diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java index 55ad5f1e..f25b31e7 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java @@ -8,10 +8,7 @@ import com.hw.system.api.domain.common.WfProcessActivity; import com.hw.system.api.domain.common.vo.WfProcessActivityVo; import com.hw.system.api.factory.RemoteSysCommonFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -34,4 +31,7 @@ public interface RemoteSysCommonService { @PostMapping("/pointRouter/insertPointRouterInfo") R insertSysPointRouterPort(@RequestBody List sysPointRouterList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + @PostMapping("/wfprocessactivity/processActivityUserInfo") + R selectProcessActivityUserInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, Long processActivityId); } diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/WfProcessActivityAuth.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/WfProcessActivityAuth.java index 868cc0d4..c8e1b5ba 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/WfProcessActivityAuth.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/WfProcessActivityAuth.java @@ -31,6 +31,26 @@ public class WfProcessActivityAuth extends BaseEntity private Long authTargetId; private String nickName; + private String userName; + + private String email; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + public String getNickName() { return nickName; } diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java index 3ac1a99f..65bb8c7d 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java @@ -52,6 +52,12 @@ public class RemoteSysCommonFallbackFactory implements FallbackFactory selectProcessActivityUserInfo(String source, Long processActivityId) { + return R.fail("获取工单流程步骤用户信息失败:" + throwable.getMessage()); + } + + }; } } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java index f37062a1..5ea014cf 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java @@ -33,7 +33,35 @@ public class WfConstants { /**质检文件关联类型*/ public static final String QMS_FILE_TARGET_TYPE_QUALITY_INSTANCE_ACTIVITY = "1";//质检工单实例节点 + /**采购申请流程ID*/ + public static final Long WF_PURCHASE_REQUISITION_PROCESS_ID = 401L; + /**流程节点:采购申请流程创建*/ + public static final Long WF_PURCHASE_ACTIVITY_CREATE_ID = 4011L; + /**流程节点:采购申请流程采购审核*/ + public static final Long WF_PURCHASE_ACTIVITY_PROCUREMENT_AUDIT_ID = 4012L; + /**流程节点:采购申请流程技术修改*/ + public static final Long WF_PURCHASE_ACTIVITY_TECHNICAL_MODIFY_ID = 4013L; + /**流程节点:采购申请流程ERP修改*/ + public static final Long WF_PURCHASE_ACTIVITY_ERP_MODIFY_ID = 4014L; + /**流程节点:采购申请流程完成*/ + public static final Long WF_PURCHASE_ACTIVITY_FINISH_ID = 4015L; + /**采购申请流程:通知标识(0否 1是)*/ + public static final String PA_NOTICE_FLAG_YES = "1"; + /**采购申请流程:通知标识(0否 1是)*/ + public static final String PA_NOTICE_FLAG_NO = "0"; + /**采购申请流程:异常标识(0否 1是)*/ + public static final String PA_ANOMALY_FLAG_YES = "1"; + /**采购申请流程:异常标识(0否 1是)*/ + public static final String PA_ANOMALY_FLAG_NO = "0"; + /**采购申请流程:更新标识(0否 1是)*/ + public static final String PA_UPDATE_FLAG_YES = "1"; + /**采购申请流程:更新标识(0否 1是)*/ + public static final String PA_UPDATE_FLAG_NO = "0"; + /**采购申请流程:导入标识(0否 1是)*/ + public static final String PA_IMPORT_FLAG_YES = "1"; + /**采购申请流程:导入标识(0否 1是)*/ + public static final String PA_IMPORT_FLAG_NO = "0"; } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java index ed6d6804..4d447c63 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java @@ -48,4 +48,53 @@ public class MailUtils { throw new RuntimeException(e); } } + + /** + * 流程发送邮件 + * @param receiverEmail 接收人邮箱 + * @param subject 标题 + * @param text 内容 + */ + public static void processSendEmail(String receiverEmail, String subject, String text) { + // 设置发件人、收件人、SMTP服务器等信息 + String senderEmail = "chencheng01@jsjyep.com"; +// String receiverEmail = "chencheng01@jsjyep.com"; + String password = "QH6faJaWw5rgvM4u"; + String host = "smtp.exmail.qq.com"; // SMTP服务器地址 + int port = 465; // 端口号,如果是SSL连接常用465,非SSL常用587或25 + + // 设置邮件服务器的属性 + Properties props = new Properties(); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.ssl.enable", "true"); // 启用SSL + props.put("mail.smtp.ssl.protocols", "TLSv1.2"); // 设置SSL/TLS版本 + +// props.put("mail.smtp.starttls.enable", "true"); // 如果是SSL连接,则不需要这行 + props.put("mail.smtp.host", host); + props.put("mail.smtp.port", port); + + // 创建会话 + Session session = Session.getInstance(props, new Authenticator() { + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(senderEmail, password); + } + }); + + try { + // 创建邮件消息 + Message message = new MimeMessage(session); + message.setFrom(new InternetAddress(senderEmail)); + message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(receiverEmail)); + message.setSubject(subject); + message.setText(text); + + // 发送邮件 + Transport.send(message); + System.out.println("邮件已成功发送!"); + } catch (MessagingException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java index e644e5b8..cdf0e21b 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java @@ -301,6 +301,14 @@ public class Seq { // 虚拟采购订单信息的记录标识 public static final String mesVirtualPurchaseOrderCode = "VP"; + // 采购申请任务编号 + public static final String mesPurchaseApplyProcessSeqType = "purchaseApplyProcess"; + + // 采购申请任务编号序列数 + private static AtomicInteger mesPurchaseApplyProcessSeq = new AtomicInteger(1); + + // 采购申请任务编号的记录标识 + public static final String mesPurchaseApplyProcessCode = "CG"; /** * 获取通用序列号 @@ -414,6 +422,8 @@ public class Seq { atomicInt = mesVirtualSaleOrderSeq; }else if (mesVirtualPurchaseOrderSeqType.equals(type)) { atomicInt = mesVirtualPurchasaeOrderSeq; + }else if (mesPurchaseApplyProcessSeqType.equals(type)) { + atomicInt = mesPurchaseApplyProcessSeq; } return getId(atomicInt, 3, code); } diff --git a/hw-modules/hw-mes/pom.xml b/hw-modules/hw-mes/pom.xml index 53e3e8e7..21dbd3a9 100644 --- a/hw-modules/hw-mes/pom.xml +++ b/hw-modules/hw-mes/pom.xml @@ -94,6 +94,10 @@ com.hw hw-api-wms + + com.hw + hw-api-system + diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java index df6909ab..e4a38341 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java @@ -60,4 +60,19 @@ public class MesImportController extends BaseController { return success(message); } + /** + * 提资单BOM信息excel导入 + * @param file + * @param updateSupport + * @return + */ + @Log(title = "提资单BOM信息", businessType = BusinessType.IMPORT) + @PostMapping(("/raiseCapitalImportData")) + public AjaxResult raiseCapitalImportData(MultipartFile file, boolean updateSupport) + { + String operName = SecurityUtils.getUsername(); + String message = mesImportService.raiseCapitalImportData(file, updateSupport, operName); + return success(message); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseApplyProcessController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseApplyProcessController.java new file mode 100644 index 00000000..56d8f2e3 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseApplyProcessController.java @@ -0,0 +1,128 @@ +package com.hw.mes.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +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.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.mes.domain.MesPurchaseApplyProcess; +import com.hw.mes.service.IMesPurchaseApplyProcessService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 采购申请流程Controller + * + * @author Yinq + * @date 2024-09-19 + */ +@RestController +@RequestMapping("/purchaseApplyProcess") +public class MesPurchaseApplyProcessController extends BaseController { + @Autowired + private IMesPurchaseApplyProcessService mesPurchaseApplyProcessService; + + /** + * 查询采购申请流程列表 + */ + @RequiresPermissions("mes:purchaseApplyProcess:list") + @GetMapping("/list") + public TableDataInfo list(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + startPage(); + List list = mesPurchaseApplyProcessService.selectMesPurchaseApplyProcessList(mesPurchaseApplyProcess); + return getDataTable(list); + } + + /** + * 导出采购申请流程列表 + */ + @RequiresPermissions("mes:purchaseApplyProcess:export") + @Log(title = "采购申请流程", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesPurchaseApplyProcess mesPurchaseApplyProcess) { + List list = mesPurchaseApplyProcessService.selectMesPurchaseApplyProcessList(mesPurchaseApplyProcess); + ExcelUtil util = new ExcelUtil(MesPurchaseApplyProcess.class); + util.exportExcel(response, list, "采购申请流程数据"); + } + + /** + * 获取采购申请流程详细信息 + */ + @RequiresPermissions("mes:purchaseApplyProcess:query") + @GetMapping(value = "/{purchaseApplyId}") + public AjaxResult getInfo(@PathVariable("purchaseApplyId") Long purchaseApplyId) { + return success(mesPurchaseApplyProcessService.selectMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId)); + } + + /** + * 新增采购申请流程 + */ + @RequiresPermissions("mes:purchaseApplyProcess:add") + @Log(title = "采购申请流程", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesPurchaseApplyProcess mesPurchaseApplyProcess) { + return toAjax(mesPurchaseApplyProcessService.insertMesPurchaseApplyProcess(mesPurchaseApplyProcess)); + } + + /** + * 修改采购申请流程 + */ + @RequiresPermissions("mes:purchaseApplyProcess:edit") + @Log(title = "采购申请流程", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesPurchaseApplyProcess mesPurchaseApplyProcess) { + return toAjax(mesPurchaseApplyProcessService.updateMesPurchaseApplyProcess(mesPurchaseApplyProcess)); + } + + /** + * 删除采购申请流程 + */ + @RequiresPermissions("mes:purchaseApplyProcess:remove") + @Log(title = "采购申请流程", businessType = BusinessType.DELETE) + @DeleteMapping("/{purchaseApplyIds}") + public AjaxResult remove(@PathVariable Long[] purchaseApplyIds) { + return toAjax(mesPurchaseApplyProcessService.deleteMesPurchaseApplyProcessByPurchaseApplyIds(purchaseApplyIds)); + } + + /** + * 采购处理 + * 1、导入BOM,流程完成 + * 2、异常通知,技术修改 + * @param mesPurchaseApplyProcess + * @return + */ + @Log(title = "采购申请流程", businessType = BusinessType.OTHER) + @PostMapping("purchaseAbnormalFlow") + @RequiresPermissions("mes:purchaseApplyProcess:purchaseEdit") + public AjaxResult purchaseAbnormalFlow(@RequestBody MesPurchaseApplyProcess mesPurchaseApplyProcess) { + return toAjax(mesPurchaseApplyProcessService.purchaseAbnormalFlow(mesPurchaseApplyProcess)); + } + + /** + * 技术处理 + * 1、处理完成返回采购修改节点 + * 2、缺物料通知ERP人员 + * @param mesPurchaseApplyProcess + * @return + */ + @Log(title = "采购申请流程", businessType = BusinessType.OTHER) + @PostMapping("technicalProcessing") + @RequiresPermissions("mes:purchaseApplyProcess:technicalEdit") + public AjaxResult technicalProcessing(@RequestBody MesPurchaseApplyProcess mesPurchaseApplyProcess) { + return toAjax(mesPurchaseApplyProcessService.technicalProcessing(mesPurchaseApplyProcess)); + } + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesRaiseCapitalBomController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesRaiseCapitalBomController.java new file mode 100644 index 00000000..3438397f --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesRaiseCapitalBomController.java @@ -0,0 +1,98 @@ +package com.hw.mes.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +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.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.mes.domain.MesRaiseCapitalBom; +import com.hw.mes.service.IMesRaiseCapitalBomService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; + +/** + * 提资单BOM信息Controller + * + * @author Yinq + * @date 2024-09-18 + */ +@RestController +@RequestMapping("/mesRaiseCapitalBom") +public class MesRaiseCapitalBomController extends BaseController { + @Autowired + private IMesRaiseCapitalBomService mesRaiseCapitalBomService; + + /** + * 查询提资单BOM信息列表 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:list") + @GetMapping("/list") + public AjaxResult list(MesRaiseCapitalBom mesRaiseCapitalBom) + { + List list = mesRaiseCapitalBomService.selectMesRaiseCapitalBomList(mesRaiseCapitalBom); + return success(list); + } + + /** + * 导出提资单BOM信息列表 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:export") + @Log(title = "提资单BOM信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesRaiseCapitalBom mesRaiseCapitalBom) { + List list = mesRaiseCapitalBomService.selectMesRaiseCapitalBomList(mesRaiseCapitalBom); + ExcelUtil util = new ExcelUtil(MesRaiseCapitalBom.class); + util.exportExcel(response, list, "提资单BOM信息数据"); + } + + /** + * 获取提资单BOM信息详细信息 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:query") + @GetMapping(value = "/{raiseCapitalId}") + public AjaxResult getInfo(@PathVariable("raiseCapitalId") Long raiseCapitalId) { + return success(mesRaiseCapitalBomService.selectMesRaiseCapitalBomByRaiseCapitalId(raiseCapitalId)); + } + + /** + * 新增提资单BOM信息 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:add") + @Log(title = "提资单BOM信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesRaiseCapitalBom mesRaiseCapitalBom) { + return toAjax(mesRaiseCapitalBomService.insertMesRaiseCapitalBom(mesRaiseCapitalBom)); + } + + /** + * 修改提资单BOM信息 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:edit") + @Log(title = "提资单BOM信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesRaiseCapitalBom mesRaiseCapitalBom) { + return toAjax(mesRaiseCapitalBomService.updateMesRaiseCapitalBom(mesRaiseCapitalBom)); + } + + /** + * 删除提资单BOM信息 + */ + @RequiresPermissions("mes:mesRaiseCapitalBom:remove") + @Log(title = "提资单BOM信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{raiseCapitalIds}") + public AjaxResult remove(@PathVariable Long[] raiseCapitalIds) { + return toAjax(mesRaiseCapitalBomService.deleteMesRaiseCapitalBomByRaiseCapitalIds(raiseCapitalIds)); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java index d6955990..6511284f 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java @@ -99,6 +99,24 @@ public class MesMaterialBom extends TreeEntity { @Excel(name = "安装时长") private Long assembleTime; + /** + * 品牌 + */ + private String brand; + + /** + * 祖级列表 + */ + private String ancestors; + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + public Long getAssembleTime() { return assembleTime; } @@ -247,4 +265,28 @@ public class MesMaterialBom extends TreeEntity { .append("updateTime", getUpdateTime()) .toString(); } + + public void copyFromMesRaiseCapitalBom(MesRaiseCapitalBom source) { + if (source != null) { + this.setMaterialBomId(source.getRaiseCapitalId()); + this.setParentId(source.getParentId()); + this.setAncestors(source.getAncestors()); + this.setErpMaterialId(source.getErpMaterialId()); + this.setMaterialClassfication(source.getMaterialClassfication()); + this.setMaterialId(source.getMaterialId()); + this.setMaterialName(source.getMaterialName()); + this.setMaterialBomDesc(source.getMaterialBomDesc()); + this.setStandardAmount(source.getStandardAmount()); + this.setTopFlag(source.getTopFlag()); + this.setCheckType(source.getCheckType()); + this.setProjectId(source.getProjectId()); + this.setActiveFlag(source.getActiveFlag()); + this.setMaterialCode(source.getMaterialCode()); + this.setMaterialSpec(source.getMaterialSpec()); + this.setAssembleTime(source.getAssembleTime()); + this.setMaterialNameDesc(source.getMaterialName()); + this.setCreateBy(source.getCreateBy()); + this.setCreateTime(source.getCreateTime()); + } + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcess.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcess.java new file mode 100644 index 00000000..838fcc78 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcess.java @@ -0,0 +1,155 @@ +package com.hw.mes.domain; + +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 采购申请流程对象 mes_purchase_apply_process + * + * @author Yinq + * @date 2024-09-19 + */ +public class MesPurchaseApplyProcess extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long purchaseApplyId; + + /** + * 任务编号 + */ + @Excel(name = "任务编号") + private String taskCode; + + /** + * 提资单成品名称 + */ + @Excel(name = "提资单成品名称") + private String materialName; + + /** + * 处理流程节点ID + */ + private Long wfProcessId; + + /** + * 当前流程节点ID + */ + private Long processActivityId; + + /** + * 当前流程节点描述 + */ + private String processActivityName; + + /** + * 导入BOM标识(0否 1是) + */ + @Excel(name = "导入BOM标识(0否 1是)") + private String importFlag; + + /** + * 采购申请流程明细信息 + */ + private List mesPurchaseApplyProcessDetailList; + + + /** + * 异常标识(0否 1是) + */ + @Excel(name = "异常标识(0否 1是)") + private String currentAnomalyFlag; + + public String getCurrentAnomalyFlag() { + return currentAnomalyFlag; + } + + public void setCurrentAnomalyFlag(String currentAnomalyFlag) { + this.currentAnomalyFlag = currentAnomalyFlag; + } + + public String getProcessActivityName() { + return processActivityName; + } + + public void setProcessActivityName(String processActivityName) { + this.processActivityName = processActivityName; + } + + public Long getProcessActivityId() { + return processActivityId; + } + + public void setProcessActivityId(Long processActivityId) { + this.processActivityId = processActivityId; + } + + public void setPurchaseApplyId(Long purchaseApplyId) { + this.purchaseApplyId = purchaseApplyId; + } + + public Long getPurchaseApplyId() { + return purchaseApplyId; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getTaskCode() { + return taskCode; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public void setWfProcessId(Long wfProcessId) { + this.wfProcessId = wfProcessId; + } + + public Long getWfProcessId() { + return wfProcessId; + } + + public void setImportFlag(String importFlag) { + this.importFlag = importFlag; + } + + public String getImportFlag() { + return importFlag; + } + + public List getMesPurchaseApplyProcessDetailList() { + return mesPurchaseApplyProcessDetailList; + } + + public void setMesPurchaseApplyProcessDetailList(List mesPurchaseApplyProcessDetailList) { + this.mesPurchaseApplyProcessDetailList = mesPurchaseApplyProcessDetailList; + } + + @Override + public String toString() { + return "MesPurchaseApplyProcess{" + + "purchaseApplyId=" + purchaseApplyId + + ", taskCode='" + taskCode + '\'' + + ", materialName='" + materialName + '\'' + + ", wfProcessId=" + wfProcessId + + ", processActivityId=" + processActivityId + + ", processActivityName='" + processActivityName + '\'' + + ", importFlag='" + importFlag + '\'' + + ", mesPurchaseApplyProcessDetailList=" + mesPurchaseApplyProcessDetailList + + ", currentAnomalyFlag='" + currentAnomalyFlag + '\'' + + '}'; + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcessDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcessDetail.java new file mode 100644 index 00000000..039200e1 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseApplyProcessDetail.java @@ -0,0 +1,158 @@ +package com.hw.mes.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 采购申请流程明细对象 mes_purchase_apply_process_detail + * + * @author Yinq + * @date 2024-09-19 + */ +public class MesPurchaseApplyProcessDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long purchaseApplyDetailId; + + /** + * 任务编号 + */ + @Excel(name = "任务编号") + private String taskCode; + + /** + * 流程节点ID + */ + @Excel(name = "流程节点ID") + private Long processActivityId; + + /** + * 异常标识(0否 1是) + */ + @Excel(name = "异常标识(0否 1是)") + private String anomalyFlag; + + /** + * 更新标识(0否 1是) + */ + @Excel(name = "更新标识(0否 1是)") + private String updateFlag; + + /** + * 通知标识(0否 1是) + */ + @Excel(name = "通知标识(0否 1是)") + private String noticeFlag; + + /** + * 通知用户编号 + */ + @Excel(name = "通知用户编号") + private String noticeAuth; + + /** + * 备注 + */ + @Excel(name = "备注") + private String purchaseRemark; + + /** + * 当前流程节点描述 + */ + private String processActivityName; + + public String getProcessActivityName() { + return processActivityName; + } + + public void setProcessActivityName(String processActivityName) { + this.processActivityName = processActivityName; + } + + public void setPurchaseApplyDetailId(Long purchaseApplyDetailId) { + this.purchaseApplyDetailId = purchaseApplyDetailId; + } + + public Long getPurchaseApplyDetailId() { + return purchaseApplyDetailId; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getTaskCode() { + return taskCode; + } + + public void setProcessActivityId(Long processActivityId) { + this.processActivityId = processActivityId; + } + + public Long getProcessActivityId() { + return processActivityId; + } + + public void setAnomalyFlag(String anomalyFlag) { + this.anomalyFlag = anomalyFlag; + } + + public String getAnomalyFlag() { + return anomalyFlag; + } + + public void setUpdateFlag(String updateFlag) { + this.updateFlag = updateFlag; + } + + public String getUpdateFlag() { + return updateFlag; + } + + public void setNoticeFlag(String noticeFlag) { + this.noticeFlag = noticeFlag; + } + + public String getNoticeFlag() { + return noticeFlag; + } + + public void setNoticeAuth(String noticeAuth) { + this.noticeAuth = noticeAuth; + } + + public String getNoticeAuth() { + return noticeAuth; + } + + public void setPurchaseRemark(String purchaseRemark) { + this.purchaseRemark = purchaseRemark; + } + + public String getPurchaseRemark() { + return purchaseRemark; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("purchaseApplyDetailId", getPurchaseApplyDetailId()) + .append("taskCode", getTaskCode()) + .append("processActivityId", getProcessActivityId()) + .append("anomalyFlag", getAnomalyFlag()) + .append("updateFlag", getUpdateFlag()) + .append("noticeFlag", getNoticeFlag()) + .append("noticeAuth", getNoticeAuth()) + .append("purchaseRemark", getPurchaseRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesRaiseCapitalBom.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesRaiseCapitalBom.java new file mode 100644 index 00000000..44a40890 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesRaiseCapitalBom.java @@ -0,0 +1,292 @@ +package com.hw.mes.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 提资单BOM信息对象 mes_raise_capital_bom + * + * @author Yinq + * @date 2024-09-18 + */ +public class MesRaiseCapitalBom extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long raiseCapitalId; + + /** + * 任务编号 + */ + @Excel(name = "任务编号") + private String taskCode; + + /** + * bom说明;顶级不能为空,在选择bom时可以用此字段区分 + */ + @Excel(name = "bom说明;顶级不能为空,在选择bom时可以用此字段区分") + private String materialBomDesc; + + /** + * 父级标识,关联物料bom表主键 + */ + @Excel(name = "父级标识,关联物料bom表主键") + private Long parentId; + + /** + * 祖级列表 + */ + @Excel(name = "祖级列表") + private String ancestors; + + /** + * 物料ID,关联物料信息表主键 + */ + @Excel(name = "物料ID,关联物料信息表主键") + private Long materialId; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 标准数量;最顶级数量须为1 + */ + @Excel(name = "标准数量;最顶级数量须为1") + private BigDecimal standardAmount; + + /** + * 顶级标识(1是,0否) + */ + @Excel(name = "顶级标识(1是,0否)") + private Long topFlag; + + /** + * 校验类型(0不校验,1人工校验,2自动校验) + */ + @Excel(name = "校验类型(0不校验,1人工校验,2自动校验)") + private String checkType; + + /** + * 项目ID,关联mes_project_info的主键 + */ + @Excel(name = "项目ID,关联mes_project_info的主键") + private Long projectId; + + /** + * 装配时长(单位:s) + */ + @Excel(name = "装配时长(单位:s)") + private Long assembleTime; + + /** + * 激活标识:1-是;0-否 + */ + @Excel(name = "激活标识:1-是;0-否") + private String activeFlag; + + /** + * 品牌 + */ + @Excel(name = "品牌") + private String brand; + + /** + * 物料分类:1ERP同步,2虚拟物料,3,MES物料 + */ + @Excel(name = "物料分类:1ERP同步,2虚拟物料,3,MES物料") + private String materialClassfication; + + /** + * 物料信息表的ERPID + */ + @Excel(name = "物料信息表的ERPID") + private Long erpMaterialId; + + /** + * 物料编号 + */ + @Excel(name = "物料编号") + private String materialCode; + + private String materialSpec; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + public void setRaiseCapitalId(Long raiseCapitalId) { + this.raiseCapitalId = raiseCapitalId; + } + + public Long getRaiseCapitalId() { + return raiseCapitalId; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getTaskCode() { + return taskCode; + } + + public void setMaterialBomDesc(String materialBomDesc) { + this.materialBomDesc = materialBomDesc; + } + + public String getMaterialBomDesc() { + return materialBomDesc; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Long getParentId() { + return parentId; + } + + public void setAncestors(String ancestors) { + this.ancestors = ancestors; + } + + public String getAncestors() { + return ancestors; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public void setStandardAmount(BigDecimal standardAmount) { + this.standardAmount = standardAmount; + } + + public BigDecimal getStandardAmount() { + return standardAmount; + } + + public void setTopFlag(Long topFlag) { + this.topFlag = topFlag; + } + + public Long getTopFlag() { + return topFlag; + } + + public void setCheckType(String checkType) { + this.checkType = checkType; + } + + public String getCheckType() { + return checkType; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getProjectId() { + return projectId; + } + + public void setAssembleTime(Long assembleTime) { + this.assembleTime = assembleTime; + } + + public Long getAssembleTime() { + return assembleTime; + } + + public void setActiveFlag(String activeFlag) { + this.activeFlag = activeFlag; + } + + public String getActiveFlag() { + return activeFlag; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getBrand() { + return brand; + } + + public void setMaterialClassfication(String materialClassfication) { + this.materialClassfication = materialClassfication; + } + + public String getMaterialClassfication() { + return materialClassfication; + } + + public void setErpMaterialId(Long erpMaterialId) { + this.erpMaterialId = erpMaterialId; + } + + public Long getErpMaterialId() { + return erpMaterialId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("raiseCapitalId", getRaiseCapitalId()) + .append("taskCode", getTaskCode()) + .append("materialBomDesc", getMaterialBomDesc()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("standardAmount", getStandardAmount()) + .append("topFlag", getTopFlag()) + .append("checkType", getCheckType()) + .append("projectId", getProjectId()) + .append("assembleTime", getAssembleTime()) + .append("activeFlag", getActiveFlag()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("brand", getBrand()) + .append("materialClassfication", getMaterialClassfication()) + .append("erpMaterialId", getErpMaterialId()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java index 48495ae9..49de9a75 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java @@ -66,4 +66,12 @@ public interface MesMaterialBomMapper * @return 物料BOM信息集合 */ public List selectMesMaterialBomJoinList(MesMaterialBom mesMaterialBom); + + /** + * 批量新增物料BOM信息 + * + * @param mesMaterialBomList 物料BOM信息 + * @return 结果 + */ + public int batchMesMaterialBom(List mesMaterialBomList); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessDetailMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessDetailMapper.java new file mode 100644 index 00000000..e248c3e2 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessDetailMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; + +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; + +/** + * 采购申请流程明细Mapper接口 + * + * @author Open Platform + * @date 2024-09-24 + */ +public interface MesPurchaseApplyProcessDetailMapper { + /** + * 查询采购申请流程明细 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 采购申请流程明细 + */ + public MesPurchaseApplyProcessDetail selectMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId); + + /** + * 查询采购申请流程明细列表 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 采购申请流程明细集合 + */ + public List selectMesPurchaseApplyProcessDetailList(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 新增采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + public int insertMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 修改采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + public int updateMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 删除采购申请流程明细 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId); + + /** + * 批量删除采购申请流程明细 + * + * @param purchaseApplyDetailIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailIds(Long[] purchaseApplyDetailIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessMapper.java new file mode 100644 index 00000000..16ae2511 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseApplyProcessMapper.java @@ -0,0 +1,88 @@ +package com.hw.mes.mapper; + +import java.util.List; + +import com.hw.mes.domain.MesPurchaseApplyProcess; +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; + +/** + * 采购申请流程Mapper接口 + * + * @author Yinq + * @date 2024-09-19 + */ +public interface MesPurchaseApplyProcessMapper { + /** + * 查询采购申请流程 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 采购申请流程 + */ + public MesPurchaseApplyProcess selectMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId); + + /** + * 查询采购申请流程列表 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 采购申请流程集合 + */ + public List selectMesPurchaseApplyProcessList(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 新增采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + public int insertMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 修改采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + public int updateMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 删除采购申请流程 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId); + + /** + * 批量删除采购申请流程 + * + * @param purchaseApplyIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds); + + /** + * 批量删除采购申请流程明细 + * + * @param purchaseApplyIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByTaskCodes(Long[] purchaseApplyIds); + + /** + * 批量新增采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetailList 采购申请流程明细列表 + * @return 结果 + */ + public int batchMesPurchaseApplyProcessDetail(List mesPurchaseApplyProcessDetailList); + + + /** + * 通过采购申请流程主键删除采购申请流程明细信息 + * + * @param purchaseApplyId 采购申请流程ID + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByTaskCode(Long purchaseApplyId); + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesRaiseCapitalBomMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesRaiseCapitalBomMapper.java new file mode 100644 index 00000000..fb1c5dab --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesRaiseCapitalBomMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; + +import com.hw.mes.domain.MesRaiseCapitalBom; + +/** + * 提资单BOM信息Mapper接口 + * + * @author Yinq + * @date 2024-09-18 + */ +public interface MesRaiseCapitalBomMapper { + /** + * 查询提资单BOM信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 提资单BOM信息 + */ + public MesRaiseCapitalBom selectMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId); + + /** + * 查询提资单BOM信息列表 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 提资单BOM信息集合 + */ + public List selectMesRaiseCapitalBomList(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 新增提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + public int insertMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 修改提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + public int updateMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 删除提资单BOM信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 结果 + */ + public int deleteMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId); + + /** + * 批量删除提资单BOM信息 + * + * @param raiseCapitalIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesRaiseCapitalBomByRaiseCapitalIds(Long[] raiseCapitalIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesImportService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesImportService.java index 8ec3f351..d1476a85 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesImportService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesImportService.java @@ -31,4 +31,14 @@ public interface IMesImportService * @return */ String BOMImportData(MultipartFile file, boolean updateSupport, String operName); + + /** + * 提资单BOM信息excel导入 + * @param file + * @param updateSupport + * @param operName + * @return + */ + String raiseCapitalImportData(MultipartFile file, boolean updateSupport, String operName); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessDetailService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessDetailService.java new file mode 100644 index 00000000..1cc5ed96 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessDetailService.java @@ -0,0 +1,61 @@ +package com.hw.mes.service; + +import java.util.List; +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; + +/** + * 采购申请流程明细Service接口 + * + * @author Open Platform + * @date 2024-09-24 + */ +public interface IMesPurchaseApplyProcessDetailService +{ + /** + * 查询采购申请流程明细 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 采购申请流程明细 + */ + public MesPurchaseApplyProcessDetail selectMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId); + + /** + * 查询采购申请流程明细列表 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 采购申请流程明细集合 + */ + public List selectMesPurchaseApplyProcessDetailList(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 新增采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + public int insertMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 修改采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + public int updateMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail); + + /** + * 批量删除采购申请流程明细 + * + * @param purchaseApplyDetailIds 需要删除的采购申请流程明细主键集合 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailIds(Long[] purchaseApplyDetailIds); + + /** + * 删除采购申请流程明细信息 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessService.java new file mode 100644 index 00000000..6516e718 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseApplyProcessService.java @@ -0,0 +1,89 @@ +package com.hw.mes.service; + +import java.util.List; + +import com.hw.mes.domain.MesPurchaseApplyProcess; +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; + +/** + * 采购申请流程Service接口 + * + * @author Yinq + * @date 2024-09-19 + */ +public interface IMesPurchaseApplyProcessService { + /** + * 查询采购申请流程 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 采购申请流程 + */ + public MesPurchaseApplyProcess selectMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId); + + /** + * 查询采购申请流程列表 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 采购申请流程集合 + */ + public List selectMesPurchaseApplyProcessList(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 新增采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + public int insertMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 修改采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + public int updateMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 批量删除采购申请流程 + * + * @param purchaseApplyIds 需要删除的采购申请流程主键集合 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds); + + /** + * 删除采购申请流程信息 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 结果 + */ + public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId); + + /** + * 提资单导入新增采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + public int insertRaisePurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 采购处理 + * 1、导入BOM,流程完成 + * 2、异常通知,技术修改 + * @param mesPurchaseApplyProcess + * @return + */ + public int purchaseAbnormalFlow(MesPurchaseApplyProcess mesPurchaseApplyProcess); + + /** + * 技术处理 + * 1、处理完成返回采购修改节点 + * 2、缺物料通知ERP人员 + * @param mesPurchaseApplyProcess + * @return + */ + public int technicalProcessing(MesPurchaseApplyProcess mesPurchaseApplyProcess); + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesRaiseCapitalBomService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesRaiseCapitalBomService.java new file mode 100644 index 00000000..bb9c009d --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesRaiseCapitalBomService.java @@ -0,0 +1,68 @@ +package com.hw.mes.service; + +import java.util.List; + +import com.hw.mes.domain.MesRaiseCapitalBom; + +/** + * 提资单BOM信息Service接口 + * + * @author Yinq + * @date 2024-09-18 + */ +public interface IMesRaiseCapitalBomService { + /** + * 查询提资单BOM信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 提资单BOM信息 + */ + public MesRaiseCapitalBom selectMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId); + + /** + * 查询提资单BOM信息列表 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 提资单BOM信息集合 + */ + public List selectMesRaiseCapitalBomList(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 新增提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + public int insertMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 修改提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + public int updateMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom); + + /** + * 批量删除提资单BOM信息 + * + * @param raiseCapitalIds 需要删除的提资单BOM信息主键集合 + * @return 结果 + */ + public int deleteMesRaiseCapitalBomByRaiseCapitalIds(Long[] raiseCapitalIds); + + /** + * 删除提资单BOM信息信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 结果 + */ + public int deleteMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId); + + /** + * BOM导入 + * @param taskCode + */ + public void importRaiseCapitalBom(String taskCode); + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java index 9332e357..07557501 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java @@ -3,25 +3,24 @@ package com.hw.mes.service.impl; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.SecurityConstants; +import com.hw.common.core.constant.WfConstants; import com.hw.common.core.domain.R; import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.bean.BeanValidators; +import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.security.utils.SecurityUtils; import com.hw.jindie.api.RemoteJindieService; import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseMaterialInfo; -import com.hw.mes.domain.MesBaseUnitInfo; -import com.hw.mes.domain.MesMaterialBom; -import com.hw.mes.domain.MesPurchaseRequisitionTemplate; +import com.hw.mes.domain.*; import com.hw.mes.mapper.MesBaseMaterialInfoMapper; import com.hw.mes.mapper.MesBaseUnitInfoMapper; import com.hw.mes.mapper.MesMaterialBomMapper; -import com.hw.mes.service.IMesBaseMaterialInfoService; -import com.hw.mes.service.IMesImportService; -import com.hw.mes.service.IMesMaterialBomService; +import com.hw.mes.service.*; import org.apache.poi.ss.usermodel.*; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -37,6 +36,7 @@ import java.io.InputStream; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import static org.apache.poi.ss.usermodel.CellType.NUMERIC; import static org.apache.poi.ss.usermodel.CellType.STRING; @@ -62,6 +62,12 @@ public class MesImportImpl implements IMesImportService { @Autowired private MesBaseMaterialInfoMapper mesBaseMaterialInfoMapper; + @Autowired + private IMesRaiseCapitalBomService mesRaiseCapitalBomService; + + @Autowired + private IMesPurchaseApplyProcessService mesPurchaseApplyProcessService; + private static final Logger log = LoggerFactory.getLogger(MesImportImpl.class); /** @@ -147,7 +153,7 @@ public class MesImportImpl implements IMesImportService { /** * 物料BOM信息excel导入 - * + * 接口作废 * @param file * @param updateSupport * @param operName @@ -156,7 +162,127 @@ public class MesImportImpl implements IMesImportService { @Override @Transactional(rollbackFor = ServiceException.class) public String BOMImportData(MultipartFile file, boolean updateSupport, String operName) { +// InputStream is = null; +// StringBuilder failureMsg = new StringBuilder(); +// try { +// is = file.getInputStream(); +// Workbook workbook = new XSSFWorkbook(is); +// Sheet sheet = workbook.getSheetAt(0); +// int lastRowNum = sheet.getLastRowNum(); +// for (int i = 0; i < lastRowNum; i++) { +// Row rowT = sheet.getRow(i); +// if (rowT == null) { +// continue; // 如果行为空,跳过 +// } +// Cell cellT = rowT.getCell(2); +// if (StringUtils.isNull(cellT)) { +// throw new ServiceException("Excel格式错误!"); +// } +// String productBom = cellT.getStringCellValue(); +// productBom = productBom.replaceAll("(.*?)", ""); +// MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom); +// if (productMaterial == null) { +// throw new ServiceException("Excel格式错误:物料编号:" + productBom + "的信息不存在!"); +// } +// +// i = i + 3;//标题下一行 +// MesMaterialBom selectBom = new MesMaterialBom(); +// selectBom.setMaterialId(productMaterial.getMaterialId()); +// selectBom.setMaterialBomDesc(productMaterial.getMaterialName()); +// List productBomList = mesMaterialBomService.selectMesMaterialBomList(selectBom); +// Long parentBomId = 0L; +// String parentBomDesc = productMaterial.getMaterialName(); +// if (productBomList.size() > 0) { +// MesMaterialBom mesMaterialBom = productBomList.get(0); +// parentBomId = mesMaterialBom.getMaterialBomId(); +// MesMaterialBom materialBom = new MesMaterialBom(); +// materialBom.setParentId(mesMaterialBom.getMaterialBomId()); +// List mesMaterialBoms = mesMaterialBomService.selectMesMaterialBomList(materialBom); +// for (MesMaterialBom bom : mesMaterialBoms) { +// mesMaterialBomService.deleteMesMaterialBomByMaterialBomId(bom.getMaterialBomId()); +// } +// } else { +// MesMaterialBom materialBom = new MesMaterialBom(); +// materialBom.setMaterialId(productMaterial.getMaterialId()); +// materialBom.setMaterialName(productMaterial.getMaterialName()); +// materialBom.setMaterialBomDesc(productMaterial.getMaterialName()); +// materialBom.setParentId(0L); +// materialBom.setActiveFlag("1"); +// materialBom.setStandardAmount(new BigDecimal(1)); +// materialBom.setCreateBy(operName); +// mesMaterialBomService.insertMesMaterialBom(materialBom); +// parentBomId = materialBom.getMaterialBomId(); +// } +// +// ArrayList bomList = new ArrayList<>(); +// while (true) { +// if (i > lastRowNum) { +// break; +// } +// Row rowC = sheet.getRow(i); +// Cell numberCell = rowC.getCell(0); +// if (StringUtils.isNull(numberCell) || numberCell.getCellType() != NUMERIC) { +// break; +// } +// Cell materialCodeCell = rowC.getCell(1); +// String materialCode = null; +// if (materialCodeCell.getCellType() == NUMERIC) { +// double numericCellValue = materialCodeCell.getNumericCellValue(); +// materialCode = new BigDecimal(numericCellValue).toString(); +// } else if (materialCodeCell.getCellType() == STRING) { +// materialCode = materialCodeCell.getStringCellValue(); +// } +// Cell amountCell = rowC.getCell(5); +// if (StringUtils.isNotEmpty(materialCode)) { +// MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode); +// if (StringUtils.isNotNull(materialInfo)) { +// MesMaterialBom materialBom = new MesMaterialBom(); +// materialBom.setMaterialId(materialInfo.getMaterialId()); +// materialBom.setMaterialName(materialInfo.getMaterialName()); +// materialBom.setMaterialCode(materialInfo.getMaterialCode()); +// materialBom.setMaterialBomDesc(parentBomDesc); +// materialBom.setParentId(parentBomId); +// materialBom.setActiveFlag("1"); +// materialBom.setStandardAmount(BigDecimal.valueOf(amountCell.getNumericCellValue())); +// materialBom.setCreateBy(operName); +// bomList.add(materialBom); +// } else { +// failureMsg.append("物料编号:").append(materialCode).append("|"); +// } +// } +// i++; +// } +// if (failureMsg.length() != 0){ +// failureMsg.append("MES中未同步该物料信息!"); +// throw new ServiceException(failureMsg.toString()); +// } +// for (MesMaterialBom materialBom : bomList) { +// mesMaterialBomService.insertMesMaterialBom(materialBom); +// } +// } +// } catch (IOException e) { +// throw new ServiceException("文件处理错误:" + e); +// } finally { +// IOUtils.closeQuietly(is); +// } + + return "BOM导入成功"; + } + + /** + * 提资单BOM信息excel导入 + * @param file + * @param updateSupport + * @param operName + * @return + */ + @Override + @Transactional(rollbackFor = ServiceException.class) + public String raiseCapitalImportData(MultipartFile file, boolean updateSupport, String operName) { InputStream is = null; + StringBuilder failureMsg = new StringBuilder(); + List finishedProductNameList = new ArrayList<>(); + String taskCode = Seq.getId(Seq.mesPurchaseApplyProcessSeqType, Seq.mesPurchaseApplyProcessCode); try { is = file.getInputStream(); Workbook workbook = new XSSFWorkbook(is); @@ -175,39 +301,41 @@ public class MesImportImpl implements IMesImportService { productBom = productBom.replaceAll("(.*?)", ""); MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom); if (productMaterial == null) { - throw new ServiceException("Excel格式错误:找不到父级BOM信息!"); + throw new ServiceException("Excel格式错误:物料编号:" + productBom + "的信息不存在!"); } i = i + 3;//标题下一行 - MesMaterialBom selectBom = new MesMaterialBom(); + MesRaiseCapitalBom selectBom = new MesRaiseCapitalBom(); selectBom.setMaterialId(productMaterial.getMaterialId()); selectBom.setMaterialBomDesc(productMaterial.getMaterialName()); - List productBomList = mesMaterialBomService.selectMesMaterialBomList(selectBom); + List productBomList = mesRaiseCapitalBomService.selectMesRaiseCapitalBomList(selectBom); Long parentBomId = 0L; String parentBomDesc = productMaterial.getMaterialName(); + finishedProductNameList.add(productMaterial.getMaterialName()); if (productBomList.size() > 0) { - MesMaterialBom mesMaterialBom = productBomList.get(0); - parentBomId = mesMaterialBom.getMaterialBomId(); - MesMaterialBom materialBom = new MesMaterialBom(); - materialBom.setParentId(mesMaterialBom.getMaterialBomId()); - List mesMaterialBoms = mesMaterialBomService.selectMesMaterialBomList(materialBom); - for (MesMaterialBom bom : mesMaterialBoms) { - mesMaterialBomService.deleteMesMaterialBomByMaterialBomId(bom.getMaterialBomId()); + MesRaiseCapitalBom mesMaterialBom = productBomList.get(0); + parentBomId = mesMaterialBom.getRaiseCapitalId(); + MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom(); + materialBom.setParentId(mesMaterialBom.getRaiseCapitalId()); + List mesMaterialBoms = mesRaiseCapitalBomService.selectMesRaiseCapitalBomList(materialBom); + for (MesRaiseCapitalBom bom : mesMaterialBoms) { + mesRaiseCapitalBomService.deleteMesRaiseCapitalBomByRaiseCapitalId(bom.getRaiseCapitalId()); } } else { - MesMaterialBom materialBom = new MesMaterialBom(); + MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom(); + materialBom.setTaskCode(taskCode); materialBom.setMaterialId(productMaterial.getMaterialId()); materialBom.setMaterialName(productMaterial.getMaterialName()); materialBom.setMaterialBomDesc(productMaterial.getMaterialName()); materialBom.setParentId(0L); materialBom.setActiveFlag("1"); materialBom.setStandardAmount(new BigDecimal(1)); - materialBom.setCreateBy(operName); - mesMaterialBomService.insertMesMaterialBom(materialBom); - parentBomId = materialBom.getMaterialBomId(); + materialBom.setErpMaterialId(productMaterial.getErpId()); + mesRaiseCapitalBomService.insertMesRaiseCapitalBom(materialBom); + parentBomId = materialBom.getRaiseCapitalId(); } - ArrayList bomList = new ArrayList<>(); + ArrayList bomList = new ArrayList<>(); while (true) { if (i > lastRowNum) { break; @@ -229,30 +357,46 @@ public class MesImportImpl implements IMesImportService { if (StringUtils.isNotEmpty(materialCode)) { MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode); if (StringUtils.isNotNull(materialInfo)) { - MesMaterialBom materialBom = new MesMaterialBom(); + MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom(); + materialBom.setTaskCode(taskCode); materialBom.setMaterialId(materialInfo.getMaterialId()); materialBom.setMaterialName(materialInfo.getMaterialName()); - materialBom.setMaterialCode(materialInfo.getMaterialName()); materialBom.setMaterialBomDesc(parentBomDesc); materialBom.setParentId(parentBomId); materialBom.setActiveFlag("1"); materialBom.setStandardAmount(BigDecimal.valueOf(amountCell.getNumericCellValue())); - materialBom.setCreateBy(operName); + materialBom.setErpMaterialId(materialInfo.getErpId()); bomList.add(materialBom); + } else { + failureMsg.append("物料编号:").append(materialCode).append("|"); } } i++; } - for (MesMaterialBom materialBom : bomList) { - mesMaterialBomService.insertMesMaterialBom(materialBom); + if (failureMsg.length() != 0){ + failureMsg.append("MES中未同步该物料信息!"); + throw new ServiceException(failureMsg.toString()); + } + for (MesRaiseCapitalBom materialBom : bomList) { + mesRaiseCapitalBomService.insertMesRaiseCapitalBom(materialBom); } } + //存入采购申请流程 + MesPurchaseApplyProcess applyProcess = new MesPurchaseApplyProcess(); + applyProcess.setTaskCode(taskCode); + String materialName = String.join(",", finishedProductNameList); + applyProcess.setMaterialName(materialName); + applyProcess.setWfProcessId(WfConstants.WF_PURCHASE_REQUISITION_PROCESS_ID); + applyProcess.setProcessActivityId(WfConstants.WF_PURCHASE_ACTIVITY_CREATE_ID); + applyProcess.setCreateBy(SecurityUtils.getUsername()); + applyProcess.setCreateTime(DateUtils.getNowDate()); + //新增采购申请流程 + mesPurchaseApplyProcessService.insertRaisePurchaseApplyProcess(applyProcess); } catch (IOException e) { throw new ServiceException("文件处理错误:" + e); } finally { IOUtils.closeQuietly(is); } - return "BOM导入成功"; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessDetailServiceImpl.java new file mode 100644 index 00000000..0262cab8 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessDetailServiceImpl.java @@ -0,0 +1,93 @@ +package com.hw.mes.service.impl; + +import java.util.List; + +import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.mes.mapper.MesPurchaseApplyProcessDetailMapper; +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; +import com.hw.mes.service.IMesPurchaseApplyProcessDetailService; + +/** + * 采购申请流程明细Service业务层处理 + * + * @author Open Platform + * @date 2024-09-24 + */ +@Service +public class MesPurchaseApplyProcessDetailServiceImpl implements IMesPurchaseApplyProcessDetailService { + @Autowired + private MesPurchaseApplyProcessDetailMapper mesPurchaseApplyProcessDetailMapper; + + /** + * 查询采购申请流程明细 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 采购申请流程明细 + */ + @Override + public MesPurchaseApplyProcessDetail selectMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId) { + return mesPurchaseApplyProcessDetailMapper.selectMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(purchaseApplyDetailId); + } + + /** + * 查询采购申请流程明细列表 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 采购申请流程明细 + */ + @Override + public List selectMesPurchaseApplyProcessDetailList(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail) { + return mesPurchaseApplyProcessDetailMapper.selectMesPurchaseApplyProcessDetailList(mesPurchaseApplyProcessDetail); + } + + /** + * 新增采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + @Override + public int insertMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail) { + mesPurchaseApplyProcessDetail.setCreateBy(SecurityUtils.getUsername()); + mesPurchaseApplyProcessDetail.setCreateTime(DateUtils.getNowDate()); + return mesPurchaseApplyProcessDetailMapper.insertMesPurchaseApplyProcessDetail(mesPurchaseApplyProcessDetail); + } + + /** + * 修改采购申请流程明细 + * + * @param mesPurchaseApplyProcessDetail 采购申请流程明细 + * @return 结果 + */ + @Override + public int updateMesPurchaseApplyProcessDetail(MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail) { + mesPurchaseApplyProcessDetail.setUpdateBy(SecurityUtils.getUsername()); + mesPurchaseApplyProcessDetail.setUpdateTime(DateUtils.getNowDate()); + return mesPurchaseApplyProcessDetailMapper.updateMesPurchaseApplyProcessDetail(mesPurchaseApplyProcessDetail); + } + + /** + * 批量删除采购申请流程明细 + * + * @param purchaseApplyDetailIds 需要删除的采购申请流程明细主键 + * @return 结果 + */ + @Override + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailIds(Long[] purchaseApplyDetailIds) { + return mesPurchaseApplyProcessDetailMapper.deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailIds(purchaseApplyDetailIds); + } + + /** + * 删除采购申请流程明细信息 + * + * @param purchaseApplyDetailId 采购申请流程明细主键 + * @return 结果 + */ + @Override + public int deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(Long purchaseApplyDetailId) { + return mesPurchaseApplyProcessDetailMapper.deleteMesPurchaseApplyProcessDetailByPurchaseApplyDetailId(purchaseApplyDetailId); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessServiceImpl.java new file mode 100644 index 00000000..349f8b8c --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseApplyProcessServiceImpl.java @@ -0,0 +1,277 @@ +package com.hw.mes.service.impl; + +import java.util.List; + +import com.hw.common.core.constant.SecurityConstants; +import com.hw.common.core.constant.WfConstants; +import com.hw.common.core.domain.R; +import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.MailUtils; +import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.service.IMesPurchaseApplyProcessDetailService; +import com.hw.mes.service.IMesRaiseCapitalBomService; +import com.hw.system.api.RemoteSysCommonService; +import com.hw.system.api.domain.common.WfProcessActivity; +import com.hw.system.api.domain.common.WfProcessActivityAuth; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; + +import com.hw.common.core.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.hw.mes.domain.MesPurchaseApplyProcessDetail; +import com.hw.mes.mapper.MesPurchaseApplyProcessMapper; +import com.hw.mes.domain.MesPurchaseApplyProcess; +import com.hw.mes.service.IMesPurchaseApplyProcessService; + +/** + * 采购申请流程Service业务层处理 + * + * @author Yinq + * @date 2024-09-19 + */ +@Service +public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProcessService { + @Autowired + private MesPurchaseApplyProcessMapper mesPurchaseApplyProcessMapper; + + @Autowired + private IMesPurchaseApplyProcessDetailService mesPurchaseApplyProcessDetailService; + + @Autowired + private RemoteSysCommonService remoteSysCommonService; + + @Autowired + private IMesRaiseCapitalBomService mesRaiseCapitalBomService; + + /** + * 查询采购申请流程 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 采购申请流程 + */ + @Override + public MesPurchaseApplyProcess selectMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId) { + return mesPurchaseApplyProcessMapper.selectMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId); + } + + /** + * 查询采购申请流程列表 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 采购申请流程 + */ + @Override + public List selectMesPurchaseApplyProcessList(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + return mesPurchaseApplyProcessMapper.selectMesPurchaseApplyProcessList(mesPurchaseApplyProcess); + } + + /** + * 新增采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + @Transactional + @Override + public int insertMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + mesPurchaseApplyProcess.setCreateTime(DateUtils.getNowDate()); + int rows = mesPurchaseApplyProcessMapper.insertMesPurchaseApplyProcess(mesPurchaseApplyProcess); + insertMesPurchaseApplyProcessDetail(mesPurchaseApplyProcess); + return rows; + } + + /** + * 修改采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + @Transactional + @Override + public int updateMesPurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + mesPurchaseApplyProcess.setUpdateBy(SecurityUtils.getUsername()); + mesPurchaseApplyProcess.setUpdateTime(DateUtils.getNowDate()); + return mesPurchaseApplyProcessMapper.updateMesPurchaseApplyProcess(mesPurchaseApplyProcess); + } + + /** + * 批量删除采购申请流程 + * + * @param purchaseApplyIds 需要删除的采购申请流程主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds) { + mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCodes(purchaseApplyIds); + return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyIds(purchaseApplyIds); + } + + /** + * 删除采购申请流程信息 + * + * @param purchaseApplyId 采购申请流程主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId) { + mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCode(purchaseApplyId); + return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId); + } + + /** + * 新增采购申请流程明细信息 + * + * @param mesPurchaseApplyProcess 采购申请流程对象 + */ + public void insertMesPurchaseApplyProcessDetail(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + List mesPurchaseApplyProcessDetailList = mesPurchaseApplyProcess.getMesPurchaseApplyProcessDetailList(); + String taskCode = mesPurchaseApplyProcess.getTaskCode(); + if (StringUtils.isNotNull(mesPurchaseApplyProcessDetailList)) { + List list = new ArrayList<>(); + for (MesPurchaseApplyProcessDetail mesPurchaseApplyProcessDetail : mesPurchaseApplyProcessDetailList) { + mesPurchaseApplyProcessDetail.setTaskCode(taskCode); + list.add(mesPurchaseApplyProcessDetail); + } + if (list.size() > 0) { + mesPurchaseApplyProcessMapper.batchMesPurchaseApplyProcessDetail(list); + } + } + } + + /** + * 提资单导入新增采购申请流程 + * + * @param mesPurchaseApplyProcess 采购申请流程 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = ServiceException.class) + public int insertRaisePurchaseApplyProcess(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + String taskCode = mesPurchaseApplyProcess.getTaskCode(); + Long processActivityId = mesPurchaseApplyProcess.getProcessActivityId(); + mesPurchaseApplyProcessMapper.insertMesPurchaseApplyProcess(mesPurchaseApplyProcess); + //存采购申请流程创建流程节点 + MesPurchaseApplyProcessDetail processDetail = new MesPurchaseApplyProcessDetail(); + processDetail.setTaskCode(taskCode); + processDetail.setProcessActivityId(processActivityId); + //技术导入提资单BOM -> 邮件通知采购 + String text = mesPurchaseApplyProcess.getMaterialName() + ",提资单已导入请采购确认!"; + mesPurchaseApplyProcess.setRemark(text); + this.processActivityEmailNotice(mesPurchaseApplyProcess, processDetail, WfConstants.WF_PURCHASE_ACTIVITY_PROCUREMENT_AUDIT_ID); + mesPurchaseApplyProcessDetailService.insertMesPurchaseApplyProcessDetail(processDetail); +// /**流程节点:采购申请流程创建*/ +// public static final Long WF_PURCHASE_ACTIVITY_CREATE_ID = 4011L; +// /**流程节点:采购申请流程采购审核*/ +// public static final Long WF_PURCHASE_ACTIVITY_PROCUREMENT_AUDIT_ID = 4012L; +// /**流程节点:采购申请流程技术修改*/ +// public static final Long WF_PURCHASE_ACTIVITY_TECHNICAL_MODIFY_ID = 4013L; +// /**流程节点:采购申请流程ERP修改*/ +// public static final Long WF_PURCHASE_ACTIVITY_ERP_MODIFY_ID = 4014L; + return 1; + } + + /** + * 流程节点邮件通知 + * @param mesPurchaseApplyProcess + * @param processDetail + * @param processActivityId + */ + private void processActivityEmailNotice(MesPurchaseApplyProcess mesPurchaseApplyProcess, MesPurchaseApplyProcessDetail processDetail, Long processActivityId) { + R activityRes = remoteSysCommonService.selectProcessActivityUserInfo(SecurityConstants.INNER, processActivityId); + String title = activityRes.getData().getProcessActivityName() + "[" + mesPurchaseApplyProcess.getTaskCode() + "]"; + String text = mesPurchaseApplyProcess.getRemark(); + List activityAuthList = activityRes.getData().getWfProcessActivityAuthList(); + List userNameList = new ArrayList<>();//已通知用户 + for (WfProcessActivityAuth activityAuth : activityAuthList) { + //邮件通知 + String email = activityAuth.getEmail(); + if (StringUtils.isNotEmpty(email)){ + MailUtils.processSendEmail(email, title, text); + userNameList.add(activityAuth.getUserName()); + } + } + if (userNameList.size() > 0){ + processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_YES); + processDetail.setNoticeAuth(String.join(",", userNameList)); + } else { + processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_NO); + } + } + + /** + * 采购处理 + * 1、导入BOM,流程完成 + * 2、异常通知,技术修改 + * @param mesPurchaseApplyProcess + * @return + */ + @Override + @Transactional(rollbackFor = ServiceException.class) + public int purchaseAbnormalFlow(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + //流程节点:采购申请流程采购审核 + String currentAnomalyFlag = mesPurchaseApplyProcess.getCurrentAnomalyFlag(); + Long processActivityId = WfConstants.WF_PURCHASE_ACTIVITY_PROCUREMENT_AUDIT_ID; + MesPurchaseApplyProcessDetail processDetail = new MesPurchaseApplyProcessDetail(); + processDetail.setTaskCode(mesPurchaseApplyProcess.getTaskCode()); + processDetail.setProcessActivityId(processActivityId); + processDetail.setAnomalyFlag(currentAnomalyFlag); + processDetail.setPurchaseRemark(mesPurchaseApplyProcess.getRemark()); + if (currentAnomalyFlag.equals(WfConstants.PA_ANOMALY_FLAG_YES)){ + //异常通知,技术修改 + this.processActivityEmailNotice(mesPurchaseApplyProcess, processDetail, WfConstants.WF_PURCHASE_ACTIVITY_TECHNICAL_MODIFY_ID); + mesPurchaseApplyProcess.setProcessActivityId(processActivityId); + } + mesPurchaseApplyProcessDetailService.insertMesPurchaseApplyProcessDetail(processDetail); + if (currentAnomalyFlag.equals(WfConstants.PA_ANOMALY_FLAG_NO)){ + //导入BOM,流程完成 + mesRaiseCapitalBomService.importRaiseCapitalBom(mesPurchaseApplyProcess.getTaskCode()); + mesPurchaseApplyProcess.setProcessActivityId(WfConstants.WF_PURCHASE_ACTIVITY_FINISH_ID); + mesPurchaseApplyProcess.setImportFlag(WfConstants.PA_IMPORT_FLAG_YES); + //流程节点:采购申请流程完成 + processDetail.setProcessActivityId(WfConstants.WF_PURCHASE_ACTIVITY_FINISH_ID); + mesPurchaseApplyProcessDetailService.insertMesPurchaseApplyProcessDetail(processDetail); + } + this.updateMesPurchaseApplyProcess(mesPurchaseApplyProcess); + return 1; + } + + /** + * 技术处理 + * 1、处理完成返回采购修改节点 + * 2、缺物料通知ERP人员 + * @param mesPurchaseApplyProcess + * @return + */ + @Override + @Transactional(rollbackFor = ServiceException.class) + public int technicalProcessing(MesPurchaseApplyProcess mesPurchaseApplyProcess) { + //流程节点:采购申请流程技术修改 + String currentAnomalyFlag = mesPurchaseApplyProcess.getCurrentAnomalyFlag(); + Long processActivityId = WfConstants.WF_PURCHASE_ACTIVITY_TECHNICAL_MODIFY_ID; + MesPurchaseApplyProcessDetail processDetail = new MesPurchaseApplyProcessDetail(); + processDetail.setTaskCode(mesPurchaseApplyProcess.getTaskCode()); + processDetail.setProcessActivityId(processActivityId); + processDetail.setAnomalyFlag(currentAnomalyFlag); + processDetail.setPurchaseRemark(mesPurchaseApplyProcess.getRemark()); + if (currentAnomalyFlag.equals(WfConstants.PA_ANOMALY_FLAG_NO)){ + //处理完成返回采购修改节点 + this.processActivityEmailNotice(mesPurchaseApplyProcess, processDetail, WfConstants.WF_PURCHASE_ACTIVITY_PROCUREMENT_AUDIT_ID); + mesPurchaseApplyProcess.setProcessActivityId(WfConstants.WF_PURCHASE_ACTIVITY_CREATE_ID); + } + if (currentAnomalyFlag.equals(WfConstants.PA_ANOMALY_FLAG_YES)){ + //缺物料通知ERP人员 + this.processActivityEmailNotice(mesPurchaseApplyProcess, processDetail, WfConstants.WF_PURCHASE_ACTIVITY_ERP_MODIFY_ID); + mesPurchaseApplyProcess.setProcessActivityId(processActivityId); + } + mesPurchaseApplyProcessDetailService.insertMesPurchaseApplyProcessDetail(processDetail); + this.updateMesPurchaseApplyProcess(mesPurchaseApplyProcess); + return 1; + } + + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesRaiseCapitalBomServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesRaiseCapitalBomServiceImpl.java new file mode 100644 index 00000000..f52ce150 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesRaiseCapitalBomServiceImpl.java @@ -0,0 +1,141 @@ +package com.hw.mes.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.StringUtils; +import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.domain.MesMaterialBom; +import com.hw.mes.mapper.MesMaterialBomMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.mes.mapper.MesRaiseCapitalBomMapper; +import com.hw.mes.domain.MesRaiseCapitalBom; +import com.hw.mes.service.IMesRaiseCapitalBomService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 提资单BOM信息Service业务层处理 + * + * @author Yinq + * @date 2024-09-18 + */ +@Service +public class MesRaiseCapitalBomServiceImpl implements IMesRaiseCapitalBomService { + @Autowired + private MesRaiseCapitalBomMapper mesRaiseCapitalBomMapper; + + @Autowired + private MesMaterialBomMapper mesMaterialBomMapper; + + /** + * 查询提资单BOM信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 提资单BOM信息 + */ + @Override + public MesRaiseCapitalBom selectMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId) { + return mesRaiseCapitalBomMapper.selectMesRaiseCapitalBomByRaiseCapitalId(raiseCapitalId); + } + + /** + * 查询提资单BOM信息列表 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 提资单BOM信息 + */ + @Override + public List selectMesRaiseCapitalBomList(MesRaiseCapitalBom mesRaiseCapitalBom) { + return mesRaiseCapitalBomMapper.selectMesRaiseCapitalBomList(mesRaiseCapitalBom); + } + + /** + * 新增提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + @Override + public int insertMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom) { + isTopFlag(mesRaiseCapitalBom); + mesRaiseCapitalBom.setCreateBy(SecurityUtils.getUsername()); + mesRaiseCapitalBom.setCreateTime(DateUtils.getNowDate()); + MesRaiseCapitalBom info = mesRaiseCapitalBomMapper.selectMesRaiseCapitalBomByRaiseCapitalId(mesRaiseCapitalBom.getParentId()); + if (StringUtils.isNull(info)){ + mesRaiseCapitalBom.setAncestors(mesRaiseCapitalBom.getParentId().toString()); + }else { + mesRaiseCapitalBom.setAncestors(info.getAncestors() + "," + mesRaiseCapitalBom.getParentId()); + } + return mesRaiseCapitalBomMapper.insertMesRaiseCapitalBom(mesRaiseCapitalBom); + } + + /** + * SET顶级标识 + * 判断是否顶级BOM + * @param mesRaiseCapitalBom + */ + private void isTopFlag(MesRaiseCapitalBom mesRaiseCapitalBom){ + // 顶级标识1=是,0=否 + if (StringUtils.isNull(mesRaiseCapitalBom.getParentId()) || mesRaiseCapitalBom.getParentId() == 0L){ + mesRaiseCapitalBom.setTopFlag(1L); + }else { + mesRaiseCapitalBom.setTopFlag(0L); + } + } + + /** + * 修改提资单BOM信息 + * + * @param mesRaiseCapitalBom 提资单BOM信息 + * @return 结果 + */ + @Override + public int updateMesRaiseCapitalBom(MesRaiseCapitalBom mesRaiseCapitalBom) { + mesRaiseCapitalBom.setUpdateBy(SecurityUtils.getUsername()); + mesRaiseCapitalBom.setUpdateTime(DateUtils.getNowDate()); + return mesRaiseCapitalBomMapper.updateMesRaiseCapitalBom(mesRaiseCapitalBom); + } + + /** + * 批量删除提资单BOM信息 + * + * @param raiseCapitalIds 需要删除的提资单BOM信息主键 + * @return 结果 + */ + @Override + public int deleteMesRaiseCapitalBomByRaiseCapitalIds(Long[] raiseCapitalIds) { + return mesRaiseCapitalBomMapper.deleteMesRaiseCapitalBomByRaiseCapitalIds(raiseCapitalIds); + } + + /** + * 删除提资单BOM信息信息 + * + * @param raiseCapitalId 提资单BOM信息主键 + * @return 结果 + */ + @Override + public int deleteMesRaiseCapitalBomByRaiseCapitalId(Long raiseCapitalId) { + return mesRaiseCapitalBomMapper.deleteMesRaiseCapitalBomByRaiseCapitalId(raiseCapitalId); + } + + @Override + @Transactional(rollbackFor = ServiceException.class) + public void importRaiseCapitalBom(String taskCode) { + MesRaiseCapitalBom raiseCapitalBom = new MesRaiseCapitalBom(); + raiseCapitalBom.setTaskCode(taskCode); + List capitalBomList = mesRaiseCapitalBomMapper.selectMesRaiseCapitalBomList(raiseCapitalBom); + //TODO 异常处理 + + List materialBomList = new ArrayList<>(); + for (MesRaiseCapitalBom capitalBom : capitalBomList) { + MesMaterialBom mesMaterialBom = new MesMaterialBom(); + mesMaterialBom.copyFromMesRaiseCapitalBom(capitalBom); + materialBomList.add(mesMaterialBom); + } + mesMaterialBomMapper.batchMesMaterialBom(materialBomList); + } + +} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml index a4fa5d3a..b5da4fe9 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml @@ -202,5 +202,11 @@ order by mmb.material_bom_id desc + + insert into mes_material_bom( material_bom_id, material_bom_desc, parent_id, ancestors, material_id, material_name, standard_amount, top_flag, check_type, project_id, assemble_time, active_flag, remark, create_by, create_time, update_by, update_time, brand, material_classfication, erp_material_id) values + + ( #{item.materialBomId}, #{item.materialBomDesc}, #{item.parentId}, #{item.ancestors}, #{item.materialId}, #{item.materialName}, #{item.standardAmount}, #{item.topFlag}, #{item.checkType}, #{item.projectId}, #{item.assembleTime}, #{item.activeFlag}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.brand}, #{item.materialClassfication}, #{item.erpMaterialId}) + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessDetailMapper.xml new file mode 100644 index 00000000..4a2b5afa --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessDetailMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + select purchase_apply_detail_id, + task_code, + process_activity_id, + anomaly_flag, + update_flag, + notice_flag, + notice_auth, + purchase_remark, + create_by, + create_time, + update_by, + update_time + from mes_purchase_apply_process_detail + + + + + + + + insert into mes_purchase_apply_process_detail + + task_code, + process_activity_id, + anomaly_flag, + update_flag, + notice_flag, + notice_auth, + purchase_remark, + create_by, + create_time, + update_by, + update_time, + + + #{taskCode}, + #{processActivityId}, + #{anomalyFlag}, + #{updateFlag}, + #{noticeFlag}, + #{noticeAuth}, + #{purchaseRemark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_purchase_apply_process_detail + + task_code = #{taskCode}, + process_activity_id = #{processActivityId}, + anomaly_flag = #{anomalyFlag}, + update_flag = #{updateFlag}, + notice_flag = #{noticeFlag}, + notice_auth = #{noticeAuth}, + purchase_remark = #{purchaseRemark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where purchase_apply_detail_id = #{purchaseApplyDetailId} + + + + delete + from mes_purchase_apply_process_detail + where purchase_apply_detail_id = #{purchaseApplyDetailId} + + + + delete from mes_purchase_apply_process_detail where purchase_apply_detail_id in + + #{purchaseApplyDetailId} + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessMapper.xml new file mode 100644 index 00000000..8f45d3f8 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseApplyProcessMapper.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select mpap.purchase_apply_id, + mpap.task_code, + mpap.material_name, + mpap.wf_process_id, + mpap.process_activity_id, + mpap.import_flag, + mpap.create_by, + mpap.create_time, + mpap.update_by, + mpap.update_time, + wpa.process_activity_name + from mes_purchase_apply_process mpap + left join wf_process_activity wpa on mpap.process_activity_id + 1 = wpa.process_activity_id + + + + + + + + insert into mes_purchase_apply_process + + task_code, + material_name, + wf_process_id, + process_activity_id, + import_flag, + create_by, + create_time, + update_by, + update_time, + + + #{taskCode}, + #{materialName}, + #{wfProcessId}, + #{processActivityId}, + #{importFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_purchase_apply_process + + task_code = #{taskCode}, + material_name = #{materialName}, + wf_process_id = #{wfProcessId}, + process_activity_id = #{processActivityId}, + import_flag = #{importFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where purchase_apply_id = #{purchaseApplyId} + + + + delete + from mes_purchase_apply_process + where purchase_apply_id = #{purchaseApplyId} + + + + delete from mes_purchase_apply_process where purchase_apply_id in + + #{purchaseApplyId} + + + + + delete from mes_purchase_apply_process_detail where task_code in + + #{taskCode} + + + + + delete + from mes_purchase_apply_process_detail + where task_code = #{taskCode} + + + + insert into mes_purchase_apply_process_detail( purchase_apply_detail_id, task_code, process_activity_id, + anomaly_flag, update_flag, notice_flag, notice_auth, purchase_remark, create_by, create_time, update_by, + update_time) values + + ( #{item.purchaseApplyDetailId}, #{item.taskCode}, #{item.processActivityId}, #{item.anomalyFlag}, + #{item.updateFlag}, #{item.noticeFlag}, #{item.noticeAuth}, #{item.purchaseRemark}, #{item.createBy}, + #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesRaiseCapitalBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesRaiseCapitalBomMapper.xml new file mode 100644 index 00000000..6847a0f0 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesRaiseCapitalBomMapper.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select mrcb.raise_capital_id, + mrcb.task_code, + mrcb.material_bom_desc, + mrcb.parent_id, + mrcb.ancestors, + mrcb.material_id, + mrcb.standard_amount, + mrcb.top_flag, + mrcb.check_type, + mrcb.project_id, + mrcb.assemble_time, + mrcb.active_flag, + mrcb.remark, + mrcb.create_by, + mrcb.create_time, + mrcb.update_by, + mrcb.update_time, + mrcb.brand, + mrcb.material_classfication, + mrcb.erp_material_id, + mbmi.material_code, + mbmi.material_name, + mbmi.material_spec + from mes_raise_capital_bom mrcb + left join mes_base_material_info mbmi on mrcb.material_id = mbmi.material_id + + + + + + + + insert into mes_raise_capital_bom + + task_code, + material_bom_desc, + parent_id, + ancestors, + material_id, + material_name, + standard_amount, + top_flag, + check_type, + project_id, + assemble_time, + active_flag, + remark, + create_by, + create_time, + update_by, + update_time, + brand, + material_classfication, + erp_material_id, + + + #{taskCode}, + #{materialBomDesc}, + #{parentId}, + #{ancestors}, + #{materialId}, + #{materialName}, + #{standardAmount}, + #{topFlag}, + #{checkType}, + #{projectId}, + #{assembleTime}, + #{activeFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{brand}, + #{materialClassfication}, + #{erpMaterialId}, + + + + + update mes_raise_capital_bom + + task_code = #{taskCode}, + material_bom_desc = #{materialBomDesc}, + parent_id = #{parentId}, + ancestors = #{ancestors}, + material_id = #{materialId}, + material_name = #{materialName}, + standard_amount = #{standardAmount}, + top_flag = #{topFlag}, + check_type = #{checkType}, + project_id = #{projectId}, + assemble_time = #{assembleTime}, + active_flag = #{activeFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + brand = #{brand}, + material_classfication = #{materialClassfication}, + erp_material_id = #{erpMaterialId}, + + where raise_capital_id = #{raiseCapitalId} + + + + delete + from mes_raise_capital_bom + where raise_capital_id = #{raiseCapitalId} + + + + delete from mes_raise_capital_bom where raise_capital_id in + + #{raiseCapitalId} + + + \ No newline at end of file diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/WfProcessActivityController.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/WfProcessActivityController.java index 2f2d58f4..d2a612e9 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/WfProcessActivityController.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/WfProcessActivityController.java @@ -121,4 +121,11 @@ public class WfProcessActivityController extends BaseController return success(wfProcessActivityService.selectWfProcessActivityByUI(queryProcessActivityVo.getWfProcessId(), queryProcessActivityVo.getProcessActivityOrder())); } + + @InnerAuth + @PostMapping(value = "/processActivityUserInfo") + public AjaxResult processActivityUserInfo(@RequestBody Long processActivityId) + { + return success(wfProcessActivityService.selectProcessActivityUserInfo(processActivityId)); + } } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/WfProcessActivityMapper.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/WfProcessActivityMapper.java index 1f7c732f..d0b05c0b 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/WfProcessActivityMapper.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/WfProcessActivityMapper.java @@ -100,4 +100,5 @@ public interface WfProcessActivityMapper public WfProcessActivity selectWfProcessActivityByUI(@Param("wfProcessId") Long wfProcessId, @Param("processActivityOrder") Long processActivityOrder); + public WfProcessActivity selectProcessActivityUserInfo(Long processActivityId); } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IWfProcessActivityService.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IWfProcessActivityService.java index a16df332..08f8d52c 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IWfProcessActivityService.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IWfProcessActivityService.java @@ -70,4 +70,7 @@ public interface IWfProcessActivityService { * @return 工单流程节点步骤 */ public WfProcessActivity selectWfProcessActivityByUI(Long wfProcessId, Long processActivityOrder); + + WfProcessActivity selectProcessActivityUserInfo(Long processActivityId); + } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java index f06ef75f..57b744bc 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java @@ -179,4 +179,10 @@ public class WfProcessActivityServiceImpl implements IWfProcessActivityService public WfProcessActivity selectWfProcessActivityByUI(Long wfProcessId, Long processActivityOrder){ return wfProcessActivityMapper.selectWfProcessActivityByUI(wfProcessId, processActivityOrder); } + + @Override + public WfProcessActivity selectProcessActivityUserInfo(Long processActivityId) { + WfProcessActivity wfProcessActivity = wfProcessActivityMapper.selectProcessActivityUserInfo(processActivityId); + return wfProcessActivity; + } } diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/common/WfProcessActivityMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/common/WfProcessActivityMapper.xml index 102dcb22..16521159 100644 --- a/hw-modules/hw-system/src/main/resources/mapper/system/common/WfProcessActivityMapper.xml +++ b/hw-modules/hw-system/src/main/resources/mapper/system/common/WfProcessActivityMapper.xml @@ -37,6 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -170,4 +173,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from wf_process_activity a where a.wf_process_id = #{wfProcessId} and a.process_activity_order = #{processActivityOrder} limit 1 + + + diff --git a/hw-ui/src/api/mes/mesRaiseCapitalBom.js b/hw-ui/src/api/mes/mesRaiseCapitalBom.js new file mode 100644 index 00000000..8300ad68 --- /dev/null +++ b/hw-ui/src/api/mes/mesRaiseCapitalBom.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询提资单BOM信息列表 +export function listMesRaiseCapitalBom(query) { + return request({ + url: '/mes/mesRaiseCapitalBom/list', + method: 'get', + params: query + }) +} + +// 查询提资单BOM信息详细 +export function getMesRaiseCapitalBom(raiseCapitalId) { + return request({ + url: '/mes/mesRaiseCapitalBom/' + raiseCapitalId, + method: 'get' + }) +} + +// 新增提资单BOM信息 +export function addMesRaiseCapitalBom(data) { + return request({ + url: '/mes/mesRaiseCapitalBom', + method: 'post', + data: data + }) +} + +// 修改提资单BOM信息 +export function updateMesRaiseCapitalBom(data) { + return request({ + url: '/mes/mesRaiseCapitalBom', + method: 'put', + data: data + }) +} + +// 删除提资单BOM信息 +export function delMesRaiseCapitalBom(raiseCapitalId) { + return request({ + url: '/mes/mesRaiseCapitalBom/' + raiseCapitalId, + method: 'delete' + }) +} diff --git a/hw-ui/src/api/mes/purchaseApplyProcess.js b/hw-ui/src/api/mes/purchaseApplyProcess.js new file mode 100644 index 00000000..9dbe6604 --- /dev/null +++ b/hw-ui/src/api/mes/purchaseApplyProcess.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 查询采购申请流程列表 +export function listPurchaseApplyProcess(query) { + return request({ + url: '/mes/purchaseApplyProcess/list', + method: 'get', + params: query + }) +} + +// 查询采购申请流程详细 +export function getPurchaseApplyProcess(purchaseApplyId) { + return request({ + url: '/mes/purchaseApplyProcess/' + purchaseApplyId, + method: 'get' + }) +} + +// 新增采购申请流程 +export function addPurchaseApplyProcess(data) { + return request({ + url: '/mes/purchaseApplyProcess', + method: 'post', + data: data + }) +} + +// 修改采购申请流程 +export function updatePurchaseApplyProcess(data) { + return request({ + url: '/mes/purchaseApplyProcess', + method: 'put', + data: data + }) +} + +// 删除采购申请流程 +export function delPurchaseApplyProcess(purchaseApplyId) { + return request({ + url: '/mes/purchaseApplyProcess/' + purchaseApplyId, + method: 'delete' + }) +} + +// 采购异常流转 +export function purchaseAbnormalFlowApi(data) { + return request({ + url: '/mes/purchaseApplyProcess/purchaseAbnormalFlow', + method: 'post', + data: data + }) +} + +// 技术处理 +export function technicalProcessingFlowApi(data) { + return request({ + url: '/mes/purchaseApplyProcess/technicalProcessing', + method: 'post', + data: data + }) +} diff --git a/hw-ui/src/router/index.js b/hw-ui/src/router/index.js index 7e790106..143923a7 100644 --- a/hw-ui/src/router/index.js +++ b/hw-ui/src/router/index.js @@ -647,6 +647,20 @@ export const dynamicRoutes = [ }, ], }, + { + path: '/mes/raise-capital-bom', + component: Layout, + hidden: true, + permissions: ['mes:mesRaiseCapitalBom:list'], + children: [ + { + path: 'index/:taskCode', + component: () => import('@/views/mes/mesRaiseCapitalBom/index'), + name: 'orderBind', + meta: { title: '提资单BOM', activeMenu: '/mes/mesRaiseCapitalBom' } + } + ] + }, ] diff --git a/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue b/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue new file mode 100644 index 00000000..0e79cb78 --- /dev/null +++ b/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue @@ -0,0 +1,529 @@ + + + diff --git a/hw-ui/src/views/mes/purchaseApplyProcess/index.vue b/hw-ui/src/views/mes/purchaseApplyProcess/index.vue new file mode 100644 index 00000000..65d7e99b --- /dev/null +++ b/hw-ui/src/views/mes/purchaseApplyProcess/index.vue @@ -0,0 +1,556 @@ + + +