gaodd hace 4 años
padre
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 55
     @PostMapping("/getPage")
56 56
     public ResultView getPage(@RequestBody PageParam pageParam) throws Exception{
57 57
     	Page<ProcessAudit> page = processAuditService.getPage(pageParam);
@@ -63,12 +63,12 @@ public class ProcessAuditController {
63 63
      * @param id
64 64
      * @return
65 65
      */
66
-    @ApiOperation(value = "根据id和审批状态查询", notes = "")
66
+    /*@ApiOperation(value = "根据id和审批状态查询", notes = "")
67 67
     @GetMapping("/getById/{id}")
68 68
     public ResultView getById(@PathVariable Integer id) {
69 69
     	List<Map<String,Object>> list = processAuditService.getAllById(id);
70 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 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 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 296
             Integer equipmentId = object.optInt("equipmentId");
297 297
             String startTime = object.optString("startTime");
298 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 304
             	ew.eq("equipment_id", equipmentId);
302 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 309
                 		ew.eq("result", 1);//取第一条数据
307 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 313
                         	ew.eq("result", 2);//药剂保管d第一条数据
311 314
                         }else{
312 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 331
             if (StringUtils.isNotBlank(startTime) || StringUtils.isNotBlank(endTime)) {
@@ -348,7 +351,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
348 351
 
349 352
 
350 353
     //noUse
351
-    @Override
354
+/*@Override
352 355
     public List<Map<String, Object>> getAllById(Integer id) {
353 356
         // TODO Auto-generated method stub
354 357
         List<Map<String, Object>> list1 = new ArrayList<>();
@@ -389,7 +392,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
389 392
         }
390 393
 
391 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 419
         org.json.JSONObject object = new org.json.JSONObject(pageParam.getCondition());
420
+        Integer userId = object.getInt("userId");
417 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 424
             ew.eq("audit_state", 0);//已提交
421 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 1079
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1076 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 1087
         //ew.eq("result", 1);//整个流程的第一条数据
1082 1088
         //只获取审批的数据
@@ -1135,9 +1141,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1135 1141
 
1136 1142
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
1137 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 1146
             //如果是第一个审批人 则第一条数据中状态不为0(提交)
1140
-            ew.eq("to_people", object.optString("userId"));
1147
+            ew.eq("to_people", userId);
1141 1148
             //ew.eq("result",1);//整个流程的第一条数据
1142 1149
             //ew.ne("audit_state",0);
1143 1150
 
@@ -1723,8 +1730,9 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1723 1730
 	public void drugDetailsAdd(String parameter) throws JSONException {
1724 1731
 		JSONObject jsStr = new JSONObject(parameter);
1725 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 1736
         }else{
1729 1737
         	 processId = UUID.randomUUID().toString();//生成一个流程id
1730 1738
         }