gaodd il y a 4 ans
Parent
commit
a1064ce975

+ 3 - 3
src/main/java/com/unissoft/ventilation/controller/ProcessAuditController.java

@@ -51,7 +51,7 @@ public class ProcessAuditController {
51
 	/**
51
 	/**
52
 	 * 机械通风列表
52
 	 * 机械通风列表
53
 	 */
53
 	 */
54
-    @ApiOperation(value = "分页条件查询", notes = "提交参数(type、houseId、depotId必填,没有houseId的就不填):{\"pageIndex\":1,\"pageSize\":10,  \"condition\":\"{\'type\':\'\',\'depotId\':\'\',\'houseId\':\'\',\'startTime\':\'\',\'endTime\':\'\'}\"}")
54
+    @ApiOperation(value = "分页条件查询", notes = "提交参数(type、houseId、depotId必填,没有houseId的就不填):{\"pageIndex\":1,\"pageSize\":10,  \"condition\":\"{\'equipmentId\':\'\',\'type\':\'\',\'depotId\':\'\',\'houseId\':\'\',\'startTime\':\'\',\'endTime\':\'\'}\"}")
55
     @PostMapping("/getPage")
55
     @PostMapping("/getPage")
56
     public ResultView getPage(@RequestBody PageParam pageParam) throws Exception{
56
     public ResultView getPage(@RequestBody PageParam pageParam) throws Exception{
57
     	Page<ProcessAudit> page = processAuditService.getPage(pageParam);
57
     	Page<ProcessAudit> page = processAuditService.getPage(pageParam);
@@ -63,12 +63,12 @@ public class ProcessAuditController {
63
      * @param id
63
      * @param id
64
      * @return
64
      * @return
65
      */
65
      */
66
-    @ApiOperation(value = "根据id和审批状态查询", notes = "")
66
+    /*@ApiOperation(value = "根据id和审批状态查询", notes = "")
67
     @GetMapping("/getById/{id}")
67
     @GetMapping("/getById/{id}")
68
     public ResultView getById(@PathVariable Integer id) {
68
     public ResultView getById(@PathVariable Integer id) {
69
     	List<Map<String,Object>> list = processAuditService.getAllById(id);
69
     	List<Map<String,Object>> list = processAuditService.getAllById(id);
70
         return ResultView.success(list);
70
         return ResultView.success(list);
71
-    }
71
+    }*/
72
     
72
     
73
     
73
     
74
     /**
74
     /**

+ 1 - 1
src/main/java/com/unissoft/ventilation/service/ProcessAuditService.java

@@ -26,7 +26,7 @@ public interface ProcessAuditService extends IService<ProcessAudit> {
26
 
26
 
27
 	Page<ProcessAudit> getPage(PageParam pageParam)throws Exception;
27
 	Page<ProcessAudit> getPage(PageParam pageParam)throws Exception;
28
 
28
 
29
-	List<Map<String, Object>> getAllById(Integer id);
29
+	//List<Map<String, Object>> getAllById(Integer id);
30
 
30
 
31
 	void deleteById(Integer id);
31
 	void deleteById(Integer id);
32
 
32
 

+ 29 - 21
src/main/java/com/unissoft/ventilation/service/impl/ProcessAuditServiceImpl.java

@@ -296,17 +296,20 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
296
             Integer equipmentId = object.optInt("equipmentId");
296
             Integer equipmentId = object.optInt("equipmentId");
297
             String startTime = object.optString("startTime");
297
             String startTime = object.optString("startTime");
298
             String endTime = object.optString("endTime");
298
             String endTime = object.optString("endTime");
299
+            String type = object.optString("type");
300
+            String houseId = object.optString("houseId");
301
+            String depotId = object.optString("depotId");
299
             
302
             
300
-            if("" != equipmentId+""){
303
+            if("" != equipmentId+"" && equipmentId != 0){
301
             	ew.eq("equipment_id", equipmentId);
304
             	ew.eq("equipment_id", equipmentId);
302
             }else{
305
             }else{
303
-            	if (StringUtils.isNotBlank(object.optString("type"))) {
304
-                	if(object.optString("type").equals("xz") || object.optString("type").equals("sswx") || object.optString("type").equals("sbly")){
305
-                		ew.like("type",object.optString("type"));
306
+            	if (StringUtils.isNotBlank(type)) {
307
+                	if(type.equals("xz") || type.equals("sswx") || type.equals("sbly")){
308
+                		ew.like("type",type);
306
                 		ew.eq("result", 1);//取第一条数据
309
                 		ew.eq("result", 1);//取第一条数据
307
                 	}else{
310
                 	}else{
308
-                		ew.eq("type", object.optString("type"));
309
-                        if(object.optString("type").equals("yjbg")){//药剂保管
311
+                		ew.eq("type", type);
312
+                        if(type.equals("yjbg")){//药剂保管
310
                         	ew.eq("result", 2);//药剂保管d第一条数据
313
                         	ew.eq("result", 2);//药剂保管d第一条数据
311
                         }else{
314
                         }else{
312
                         	ew.eq("result", 1);//取第一条数据
315
                         	ew.eq("result", 1);//取第一条数据
@@ -318,11 +321,11 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
318
                 }
321
                 }
319
             }
322
             }
320
             
323
             
321
-            if (StringUtils.isNotBlank(object.optString("houseId"))) {
322
-                ew.eq("house_id", object.optString("houseId"));
324
+            if (StringUtils.isNotBlank(houseId)) {
325
+                ew.eq("house_id", houseId);
323
             }
326
             }
324
-            if (StringUtils.isNotBlank(object.optString("depotId"))) {
325
-                ew.eq("depot_id", object.optString("depotId"));
327
+            if (StringUtils.isNotBlank(depotId)) {
328
+                ew.eq("depot_id", depotId);
326
             }
329
             }
327
 
330
 
328
             if (StringUtils.isNotBlank(startTime) || StringUtils.isNotBlank(endTime)) {
331
             if (StringUtils.isNotBlank(startTime) || StringUtils.isNotBlank(endTime)) {
@@ -348,7 +351,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
348
 
351
 
349
 
352
 
350
     //noUse
353
     //noUse
351
-    @Override
354
+/*@Override
352
     public List<Map<String, Object>> getAllById(Integer id) {
355
     public List<Map<String, Object>> getAllById(Integer id) {
353
         // TODO Auto-generated method stub
356
         // TODO Auto-generated method stub
354
         List<Map<String, Object>> list1 = new ArrayList<>();
357
         List<Map<String, Object>> list1 = new ArrayList<>();
@@ -389,7 +392,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
389
         }
392
         }
390
 
393
 
391
         return list1;
394
         return list1;
392
-    }
395
+    }*/
393
 
396
 
394
 
397
 
395
     /**
398
     /**
@@ -414,9 +417,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
414
 
417
 
415
 
418
 
416
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
419
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
420
+        Integer userId = object.getInt("userId");
417
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
421
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
418
-        if (StringUtils.isNotBlank(object.optString("userId"))) {
419
-            ew.eq("to_people", object.getInt("userId"));
422
+        if (StringUtils.isNotBlank(userId+"")) {
423
+            ew.eq("to_people", userId);
420
             ew.eq("audit_state", 0);//已提交
424
             ew.eq("audit_state", 0);//已提交
421
             //ew.and(x->x.eq("audit_state", 0).or().isNull("audit_state"));
425
             //ew.and(x->x.eq("audit_state", 0).or().isNull("audit_state"));
422
         }
426
         }
@@ -1074,9 +1078,11 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1074
 
1078
 
1075
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1079
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1076
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
1080
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
1077
-        if (StringUtils.isNotBlank(object.optString("userId"))) {
1078
-            ew.eq("apply_people", object.optString("userId"));
1079
-            ew.eq("from_people", object.optString("userId"));
1081
+        String userId = object.optString("userId");
1082
+
1083
+        if (StringUtils.isNotBlank(userId)) {
1084
+            ew.eq("apply_people", userId);
1085
+            ew.eq("from_people", userId);
1080
         }
1086
         }
1081
         //ew.eq("result", 1);//整个流程的第一条数据
1087
         //ew.eq("result", 1);//整个流程的第一条数据
1082
         //只获取审批的数据
1088
         //只获取审批的数据
@@ -1135,9 +1141,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1135
 
1141
 
1136
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1142
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1137
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
1143
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
1138
-        if (StringUtils.isNotBlank(object.optString("userId"))) {
1144
+        String userId = object.optString("userId");
1145
+        if (StringUtils.isNotBlank(userId)) {
1139
             //如果是第一个审批人 则第一条数据中状态不为0(提交)
1146
             //如果是第一个审批人 则第一条数据中状态不为0(提交)
1140
-            ew.eq("to_people", object.optString("userId"));
1147
+            ew.eq("to_people", userId);
1141
             //ew.eq("result",1);//整个流程的第一条数据
1148
             //ew.eq("result",1);//整个流程的第一条数据
1142
             //ew.ne("audit_state",0);
1149
             //ew.ne("audit_state",0);
1143
 
1150
 
@@ -1723,8 +1730,9 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1723
 	public void drugDetailsAdd(String parameter) throws JSONException {
1730
 	public void drugDetailsAdd(String parameter) throws JSONException {
1724
 		JSONObject jsStr = new JSONObject(parameter);
1731
 		JSONObject jsStr = new JSONObject(parameter);
1725
         String processId = "";
1732
         String processId = "";
1726
-        if(null != jsStr.optString("processId") && !jsStr.optString("processId").equals("")){
1727
-        	 processId = jsStr.optString("processId");//流程id 用于修改
1733
+        String receiveProcessId = jsStr.optString("processId");
1734
+        if(null != receiveProcessId && !receiveProcessId.equals("")){
1735
+        	 processId = receiveProcessId;//流程id 用于修改
1728
         }else{
1736
         }else{
1729
         	 processId = UUID.randomUUID().toString();//生成一个流程id
1737
         	 processId = UUID.randomUUID().toString();//生成一个流程id
1730
         }
1738
         }