浏览代码

Merge branch 'master' of http://101.36.160.140:21044/csc/csc-szls-business

shengyang000 3 年之前
父节点
当前提交
3f4c249652

+ 4 - 1
src/main/java/com/unissoft/config/MySecurityMetadataSource.java

@@ -49,7 +49,10 @@ public class MySecurityMetadataSource implements FilterInvocationSecurityMetadat
49 49
                     configAttributes2.add(securityConfig);
50 50
                     linkedHashMap.put(urlPattern1, configAttributes2);
51 51
                 } else {
52
-                    linkedHashMap.get(urlPattern1).add(securityConfig);
52
+                    Collection<ConfigAttribute> configAttributes = linkedHashMap.get(urlPattern1);
53
+                    if(!configAttributes.contains(securityConfig)){
54
+                        configAttributes.add(securityConfig);
55
+                    }
53 56
                 }
54 57
             }
55 58
         }

+ 4 - 1
src/main/java/com/unissoft/mapper/QuantityQualityMapper.java

@@ -2,8 +2,10 @@ package com.unissoft.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.unissoft.model.QuantityQuality;
5
+import org.apache.ibatis.annotations.Mapper;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
8
+import javax.annotation.Resource;
7 9
 import java.util.List;
8 10
 
9 11
 /**
@@ -14,6 +16,7 @@ import java.util.List;
14 16
  * @author root
15 17
  * @since 2021-01-26
16 18
  */
19
+@Mapper
17 20
 public interface QuantityQualityMapper extends BaseMapper<QuantityQuality> {
18
-    public List<QuantityQuality> groudByType(@Param("depotId") String depotId, @Param("depotType") String depotType);
21
+    List<QuantityQuality> groudByType(@Param("depotId") String depotId, @Param("depotType") String depotType);
19 22
 }

+ 4 - 1
src/main/java/com/unissoft/mapper/QuantityQualityMapper.xml

@@ -16,11 +16,14 @@
16 16
         <result column="c_quality" property="cQuality" />
17 17
         <result column="c_character" property="cCharacter" />
18 18
         <result column="c_toxin_index" property="cToxinIndex" />
19
+        <result column="save_state" property="saveState" />
20
+        <result column="m_spare" property="mSpare" />
21
+        <result column="m_spare2" property="mSpare2" />
19 22
     </resultMap>
20 23
 
21 24
     <!-- 通用查询结果列 -->
22 25
     <sql id="Base_Column_List">
23
-        q_id, q_type, q_type_name, depot_ypte, depot_id, depot_name, warehouse_id, warehouse_name, create_time, c_quality, c_character, c_toxin_index
26
+        q_id, q_type, q_type_name, depot_ypte, depot_id, depot_name, warehouse_id, warehouse_name, create_time, c_quality, c_character, c_toxin_index, save_state, m_spare, m_spare2
24 27
     </sql>
25 28
 
26 29
     <select id="groudByType" resultMap="BaseResultMap">

+ 2 - 1
src/main/java/com/unissoft/mapper/SysResourceRoleMapper.xml

@@ -32,8 +32,9 @@ FROM
32 32
 	sys_resource t1
33 33
 LEFT JOIN project t2 ON t1.`se_project_id` = t2.`id`
34 34
 LEFT JOIN sys_resource_role t3 ON t1.`se_id` = t3.`resource_id`
35
+LEFT JOIN sys_role r ON t3.role_id = r.r_id
35 36
 WHERE
36 37
 	t2.`code` = #{projectCode}
37
-AND t1.se_button != '' AND t1.se_button IS NOT NULL
38
+AND t1.se_button != '' AND t1.se_button IS NOT NULL AND t1.se_button != '/'
38 39
     </select>
39 40
 </mapper>

+ 10 - 0
src/main/java/com/unissoft/model/QuantityQuality.java

@@ -75,5 +75,15 @@ public class QuantityQuality implements Serializable {
75 75
     @TableField("c_toxin_index")
76 76
     private Integer cToxinIndex;
77 77
 
78
+    @ApiModelProperty(value = "0保存,1暂存")
79
+    @TableField("save_state")
80
+    private Integer saveState;
78 81
 
82
+    @ApiModelProperty(value = "备用1")
83
+    @TableField("m_spare")
84
+    private String mSpare;
85
+
86
+    @ApiModelProperty(value = "备用2")
87
+    @TableField("m_spare2")
88
+    private String mSpare2;
79 89
 }

+ 177 - 131
src/main/java/com/unissoft/ventilation/service/impl/ProcessAuditServiceImpl.java

@@ -120,9 +120,11 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
120 120
             if(operationTime != null){
121 121
             	processAudit.setOperationTime(operationTime);
122 122
             }
123
+            if(houseId != 0 && houseId != null){
124
+            	processAudit.setHouseId(houseId);
125
+            }
123 126
             processAudit.setSubData(subData);
124 127
             processAudit.setType(type);
125
-            processAudit.setHouseId(houseId);
126 128
             processAudit.setDepotId(depotId);
127 129
             processAudit.setApplyPeople(applyPeople);
128 130
             processAudit.setFromPeople(fromPeople);
@@ -168,12 +170,17 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
168 170
         	sysNoticeVO.setNoticeModule("yjly");
169 171
         }
170 172
         //根据仓房id获取仓房名称
171
-        ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + houseId, String.class);
172
-        com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
173
-        BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
174
-        if (null != ware) {
175
-            sysNoticeVO.setWarehouse(ware.gethName());
173
+        String houseName = "";
174
+        if(houseId != null && houseId != 0){
175
+        	ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + houseId, String.class);
176
+            com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
177
+            BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
178
+            if (null != ware) {
179
+                sysNoticeVO.setWarehouse(ware.gethName());
180
+                houseName = ware.gethName() ;
181
+            }
176 182
         }
183
+        
177 184
         //获取申请人的信息
178 185
         ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + applyPeople, String.class);
179 186
         com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -184,7 +191,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
184 191
             sysNoticeVO.setOrgName(userInfo.getDepotName());//申请人
185 192
             sysNoticeVO.setApplyDept(userInfo.getDepartmentName());//申请部门
186 193
             sysNoticeVO.setCreateBy(applyPeople);
187
-            sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"请审批");
194
+            sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"请审批");
188 195
         }
189 196
        
190 197
         sendNoticeVO.setSysNoticeVO(sysNoticeVO);
@@ -326,12 +333,15 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
326 333
         if (pageInfo.getTotal() > 0) {
327 334
             for (ProcessAudit processAudit : pageInfo.getRecords()) {
328 335
                 //根据仓房id获取仓房名称
329
-                ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
330
-                com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
331
-                BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
332
-                if (null != ware) {
333
-                    processAudit.setHouseName(ware.gethName());
334
-                }
336
+            	if(null != processAudit.getHouseId()){
337
+            		ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
338
+                    com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
339
+                    BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
340
+                    if (null != ware) {
341
+                        processAudit.setHouseName(ware.gethName());
342
+                    }
343
+            	}
344
+                
335 345
                 //获取申请人的信息
336 346
                 ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + processAudit.getApplyPeople(), String.class);
337 347
                 com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -384,12 +394,17 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
384 394
           	 sysNoticeVO.setNoticeModule("yjly");
385 395
          }
386 396
          //根据仓房id获取仓房名称
387
-         ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
388
-         com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
389
-         BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
390
-         if (null != ware) {
391
-             sysNoticeVO.setWarehouse(ware.gethName());
397
+         String houseName = "";
398
+         if(null != processAudit.getHouseId()){
399
+        	 ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
400
+             com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
401
+             BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
402
+             if (null != ware) {
403
+                 sysNoticeVO.setWarehouse(ware.gethName());
404
+                 houseName = ware.gethName();
405
+             }
392 406
          }
407
+         
393 408
          //获取申请人的信息
394 409
          ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + processAudit.getApplyPeople(), String.class);
395 410
          com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -456,7 +471,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
456 471
                  /**
457 472
                   *  发送通知数据给下一审批人
458 473
                   */
459
-                 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批通过");
474
+                 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批通过");
460 475
                  sysNoticeVO.setNoticeType(30);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
461 476
                 //获取下一审批人的信息
462 477
                  ResponseEntity<String> userInfos1 = restTemplate.getForEntity(MyConstant.SYSTEM_USER + toPeople, String.class);
@@ -465,7 +480,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
465 480
                  users.put(toPeople, userInfo1.getuName());
466 481
                  
467 482
              }else{//不通过 发送数据给申请人
468
-             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批不通过");
483
+             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批不通过");
469 484
                  sysNoticeVO.setNoticeType(40);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
470 485
                  users.put(processAudit.getApplyPeople(), userInfo.getuName());
471 486
              }
@@ -495,10 +510,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
495 510
 
496 511
              if((int) auditState >= 3 || (int) auditState ==1){
497 512
              	sysNoticeVO.setNoticeType(30);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
498
-             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批通过");
513
+             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批通过");
499 514
              }else if((int) auditState == 2){
500 515
              	sysNoticeVO.setNoticeType(40);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
501
-             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批不通过");
516
+             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批不通过");
502 517
              }
503 518
              users.put(processAudit.getApplyPeople(), userInfo.getuName());
504 519
          }
@@ -628,64 +643,66 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
628 643
 
629 644
         //审批流程信息
630 645
         List<ProcessBasis> pbList = processBasisService.getBasisByType(list.get(0).getType(), null, list.get(0).getDepotId());
631
-        if(pbList.get(0).getType().equals("tf")){
632
-        	 pbList.get(0).setAuditTime(list.get(0).getApplyTime());
633
-             pbList.get(0).setContent(list.get(0).getApplyPeople());
634
-             if (list.get(0).getAuditState().equals(0)) {
635
-                 //已申请,待第一个人审批
636
-                 pbList.get(1).setAuditState(0);
637
-                 pbList.get(1).setContent(list.get(0).getToPeople());
638
-             } else {
639
-                 //已审批
640
-                 pbList.get(1).setContent(list.get(0).getToPeople());
641
-                 pbList.get(1).setAuditTime(list.get(0).getAuditTime());
642
-                 if ((int) list.get(0).getAuditState() >= 3) {
643
-                     pbList.get(1).setAuditState(1);
644
-                 } else if (list.size() > 1 && list.get(0).getAuditState().equals(2)) {//两次审批 第一次通过 第二次不通过 第一条数据的状态是最新的2 则展示通过
645
-                     pbList.get(1).setAuditState(1);
646
-                 } else {
647
-                     pbList.get(1).setAuditState(list.get(0).getAuditState());
648
-                 }
649
-                 if (list.size() > 1) {
650
-                     pbList.get(2).setContent(list.get(1).getToPeople());
651
-                     pbList.get(2).setAuditTime(list.get(1).getAuditTime());
652
-                     pbList.get(2).setAuditState(list.get(1).getAuditState());
653
-                 }
654
-             }
655
-        }else{
656
-        	
657
-        	//判断是否是通过
658
-        	boolean flag = list.get(0).getAuditState().equals(2);
659
-        	//保管员
660
-			pbList.get(0).setAuditTime(list.get(0).getApplyTime());//保管员的时间为 申请时间
661
-			pbList.get(0).setContent(list.get(0).getApplyPeople());//保管员为申请人
662
-        	for (int j = 0; j < pbList.size(); j++) {
663
-        		    if(j==0)continue;//保管员 不做处理
664
-        		    //审批人
665
-        		    ProcessBasis item = pbList.get(j);
666
-        			if(j-1<=list.size()-1){
667
-        				// 业务
668
-        				ProcessAudit audit = list.get(j-1);
669
-        				item.setAuditTime(audit.getAuditTime());
670
-        				item.setContent(audit.getToPeople());
671
-        				if(flag){//不通过
672
-                			if(j-1==list.size()-1){
673
-                				item.setAuditState(2);
674
-                			}else{
675
-                				item.setAuditState(1);
676
-                			}
677
-                		}else{
678
-                			item.setAuditState(audit.getAuditState());
679
-                		}
680
-        				
681
-        			}
682
-			}
683
-        	if(pbList.get(1).getAuditState().equals(4) || pbList.get(1).getAuditState().equals(3)){
684
-        		pbList.get(1).setAuditState(1);
685
-        	}
686
-        	
646
+        if(pbList.size()>0){
647
+        	if(pbList.get(0).getType().equals("tf") || pbList.get(0).getType().equals("yjly")){
648
+           	 pbList.get(0).setAuditTime(list.get(0).getApplyTime());
649
+                pbList.get(0).setContent(list.get(0).getApplyPeople());
650
+                if (list.get(0).getAuditState().equals(0)) {
651
+                    //已申请,待第一个人审批
652
+                    pbList.get(1).setAuditState(0);
653
+                    pbList.get(1).setContent(list.get(0).getToPeople());
654
+                } else {
655
+                    //已审批
656
+                    pbList.get(1).setContent(list.get(0).getToPeople());
657
+                    pbList.get(1).setAuditTime(list.get(0).getAuditTime());
658
+                    if ((int) list.get(0).getAuditState() >= 3) {
659
+                        pbList.get(1).setAuditState(1);
660
+                    } else if (list.size() > 1 && list.get(0).getAuditState().equals(2)) {//两次审批 第一次通过 第二次不通过 第一条数据的状态是最新的2 则展示通过
661
+                        pbList.get(1).setAuditState(1);
662
+                    } else {
663
+                        pbList.get(1).setAuditState(list.get(0).getAuditState());
664
+                    }
665
+                    if (list.size() > 1) {
666
+                        pbList.get(2).setContent(list.get(1).getToPeople());
667
+                        pbList.get(2).setAuditTime(list.get(1).getAuditTime());
668
+                        pbList.get(2).setAuditState(list.get(1).getAuditState());
669
+                    }
670
+                }
671
+           }else{
672
+           	
673
+           	//判断是否是通过
674
+           	boolean flag = list.get(0).getAuditState().equals(2);
675
+           	//保管员
676
+   			pbList.get(0).setAuditTime(list.get(0).getApplyTime());//保管员的时间为 申请时间
677
+   			pbList.get(0).setContent(list.get(0).getApplyPeople());//保管员为申请人
678
+           	for (int j = 0; j < pbList.size(); j++) {
679
+           		    if(j==0)continue;//保管员 不做处理
680
+           		    //审批人
681
+           		    ProcessBasis item = pbList.get(j);
682
+           			if(j-1<=list.size()-1){
683
+           				// 业务
684
+           				ProcessAudit audit = list.get(j-1);
685
+           				item.setAuditTime(audit.getAuditTime());
686
+           				item.setContent(audit.getToPeople());
687
+           				if(flag){//不通过
688
+                   			if(j-1==list.size()-1){
689
+                   				item.setAuditState(2);
690
+                   			}else{
691
+                   				item.setAuditState(1);
692
+                   			}
693
+                   		}else{
694
+                   			item.setAuditState(audit.getAuditState());
695
+                   		}
696
+           				
697
+           			}
698
+   			}
699
+           	if(pbList.get(1).getAuditState().equals(4) || pbList.get(1).getAuditState().equals(3)){
700
+           		pbList.get(1).setAuditState(1);
701
+           	}
702
+           	
703
+           }
704
+        	map.put("audit", pbList);
687 705
         }
688
-        map.put("audit", pbList);
689 706
 
690 707
         return map;
691 708
     }
@@ -720,12 +737,15 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
720 737
         if (pageInfo.getTotal() > 0) {
721 738
             for (ProcessAudit processAudit : pageInfo.getRecords()) {
722 739
                 //根据仓房id获取仓房名称
723
-                ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
724
-                com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
725
-                BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
726
-                if (null != ware) {
727
-                    processAudit.setHouseName(ware.gethName());
728
-                }
740
+            	if(null != processAudit.getHouseId()){
741
+            		ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
742
+                    com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
743
+                    BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
744
+                    if (null != ware) {
745
+                        processAudit.setHouseName(ware.gethName());
746
+                    }
747
+            	}
748
+                
729 749
                 //获取申请人的信息
730 750
                 ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + processAudit.getApplyPeople(), String.class);
731 751
                 com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -777,12 +797,15 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
777 797
         if (pageInfo.getTotal() > 0) {
778 798
             for (ProcessAudit processAudit : pageInfo.getRecords()) {
779 799
                 //根据仓房id获取仓房名称
780
-                ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
781
-                com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
782
-                BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
783
-                if (null != ware) {
784
-                    processAudit.setHouseName(ware.gethName());
785
-                }
800
+            	if(null != processAudit.getHouseId()){
801
+            		ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
802
+                    com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
803
+                    BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
804
+                    if (null != ware) {
805
+                        processAudit.setHouseName(ware.gethName());
806
+                    }
807
+            	}
808
+                
786 809
                 //获取申请人的信息
787 810
                 ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + processAudit.getApplyPeople(), String.class);
788 811
                 com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -1052,12 +1075,17 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1052 1075
           	 sysNoticeVO.setNoticeModule("yjly");
1053 1076
          }
1054 1077
          //根据仓房id获取仓房名称
1055
-         ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
1056
-         com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
1057
-         BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
1058
-         if (null != ware) {
1059
-             sysNoticeVO.setWarehouse(ware.gethName());
1078
+         String houseName = "";
1079
+         if(null != processAudit.getHouseId()){
1080
+        	 ResponseEntity<String> forEntity = restTemplate.getForEntity(MyConstant.SYSTEM_WAREHOUSE + processAudit.getHouseId(), String.class);
1081
+             com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(forEntity.getBody());
1082
+             BasicsWarehouse ware = com.alibaba.fastjson.JSONObject.toJavaObject(jsonObject, BasicsWarehouse.class);
1083
+             if (null != ware) {
1084
+                 sysNoticeVO.setWarehouse(ware.gethName());
1085
+                 houseName = ware.gethName();
1086
+             }
1060 1087
          }
1088
+         
1061 1089
          //获取申请人的信息
1062 1090
          ResponseEntity<String> userInfos = restTemplate.getForEntity(MyConstant.SYSTEM_USER + processAudit.getApplyPeople(), String.class);
1063 1091
          com.alibaba.fastjson.JSONObject jsonObjectuser = JSON.parseObject(userInfos.getBody());
@@ -1096,10 +1124,10 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1096 1124
 
1097 1125
              if((int) auditState >= 3 || (int) auditState ==1){
1098 1126
              	sysNoticeVO.setNoticeType(30);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
1099
-             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批通过");
1127
+             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批通过");
1100 1128
              }else if((int) auditState == 2){
1101 1129
              	sysNoticeVO.setNoticeType(40);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
1102
-             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批不通过");
1130
+             	sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批不通过");
1103 1131
              }
1104 1132
              users.put(processAudit.getApplyPeople(), userInfo.getuName());
1105 1133
         	 
@@ -1141,7 +1169,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1141 1169
                  /**
1142 1170
                   *  发送通知数据给下一审批人
1143 1171
                   */
1144
-                 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批通过");
1172
+                 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批通过");
1145 1173
                  sysNoticeVO.setNoticeType(30);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
1146 1174
                 //获取下一审批人的信息
1147 1175
                  ResponseEntity<String> userInfos1 = restTemplate.getForEntity(MyConstant.SYSTEM_USER + toPeople, String.class);
@@ -1153,7 +1181,7 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1153 1181
             	 allPaList.get(0).setAuditState(auditState);
1154 1182
                  allPaList.get(0).setOngoingStep(ongoingStep);
1155 1183
                  processAuditMapper.updateById(allPaList.get(0));
1156
-             	 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+ware.gethName()+"-"+"审批不通过");
1184
+             	 sysNoticeVO.setContent(userInfo.getDepotName()+"-"+houseName+"-"+"审批不通过");
1157 1185
                  sysNoticeVO.setNoticeType(40);//申请的时候推送  通知类型:10系统、20待办、30审批通过、40审批不通过、50警告
1158 1186
                  users.put(processAudit.getApplyPeople(), userInfo.getuName());
1159 1187
              }
@@ -1172,56 +1200,64 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1172 1200
 		// TODO Auto-generated method stub
1173 1201
 		
1174 1202
         JSONObject jsStr = new JSONObject(parameter);
1175
-        String processId = UUID.randomUUID().toString();//生成一个流程id
1203
+        String processId = "";
1204
+        if(null != jsStr.optString("processId") && "" != jsStr.optString("processId")){
1205
+        	 processId = jsStr.optString("processId");//流程id 用于修改
1206
+        }else{
1207
+        	 processId = UUID.randomUUID().toString();//生成一个流程id
1208
+        }
1209
+        
1176 1210
         String type = jsStr.optString("type");//流程类型
1177
-        Integer houseId = jsStr.optInt("houseId");//仓房id
1178 1211
         Integer depotId = jsStr.optInt("depotId");//库id
1212
+        Integer auditState = jsStr.optInt("auditState");//状态
1179 1213
         JSONArray jsonArray = jsStr.optJSONArray("subList");//子流程数据
1180 1214
         JSONObject row = null;
1181 1215
         for (int i = 0; i < jsonArray.length(); i++) {
1182 1216
             row = jsonArray.getJSONObject(i);
1183 1217
             Integer subData = row.optInt("subData");//子流程数据
1184 1218
             String operationTime = row.optString("operationTime");//子流程的操作时间
1185
-            Integer auditId = row.optInt("auditId");//每条数据的id
1219
+            Integer subId = row.optInt("subId");//子流程id
1186 1220
             QueryWrapper<ProcessAudit> ew1 = new QueryWrapper<>();
1187 1221
             ew1.eq("process_id", processId);
1188 1222
             ew1.eq("type", type);
1189 1223
             List<ProcessAudit> list = processAuditMapper.selectList(ew1);
1190
-            if (list.size() > 0) {
1191
-            	if(null != auditId && 0 != auditId){
1192
-            		 //修改
1193
-            		for (ProcessAudit processAudit : list) {
1194
-             		   if(processAudit.getId().equals(auditId)){
1195
-             			  if (!processAudit.getSubData().equals(subData)) {
1196
-             				   processAudit.setSubData(subData);
1197
-             				   processAudit.setOperationTime(operationTime);
1198
-                               processAuditMapper.updateById(processAudit);
1199
-                          }
1200
-                 	   }
1201
- 			        }
1202
-            	}else{
1203
-            		//新增
1204
-                    ProcessAudit processAudit = new ProcessAudit();
1205
-                    processAudit.setType(type);
1206
-                    processAudit.setSubData(subData);
1207
-                    processAudit.setOperationTime(operationTime);
1208
-                    processAudit.setHouseId(houseId);
1209
-                    processAudit.setDepotId(depotId);
1210
-                    processAudit.setProcessId(processId);
1211
-                    processAuditMapper.insert(processAudit);
1212
-            	}
1213
-               
1214
-                
1215
-            } else {
1216
-                //第一条数据新增
1224
+            if(list.size() > 0){//修改
1225
+            	QueryWrapper<ProcessAudit> ew2 = new QueryWrapper<>();
1226
+            	ew2.eq("process_id", processId);
1227
+            	ew2.eq("type", type);
1228
+            	ew2.eq("sub_id", subId);
1229
+                List<ProcessAudit> list1 = processAuditMapper.selectList(ew2);
1230
+                if(list1.size()>0){
1231
+                	for (ProcessAudit processAudit : list1) {
1232
+                		if(processAudit.getSubId().equals(subId) && !processAudit.getSubData().equals(subData)){
1233
+                			//修改
1234
+                			processAudit.setSubData(subData);
1235
+          				    processAudit.setOperationTime(operationTime);
1236
+                            processAuditMapper.updateById(processAudit);
1237
+                		}
1238
+    				}
1239
+                }else{
1240
+                	//新增
1241
+                    ProcessAudit processAudit1 = new ProcessAudit();
1242
+                    processAudit1.setType(type);
1243
+                    processAudit1.setSubId(subId);
1244
+                    processAudit1.setSubData(subData);
1245
+                    processAudit1.setOperationTime(operationTime);
1246
+                    processAudit1.setDepotId(depotId);
1247
+                    processAudit1.setProcessId(processId);
1248
+                    processAuditMapper.insert(processAudit1);
1249
+                }
1250
+            }else{
1251
+            	//第一条数据新增
1217 1252
                 ProcessAudit processAudit = new ProcessAudit();
1218 1253
                 processAudit.setType(type);
1219 1254
                 processAudit.setSubData(subData);
1255
+                processAudit.setSubId(subId);
1220 1256
                 processAudit.setOperationTime(operationTime);
1221
-                processAudit.setHouseId(houseId);
1222 1257
                 processAudit.setDepotId(depotId);
1223 1258
                 processAudit.setResult(2);//第一条数据 保存并审批  1是0否 2和流程无关的数据
1224 1259
                 processAudit.setProcessId(processId);
1260
+                processAudit.setAuditState(auditState);
1225 1261
                 Date date = new Date();
1226 1262
                 SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
1227 1263
                 String dateString = formatter.format(date);
@@ -1230,6 +1266,16 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
1230 1266
             }
1231 1267
 
1232 1268
         }
1269
+        QueryWrapper<ProcessAudit> ew2 = new QueryWrapper<>();
1270
+    	ew2.eq("process_id", processId);
1271
+    	ew2.eq("type", type);
1272
+    	ew2.eq("result", 2);
1273
+        List<ProcessAudit> list2 = processAuditMapper.selectList(ew2);
1274
+        if(!list2.get(0).getAuditState().equals(auditState)){
1275
+        	//修改第一条数据的状态
1276
+            list2.get(0).setAuditState(auditState);
1277
+    		processAuditMapper.updateById(list2.get(0));
1278
+        }
1233 1279
     
1234 1280
 	}
1235 1281