|
@@ -2,6 +2,7 @@ package com.fjhx.applet.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.applet.mapper.MaterialReceiveMapper;
|
|
|
import com.fjhx.applet.service.MaterialReceiveService;
|
|
@@ -12,7 +13,9 @@ import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -23,7 +26,7 @@ public class MaterialReceiveServiceImpl extends ServiceImpl<MaterialReceiveMappe
|
|
|
private IUserClient userClient;
|
|
|
|
|
|
@Override
|
|
|
- public synchronized void submit() {
|
|
|
+ public synchronized void submit(String checkUserId) {
|
|
|
|
|
|
List<Map<String, Object>> list = baseMapper.selectWaterDetail();
|
|
|
|
|
@@ -33,44 +36,40 @@ public class MaterialReceiveServiceImpl extends ServiceImpl<MaterialReceiveMappe
|
|
|
|
|
|
List<Map<String, Object>> outList = stockChangeType.get(29);
|
|
|
if (outList != null) {
|
|
|
- StringJoiner outJoiner = new StringJoiner(",", "(", ")");
|
|
|
- HashSet<String> waterIdSet = new HashSet<>();
|
|
|
-
|
|
|
- for (Map<String, Object> map : outList) {
|
|
|
- outJoiner.add(map.get("id").toString());
|
|
|
- waterIdSet.add(map.get("waterId").toString() + "," + map.get("userId").toString());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (waterIdSet.size() > 0) {
|
|
|
- String uuid = UUID.randomUUID().toString();
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
+ String flowLinkId = list.get(0).get("id").toString();
|
|
|
+
|
|
|
+
|
|
|
+ baseMapper.insertFlowApplyCheck(
|
|
|
+ IdWorker.getIdStr(),
|
|
|
+ "202208240000000000000000001",
|
|
|
+ "20220824000000000000000000101",
|
|
|
+ null,
|
|
|
+ "20220824000000000000000000102",
|
|
|
+ checkUserId,
|
|
|
+ "0",
|
|
|
+ null,
|
|
|
+ flowLinkId,
|
|
|
+ "物料接收"
|
|
|
+ );
|
|
|
|
|
|
|
|
|
- baseMapper.updateReceive(outJoiner.toString(), 1);
|
|
|
+ List<String> idList = outList.stream().map(item -> item.get("id").toString()).collect(Collectors.toList());
|
|
|
+ baseMapper.updateReceive(idList, 0, 23, 1, flowLinkId);
|
|
|
}
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> repairList = stockChangeType.get(30);
|
|
|
if (repairList != null) {
|
|
|
- StringJoiner repairJoiner = new StringJoiner(",", "(", ")");
|
|
|
- HashSet<String> accountSet = new HashSet<>();
|
|
|
- for (Map<String, Object> map : repairList) {
|
|
|
- repairJoiner.add(map.get("id").toString());
|
|
|
- accountSet.add(map.get("account").toString());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- baseMapper.updateReceive(repairJoiner.toString(), 2);
|
|
|
|
|
|
|
|
|
- Map<String, String> accountMap = userClient.getOpenidByAccount(new ArrayList<>(accountSet));
|
|
|
- for (String account : accountSet) {
|
|
|
+ List<String> accountList = repairList.stream()
|
|
|
+ .map(item -> item.get("account").toString()).distinct().collect(Collectors.toList());
|
|
|
+ Map<String, String> accountMap = userClient.getOpenidByAccount(accountList);
|
|
|
+
|
|
|
+ for (String account : accountList) {
|
|
|
String openId = accountMap.get(account);
|
|
|
-
|
|
|
if (ObjectUtil.isNotEmpty(openId)) {
|
|
|
Integer num = baseMapper.countNum(account);
|
|
|
WxAppletUtil.UniformSendEntity uniformSendEntity = new WxAppletUtil.UniformSendEntity();
|
|
@@ -84,6 +83,8 @@ public class MaterialReceiveServiceImpl extends ServiceImpl<MaterialReceiveMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ List<String> idList = repairList.stream().map(item -> item.get("id").toString()).collect(Collectors.toList());
|
|
|
+ baseMapper.updateReceive(idList, null, 20, 2, null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -101,10 +102,42 @@ public class MaterialReceiveServiceImpl extends ServiceImpl<MaterialReceiveMappe
|
|
|
Assert.notEmpty(idList, "id列表不能为空");
|
|
|
Assert.notEmpty(operation, "操作类型不能为空");
|
|
|
|
|
|
- StringJoiner idJoiner = new StringJoiner(",", "(", ")");
|
|
|
- idList.forEach(idJoiner::add);
|
|
|
+ baseMapper.updateReceive(idList, null, null, operation, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> flowDetails(Map<String, String> condition) {
|
|
|
+ String flowLinkId = condition.get("flowLinkId");
|
|
|
+ return baseMapper.flowDetails(flowLinkId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleFlow(Map<String, String> condition) {
|
|
|
+
|
|
|
+ String checkUserId = condition.get("checkUserId");
|
|
|
+
|
|
|
+ String flowLinkId = condition.get("flowLinkId");
|
|
|
+
|
|
|
+ String checkState = condition.get("checkState");
|
|
|
+
|
|
|
+ String suggestions = condition.get("suggestions");
|
|
|
+
|
|
|
+
|
|
|
+ baseMapper.insertFlowApplyCheck(
|
|
|
+ IdWorker.getIdStr(),
|
|
|
+ "202208240000000000000000001",
|
|
|
+ "20220824000000000000000000102",
|
|
|
+ "20220824000000000000000000101",
|
|
|
+ null,
|
|
|
+ checkUserId,
|
|
|
+ checkState,
|
|
|
+ suggestions,
|
|
|
+ flowLinkId,
|
|
|
+ "物料接收"
|
|
|
+ );
|
|
|
+
|
|
|
+ baseMapper.updatePickingStatus(flowLinkId, checkState);
|
|
|
|
|
|
- baseMapper.updateReceive(idJoiner.toString(), operation);
|
|
|
}
|
|
|
|
|
|
}
|