Browse Source

修改料控管理

yinhao 4 years ago
parent
commit
11ddde2ca6

+ 9 - 7
shiwan/admin/src/main/java/com/huimv/admin/service/secondary/impl/MachineControlServiceImpl.java

@@ -58,9 +58,9 @@ public class MachineControlServiceImpl implements MachineControlService {
         machineControlEntity.setNo4DlstartTime2(machineControlDTO.getNo4DlstartTime2());
         machineControlEntity.setNo4DlstartTime3(machineControlDTO.getNo4DlstartTime3());
         machineControlEntity.setNo4DlstartTime4(machineControlDTO.getNo4DlstartTime4());
+        machineControlEntity.setJqId(machineControlDTO.getJqid());
 
         if (isAdd) {
-            machineControlEntity.setJqId(machineControlDTO.getJqid());
             machineControlRepository.saveAndFlush(machineControlEntity);
             return;
         }
@@ -71,15 +71,17 @@ public class MachineControlServiceImpl implements MachineControlService {
     }
 
     @Override
-    public Map<String,Object> list(Integer pageNum, Integer pageSize, String keyword) {
-        Map<String,Object> map = new HashMap<>(16);
+    public Map<String, Object> list(Integer pageNum, Integer pageSize, String keyword) {
+        Map<String, Object> map = new HashMap<>(16);
+        if (keyword == null) {
+            keyword = "";
+        }
         Long totalSize = machineControlRepository.countTotalSize(keyword);
-        map.put("totalSize",totalSize);
-        map.put("totalPageNum",(totalSize + pageSize - 1) / pageSize);
+        map.put("totalSize", totalSize);
+        map.put("totalPageNum", (totalSize + pageSize - 1) / pageSize);
         Integer start = (pageNum - 1) * pageSize;
-        if (keyword == null) { keyword = "";}
         List<Map> machineControlInfoList = machineControlRepository.getMachineControlInfo(start, pageSize, keyword);
-        map.put("data",machineControlInfoList);
+        map.put("data", machineControlInfoList);
         return map;
     }