Compare commits

...

2 Commits

6 changed files with 21 additions and 239 deletions

View File

@ -1102,12 +1102,12 @@ public class BaseKnifeController extends BaseController {
wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString()); wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString());
wmsInPlanDetail.setPlanInStatus("0"); wmsInPlanDetail.setPlanInStatus("0");
wmsInPlanDetailList.add(wmsInPlanDetail); wmsInPlanDetailList.add(wmsInPlanDetail);
wmsInPlanTemp.setWmsInPlanDetailsList(wmsInPlanDetailList); wmsInPlanTemp.setWmsInPlanDetailList(wmsInPlanDetailList);
wmsInPlanService.insertWmsInPlan(wmsInPlanTemp); wmsInPlanService.insertWmsInPlan(wmsInPlanTemp);
wmsInPlan = wmsInPlanTemp; wmsInPlan = wmsInPlanTemp;
} else { } else {
// 入库任务明细 // 入库任务明细
List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailsList(); List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailList();
WmsInPlanDetail wmsInPlanDetail = new WmsInPlanDetail(); WmsInPlanDetail wmsInPlanDetail = new WmsInPlanDetail();
wmsInPlanDetail.setMaterialId(zdTask.getmProductId().toString()); wmsInPlanDetail.setMaterialId(zdTask.getmProductId().toString());
wmsInPlanDetail.setBatch(batchNum); wmsInPlanDetail.setBatch(batchNum);
@ -1116,7 +1116,7 @@ public class BaseKnifeController extends BaseController {
wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString()); wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString());
wmsInPlanDetail.setPlanInStatus("0"); wmsInPlanDetail.setPlanInStatus("0");
wmsInPlanDetailList.add(wmsInPlanDetail); wmsInPlanDetailList.add(wmsInPlanDetail);
wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailList); wmsInPlan.setWmsInPlanDetailList(wmsInPlanDetailList);
wmsInPlanService.updateWmsInPlan(wmsInPlan); wmsInPlanService.updateWmsInPlan(wmsInPlan);
} }

View File

@ -6,17 +6,8 @@ import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType; import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.domain.WmsBusinessType;
import com.ktg.mes.md.mapper.MdItemMapper;
import com.ktg.mes.md.service.IAP0AEService;
import com.ktg.mes.md.service.IMdItemService;
import com.ktg.mes.md.service.IWmsBusinessTypeService;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.WmsInPlan; import com.ktg.mes.wm.domain.WmsInPlan;
import com.ktg.mes.wm.domain.WmsInPlanDetail;
import com.ktg.mes.wm.domain.dto.WmsInboundOrderDto; import com.ktg.mes.wm.domain.dto.WmsInboundOrderDto;
import com.ktg.mes.wm.service.IWmStorageLocationService;
import com.ktg.mes.wm.service.IWmsInPlanService; import com.ktg.mes.wm.service.IWmsInPlanService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -24,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Collections;
import java.util.List; import java.util.List;
/** /**
@ -38,10 +28,6 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class WmsInPlanController extends BaseController { public class WmsInPlanController extends BaseController {
private final IWmsInPlanService wmsInPlanService; private final IWmsInPlanService wmsInPlanService;
private final IWmStorageLocationService wmStorageLocationService;
private final MdItemMapper mdItemMapper;
private final IWmsBusinessTypeService wmsBusinessTypeService;
private final IMdItemService mdItemService;
/** /**
* 查询入库计划列表 * 查询入库计划列表

View File

@ -3,6 +3,8 @@ package com.ktg.mes.wm.domain;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
@ -14,6 +16,8 @@ import com.ktg.common.core.domain.BaseEntity;
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
@Getter
@Setter
public class WmsInPlan extends BaseEntity { public class WmsInPlan extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -169,214 +173,6 @@ public class WmsInPlan extends BaseEntity {
*/ */
private List<WmsInPlanDetail> wmsInPlanDetailList; private List<WmsInPlanDetail> wmsInPlanDetailList;
public void setPlanId(Long planId) {
this.planId = planId;
}
public Long getPlanId() {
return planId;
}
public void setState(String state) {
this.state = state;
}
public String getState() {
return state;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getSourceType() {
return sourceType;
}
public void setWareId(String wareId) {
this.wareId = wareId;
}
public String getWareId() {
return wareId;
}
public void setCellCode(String cellCode) {
this.cellCode = cellCode;
}
public String getCellCode() {
return cellCode;
}
public void setWorkOrderCode(String workOrderCode) {
this.workOrderCode = workOrderCode;
}
public String getWorkOrderCode() {
return workOrderCode;
}
public void setExpectDate(Date expectDate) {
this.expectDate = expectDate;
}
public Date getExpectDate() {
return expectDate;
}
public void setPublishName(String publishName) {
this.publishName = publishName;
}
public String getPublishName() {
return publishName;
}
public void setPublishTime(String publishTime) {
this.publishTime = publishTime;
}
public String getPublishTime() {
return publishTime;
}
public void setCloserId(String closerId) {
this.closerId = closerId;
}
public String getCloserId() {
return closerId;
}
public void setCloseTime(String closeTime) {
this.closeTime = closeTime;
}
public String getCloseTime() {
return closeTime;
}
public void setRelBillCode(String relBillCode) {
this.relBillCode = relBillCode;
}
public String getRelBillCode() {
return relBillCode;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getCustomerId() {
return customerId;
}
public void setPoCode(String poCode) {
this.poCode = poCode;
}
public String getPoCode() {
return poCode;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentId() {
return departmentId;
}
public void setContractNo(String contractNo) {
this.contractNo = contractNo;
}
public String getContractNo() {
return contractNo;
}
public void setSupplierId(String supplierId) {
this.supplierId = supplierId;
}
public String getSupplierId() {
return supplierId;
}
public void setBusinessTypeId(String businessTypeId) {
this.businessTypeId = businessTypeId;
}
public String getBusinessTypeId() {
return businessTypeId;
}
public void setSrcOutTaskId(String srcOutTaskId) {
this.srcOutTaskId = srcOutTaskId;
}
public String getSrcOutTaskId() {
return srcOutTaskId;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getIsActive() {
return isActive;
}
public void setIsDelete(String isDelete) {
this.isDelete = isDelete;
}
public String getIsDelete() {
return isDelete;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setPlanTypeId(Long planTypeId) {
this.planTypeId = planTypeId;
}
public Long getPlanTypeId() {
return planTypeId;
}
public String getPlanTypeCode() {
return planTypeCode;
}
public void setPlanTypeCode(String planTypeCode) {
this.planTypeCode = planTypeCode;
}
public List<WmsInPlanDetail> getWmsInPlanDetailsList() {
return wmsInPlanDetailList;
}
public void setWmsInPlanDetailsList(List<WmsInPlanDetail> wmsInPlanDetailList) {
this.wmsInPlanDetailList = wmsInPlanDetailList;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -409,7 +205,7 @@ public class WmsInPlan extends BaseEntity {
.append("planCode", getPlanCode()) .append("planCode", getPlanCode())
.append("planTypeId", getPlanTypeId()) .append("planTypeId", getPlanTypeId())
.append("planTypeCode", getPlanTypeCode()) .append("planTypeCode", getPlanTypeCode())
.append("wmsInPlanDetailsList", getWmsInPlanDetailsList()) .append("wmsInPlanDetailsList", getWmsInPlanDetailList())
.toString(); .toString();
} }
} }

View File

@ -70,7 +70,7 @@ public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityS
// 获取入库计划 // 获取入库计划
WmsBusinessType wmsBusinessType = wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getPlanTypeId().toString()); WmsBusinessType wmsBusinessType = wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getPlanTypeId().toString());
for (WmsInPlanDetail detail : wmsInPlan.getWmsInPlanDetailsList()) { for (WmsInPlanDetail detail : wmsInPlan.getWmsInPlanDetailList()) {
// 匹配入库明细 // 匹配入库明细
if (detail.getDetailsId().equals(entity.getPlanDetailsId())) { if (detail.getDetailsId().equals(entity.getPlanDetailsId())) {
System.out.println("---" + detail.getDetailsId() + "+测试+" + entity.getPlanDetailsId()); System.out.println("---" + detail.getDetailsId() + "+测试+" + entity.getPlanDetailsId());

View File

@ -62,14 +62,14 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
public WmsInPlan selectWmsInPlanByPlanId(Long planId) { public WmsInPlan selectWmsInPlanByPlanId(Long planId) {
WmsInPlan wmsInPlan = wmsInPlanMapper.selectWmsInPlanByPlanId(planId); WmsInPlan wmsInPlan = wmsInPlanMapper.selectWmsInPlanByPlanId(planId);
List<WmsInPlanDetail> wmsInPlanDetailList = new ArrayList<>(); List<WmsInPlanDetail> wmsInPlanDetailList = new ArrayList<>();
wmsInPlan.getWmsInPlanDetailsList().forEach(detail -> { wmsInPlan.getWmsInPlanDetailList().forEach(detail -> {
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity(); WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
wmsInPlanDetailEntityQuery.setPlanDetailsId(detail.getDetailsId()); wmsInPlanDetailEntityQuery.setPlanDetailsId(detail.getDetailsId());
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery); List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery);
detail.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList); detail.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInPlanDetailList.add(detail); wmsInPlanDetailList.add(detail);
}); });
wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailList); wmsInPlan.setWmsInPlanDetailList(wmsInPlanDetailList);
return wmsInPlan; return wmsInPlan;
} }
@ -127,7 +127,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
wmsInPlanDetail.setQuantityIn(ap0ae.getQuantity().toString()); wmsInPlanDetail.setQuantityIn(ap0ae.getQuantity().toString());
wmsInPlanDetail.setMaterialId(mdItem.getItemId().toString()); wmsInPlanDetail.setMaterialId(mdItem.getItemId().toString());
wmsInPlan.setWmsInPlanDetailsList(Collections.singletonList(wmsInPlanDetail)); wmsInPlan.setWmsInPlanDetailList(Collections.singletonList(wmsInPlanDetail));
this.insertWmsInPlan(wmsInPlan); this.insertWmsInPlan(wmsInPlan);
// 执行入库计划 // 执行入库计划
@ -215,7 +215,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
* @param wmsInPlan 入库计划对象 * @param wmsInPlan 入库计划对象
*/ */
public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) { public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) {
List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailsList(); List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailList();
Long planId = wmsInPlan.getPlanId(); Long planId = wmsInPlan.getPlanId();
if (StringUtils.isNotNull(wmsInPlanDetailList)) { if (StringUtils.isNotNull(wmsInPlanDetailList)) {
List<WmsInPlanDetail> list = new ArrayList<>(); List<WmsInPlanDetail> list = new ArrayList<>();
@ -226,7 +226,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
if (!list.isEmpty()) { if (!list.isEmpty()) {
wmsInPlanMapper.batchWmsInPlanDetails(list); wmsInPlanMapper.batchWmsInPlanDetails(list);
WmsInPlan wmsInPlan1 = selectWmsInPlanByPlanId(planId); WmsInPlan wmsInPlan1 = selectWmsInPlanByPlanId(planId);
List<WmsInPlanDetail> wmsInPlanDetailList1 = wmsInPlan1.getWmsInPlanDetailsList(); List<WmsInPlanDetail> wmsInPlanDetailList1 = wmsInPlan1.getWmsInPlanDetailList();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = list.get(i).getWmsInPlanDetailEntityList(); List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = list.get(i).getWmsInPlanDetailEntityList();
wmsInPlanDetailList1.get(i).setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList); wmsInPlanDetailList1.get(i).setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
@ -285,7 +285,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
WmsInTask wmsInTask = new WmsInTask(); WmsInTask wmsInTask = new WmsInTask();
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
wmsInPlan.getWmsInPlanDetailsList().forEach(detail -> { wmsInPlan.getWmsInPlanDetailList().forEach(detail -> {
int index = atomicInteger.getAndIncrement(); int index = atomicInteger.getAndIncrement();
wmsInTask.setPlanInId(wmsInPlan.getPlanId()); wmsInTask.setPlanInId(wmsInPlan.getPlanId());
@ -332,7 +332,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
public void autoCell(WmsInPlan wmsInPlan) { public void autoCell(WmsInPlan wmsInPlan) {
// 校验是否指定了库区 // 校验是否指定了库区
if (StringUtils.isNotEmpty(wmsInPlan.getLocationCode())) { if (StringUtils.isNotEmpty(wmsInPlan.getLocationCode())) {
wmsInPlan.getWmsInPlanDetailsList().forEach(wmsInPlanDetails -> { wmsInPlan.getWmsInPlanDetailList().forEach(wmsInPlanDetails -> {
// 获得物料ID // 获得物料ID
MdItem mdItemById = mdItemService.selectMdItemById(Long.parseLong(wmsInPlanDetails.getMaterialId())); MdItem mdItemById = mdItemService.selectMdItemById(Long.parseLong(wmsInPlanDetails.getMaterialId()));
if (mdItemById == null) throw new RuntimeException("操作失败,该物料不存在"); if (mdItemById == null) throw new RuntimeException("操作失败,该物料不存在");
@ -378,7 +378,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
wmsInPlanDetail.setQuantity(wmsInboundOrderDto.getQuantity().toString()); wmsInPlanDetail.setQuantity(wmsInboundOrderDto.getQuantity().toString());
wmsInPlanDetail.setQuantityIn(wmsInboundOrderDto.getQuantity().toString()); wmsInPlanDetail.setQuantityIn(wmsInboundOrderDto.getQuantity().toString());
wmsInPlanDetail.setMaterialId(mdItem.getItemId().toString()); wmsInPlanDetail.setMaterialId(mdItem.getItemId().toString());
wmsInPlan.setWmsInPlanDetailsList(Collections.singletonList(wmsInPlanDetail)); wmsInPlan.setWmsInPlanDetailList(Collections.singletonList(wmsInPlanDetail));
// 整刀回库 // 整刀回库
if (StringUtils.equals(wmsInboundOrderDto.getTypeCode(), "ZDHK")) { if (StringUtils.equals(wmsInboundOrderDto.getTypeCode(), "ZDHK")) {
// 如果是整刀回库入库数量限制为 1 // 如果是整刀回库入库数量限制为 1

View File

@ -441,12 +441,12 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
}); });
wmsInPlanDetail.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList); wmsInPlanDetail.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInPlanDetailList.add(wmsInPlanDetail); wmsInPlanDetailList.add(wmsInPlanDetail);
wmsInPlanTemp.setWmsInPlanDetailsList(wmsInPlanDetailList); wmsInPlanTemp.setWmsInPlanDetailList(wmsInPlanDetailList);
wmsInPlanService.insertWmsInPlan(wmsInPlanTemp); wmsInPlanService.insertWmsInPlan(wmsInPlanTemp);
wmsInPlan = wmsInPlanTemp; wmsInPlan = wmsInPlanTemp;
} else { } else {
// 入库任务明细 // 入库任务明细
List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailsList(); List<WmsInPlanDetail> wmsInPlanDetailList = wmsInPlan.getWmsInPlanDetailList();
WmsInPlanDetail wmsInPlanDetail = new WmsInPlanDetail(); WmsInPlanDetail wmsInPlanDetail = new WmsInPlanDetail();
wmsInPlanDetail.setMaterialId(zdTask.getmProductId().toString()); wmsInPlanDetail.setMaterialId(zdTask.getmProductId().toString());
wmsInPlanDetail.setBatch(batchNum); wmsInPlanDetail.setBatch(batchNum);
@ -455,7 +455,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString()); wmsInPlanDetail.setQuantityIn(zdTask.getProductIdQty().toString());
wmsInPlanDetail.setPlanInStatus("0"); wmsInPlanDetail.setPlanInStatus("0");
wmsInPlanDetailList.add(wmsInPlanDetail); wmsInPlanDetailList.add(wmsInPlanDetail);
wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailList); wmsInPlan.setWmsInPlanDetailList(wmsInPlanDetailList);
wmsInPlanService.updateWmsInPlan(wmsInPlan); wmsInPlanService.updateWmsInPlan(wmsInPlan);
} }
@ -479,7 +479,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
wmsInTask.setPlanTypeId("9"); wmsInTask.setPlanTypeId("9");
wmsInTask.setPlanTypeCode("ZDHK"); wmsInTask.setPlanTypeCode("ZDHK");
wmsInTask.setPlanInStatus("0"); wmsInTask.setPlanInStatus("0");
wmsInTask.setDetailInId(inPlanTemp.getWmsInPlanDetailsList().get(0).getDetailsId()); wmsInTask.setDetailInId(inPlanTemp.getWmsInPlanDetailList().get(0).getDetailsId());
wmsInTask.setCreateBy(getUsername()); wmsInTask.setCreateBy(getUsername());
wmsInTask.setCreateTime(DateUtils.getNowDate()); wmsInTask.setCreateTime(DateUtils.getNowDate());
wmsInTaskMapper.insertWmsInTask(wmsInTask); wmsInTaskMapper.insertWmsInTask(wmsInTask);