From 1674f2b873da35814f5f1bdd199b0b37d5d04a3b Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 23 十月 2025 09:07:31 +0800
Subject: [PATCH] 最新版本541200007
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java | 91 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 86 insertions(+), 5 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java
index 1c94748..ed86b04 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java
@@ -1,20 +1,33 @@
package com.doumee.service.business.impl;
-import com.doumee.core.model.PageData;
-import com.doumee.core.model.PageWrap;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.biz.system.SystemUserBiz;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.service.business.third.model.PageData;
+import com.doumee.service.business.third.model.PageWrap;
+import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.PlatformWmsDetailMapper;
import com.doumee.dao.business.PlatformWmsJobMapper;
+import com.doumee.dao.business.model.PlatformWmsDetail;
import com.doumee.dao.business.model.PlatformWmsJob;
+import com.doumee.dao.business.vo.WmsJobContractVO;
import com.doumee.service.business.PlatformWmsJobService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
-import java.util.List;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.function.BinaryOperator;
+import java.util.function.Function;
+import java.util.stream.Collectors;
/**
* 鏈堝彴_WMS浣滀笟閫氱煡鍗曡鏁版嵁Service瀹炵幇
@@ -26,6 +39,11 @@
@Autowired
private PlatformWmsJobMapper platformWmsJobMapper;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
+ @Autowired
+ private PlatformWmsDetailMapper platformWmsDetailMapper;
@Override
public Integer create(PlatformWmsJob platformWmsJob) {
@@ -72,6 +90,71 @@
return platformWmsJobMapper.selectById(id);
}
+
+
+ @Override
+ public PlatformWmsJob findByDetailId(Integer id) {
+ PlatformWmsJob platformWmsJob = platformWmsJobMapper.selectOne(new QueryWrapper<PlatformWmsJob>().
+ lambda().eq(PlatformWmsJob::getIsdeleted, Constants.ZERO)
+ .eq(PlatformWmsJob::getJobId,id).last(" limit 1 "));
+ if(Objects.isNull(platformWmsJob)){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏈煡璇㈠埌杩愬崟淇℃伅");
+ }
+ String codeStr =systemDictDataBiz.queryByCode(Constants.WMS_PARAM, Constants.WMS_IN_REPERTOTY_CODE_LIST).getCode();
+ List<PlatformWmsDetail> platformWmsDetailList = platformWmsDetailMapper.selectList(new QueryWrapper<PlatformWmsDetail>()
+ .lambda().eq(PlatformWmsDetail::getJobId,id).eq(PlatformWmsDetail::getIsdeleted, Constants.ZERO));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformWmsDetailList)){
+ platformWmsJob.setIoQty(
+ platformWmsDetailList.stream().map(m->m.getIoQty()).reduce(BigDecimal.ZERO,BigDecimal::add)
+ );
+ for(PlatformWmsDetail d :platformWmsDetailList){
+ if(StringUtils.isNotBlank(d.getInRepertotyCode())){
+ //渚涘簲鍟嗗悕绉�
+ d.setInRepertotyName(Constants.getWmsAreasNameByCode(codeStr,d.getInRepertotyCode()));
+ }
+ }
+ //鑾峰彇鎵�鏈夊悎鍚屽彿(鍘婚噸锛�
+ List<String> ioCodeList = platformWmsDetailList.stream().map(m->m.getContractNum()).distinct().collect(Collectors.toList());
+ Set<String> ioCodeSet = new HashSet<String>(ioCodeList);
+ List<WmsJobContractVO> wmsJobContractVOList = new ArrayList<>();
+ for (String ioCode:ioCodeSet) {
+ if(StringUtils.isBlank(ioCode)){
+// continue;
+ }
+ WmsJobContractVO wmsJobContractVO = new WmsJobContractVO();
+ wmsJobContractVO.setContractCode(ioCode);
+ wmsJobContractVO.setPlatformWmsDetailList(
+ platformWmsDetailList.stream().filter(i-> StringUtils.equals(i.getContractNum(),ioCode)).collect(Collectors.toList())
+ );
+ if(wmsJobContractVO.getPlatformWmsDetailList()!=null&& wmsJobContractVO.getPlatformWmsDetailList().size()>0){
+ wmsJobContractVO.setAddress(wmsJobContractVO.getPlatformWmsDetailList().get(0).getRepertotyAddress());
+ }
+ if(Objects.isNull(wmsJobContractVO.getLockStatus())&&
+ com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(wmsJobContractVO.getPlatformWmsDetailList())){
+ if(Constants.equalsInteger(platformWmsJob.getType(),Constants.ONE)){
+ if(Objects.isNull(wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getLockStatus())){
+ wmsJobContractVO.setLockStatus(Constants.ZERO
+ );
+ }else{
+ wmsJobContractVO.setLockStatus(
+ wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getLockStatus()
+ );
+ }
+ wmsJobContractVO.setStatus(
+ wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getStatus()
+ );
+ }
+ }
+ wmsJobContractVOList.add(wmsJobContractVO);
+ }
+
+ platformWmsJob.setWmsJobContractVOList(wmsJobContractVOList);
+ }else{
+ platformWmsJob.setIoQty(BigDecimal.ZERO);
+ }
+ return platformWmsJob;
+ }
+
@Override
public PlatformWmsJob findOne(PlatformWmsJob platformWmsJob) {
QueryWrapper<PlatformWmsJob> wrapper = new QueryWrapper<>(platformWmsJob);
@@ -106,8 +189,6 @@
.eq(pageWrap.getModel().getDriverName() != null, PlatformWmsJob::getDriverName, pageWrap.getModel().getDriverName())
.eq(pageWrap.getModel().getCarrierName() != null, PlatformWmsJob::getCarrierName, pageWrap.getModel().getCarrierName())
.eq(pageWrap.getModel().getCarryBillCode() != null, PlatformWmsJob::getCarryBillCode, pageWrap.getModel().getCarryBillCode())
- .ge(pageWrap.getModel().getIoCreatedate() != null, PlatformWmsJob::getIoCreatedate, Utils.Date.getStart(pageWrap.getModel().getIoCreatedate()))
- .le(pageWrap.getModel().getIoCreatedate() != null, PlatformWmsJob::getIoCreatedate, Utils.Date.getEnd(pageWrap.getModel().getIoCreatedate()))
.eq(pageWrap.getModel().getStatus() != null, PlatformWmsJob::getStatus, pageWrap.getModel().getStatus())
.ge(pageWrap.getModel().getCancelDate() != null, PlatformWmsJob::getCancelDate, Utils.Date.getStart(pageWrap.getModel().getCancelDate()))
.le(pageWrap.getModel().getCancelDate() != null, PlatformWmsJob::getCancelDate, Utils.Date.getEnd(pageWrap.getModel().getCancelDate()))
--
Gitblit v1.9.3