Commit 81a0330d733849695d0dca52f183df26c351106b

Authored by yiming
1 parent da0cc35e

个人消息初版

Showing 43 changed files with 2307 additions and 86 deletions
ruoyi-service/src/main/java/com/ruoyi/service/controller/DepotController.java
@@ -111,28 +111,28 @@ public class DepotController extends BaseController @@ -111,28 +111,28 @@ public class DepotController extends BaseController
111 } 111 }
112 112
113 113
114 - @DeleteMapping("/delDepot/{id}")  
115 - public AjaxResult delDepot(@PathVariable Long id) 114 + @DeleteMapping("/delDepot/{ids}")
  115 + public AjaxResult delDepot(@PathVariable Long[] ids)
116 { 116 {
117 - return toAjax(depotService.delDepot(id)); 117 + return toAjax(depotService.delDepot(ids));
118 } 118 }
119 119
120 - @DeleteMapping("/delRegion/{id}")  
121 - public AjaxResult delRegion(@PathVariable Long id) 120 + @DeleteMapping("/delRegion/{ids}")
  121 + public AjaxResult delRegion(@PathVariable Long[] ids)
122 { 122 {
123 - return toAjax(depotService.delRegion(id)); 123 + return toAjax(depotService.delRegion(ids));
124 } 124 }
125 125
126 - @DeleteMapping("/deColumn/{id}")  
127 - public AjaxResult deColumn(@PathVariable Long id) 126 + @DeleteMapping("/deColumn/{ids}")
  127 + public AjaxResult deColumn(@PathVariable Long[] ids)
128 { 128 {
129 - return toAjax(depotService.deColumn(id)); 129 + return toAjax(depotService.deColumn(ids));
130 } 130 }
131 131
132 - @DeleteMapping("/delNode/{id}")  
133 - public AjaxResult delNode(@PathVariable Long id) 132 + @DeleteMapping("/delNode/{ids}")
  133 + public AjaxResult delNode(@PathVariable Long[] ids)
134 { 134 {
135 - return toAjax(depotService.delNode(id)); 135 + return toAjax(depotService.delNode(ids));
136 } 136 }
137 137
138 @GetMapping("/getDepots") 138 @GetMapping("/getDepots")
@@ -140,7 +140,7 @@ public class DepotController extends BaseController @@ -140,7 +140,7 @@ public class DepotController extends BaseController
140 { 140 {
141 AjaxResult ajax = AjaxResult.success(); 141 AjaxResult ajax = AjaxResult.success();
142 List<Depot> list = depotService.depotList(null); 142 List<Depot> list = depotService.depotList(null);
143 - ajax.put("depotOptions",list); 143 + ajax.put("depotList",list);
144 return ajax; 144 return ajax;
145 } 145 }
146 146
ruoyi-service/src/main/java/com/ruoyi/service/controller/DepotStatesController.java 0 → 100644
  1 +package com.ruoyi.service.controller;
  2 +
  3 +
  4 +import com.ruoyi.common.annotation.Log;
  5 +import com.ruoyi.common.core.controller.BaseController;
  6 +import com.ruoyi.common.core.domain.AjaxResult;
  7 +import com.ruoyi.common.core.domain.entity.SysUser;
  8 +import com.ruoyi.common.core.page.TableDataInfo;
  9 +import com.ruoyi.common.enums.BusinessType;
  10 +import com.ruoyi.common.utils.poi.ExcelUtil;
  11 +import com.ruoyi.service.domain.Depot;
  12 +import com.ruoyi.service.domain.DepotStatus;
  13 +import com.ruoyi.service.service.DepotService;
  14 +import com.ruoyi.service.service.DepotStatusService;
  15 +import org.springframework.security.access.prepost.PreAuthorize;
  16 +import org.springframework.validation.annotation.Validated;
  17 +import org.springframework.web.bind.annotation.*;
  18 +
  19 +import javax.annotation.Resource;
  20 +import javax.servlet.http.HttpServletResponse;
  21 +import java.util.List;
  22 +
  23 +
  24 +/**
  25 + * 库房状态 控制层
  26 + *
  27 + * @author ym
  28 + */
  29 +@RestController
  30 +@RequestMapping("/service/depotStatus")
  31 +public class DepotStatesController extends BaseController
  32 +{
  33 +
  34 + @Resource
  35 + private DepotStatusService depotStatusService;
  36 +
  37 + @Resource
  38 + private DepotService depotService;
  39 +
  40 + @PreAuthorize("@ss.hasPermi('service:depotStatus:add')")
  41 + @Log(title = "库房状态", businessType = BusinessType.INSERT)
  42 + @PostMapping
  43 + public AjaxResult add(@Validated @RequestBody DepotStatus depotStatus)
  44 + {
  45 + return toAjax(depotStatusService.insert(depotStatus));
  46 + }
  47 +
  48 +
  49 + @PreAuthorize("@ss.hasPermi('service:depotStatus:edit')")
  50 + @Log(title = "库房状态", businessType = BusinessType.UPDATE)
  51 + @PutMapping
  52 + public AjaxResult edit(@Validated @RequestBody DepotStatus depotStatus)
  53 + {
  54 + if (depotStatusService.update(depotStatus) > 0)
  55 + {
  56 + return AjaxResult.success();
  57 + }
  58 + return AjaxResult.error("编辑失败,请联系管理员");
  59 + }
  60 +
  61 + @PreAuthorize("@ss.hasPermi('service:depotStatus:remove')")
  62 + @Log(title = "库房状态", businessType = BusinessType.DELETE)
  63 + @DeleteMapping("/{id}")
  64 + public AjaxResult remove(@PathVariable Long id)
  65 + {
  66 + depotStatusService.delete(id);
  67 + return success();
  68 + }
  69 +
  70 + @PreAuthorize("@ss.hasPermi('service:depotStatus:list')")
  71 + @GetMapping("/list")
  72 + public TableDataInfo list(DepotStatus depotStatus)
  73 + {
  74 + startPage();
  75 + List<DepotStatus> list = depotStatusService.selectList(depotStatus);
  76 + return getDataTable(list);
  77 + }
  78 +
  79 + @Log(title = "库房状态", businessType = BusinessType.EXPORT)
  80 + @PreAuthorize("@ss.hasPermi('service:depotStatus:export')")
  81 + @PostMapping("/export")
  82 + public void export(HttpServletResponse response, DepotStatus depotStatus)
  83 + {
  84 + List<DepotStatus> list = depotStatusService.selectList(depotStatus);
  85 + ExcelUtil<DepotStatus> util = new ExcelUtil<>(DepotStatus.class);
  86 + util.exportExcel(response, list, "库房状态");
  87 + }
  88 +
  89 +}
ruoyi-service/src/main/java/com/ruoyi/service/controller/InventoryController.java
@@ -41,7 +41,10 @@ public class InventoryController extends BaseController @@ -41,7 +41,10 @@ public class InventoryController extends BaseController
41 @PostMapping 41 @PostMapping
42 public AjaxResult add(@Validated @RequestBody Inventory inventory) 42 public AjaxResult add(@Validated @RequestBody Inventory inventory)
43 { 43 {
44 - String factory=inventory.getSelectType1()+"&"+inventory.getSelectType2()+"&"+inventory.getSelectType3(); 44 + String selectType1=inventory.getSelectType1()==null?"":inventory.getSelectType1();
  45 + String selectType2=inventory.getSelectType2()==null?"":inventory.getSelectType2();
  46 + String selectType3=inventory.getSelectType3()==null?"":inventory.getSelectType3();
  47 + String factory=selectType1+"&"+selectType2+"&"+selectType3;
45 inventory.setFactor(factory); 48 inventory.setFactor(factory);
46 return toAjax(inventoryService.insert(inventory)); 49 return toAjax(inventoryService.insert(inventory));
47 } 50 }
@@ -61,10 +64,10 @@ public class InventoryController extends BaseController @@ -61,10 +64,10 @@ public class InventoryController extends BaseController
61 64
62 @PreAuthorize("@ss.hasPermi('service:inventory:remove')") 65 @PreAuthorize("@ss.hasPermi('service:inventory:remove')")
63 @Log(title = "库房盘点", businessType = BusinessType.DELETE) 66 @Log(title = "库房盘点", businessType = BusinessType.DELETE)
64 - @DeleteMapping("/{id}")  
65 - public AjaxResult remove(@PathVariable Long id) 67 + @DeleteMapping("/{ids}")
  68 + public AjaxResult remove(@PathVariable Long[] ids)
66 { 69 {
67 - inventoryService.delete(id); 70 + inventoryService.delete(ids);
68 return success(); 71 return success();
69 } 72 }
70 73
ruoyi-service/src/main/java/com/ruoyi/service/controller/MessageController.java 0 → 100644
  1 +package com.ruoyi.service.controller;
  2 +
  3 +
  4 +import com.ruoyi.common.annotation.Log;
  5 +import com.ruoyi.common.core.controller.BaseController;
  6 +import com.ruoyi.common.core.domain.AjaxResult;
  7 +import com.ruoyi.common.core.page.TableDataInfo;
  8 +import com.ruoyi.common.enums.BusinessType;
  9 +import com.ruoyi.service.domain.Message;
  10 +import com.ruoyi.service.service.MessageService;
  11 +import org.springframework.security.access.prepost.PreAuthorize;
  12 +import org.springframework.validation.annotation.Validated;
  13 +import org.springframework.web.bind.annotation.*;
  14 +import javax.annotation.Resource;
  15 +import java.util.List;
  16 +
  17 +
  18 +/**
  19 + * 消息
  20 + *
  21 + * @author ym
  22 + */
  23 +@RestController
  24 +@RequestMapping("/service/message")
  25 +public class MessageController extends BaseController
  26 +{
  27 +
  28 + @Resource
  29 + private MessageService messageService;
  30 +
  31 + @PreAuthorize("@ss.hasPermi('service:message:add')")
  32 + @Log(title = "消息", businessType = BusinessType.INSERT)
  33 + @PostMapping
  34 + public AjaxResult add(@Validated @RequestBody Message message)
  35 + {
  36 + return toAjax(messageService.insert(message));
  37 + }
  38 +
  39 +
  40 +
  41 + @PreAuthorize("@ss.hasPermi('service:message:remove')")
  42 + @Log(title = "消息", businessType = BusinessType.DELETE)
  43 + @DeleteMapping("/{ids}")
  44 + public AjaxResult remove(@PathVariable Long[] ids)
  45 + {
  46 + messageService.delete(ids);
  47 + return success();
  48 + }
  49 +
  50 + @PreAuthorize("@ss.hasPermi('service:message:list')")
  51 + @GetMapping("/list")
  52 + public TableDataInfo list(Message message)
  53 + {
  54 + startPage();
  55 + message.setUserId(getUserId());
  56 + List<Message> list = messageService.selectList(message);
  57 + return getDataTable(list);
  58 + }
  59 +
  60 + @PreAuthorize("@ss.hasPermi('service:message:edit')")
  61 + @Log(title = "消息", businessType = BusinessType.DELETE)
  62 + @DeleteMapping("read/{ids}")
  63 + public AjaxResult read(@PathVariable Long[] ids)
  64 + {
  65 + messageService.read(ids);
  66 + return success();
  67 + }
  68 +
  69 + @PreAuthorize("@ss.hasPermi('service:message:list')")
  70 + @GetMapping("/count")
  71 + public int count()
  72 + {
  73 + Message message=new Message();
  74 + message.setUserId(getUserId());
  75 + return messageService.selectCount(message);
  76 + }
  77 +
  78 +}
ruoyi-service/src/main/java/com/ruoyi/service/controller/SafetyController.java 0 → 100644
  1 +package com.ruoyi.service.controller;
  2 +
  3 +
  4 +import com.ruoyi.common.annotation.Log;
  5 +import com.ruoyi.common.core.controller.BaseController;
  6 +import com.ruoyi.common.core.domain.AjaxResult;
  7 +import com.ruoyi.common.core.domain.entity.SysDept;
  8 +import com.ruoyi.common.core.page.TableDataInfo;
  9 +import com.ruoyi.common.enums.BusinessType;
  10 +import com.ruoyi.service.domain.Inventory;
  11 +import com.ruoyi.service.domain.Safety;
  12 +import com.ruoyi.service.domain.SafetyDetail;
  13 +import com.ruoyi.service.domain.Tree;
  14 +import com.ruoyi.service.service.InventoryService;
  15 +import com.ruoyi.service.service.SafetyService;
  16 +import org.springframework.security.access.prepost.PreAuthorize;
  17 +import org.springframework.validation.annotation.Validated;
  18 +import org.springframework.web.bind.annotation.*;
  19 +
  20 +import javax.annotation.Resource;
  21 +import java.util.List;
  22 +
  23 +
  24 +/**
  25 + * 安全检查
  26 + *
  27 + * @author ym
  28 + */
  29 +@RestController
  30 +@RequestMapping("/service/safety")
  31 +public class SafetyController extends BaseController
  32 +{
  33 +
  34 + @Resource
  35 + private SafetyService safetyService;
  36 +
  37 + @GetMapping("/treeselect")
  38 + public AjaxResult treeselect(SysDept dept)
  39 + {
  40 + List<Tree> tree=safetyService.treeSelect();
  41 + return AjaxResult.success(tree);
  42 + }
  43 +
  44 + @PreAuthorize("@ss.hasPermi('service:safety:add')")
  45 + @Log(title = "安全检查", businessType = BusinessType.INSERT)
  46 + @PostMapping
  47 + public AjaxResult add(@Validated @RequestBody Safety safety)
  48 + {
  49 + return toAjax(safetyService.insert(safety));
  50 + }
  51 +
  52 +
  53 + @PreAuthorize("@ss.hasPermi('service:safety:edit')")
  54 + @Log(title = "安全检查", businessType = BusinessType.UPDATE)
  55 + @PutMapping
  56 + public AjaxResult edit(@Validated @RequestBody Safety safety)
  57 + {
  58 + if (safetyService.update(safety) > 0)
  59 + {
  60 + return AjaxResult.success();
  61 + }
  62 + return AjaxResult.error("编辑失败,请联系管理员");
  63 + }
  64 +
  65 + @PreAuthorize("@ss.hasPermi('service:safety:remove')")
  66 + @Log(title = "安全检查", businessType = BusinessType.DELETE)
  67 + @DeleteMapping("/{id}")
  68 + public AjaxResult remove(@PathVariable Long id)
  69 + {
  70 + safetyService.delete(id);
  71 + return success();
  72 + }
  73 +
  74 + @PreAuthorize("@ss.hasPermi('service:safety:list')")
  75 + @GetMapping("/list")
  76 + public TableDataInfo list(Safety safety)
  77 + {
  78 + startPage();
  79 + List<Safety> list = safetyService.selectList(safety);
  80 + return getDataTable(list);
  81 + }
  82 +
  83 + @PreAuthorize("@ss.hasPermi('service:safetyDetail:add')")
  84 + @Log(title = "安全检查详情", businessType = BusinessType.INSERT)
  85 + @PostMapping("/addDetail")
  86 + public AjaxResult addDetail(@Validated @RequestBody SafetyDetail safetyDetail)
  87 + {
  88 + return toAjax(safetyService.insertDetail(safetyDetail));
  89 + }
  90 +
  91 + @PreAuthorize("@ss.hasPermi('service:safetyDetail:list')")
  92 + @GetMapping("/detailList")
  93 + public TableDataInfo detailList(SafetyDetail safetyDetail)
  94 + {
  95 + List<SafetyDetail> list = safetyService.selectDetailList(safetyDetail);
  96 + return getDataTable(list);
  97 + }
  98 +}
ruoyi-service/src/main/java/com/ruoyi/service/domain/DepotStatus.java 0 → 100644
  1 +package com.ruoyi.service.domain;
  2 +
  3 +
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import com.ruoyi.common.annotation.Excel;
  6 +import com.ruoyi.common.core.domain.BaseEntity;
  7 +
  8 +import java.util.Date;
  9 +
  10 +
  11 +/**
  12 + * 库房状态 depot_states
  13 + *
  14 + * @author ym
  15 + */
  16 +public class DepotStatus extends BaseEntity
  17 +{
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /** 主键 */
  21 + private Long id;
  22 +
  23 + /** 监测点 */
  24 + private Long depotId;
  25 +
  26 + @Excel(name = "监测点")
  27 + private String depotName;
  28 +
  29 + /** 监测时间 */
  30 + @Excel(name = "监测时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
  31 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  32 + private Date checkTime;
  33 +
  34 + /** 湿度 */
  35 + @Excel(name = "湿度%")
  36 + private int humidity;
  37 +
  38 + /** 温度 */
  39 + @Excel(name = "温度°C")
  40 + private int temperature;
  41 +
  42 + /** 采取措施 */
  43 + @Excel(name = "采取措施")
  44 + private String mark;
  45 +
  46 +
  47 + public Long getId() {
  48 + return id;
  49 + }
  50 +
  51 + public void setId(Long id) {
  52 + this.id = id;
  53 + }
  54 +
  55 + public String getDepotName() {
  56 + return depotName;
  57 + }
  58 +
  59 + public void setDepotName(String depotName) {
  60 + this.depotName = depotName;
  61 + }
  62 +
  63 + public Long getDepotId() {
  64 + return depotId;
  65 + }
  66 +
  67 + public void setDepotId(Long depotId) {
  68 + this.depotId = depotId;
  69 + }
  70 +
  71 + public Date getCheckTime() {
  72 + return checkTime;
  73 + }
  74 +
  75 + public void setCheckTime(Date checkTime) {
  76 + this.checkTime = checkTime;
  77 + }
  78 +
  79 + public int getHumidity() {
  80 + return humidity;
  81 + }
  82 +
  83 + public void setHumidity(int humidity) {
  84 + this.humidity = humidity;
  85 + }
  86 +
  87 + public int getTemperature() {
  88 + return temperature;
  89 + }
  90 +
  91 + public void setTemperature(int temperature) {
  92 + this.temperature = temperature;
  93 + }
  94 +
  95 + public String getMark() {
  96 + return mark;
  97 + }
  98 +
  99 + public void setMark(String mark) {
  100 + this.mark = mark;
  101 + }
  102 +}
ruoyi-service/src/main/java/com/ruoyi/service/domain/Archives.java renamed to ruoyi-service/src/main/java/com/ruoyi/service/domain/General.java
@@ -7,11 +7,11 @@ import com.ruoyi.common.core.domain.BaseEntity; @@ -7,11 +7,11 @@ import com.ruoyi.common.core.domain.BaseEntity;
7 7
8 8
9 /** 9 /**
10 - * 库房-节点 sys_job 10 + * sys_job
11 * 11 *
12 * @author ym 12 * @author ym
13 */ 13 */
14 -public class Archives extends BaseEntity 14 +public class General extends BaseEntity
15 { 15 {
16 private static final long serialVersionUID = 1L; 16 private static final long serialVersionUID = 1L;
17 17
ruoyi-service/src/main/java/com/ruoyi/service/domain/Message.java 0 → 100644
  1 +package com.ruoyi.service.domain;
  2 +
  3 +
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import com.ruoyi.common.core.domain.BaseEntity;
  6 +
  7 +import java.util.Date;
  8 +
  9 +
  10 +/**
  11 + * 消息 message
  12 + *
  13 + * @author ym
  14 + */
  15 +public class Message extends BaseEntity
  16 +{
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 +
  20 + private Long id;
  21 +
  22 + private Long userId;
  23 +
  24 + private String message;
  25 +
  26 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  27 + private Date createTime;
  28 +
  29 + /** 状态 1未读 2已读 */
  30 + private int messageState;
  31 +
  32 + public Long getId() {
  33 + return id;
  34 + }
  35 +
  36 + public void setId(Long id) {
  37 + this.id = id;
  38 + }
  39 +
  40 + public Long getUserId() {
  41 + return userId;
  42 + }
  43 +
  44 + public void setUserId(Long userId) {
  45 + this.userId = userId;
  46 + }
  47 +
  48 + public String getMessage() {
  49 + return message;
  50 + }
  51 +
  52 + public void setMessage(String message) {
  53 + this.message = message;
  54 + }
  55 +
  56 + @Override
  57 + public Date getCreateTime() {
  58 + return createTime;
  59 + }
  60 +
  61 + @Override
  62 + public void setCreateTime(Date createTime) {
  63 + this.createTime = createTime;
  64 + }
  65 +
  66 + public int getMessageState() {
  67 + return messageState;
  68 + }
  69 +
  70 + public void setMessageState(int messageState) {
  71 + this.messageState = messageState;
  72 + }
  73 +}
ruoyi-service/src/main/java/com/ruoyi/service/domain/Safety.java 0 → 100644
  1 +package com.ruoyi.service.domain;
  2 +
  3 +
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import com.ruoyi.common.annotation.Excel;
  6 +import com.ruoyi.common.core.domain.BaseEntity;
  7 +
  8 +import java.util.Date;
  9 +
  10 +
  11 +/**
  12 + * 安全检查 safety
  13 + *
  14 + * @author ym
  15 + */
  16 +public class Safety extends BaseEntity
  17 +{
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /** 主键 */
  21 + private Long id;
  22 +
  23 + /** 库房主键 */
  24 + private Long depotId;
  25 +
  26 + /** 检查时间 */
  27 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  28 + private Date checkTime;
  29 +
  30 + /** 检查人 */
  31 + private String checkUser;
  32 +
  33 + /** 检查描述 */
  34 + private String mark;
  35 +
  36 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  37 + private Date createTime;
  38 +
  39 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  40 + private Date updateTime;
  41 +
  42 +
  43 + public Long getId() {
  44 + return id;
  45 + }
  46 +
  47 + public void setId(Long id) {
  48 + this.id = id;
  49 + }
  50 +
  51 + public Long getDepotId() {
  52 + return depotId;
  53 + }
  54 +
  55 + public void setDepotId(Long depotId) {
  56 + this.depotId = depotId;
  57 + }
  58 +
  59 + public Date getCheckTime() {
  60 + return checkTime;
  61 + }
  62 +
  63 + public void setCheckTime(Date checkTime) {
  64 + this.checkTime = checkTime;
  65 + }
  66 +
  67 + public String getCheckUser() {
  68 + return checkUser;
  69 + }
  70 +
  71 + public void setCheckUser(String checkUser) {
  72 + this.checkUser = checkUser;
  73 + }
  74 +
  75 + public String getMark() {
  76 + return mark;
  77 + }
  78 +
  79 + public void setMark(String mark) {
  80 + this.mark = mark;
  81 + }
  82 +
  83 + @Override
  84 + public Date getCreateTime() {
  85 + return createTime;
  86 + }
  87 +
  88 + @Override
  89 + public void setCreateTime(Date createTime) {
  90 + this.createTime = createTime;
  91 + }
  92 +
  93 + @Override
  94 + public Date getUpdateTime() {
  95 + return updateTime;
  96 + }
  97 +
  98 + @Override
  99 + public void setUpdateTime(Date updateTime) {
  100 + this.updateTime = updateTime;
  101 + }
  102 +}
ruoyi-service/src/main/java/com/ruoyi/service/domain/SafetyDetail.java 0 → 100644
  1 +package com.ruoyi.service.domain;
  2 +
  3 +
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import com.ruoyi.common.core.domain.BaseEntity;
  6 +
  7 +import java.util.Date;
  8 +
  9 +
  10 +/**
  11 + * 安全检查明细 safety_detail
  12 + *
  13 + * @author ym
  14 + */
  15 +public class SafetyDetail extends BaseEntity
  16 +{
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /** 主键 */
  20 + private Long id;
  21 +
  22 + /** 安全检查表主键 */
  23 + private Long safetyId;
  24 +
  25 + /** 检查项 */
  26 + private int checkType;
  27 +
  28 + /** 检查情况 */
  29 + private int state;
  30 +
  31 + /** 措施 */
  32 + private int measures;
  33 +
  34 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  35 + private Date createTime;
  36 +
  37 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  38 + private Date updateTime;
  39 +
  40 + public Long getId() {
  41 + return id;
  42 + }
  43 +
  44 + public void setId(Long id) {
  45 + this.id = id;
  46 + }
  47 +
  48 + public Long getSafetyId() {
  49 + return safetyId;
  50 + }
  51 +
  52 + public void setSafetyId(Long safetyId) {
  53 + this.safetyId = safetyId;
  54 + }
  55 +
  56 + public int getCheckType() {
  57 + return checkType;
  58 + }
  59 +
  60 + public void setCheckType(int checkType) {
  61 + this.checkType = checkType;
  62 + }
  63 +
  64 + public int getState() {
  65 + return state;
  66 + }
  67 +
  68 + public void setState(int state) {
  69 + this.state = state;
  70 + }
  71 +
  72 + public int getMeasures() {
  73 + return measures;
  74 + }
  75 +
  76 + public void setMeasures(int measures) {
  77 + this.measures = measures;
  78 + }
  79 +
  80 + @Override
  81 + public Date getCreateTime() {
  82 + return createTime;
  83 + }
  84 +
  85 + @Override
  86 + public void setCreateTime(Date createTime) {
  87 + this.createTime = createTime;
  88 + }
  89 +
  90 + @Override
  91 + public Date getUpdateTime() {
  92 + return updateTime;
  93 + }
  94 +
  95 + @Override
  96 + public void setUpdateTime(Date updateTime) {
  97 + this.updateTime = updateTime;
  98 + }
  99 +}
ruoyi-service/src/main/java/com/ruoyi/service/mapper/DepotMapper.java
@@ -11,7 +11,7 @@ import java.util.List; @@ -11,7 +11,7 @@ import java.util.List;
11 */ 11 */
12 public interface DepotMapper 12 public interface DepotMapper
13 { 13 {
14 - List<Archives> selectArchivesAll(); 14 + List<General> selectGeneralAll();
15 List<Depot> selectDepot(Depot depot); 15 List<Depot> selectDepot(Depot depot);
16 List<Column> selectColumn(Column column); 16 List<Column> selectColumn(Column column);
17 List<Region> selectRegion(Region region); 17 List<Region> selectRegion(Region region);
@@ -25,9 +25,9 @@ public interface DepotMapper @@ -25,9 +25,9 @@ public interface DepotMapper
25 int updateDepot(Depot depot); 25 int updateDepot(Depot depot);
26 int updateRegion(Region region); 26 int updateRegion(Region region);
27 int updateColumn(Column column); 27 int updateColumn(Column column);
28 - int delDepot(Long id);  
29 - int delRegion(Long id);  
30 - int deColumn(Long id);  
31 - int delNode(Long id); 28 + int delDepot(Long[] ids);
  29 + int delRegion(Long[] ids);
  30 + int deColumn(Long[] ids);
  31 + int delNode(Long[] ids);
32 Depot getDepot(Depot depot); 32 Depot getDepot(Depot depot);
33 } 33 }
ruoyi-service/src/main/java/com/ruoyi/service/mapper/DepotStatusMapper.java 0 → 100644
  1 +package com.ruoyi.service.mapper;
  2 +
  3 +import com.ruoyi.service.domain.DepotStatus;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 库房状态 数据层
  9 + *
  10 + * @author ym
  11 + */
  12 +public interface DepotStatusMapper
  13 +{
  14 + int insert(DepotStatus depotStatus);
  15 + int update(DepotStatus depotStatus);
  16 + int delete(Long id);
  17 + List<DepotStatus> selectList(DepotStatus depotStatus);
  18 +}
ruoyi-service/src/main/java/com/ruoyi/service/mapper/InventoryMapper.java
@@ -13,6 +13,6 @@ public interface InventoryMapper @@ -13,6 +13,6 @@ public interface InventoryMapper
13 { 13 {
14 int insert(Inventory inventory); 14 int insert(Inventory inventory);
15 int update(Inventory inventory); 15 int update(Inventory inventory);
16 - int delete(Long id); 16 + int delete(Long[] ids);
17 List<Inventory> selectList(Inventory inventory); 17 List<Inventory> selectList(Inventory inventory);
18 } 18 }
ruoyi-service/src/main/java/com/ruoyi/service/mapper/MessageMapper.java 0 → 100644
  1 +package com.ruoyi.service.mapper;
  2 +
  3 +
  4 +import com.ruoyi.service.domain.Message;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 消息 数据层
  9 + *
  10 + * @author ym
  11 + */
  12 +public interface MessageMapper
  13 +{
  14 + int insert(Message message);
  15 + int read(Long[] ids);
  16 + int delete(Long[] ids);
  17 + List<Message> selectList(Message message);
  18 + int selectCount(Message message);
  19 +}
ruoyi-service/src/main/java/com/ruoyi/service/mapper/SafetyDetailMapper.java 0 → 100644
  1 +package com.ruoyi.service.mapper;
  2 +
  3 +import com.ruoyi.service.domain.SafetyDetail;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 安全檢查 数据层
  9 + *
  10 + * @author ym
  11 + */
  12 +public interface SafetyDetailMapper
  13 +{
  14 + int insert(SafetyDetail safetyDetail);
  15 + List<SafetyDetail> selectList(SafetyDetail safetyDetail);
  16 +}
ruoyi-service/src/main/java/com/ruoyi/service/mapper/SafetyMapper.java 0 → 100644
  1 +package com.ruoyi.service.mapper;
  2 +
  3 +import com.ruoyi.service.domain.Inventory;
  4 +import com.ruoyi.service.domain.Safety;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * 安全檢查 数据层
  10 + *
  11 + * @author ym
  12 + */
  13 +public interface SafetyMapper
  14 +{
  15 + int insert(Safety safety);
  16 + int update(Safety safety);
  17 + int delete(Long id);
  18 + List<Safety> selectList(Safety safety);
  19 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/DepotService.java
@@ -38,13 +38,13 @@ public interface DepotService @@ -38,13 +38,13 @@ public interface DepotService
38 38
39 AjaxResult updColumn(JSONObject jsonObject); 39 AjaxResult updColumn(JSONObject jsonObject);
40 40
41 - int delDepot(Long id); 41 + int delDepot(Long[] ids);
42 42
43 - int delRegion(Long id); 43 + int delRegion(Long[] ids);
44 44
45 - int deColumn(Long id); 45 + int deColumn(Long[] ids);
46 46
47 - int delNode(Long id); 47 + int delNode(Long[] ids);
48 48
49 49
50 } 50 }
ruoyi-service/src/main/java/com/ruoyi/service/service/DepotStatusService.java 0 → 100644
  1 +package com.ruoyi.service.service;
  2 +
  3 +
  4 +import com.ruoyi.service.domain.DepotStatus;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 库房状态 服务层
  9 + *
  10 + * @author ym
  11 + */
  12 +public interface DepotStatusService
  13 +{
  14 + int insert(DepotStatus depotStatus);
  15 + int update(DepotStatus depotStatus);
  16 + int delete(Long id);
  17 + List<DepotStatus> selectList(DepotStatus depotStatus);
  18 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/InventoryService.java
@@ -14,6 +14,6 @@ public interface InventoryService @@ -14,6 +14,6 @@ public interface InventoryService
14 { 14 {
15 int insert(Inventory inventory); 15 int insert(Inventory inventory);
16 int update(Inventory inventory); 16 int update(Inventory inventory);
17 - int delete(Long id); 17 + int delete(Long[] ids);
18 List<Inventory> selectList(Inventory inventory); 18 List<Inventory> selectList(Inventory inventory);
19 } 19 }
ruoyi-service/src/main/java/com/ruoyi/service/service/MessageService.java 0 → 100644
  1 +package com.ruoyi.service.service;
  2 +
  3 +
  4 +import com.ruoyi.service.domain.Inventory;
  5 +import com.ruoyi.service.domain.Message;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 消息 服务层
  11 + *
  12 + * @author ym
  13 + */
  14 +public interface MessageService
  15 +{
  16 + int insert(Message message);
  17 + int read(Long[] ids);
  18 + int delete(Long[] ids);
  19 + List<Message> selectList(Message message);
  20 + int selectCount(Message message);
  21 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/SafetyService.java 0 → 100644
  1 +package com.ruoyi.service.service;
  2 +
  3 +
  4 +import com.ruoyi.service.domain.Inventory;
  5 +import com.ruoyi.service.domain.Safety;
  6 +import com.ruoyi.service.domain.SafetyDetail;
  7 +import com.ruoyi.service.domain.Tree;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 安全检查 服务层
  13 + *
  14 + * @author ym
  15 + */
  16 +public interface SafetyService
  17 +{
  18 + List<Tree> treeSelect();
  19 + int insert(Safety safety);
  20 + int update(Safety safety);
  21 + int delete(Long id);
  22 + List<Safety> selectList(Safety safety);
  23 + int insertDetail(SafetyDetail safetyDetail);
  24 + List<SafetyDetail> selectDetailList(SafetyDetail safetyDetail);
  25 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/DepotServiceImpl.java
1 package com.ruoyi.service.service.impl; 1 package com.ruoyi.service.service.impl;
2 2
3 import com.alibaba.fastjson2.JSONObject; 3 import com.alibaba.fastjson2.JSONObject;
4 -import com.ruoyi.common.constant.UserConstants;  
5 import com.ruoyi.common.core.domain.AjaxResult; 4 import com.ruoyi.common.core.domain.AjaxResult;
6 -import com.ruoyi.common.core.domain.entity.SysDept;  
7 import com.ruoyi.common.utils.StringUtils; 5 import com.ruoyi.common.utils.StringUtils;
8 import com.ruoyi.service.domain.*; 6 import com.ruoyi.service.domain.*;
9 import com.ruoyi.service.mapper.DepotMapper; 7 import com.ruoyi.service.mapper.DepotMapper;
10 import com.ruoyi.service.service.DepotService; 8 import com.ruoyi.service.service.DepotService;
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
13 10
14 import javax.annotation.Resource; 11 import javax.annotation.Resource;
@@ -29,10 +26,10 @@ public class DepotServiceImpl implements DepotService @@ -29,10 +26,10 @@ public class DepotServiceImpl implements DepotService
29 @Override 26 @Override
30 public List<Tree> treeSelect(){ 27 public List<Tree> treeSelect(){
31 Set<Tree> set=new HashSet<>(); 28 Set<Tree> set=new HashSet<>();
32 - List<Archives> archives=depotMapper.selectArchivesAll();  
33 - archives.forEach(archive -> {  
34 - String id="a"+archive.getId();  
35 - Tree tree=new Tree(0,archive.getId(),id,"0",archive.getName()); 29 + List<General> generals=depotMapper.selectGeneralAll();
  30 + generals.forEach(general -> {
  31 + String id="a"+general.getId();
  32 + Tree tree=new Tree(0,general.getId(),id,"0",general.getName());
36 set.add(tree); 33 set.add(tree);
37 }); 34 });
38 35
@@ -175,27 +172,27 @@ public class DepotServiceImpl implements DepotService @@ -175,27 +172,27 @@ public class DepotServiceImpl implements DepotService
175 } 172 }
176 173
177 @Override 174 @Override
178 - public int delDepot(Long id){  
179 - return depotMapper.delDepot(id); 175 + public int delDepot(Long[] ids){
  176 + return depotMapper.delDepot(ids);
180 } 177 }
181 178
182 @Override 179 @Override
183 - public int delRegion(Long id){  
184 - return depotMapper.delRegion(id); 180 + public int delRegion(Long[] ids){
  181 + return depotMapper.delRegion(ids);
185 } 182 }
186 183
187 @Override 184 @Override
188 - public int deColumn(Long id){  
189 - return depotMapper.deColumn(id); 185 + public int deColumn(Long[] ids){
  186 + return depotMapper.deColumn(ids);
190 } 187 }
191 188
192 @Override 189 @Override
193 - public int delNode(Long id){  
194 - return depotMapper.delNode(id); 190 + public int delNode(Long[] ids){
  191 + return depotMapper.delNode(ids);
195 } 192 }
196 193
197 194
198 - public List<Tree> buildTree(List<Tree> treeList) 195 + public static List<Tree> buildTree(List<Tree> treeList)
199 { 196 {
200 List<Tree> returnList = new ArrayList<>(); 197 List<Tree> returnList = new ArrayList<>();
201 List<String> tempList = new ArrayList<>(); 198 List<String> tempList = new ArrayList<>();
@@ -219,7 +216,7 @@ public class DepotServiceImpl implements DepotService @@ -219,7 +216,7 @@ public class DepotServiceImpl implements DepotService
219 return returnList; 216 return returnList;
220 } 217 }
221 218
222 - private void recursionFn(List<Tree> list, Tree t) 219 + private static void recursionFn(List<Tree> list, Tree t)
223 { 220 {
224 // 得到子节点列表 221 // 得到子节点列表
225 List<Tree> childList = getChildList(list, t); 222 List<Tree> childList = getChildList(list, t);
@@ -233,7 +230,7 @@ public class DepotServiceImpl implements DepotService @@ -233,7 +230,7 @@ public class DepotServiceImpl implements DepotService
233 } 230 }
234 } 231 }
235 232
236 - private List<Tree> getChildList(List<Tree> list, Tree t) 233 + private static List<Tree> getChildList(List<Tree> list, Tree t)
237 { 234 {
238 List<Tree> tlist = new ArrayList<>(); 235 List<Tree> tlist = new ArrayList<>();
239 Iterator<Tree> it = list.iterator(); 236 Iterator<Tree> it = list.iterator();
@@ -251,7 +248,7 @@ public class DepotServiceImpl implements DepotService @@ -251,7 +248,7 @@ public class DepotServiceImpl implements DepotService
251 /** 248 /**
252 * 判断是否有子节点 249 * 判断是否有子节点
253 */ 250 */
254 - private boolean hasChild(List<Tree> list, Tree t) 251 + private static boolean hasChild(List<Tree> list, Tree t)
255 { 252 {
256 return getChildList(list, t).size() > 0; 253 return getChildList(list, t).size() > 0;
257 } 254 }
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/DepotStatusServiceImpl.java 0 → 100644
  1 +package com.ruoyi.service.service.impl;
  2 +
  3 +import com.ruoyi.service.domain.*;
  4 +import com.ruoyi.service.mapper.DepotStatusMapper;
  5 +import com.ruoyi.service.service.DepotStatusService;
  6 +import org.springframework.stereotype.Service;
  7 +import javax.annotation.Resource;
  8 +import java.util.List;
  9 +
  10 +
  11 +/**
  12 + * 库房状态 服务实现
  13 + *
  14 + * @author ym
  15 + */
  16 +@Service
  17 +public class DepotStatusServiceImpl implements DepotStatusService
  18 +{
  19 + @Resource
  20 + private DepotStatusMapper depotStatusMapper;
  21 +
  22 + @Override
  23 + public int insert(DepotStatus depotStatus) {
  24 + return depotStatusMapper.insert(depotStatus);
  25 + }
  26 +
  27 + @Override
  28 + public int update(DepotStatus depotStatus) {
  29 + return depotStatusMapper.update(depotStatus);
  30 + }
  31 +
  32 + @Override
  33 + public int delete(Long id) {
  34 + return depotStatusMapper.delete(id);
  35 + }
  36 +
  37 + @Override
  38 + public List<DepotStatus> selectList(DepotStatus depotStatus) {
  39 + return depotStatusMapper.selectList(depotStatus);
  40 + }
  41 +
  42 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/InventoryServiceImpl.java
@@ -37,8 +37,8 @@ public class InventoryServiceImpl implements InventoryService @@ -37,8 +37,8 @@ public class InventoryServiceImpl implements InventoryService
37 } 37 }
38 38
39 @Override 39 @Override
40 - public int delete(Long id) {  
41 - return inventoryMapper.delete(id); 40 + public int delete(Long[] ids) {
  41 + return inventoryMapper.delete(ids);
42 } 42 }
43 43
44 @Override 44 @Override
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/MessageServiceImpl.java 0 → 100644
  1 +package com.ruoyi.service.service.impl;
  2 +
  3 +import com.ruoyi.service.domain.Message;
  4 +import com.ruoyi.service.mapper.MessageMapper;
  5 +import com.ruoyi.service.service.MessageService;
  6 +import org.springframework.stereotype.Service;
  7 +import javax.annotation.Resource;
  8 +import java.util.List;
  9 +
  10 +
  11 +/**
  12 + * 消息 服务实现
  13 + *
  14 + * @author ym
  15 + */
  16 +@Service
  17 +public class MessageServiceImpl implements MessageService
  18 +{
  19 + @Resource
  20 + private MessageMapper messageMapper;
  21 +
  22 +
  23 + @Override
  24 + public int insert(Message message) {
  25 + return messageMapper.insert(message);
  26 + }
  27 +
  28 + @Override
  29 + public int read(Long[] ids) {
  30 + return messageMapper.read(ids);
  31 + }
  32 +
  33 + @Override
  34 + public int delete(Long[] ids) {
  35 + return messageMapper.delete(ids);
  36 + }
  37 +
  38 + @Override
  39 + public List<Message> selectList(Message message) {
  40 + return messageMapper.selectList(message);
  41 + }
  42 +
  43 + @Override
  44 + public int selectCount(Message message) {
  45 + return messageMapper.selectCount(message);
  46 + }
  47 +}
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/SafetyServiceImpl.java 0 → 100644
  1 +package com.ruoyi.service.service.impl;
  2 +
  3 +import com.ruoyi.service.domain.*;
  4 +import com.ruoyi.service.mapper.DepotMapper;
  5 +import com.ruoyi.service.mapper.SafetyDetailMapper;
  6 +import com.ruoyi.service.mapper.SafetyMapper;
  7 +import com.ruoyi.service.service.SafetyService;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import javax.annotation.Resource;
  11 +import java.util.ArrayList;
  12 +import java.util.HashSet;
  13 +import java.util.List;
  14 +import java.util.Set;
  15 +
  16 +
  17 +/**
  18 + * 安全检查 服务实现
  19 + *
  20 + * @author ym
  21 + */
  22 +@Service
  23 +public class SafetyServiceImpl implements SafetyService
  24 +{
  25 + @Resource
  26 + private SafetyMapper safetyMapper;
  27 +
  28 + @Resource
  29 + private DepotMapper depotMapper;
  30 +
  31 + @Resource
  32 + private SafetyDetailMapper safetyDetailMapper;
  33 +
  34 +
  35 + @Override
  36 + public List<Tree> treeSelect(){
  37 + Set<Tree> set=new HashSet<>();
  38 + List<General> generals=depotMapper.selectGeneralAll();
  39 + generals.forEach(general -> {
  40 + String id="a"+general.getId();
  41 + Tree tree=new Tree(0,general.getId(),id,"0",general.getName());
  42 + set.add(tree);
  43 + });
  44 +
  45 + List<Depot> depots=depotMapper.selectDepot(null);
  46 + depots.forEach(depot -> {
  47 + String id="d"+depot.getId();
  48 + String parentId="a"+depot.getParentId();
  49 + Tree tree=new Tree(1,depot.getId(),id,parentId,depot.getName());
  50 + set.add(tree);
  51 + });
  52 + List<Tree> list=new ArrayList<>();
  53 + set.forEach(tree -> {
  54 + list.add(tree);
  55 + });
  56 + List<Tree> treeList =DepotServiceImpl.buildTree(list);
  57 + return treeList;
  58 + }
  59 +
  60 + @Override
  61 + public int insert(Safety safety) {
  62 + return safetyMapper.insert(safety);
  63 + }
  64 +
  65 + @Override
  66 + public int update(Safety safety) {
  67 + return safetyMapper.update(safety);
  68 + }
  69 +
  70 + @Override
  71 + public int delete(Long id) {
  72 + return safetyMapper.delete(id);
  73 + }
  74 +
  75 + @Override
  76 + public List<Safety> selectList(Safety safety) {
  77 + return safetyMapper.selectList(safety);
  78 + }
  79 +
  80 + @Override
  81 + public int insertDetail(SafetyDetail safetyDetail) {
  82 + return safetyDetailMapper.insert(safetyDetail);
  83 + }
  84 +
  85 + @Override
  86 + public List<SafetyDetail> selectDetailList(SafetyDetail safetyDetail) {
  87 + return safetyDetailMapper.selectList(safetyDetail);
  88 + }
  89 +
  90 +}
ruoyi-service/src/main/resources/mapper/sevice/DepotMapper.xml
@@ -4,8 +4,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -4,8 +4,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.ruoyi.service.mapper.DepotMapper"> 5 <mapper namespace="com.ruoyi.service.mapper.DepotMapper">
6 6
7 - <select id="selectArchivesAll" resultType="com.ruoyi.service.domain.Archives">  
8 - select * from archives 7 + <select id="selectGeneralAll" resultType="com.ruoyi.service.domain.General">
  8 + select * from general
9 </select> 9 </select>
10 10
11 <select id="selectDepot" parameterType="com.ruoyi.service.domain.Depot" resultType="com.ruoyi.service.domain.Depot"> 11 <select id="selectDepot" parameterType="com.ruoyi.service.domain.Depot" resultType="com.ruoyi.service.domain.Depot">
@@ -33,15 +33,14 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -33,15 +33,14 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
33 </select> 33 </select>
34 34
35 <select id="selectColumn" resultType="com.ruoyi.service.domain.Column" parameterType="com.ruoyi.service.domain.Column"> 35 <select id="selectColumn" resultType="com.ruoyi.service.domain.Column" parameterType="com.ruoyi.service.domain.Column">
36 - select * from depot_column  
37 - <where>  
38 - <if test="id != null and id != ''">  
39 - AND id =#{id}  
40 - </if>  
41 - <if test="parentId != null and parentId != ''">  
42 - AND parentId =#{parentId}  
43 - </if>  
44 - </where> 36 + select a.*,b.regionName from depot_column a,depot_region b
  37 + where a.parentId=b.id
  38 + <if test="id != null and id != ''">
  39 + AND a.id =#{id}
  40 + </if>
  41 + <if test="parentId != null and parentId != ''">
  42 + AND a.parentId =#{parentId}
  43 + </if>
45 </select> 44 </select>
46 45
47 <select id="selectNode" resultType="com.ruoyi.service.domain.Node" parameterType="com.ruoyi.service.domain.Node"> 46 <select id="selectNode" resultType="com.ruoyi.service.domain.Node" parameterType="com.ruoyi.service.domain.Node">
@@ -114,7 +113,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -114,7 +113,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
114 <insert id="insertColumn" parameterType="com.ruoyi.service.domain.Column"> 113 <insert id="insertColumn" parameterType="com.ruoyi.service.domain.Column">
115 insert into depot_column( 114 insert into depot_column(
116 <if test="parentId != null and parentId != ''">parentId,</if> 115 <if test="parentId != null and parentId != ''">parentId,</if>
117 - <if test="regionName != null and regionName != ''">regionName,</if>  
118 <if test="type != null and type != ''">type,</if> 116 <if test="type != null and type != ''">type,</if>
119 <if test="surfaceType != null and surfaceType != ''">surfaceType,</if> 117 <if test="surfaceType != null and surfaceType != ''">surfaceType,</if>
120 <if test="columnNo != null and columnNo != ''">columnNo,</if> 118 <if test="columnNo != null and columnNo != ''">columnNo,</if>
@@ -128,7 +126,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -128,7 +126,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
128 createTime 126 createTime
129 )values( 127 )values(
130 <if test="parentId != null and parentId != ''">#{parentId},</if> 128 <if test="parentId != null and parentId != ''">#{parentId},</if>
131 - <if test="regionName != null and regionName != ''">#{regionName},</if>  
132 <if test="type != null and type != ''">#{type},</if> 129 <if test="type != null and type != ''">#{type},</if>
133 <if test="surfaceType != null and surfaceType != ''">#{surfaceType},</if> 130 <if test="surfaceType != null and surfaceType != ''">#{surfaceType},</if>
134 <if test="columnNo != null and columnNo != ''">#{columnNo},</if> 131 <if test="columnNo != null and columnNo != ''">#{columnNo},</if>
@@ -215,19 +212,31 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -215,19 +212,31 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
215 </select> 212 </select>
216 213
217 <delete id="delDepot" parameterType="Long"> 214 <delete id="delDepot" parameterType="Long">
218 - delete from depot where id = #{id} 215 + delete from depot where id id in
  216 + <foreach collection="array" item="id" open="(" separator="," close=")">
  217 + #{id}
  218 + </foreach>
219 </delete> 219 </delete>
220 220
221 <delete id="delRegion" parameterType="Long"> 221 <delete id="delRegion" parameterType="Long">
222 - delete from depot_region where id = #{id} 222 + delete from depot_region where id in
  223 + <foreach collection="array" item="id" open="(" separator="," close=")">
  224 + #{id}
  225 + </foreach>
223 </delete> 226 </delete>
224 227
225 <delete id="delColumn" parameterType="Long"> 228 <delete id="delColumn" parameterType="Long">
226 - delete from depot_column where id = #{id} 229 + delete from depot_column where id in
  230 + <foreach collection="array" item="id" open="(" separator="," close=")">
  231 + #{id}
  232 + </foreach>
227 </delete> 233 </delete>
228 234
229 <delete id="delNode" parameterType="Long"> 235 <delete id="delNode" parameterType="Long">
230 - delete from depot_node where id = #{id} 236 + delete from depot_node where id in
  237 + <foreach collection="array" item="id" open="(" separator="," close=")">
  238 + #{id}
  239 + </foreach>
231 </delete> 240 </delete>
232 241
233 242
ruoyi-service/src/main/resources/mapper/sevice/DepotStatusMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.service.mapper.DepotStatusMapper">
  6 +
  7 + <insert id="insert" parameterType="com.ruoyi.service.domain.DepotStatus">
  8 + insert into depot_status(
  9 + <if test="depotId != null and depotId != ''">depotId,</if>
  10 + <if test="checkTime != null and checkTime != null">checkTime,</if>
  11 + <if test="humidity != null and humidity != ''">humidity,</if>
  12 + <if test="temperature != null and temperature != ''">temperature,</if>
  13 + <if test="mark != null and mark != ''">mark,</if>
  14 + createTime
  15 + )values(
  16 + <if test="depotId != null and depotId != ''">#{depotId},</if>
  17 + <if test="checkTime != null and checkTime != null">#{checkTime},</if>
  18 + <if test="humidity != null and humidity != ''">#{humidity},</if>
  19 + <if test="temperature != null and temperature != ''">#{temperature},</if>
  20 + <if test="mark != null and mark != ''">#{mark},</if>
  21 + sysdate()
  22 + )
  23 + </insert>
  24 +
  25 + <update id="update" parameterType="com.ruoyi.service.domain.DepotStatus">
  26 + update depot_status
  27 + <set>
  28 + <if test="depotId != null and depotId != ''">depotId = #{depotId},</if>
  29 + <if test="checkTime != null and checkTime != null">checkTime = #{checkTime},</if>
  30 + <if test="humidity != null and humidity != ''">humidity = #{humidity},</if>
  31 + <if test="temperature != null and temperature != ''">temperature = #{temperature},</if>
  32 + <if test="mark != null">mark = #{mark},</if>
  33 + updateTime = sysdate()
  34 + </set>
  35 + where id = #{id}
  36 + </update>
  37 +
  38 + <delete id="delete" parameterType="Long">
  39 + delete from depot_status where id = #{id}
  40 + </delete>
  41 +
  42 + <select id="selectList" resultType="com.ruoyi.service.domain.DepotStatus" parameterType="com.ruoyi.service.domain.DepotStatus">
  43 + select a.*,b.depotName from depot_status a,depot b
  44 + where a.depotId=b.id
  45 + <if test="depotId != null and depotId != ''">
  46 + AND depotId =#{depotId}
  47 + </if>
  48 + </select>
  49 +
  50 +
  51 +</mapper>
0 \ No newline at end of file 52 \ No newline at end of file
ruoyi-service/src/main/resources/mapper/sevice/InventoryMapper.xml
@@ -41,7 +41,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -41,7 +41,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
41 </update> 41 </update>
42 42
43 <delete id="delete" parameterType="Long"> 43 <delete id="delete" parameterType="Long">
44 - delete from inventory where id = #{id} 44 + delete from inventory where id in
  45 + <foreach collection="array" item="id" open="(" separator="," close=")">
  46 + #{id}
  47 + </foreach>
45 </delete> 48 </delete>
46 49
47 <select id="selectList" resultType="com.ruoyi.service.domain.Inventory" parameterType="com.ruoyi.service.domain.Inventory"> 50 <select id="selectList" resultType="com.ruoyi.service.domain.Inventory" parameterType="com.ruoyi.service.domain.Inventory">
ruoyi-service/src/main/resources/mapper/sevice/MessageMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.service.mapper.MessageMapper">
  6 +
  7 + <insert id="insert" parameterType="com.ruoyi.service.domain.Message">
  8 + insert into message(
  9 + <if test="userId != null and userId != ''">userId,</if>
  10 + <if test="message != null and message != ''">message,</if>
  11 + <if test="messageState != null and messageState != ''">messageState,</if>
  12 + createTime
  13 + )values(
  14 + <if test="userId != null and userId != ''">#{userId},</if>
  15 + <if test="message != null and message != ''">#{message},</if>
  16 + <if test="messageState != null and messageState != ''">#{messageState},</if>
  17 + sysdate()
  18 + )
  19 + </insert>
  20 +
  21 + <update id="read" parameterType="Long">
  22 + update message set
  23 + messageState = 2,
  24 + updateTime = sysdate()
  25 + where id in
  26 + <foreach collection="array" item="id" open="(" separator="," close=")">
  27 + #{id}
  28 + </foreach>
  29 + </update>
  30 +
  31 + <delete id="delete" parameterType="Long">
  32 + delete from message where id in
  33 + <foreach collection="array" item="id" open="(" separator="," close=")">
  34 + #{id}
  35 + </foreach>
  36 + </delete>
  37 +
  38 + <select id="selectList" resultType="com.ruoyi.service.domain.Message" parameterType="com.ruoyi.service.domain.Message">
  39 + select * from message
  40 + where userId =#{userId}
  41 + </select>
  42 +
  43 + <select id="selectCount" resultType="int" parameterType="com.ruoyi.service.domain.Message">
  44 + select count(*) from message
  45 + where userId =#{userId} and messageState = 1
  46 + </select>
  47 +
  48 +</mapper>
0 \ No newline at end of file 49 \ No newline at end of file
ruoyi-service/src/main/resources/mapper/sevice/SafetyDetailMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.service.mapper.SafetyDetailMapper">
  6 +
  7 + <insert id="insert" parameterType="com.ruoyi.service.domain.SafetyDetail">
  8 + insert into safety_detail(
  9 + <if test="safetyId != null and safetyId != ''">safetyId,</if>
  10 + <if test="checkType != null and checkType != ''">checkType,</if>
  11 + <if test="state != null and state != ''">state,</if>
  12 + <if test="measures != null and measures != ''">measures,</if>
  13 + createTime
  14 + )values(
  15 + <if test="safetyId != null and safetyId != ''">#{safetyId},</if>
  16 + <if test="checkType != null and checkType != ''">#{checkType},</if>
  17 + <if test="state != null and state != ''">#{state},</if>
  18 + <if test="measures != null and measures != ''">#{measures},</if>
  19 + sysdate()
  20 + )
  21 + </insert>
  22 +
  23 + <select id="selectList" resultType="com.ruoyi.service.domain.SafetyDetail" parameterType="com.ruoyi.service.domain.SafetyDetail">
  24 + select * from safety_detail
  25 + <where>
  26 + <if test="safetyId != null and safetyId != ''">
  27 + AND safetyId =#{safetyId}
  28 + </if>
  29 + </where>
  30 + </select>
  31 +
  32 +</mapper>
0 \ No newline at end of file 33 \ No newline at end of file
ruoyi-service/src/main/resources/mapper/sevice/SafetyMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.service.mapper.SafetyMapper">
  6 +
  7 + <insert id="insert" parameterType="com.ruoyi.service.domain.Safety">
  8 + insert into safety(
  9 + <if test="depotId != null and depotId != ''">depotId,</if>
  10 + <if test="checkTime != null and checkTime != null">checkTime,</if>
  11 + <if test="checkUser != null and checkUser != ''">checkUser,</if>
  12 + <if test="mark != null and mark != ''">mark,</if>
  13 + createTime
  14 + )values(
  15 + <if test="depotId != null and depotId != ''">#{depotId},</if>
  16 + <if test="checkTime != null and checkTime != null">#{checkTime},</if>
  17 + <if test="checkUser != null and checkUser != ''">#{checkUser},</if>
  18 + <if test="mark != null and mark != ''">#{mark},</if>
  19 + sysdate()
  20 + )
  21 + </insert>
  22 +
  23 + <update id="update" parameterType="com.ruoyi.service.domain.Safety">
  24 + update safety
  25 + <set>
  26 + <if test="depotId != null and depotId != ''">depotId = #{depotId},</if>
  27 + <if test="checkTime != null and checkTime != null">checkTime = #{checkTime},</if>
  28 + <if test="checkUser != null and checkUser != ''">checkUser = #{checkUser},</if>
  29 + <if test="mark != null">mark = #{mark},</if>
  30 + updateTime = sysdate()
  31 + </set>
  32 + where id = #{id}
  33 + </update>
  34 +
  35 + <delete id="delete" parameterType="Long">
  36 + delete from safety where id = #{id}
  37 + </delete>
  38 +
  39 + <select id="selectList" resultType="com.ruoyi.service.domain.Safety" parameterType="com.ruoyi.service.domain.Safety">
  40 + select * from safety
  41 + <where>
  42 + <if test="depotId != null and depotId != ''">
  43 + AND depotId =#{depotId}
  44 + </if>
  45 + </where>
  46 + </select>
  47 +
  48 +
  49 +</mapper>
0 \ No newline at end of file 50 \ No newline at end of file
ruoyi-ui/src/api/service/depotStatus.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +
  4 +export function listPost(query) {
  5 + return request({
  6 + url: '/service/depotStatus/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +export function addPost(data) {
  13 + return request({
  14 + url: '/service/depotStatus',
  15 + method: 'post',
  16 + data: data
  17 + })
  18 +}
  19 +
  20 +export function updatePost(data) {
  21 + return request({
  22 + url: '/service/depotStatus',
  23 + method: 'put',
  24 + data: data
  25 + })
  26 +}
  27 +
  28 +export function delPost(id) {
  29 + return request({
  30 + url: '/service/depotStatus/' + id,
  31 + method: 'delete'
  32 + })
  33 +}
ruoyi-ui/src/api/service/message.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +
  4 +export function listPost(query) {
  5 + return request({
  6 + url: '/service/message/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +export function addPost(data) {
  13 + return request({
  14 + url: '/service/message',
  15 + method: 'post',
  16 + data: data
  17 + })
  18 +}
  19 +
  20 +
  21 +export function delPost(ids) {
  22 + return request({
  23 + url: '/service/message/' + ids,
  24 + method: 'delete'
  25 + })
  26 +}
  27 +
  28 +export function read(ids) {
  29 + return request({
  30 + url: '/service/message/read/' + ids,
  31 + method: 'delete'
  32 + })
  33 +}
  34 +
  35 +export function count() {
  36 + return request({
  37 + url: '/service/message/count',
  38 + method: 'get'
  39 + })
  40 +}
  41 +
ruoyi-ui/src/api/service/safety.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +export function treeselect() {
  4 + return request({
  5 + url: '/service/safety/treeselect',
  6 + method: 'get'
  7 + })
  8 +}
  9 +
  10 +export function listPost(query) {
  11 + return request({
  12 + url: '/service/safety/list',
  13 + method: 'get',
  14 + params: query
  15 + })
  16 +}
  17 +
  18 +export function addPost(data) {
  19 + return request({
  20 + url: '/service/safety',
  21 + method: 'post',
  22 + data: data
  23 + })
  24 +}
  25 +
  26 +export function updatePost(data) {
  27 + return request({
  28 + url: '/service/safety',
  29 + method: 'put',
  30 + data: data
  31 + })
  32 +}
  33 +
  34 +export function delPost(id) {
  35 + return request({
  36 + url: '/service/safety/' + id,
  37 + method: 'delete'
  38 + })
  39 +}
  40 +
  41 +export function addDetail(data) {
  42 + return request({
  43 + url: '/service/safety/addDetail',
  44 + method: 'post',
  45 + data: data
  46 + })
  47 +}
  48 +
  49 +export function detailList(query) {
  50 + return request({
  51 + url: '/service/safety/detailList',
  52 + method: 'get',
  53 + params: query
  54 + })
  55 +}
  56 +
  57 +
ruoyi-ui/src/assets/icons/svg/message2.svg 0 → 100644
  1 +<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><animate attributeName="color" attributeType="css" to="#504D46" from="white" repeatCount="indefinite" begin="2s" dur="2s" calcMode="discrete"></animate><path d="M0 20.967v59.59c0 11.59 8.537 20.966 19.075 20.966h28.613l1 26.477L76.8 101.523h32.125c10.538 0 19.075-9.377 19.075-20.966v-59.59C128 9.377 119.463 0 108.925 0h-89.85C8.538 0 0 9.377 0 20.967zm82.325 33.1c0-5.524 4.013-9.935 9.037-9.935 5.026 0 9.038 4.41 9.038 9.934 0 5.524-4.025 9.934-9.038 9.934-5.024 0-9.037-4.41-9.037-9.934zm-27.613 0c0-5.524 4.013-9.935 9.038-9.935s9.037 4.41 9.037 9.934c0 5.524-4.025 9.934-9.037 9.934-5.025 0-9.038-4.41-9.038-9.934zm-27.1 0c0-5.524 4.013-9.935 9.038-9.935s9.038 4.41 9.038 9.934c0 5.524-4.026 9.934-9.05 9.934-5.013 0-9.025-4.41-9.025-9.934z"/></svg>
ruoyi-ui/src/layout/components/Navbar.vue
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <div class="right-menu"> 8 <div class="right-menu">
9 <template v-if="device!=='mobile'"> 9 <template v-if="device!=='mobile'">
10 <search id="header-search" class="right-menu-item" /> 10 <search id="header-search" class="right-menu-item" />
11 - 11 +
12 <el-tooltip content="源码地址" effect="dark" placement="bottom"> 12 <el-tooltip content="源码地址" effect="dark" placement="bottom">
13 <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> 13 <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
14 </el-tooltip> 14 </el-tooltip>
@@ -17,6 +17,10 @@ @@ -17,6 +17,10 @@
17 <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" /> 17 <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
18 </el-tooltip> 18 </el-tooltip>
19 19
  20 + <el-tooltip content="我的消息" effect="dark" placement="bottom">
  21 + <message id="message" class="right-menu-item hover-effect" :key="Math.random()" v-if="messageCount==0"/>
  22 + <message2 id="message2" class="right-menu-item hover-effect" :key="Math.random()" v-if="messageCount>0"/>
  23 + </el-tooltip>
20 <screenfull id="screenfull" class="right-menu-item hover-effect" /> 24 <screenfull id="screenfull" class="right-menu-item hover-effect" />
21 25
22 <el-tooltip content="布局大小" effect="dark" placement="bottom"> 26 <el-tooltip content="布局大小" effect="dark" placement="bottom">
@@ -56,8 +60,15 @@ import SizeSelect from &#39;@/components/SizeSelect&#39; @@ -56,8 +60,15 @@ import SizeSelect from &#39;@/components/SizeSelect&#39;
56 import Search from '@/components/HeaderSearch' 60 import Search from '@/components/HeaderSearch'
57 import RuoYiGit from '@/components/RuoYi/Git' 61 import RuoYiGit from '@/components/RuoYi/Git'
58 import RuoYiDoc from '@/components/RuoYi/Doc' 62 import RuoYiDoc from '@/components/RuoYi/Doc'
59 - 63 +import Message from '@/views/service/message/message'
  64 +import Message2 from '@/views/service/message/message2'
  65 +import {count} from "@/api/service/message";
60 export default { 66 export default {
  67 + data() {
  68 + return {
  69 + messageCount:0
  70 + };
  71 + },
61 components: { 72 components: {
62 Breadcrumb, 73 Breadcrumb,
63 TopNav, 74 TopNav,
@@ -66,7 +77,9 @@ export default { @@ -66,7 +77,9 @@ export default {
66 SizeSelect, 77 SizeSelect,
67 Search, 78 Search,
68 RuoYiGit, 79 RuoYiGit,
69 - RuoYiDoc 80 + RuoYiDoc,
  81 + Message,
  82 + Message2
70 }, 83 },
71 computed: { 84 computed: {
72 ...mapGetters([ 85 ...mapGetters([
@@ -105,7 +118,21 @@ export default { @@ -105,7 +118,21 @@ export default {
105 location.href = '/index'; 118 location.href = '/index';
106 }) 119 })
107 }).catch(() => {}); 120 }).catch(() => {});
  121 + },
  122 + time(){
  123 + setInterval(()=>{
  124 + this.messageCount=sessionStorage.getItem("messageCount");
  125 + },10000)
  126 + },getCount() {
  127 + count().then(response => {
  128 + sessionStorage.setItem("messageCount",response);
  129 + this.messageCount=response;
  130 + this.time();
  131 + });
108 } 132 }
  133 + },
  134 + created() {
  135 + this.getCount();
109 } 136 }
110 } 137 }
111 </script> 138 </script>
ruoyi-ui/src/views/service/depotStatus/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row :gutter="10" class="mb8">
  4 + <el-col :span="1.5">
  5 + <el-button
  6 + type="primary"
  7 + plain
  8 + icon="el-icon-plus"
  9 + size="mini"
  10 + @click="handleAdd"
  11 + v-hasPermi="['service:depotStatus:add']"
  12 + >登记</el-button>
  13 + </el-col>
  14 + <el-col :span="1.5">
  15 + <el-button
  16 + type="success"
  17 + plain
  18 + icon="el-icon-edit"
  19 + size="mini"
  20 + :disabled="single"
  21 + @click="handleUpdate"
  22 + v-hasPermi="['service:depotStatus:edit']"
  23 + >编辑</el-button>
  24 + </el-col>
  25 + <el-col :span="1.5">
  26 + <el-button
  27 + type="danger"
  28 + plain
  29 + icon="el-icon-delete"
  30 + size="mini"
  31 + :disabled="multiple"
  32 + @click="handleDelete"
  33 + v-hasPermi="['service:depotStatus:remove']"
  34 + >删除</el-button>
  35 + </el-col>
  36 + <el-col :span="1.5">
  37 + <el-button
  38 + type="warning"
  39 + plain
  40 + icon="el-icon-download"
  41 + size="mini"
  42 + @click="handleExport"
  43 + v-hasPermi="['service:depotStatus:export']"
  44 + >导出</el-button>
  45 + </el-col>
  46 + </el-row>
  47 +
  48 + <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
  49 + <el-table-column type="selection" width="55" align="center" />
  50 + <el-table-column label="检查点" align="center" prop="depotId" :formatter="depotIdFormat"/>
  51 + <el-table-column label="监测时间" align="center" prop="checkTime" />
  52 + <el-table-column label="湿度%" align="center" prop="humidity" />
  53 + <el-table-column label="温度°C" align="center" prop="temperature" />
  54 + <el-table-column label="采取措施" align="center" prop="mark" />
  55 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  56 + <template slot-scope="scope">
  57 + <el-button
  58 + size="mini"
  59 + type="text"
  60 + icon="el-icon-edit"
  61 + @click="handleUpdate(scope.row)"
  62 + v-hasPermi="['system:depotStatus:edit']"
  63 + >编辑</el-button>
  64 + <el-button
  65 + size="mini"
  66 + type="text"
  67 + icon="el-icon-delete"
  68 + @click="handleDelete(scope.row)"
  69 + v-hasPermi="['system:depotStatus:remove']"
  70 + >删除</el-button>
  71 + </template>
  72 + </el-table-column>
  73 + </el-table>
  74 +
  75 + <pagination
  76 + v-show="total>0"
  77 + :total="total"
  78 + :page.sync="queryParams.pageNum"
  79 + :limit.sync="queryParams.pageSize"
  80 + @pagination="getList"
  81 + />
  82 +
  83 + <!-- 添加或修改对话框 -->
  84 + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  85 + <el-form ref="form" :model="form" :rules="rules" label-width="90px">
  86 + <el-form-item label="监测点" prop="depotId">
  87 + <el-select v-model="form.depotId" placeholder="监测点" :disabled="edit">
  88 + <el-option
  89 + v-for="depot in depotOptions"
  90 + :key="depot.id"
  91 + :label="depot.depotName"
  92 + :value="depot.id"
  93 + />
  94 + </el-select>
  95 + </el-form-item>
  96 + <el-form-item label="监测时间" prop="checkTime">
  97 + <el-date-picker
  98 + v-model="form.checkTime" type="datetime" placeholder="选择时间" value-format="yyyy-MM-dd HH:mm:ss">
  99 + </el-date-picker>
  100 + </el-form-item>
  101 + <el-form-item label="湿度值" prop="humidity">
  102 + <el-input-number v-model="form.humidity" controls-position="right" :min="0" />
  103 + </el-form-item>
  104 + <el-form-item label="湿度值" prop="temperature">
  105 + <el-input-number v-model="form.temperature" controls-position="right" :min="0" />
  106 + </el-form-item>
  107 + <el-form-item label="采取措施" >
  108 + <el-input v-model="form.mark" />
  109 + </el-form-item>
  110 + </el-form>
  111 + <div slot="footer" class="dialog-footer">
  112 + <el-button type="primary" @click="submitForm">确 定</el-button>
  113 + <el-button @click="cancel">取 消</el-button>
  114 + </div>
  115 + </el-dialog>
  116 + </div>
  117 +</template>
  118 +
  119 +<script>
  120 +import {listPost, delPost, addPost, updatePost } from "@/api/service/depotStatus";
  121 +import {getDepots} from "@/api/service/depot";
  122 +export default {
  123 + name: "depotStatus",
  124 + dicts: ['archivesLevel','selectType1','selectType2'],
  125 + data() {
  126 + return {
  127 + // 遮罩层
  128 + loading: true,
  129 + // 选中数组
  130 + ids: [],
  131 + // 非单个禁用
  132 + single: true,
  133 + // 非多个禁用
  134 + multiple: true,
  135 + // 显示搜索条件
  136 + showSearch: true,
  137 + // 总条数
  138 + total: 0,
  139 + // 岗位表格数据
  140 + postList: [],
  141 + // 弹出层标题
  142 + title: "",
  143 + // 是否显示弹出层
  144 + open: false,
  145 + // 查询参数
  146 + queryParams: {
  147 + pageNum: 1,
  148 + pageSize: 10
  149 + },
  150 + // 表单参数
  151 + form: {},
  152 + // 表单校验
  153 + rules: {
  154 + depotId: [
  155 + { required: true, message: "请选择监测点", trigger: "blur" }
  156 + ],
  157 + checkTime: [
  158 + { required: true, message: "检测时间不能为空", trigger: "blur" }
  159 + ],
  160 + humidity: [
  161 + { required: true, message: "湿度不能为空", trigger: "blur" }
  162 + ],
  163 + temperature: [
  164 + { required: true, message: "温度不能为空", trigger: "blur" }
  165 + ]
  166 + },
  167 + depotOptions:[],
  168 + edit:false,
  169 + depotList:[]
  170 + };
  171 + },
  172 + created() {
  173 + this.getList();
  174 + this.getDepots();
  175 + },
  176 + methods: {
  177 + getList() {
  178 + this.loading = true;
  179 + listPost(this.queryParams).then(response => {
  180 + this.postList = response.rows;
  181 + this.total = response.total;
  182 + this.loading = false;
  183 + });
  184 + },
  185 + // 取消按钮
  186 + cancel() {
  187 + this.open = false;
  188 + this.reset();
  189 + },
  190 + // 表单重置
  191 + reset() {
  192 + this.form = {
  193 + depotId: undefined,
  194 + checkTime: undefined,
  195 + humidity: undefined,
  196 + temperature:undefined,
  197 + factor: undefined,
  198 + mark: undefined
  199 + };
  200 + this.resetForm("form");
  201 + },
  202 + /** 搜索按钮操作 */
  203 + handleQuery() {
  204 + this.queryParams.pageNum = 1;
  205 + this.getList();
  206 + },
  207 + /** 重置按钮操作 */
  208 + resetQuery() {
  209 + this.resetForm("queryForm");
  210 + this.handleQuery();
  211 + },
  212 + // 多选框选中数据
  213 + handleSelectionChange(selection) {
  214 + this.ids = selection.map(item => item.postId)
  215 + this.single = selection.length!=1
  216 + this.multiple = !selection.length
  217 + },
  218 + /** 新增按钮操作 */
  219 + handleAdd() {
  220 + this.edit=false;
  221 + this.reset();
  222 + getDepots().then(response => {
  223 + this.depotOptions = response.depotList;
  224 + this.open = true;
  225 + this.title = "登记";
  226 + });
  227 + },
  228 + /** 修改按钮操作 */
  229 + handleUpdate(row) {
  230 + this.edit=true;
  231 + this.reset();
  232 + this.form = row;
  233 + this.open = true;
  234 + this.title = "编辑";
  235 + },
  236 + /** 提交按钮 */
  237 + submitForm: function() {
  238 + this.$refs["form"].validate(valid => {
  239 + if (valid) {
  240 + if (this.edit) {
  241 + updatePost(this.form).then(response => {
  242 + this.$modal.msgSuccess("修改成功");
  243 + this.open = false;
  244 + this.getList();
  245 + });
  246 + } else {
  247 + addPost(this.form).then(response => {
  248 + this.$modal.msgSuccess("新增成功");
  249 + this.open = false;
  250 + this.getList();
  251 + });
  252 + }
  253 + }
  254 + });
  255 + },
  256 + /** 删除按钮操作 */
  257 + handleDelete(row) {
  258 + this.$modal.confirm('是否确认删除数据?').then(function() {
  259 + return delPost(row.id);
  260 + }).then(() => {
  261 + this.getList();
  262 + this.$modal.msgSuccess("删除成功");
  263 + }).catch(() => {});
  264 + },
  265 + /** 导出按钮操作 */
  266 + handleExport() {
  267 + this.download('service/depotStatus/export', {
  268 + ...this.queryParams
  269 + }, `depot_status_${new Date().getTime()}.xlsx`)
  270 + },
  271 + getDepots(){
  272 + getDepots().then(response=>{
  273 + this.depotList=response.depotList;
  274 + })
  275 + },
  276 + depotIdFormat(row) {
  277 + for(let i in this.depotList){
  278 + let depot=this.depotList[i]
  279 + if (depot.id == row.depotId) {
  280 + return depot.depotName;
  281 + }
  282 + }
  283 + }
  284 + }
  285 +};
  286 +</script>
ruoyi-ui/src/views/service/inventory/index.vue
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 size="mini" 19 size="mini"
20 :disabled="single" 20 :disabled="single"
21 @click="handleUpdate" 21 @click="handleUpdate"
22 - v-hasPermi="['system:post:edit']" 22 + v-hasPermi="['service:inventory:edit']"
23 >编辑</el-button> 23 >编辑</el-button>
24 </el-col> 24 </el-col>
25 <el-col :span="1.5"> 25 <el-col :span="1.5">
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 size="mini" 30 size="mini"
31 :disabled="multiple" 31 :disabled="multiple"
32 @click="handleDelete" 32 @click="handleDelete"
33 - v-hasPermi="['system:post:remove']" 33 + v-hasPermi="['service:inventory:remove']"
34 >删除</el-button> 34 >删除</el-button>
35 </el-col> 35 </el-col>
36 <el-col :span="1.5"> 36 <el-col :span="1.5">
@@ -39,8 +39,8 @@ @@ -39,8 +39,8 @@
39 plain 39 plain
40 icon="el-icon-download" 40 icon="el-icon-download"
41 size="mini" 41 size="mini"
42 - @click="handleExport"  
43 - v-hasPermi="['system:post:export']" 42 + @click="handleAdd"
  43 + v-hasPermi="['service:inventory:export']"
44 >盘点</el-button> 44 >盘点</el-button>
45 </el-col> 45 </el-col>
46 <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> 46 <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -62,21 +62,21 @@ @@ -62,21 +62,21 @@
62 type="text" 62 type="text"
63 icon="el-icon-edit" 63 icon="el-icon-edit"
64 @click="handleUpdate(scope.row)" 64 @click="handleUpdate(scope.row)"
65 - v-hasPermi="['system:post:edit']" 65 + v-hasPermi="['service:inventory:edit']"
66 >盘点</el-button> 66 >盘点</el-button>
67 <el-button 67 <el-button
68 size="mini" 68 size="mini"
69 type="text" 69 type="text"
70 icon="el-icon-edit" 70 icon="el-icon-edit"
71 @click="handleUpdate(scope.row)" 71 @click="handleUpdate(scope.row)"
72 - v-hasPermi="['system:post:edit']" 72 + v-hasPermi="['service:inventory:edit']"
73 >编辑</el-button> 73 >编辑</el-button>
74 <el-button 74 <el-button
75 size="mini" 75 size="mini"
76 type="text" 76 type="text"
77 icon="el-icon-delete" 77 icon="el-icon-delete"
78 @click="handleDelete(scope.row)" 78 @click="handleDelete(scope.row)"
79 - v-hasPermi="['system:post:remove']" 79 + v-hasPermi="['service:inventory:remove']"
80 >删除</el-button> 80 >删除</el-button>
81 </template> 81 </template>
82 </el-table-column> 82 </el-table-column>
@@ -93,10 +93,10 @@ @@ -93,10 +93,10 @@
93 <!-- 添加或修改对话框 --> 93 <!-- 添加或修改对话框 -->
94 <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> 94 <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
95 <el-form ref="form" :model="form" :rules="rules" label-width="90px"> 95 <el-form ref="form" :model="form" :rules="rules" label-width="90px">
96 - <el-form-item label="任务描述" > 96 + <el-form-item label="任务描述" prop="mark">
97 <el-input v-model="form.mark" placeholder="请输入任务描述" :disabled="edit"/> 97 <el-input v-model="form.mark" placeholder="请输入任务描述" :disabled="edit"/>
98 </el-form-item> 98 </el-form-item>
99 - <el-form-item label="档案库" > 99 + <el-form-item label="档案库" prop="depotId">
100 <el-select v-model="form.depotId" placeholder="档案库" :disabled="edit"> 100 <el-select v-model="form.depotId" placeholder="档案库" :disabled="edit">
101 <el-option 101 <el-option
102 v-for="depot in depotOptions" 102 v-for="depot in depotOptions"
@@ -106,7 +106,7 @@ @@ -106,7 +106,7 @@
106 /> 106 />
107 </el-select> 107 </el-select>
108 </el-form-item> 108 </el-form-item>
109 - <el-form-item label="档案级别" > 109 + <el-form-item label="档案级别" prop="archivesLevel">
110 <el-select v-model="form.archivesLevel" placeholder="档案级别" :disabled="edit"> 110 <el-select v-model="form.archivesLevel" placeholder="档案级别" :disabled="edit">
111 <el-option 111 <el-option
112 v-for="dict in dict.type.archivesLevel" 112 v-for="dict in dict.type.archivesLevel"
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 import { listPost, getPost, delPost, addPost, updatePost } from "@/api/service/inventory"; 156 import { listPost, getPost, delPost, addPost, updatePost } from "@/api/service/inventory";
157 import {getDepots} from "@/api/service/depot"; 157 import {getDepots} from "@/api/service/depot";
158 export default { 158 export default {
159 - name: "Post", 159 + name: "inventory",
160 dicts: ['archivesLevel','selectType1','selectType2'], 160 dicts: ['archivesLevel','selectType1','selectType2'],
161 data() { 161 data() {
162 return { 162 return {
@@ -187,6 +187,15 @@ export default { @@ -187,6 +187,15 @@ export default {
187 form: {}, 187 form: {},
188 // 表单校验 188 // 表单校验
189 rules: { 189 rules: {
  190 + archivesLevel: [
  191 + { required: true, message: "请选择档案级别", trigger: "blur" }
  192 + ],
  193 + mark: [
  194 + { required: true, message: "任务描述不能为空", trigger: "blur" }
  195 + ],
  196 + depotId: [
  197 + { required: true, message: "请选择档案库", trigger: "blur" }
  198 + ]
190 }, 199 },
191 depotOptions:[], 200 depotOptions:[],
192 edit:false, 201 edit:false,
@@ -237,7 +246,8 @@ export default { @@ -237,7 +246,8 @@ export default {
237 }, 246 },
238 // 多选框选中数据 247 // 多选框选中数据
239 handleSelectionChange(selection) { 248 handleSelectionChange(selection) {
240 - this.ids = selection.map(item => item.postId) 249 + this.ids = selection.map(item => item.id)
  250 + console.log(this.ids);
241 this.single = selection.length!=1 251 this.single = selection.length!=1
242 this.multiple = !selection.length 252 this.multiple = !selection.length
243 }, 253 },
@@ -246,7 +256,7 @@ export default { @@ -246,7 +256,7 @@ export default {
246 this.edit=false; 256 this.edit=false;
247 this.reset(); 257 this.reset();
248 getDepots().then(response => { 258 getDepots().then(response => {
249 - this.depotOptions = response.depotOptions; 259 + this.depotOptions = response.depotList;
250 this.open = true; 260 this.open = true;
251 this.title = "添加"; 261 this.title = "添加";
252 }); 262 });
@@ -281,8 +291,9 @@ export default { @@ -281,8 +291,9 @@ export default {
281 }, 291 },
282 /** 删除按钮操作 */ 292 /** 删除按钮操作 */
283 handleDelete(row) { 293 handleDelete(row) {
  294 + const ids =row.id || this.ids;
284 this.$modal.confirm('是否确认删除数据?').then(function() { 295 this.$modal.confirm('是否确认删除数据?').then(function() {
285 - return delPost(row.id); 296 + return delPost(ids);
286 }).then(() => { 297 }).then(() => {
287 this.getList(); 298 this.getList();
288 this.$modal.msgSuccess("删除成功"); 299 this.$modal.msgSuccess("删除成功");
ruoyi-ui/src/views/service/message/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row :gutter="10" class="mb8">
  4 + <el-col :span="1.5">
  5 + <el-button
  6 + type="danger"
  7 + plain
  8 + size="mini"
  9 + :disabled="multiple"
  10 + @click="handleUpdate"
  11 + v-hasPermi="['service:message:edit']"
  12 + >已读</el-button>
  13 + <el-button
  14 + type="danger"
  15 + plain
  16 + size="mini"
  17 + :disabled="multiple"
  18 + @click="handleDelete"
  19 + v-hasPermi="['service:message:remove']"
  20 + >删除</el-button>
  21 + </el-col>
  22 + </el-row>
  23 +
  24 + <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
  25 + <el-table-column type="selection" width="55" align="center" />
  26 + <el-table-column label="消息描述" align="center" prop="message" :show-overflow-tooltip="true" />
  27 + <el-table-column label="时间" align="center" prop="createTime" />
  28 + <el-table-column label="是否已读" align="center" prop="messageState" :formatter="messageStateFormat" />
  29 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  30 + <template slot-scope="scope">
  31 + <el-button
  32 + size="mini"
  33 + type="text"
  34 + @click="handleUpdate(scope.row)"
  35 + v-hasPermi="['service:message:edit']"
  36 + >标记已读</el-button>
  37 + </template>
  38 + </el-table-column>
  39 + </el-table>
  40 +
  41 + <pagination
  42 + v-show="total>0"
  43 + :total="total"
  44 + :page.sync="queryParams.pageNum"
  45 + :limit.sync="queryParams.pageSize"
  46 + @pagination="getList"
  47 + />
  48 +
  49 + </div>
  50 +</template>
  51 +
  52 +<script>
  53 +import {listPost, delPost, read} from "@/api/service/message";
  54 +import navbar from "@/layout/components/Navbar.vue";
  55 +export default {
  56 + name: "message",
  57 + dicts: ['messageState'],
  58 + data() {
  59 + return {
  60 + // 遮罩层
  61 + loading: true,
  62 + // 选中数组
  63 + ids: [],
  64 + // 非单个禁用
  65 + single: true,
  66 + // 非多个禁用
  67 + multiple: true,
  68 + // 显示搜索条件
  69 + showSearch: true,
  70 + // 总条数
  71 + total: 0,
  72 + // 岗位表格数据
  73 + postList: [],
  74 + // 弹出层标题
  75 + title: "",
  76 + // 是否显示弹出层
  77 + open: false,
  78 + // 查询参数
  79 + queryParams: {
  80 + pageNum: 1,
  81 + pageSize: 10
  82 + },
  83 + // 表单参数
  84 + form: {},
  85 + // 表单校验
  86 + rules: {
  87 + }
  88 + };
  89 + },
  90 + created() {
  91 + this.getList();
  92 + },
  93 + methods: {
  94 + getList() {
  95 + this.loading = true;
  96 + listPost(this.queryParams).then(response => {
  97 + this.postList = response.rows;
  98 + this.total = response.total;
  99 + this.loading = false;
  100 + });
  101 + },
  102 + // 取消按钮
  103 + cancel() {
  104 + this.open = false;
  105 + this.reset();
  106 + },
  107 + /** 搜索按钮操作 */
  108 + handleQuery() {
  109 + this.queryParams.pageNum = 1;
  110 + this.getList();
  111 + },
  112 + /** 重置按钮操作 */
  113 + resetQuery() {
  114 + this.resetForm("queryForm");
  115 + this.handleQuery();
  116 + },
  117 + // 多选框选中数据
  118 + handleSelectionChange(selection) {
  119 + this.ids = selection.map(item => item.id)
  120 + this.single = selection.length!=1
  121 + this.multiple = !selection.length
  122 + },
  123 + /** 修改按钮操作 */
  124 + handleUpdate(row) {
  125 + const ids =row.id || this.ids;
  126 + return read(ids).then(()=>{
  127 + this.getList();
  128 + navbar.methods.getCount();
  129 + })
  130 + },
  131 + /** 删除按钮操作 */
  132 + handleDelete(row) {
  133 + const ids =row.id || this.ids;
  134 + this.$modal.confirm('是否确认删除数据?').then(function() {
  135 + return delPost(ids);
  136 + }).then(() => {
  137 + this.getList();
  138 + this.$modal.msgSuccess("删除成功");
  139 + }).catch(() => {});
  140 + },
  141 + messageStateFormat(row, column) {
  142 + return this.selectDictLabel(this.dict.type.messageState, row.messageState);
  143 + }
  144 + }
  145 +};
  146 +</script>
ruoyi-ui/src/views/service/message/message.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <svg-icon icon-class="message" @click="goto" />
  4 + </div>
  5 +</template>
  6 +<script>
  7 +export default {
  8 + name: 'Message',
  9 + data() {
  10 + return {
  11 + url: '/system/message'
  12 + }
  13 + },
  14 + methods: {
  15 + goto() {
  16 + this.$tab.openPage("我的消息", this.url);
  17 +
  18 + }
  19 + }
  20 +}
  21 +</script>
ruoyi-ui/src/views/service/message/message2.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <svg-icon icon-class="message2" @click="goto" />
  4 + </div>
  5 +</template>
  6 +
  7 +<script>
  8 +export default {
  9 + name: 'Message2',
  10 + data() {
  11 + return {
  12 + url: '/system/message'
  13 + }
  14 + },
  15 + methods: {
  16 + goto() {
  17 + this.$tab.openPage("我的消息", this.url);
  18 +
  19 + }
  20 + }
  21 +}
  22 +</script>
ruoyi-ui/src/views/service/safety/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row :gutter="20">
  4 + <!--库房维护-->
  5 + <el-col :span="4" :xs="24">
  6 + <div class="head-container">
  7 + <el-tree
  8 + :data="options"
  9 + :props="defaultProps"
  10 + :expand-on-click-node="false"
  11 + :filter-node-method="filterNode"
  12 + :default-expand-all=true
  13 + node-key="id"
  14 + ref="tree"
  15 + highlight-current
  16 + @node-click="handleNodeClick"
  17 + />
  18 + </div>
  19 + </el-col>
  20 + <el-col :span="20" :xs="24" >
  21 + <el-row :gutter="10" class="mb8">
  22 + <el-col :span="1.5">
  23 + <el-button
  24 + type="primary"
  25 + plain
  26 + icon="el-icon-plus"
  27 + size="mini"
  28 + @click="handleAdd"
  29 + v-hasPermi="['server:safety:add']"
  30 + >新增</el-button>
  31 + </el-col>
  32 + <el-col :span="1.5">
  33 + <el-button
  34 + type="danger"
  35 + plain
  36 + icon="el-icon-delete"
  37 + size="mini"
  38 + :disabled="multiple"
  39 + @click="handleDelete"
  40 + v-hasPermi="['server:safety:remove']"
  41 + >删除</el-button>
  42 + </el-col>
  43 + </el-row>
  44 +
  45 + <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
  46 + <el-table-column type="selection" width="50" align="center" />
  47 + <el-table-column label="库房名称" align="center" key="depotName" prop="depotName" :formatter="depotIdFormat"/>
  48 + <el-table-column label="检查时间" align="center" key="checkTime" prop="checkTime" />
  49 + <el-table-column label="检查人" align="center" key="checkUser" prop="checkUser" />
  50 + <el-table-column label="检查描述" align="center" key="mark" prop="mark" />
  51 + <el-table-column
  52 + label="操作"
  53 + align="center"
  54 + width="160"
  55 + class-name="small-padding fixed-width"
  56 + >
  57 + <template slot-scope="scope" >
  58 + <el-button
  59 + size="mini"
  60 + type="text"
  61 + icon="el-icon-edit"
  62 + @click="handleUpdate(scope.row)"
  63 + v-hasPermi="['system:user:edit']"
  64 + >修改</el-button>
  65 + <el-button
  66 + size="mini"
  67 + type="text"
  68 + icon="el-icon-edit"
  69 + @click="handleDetail(scope.row)"
  70 + v-hasPermi="['system:user:edit']"
  71 + >登记</el-button>
  72 + <el-button
  73 + size="mini"
  74 + type="text"
  75 + icon="el-icon-delete"
  76 + @click="handleDelete(scope.row)"
  77 + v-hasPermi="['system:user:remove']"
  78 + >删除</el-button>
  79 + </template>
  80 + </el-table-column>
  81 + </el-table>
  82 +
  83 + <pagination
  84 + v-show="total>0"
  85 + :total="total"
  86 + :page.sync="queryParams.pageNum"
  87 + :limit.sync="queryParams.pageSize"
  88 + @pagination="getList"
  89 + />
  90 + </el-col>
  91 + </el-row>
  92 +
  93 + <!-- 添加或修改对话框 -->
  94 + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  95 + <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  96 + <el-form-item label="档案库" >
  97 + <el-select v-model="form.depotId" placeholder="档案库" :disabled="edit">
  98 + <el-option
  99 + v-for="depot in depotList"
  100 + :key="depot.id"
  101 + :label="depot.depotName"
  102 + :value="depot.id"
  103 + />
  104 + </el-select>
  105 + </el-form-item>
  106 + <el-form-item label="检查时间" prop="depotName">
  107 + <el-date-picker
  108 + v-model="form.checkTime" type="datetime" placeholder="选择时间" value-format="yyyy-MM-dd HH:mm:ss">
  109 + </el-date-picker>
  110 + </el-form-item>
  111 + <el-form-item label="检查人" prop="mark">
  112 + <el-input v-model="form.checkUser" maxlength="30" />
  113 + </el-form-item>
  114 + <el-form-item label="检查描述" prop="mark">
  115 + <el-input v-model="form.mark" maxlength="30" />
  116 + </el-form-item>
  117 + </el-form>
  118 + <div slot="footer" class="dialog-footer">
  119 + <el-button type="primary" @click="submitForm">确 定</el-button>
  120 + <el-button @click="cancel">取 消</el-button>
  121 + </div>
  122 + </el-dialog>
  123 + <!--明细 -->
  124 + <el-dialog title="登记" :visible.sync="open2" width="1000px" append-to-body>
  125 + <el-row :gutter="10" class="mb8">
  126 + <el-col :span="1.5">
  127 + <el-button
  128 + type="primary"
  129 + plain
  130 + icon="el-icon-plus"
  131 + size="mini"
  132 + @click="handleAddDetail()"
  133 + v-hasPermi="['server:safety:add']"
  134 + >新增</el-button>
  135 + </el-col>
  136 + </el-row>
  137 + <el-table v-loading="loading" :data="detailList" >
  138 + <el-table-column label="检查项" align="center" key="checkType" prop="checkType" :formatter="checkTypeFormat" />
  139 + <el-table-column label="检查情况" align="center" key="state" prop="state" />
  140 + <el-table-column label="措施" align="center" key="measures" prop="measures" :formatter="measuresFormat"/>
  141 + <el-table-column
  142 + label="操作"
  143 + align="center"
  144 + width="160"
  145 + class-name="small-padding fixed-width"
  146 + >
  147 + <template slot-scope="scope" >
  148 + <el-button
  149 + size="mini"
  150 + type="text"
  151 + >明细</el-button>
  152 + </template>
  153 + </el-table-column>
  154 + </el-table>
  155 + </el-dialog>
  156 +
  157 + <el-dialog title="新增" :visible.sync="open3" width="500px" append-to-body>
  158 + <el-form ref="form2" :model="form2" :rules="rules" label-width="100px">
  159 + <el-form-item label="检查项" >
  160 + <el-select v-model="form2.checkType" placeholder="检查项" >
  161 + <el-option
  162 + v-for="dict in dict.type.checkType"
  163 + :key="dict.value"
  164 + :label="dict.label"
  165 + :value="dict.value"
  166 + />
  167 + </el-select>
  168 + </el-form-item>
  169 + <el-form-item label="检查情况" >
  170 + <el-input-number v-model="form2.state" controls-position="right" :min="0" />
  171 + </el-form-item>
  172 + <el-form-item label="措施" >
  173 + <el-select v-model="form2.measures" placeholder="措施" >
  174 + <el-option
  175 + v-for="dict in dict.type.measures"
  176 + :key="dict.value"
  177 + :label="dict.label"
  178 + :value="dict.value"
  179 + />
  180 + </el-select>
  181 + </el-form-item>
  182 + </el-form>
  183 + <div slot="footer" class="dialog-footer">
  184 + <el-button type="primary" @click="submitForm2">确 定</el-button>
  185 + <el-button @click="cancel2">取 消</el-button>
  186 + </div>
  187 + </el-dialog>
  188 + </div>
  189 +</template>
  190 +
  191 +<script>
  192 +
  193 +import {getDepots} from "@/api/service/depot";
  194 +import {treeselect, listPost, addPost, updatePost, delPost, detailList, addDetail} from "@/api/service/safety";
  195 +import Treeselect from "@riophae/vue-treeselect";
  196 +import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  197 +
  198 +export default {
  199 + dicts: ['checkType','measures'],
  200 + components: { Treeselect },
  201 + data() {
  202 + return {
  203 + postList: null,
  204 + detailList:null,
  205 + id:undefined,
  206 + edit:false,
  207 + form: {},
  208 + form2:{},
  209 + // 遮罩层
  210 + loading: true,
  211 + // 选中数组
  212 + ids: [],
  213 + // 非单个禁用
  214 + single: true,
  215 + // 非多个禁用
  216 + multiple: true,
  217 + // 总条数
  218 + total: 0,
  219 + // 弹出层标题
  220 + title: "",
  221 + // 部门树选项
  222 + options: undefined,
  223 + // 是否显示弹出层
  224 + open: false,
  225 + open2:false,
  226 + open3:false,
  227 + // 表单参数
  228 + defaultProps: {
  229 + children: "children",
  230 + label: "label"
  231 + },
  232 + // 查询参数
  233 + queryParams: {
  234 + pageNum: 1,
  235 + pageSize: 10,
  236 + depotId:undefined
  237 + },
  238 + queryParams2: {
  239 + safetyId:undefined
  240 + },
  241 + // 表单校验
  242 + rules: {
  243 + },
  244 + depotList:[],
  245 + safetyId:undefined
  246 + };
  247 + },
  248 + watch: {
  249 + // 根据名称筛选部门树
  250 + deptName(val) {
  251 + this.$refs.tree.filter(val);
  252 + }
  253 + },
  254 + created() {
  255 + this.getList();
  256 + this.getTreeselect();
  257 + this.getDepots();
  258 + },
  259 + methods: {
  260 + getList() {
  261 + this.loading = true;
  262 + listPost(this.queryParams).then(response => {
  263 + this.postList = response.rows;
  264 + this.total = response.total;
  265 + this.loading = false;
  266 + });
  267 + },
  268 + /** 查询部门下拉树结构 */
  269 + getTreeselect() {
  270 + treeselect().then(response => {
  271 + this.options = response.data;
  272 + });
  273 + },
  274 + // 筛选节点
  275 + filterNode(value, data) {
  276 + if (!value) return true;
  277 + return data.label.indexOf(value) !== -1;
  278 + },
  279 + // 节点单击事件
  280 + handleNodeClick(data) {
  281 + this.queryParams.depotId=undefined;
  282 + if(data.level==1){
  283 + this.queryParams.depotId=data.dbId;
  284 + }
  285 + this.handleQuery();
  286 + },
  287 + // 取消按钮
  288 + cancel() {
  289 + this.open = false;
  290 + this.reset();
  291 + },
  292 + cancel2() {
  293 + this.open3 = false;
  294 + },
  295 + // 表单重置
  296 + reset() {
  297 + this.form = {
  298 + depotId: undefined,
  299 + checkTime: undefined,
  300 + checkUser: undefined,
  301 + mark: undefined
  302 + };
  303 + this.resetForm("form");
  304 + },
  305 + reset2() {
  306 + this.form2 = {
  307 + safetyId: undefined,
  308 + checkType: undefined,
  309 + state: undefined,
  310 + measures: undefined
  311 + };
  312 + this.resetForm("form2");
  313 + },
  314 + /** 搜索按钮操作 */
  315 + handleQuery() {
  316 + this.queryParams.pageNum = 1;
  317 + this.getList();
  318 + },
  319 + /** 重置按钮操作 */
  320 + resetQuery() {
  321 + this.dateRange = [];
  322 + this.resetForm("queryForm");
  323 + this.handleQuery();
  324 + },
  325 + // 多选框选中数据
  326 + handleSelectionChange(selection) {
  327 + this.ids = selection.map(item => item.userId);
  328 + this.single = selection.length != 1;
  329 + this.multiple = !selection.length;
  330 + },
  331 + /** 新增按钮操作 */
  332 + handleAdd() {
  333 + this.reset();
  334 + this.open = true;
  335 + this.edit = false;
  336 + this.title = "创建";
  337 + },
  338 + /** 修改按钮操作 */
  339 + handleUpdate(row) {
  340 + this.reset();
  341 + this.form = row;
  342 + this.open = true;
  343 + this.edit = true;
  344 + this.title = "编辑";
  345 + },
  346 + handleDetail(row) {
  347 + this.safetyId=row.id;
  348 + this.getDetailList(row.id);
  349 + this.open2 = true;
  350 + },
  351 + handleAddDetail() {
  352 + this.reset2();
  353 + this.form2.safetyId=this.safetyId;
  354 + this.open3 = true;
  355 + },
  356 + /** 提交按钮 */
  357 + submitForm: function() {
  358 + this.$refs["form"].validate(valid => {
  359 + if (valid) {
  360 + if (this.edit) {
  361 + updatePost(this.form).then(response => {
  362 + this.$modal.msgSuccess("修改成功");
  363 + this.open = false;
  364 + this.getList();
  365 + });
  366 + } else {
  367 + addPost(this.form).then(response => {
  368 + this.$modal.msgSuccess("新增成功");
  369 + this.open = false;
  370 + this.getList();
  371 + });
  372 + }
  373 + }
  374 + });
  375 + },
  376 + submitForm2: function() {
  377 + this.$refs["form2"].validate(valid => {
  378 + if (valid) {
  379 + addDetail(this.form2).then(response => {
  380 + this.$modal.msgSuccess("新增成功");
  381 + this.open3 = false;
  382 + this.getDetailList(this.safetyId);
  383 + });
  384 + }
  385 + });
  386 + },
  387 + /** 删除按钮操作 */
  388 + handleDelete(row) {
  389 + this.$modal.confirm('是否确认删除').then(function() {
  390 + return delPost(row.id);
  391 + }).then(() => {
  392 + this.getList();
  393 + this.$modal.msgSuccess("删除成功");
  394 + this.getTreeselect();
  395 + }).catch(() => {});
  396 + },
  397 + /** 获取档案库列表 */
  398 + getDepots(){
  399 + getDepots().then(response=>{
  400 + this.depotList=response.depotList;
  401 + })
  402 + },
  403 + depotIdFormat(row) {
  404 + for(let i in this.depotList){
  405 + let depot=this.depotList[i]
  406 + if (depot.id == row.depotId) {
  407 + return depot.depotName;
  408 + }
  409 + }
  410 + },
  411 + /** 详情的查询 */
  412 + getDetailList(safetyId) {
  413 + this.queryParams2.safetyId=safetyId;
  414 + this.loading = true;
  415 + detailList(this.queryParams2).then(response => {
  416 + this.detailList = response.rows;
  417 + this.loading = false;
  418 + });
  419 + },
  420 + checkTypeFormat(row, column) {
  421 + return this.selectDictLabel(this.dict.type.checkType, row.checkType);
  422 + },
  423 + measuresFormat(row, column) {
  424 + return this.selectDictLabel(this.dict.type.measures, row.measures);
  425 + }
  426 + }
  427 +};
  428 +</script>