diff --git a/ktg-common/src/main/java/com/ktg/common/constant/UserConstants.java b/ktg-common/src/main/java/com/ktg/common/constant/UserConstants.java index 4ecc7f1..146f80f 100644 --- a/ktg-common/src/main/java/com/ktg/common/constant/UserConstants.java +++ b/ktg-common/src/main/java/com/ktg/common/constant/UserConstants.java @@ -144,6 +144,9 @@ public class UserConstants public static final String TRANSACTION_TYPE_ITEM_ISSUE_OUT = "ITEM_ISSUE_OUT"; //生产领用-出库事务 public static final String TRANSACTION_TYPE_ITEM_ISSUE_IN = "ITEM_ISSUE_IN"; //生产领用-入库事务 + public static final String TRANSACTION_TYPE_OUTSOURCE_ISSUE_OUT ="OUTSOURCE_ISSUE_OUT"; //外协领用-出库事务 + public static final String TRANSACTION_TYPE_OUTSOURCE_RECPT_IN ="OUTSOURCE_RECPT_IN"; //外协入库-入库事务 + public static final String TRANSACTION_TYPE_ITEM_RT_ISSUE_OUT = "ITEM_RT_ISSUE_OUT"; //生产退料-出库事务 public static final String TRANSACTION_TYPE_ITEM_RT_ISSUE_IN = "ITEM_RT_ISSUE_IN"; //生产退料-入库事务 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSipController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSipController.java new file mode 100644 index 0000000..fa65db3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSipController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.md.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.md.domain.MdProductSip; +import com.ktg.mes.md.service.IMdProductSipService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 产品SIPController + * + * @author yinjinlu + * @date 2023-10-31 + */ +@RestController +@RequestMapping("/mes/md/sip") +public class MdProductSipController extends BaseController +{ + @Autowired + private IMdProductSipService mdProductSipService; + + /** + * 查询产品SIP列表 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:list')") + @GetMapping("/list") + public TableDataInfo list(MdProductSip mdProductSip) + { + startPage(); + List list = mdProductSipService.selectMdProductSipList(mdProductSip); + return getDataTable(list); + } + + /** + * 导出产品SIP列表 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:export')") + @Log(title = "产品SIP", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MdProductSip mdProductSip) + { + List list = mdProductSipService.selectMdProductSipList(mdProductSip); + ExcelUtil util = new ExcelUtil(MdProductSip.class); + util.exportExcel(response, list, "产品SIP数据"); + } + + /** + * 获取产品SIP详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:query')") + @GetMapping(value = "/{sipId}") + public AjaxResult getInfo(@PathVariable("sipId") Long sipId) + { + return AjaxResult.success(mdProductSipService.selectMdProductSipBySipId(sipId)); + } + + /** + * 新增产品SIP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:add')") + @Log(title = "产品SIP", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MdProductSip mdProductSip) + { + return toAjax(mdProductSipService.insertMdProductSip(mdProductSip)); + } + + /** + * 修改产品SIP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:edit')") + @Log(title = "产品SIP", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MdProductSip mdProductSip) + { + return toAjax(mdProductSipService.updateMdProductSip(mdProductSip)); + } + + /** + * 删除产品SIP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sip:remove')") + @Log(title = "产品SIP", businessType = BusinessType.DELETE) + @DeleteMapping("/{sipIds}") + public AjaxResult remove(@PathVariable Long[] sipIds) + { + return toAjax(mdProductSipService.deleteMdProductSipBySipIds(sipIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSOPMobController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/mobile/MdProductSOPMobController.java similarity index 93% rename from ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSOPMobController.java rename to ktg-mes/src/main/java/com/ktg/mes/md/controller/mobile/MdProductSOPMobController.java index e67fca8..d2b771e 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProductSOPMobController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/mobile/MdProductSOPMobController.java @@ -1,8 +1,7 @@ -package com.ktg.mes.md.controller; +package com.ktg.mes.md.controller.mobile; import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.domain.AjaxResult; -import com.ktg.common.core.page.TableDataInfo; import com.ktg.mes.md.domain.MdProductSop; import com.ktg.mes.md.service.IMdProductSopService; import io.swagger.annotations.ApiOperation; diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductSip.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductSip.java new file mode 100644 index 0000000..930816d --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductSip.java @@ -0,0 +1,206 @@ +package com.ktg.mes.md.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 产品SIP对象 md_product_sip + * + * @author yinjinlu + * @date 2023-10-31 + */ +public class MdProductSip extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 记录ID */ + private Long sipId; + + /** 物料产品ID */ + @Excel(name = "物料产品ID") + private Long itemId; + + /** 排列顺序 */ + @Excel(name = "排列顺序") + private Integer orderNum; + + /** 对应的工序 */ + @Excel(name = "对应的工序") + private Long processId; + + /** 工序编号 */ + @Excel(name = "工序编号") + private String processCode; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 标题 */ + @Excel(name = "标题") + private String sipTitle; + + /** 详细描述 */ + @Excel(name = "详细描述") + private String sipDescription; + + /** 图片地址 */ + @Excel(name = "图片地址") + private String sipUrl; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setSipId(Long sipId) + { + this.sipId = sipId; + } + + public Long getSipId() + { + return sipId; + } + public void setItemId(Long itemId) + { + this.itemId = itemId; + } + + public Long getItemId() + { + return itemId; + } + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public Integer getOrderNum() + { + return orderNum; + } + public void setProcessId(Long processId) + { + this.processId = processId; + } + + public Long getProcessId() + { + return processId; + } + public void setProcessCode(String processCode) + { + this.processCode = processCode; + } + + public String getProcessCode() + { + return processCode; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setSipTitle(String sipTitle) + { + this.sipTitle = sipTitle; + } + + public String getSipTitle() + { + return sipTitle; + } + public void setSipDescription(String sipDescription) + { + this.sipDescription = sipDescription; + } + + public String getSipDescription() + { + return sipDescription; + } + public void setSipUrl(String sipUrl) + { + this.sipUrl = sipUrl; + } + + public String getSipUrl() + { + return sipUrl; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(Long attr3) + { + this.attr3 = attr3; + } + + public Long getAttr3() + { + return attr3; + } + public void setAttr4(Long attr4) + { + this.attr4 = attr4; + } + + public Long getAttr4() + { + return attr4; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("sipId", getSipId()) + .append("itemId", getItemId()) + .append("orderNum", getOrderNum()) + .append("processId", getProcessId()) + .append("processCode", getProcessCode()) + .append("processName", getProcessName()) + .append("sipTitle", getSipTitle()) + .append("sipDescription", getSipDescription()) + .append("sipUrl", getSipUrl()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProductSipMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProductSipMapper.java new file mode 100644 index 0000000..52d59ab --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProductSipMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.md.mapper; + +import java.util.List; +import com.ktg.mes.md.domain.MdProductSip; + +/** + * 产品SIPMapper接口 + * + * @author yinjinlu + * @date 2023-10-31 + */ +public interface MdProductSipMapper +{ + /** + * 查询产品SIP + * + * @param sipId 产品SIP主键 + * @return 产品SIP + */ + public MdProductSip selectMdProductSipBySipId(Long sipId); + + /** + * 查询产品SIP列表 + * + * @param mdProductSip 产品SIP + * @return 产品SIP集合 + */ + public List selectMdProductSipList(MdProductSip mdProductSip); + + /** + * 新增产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + public int insertMdProductSip(MdProductSip mdProductSip); + + /** + * 修改产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + public int updateMdProductSip(MdProductSip mdProductSip); + + /** + * 删除产品SIP + * + * @param sipId 产品SIP主键 + * @return 结果 + */ + public int deleteMdProductSipBySipId(Long sipId); + + /** + * 批量删除产品SIP + * + * @param sipIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMdProductSipBySipIds(Long[] sipIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProductSipService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProductSipService.java new file mode 100644 index 0000000..079985f --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProductSipService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.md.service; + +import java.util.List; +import com.ktg.mes.md.domain.MdProductSip; + +/** + * 产品SIPService接口 + * + * @author yinjinlu + * @date 2023-10-31 + */ +public interface IMdProductSipService +{ + /** + * 查询产品SIP + * + * @param sipId 产品SIP主键 + * @return 产品SIP + */ + public MdProductSip selectMdProductSipBySipId(Long sipId); + + /** + * 查询产品SIP列表 + * + * @param mdProductSip 产品SIP + * @return 产品SIP集合 + */ + public List selectMdProductSipList(MdProductSip mdProductSip); + + /** + * 新增产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + public int insertMdProductSip(MdProductSip mdProductSip); + + /** + * 修改产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + public int updateMdProductSip(MdProductSip mdProductSip); + + /** + * 批量删除产品SIP + * + * @param sipIds 需要删除的产品SIP主键集合 + * @return 结果 + */ + public int deleteMdProductSipBySipIds(Long[] sipIds); + + /** + * 删除产品SIP信息 + * + * @param sipId 产品SIP主键 + * @return 结果 + */ + public int deleteMdProductSipBySipId(Long sipId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProductSipServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProductSipServiceImpl.java new file mode 100644 index 0000000..da1b511 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProductSipServiceImpl.java @@ -0,0 +1,96 @@ +package com.ktg.mes.md.service.impl; + +import java.util.List; +import com.ktg.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ktg.mes.md.mapper.MdProductSipMapper; +import com.ktg.mes.md.domain.MdProductSip; +import com.ktg.mes.md.service.IMdProductSipService; + +/** + * 产品SIPService业务层处理 + * + * @author yinjinlu + * @date 2023-10-31 + */ +@Service +public class MdProductSipServiceImpl implements IMdProductSipService +{ + @Autowired + private MdProductSipMapper mdProductSipMapper; + + /** + * 查询产品SIP + * + * @param sipId 产品SIP主键 + * @return 产品SIP + */ + @Override + public MdProductSip selectMdProductSipBySipId(Long sipId) + { + return mdProductSipMapper.selectMdProductSipBySipId(sipId); + } + + /** + * 查询产品SIP列表 + * + * @param mdProductSip 产品SIP + * @return 产品SIP + */ + @Override + public List selectMdProductSipList(MdProductSip mdProductSip) + { + return mdProductSipMapper.selectMdProductSipList(mdProductSip); + } + + /** + * 新增产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + @Override + public int insertMdProductSip(MdProductSip mdProductSip) + { + mdProductSip.setCreateTime(DateUtils.getNowDate()); + return mdProductSipMapper.insertMdProductSip(mdProductSip); + } + + /** + * 修改产品SIP + * + * @param mdProductSip 产品SIP + * @return 结果 + */ + @Override + public int updateMdProductSip(MdProductSip mdProductSip) + { + mdProductSip.setUpdateTime(DateUtils.getNowDate()); + return mdProductSipMapper.updateMdProductSip(mdProductSip); + } + + /** + * 批量删除产品SIP + * + * @param sipIds 需要删除的产品SIP主键 + * @return 结果 + */ + @Override + public int deleteMdProductSipBySipIds(Long[] sipIds) + { + return mdProductSipMapper.deleteMdProductSipBySipIds(sipIds); + } + + /** + * 删除产品SIP信息 + * + * @param sipId 产品SIP主键 + * @return 结果 + */ + @Override + public int deleteMdProductSipBySipId(Long sipId) + { + return mdProductSipMapper.deleteMdProductSipBySipId(sipId); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceIssueController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceIssueController.java index 7aa4dca..f7592df 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceIssueController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceIssueController.java @@ -9,6 +9,8 @@ import com.ktg.mes.wm.domain.WmIssueHeader; import com.ktg.mes.wm.domain.WmIssueLine; import com.ktg.mes.wm.domain.WmOutsourceIssueLine; import com.ktg.mes.wm.domain.tx.IssueTxBean; +import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean; +import com.ktg.mes.wm.service.IStorageCoreService; import com.ktg.mes.wm.service.IWmOutsourceIssueLineService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -46,6 +48,9 @@ public class WmOutsourceIssueController extends BaseController @Autowired private IWmOutsourceIssueLineService wmOutsourceIssueLineService; + @Autowired + private IStorageCoreService storageCoreService; + /** * 查询外协领料单头列表 */ @@ -108,9 +113,14 @@ public class WmOutsourceIssueController extends BaseController */ @PreAuthorize("@ss.hasPermi('mes:wm:outsourceissue:remove')") @Log(title = "外协领料单头", businessType = BusinessType.DELETE) + @Transactional @DeleteMapping("/{issueIds}") public AjaxResult remove(@PathVariable Long[] issueIds) { + for (Long issueId:issueIds + ) { + wmOutsourceIssueLineService.deleteWmOutsourceIssueLineByIssueId(issueId); + } return toAjax(wmOutsourceIssueService.deleteWmOutsourceIssueByIssueIds(issueIds)); } @@ -130,8 +140,10 @@ public class WmOutsourceIssueController extends BaseController if(CollUtil.isEmpty(lines)){ return AjaxResult.error("请指定领出的物资"); } - //TODO: 库存事务核心处理 + List beans = wmOutsourceIssueService.getTxBeans(issueId); + + storageCoreService.processOutsourceIssue(beans); //更新单据状态 header.setStatus(UserConstants.ORDER_STATUS_FINISHED); wmOutsourceIssueService.updateWmOutsourceIssue(header); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceRecptController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceRecptController.java index 7568fc5..d3e310f 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceRecptController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmOutsourceRecptController.java @@ -1,9 +1,24 @@ package com.ktg.mes.wm.controller; +import java.math.BigDecimal; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import ch.qos.logback.core.util.StringCollectionUtil; +import com.ktg.common.constant.UserConstants; +import com.ktg.common.utils.StringUtils; +import com.ktg.mes.pro.domain.ProWorkorder; +import com.ktg.mes.pro.service.IProWorkorderService; +import com.ktg.mes.wm.domain.WmItemRecpt; +import com.ktg.mes.wm.domain.WmOutsourceRecptLine; +import com.ktg.mes.wm.domain.tx.ItemRecptTxBean; +import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean; +import com.ktg.mes.wm.service.IStorageCoreService; +import com.ktg.mes.wm.service.IWmOutsourceRecptLineService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -34,6 +49,16 @@ public class WmOutsourceRecptController extends BaseController @Autowired private IWmOutsourceRecptService wmOutsourceRecptService; + @Autowired + private IWmOutsourceRecptLineService wmOutsourceRecptLineService; + + @Autowired + private IStorageCoreService storageCoreService; + + @Autowired + private IProWorkorderService proWorkorderService; + + /** * 查询外协入库单列表 */ @@ -96,9 +121,62 @@ public class WmOutsourceRecptController extends BaseController */ @PreAuthorize("@ss.hasPermi('mes:wm:outsourcerecpt:remove')") @Log(title = "外协入库单", businessType = BusinessType.DELETE) + @Transactional @DeleteMapping("/{recptIds}") public AjaxResult remove(@PathVariable Long[] recptIds) { + for (Long recptId:recptIds + ) { + wmOutsourceRecptLineService.selectWmOutsourceRecptLineByRecptId(recptId); + } return toAjax(wmOutsourceRecptService.deleteWmOutsourceRecptByRecptIds(recptIds)); } + + /** + * 执行入库 + * @return + */ + @PreAuthorize("@ss.hasPermi('mes:wm:outsourcerecpt:edit')") + @Log(title = "外协入库单", businessType = BusinessType.UPDATE) + @Transactional + @PutMapping("/{recptId}") + public AjaxResult execute(@PathVariable Long recptId){ + + WmOutsourceRecpt recpt = wmOutsourceRecptService.selectWmOutsourceRecptByRecptId(recptId); + + List lines = wmOutsourceRecptLineService.selectWmOutsourceRecptLineByRecptId(recptId); + if(CollectionUtils.isEmpty(lines)){ + return AjaxResult.error("请指定入库的物资!"); + } + + //构造Transaction事务,并执行库存更新逻辑 + List beans = wmOutsourceRecptService.getTxBeans(recptId); + + //调用库存核心 + storageCoreService.processOutsourceRecpt(beans); + + //根据当前入库的物料更新对应的生产工单/生产任务 已生产数量 + ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(recpt.getWorkorderId()); + if(!StringUtils.isNotNull(workorder)){ + return AjaxResult.error("未找到对应的外协工单/外协任务!"); + } + + //正常外协入库的产品必须先经过检验,确认合格数量后才能执行入库,并且更新外协工单的进度。此处暂时先直接根据入库数量更新外协工单的生产数量。 + BigDecimal produced = workorder.getQuantityProduced() == null?new BigDecimal(0):workorder.getQuantityProduced(); + for (int i = 0; i < lines.size(); i++) { + WmOutsourceRecptLine line = lines.get(i); + //判断入库的物资,如果是生产工单中的产品,则更新已生产数量 + if(line.getItemCode().equals(workorder.getProductCode())){ + workorder.setQuantityProduced( produced.add(line.getQuantityRecived())); + } + } + proWorkorderService.updateProWorkorder(workorder); + + //更新单据状态 + recpt.setStatus(UserConstants.ORDER_STATUS_FINISHED); + wmOutsourceRecptService.updateWmOutsourceRecpt(recpt); + + return AjaxResult.success(); + } + } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceIssueTxBean.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceIssueTxBean.java new file mode 100644 index 0000000..19ad62f --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceIssueTxBean.java @@ -0,0 +1,343 @@ +package com.ktg.mes.wm.domain.tx; + +import com.ktg.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +public class OutsourceIssueTxBean extends BaseEntity { + + private static final long serialVersionUID = 1L; + + private Long materialStockId; + + /** 产品物料ID */ + private Long itemId; + + /** 产品物料编码 */ + private String itemCode; + + /** 产品物料名称 */ + private String itemName; + + /** 规格型号 */ + private String specification; + + /** 单位 */ + private String unitOfMeasure; + + /** 批次号 */ + private String batchCode; + + /** 供应商ID */ + private Long vendorId; + + /** 供应商编号 */ + private String vendorCode; + + /** 供应商名称 */ + private String vendorName; + + /** 供应商简称 */ + private String vendorNick; + + /** 仓库ID */ + private Long warehouseId; + + /** 仓库编码 */ + private String warehouseCode; + + /** 仓库名称 */ + private String warehouseName; + + /** 库区ID */ + private Long locationId; + + /** 库区编码 */ + private String locationCode; + + /** 库区名称 */ + private String locationName; + + /** 库位ID */ + private Long areaId; + + /** 库位编码 */ + private String areaCode; + + /** 库位名称 */ + private String areaName; + + /** 单据类型 */ + private String sourceDocType; + + /** 单据ID */ + private Long sourceDocId; + + /** 单据编号 */ + private String sourceDocCode; + + /** 单据行ID */ + private Long sourceDocLineId; + + /** 事务数量 */ + private BigDecimal transactionQuantity; + + /** + * 生产工单ID + */ + private Long workorderId; + + /** + * 生产工单编号 + */ + private String workorderCode; + + public Long getMaterialStockId() { + return materialStockId; + } + + public void setMaterialStockId(Long materialStockId) { + this.materialStockId = materialStockId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemCode() { + return itemCode; + } + + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getUnitOfMeasure() { + return unitOfMeasure; + } + + public void setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public Long getVendorId() { + return vendorId; + } + + public void setVendorId(Long vendorId) { + this.vendorId = vendorId; + } + + public String getVendorCode() { + return vendorCode; + } + + public void setVendorCode(String vendorCode) { + this.vendorCode = vendorCode; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorNick() { + return vendorNick; + } + + public void setVendorNick(String vendorNick) { + this.vendorNick = vendorNick; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseCode() { + return warehouseCode; + } + + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public Long getLocationId() { + return locationId; + } + + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + public String getLocationCode() { + return locationCode; + } + + public void setLocationCode(String locationCode) { + this.locationCode = locationCode; + } + + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getSourceDocType() { + return sourceDocType; + } + + public void setSourceDocType(String sourceDocType) { + this.sourceDocType = sourceDocType; + } + + public Long getSourceDocId() { + return sourceDocId; + } + + public void setSourceDocId(Long sourceDocId) { + this.sourceDocId = sourceDocId; + } + + public String getSourceDocCode() { + return sourceDocCode; + } + + public void setSourceDocCode(String sourceDocCode) { + this.sourceDocCode = sourceDocCode; + } + + public Long getSourceDocLineId() { + return sourceDocLineId; + } + + public void setSourceDocLineId(Long sourceDocLineId) { + this.sourceDocLineId = sourceDocLineId; + } + + public BigDecimal getTransactionQuantity() { + return transactionQuantity; + } + + public void setTransactionQuantity(BigDecimal transactionQuantity) { + this.transactionQuantity = transactionQuantity; + } + + public Long getWorkorderId() { + return workorderId; + } + + public void setWorkorderId(Long workorderId) { + this.workorderId = workorderId; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + @Override + public String toString() { + return "OutsourceIssueTxBean{" + + "materialStockId=" + materialStockId + + ", itemId=" + itemId + + ", itemCode='" + itemCode + '\'' + + ", itemName='" + itemName + '\'' + + ", specification='" + specification + '\'' + + ", unitOfMeasure='" + unitOfMeasure + '\'' + + ", batchCode='" + batchCode + '\'' + + ", vendorId=" + vendorId + + ", vendorCode='" + vendorCode + '\'' + + ", vendorName='" + vendorName + '\'' + + ", vendorNick='" + vendorNick + '\'' + + ", warehouseId=" + warehouseId + + ", warehouseCode='" + warehouseCode + '\'' + + ", warehouseName='" + warehouseName + '\'' + + ", locationId=" + locationId + + ", locationCode='" + locationCode + '\'' + + ", locationName='" + locationName + '\'' + + ", areaId=" + areaId + + ", areaCode='" + areaCode + '\'' + + ", areaName='" + areaName + '\'' + + ", sourceDocType='" + sourceDocType + '\'' + + ", sourceDocId=" + sourceDocId + + ", sourceDocCode='" + sourceDocCode + '\'' + + ", sourceDocLineId=" + sourceDocLineId + + ", transactionQuantity=" + transactionQuantity + + ", workorderId=" + workorderId + + ", workorderCode='" + workorderCode + '\'' + + '}'; + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceRecptTxBean.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceRecptTxBean.java new file mode 100644 index 0000000..ca9e8f3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/OutsourceRecptTxBean.java @@ -0,0 +1,333 @@ +package com.ktg.mes.wm.domain.tx; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ktg.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +public class OutsourceRecptTxBean extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 产品物料ID */ + private Long itemId; + + /** 产品物料编码 */ + private String itemCode; + + /** 产品物料名称 */ + private String itemName; + + /** 规格型号 */ + private String specification; + + /** 单位 */ + private String unitOfMeasure; + + /** 入库批次号 */ + private String batchCode; + + /** 仓库ID */ + private Long warehouseId; + + /** 仓库编码 */ + private String warehouseCode; + + /** 仓库名称 */ + private String warehouseName; + + /** 库区ID */ + private Long locationId; + + /** 库区编码 */ + private String locationCode; + + /** 库区名称 */ + private String locationName; + + /** 库位ID */ + private Long areaId; + + /** 库位编码 */ + private String areaCode; + + /** 库位名称 */ + private String areaName; + + /** 供应商ID */ + private Long vendorId; + + /** 供应商编号 */ + private String vendorCode; + + /** 供应商名称 */ + private String vendorName; + + /** 供应商简称 */ + private String vendorNick; + + /** 单据类型 */ + private String sourceDocType; + + /** 单据ID */ + private Long sourceDocId; + + /** 单据编号 */ + private String sourceDocCode; + + /** 单据行ID */ + private Long sourceDocLineId; + + /** 事务数量 */ + private BigDecimal transactionQuantity; + + /** 入库日期 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + private Date recptDate; + + /** 库存有效期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date expireDate; + + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemCode() { + return itemCode; + } + + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getUnitOfMeasure() { + return unitOfMeasure; + } + + public void setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseCode() { + return warehouseCode; + } + + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public Long getLocationId() { + return locationId; + } + + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + public String getLocationCode() { + return locationCode; + } + + public void setLocationCode(String locationCode) { + this.locationCode = locationCode; + } + + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public Long getVendorId() { + return vendorId; + } + + public void setVendorId(Long vendorId) { + this.vendorId = vendorId; + } + + public String getVendorCode() { + return vendorCode; + } + + public void setVendorCode(String vendorCode) { + this.vendorCode = vendorCode; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorNick() { + return vendorNick; + } + + public void setVendorNick(String vendorNick) { + this.vendorNick = vendorNick; + } + + public String getSourceDocType() { + return sourceDocType; + } + + public void setSourceDocType(String sourceDocType) { + this.sourceDocType = sourceDocType; + } + + public Long getSourceDocId() { + return sourceDocId; + } + + public void setSourceDocId(Long sourceDocId) { + this.sourceDocId = sourceDocId; + } + + public String getSourceDocCode() { + return sourceDocCode; + } + + public void setSourceDocCode(String sourceDocCode) { + this.sourceDocCode = sourceDocCode; + } + + public Long getSourceDocLineId() { + return sourceDocLineId; + } + + public void setSourceDocLineId(Long sourceDocLineId) { + this.sourceDocLineId = sourceDocLineId; + } + + public BigDecimal getTransactionQuantity() { + return transactionQuantity; + } + + public void setTransactionQuantity(BigDecimal transactionQuantity) { + this.transactionQuantity = transactionQuantity; + } + + public Date getRecptDate() { + return recptDate; + } + + public void setRecptDate(Date recptDate) { + this.recptDate = recptDate; + } + + public Date getExpireDate() { + return expireDate; + } + + public void setExpireDate(Date expireDate) { + this.expireDate = expireDate; + } + + @Override + public String toString() { + return "OutsourceRecptTxBean{" + + "itemId=" + itemId + + ", itemCode='" + itemCode + '\'' + + ", itemName='" + itemName + '\'' + + ", specification='" + specification + '\'' + + ", unitOfMeasure='" + unitOfMeasure + '\'' + + ", batchCode='" + batchCode + '\'' + + ", warehouseId=" + warehouseId + + ", warehouseCode='" + warehouseCode + '\'' + + ", warehouseName='" + warehouseName + '\'' + + ", locationId=" + locationId + + ", locationCode='" + locationCode + '\'' + + ", locationName='" + locationName + '\'' + + ", areaId=" + areaId + + ", areaCode='" + areaCode + '\'' + + ", areaName='" + areaName + '\'' + + ", vendorId=" + vendorId + + ", vendorCode='" + vendorCode + '\'' + + ", vendorName='" + vendorName + '\'' + + ", vendorNick='" + vendorNick + '\'' + + ", sourceDocType='" + sourceDocType + '\'' + + ", sourceDocId=" + sourceDocId + + ", sourceDocCode='" + sourceDocCode + '\'' + + ", sourceDocLineId=" + sourceDocLineId + + ", transactionQuantity=" + transactionQuantity + + ", recptDate=" + recptDate + + ", expireDate=" + expireDate + + '}'; + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueLineMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueLineMapper.java index e5525ec..cc75a42 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueLineMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueLineMapper.java @@ -27,6 +27,13 @@ public interface WmOutsourceIssueLineMapper */ public List selectWmOutsourceIssueLineList(WmOutsourceIssueLine wmOutsourceIssueLine); + /** + * 根据发货单ID查询所有行信息 + * @param issueId + * @return + */ + public List selectWmOutsourceIssueLineByIssueId(Long issueId); + /** * 新增外协领料单行 * @@ -58,4 +65,11 @@ public interface WmOutsourceIssueLineMapper * @return 结果 */ public int deleteWmOutsourceIssueLineByLineIds(Long[] lineIds); + + /** + * 根据发料单ID删除所有行 + * @param issueId + * @return + */ + public int deleteWmOutsourceIssueLineByIssueId(Long issueId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueMapper.java index d16891e..37db478 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceIssueMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmOutsourceIssue; +import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean; /** * 外协领料单头Mapper接口 @@ -58,4 +59,6 @@ public interface WmOutsourceIssueMapper * @return 结果 */ public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds); + + public List getTxBeans(Long issueId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptLineMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptLineMapper.java index 0bb96dd..65d9aa2 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptLineMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptLineMapper.java @@ -27,6 +27,13 @@ public interface WmOutsourceRecptLineMapper */ public List selectWmOutsourceRecptLineList(WmOutsourceRecptLine wmOutsourceRecptLine); + /** + * 根据外协入库单ID查询所有入库单行 + * @param recptId + * @return + */ + public List selectWmOutsourceRecptLineByRecptId(Long recptId); + /** * 新增外协入库单行 * @@ -58,4 +65,11 @@ public interface WmOutsourceRecptLineMapper * @return 结果 */ public int deleteWmOutsourceRecptLineByLineIds(Long[] lineIds); + + /** + * 根据外协入库单头ID删除所有行 + * @param recptId + * @return + */ + public int deleteWmOutsourceRecptLineByRecptId(Long recptId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptMapper.java index 19d3963..f6d1dc2 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmOutsourceRecptMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmOutsourceRecpt; +import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean; /** * 外协入库单Mapper接口 @@ -58,4 +59,6 @@ public interface WmOutsourceRecptMapper * @return 结果 */ public int deleteWmOutsourceRecptByRecptIds(Long[] recptIds); + + public List getTxBeans(Long recptId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IStorageCoreService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IStorageCoreService.java index 2c1ac39..4c817bb 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IStorageCoreService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IStorageCoreService.java @@ -27,6 +27,18 @@ public interface IStorageCoreService { */ public void processIssue(List lines); + /** + * 处理外协领料 + * @param lines + */ + public void processOutsourceIssue(List lines); + + /** + * 处理外协入库 + * @param lines + */ + public void processOutsourceRecpt(List lines); + /** * 处理生产退料 * @param lines diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueLineService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueLineService.java index ff65684..5553c93 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueLineService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueLineService.java @@ -27,6 +27,14 @@ public interface IWmOutsourceIssueLineService */ public List selectWmOutsourceIssueLineList(WmOutsourceIssueLine wmOutsourceIssueLine); + + /** + * 根据外协领料单ID查询所有行 + * @param issueId + * @return + */ + public List selectWmOutsourceIssueLineByIssueId(Long issueId); + /** * 新增外协领料单行 * @@ -58,4 +66,11 @@ public interface IWmOutsourceIssueLineService * @return 结果 */ public int deleteWmOutsourceIssueLineByLineId(Long lineId); + + /** + * 根据发料单ID删除所有行 + * @param issueId + * @return + */ + public int deleteWmOutsourceIssueLineByIssueId(Long issueId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueService.java index 0062280..f4dc4a9 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceIssueService.java @@ -2,6 +2,8 @@ package com.ktg.mes.wm.service; import java.util.List; import com.ktg.mes.wm.domain.WmOutsourceIssue; +import com.ktg.mes.wm.domain.tx.IssueTxBean; +import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean; /** * 外协领料单头Service接口 @@ -58,4 +60,6 @@ public interface IWmOutsourceIssueService * @return 结果 */ public int deleteWmOutsourceIssueByIssueId(Long issueId); + + public List getTxBeans(Long issueId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptLineService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptLineService.java index ada3c70..1b38891 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptLineService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptLineService.java @@ -27,6 +27,13 @@ public interface IWmOutsourceRecptLineService */ public List selectWmOutsourceRecptLineList(WmOutsourceRecptLine wmOutsourceRecptLine); + /** + * 根据外协入库单ID查询所有入库单行 + * @param recptId + * @return + */ + public List selectWmOutsourceRecptLineByRecptId(Long recptId); + /** * 新增外协入库单行 * @@ -58,4 +65,11 @@ public interface IWmOutsourceRecptLineService * @return 结果 */ public int deleteWmOutsourceRecptLineByLineId(Long lineId); + + /** + * 根据外协入库单头ID删除所有行 + * @param recptId + * @return + */ + public int deleteWmOutsourceRecptLineByRecptId(Long recptId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptService.java index fe0a5b8..bb69149 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmOutsourceRecptService.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.service; import java.util.List; import com.ktg.mes.wm.domain.WmOutsourceRecpt; +import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean; /** * 外协入库单Service接口 @@ -58,4 +59,11 @@ public interface IWmOutsourceRecptService * @return 结果 */ public int deleteWmOutsourceRecptByRecptId(Long recptId); + + /** + * 获取执行入库的TxBeans + * @param recptId + * @return + */ + public List getTxBeans(Long recptId); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/StorageCoreServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/StorageCoreServiceImpl.java index b3db2df..9125d4b 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/StorageCoreServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/StorageCoreServiceImpl.java @@ -134,6 +134,43 @@ public class StorageCoreServiceImpl implements IStorageCoreService { } } + @Override + public void processOutsourceIssue(List lines) { + if(CollUtil.isEmpty(lines)){ + throw new BussinessException("没有需要处理的外协发货单行"); + } + + String transactionType_out = UserConstants.TRANSACTION_TYPE_ITEM_ISSUE_OUT; + for(int i=0;i lines) { + String transactionType = UserConstants.TRANSACTION_TYPE_OUTSOURCE_RECPT_IN; + if(CollUtil.isEmpty(lines)){ + throw new BussinessException("没有需要处理的外协入库单行"); + } + + for (int i =0;i selectWmOutsourceIssueLineByIssueId(Long issueId){ + return wmOutsourceIssueLineMapper.selectWmOutsourceIssueLineByIssueId(issueId); + } + /** * 新增外协领料单行 * @@ -93,4 +103,13 @@ public class WmOutsourceIssueLineServiceImpl implements IWmOutsourceIssueLineSer { return wmOutsourceIssueLineMapper.deleteWmOutsourceIssueLineByLineId(lineId); } + + /** + * 根据发料单ID删除所有行 + * @param issueId + * @return + */ + public int deleteWmOutsourceIssueLineByIssueId(Long issueId){ + return wmOutsourceIssueLineMapper.deleteWmOutsourceIssueLineByIssueId(issueId); + } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceIssueServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceIssueServiceImpl.java index 16fe459..40a7bb8 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceIssueServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceIssueServiceImpl.java @@ -2,6 +2,8 @@ package com.ktg.mes.wm.service.impl; import java.util.List; import com.ktg.common.utils.DateUtils; +import com.ktg.mes.wm.domain.tx.IssueTxBean; +import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ktg.mes.wm.mapper.WmOutsourceIssueMapper; @@ -10,87 +12,86 @@ import com.ktg.mes.wm.service.IWmOutsourceIssueService; /** * 外协领料单头Service业务层处理 - * + * * @author yinjinlu * @date 2023-10-30 */ @Service -public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService -{ +public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService { + @Autowired private WmOutsourceIssueMapper wmOutsourceIssueMapper; /** * 查询外协领料单头 - * + * * @param issueId 外协领料单头主键 * @return 外协领料单头 */ @Override - public WmOutsourceIssue selectWmOutsourceIssueByIssueId(Long issueId) - { + public WmOutsourceIssue selectWmOutsourceIssueByIssueId(Long issueId) { return wmOutsourceIssueMapper.selectWmOutsourceIssueByIssueId(issueId); } /** * 查询外协领料单头列表 - * + * * @param wmOutsourceIssue 外协领料单头 * @return 外协领料单头 */ @Override - public List selectWmOutsourceIssueList(WmOutsourceIssue wmOutsourceIssue) - { + public List selectWmOutsourceIssueList(WmOutsourceIssue wmOutsourceIssue) { return wmOutsourceIssueMapper.selectWmOutsourceIssueList(wmOutsourceIssue); } /** * 新增外协领料单头 - * + * * @param wmOutsourceIssue 外协领料单头 * @return 结果 */ @Override - public int insertWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) - { + public int insertWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) { wmOutsourceIssue.setCreateTime(DateUtils.getNowDate()); return wmOutsourceIssueMapper.insertWmOutsourceIssue(wmOutsourceIssue); } /** * 修改外协领料单头 - * + * * @param wmOutsourceIssue 外协领料单头 * @return 结果 */ @Override - public int updateWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) - { + public int updateWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) { wmOutsourceIssue.setUpdateTime(DateUtils.getNowDate()); return wmOutsourceIssueMapper.updateWmOutsourceIssue(wmOutsourceIssue); } /** * 批量删除外协领料单头 - * + * * @param issueIds 需要删除的外协领料单头主键 * @return 结果 */ @Override - public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds) - { + public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds) { return wmOutsourceIssueMapper.deleteWmOutsourceIssueByIssueIds(issueIds); } /** * 删除外协领料单头信息 - * + * * @param issueId 外协领料单头主键 * @return 结果 */ @Override - public int deleteWmOutsourceIssueByIssueId(Long issueId) - { + public int deleteWmOutsourceIssueByIssueId(Long issueId) { return wmOutsourceIssueMapper.deleteWmOutsourceIssueByIssueId(issueId); } + + @Override + public List getTxBeans(Long issueId) { + return wmOutsourceIssueMapper.getTxBeans(issueId); + } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptLineServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptLineServiceImpl.java index 5b554a7..26dff37 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptLineServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptLineServiceImpl.java @@ -44,6 +44,11 @@ public class WmOutsourceRecptLineServiceImpl implements IWmOutsourceRecptLineSer return wmOutsourceRecptLineMapper.selectWmOutsourceRecptLineList(wmOutsourceRecptLine); } + @Override + public List selectWmOutsourceRecptLineByRecptId(Long recptId) { + return wmOutsourceRecptLineMapper.selectWmOutsourceRecptLineByRecptId(recptId); + } + /** * 新增外协入库单行 * @@ -93,4 +98,9 @@ public class WmOutsourceRecptLineServiceImpl implements IWmOutsourceRecptLineSer { return wmOutsourceRecptLineMapper.deleteWmOutsourceRecptLineByLineId(lineId); } + + @Override + public int deleteWmOutsourceRecptLineByRecptId(Long recptId) { + return wmOutsourceRecptLineMapper.deleteWmOutsourceRecptLineByRecptId(recptId); + } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptServiceImpl.java index 513ca3d..751fec1 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmOutsourceRecptServiceImpl.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.service.impl; import java.util.List; import com.ktg.common.utils.DateUtils; +import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ktg.mes.wm.mapper.WmOutsourceRecptMapper; @@ -93,4 +94,9 @@ public class WmOutsourceRecptServiceImpl implements IWmOutsourceRecptService { return wmOutsourceRecptMapper.deleteWmOutsourceRecptByRecptId(recptId); } + + @Override + public List getTxBeans(Long recptId) { + return wmOutsourceRecptMapper.getTxBeans(recptId); + } } diff --git a/ktg-mes/src/main/resources/mapper/md/MdProductSipMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdProductSipMapper.xml new file mode 100644 index 0000000..5ffae51 --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/md/MdProductSipMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select sip_id, item_id, order_num, process_id, process_code, process_name, sip_title, sip_description, sip_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_product_sip + + + + + + + + insert into md_product_sip + + item_id, + order_num, + process_id, + process_code, + process_name, + sip_title, + sip_description, + sip_url, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{itemId}, + #{orderNum}, + #{processId}, + #{processCode}, + #{processName}, + #{sipTitle}, + #{sipDescription}, + #{sipUrl}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update md_product_sip + + item_id = #{itemId}, + order_num = #{orderNum}, + process_id = #{processId}, + process_code = #{processCode}, + process_name = #{processName}, + sip_title = #{sipTitle}, + sip_description = #{sipDescription}, + sip_url = #{sipUrl}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where sip_id = #{sipId} + + + + delete from md_product_sip where sip_id = #{sipId} + + + + delete from md_product_sip where sip_id in + + #{sipId} + + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueLineMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueLineMapper.xml index 1b98c1c..84b7322 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueLineMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueLineMapper.xml @@ -67,6 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where line_id = #{lineId} + + insert into wm_outsource_issue_line @@ -168,6 +173,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from wm_outsource_issue_line where line_id = #{lineId} + + delete from wm_outsource_issue_line where issue_id = #{issueId} + + delete from wm_outsource_issue_line where line_id in diff --git a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueMapper.xml index 16cfa39..b490b04 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceIssueMapper.xml @@ -36,6 +36,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select issue_id, issue_code, issue_name, workorder_id, workorder_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, issue_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_outsource_issue @@ -69,6 +103,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where issue_id = #{issueId} + + insert into wm_outsource_issue diff --git a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptLineMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptLineMapper.xml index 942de91..54d68a8 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptLineMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptLineMapper.xml @@ -73,6 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where line_id = #{lineId} + + insert into wm_outsource_recpt_line @@ -183,6 +188,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from wm_outsource_recpt_line where line_id = #{lineId} + + delete from wm_outsource_recpt_line where recpt_id = #{recptId} + + delete from wm_outsource_recpt_line where line_id in diff --git a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptMapper.xml index 6300a76..48b97ef 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmOutsourceRecptMapper.xml @@ -38,6 +38,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select recpt_id, recpt_code, recpt_name, iqc_id, iqc_code, workorder_id, workorder_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, recpt_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_outsource_recpt @@ -73,6 +106,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where recpt_id = #{recptId} + + insert into wm_outsource_recpt