diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseProduct.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java similarity index 99% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseProduct.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java index d32ddc72..9573c014 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseProduct.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBom.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBom.java similarity index 99% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapBom.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBom.java index e3a093ec..29138c42 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBom.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBom.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.fasterxml.jackson.annotation.JsonFormat; import com.op.common.core.annotation.Excel; @@ -12,6 +12,9 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; +/** + * BOM + */ public class SapBom extends BaseEntity { private static final long serialVersionUID = 1L; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBomComponent.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBomComponent.java similarity index 99% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapBomComponent.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBomComponent.java index 5fb8d2d4..f1ba8453 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBomComponent.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBomComponent.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.fasterxml.jackson.annotation.JsonFormat; import com.op.common.core.annotation.Excel; @@ -9,6 +9,9 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.math.BigDecimal; import java.util.Date; +/** + * BOM子表 + */ public class SapBomComponent extends BaseEntity { /** 主键 */ private Long id; diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCreateOrder.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCreateOrder.java index 02574da8..36c7ed9c 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCreateOrder.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCreateOrder.java @@ -1,18 +1,22 @@ package com.op.system.api.domain.sap; +/** + * 订单创建 + */ public class SapCreateOrder { - private String werks;//工厂编码 + private String werks; - private String aufpar;//订单类型 + private String aufpar; - private String matnr;//物料编号 + private String matnr; - private String quantity;//数量 + private String quantity; - private String dates;//开始时间 + private String dates; + + private String datee; - private String datee;//完成时间 public String getWerks() { return werks; diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java index 979a13cd..c9aef40b 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java @@ -1,6 +1,9 @@ package com.op.system.api.domain.sap; +/** + * 领料单 + */ public class SapMaterialPreparation { //订单号 private String AUFNR; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcess.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcess.java similarity index 77% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcess.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcess.java index dcc1dfd0..ac9d8d0b 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcess.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcess.java @@ -1,21 +1,14 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import java.util.List; - - /** - * 生产工序对象 pro_process - * - * @author yinjinlu - * @date 2022-05-12 + * 工序 */ -public class SapProProcess extends BaseEntity -{ +public class SapProProcess extends BaseEntity { private static final long serialVersionUID = 1L; /** 工序ID */ @@ -50,7 +43,7 @@ public class SapProProcess extends BaseEntity private Long attr4; private String fileList; - private List files; + //s:拆分 m合并 private String splitMerge; //拆分合并数量 @@ -64,13 +57,7 @@ public class SapProProcess extends BaseEntity //线体设备 private String equipment; - public List getFiles() { - return files; - } - public void setFiles(List files) { - this.files = files; - } public String getWorkCenter() { return workCenter; @@ -212,21 +199,22 @@ public class SapProProcess extends BaseEntity } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("processId", getProcessId()) - .append("processCode", getProcessCode()) - .append("processName", getProcessName()) - .append("attention", getAttention()) - .append("enableFlag", getEnableFlag()) - .append("remark", getRemark()) - .append("attr1", getAttr1()) - .append("attr2", getAttr2()) - .append("attr3", getAttr3()) - .append("attr4", getAttr4()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("processId", getProcessId()) + .append("processCode", getProcessCode()) + .append("processName", getProcessName()) + .append("attention", getAttention()) + .append("enableFlag", getEnableFlag()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } + } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcessContent.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcessContent.java similarity index 99% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcessContent.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcessContent.java index 26ef0621..c9146d60 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProProcessContent.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProProcessContent.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRoute.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRoute.java similarity index 93% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRoute.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRoute.java index 2a7dd6ae..13887edf 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRoute.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRoute.java @@ -1,9 +1,12 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; import java.util.List; +import java.util.Objects; /** @@ -64,10 +67,6 @@ public class SapProRoute extends BaseEntity private String tecConfAcivity5Unit; private String tecConfAcivity6; private String tecConfAcivity6Unit; - - private String fileList; - private List files; - private List idList; private String routeVersion; @@ -248,21 +247,7 @@ public class SapProRoute extends BaseEntity this.tecConfAcivity6Unit = tecConfAcivity6Unit; } - public String getFileList() { - return fileList; - } - - public void setFileList(String fileList) { - this.fileList = fileList; - } - - public List getFiles() { - return files; - } - public void setFiles(List files) { - this.files = files; - } public List getIdList() { return idList; @@ -305,8 +290,6 @@ public class SapProRoute extends BaseEntity ", tecConfAcivity5Unit='" + tecConfAcivity5Unit + '\'' + ", tecConfAcivity6='" + tecConfAcivity6 + '\'' + ", tecConfAcivity6Unit='" + tecConfAcivity6Unit + '\'' + - ", fileList='" + fileList + '\'' + - ", files=" + files + ", idList=" + idList + ", routeVersion='" + routeVersion + '\'' + '}'; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProcess.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProcess.java similarity index 99% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProcess.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProcess.java index 25882cb8..dfe49702 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProcess.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProcess.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProduct.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProduct.java similarity index 98% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProduct.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProduct.java index 52fee73a..f48efc37 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapProRouteProduct.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapProRouteProduct.java @@ -1,4 +1,4 @@ -package com.op.sap.domain; +package com.op.system.api.domain.sap; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java index fcb78fcc..2bc9f2e1 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java @@ -6,11 +6,9 @@ import com.op.common.core.domain.R; //import com.op.quality.domain.BaseFile; import com.op.quality.domain.BaseFile; import com.op.quality.domain.QcProCheck; -//import com.op.quality.mapper.BaseFileMapper; import com.op.quality.mapper.BaseFileMapper; import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.service.QcProCheckService; -import com.sap.conn.jco.JCoException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index 1df0d234..5ac5b038 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -1,17 +1,15 @@ package com.op.sap.controller; import com.op.common.core.domain.R; -import com.op.common.core.utils.DateUtils; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.sap.service.SapBomService; -import com.op.sap.domain.SapBom; import com.op.sap.service.SapMaterialPreparationService; import com.op.sap.service.SapOrderService; -import com.op.sap.service.SapService; +import com.op.sap.service.SapRouterService; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapMaterialPreparation; import com.op.system.api.domain.sap.SapRFW; @@ -25,8 +23,6 @@ import java.util.List; @RequestMapping("/sap") public class SapController extends BaseController { - @Autowired - private SapService sapService; @Autowired private SapOrderService sapOrderService; @@ -36,6 +32,8 @@ public class SapController extends BaseController { @Autowired private SapMaterialPreparationService sapMaterialPreparationService; + @Autowired + private SapRouterService sapRouterService; /** * 订单同步接口 @@ -62,7 +60,7 @@ public class SapController extends BaseController { */ @PostMapping("/bomSync") @Log(title = "同步SAP物料清单", businessType = BusinessType.SAP) - public AjaxResult saveBom(){ + public R bomSync(){ return sapBomService.bomSync(); } @@ -78,16 +76,18 @@ public class SapController extends BaseController { return sapMaterialPreparationService.MaterialPreparation(shopOrder); } - @PostMapping("/sapProRouteProcess") - public R sapProRouteProcess() { - return sapService.sapProRouteProcess(); - } + /** + * 生产订单创建接口 + * @param sapCreateOrderList + * @return + */ - @PostMapping("/SapCreateOrder") + @PostMapping("/sapCreateOrder") @Log(title = "生产订单创建接口", businessType = BusinessType.SAP) public R> SapCreateOrder(@RequestBody List sapCreateOrderList){ return sapOrderService.SapCreateOrder(sapCreateOrderList); } + /** * 生产订单关闭接口 * @param shopOrder @@ -105,4 +105,10 @@ public class SapController extends BaseController { return sapOrderService.sapRFWOrder(sapRFW); } + + @PostMapping("/sapRouterSync") + public R sapRouerSync() { + return sapRouterService.sapRouterSync(); + } + } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseFile.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseFile.java deleted file mode 100644 index 2994713f..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapBaseFile.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.op.sap.domain; - -import com.op.common.core.annotation.Excel; -import com.op.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 附件对象 base_file - * - * @author Open Platform - * @date 2023-07-10 - */ -public class SapBaseFile extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 附件ID */ - private String fileId; - - /** 附件名称 */ - @Excel(name = "附件名称") - private String fileName; - - /** 附件地址 */ - @Excel(name = "附件地址") - private String fileAddress; - - /** 数据来源 */ - @Excel(name = "数据来源") - private String sourceId; - - /** 预留字段1 */ - @Excel(name = "预留字段1") - private String attr1; - - /** 预留字段2 */ - @Excel(name = "预留字段2") - private String attr2; - - /** 预留字段3 */ - @Excel(name = "预留字段3") - private Long attr3; - - /** 预留字段4 */ - @Excel(name = "预留字段4") - private Long attr4; - - public void setFileId(String fileId) { - this.fileId = fileId; - } - - public String getFileId() { - return fileId; - } - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getFileName() { - return fileName; - } - public void setFileAddress(String fileAddress) { - this.fileAddress = fileAddress; - } - - public String getFileAddress() { - return fileAddress; - } - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public String getSourceId() { - return sourceId; - } - public void setAttr1(String attr1) { - this.attr1 = attr1; - } - - public String getAttr1() { - return attr1; - } - public void setAttr2(String attr2) { - this.attr2 = attr2; - } - - public String getAttr2() { - return attr2; - } - public void setAttr3(Long attr3) { - this.attr3 = attr3; - } - - public Long getAttr3() { - return attr3; - } - public void setAttr4(Long attr4) { - this.attr4 = attr4; - } - - public Long getAttr4() { - return attr4; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("fileId", getFileId()) - .append("fileName", getFileName()) - .append("fileAddress", getFileAddress()) - .append("sourceId", getSourceId()) - .append("remark", getRemark()) - .append("attr1", getAttr1()) - .append("attr2", getAttr2()) - .append("attr3", getAttr3()) - .append("attr4", getAttr4()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapMaterialPreparation.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapMaterialPreparation.java new file mode 100644 index 00000000..2981cdd7 --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapMaterialPreparation.java @@ -0,0 +1,125 @@ +package com.op.sap.domain; + + +public class SapMaterialPreparation { + //订单号 + private String AUFNR; + //预留/相关需求的项目编号 + private String RSPOS; + //物料号 + private String MATNR; + //物料描述(短文本) + private String MAKTX; + //工厂 + private String WERKS; + //库存地点 + private String LGORT; + //组件的需求日期 + private String BDTER; + //需求量 + private String BDMNG; + //欠料数量 + private String ZQLSL; + //基本计量单位 + private String MEINS; + //标识:反冲 + private String RGEKZ; + //直接采购标识 + private String DBSKZ; + + public String getAUFNR() { + return AUFNR; + } + + public void setAUFNR(String AUFNR) { + this.AUFNR = AUFNR; + } + + public String getRSPOS() { + return RSPOS; + } + + public void setRSPOS(String RSPOS) { + this.RSPOS = RSPOS; + } + + public String getMATNR() { + return MATNR; + } + + public void setMATNR(String MATNR) { + this.MATNR = MATNR; + } + + public String getMAKTX() { + return MAKTX; + } + + public void setMAKTX(String MAKTX) { + this.MAKTX = MAKTX; + } + + public String getWERKS() { + return WERKS; + } + + public void setWERKS(String WERKS) { + this.WERKS = WERKS; + } + + public String getLGORT() { + return LGORT; + } + + public void setLGORT(String LGORT) { + this.LGORT = LGORT; + } + + public String getBDTER() { + return BDTER; + } + + public void setBDTER(String BDTER) { + this.BDTER = BDTER; + } + + public String getBDMNG() { + return BDMNG; + } + + public void setBDMNG(String BDMNG) { + this.BDMNG = BDMNG; + } + + public String getZQLSL() { + return ZQLSL; + } + + public void setZQLSL(String ZQLSL) { + this.ZQLSL = ZQLSL; + } + + public String getMEINS() { + return MEINS; + } + + public void setMEINS(String MEINS) { + this.MEINS = MEINS; + } + + public String getRGEKZ() { + return RGEKZ; + } + + public void setRGEKZ(String RGEKZ) { + this.RGEKZ = RGEKZ; + } + + public String getDBSKZ() { + return DBSKZ; + } + + public void setDBSKZ(String DBSKZ) { + this.DBSKZ = DBSKZ; + } +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysDept.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysDept.java deleted file mode 100644 index d06a3dc7..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysDept.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.op.sap.domain; - -import com.op.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - * 部门表 sys_dept - * - * @author OP - */ -public class SapSysDept extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 部门ID */ - private Long deptId; - - /** 父部门ID */ - private Long parentId; - - /** 祖级列表 */ - private String ancestors; - - /** 部门名称 */ - private String deptName; - - /** 显示顺序 */ - private Integer orderNum; - - /** 负责人 */ - private String leader; - - /** 联系电话 */ - private String phone; - - /** 邮箱 */ - private String email; - - /** 部门状态:0正常,1停用 */ - private String status; - - /** 删除标志(0代表存在 2代表删除) */ - private String delFlag; - - /** 父部门名称 */ - private String parentName; - - /** 子部门 */ - private List children = new ArrayList(); - - public Long getDeptId() { - return deptId; - } - - public void setDeptId(Long deptId) { - this.deptId = deptId; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public String getAncestors() { - return ancestors; - } - - public void setAncestors(String ancestors) { - this.ancestors = ancestors; - } - - @NotBlank(message = "部门名称不能为空") - @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - @NotNull(message = "显示顺序不能为空") - public Integer getOrderNum() { - return orderNum; - } - - public void setOrderNum(Integer orderNum) { - this.orderNum = orderNum; - } - - public String getLeader() { - return leader; - } - - public void setLeader(String leader) { - this.leader = leader; - } - - @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - @Email(message = "邮箱格式不正确") - @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getParentName() { - return parentName; - } - - public void setParentName(String parentName) { - this.parentName = parentName; - } - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("deptId", getDeptId()) - .append("parentId", getParentId()).append("ancestors", getAncestors()).append("deptName", getDeptName()) - .append("orderNum", getOrderNum()).append("leader", getLeader()).append("phone", getPhone()) - .append("email", getEmail()).append("status", getStatus()).append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()).append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).toString(); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysRole.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysRole.java deleted file mode 100644 index a0985350..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysRole.java +++ /dev/null @@ -1,202 +0,0 @@ -package com.op.sap.domain; - -import com.op.common.core.annotation.Excel; -import com.op.common.core.annotation.Excel.ColumnType; -import com.op.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.Set; - -/** - * 角色表 sys_role - * - * @author OP - */ -public class SapSysRole extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 角色ID */ - @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) - private Long roleId; - - /** 角色名称 */ - @Excel(name = "角色名称") - private String roleName; - - /** 角色权限 */ - @Excel(name = "角色权限") - private String roleKey; - - /** 角色排序 */ - @Excel(name = "角色排序") - private Integer roleSort; - - /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ - @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") - private String dataScope; - - /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ - private boolean menuCheckStrictly; - - /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ - private boolean deptCheckStrictly; - - /** 角色状态(0正常 1停用) */ - @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") - private String status; - - /** 删除标志(0代表存在 2代表删除) */ - private String delFlag; - - /** 用户是否存在此角色标识 默认不存在 */ - private boolean flag = false; - - /** 菜单组 */ - private Long[] menuIds; - - /** 部门组(数据权限) */ - private Long[] deptIds; - - /** 角色菜单权限 */ - private Set permissions; - - public SapSysRole() { - - } - - public SapSysRole(Long roleId) { - this.roleId = roleId; - } - - public Long getRoleId() { - return roleId; - } - - public void setRoleId(Long roleId) { - this.roleId = roleId; - } - - public boolean isAdmin() { - return isAdmin(this.roleId); - } - - public static boolean isAdmin(Long roleId) { - return roleId != null && 1L == roleId; - } - - @NotBlank(message = "角色名称不能为空") - @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") - public String getRoleName() { - return roleName; - } - - public void setRoleName(String roleName) { - this.roleName = roleName; - } - - @NotBlank(message = "权限字符不能为空") - @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") - public String getRoleKey() { - return roleKey; - } - - public void setRoleKey(String roleKey) { - this.roleKey = roleKey; - } - - @NotNull(message = "显示顺序不能为空") - public Integer getRoleSort() { - return roleSort; - } - - public void setRoleSort(Integer roleSort) { - this.roleSort = roleSort; - } - - public String getDataScope() { - return dataScope; - } - - public void setDataScope(String dataScope) { - this.dataScope = dataScope; - } - - public boolean isMenuCheckStrictly() { - return menuCheckStrictly; - } - - public void setMenuCheckStrictly(boolean menuCheckStrictly) { - this.menuCheckStrictly = menuCheckStrictly; - } - - public boolean isDeptCheckStrictly() { - return deptCheckStrictly; - } - - public void setDeptCheckStrictly(boolean deptCheckStrictly) { - this.deptCheckStrictly = deptCheckStrictly; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public boolean isFlag() { - return flag; - } - - public void setFlag(boolean flag) { - this.flag = flag; - } - - public Long[] getMenuIds() { - return menuIds; - } - - public void setMenuIds(Long[] menuIds) { - this.menuIds = menuIds; - } - - public Long[] getDeptIds() { - return deptIds; - } - - public void setDeptIds(Long[] deptIds) { - this.deptIds = deptIds; - } - - public Set getPermissions() { - return permissions; - } - - public void setPermissions(Set permissions) { - this.permissions = permissions; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("roleId", getRoleId()) - .append("roleName", getRoleName()).append("roleKey", getRoleKey()).append("roleSort", getRoleSort()) - .append("dataScope", getDataScope()).append("menuCheckStrictly", isMenuCheckStrictly()) - .append("deptCheckStrictly", isDeptCheckStrictly()).append("status", getStatus()) - .append("delFlag", getDelFlag()).append("createBy", getCreateBy()).append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("remark", getRemark()) - .toString(); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysUser.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysUser.java deleted file mode 100644 index 52834b01..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/SapSysUser.java +++ /dev/null @@ -1,282 +0,0 @@ -package com.op.sap.domain; - -import com.op.common.core.annotation.Excel; -import com.op.common.core.annotation.Excel.ColumnType; -import com.op.common.core.annotation.Excel.Type; -import com.op.common.core.annotation.Excels; -import com.op.common.core.web.domain.BaseEntity; -import com.op.common.core.xss.Xss; -import com.op.system.api.domain.SysDept; -import com.op.system.api.domain.SysRole; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import java.util.Date; -import java.util.List; - -/** - * 用户对象 sys_user - * - * @author sf - */ -public class SapSysUser extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 用户ID */ - @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") - private Long userId; - - /** 部门ID */ - @Excel(name = "部门编号", type = Type.IMPORT) - private Long deptId; - - /** 用户账号 */ - @Excel(name = "登录名称") - private String userName; - - /** 用户昵称 */ - @Excel(name = "用户名称") - private String nickName; - - /** 用户邮箱 */ - @Excel(name = "用户邮箱") - private String email; - - /** 手机号码 */ - @Excel(name = "手机号码") - private String phonenumber; - - /** 用户性别 */ - @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") - private String sex; - - /** 用户头像 */ - private String avatar; - - /** 密码 */ - private String password; - - /** 帐号状态(0正常 1停用) */ - @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") - private String status; - - /** 删除标志(0代表存在 2代表删除) */ - private String delFlag; - - /** 最后登录IP */ - @Excel(name = "最后登录IP", type = Type.EXPORT) - private String loginIp; - - /** 最后登录时间 */ - @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) - private Date loginDate; - - /** 部门对象 */ - @Excels({ @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), - @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) }) - private SysDept dept; - - /** 角色对象 */ - private List roles; - - /** 角色组 */ - private Long[] roleIds; - - /** 岗位组 */ - private Long[] postIds; - - /** 角色ID */ - private Long roleId; - private String datasourceId; - - public String getDatasourceId() { - return datasourceId; - } - - public void setDatasourceId(String datasourceId) { - this.datasourceId = datasourceId; - } - - public SapSysUser() { - - } - - public SapSysUser(Long userId) { - this.userId = userId; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } - - public boolean isAdmin() { - return isAdmin(this.userId); - } - - public static boolean isAdmin(Long userId) { - return userId != null && 1L == userId; - } - - public Long getDeptId() { - return deptId; - } - - public void setDeptId(Long deptId) { - this.deptId = deptId; - } - - @Xss(message = "用户昵称不能包含脚本字符") - @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName = nickName; - } - - @Xss(message = "用户账号不能包含脚本字符") - @NotBlank(message = "用户账号不能为空") - @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - @Email(message = "邮箱格式不正确") - @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") - public String getPhonenumber() { - return phonenumber; - } - - public void setPhonenumber(String phonenumber) { - this.phonenumber = phonenumber; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getLoginIp() { - return loginIp; - } - - public void setLoginIp(String loginIp) { - this.loginIp = loginIp; - } - - public Date getLoginDate() { - return loginDate; - } - - public void setLoginDate(Date loginDate) { - this.loginDate = loginDate; - } - - public SysDept getDept() { - return dept; - } - - public void setDept(SysDept dept) { - this.dept = dept; - } - - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - public Long[] getRoleIds() { - return roleIds; - } - - public void setRoleIds(Long[] roleIds) { - this.roleIds = roleIds; - } - - public Long[] getPostIds() { - return postIds; - } - - public void setPostIds(Long[] postIds) { - this.postIds = postIds; - } - - public Long getRoleId() { - return roleId; - } - - public void setRoleId(Long roleId) { - this.roleId = roleId; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("userId", getUserId()) - .append("deptId", getDeptId()).append("userName", getUserName()).append("nickName", getNickName()) - .append("email", getEmail()).append("phonenumber", getPhonenumber()).append("sex", getSex()) - .append("avatar", getAvatar()).append("password", getPassword()).append("status", getStatus()) - .append("delFlag", getDelFlag()).append("loginIp", getLoginIp()).append("loginDate", getLoginDate()) - .append("createBy", getCreateBy()).append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("remark", getRemark()) - .append("dept", getDept()).toString(); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseFileMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseFileMapper.java deleted file mode 100644 index 782c828a..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseFileMapper.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.op.sap.mapper; - -import com.op.common.core.domain.BaseFileData; -import com.op.sap.domain.SapBaseFile; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 附件Mapper接口 - * - * @author Open Platform - * @date 2023-07-10 - */ -@Mapper -public interface SapBaseFileMapper { - /** - * 查询附件 - * - * @param fileId 附件主键 - * @return 附件 - */ - public SapBaseFile selectBaseFileByFileId(String fileId); - - /** - * 查询附件列表 - * - * @param baseFile 附件 - * @return 附件集合 - */ - public List selectBaseFileList(SapBaseFile baseFile); - - /** - * 新增附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int insertBaseFile(SapBaseFile baseFile); - - /** - * 修改附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int updateBaseFile(SapBaseFile baseFile); - - /** - * 删除附件 - * - * @param fileId 附件主键 - * @return 结果 - */ - public int deleteBaseFileByFileId(String fileId); - - /** - * 批量删除附件 - * - * @param fileIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteBaseFileByFileIds(String[] fileIds); - - Boolean insertBaseFileBatch(@Param("baseFiles") List baseFiles); - - List getBaseFileBatch(String processId); - - void deleteBaseFileBySourceId(String processId); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseProductMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseProductMapper.java index 277f4581..98b561b5 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseProductMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBaseProductMapper.java @@ -2,7 +2,8 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapBaseProduct; + +import com.op.system.api.domain.sap.SapBaseProduct; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -63,5 +64,5 @@ public interface SapBaseProductMapper { */ public int deleteBaseProductByProductIds(String[] productIds); - public String selectBaseProductIDByProductCode(String productCode); + public SapBaseProduct selectBaseProductByProductCode(SapBaseProduct sapBaseProduct); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomComponentMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomComponentMapper.java index c94f41ca..1ecaab21 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomComponentMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomComponentMapper.java @@ -1,10 +1,6 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapBom; -import com.op.sap.domain.SapBomComponent; - - -import java.util.List; +import com.op.system.api.domain.sap.SapBomComponent; /** * 物料BOM子表Mapper接口 diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomMapper.java index 2fef708c..725a9ee9 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapBomMapper.java @@ -1,7 +1,7 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapBom; -import com.op.sap.domain.SapBomComponent; +import com.op.system.api.domain.sap.SapBom; +import com.op.system.api.domain.sap.SapBomComponent; import org.apache.ibatis.annotations.Mapper; @Mapper diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessContentMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessContentMapper.java index 5abab809..aec3f9e9 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessContentMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessContentMapper.java @@ -1,6 +1,7 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapProProcessContent; + +import com.op.system.api.domain.sap.SapProProcessContent; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessMapper.java index 8a0f75e1..77b19182 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProProcessMapper.java @@ -1,6 +1,8 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapProProcess; + + +import com.op.system.api.domain.sap.SapProProcess; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -67,5 +69,5 @@ public interface SapProProcessMapper */ public int deleteProProcessByProcessIds(String[] processIds); - int selectProProcessByProcessName(String processName); + public SapProProcess selectProProcessByProcessName(SapProProcess sapProProcess); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteMapper.java index 4a8732bb..b28dca6e 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteMapper.java @@ -1,6 +1,8 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapProRoute; + + +import com.op.system.api.domain.sap.SapProRoute; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -78,6 +80,6 @@ public interface SapProRouteMapper { * @return */ List selectAllRoute(); - int selectProRouteByRouteCode(String routeCode); + SapProRoute selectProRouteByRouteCode(String routeCode); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProcessMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProcessMapper.java index 8cd1b4f3..52a23ba7 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProcessMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProcessMapper.java @@ -1,6 +1,7 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapProRouteProcess; + +import com.op.system.api.domain.sap.SapProRouteProcess; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProductMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProductMapper.java index 64ed89cb..b15e16a2 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProductMapper.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapProRouteProductMapper.java @@ -1,6 +1,8 @@ package com.op.sap.mapper; -import com.op.sap.domain.SapProRouteProduct; + + +import com.op.system.api.domain.sap.SapProRouteProduct; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysDeptMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysDeptMapper.java deleted file mode 100644 index 462cdd07..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysDeptMapper.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.op.sap.mapper; - -import com.op.system.api.domain.SysDept; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 部门管理 数据层 - * - * @author OP - */ -public interface SapSysDeptMapper { - /** - * 查询部门管理数据 - * - * @param dept 部门信息 - * @return 部门信息集合 - */ - public List selectDeptList(SysDept dept); - - /** - * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID - * @param deptCheckStrictly 部门树选择项是否关联显示 - * @return 选中部门列表 - */ - public List selectDeptListByRoleId(@Param("roleId") Long roleId, - @Param("deptCheckStrictly") boolean deptCheckStrictly); - - /** - * 根据部门ID查询信息 - * - * @param deptId 部门ID - * @return 部门信息 - */ - public SysDept selectDeptById(Long deptId); - - /** - * 根据ID查询所有子部门 - * - * @param deptId 部门ID - * @return 部门列表 - */ - public List selectChildrenDeptById(Long deptId); - - /** - * 根据ID查询所有子部门(正常状态) - * - * @param deptId 部门ID - * @return 子部门数 - */ - public int selectNormalChildrenDeptById(Long deptId); - - /** - * 是否存在子节点 - * - * @param deptId 部门ID - * @return 结果 - */ - public int hasChildByDeptId(Long deptId); - - /** - * 查询部门是否存在用户 - * - * @param deptId 部门ID - * @return 结果 - */ - public int checkDeptExistUser(Long deptId); - - /** - * 校验部门名称是否唯一 - * - * @param deptName 部门名称 - * @param parentId 父部门ID - * @return 结果 - */ - public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); - - /** - * 新增部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - public int insertDept(SysDept dept); - - /** - * 修改部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - public int updateDept(SysDept dept); - - /** - * 修改所在部门正常状态 - * - * @param deptIds 部门ID组 - */ - public void updateDeptStatusNormal(Long[] deptIds); - - /** - * 修改子元素关系 - * - * @param depts 子元素 - * @return 结果 - */ - public int updateDeptChildren(@Param("depts") List depts); - - /** - * 删除部门管理信息 - * - * @param deptId 部门ID - * @return 结果 - */ - public int deleteDeptById(Long deptId); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysUserMapper.java b/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysUserMapper.java deleted file mode 100644 index 46d19ca3..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/mapper/SapSysUserMapper.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.op.sap.mapper; - -import com.op.sap.domain.SapSysUser; -import com.op.system.api.domain.SysUser; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - * 用户表 数据层 - * - * @author OP - */ -public interface SapSysUserMapper { - /** - * 根据条件分页查询用户列表 - * - * @param sysUser 用户信息 - * @return 用户信息集合信息 - */ - public List selectUserList(SapSysUser sysUser); - - /** - * 根据条件分页查询已配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - public List selectAllocatedList(SapSysUser user); - - /** - * 根据条件分页查询未分配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - public List selectUnallocatedList(SapSysUser user); - - /** - * 通过用户名查询用户 - * - * @param userName 用户名 - * @return 用户对象信息 - */ - public SapSysUser selectUserByUserName(String userName); - - /** - * 通过用户ID查询用户 - * - * @param userId 用户ID - * @return 用户对象信息 - */ - public SapSysUser selectUserById(Long userId); - - /** - * 新增用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - public int insertUser(SapSysUser user); - - /** - * 修改用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - public int updateUser(SapSysUser user); - - /** - * 修改用户头像 - * - * @param userName 用户名 - * @param avatar 头像地址 - * @return 结果 - */ - public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); - - /** - * 重置用户密码 - * - * @param userName 用户名 - * @param password 密码 - * @return 结果 - */ - public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); - - /** - * 通过用户ID删除用户 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserById(Long userId); - - /** - * 批量删除用户信息 - * - * @param userIds 需要删除的用户ID - * @return 结果 - */ - public int deleteUserByIds(Long[] userIds); - - /** - * 校验用户名称是否唯一 - * - * @param userName 用户名称 - * @return 结果 - */ - public SapSysUser checkUserNameUnique(String userName); - - /** - * 校验手机号码是否唯一 - * - * @param phonenumber 手机号码 - * @return 结果 - */ - public SapSysUser checkPhoneUnique(String phonenumber); - - /** - * 校验email是否唯一 - * - * @param email 用户邮箱 - * @return 结果 - */ - public SapSysUser checkEmailUnique(String email); - - public List> getPoolNameList(SapSysUser user); - - public String getPoolName(String poolName); - Integer getNums(); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/ISapBaseProductService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/ISapBaseProductService.java index 12d7099f..7873d365 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/ISapBaseProductService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/ISapBaseProductService.java @@ -2,7 +2,9 @@ package com.op.sap.service; -import com.op.sap.domain.SapBaseProduct; +import com.op.common.core.domain.R; +import com.op.system.api.domain.sap.SapBaseProduct; + import java.util.List; @@ -63,7 +65,7 @@ public interface ISapBaseProductService { - public String selectBaseProductIDByProductCode(String productCode); + public SapBaseProduct selectBaseProductByProductCode(SapBaseProduct sapBaseProduct); diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapBaseFileService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapBaseFileService.java deleted file mode 100644 index 611cafbc..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapBaseFileService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.op.sap.service; - -import com.op.common.core.domain.BaseFileData; -import com.op.sap.domain.SapBaseFile; - -import java.util.List; - -/** - * 附件Service接口 - * - * @author Open Platform - * @date 2023-07-10 - */ -public interface SapBaseFileService { - /** - * 查询附件 - * - * @param fileId 附件主键 - * @return 附件 - */ - public SapBaseFile selectBaseFileByFileId(String fileId); - - /** - * 查询附件列表 - * - * @param baseFile 附件 - * @return 附件集合 - */ - public List selectBaseFileList(SapBaseFile baseFile); - - /** - * 新增附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int insertBaseFile(SapBaseFile baseFile); - - /** - * 修改附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int updateBaseFile(SapBaseFile baseFile); - - /** - * 批量删除附件 - * - * @param fileIds 需要删除的附件主键集合 - * @return 结果 - */ - public int deleteBaseFileByFileIds(String[] fileIds); - - /** - * 删除附件信息 - * - * @param fileId 附件主键 - * @return 结果 - */ - public int deleteBaseFileByFileId(String fileId); - - public Boolean insertBaseFileBatch(List baseFiles); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapBomService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapBomService.java index 294e8233..ff1c1cbe 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapBomService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapBomService.java @@ -1,10 +1,8 @@ package com.op.sap.service; +import com.op.common.core.domain.R; import com.op.common.core.web.domain.AjaxResult; -import com.op.sap.domain.SapBom; - -import java.util.List; public interface SapBomService { - public AjaxResult bomSync(); + public R bomSync(); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java index fadf4f79..bcb7437a 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java @@ -1,6 +1,7 @@ package com.op.sap.service; import com.op.common.core.domain.R; +import com.op.common.core.web.domain.AjaxResult; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.model.SapProOrder; @@ -10,7 +11,6 @@ import java.util.List; public interface SapOrderService { R> shopOrderSync(SapProOrder sapProOrder); - R> SapCreateOrder(List sapCreateOrderList); R sapCloseOrder(String shopOrder); diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteProductService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteProductService.java deleted file mode 100644 index 2e587d68..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteProductService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.op.sap.service; - -import com.op.sap.domain.SapProRouteProduct; - -import java.util.List; - -/** - * 工艺线体关联Service接口 - * - * @author Open Platform - * @date 2023-07-13 - */ -public interface SapProRouteProductService { - /** - * 查询工艺线体关联 - * - * @param recordId 工艺线体关联主键 - * @return 工艺线体关联 - */ - public SapProRouteProduct selectProRouteProductByRecordId(String recordId); - - /** - * 查询工艺线体关联列表 - * - * @param proRouteProduct 工艺线体关联 - * @return 工艺线体关联集合 - */ - public List selectProRouteProductList(SapProRouteProduct proRouteProduct); - - /** - * 新增工艺线体关联 - * - * @param proRouteProduct 工艺线体关联 - * @return 结果 - */ - public int insertProRouteProduct(SapProRouteProduct proRouteProduct); - - /** - * 修改工艺线体关联 - * - * @param proRouteProduct 工艺线体关联 - * @return 结果 - */ - public int updateProRouteProduct(SapProRouteProduct proRouteProduct); - - /** - * 批量删除工艺线体关联 - * - * @param recordIds 需要删除的工艺线体关联主键集合 - * @return 结果 - */ - public int deleteProRouteProductByRecordIds(String[] recordIds); - - /** - * 删除工艺线体关联信息 - * - * @param recordId 工艺线体关联主键 - * @return 结果 - */ - public int deleteProRouteProductByRecordId(String recordId); - - SapProRouteProduct getList(SapProRouteProduct proRouteProduct); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteService.java deleted file mode 100644 index 108b7c42..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapProRouteService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.op.sap.service; - -import com.op.sap.domain.SapProRoute; - -import java.util.List; - -/** - * 工艺路线Service接口 - * - * @author yinjinlu - * @date 2022-05-12 - */ -public interface SapProRouteService -{ - /** - * 查询工艺路线 - * - * @param routeId 工艺路线主键 - * @return 工艺路线 - */ - public SapProRoute selectProRouteByRouteId(String routeId); - - /** - * 查询工艺路线列表 - * - * @param proRoute 工艺路线 - * @return 工艺路线集合 - */ - public List selectProRouteList(SapProRoute proRoute); - - /** - * 根据物料查找生效的工艺路线 - * @param itemId - * @return - */ - public SapProRoute getRouteByProductId(String itemId); - - public Boolean checkRouteCodeUnique(SapProRoute proRoute); - - /** - * 新增工艺路线 - * - * @param proRoute 工艺路线 - * @return 结果 - */ - public int insertProRoute(SapProRoute proRoute); - - /** - * 修改工艺路线 - * - * @param proRoute 工艺路线 - * @return 结果 - */ - public int updateProRoute(SapProRoute proRoute); - - /** - * 批量删除工艺路线 - * - * @param routeIds 需要删除的工艺路线主键集合 - * @return 结果 - */ - public int deleteProRouteByRouteIds(String[] routeIds); - - /** - * 删除工艺路线信息 - * - * @param routeId 工艺路线主键 - * @return 结果 - */ - public int deleteProRouteByRouteId(String routeId); - - public int batchInsertProRoute(SapProRoute proRoute); - - //查询工艺路线是否存在 - int selectProRrouteByRouteCode(String routeCode); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapRouterService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapRouterService.java new file mode 100644 index 00000000..8b93819c --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapRouterService.java @@ -0,0 +1,9 @@ +package com.op.sap.service; + +import com.op.common.core.domain.R; +import com.op.common.core.web.domain.AjaxResult; + +public interface SapRouterService { + + R sapRouterSync(); +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapService.java deleted file mode 100644 index 78dc2160..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.op.sap.service; - -import com.op.common.core.domain.R; -import com.op.system.api.model.SapProOrder; - -import java.util.List; - -public interface SapService { - - - -// R sapItem(); - -// R sapBom(); -// -// R sapProRoute(); - -// R sapProRouteProduct(); - - R sapProRouteProcess(); -// -// -// -// List shopOrderSync(SapProOrder sapProOrder); -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseFileServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseFileServiceImpl.java deleted file mode 100644 index 16cc0a3b..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseFileServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.op.sap.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.op.common.core.domain.BaseFileData; -import com.op.common.core.utils.DateUtils; -import com.op.sap.domain.SapBaseFile; -import com.op.sap.mapper.SapBaseFileMapper; -import com.op.sap.service.SapBaseFileService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 附件Service业务层处理 - * - * @author Open Platform - * @date 2023-07-10 - */ -@Service -public class SapBaseFileServiceImpl implements SapBaseFileService { - @Autowired - private SapBaseFileMapper baseFileMapper; - - /** - * 查询附件 - * - * @param fileId 附件主键 - * @return 附件 - */ - @Override - @DS("#header.poolName") - public SapBaseFile selectBaseFileByFileId(String fileId) { - return baseFileMapper.selectBaseFileByFileId(fileId); - } - - /** - * 查询附件列表 - * - * @param baseFile 附件 - * @return 附件 - */ - @Override - @DS("#header.poolName") - public List selectBaseFileList(SapBaseFile baseFile) { - return baseFileMapper.selectBaseFileList(baseFile); - } - - /** - * 新增附件 - * - * @param baseFile 附件 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int insertBaseFile(SapBaseFile baseFile) { - baseFile.setCreateTime(DateUtils.getNowDate()); - return baseFileMapper.insertBaseFile(baseFile); - } - - /** - * 修改附件 - * - * @param baseFile 附件 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateBaseFile(SapBaseFile baseFile) { - baseFile.setUpdateTime(DateUtils.getNowDate()); - return baseFileMapper.updateBaseFile(baseFile); - } - - /** - * 批量删除附件 - * - * @param fileIds 需要删除的附件主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteBaseFileByFileIds(String[] fileIds) { - return baseFileMapper.deleteBaseFileByFileIds(fileIds); - } - - /** - * 删除附件信息 - * - * @param fileId 附件主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteBaseFileByFileId(String fileId) { - return baseFileMapper.deleteBaseFileByFileId(fileId); - } - - /** - * 新增附件 - * - * @param baseFiles 附件 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public Boolean insertBaseFileBatch(List baseFiles) { - return baseFileMapper.insertBaseFileBatch(baseFiles); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseProductServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseProductServiceImpl.java index 365cbf4a..bff4310f 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseProductServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBaseProductServiceImpl.java @@ -1,14 +1,22 @@ package com.op.sap.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.common.security.utils.SecurityUtils; -import com.op.sap.domain.SapBaseProduct; + import com.op.sap.mapper.SapBaseProductMapper; import com.op.sap.service.ISapBaseProductService; +import com.op.sap.util.SAPConnUtils; +import com.op.system.api.RemotePlanService; +import com.op.system.api.domain.sap.SapBaseProduct; +import com.sap.conn.jco.*; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -102,8 +110,8 @@ public class SapBaseProductServiceImpl implements ISapBaseProductService { } @Override - public String selectBaseProductIDByProductCode(String productCode) { - return baseProductMapper.selectBaseProductIDByProductCode(productCode); + public SapBaseProduct selectBaseProductByProductCode(SapBaseProduct sapBaseProduct) { + return baseProductMapper.selectBaseProductByProductCode(sapBaseProduct); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBomServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBomServiceImpl.java index f64255d6..6aca333e 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBomServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapBomServiceImpl.java @@ -2,24 +2,21 @@ package com.op.sap.service.impl; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.constant.Constants; +import com.op.common.core.domain.R; import com.op.common.core.exception.ServiceException; -import com.op.common.core.utils.DateUtils; import com.op.common.core.web.domain.AjaxResult; -import com.op.sap.domain.SapBom; -import com.op.sap.domain.SapBomComponent; -import com.op.sap.domain.SapConn; +import com.op.system.api.domain.sap.SapBom; +import com.op.system.api.domain.sap.SapBomComponent; import com.op.sap.mapper.SapBomComponentMapper; import com.op.sap.mapper.SapBomMapper; import com.op.sap.service.SapBomService; import com.op.sap.util.SAPConnUtils; -import com.op.system.api.model.SapProOrder; import com.sap.conn.jco.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.text.ParseException; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -36,7 +33,7 @@ public class SapBomServiceImpl implements SapBomService { private SapBomComponentMapper sapBomComponentMapper; @Override - public AjaxResult bomSync() { + public R bomSync() { try { // 获取调用 RFC 函数对象 @@ -54,11 +51,17 @@ public class SapBomServiceImpl implements SapBomService { // jCoTable.setValue(Constants.OPTION, "EQ"); // jCoTable.setValue(Constants.LOW, "00012222"); - JCoTable jCoTables = func.getTableParameterList().getTable("S_STLNR"); + JCoTable jCoTables = func.getTableParameterList().getTable("S_MATNR"); jCoTables.appendRow(); jCoTables.setValue(Constants.SIGN, "I"); jCoTables.setValue(Constants.OPTION, "EQ"); - jCoTables.setValue(Constants.LOW, "00012222"); + jCoTables.setValue(Constants.LOW, "000000010101000115"); + + JCoTable S_WERKS_jCoTables = func.getTableParameterList().getTable("S_WERKS"); + S_WERKS_jCoTables.appendRow(); + S_WERKS_jCoTables.setValue(Constants.SIGN, "I"); + S_WERKS_jCoTables.setValue(Constants.OPTION, "EQ"); + S_WERKS_jCoTables.setValue(Constants.LOW, "1000"); // 获取调用 RFC 函数对象 func.execute(dest); // 获取 内表 - ZMES_PRO @@ -112,7 +115,7 @@ public class SapBomServiceImpl implements SapBomService { + " - 生产版本有效期:" + ADATU + " - 生产版本截止日期:" + BDATU + " - BOM计算数量:" + LOSGR + " - BOM计算单位:" + MEINS + " - BOM基本数量:" + BMENG + " - BOM基本单位:" + BMEIN + " - BOM层次:" + STUFE + " - 项目编号:" + WEGXX - + " - 组件编码:" + PMATNR + " - 组件上层物料编码:" + OJTXB + " - 组件名称:" + PMAKTX + + " - 组件编码:" + PMATNR + " - 组件名称:" + PMAKTX + " - 组件上层物料名称:" + OJTXB + " - 标准用量:" + PMENGE + " - 损耗率:" + PAUSCH + " - 损耗额:" + PXHLCE + " - 含损耗用量:" + PMNGKO + " - 组件数量单位:" + PMEINS + " - 组件采购标志:" + PBESKZ + " - 物料供应标识:" + BEIKZ + " - 物料供应标识:" + BEIKZ_NM + " - 成本核算标识相关:" + SANKA); @@ -152,9 +155,9 @@ public class SapBomServiceImpl implements SapBomService { // sapBomComponentMapper.insertSapBomComponent(sapBomComponent); } // inserBaseBom(sapBomList); - return AjaxResult.success(); + return R.ok(); } catch (Exception e) { - throw new ServiceException(e.getMessage()); + return R.fail(e.getMessage()); } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java index e254f15d..ec9764c9 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java @@ -4,14 +4,18 @@ import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.core.web.domain.AjaxResult; import com.op.sap.service.SapOrderService; + import com.op.sap.util.SAPConnUtils; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.model.SapProOrder; import com.sap.conn.jco.*; + import org.springframework.stereotype.Service; + import java.util.ArrayList; import java.util.List; @@ -37,6 +41,8 @@ public class SapOrderServiceImpl implements SapOrderService { jCoTable.setValue("SIGN", "I"); jCoTable.setValue("OPTION", "EQ"); jCoTable.setValue("LOW", DateUtils.parseDateToStr("yyyyMMdd", sapProOrder.getCreateTime())); + + func.execute(dest);//执行调用函数 // 获取 内表 - ZMES_PRO JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO"); @@ -90,7 +96,7 @@ public class SapOrderServiceImpl implements SapOrderService { return R.ok(proOrderList); } catch (Exception e) { - return R.fail(e.getMessage()); + return null; } } @@ -157,15 +163,15 @@ public class SapOrderServiceImpl implements SapOrderService { if (StringUtils.isEmpty(shopOrder)){ return R.fail("订单号为空"); } - jCoParameterList.setValue("P_AUFNR",shopOrder); - func.execute(dest);//执行调用函数 - JCoParameterList J= func.getExportParameterList(); - System.out.println(J); - L_MSG= func.getExportParameterList().getString("L_MSG"); - if (StringUtils.isEmpty(L_MSG)){ - return R.fail("订单关闭失败"); - } - return R.ok(L_MSG); + jCoParameterList.setValue("P_AUFNR",shopOrder); + func.execute(dest);//执行调用函数 + JCoParameterList J= func.getExportParameterList(); + System.out.println(J); + L_MSG= func.getExportParameterList().getString("L_MSG"); + if (StringUtils.isEmpty(L_MSG)){ + return R.fail("订单关闭失败"); + } + return R.ok(L_MSG); }catch (Exception e){ return R.fail(e.getMessage()); @@ -228,7 +234,7 @@ public class SapOrderServiceImpl implements SapOrderService { System.out.println(J); MESSAGE= func.getExportParameterList().getString("MESSAGE"); if (StringUtils.isEmpty(MESSAGE)){ - return R.fail("订单关闭失败"); + return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"); } return R.ok(MESSAGE); diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteProductServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteProductServiceImpl.java deleted file mode 100644 index 2671f564..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteProductServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.op.sap.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.op.common.core.utils.DateUtils; -import com.op.common.core.utils.uuid.IdUtils; -import com.op.common.security.utils.SecurityUtils; -import com.op.sap.domain.SapProRouteProduct; -import com.op.sap.mapper.SapProRouteProductMapper; -import com.op.sap.service.SapProRouteProductService; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * 工艺线体关联Service业务层处理 - * - * @author Open Platform - * @date 2023-07-13 - */ -@Service -public class SapProRouteProductServiceImpl implements SapProRouteProductService { - @Autowired - private SapProRouteProductMapper proRouteProductMapper; - - /** - * 查询工艺线体关联 - * - * @param recordId 工艺线体关联主键 - * @return 工艺线体关联 - */ - @Override - @DS("#header.poolName") - public SapProRouteProduct selectProRouteProductByRecordId(String recordId) { - return proRouteProductMapper.selectProRouteProductByRecordId(recordId); - } - - /** - * 查询工艺线体关联列表 - * - * @param proRouteProduct 工艺线体关联 - * @return 工艺线体关联 - */ - @Override - @DS("#header.poolName") - public List selectProRouteProductList(SapProRouteProduct proRouteProduct) { - return proRouteProductMapper.selectProRouteProductList(proRouteProduct); - } - - /** - * 新增工艺线体关联 - * - * @param proRouteProduct 工艺线体关联 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int insertProRouteProduct(SapProRouteProduct proRouteProduct) { - Date now = DateUtils.getNowDate(); - if(StringUtils.isNotBlank(proRouteProduct.getRouteId())){ - //删除之前的关联关系 - proRouteProductMapper.deleteByRouteId(proRouteProduct); - } - if(proRouteProduct.getSelectedValues()!=null){ - SapProRouteProduct proRouteProductDto =null; - for(String ProductCode:proRouteProduct.getSelectedValues()){ - //查询物料编码对应的各种信息 - proRouteProductDto = new SapProRouteProduct(); - proRouteProductDto.setRecordId(IdUtils.fastSimpleUUID()); - proRouteProductDto.setCreateTime(now); - proRouteProductDto.setCreateBy(SecurityUtils.getUsername()); - proRouteProductDto.setRouteId(proRouteProduct.getRouteId()); - proRouteProductDto.setItemId(proRouteProduct.getItemId()); - proRouteProductDto.setItemCode(ProductCode); - proRouteProductDto.setItemName(proRouteProduct.getItemName()); - proRouteProductMapper.insertProRouteProduct(proRouteProductDto); - } - } - //新增关联关系 - return 1; - } - - /** - * 修改工艺线体关联 - * - * @param proRouteProduct 工艺线体关联 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateProRouteProduct(SapProRouteProduct proRouteProduct) { - proRouteProduct.setUpdateTime(DateUtils.getNowDate()); - return proRouteProductMapper.updateProRouteProduct(proRouteProduct); - } - - /** - * 批量删除工艺线体关联 - * - * @param recordIds 需要删除的工艺线体关联主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProRouteProductByRecordIds(String[] recordIds) { - return proRouteProductMapper.deleteProRouteProductByRecordIds(recordIds); - } - - /** - * 删除工艺线体关联信息 - * - * @param recordId 工艺线体关联主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProRouteProductByRecordId(String recordId) { - return proRouteProductMapper.deleteProRouteProductByRecordId(recordId); - } - - @Override - @DS("#header.poolName") - public SapProRouteProduct getList(SapProRouteProduct proRouteProduct) { - SapProRouteProduct dto = new SapProRouteProduct(); - List unSelected = proRouteProductMapper.getRouteProdProductListUndo(proRouteProduct); - dto.setUnSelect(unSelected); - List selected= proRouteProductMapper.getRouteProdProductListDo(proRouteProduct); - dto.setSelected(selected); - return dto; - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteServiceImpl.java deleted file mode 100644 index 514afb99..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapProRouteServiceImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.op.sap.service.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.op.common.core.constant.UserConstants; -import com.op.common.core.domain.BaseFileData; -import com.op.common.core.utils.DateUtils; -import com.op.common.core.utils.StringUtils; -import com.op.common.core.utils.uuid.IdUtils; -import com.op.common.security.utils.SecurityUtils; -import com.op.sap.domain.SapBaseFile; -import com.op.sap.domain.SapProRoute; -import com.op.sap.mapper.SapBaseFileMapper; -import com.op.sap.mapper.SapProRouteMapper; -import com.op.sap.service.SapProRouteService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - - -/** - * 工艺路线Service业务层处理 - * - * @author yinjinlu - * @date 2022-05-12 - */ -@Service -public class SapProRouteServiceImpl implements SapProRouteService { - @Autowired - private SapProRouteMapper proRouteMapper; - @Autowired - private SapBaseFileMapper baseFileMapper; - - /** - * 查询工艺路线 - * - * @param routeId 工艺路线主键 - * @return 工艺路线 - */ - @Override - @DS("#header.poolName") - public SapProRoute selectProRouteByRouteId(String routeId) { - - SapProRoute p = proRouteMapper.selectProRouteByRouteId(routeId); - List files = baseFileMapper.getBaseFileBatch(routeId); - if (!CollectionUtils.isEmpty(files)) { - p.setFiles(files); - } - return p; - } - - /** - * 查询工艺路线列表 - * - * @param proRoute 工艺路线 - * @return 工艺路线 - */ - @Override - @DS("#header.poolName") - public List selectProRouteList(SapProRoute proRoute) { - return proRouteMapper.selectProRouteList(proRoute); - } - - @Override - public SapProRoute getRouteByProductId(String itemId) { - return proRouteMapper.getRouteByProductId(itemId); - } - - - @Override - @DS("#header.poolName") - public Boolean checkRouteCodeUnique(SapProRoute proRoute) { - SapProRoute route = proRouteMapper.checkRouteCodeUnique(proRoute); - String routeId = proRoute.getRouteId(); - if (StringUtils.isNotNull(route) && !route.getRouteId().equals(routeId)) { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 新增工艺路线 - * - * @param proRoute 工艺路线 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int insertProRoute(SapProRoute proRoute) { - proRoute.setCreateTime(DateUtils.getNowDate()); - proRoute.setRouteVersion("V.1"); - //上传附件 - if (StringUtils.isNotEmpty(proRoute.getFileList())) { - String[] ids = proRoute.getFileList().split(","); - List files = new ArrayList<>(); - BaseFileData file = null; - for (String id : ids) { - file = new BaseFileData(); - file.setFileId(IdUtils.fastSimpleUUID()); - file.setFileName(id.split("&fileName=")[1]); - file.setFileAddress(id); - file.setSourceId(proRoute.getRouteId()); - file.setCreateBy(SecurityUtils.getUsername()); - file.setCreateTime(new Date()); - files.add(file); - } - baseFileMapper.insertBaseFileBatch(files); - } - - return proRouteMapper.insertProRoute(proRoute); - } - - /** - * 修改工艺路线 - * - * @param proRoute 工艺路线 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateProRoute(SapProRoute proRoute) { - proRoute.setUpdateTime(DateUtils.getNowDate()); - baseFileMapper.deleteBaseFileBySourceId(proRoute.getRouteId()); - //上传附件 - if (StringUtils.isNotEmpty(proRoute.getFileList())) { - - String[] ids = proRoute.getFileList().split(","); - List files = new ArrayList<>(); - BaseFileData file = null; - for (String id : ids) { - file = new BaseFileData(); - file.setFileId(IdUtils.fastSimpleUUID()); - file.setFileAddress(id); - file.setFileName(id.split("&fileName=")[1]); - file.setSourceId(proRoute.getRouteId()); - file.setCreateBy(SecurityUtils.getUsername()); - file.setCreateTime(new Date()); - files.add(file); - } - baseFileMapper.insertBaseFileBatch(files); - } - - //更新版本V.1->递增 - String nowRouteVersion = proRoute.getRouteVersion().replace("V", "") - .replace(".", ""); - int nowRouteVersionNum = Integer.parseInt(nowRouteVersion); - String newRouteVersionNum = "V." + (++nowRouteVersionNum); - proRoute.setRouteVersion(newRouteVersionNum); - return proRouteMapper.updateProRoute(proRoute); - } - - /** - * 批量删除工艺路线 - * - * @param routeIds 需要删除的工艺路线主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProRouteByRouteIds(String[] routeIds) { - return proRouteMapper.deleteProRouteByRouteIds(routeIds); - } - - /** - * 删除工艺路线信息 - * - * @param routeId 工艺路线主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteProRouteByRouteId(String routeId) { - return proRouteMapper.deleteProRouteByRouteId(routeId); - } - - @Override - @DS("#header.poolName") - public int batchInsertProRoute(SapProRoute proRoute) { - proRoute.setCreateTime(DateUtils.getNowDate()); - if (StringUtils.isNotEmpty(proRoute.getFileList())) { - List ids = proRoute.getIdList(); -// for (int j = ids.size(); j < 1; j--) { - for (String id :ids) { - String[] f = proRoute.getFileList().split(","); - List files = new ArrayList<>(); - BaseFileData file = null; - for (String file1 : f) { - file = new BaseFileData(); - file.setFileId(IdUtils.fastSimpleUUID()); - file.setFileName(file1.split("&fileName=")[1]); - file.setFileAddress(file1); - file.setSourceId(id); - file.setCreateBy(SecurityUtils.getUsername()); - file.setCreateTime(new Date()); - files.add(file); - } - baseFileMapper.insertBaseFileBatch(files); - } - } - return 1; - } - - @Override - public int selectProRrouteByRouteCode(String routeCode) { - return proRouteMapper.selectProRouteByRouteCode(routeCode); - } -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java new file mode 100644 index 00000000..4901bf8b --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java @@ -0,0 +1,261 @@ +package com.op.sap.service.impl; + +import com.alibaba.csp.sentinel.util.StringUtil; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.domain.R; +import com.op.common.core.exception.ServiceException; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.core.utils.uuid.UUID; +import com.op.common.core.web.domain.AjaxResult; +import com.op.sap.mapper.*; +import com.op.sap.service.SapRouterService; +import com.op.sap.util.SAPConnUtils; +import com.op.system.api.domain.sap.*; +import com.sap.conn.jco.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ServerErrorException; + +import java.rmi.ServerException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.TreeSet; +import java.util.stream.Collectors; + +@Service +public class SapRouterServiceImpl implements SapRouterService { + @Autowired + private SapProProcessMapper sapProProcessMapper; + @Autowired + private SapProProcessContentMapper sapProProcessContentMapper; + @Autowired + private SapProRouteMapper sapProRouteMapper; + @Autowired + private SapProRouteProductMapper sapProRouteProductMapper; + @Autowired + private SapProRouteProcessMapper sapProRouteProcessMapper; + @Autowired + private SapBaseProductMapper sapBaseProductMapper; + + @Override + public R sapRouterSync() { + try { + // 获取调用 RFC 函数对象 + //获取连接 + JCoDestination dest = SAPConnUtils.connect(); + JCoRepository repository = dest.getRepository(); + JCoFunction func = repository.getFunction("ZPPR_MES_ROUTING"); + if (func == null) { + throw new RuntimeException("Function does not exist in SAP"); + } + // 配置传入参数 + JCoTable jCoTable = func.getTableParameterList().getTable("S_WERKS"); + jCoTable.appendRow(); + jCoTable.setValue("SIGN", "I"); + jCoTable.setValue("OPTION", "EQ"); + jCoTable.setValue("LOW", "1000"); + func.execute(dest);//执行调用函数 + // 获取 内表 - ZMES_PRO + JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); + JCoRecordMetaData metaData = maraTable.getRecordMetaData(); + System.out.println("###" + metaData.toString()); + + DynamicDataSourceContextHolder.push("ds_1000"); + for (int i = 0; i new TreeSet<>(Comparator.comparing(SapProProcess::getProcessName))), ArrayList::new)); + + if (StringUtil.isBlank(PLNNR)) { + throw new ServiceException("任务清单组码不能为空"); + } + //查询有无工艺路线 + SapProRoute sapProRoute=sapProRouteMapper.selectProRouteByRouteCode(PLNNR); + //如果工艺路线存在,去查询工艺路线对应成品 + // Float revision = new Float(1.0); + if (sapProRoute==null){ + /** + * 校验 + */ + + sapProProcess.setProcessName(LTXA1); + SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess); + if (operation == null) { + throw new ServiceException("工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!"); + } + SapBaseProduct sapBaseProduct=new SapBaseProduct(); + sapBaseProduct.setProductCode(MATNR); + sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct); + if (sapBaseProduct==null){ + throw new ServiceException("工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!"); + } + + //添加工艺路线 + sapProRoute=new SapProRoute(); + String routerid = IdUtils.fastSimpleUUID(); + sapProRoute.setRouteId(routerid); + sapProRoute.setRouteCode(PLNNR); + sapProRoute.setRouteName(KTEXT); + sapProRoute.setRouteDesc(KTEXT); + sapProRoute.setEnableFlag("Y"); + sapProRoute.setCreateBy(ANNAM); + sapProRoute.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); + sapProRoute.setRouteVersion("1.0"); + sapProRouteMapper.insertProRoute(sapProRoute); + + + + + //增加工艺路线和工序的关系 + SapProRouteProcess sapProRouteProcess=new SapProRouteProcess(); + sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID()); + sapProRouteProcess.setRouteId(routerid); + sapProRouteProcess.setProcessId(operation.getProcessId()); + sapProRouteProcess.setProcessCode(operation.getProcessCode()); + sapProRouteProcess.setProcessName(operation.getProcessName()); + sapProRouteProcess.setOrderNum(1); + sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); + sapProRouteProcess.setCreateBy(ANNAM); + sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess); + + + //增加与产品的关系 + + SapProRouteProduct sapProRouteProduct=new SapProRouteProduct(); + sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID()); + sapProRouteProduct.setRouteId(routerid); + sapProRouteProduct.setItemId(sapBaseProduct.getProductId()); + sapProRouteProduct.setItemCode(MATNR); + sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh()); + sapProRouteProduct.setCreateBy(ANNAM); + sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); + sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct); + + } + else { + //工艺路线存在 + SapProRouteProduct sapProRouteProduct=new SapProRouteProduct(); + sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); + sapProRouteProduct.setItemCode(MATNR); + List sapProRouteProductList=sapProRouteProductMapper.selectProRouteProductList(sapProRouteProduct); + if (sapProRouteProductList==null){ + SapBaseProduct sapBaseProduct=new SapBaseProduct(); + sapBaseProduct.setProductCode(MATNR); + sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct); + if (sapBaseProduct==null){ + throw new ServiceException("工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!"); + } + sapProProcess.setProcessName(LTXA1); + SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess); + if (operation == null) { + throw new ServiceException("工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!"); + } + sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID()); + sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); + sapProRouteProduct.setItemId(sapBaseProduct.getProductId()); + sapProRouteProduct.setItemCode(MATNR); + sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh()); + sapProRouteProduct.setCreateBy(ANNAM); + sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); + + //增加工艺路线和工序的关系 + SapProRouteProcess sapProRouteProcess=new SapProRouteProcess(); + sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID()); + sapProRouteProcess.setRouteId(sapProRoute.getRouteId()); + sapProRouteProcess.setProcessId(operation.getProcessId()); + sapProRouteProcess.setProcessCode(operation.getProcessCode()); + sapProRouteProcess.setProcessName(operation.getProcessName()); + sapProRouteProcess.setOrderNum(1); + sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); + sapProRouteProcess.setCreateBy(ANNAM); + sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct); + sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess); + } + } + } + + }catch (Exception e){ + return R.fail(e.getMessage()); + } + return null; + } + + + +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapServiceImpl.java deleted file mode 100644 index dc456481..00000000 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapServiceImpl.java +++ /dev/null @@ -1,937 +0,0 @@ -package com.op.sap.service.impl; - -import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; -import com.op.common.core.constant.Constants; -import com.op.common.core.domain.R; -import com.op.common.core.utils.DateUtils; -import com.op.common.core.utils.uuid.IdUtils; -import com.op.common.core.utils.uuid.UUID; -import com.op.sap.domain.*; -import com.op.sap.mapper.*; -import com.op.sap.service.ISapBaseProductService; -import com.op.sap.service.SapService; -import com.op.sap.util.SAPConnUtils; -import com.op.system.api.model.SapProOrder; -import com.sap.conn.jco.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class SapServiceImpl implements SapService { - -// @Autowired -// private RemotePlanService remotePlanService; - - @Autowired - private ISapBaseProductService sapBaseProductService; - @Autowired - private SapSysDeptMapper sapSysDeptMapper; - @Autowired - private SapSysUserMapper sapSysUserMapper; - - @Autowired - private SapBaseProductMapper sapBaseProductMapper; - @Autowired - private SapProRouteMapper sapProRouteMapper; - @Autowired - private SapProRouteProductMapper sapProRouteProductMapper; - @Autowired - private SapProProcessMapper sapProProcessMapper; - @Autowired - private SapProProcessContentMapper sapProProcessContentMapper; - @Autowired - private SapProRouteProcessMapper sapProRouteProcessMapper; -// @Override -// public List shopOrderSync(SapProOrder sapProOrder) { -// -// -// // 连接 -// SapConn con = new SapConn( -// ashost, -// sysnr, -// client, -// user, -// passwd, -// lang, -// pool_capacity, -// peak_limit, -// saprouter -// ); -// JCoDestination jCoDestination = SAPConnUtils.connect(con); -// try { -// // 获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_PRO_TO"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -//// importParameterList.setValue("S_AUFNR",001002125255 ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -// SapProOrder proOrder = new SapProOrder(); -// List proOrderList = new ArrayList<>(); -// // 循环输出 Table 数据 -// for (int i = 0; i < maraTable.getNumRows(); i++) { -// maraTable.setRow(i); -// String AUFNR = maraTable.getString("AUFNR"); -// String AUART = maraTable.getString("AUART"); -// String MAUFNR = maraTable.getString("MAUFNR"); -// String PLNBEZ = maraTable.getString("PLNBEZ"); -// String MAKTX = maraTable.getString("MAKTX"); -// String PWERK = maraTable.getString("PWERK"); -// String GAMNG = maraTable.getString("GAMNG"); -// String GMEIN = maraTable.getString("GMEIN"); -// String PLNNR = maraTable.getString("PLNNR"); -// String GSTRP = maraTable.getString("GSTRP"); -// String GLTRP = maraTable.getString("GLTRP"); -// String ERNAM = maraTable.getString("ERNAM"); -// String ERDAT = maraTable.getString("ERDAT"); -// String STTXT = maraTable.getString("STTXT"); -// System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX -// + " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP -// + " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT); -// proOrder.setId(IdUtils.fastSimpleUUID()); -// proOrder.setPlanFactoryCode(PWERK); -// proOrder.setOrderCode(AUFNR); -// proOrder.setOrderType(AUART); -// proOrder.setProdCode(PLNBEZ); -// proOrder.setProdDesc(MAKTX); -// proOrder.setQuantity(Long.parseLong(GAMNG.substring(0, GAMNG.indexOf(".")))); -// proOrder.setUnit(GMEIN); -// proOrder.setWorkerOrder(PLNNR); -// proOrder.setPlanProDate(DateUtils.dateTime("yyyy-MM-dd", GSTRP)); -// proOrder.setPlanComplete(DateUtils.dateTime("yyyy-MM-dd", GLTRP)); -// proOrder.setParentOrder(MAUFNR); -// proOrder.setCreateBy(ERNAM); -// proOrder.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ERDAT)); -// proOrder.setUpdateBy(ERNAM); -// proOrder.setUpdateTime(DateUtils.dateTime("yyyy-MM-dd", ERDAT)); -// proOrder.setStatus("0"); -// proOrderList.add(proOrder); -// // remotePlanService.sapAddOrder(proOrder); -// // remoteMesService.sapAddOrder(proOrder); -// } -// return proOrderList; -// } catch (Exception e) { -// return null; -// } -// } -// -// -// @Override -// public R sapItem() { -// DynamicDataSourceContextHolder.push("lanju_op_xiaolan_ds"); -// // 连接 -// SapConn con = new SapConn( -// ashost, -// sysnr, -// client, -// user, -// passwd, -// lang, -// pool_capacity, -// peak_limit, -// saprouter -// ); -// JCoDestination jCoDestination = SAPConnUtils.connect(con); -// try { -//// // 获取调用 RFC 函数对象 -//// JCoFunction func = jCoDestination.getRepository().getFunction("ZMMR_MES_MAT_GET"); -//// // 配置传入参数 -//// JCoParameterList importParameterList = func.getImportParameterList(); -//// //importParameterList.setValue("S_AUFNR",001002125255 ); -//// // 调用并获取返回值 -//// func.execute(jCoDestination); -//// // 获取 内表 - ZMES_PRO -//// JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA"); -//// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -//// System.out.println("###"+metaData.toString()); -//// SapProOrder proOrder=new SapProOrder(); -//// List proOrderList=new ArrayList<>(); -//// // 循环输出 Table 数据 -//// for (int i = 0; i < maraTable.getNumRows(); i++) { -//// maraTable.setRow(i); -//// String AUFNR = maraTable.getString("AUFNR"); -//// String AUART = maraTable.getString("AUART"); -//// String MAUFNR = maraTable.getString("MAUFNR"); -//// String PLNBEZ = maraTable.getString("PLNBEZ"); -// //获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZMMR_MES_MAT_GET"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -// //importParameterList.setValue("S_AUFNR",001002125255 ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - LT_BOM -// JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -//// SapProOrder proOrder=new SapProOrder(); -// SapBaseProduct baseProduct = new SapBaseProduct(); -// String[] str = new String[maraTable.getNumRows()]; -// List baseProductList = new ArrayList<>(); -// // 循环输出 Table 数据 -// for (int i = 0; i < maraTable.getNumRows(); i++) { -// -// maraTable.setRow(i); -// String MATNR = maraTable.getString("MATNR"); -// String MAKTX = maraTable.getString("MAKTX"); -// String EAN11 = maraTable.getString("EAN11"); -// String MTART = maraTable.getString("MTART"); -// String MTBEZ = maraTable.getString("MTBEZ"); -// String MATKL = maraTable.getString("MATKL"); -// String WGBEZ = maraTable.getString("WGBEZ"); -// BigDecimal BRGEW = maraTable.getBigDecimal("BRGEW"); -// BigDecimal NTGEW = maraTable.getBigDecimal("NTGEW"); -// BigDecimal VOLUM = maraTable.getBigDecimal("VOLUM"); -// String VOLEH = maraTable.getString("VOLEH"); -// String MEINS = maraTable.getString("MEINS"); -// String MEINH = maraTable.getString("MEINH"); -// String UMREZ = maraTable.getString("UMREZ"); -// String UMREN = maraTable.getString("UMREN"); -// String LVORM = maraTable.getString("LVORM"); -// String MENGE = maraTable.getString("MENGE"); -// String MHDHB = maraTable.getString("MHDHB"); -// String SPART = maraTable.getString("SPART"); -// String SPART_NM = maraTable.getString("SPART_NM"); -// String MVGR1 = maraTable.getString("MVGR1"); -// String MVGR1_NM = maraTable.getString("MVGR1_NM"); -// String MVGR2 = maraTable.getString("MVGR2"); -// String MVGR2_NM = maraTable.getString("MVGR2_NM"); -// String MVGR3 = maraTable.getString("MVGR3"); -// String MVGR3_NM = maraTable.getString("MVGR3_NM"); -// String MVGR4 = maraTable.getString("MVGR4"); -// String MVGR4_NM = maraTable.getString("MVGR4_NM"); -// String MVGR5 = maraTable.getString("MVGR5"); -// String MVGR5_NM = maraTable.getString("MVGR5_NM"); -//// String SANKA = maraTable.getString("SANKA"); -//// System.out.println("MATNR" + MATNR + "MAKTX" + MAKTX); -// baseProduct.setProductCode(MATNR); -// baseProduct.setProductDescZh(MAKTX); -//// baseProduct.setProductean11(EAN11); -// baseProduct.setProductGroup(MATKL); -// baseProduct.setProductGroupName(WGBEZ); -// baseProduct.setGrossWeight(BRGEW); -// baseProduct.setNetWeight(NTGEW); -// baseProduct.setVolume(VOLUM); -// baseProduct.setDelFlag("0"); -// str[i] = baseProduct.getProductCode(); -// if (i!=0){ -// if (str[i].equals(str[i-1])) { -// System.out.println("chongfu"); -// -// }else { -// sapBaseProductMapper.insertBaseProduct(baseProduct); -// } -// } -// -// -//// baseProductList.add(i, baseProduct); -//// sapBaseProductMapper.insertBaseProduct(baseProduct); -// -// -// } -// } catch (Exception e) { -// return R.fail(e.getMessage()); -// } -// return R.ok(); -// } -// -// @Override -// public R sapBom() { -// // 连接 -// SapConn con = new SapConn( -// ashost, -// sysnr, -// client, -// user, -// passwd, -// lang, -// pool_capacity, -// peak_limit, -// saprouter -// ); -// JCoDestination jCoDestination = SAPConnUtils.connect(con); -// try { -// // 获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZMMR_MES_MAT_GET"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -// //importParameterList.setValue("S_AUFNR",001002125255 ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -// SapProOrder proOrder = new SapProOrder(); -// List proOrderList = new ArrayList<>(); -// // 循环输出 Table 数据 -// for (int i = 0; i < maraTable.getNumRows(); i++) { -// maraTable.setRow(i); -// String AUFNR = maraTable.getString("AUFNR"); -// String AUART = maraTable.getString("AUART"); -// String MAUFNR = maraTable.getString("MAUFNR"); -// String PLNBEZ = maraTable.getString("PLNBEZ"); -// System.out.println("工厂:" + AUFNR + " - 物料号:" + AUART + " - 物料组:" -// + MAUFNR + " - 生产版本:" + PLNBEZ); -// } -// -//// sapBaseProductService.insertBaseProduct(baseProduct); -// } -// catch( -// Exception e) -// -// { -// return R.fail(e.getMessage()); -// } -// return R.ok(); -//} -// -// @Override -// public R sapProRoute() { -// DynamicDataSourceContextHolder.push("lanju_op_xiaolan_ds"); -// // 连接 -// SapConn con = new SapConn( -// ashost, -// sysnr, -// client, -// user, -// passwd, -// lang, -// pool_capacity, -// peak_limit, -// saprouter -// ); -// JCoDestination jCoDestination = SAPConnUtils.connect(con); -// try { -// // 获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_ROUTING"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -//// System.out.println(importParameterList.getListMetaData()); -// // importParameterList.setValue("S_ERDAT","2019-11-07" ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// String[] str = new String[maraTable.getNumRows()]; -//// System.out.println("###" + metaData.toString()); -// -// List proRouteList = new ArrayList<>(); -// for (int i = 0; i new TreeSet<>(Comparator.comparing(SapProRoute::getRouteCode))), -// ArrayList::new)); -// for (int i = 0; i < proRouteList.size(); i++) { -// sapProRouteMapper.insertProRoute(proRouteList.get(i)); -// } -// -// -// } -// catch (Exception e){ -// return R.fail(e.getMessage()); -// } -// return R.ok(); -// } - -// @Override -// public R sapProRouteProduct() { -// DynamicDataSourceContextHolder.push("lanju_op_xiaolan_ds"); -// -// try { -// // 获取调用 RFC 函数对象 -// //获取连接 -// JCoDestination dest = SAPConnUtils.connect(); -// JCoRepository repository = dest.getRepository(); -// JCoFunction func = repository.getFunction("ZPPR_MES_ROUTING"); -// if (func == null) { -// throw new RuntimeException("Function does not exist in SAP"); -// } -// // 配置传入参数 -//// JCoTable jCoTable = func.getTableParameterList().getTable("S_STLNR"); -//// jCoTable.appendRow(); -//// jCoTable.setValue(Constants.SIGN, "I"); -//// jCoTable.setValue(Constants.OPTION, "EQ"); -//// jCoTable.setValue(Constants.LOW, "00012222"); -// -//// JCoTable jCoTables = func.getTableParameterList().getTable("LT_ROUTING"); -//// jCoTables.appendRow(); -//// jCoTables.setValue(Constants.SIGN, "I"); -//// jCoTables.setValue(Constants.OPTION, "EQ"); -//// jCoTables.setValue(Constants.LOW, "00012222"); -// // 获取调用 RFC 函数对象 -// func.execute(dest); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// // 获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_ROUTING"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -//// System.out.println(importParameterList.getListMetaData()); -// // importParameterList.setValue("S_ERDAT","2019-11-07" ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// String[] str = new String[maraTable.getNumRows()]; -//// System.out.println("###" + metaData.toString()); -// List proRouteList = new ArrayList<>(); -// List proRouteProductList = new ArrayList<>(); -// for (int i = 0; i new TreeSet<>(Comparator.comparing(SapProRoute::getRouteCode))), -// ArrayList::new)); -// for (int i = 0; i < proRouteList.size(); i++) { -// sapProRouteMapper.insertProRoute(proRouteList.get(i)); -// } -//// for (int i = 0; i sapProRouteProcess() { -// DynamicDataSourceContextHolder.push("lanju_op_xiaolan_ds"); -// DynamicDataSourceContextHolder.push("lanju_op_cloud"); - - try { - // 获取调用 RFC 函数对象 - //获取连接 - JCoDestination dest = SAPConnUtils.connect(); - JCoRepository repository = dest.getRepository(); - JCoFunction func = repository.getFunction("ZPPR_MES_ROUTING"); - if (func == null) { - throw new RuntimeException("Function does not exist in SAP"); - } - // 获取调用 RFC 函数对象 - func.execute(dest); - // 获取 内表 - ZMES_PRO - JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); - JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -// System.out.println("###" + metaData.toString()); - Map mapProRoute = new IdentityHashMap(); - Map mapProProcess = new IdentityHashMap(); - Map mapProRouteProcessNew = new IdentityHashMap(); - Map mapProRouteProcessOld = new IdentityHashMap(); - List proProcessList = new ArrayList<>(); - List proRouteProcessList = new ArrayList<>(); - List proProcessContentList = new ArrayList<>(); - List proRouteList = new ArrayList(); - Set set = new HashSet<>(); - for (int i = 0,arr1=0,arr2=0; i new TreeSet<>(Comparator.comparing(SapProProcessContent::getContentText))), -// ArrayList::new)); -// for (int j=0; jnew TreeSet<>(Comparator.comparing(SapProRouteProcess::getProcessCode))), -// ArrayList::new)); -// for (int k = 0;knew TreeSet<>(Comparator.comparing(SapProRouteProcess::getProcessCode))), -// ArrayList::new)); -// for (int k = 0;k list = Arrays.asList(set.toArray(new String[0])); -// Integer nums = sapSysUserMapper.getNums(); - for (int i=0;i{ - if (key.equals(s)){ - DynamicDataSourceContextHolder.push("ds_"+s); - if (value.getRouteName()!="无"){ - { -// System.out.println(s); -// System.out.println(sapProRouteMapper.selectProRouteByRouteCode(value.getRouteCode())); - if (sapProRouteMapper.selectProRouteByRouteCode(value.getRouteCode())==0){ - value.setRouteId(UUID.randomUUID().toString().replaceAll("-","")); - sapProRouteMapper.insertProRoute(value); -// arr1 = 1; - } - else{ -// System.out.println(value); - sapProRouteMapper.updateProRoute(value); -// arr1=0; - - } - }} - } - }); - mapProProcess.forEach((key, value) ->{ - if (key.equals(s)){ - DynamicDataSourceContextHolder.push("ds_"+s); - if (value.getProcessCode()!=null&&value.getProcessCode()!=""){ - if (sapProProcessMapper.selectProProcessByProcessName(value.getProcessName())==0){ - value.setProcessId(UUID.randomUUID().toString().replaceAll("-","")); -// System.out.println(value.getProcessCode()+"================================================"); - sapProProcessMapper.insertProProcess(value); - } - else{ -// System.out.println(value); - sapProProcessMapper.updateProProcess(value); - } - } - } - }); - mapProRouteProcessNew.forEach((key, value) ->{ - if (key.equals(s)){ - DynamicDataSourceContextHolder.push("ds_"+s); - if ((sapProRouteProcessMapper.selectProRouteProcessByProcessCode(value.getProcessCode()))==0){ -// System.out.println(value); - sapProRouteProcessMapper.insertProRouteProcess(value); - } - } - }); - mapProRouteProcessOld.forEach((key, value) ->{ - if (key.equals(s)){ - DynamicDataSourceContextHolder.push("ds_"+s); - if ((sapProRouteProcessMapper.selectProRouteProcessByProcessCode(value.getProcessCode()))!=0){ -// System.out.println(value); - sapProRouteProcessMapper.updateProRouteProcess(value); - }} - }); - } - - } - catch (Exception e){ - return R.fail(e.getMessage()); - } - return R.ok(); - } - - -// public static void main(String[] args) throws JCoException { -// // 连接 -// SapConn con = new SapConn( -// "192.168.0.53", -// "00", -// "800", -// "MES", -// "123456", -// "zh", -// "true", -// "20", -// "" -// ); -// JCoDestination jCoDestination = SAPConnUtils.connect(con); -// // 获取调用 RFC 函数对象 -// JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_PRO_TO"); -// // 配置传入参数 -// JCoParameterList importParameterList = func.getImportParameterList(); -// System.out.println(importParameterList.getListMetaData()); -// // importParameterList.setValue("S_ERDAT","2019-11-07" ); -// // 调用并获取返回值 -// func.execute(jCoDestination); -// // 获取 内表 - ZMES_PRO -// JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO"); -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); -// SapProOrder proOrder = new SapProOrder(); -// List proOrderList = new ArrayList<>(); -// for (int i = 0; i < maraTable.getNumRows(); i++) { -// maraTable.setRow(i); -// String AUFNR = maraTable.getString("AUFNR"); -// String AUART = maraTable.getString("AUART"); -// String MAUFNR = maraTable.getString("MAUFNR"); -// String PLNBEZ = maraTable.getString("PLNBEZ"); -// String MAKTX = maraTable.getString("MAKTX"); -// String PWERK = maraTable.getString("PWERK"); -// String GAMNG = maraTable.getString("GAMNG"); -// String GMEIN = maraTable.getString("GMEIN"); -// String PLNNR = maraTable.getString("PLNNR"); -// String GSTRP = maraTable.getString("GSTRP"); -// String GLTRP = maraTable.getString("GLTRP"); -// String ERNAM = maraTable.getString("ERNAM"); -// String ERDAT = maraTable.getString("ERDAT"); -// String STTXT = maraTable.getString("STTXT"); -// System.out.println("订单号:" +AUFNR+" - 订单类型:" + AUART+ " - 上级订单编号:" + MAUFNR+ " - 物料号:" + PLNBEZ+ " - 物料描述(短文本):" + MAKTX -// + " - 订单的计划工厂:" + PWERK+ " - 订单数量总计:" + GAMNG+ " - 基本计量单位:" + GMEIN+ " - 任务清单组码:" + PLNNR+ " - 基本开始日期:" + GSTRP -// + " - 基本完成日期:" + GLTRP+ " - 输入者:" + ERNAM+ " - 创建日期:" + ERDAT+ " - 系统状态:" + STTXT); -// } -// // 循环输出 Table 数据 -//// for (int i = 0; i < maraTable.getNumRows(); i++) { -//// maraTable.setRow(i); -//// String MATNR = maraTable.getString("MATNR"); -//// String MAKTX = maraTable.getString("MAKTX"); -//// String EAN11 = maraTable.getString("EAN11"); -//// String MTART = maraTable.getString("MTART"); -//// String MTBEZ = maraTable.getString("MTBEZ"); -//// String MATKL = maraTable.getString("MATKL"); -//// String WGBEZ = maraTable.getString("WGBEZ"); -//// String BRGEW = maraTable.getString("BRGEW"); -//// String NTGEW = maraTable.getString("NTGEW"); -//// String VOLUM = maraTable.getString("VOLUM"); -//// String VOLEH = maraTable.getString("VOLEH"); -//// String MEINS = maraTable.getString("MEINS"); -//// String MEINH = maraTable.getString("MEINH"); -//// String UMREZ = maraTable.getString("UMREZ"); -//// String UMREN = maraTable.getString("UMREN"); -//// String LVORM = maraTable.getString("LVORM"); -//// String MENGE = maraTable.getString("MENGE"); -//// String MHDHB = maraTable.getString("MHDHB"); -//// String SPART = maraTable.getString("SPART"); -//// String SPART_NM = maraTable.getString("SPART_NM"); -//// String MVGR1 = maraTable.getString("MVGR1"); -//// String MVGR1_NM = maraTable.getString("MVGR1_NM"); -//// String MVGR2 = maraTable.getString("MVGR2"); -//// String MVGR2_NM = maraTable.getString("MVGR2_NM"); -//// String MVGR3 = maraTable.getString("MVGR3"); -//// String MVGR3_NM = maraTable.getString("MVGR3_NM"); -//// String MVGR4 = maraTable.getString("MVGR4"); -//// String MVGR4_NM = maraTable.getString("MVGR4_NM"); -//// String MVGR5 = maraTable.getString("MVGR5"); -//// String MVGR5_NM = maraTable.getString("MVGR5_NM"); -//// System.out.println("物料号:" + MATNR + " - 物料描述:" + MAKTX + " - 国际文件号(EAN/UPC):" + EAN11 + " - 物料类型:" + MTART ); -//// } -// } - -} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java b/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java index c59a6d27..3f779b7c 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java @@ -44,7 +44,7 @@ public class SAPConnUtils { private static final String ABAP_AS_POOLED = "ABAP_AS_WITH_POOL"; static { Properties connectProperties = new Properties(); - connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "192.168.0.53"); + connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "192.168.0.54"); connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "00"); connectProperties.setProperty(DestinationDataProvider.JCO_USER, "MES"); connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "123456");