|
@@ -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
|