Commit 682ad102 authored by 竹天卫's avatar 竹天卫

优化委托流程 产值计算功能

parent d4b376b3
...@@ -116,7 +116,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -116,7 +116,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
@Autowired @Autowired
private WeiXinService weiXinService; private WeiXinService weiXinService;
@Autowired @Autowired
IPrecipriceService iNormProductionService; private INormProductionService iNormProductionService;
@Autowired
private IPrecipriceService iPrecipriceService;
/** /**
...@@ -949,6 +951,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -949,6 +951,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setStatus(0) .setStatus(0)
.setAlias(handle.getName()); .setAlias(handle.getName());
sampleHandleEnclosureList.add(sampleHandleEnclosure); sampleHandleEnclosureList.add(sampleHandleEnclosure);
//获取产值信息
QueryWrapper<NormProduction> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("assess_id", handle.getId());
queryWrapper.eq("type", 0);
queryWrapper.eq("status", 1);
NormProduction normProduction = iNormProductionService.getOne(queryWrapper);
if(normProduction == null){
return BaseResponse.errorMsg("联系管理员.配置产值信息!");
}
} }
sampleHandleEnclosureService.saveBatch(sampleHandleEnclosureList); sampleHandleEnclosureService.saveBatch(sampleHandleEnclosureList);
} }
...@@ -1236,7 +1247,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1236,7 +1247,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sampleHandle.getContent() != null) { if (sampleHandle.getContent() != null) {
String[] handIdS = sampleHandle.getContent().split("、"); String[] handIdS = sampleHandle.getContent().split("、");
for (String handleId : handIdS) { for (String handleId : handIdS) {
iNormProductionService.createPreciprice(sampleHandle.getUserId(),entrust.getId(),Integer.valueOf(handleId),0,sample.getId()); try {
iPrecipriceService.createPreciprice(sampleHandle.getUserId(),entrust.getId(),Integer.valueOf(handleId),0,sample.getId());
}catch (Exception e){
return BaseResponse.errorMsg(e.getMessage());
}
} }
} }
QueryWrapper<SampleHandle> sampleHandleWrapper = new QueryWrapper<>(); QueryWrapper<SampleHandle> sampleHandleWrapper = new QueryWrapper<>();
...@@ -1329,6 +1344,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1329,6 +1344,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setStatus(0) .setStatus(0)
.setCreateTime(LocalDateTime.now()); .setCreateTime(LocalDateTime.now());
sampleDistributionList.add(sampleDistribution); sampleDistributionList.add(sampleDistribution);
//获取产值信息
QueryWrapper<NormProduction> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("assess_id", distributionTeamQuery.getTeamGroupId());
queryWrapper.eq("type", 1);
queryWrapper.eq("status", 1);
NormProduction normProduction = iNormProductionService.getOne(queryWrapper);
if(normProduction == null){
return BaseResponse.errorMsg("联系管理员.配置产值信息!");
}
//消息推送 //消息推送
BaseResponse wrapper = userMessageService.sendMessage(distributionTeamQuery.getUserId(), "您有一条样品检测信息等待接受",entrust.getId(), SysUserMessage.MessageType.ENTRUST); BaseResponse wrapper = userMessageService.sendMessage(distributionTeamQuery.getUserId(), "您有一条样品检测信息等待接受",entrust.getId(), SysUserMessage.MessageType.ENTRUST);
if(wrapper.getCode() != 200){ if(wrapper.getCode() != 200){
...@@ -1593,7 +1618,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1593,7 +1618,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List<SampleDistributionTeamVo> sampleDistributionTeamGroupVoList = distributionMapper.getDistributionTeamGroupList(sample.getId(), loginUser.getId()); List<SampleDistributionTeamVo> sampleDistributionTeamGroupVoList = distributionMapper.getDistributionTeamGroupList(sample.getId(), loginUser.getId());
if (sampleDistributionTeamGroupVoList != null && sampleDistributionTeamGroupVoList.size() > 0) { if (sampleDistributionTeamGroupVoList != null && sampleDistributionTeamGroupVoList.size() > 0) {
for (SampleDistributionTeamVo sdVo : sampleDistributionTeamGroupVoList) { for (SampleDistributionTeamVo sdVo : sampleDistributionTeamGroupVoList) {
iNormProductionService.createPreciprice(sdVo.getUserId(),entrust.getId(),sdVo.getTeamGroupId(),1,sample.getId()); try {
iPrecipriceService.createPreciprice(sdVo.getUserId(),entrust.getId(),sdVo.getTeamGroupId(),1,sample.getId());
}catch (Exception e){
return BaseResponse.errorMsg(e.getMessage());
}
} }
} }
sampleIdS.add(sample.getId()); sampleIdS.add(sample.getId());
......
...@@ -153,7 +153,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr ...@@ -153,7 +153,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
if (BeanUtil.isEmpty(normProduction)) { if (BeanUtil.isEmpty(normProduction)) {
log.debug("产值记录新增失败,产值信息没找到!"); log.debug("产值记录新增失败,产值信息没找到!");
throw new IllegalArgumentException("处理项产值未配置配置!"); throw new IllegalArgumentException("联系管理员.配置产值信息!");
} }
preciprice.setAnalyseRate(BigDecimal.valueOf(normProduction.getAnalyseRate())); preciprice.setAnalyseRate(BigDecimal.valueOf(normProduction.getAnalyseRate()));
preciprice.setAssessRate(BigDecimal.valueOf(normProduction.getAssessId())); preciprice.setAssessRate(BigDecimal.valueOf(normProduction.getAssessId()));
......
...@@ -50,24 +50,24 @@ public class WeiXinService { ...@@ -50,24 +50,24 @@ public class WeiXinService {
System.out.println("==================code==================="); System.out.println("==================code===================");
System.out.println(code); System.out.println(code);
try { try {
/*String accessToken = null; // String accessToken = null;
if (type.equals("PC")) { // if (type.equals("PC")) {
accessToken = getAccessToken(); // accessToken = getAccessToken();
} else if (type.equals("APP")) { // } else if (type.equals("APP")) {
accessToken = getPCAccessToken(); // accessToken = getPCAccessToken();
} else { // } else {
return BaseResponse.errorMsg("参数错误"); // return BaseResponse.errorMsg("参数错误");
} // }
String param = "access_token=%s&code=%s"; // String param = "access_token=%s&code=%s";
param = String.format(param, accessToken, code); // param = String.format(param, accessToken, code);
JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param); // JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param);
if (jsonObject.get("errcode").toString().equals("40029")) { // if (jsonObject.get("errcode").toString().equals("40029")) {
return BaseResponse.errorMsg("code失效!"); // return BaseResponse.errorMsg("code失效!");
} // }
String UserId = jsonObject.getString("UserId"); // String UserId = jsonObject.getString("UserId");
System.out.println("==================UserId==================="); // System.out.println("==================UserId===================");
System.out.println(UserId); // System.out.println(UserId);
JSONObject userJson = getUser(accessToken, UserId);*/ // JSONObject userJson = getUser(accessToken, UserId);
QueryWrapper<SysUser> wrapper = new QueryWrapper<>(); QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
// wrapper.eq("phone", userJson.get("mobile")); // wrapper.eq("phone", userJson.get("mobile"));
wrapper.eq("phone", code); //暂时用手机号代替code wrapper.eq("phone", code); //暂时用手机号代替code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment