2 Ревизии 3d76c91657 ... 3f4c249652

Автор SHA1 Съобщение Дата
  shengyang000 3f4c249652 Merge branch 'master' of http://101.36.160.140:21044/csc/csc-szls-business преди 3 години
  shengyang000 f25441e6be 修改代办 преди 3 години

+ 3 - 1
src/main/java/com/unissoft/mapper/ProcessSubMapper.java

@@ -1,7 +1,8 @@
1 1
 package com.unissoft.mapper;
2 2
 
3
-import com.unissoft.model.ProcessSub;
4 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.unissoft.model.ProcessSub;
5
+import org.springframework.stereotype.Repository;
5 6
 
6 7
 /**
7 8
  * <p>
@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
11 12
  * @author My SunShine
12 13
  * @since 2021-01-30
13 14
  */
15
+@Repository
14 16
 public interface ProcessSubMapper extends BaseMapper<ProcessSub> {
15 17
 
16 18
 }

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

@@ -12,7 +12,6 @@ import com.unissoft.result.ResultView;
12 12
 import com.unissoft.ventilation.service.ProcessAuditService;
13 13
 import io.swagger.annotations.Api;
14 14
 import io.swagger.annotations.ApiOperation;
15
-
16 15
 import org.json.JSONException;
17 16
 import org.springframework.beans.factory.annotation.Autowired;
18 17
 import org.springframework.web.bind.annotation.*;
@@ -185,7 +184,7 @@ public class ProcessAuditController {
185 184
     @ApiOperation(value = "根据待办id,将流程设成已办", notes = "")
186 185
     @GetMapping("/haveDone/{id}/{auditState}")
187 186
     public ResultView haveDone(@PathVariable Integer id,@PathVariable Integer auditState) {
188
-    	 processAuditService.haveDone(id,auditState);
187
+    	 processAuditService.haveDone(id, auditState);
189 188
     	 return ResultView.success();
190 189
     }
191 190
     
@@ -201,6 +200,13 @@ public class ProcessAuditController {
201 200
     	 return ResultView.success();
202 201
     }
203 202
 
203
+    @ApiOperation(value = "根据待办条件:用户ID、类型、库ID,将流程设成已办", notes = "")
204
+    @GetMapping("/haveDone2/{userId}/{type}/{depotId}/{auditState}")
205
+    public ResultView haveDone(@PathVariable Integer userId, @PathVariable String type, @PathVariable Integer depotId,@PathVariable Integer auditState) {
206
+        processAuditService.haveDone(userId,type,depotId,auditState);
207
+        return ResultView.success();
208
+    }
209
+
204 210
 
205 211
     @Autowired
206 212
     private SystemFeign systemFeign;

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

@@ -48,6 +48,8 @@ public interface ProcessAuditService extends IService<ProcessAudit> {
48 48
 
49 49
 	void haveDone(Integer userId, String type, Integer depotId, Integer houseId,Integer auditState);
50 50
 
51
+	void haveDone(Integer userId, String type, Integer depotId, Integer auditState);
52
+
51 53
 	List<Integer> getNotBeDoneNotice(String toBeDoneIds);
52 54
 
53 55
 	void yjcgAudit(String parameter);

+ 54 - 50
src/main/java/com/unissoft/ventilation/service/impl/ProcessAuditServiceImpl.java

@@ -828,43 +828,26 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
828 828
         List<ToBeDoneCallbackVO> result = new ArrayList<>();
829 829
 
830 830
         String usersInfo = processToBeDone.getUsersInfo();
831
+        Integer levelDepotHouse = processToBeDone.getLevelDepotHouse();
831 832
         if (StringUtils.isNotEmpty(usersInfo)) {
832 833
             String[] userInfoArr = usersInfo.split(",");
833 834
             for (String userInfo : userInfoArr) {
834 835
                 String[] temp = userInfo.split("\\|");
835 836
                 Integer userId = Integer.parseInt(temp[0]);
836 837
                 SysUserDTO user = systemFeign.getUserById(userId);
837
-                String storehouseIds = user.getStorehouseIds();
838
-                String storehouseNames = user.getStorehouseNames();
839
-                if (StringUtils.isNotEmpty(storehouseIds)) {
840
-                    String[] houseIdArr = storehouseIds.split(",");
841
-                    String[] houseNameArr = storehouseNames.split(",");
842
-                    for (int i = 0; i < houseIdArr.length; i++) {
843
-                        String houseId = houseIdArr[i];
844
-                        String houseName = houseNameArr[i];
845
-                        ProcessToBeDoneVO toBeDoneVO = new ProcessToBeDoneVO();
846
-                        toBeDoneVO.setTitle(processToBeDone.getTitle());
847
-                        toBeDoneVO.setHouseId(Integer.parseInt(houseId));
848
-                        toBeDoneVO.setDepotId(user.getDepotId());
849
-                        toBeDoneVO.setStartDate(processToBeDone.getStartDate());
850
-                        toBeDoneVO.setEndDate(processToBeDone.getEndDate());
851
-                        toBeDoneVO.setToPage(processToBeDone.getToPage());
852
-                        toBeDoneVO.setUserId(userId);
853
-                        toBeDoneVO.setType(processToBeDone.getType());
854
-                        //
855
-                        ProcessAudit processAudit = toBeDone(toBeDoneVO);//生成待办数据
856
-                        //
857
-                        ToBeDoneCallbackVO toBeDoneCallbackVO = new ToBeDoneCallbackVO();
858
-                        toBeDoneCallbackVO.setToBeDoneId(processAudit.getId());
859
-                        toBeDoneCallbackVO.setUserId(userId);
860
-                        toBeDoneCallbackVO.setPersonnelName(user.getPersonnelName());
861
-                        toBeDoneCallbackVO.setDepotId(user.getDepotId());
862
-                        toBeDoneCallbackVO.setDepotName(user.getDepotName());
863
-                        toBeDoneCallbackVO.setHouseId(Integer.parseInt(houseId));
864
-                        toBeDoneCallbackVO.setHouseName(houseName);
865
-//                        toBeDoneCallbackVO.setTitle(processToBeDone.getTitle());
866
-
867
-                        result.add(toBeDoneCallbackVO);
838
+                if(1 == levelDepotHouse) {//预警到库级
839
+                    toBeDoneDetails(result, processToBeDone, user, null, null);
840
+                } else if(2 == levelDepotHouse) {//预警到仓房级
841
+                    String storehouseIds = user.getStorehouseIds();
842
+                    String storehouseNames = user.getStorehouseNames();
843
+                    if (StringUtils.isNotEmpty(storehouseIds)) {
844
+                        String[] houseIdArr = storehouseIds.split(",");
845
+                        String[] houseNameArr = storehouseNames.split(",");
846
+                        for (int i = 0; i < houseIdArr.length; i++) {
847
+                            Integer houseId = Integer.parseInt(houseIdArr[i]);
848
+                            String houseName = houseNameArr[i];
849
+                            toBeDoneDetails(result, processToBeDone, user, houseId, houseName);
850
+                        }
868 851
                     }
869 852
                 }
870 853
             }
@@ -873,22 +856,36 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
873 856
         return result;
874 857
     }
875 858
 
876
-//    private SendNoticeVO getSendNoticeVO(ProcessToBeDoneVO toBeDoneVO, SysUserDTO userDTO, String houseName) {
877
-//        SendNoticeVO vo = new SendNoticeVO();
878
-//        Map<Integer, String> users = new HashMap<>();
879
-//        users.put(userDTO.getUId(), userDTO.getUName());
880
-//        SysNoticeVO sysNoticeVO = new SysNoticeVO();
881
-//
882
-//        String content = toBeDoneVO.getTitle() + "-" + houseName + "-" + "待处理";
883
-//        sysNoticeVO.setContent(content);
884
-//        sysNoticeVO.setNoticeTime(new Date());
885
-//        sysNoticeVO.setNoticeType(10);
886
-//        sysNoticeVO.setOrgName(userDTO.getCompanyName());
887
-//
888
-//        vo.setUsers(users);
889
-//        vo.setSysNoticeVO(sysNoticeVO);
890
-//        return vo;
891
-//    }
859
+    private void toBeDoneDetails(List<ToBeDoneCallbackVO> result,
860
+                                 ProcessToBeDone processToBeDone,
861
+                                 SysUserDTO user,
862
+                                 Integer houseId,
863
+                                 String houseName) {
864
+        ProcessToBeDoneVO toBeDoneVO = new ProcessToBeDoneVO();
865
+        toBeDoneVO.setTitle(processToBeDone.getTitle());
866
+        toBeDoneVO.setHouseId(houseId);
867
+        toBeDoneVO.setDepotId(user.getDepotId());
868
+        toBeDoneVO.setStartDate(processToBeDone.getStartDate());
869
+        toBeDoneVO.setEndDate(processToBeDone.getEndDate());
870
+        toBeDoneVO.setToPage(processToBeDone.getToPage());
871
+        toBeDoneVO.setUserId(user.getUId());
872
+        toBeDoneVO.setType(processToBeDone.getType());
873
+        //
874
+        ProcessAudit processAudit = toBeDone(toBeDoneVO);//生成待办数据
875
+        //
876
+        ToBeDoneCallbackVO toBeDoneCallbackVO = new ToBeDoneCallbackVO();
877
+        toBeDoneCallbackVO.setToBeDoneId(processAudit.getId());
878
+        toBeDoneCallbackVO.setUserId(user.getUId());
879
+        toBeDoneCallbackVO.setPersonnelName(user.getPersonnelName());
880
+        toBeDoneCallbackVO.setDepotId(user.getDepotId());
881
+        toBeDoneCallbackVO.setDepotName(user.getDepotName());
882
+        toBeDoneCallbackVO.setHouseId(houseId);
883
+        toBeDoneCallbackVO.setHouseName(houseName);
884
+
885
+        result.add(toBeDoneCallbackVO);
886
+    }
887
+
888
+
892 889
 
893 890
     private ProcessAudit toBeDone(ProcessToBeDoneVO processToBeDone) {
894 891
         // TODO Auto-generated method stub
@@ -949,7 +946,6 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
949 946
 
950 947
     }
951 948
 
952
-
953 949
     @Override
954 950
     public void haveDone(Integer userId, String type, Integer depotId, Integer houseId, Integer auditState) {
955 951
         // TODO Auto-generated method stub
@@ -958,8 +954,12 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
958 954
         QueryWrapper<ProcessAudit> ew = new QueryWrapper<>();
959 955
         ew.eq("to_people", userId);
960 956
         ew.eq("type", type);
961
-        ew.eq("depot_id", depotId);
962
-        ew.eq("house_id", houseId);
957
+        if(null != depotId) {
958
+            ew.eq("depot_id", depotId);
959
+        }
960
+        if(null != houseId) {
961
+            ew.eq("house_id", houseId);
962
+        }
963 963
         ew.orderByDesc("start_date");//根据时间倒叙
964 964
         List<ProcessAudit> auditList = processAuditMapper.selectList(ew);
965 965
         if (auditList.size() > 0) {
@@ -969,7 +969,11 @@ public class ProcessAuditServiceImpl extends ServiceImpl<ProcessAuditMapper, Pro
969 969
             auditList.get(0).setOperationTime(sf.format(new Date()));//具体办理时的时间
970 970
             processAuditMapper.updateById(auditList.get(0));
971 971
         }
972
+    }
972 973
 
974
+    @Override
975
+    public void haveDone(Integer userId, String type, Integer depotId, Integer auditState) {
976
+        haveDone(userId, type, depotId, null, auditState);
973 977
     }
974 978
 
975 979
     @Override