From 831bad93f75836f0ae723c3ca26b64f8fa1f1f90 Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 18 Jun 2024 15:14:10 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=9C=80=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E8=B5=84=E7=B3=BB=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/api/controller/ERPPortController.java | 17 +- .../com/os/mes/api/domain/LatestSalary.java | 213 ++++++++++++++++++ .../os/mes/api/service/IERPPortService.java | 7 + .../api/service/impl/ERPPortServiceImpl.java | 30 +++ .../com/os/mes/base/domain/BaseStaffInfo.java | 4 +- .../impl/ProdOrderInfoServiceImpl.java | 2 +- .../main/java/com/os/quartz/task/ERPTask.java | 8 + 7 files changed, 277 insertions(+), 4 deletions(-) create mode 100644 os-mes/src/main/java/com/os/mes/api/domain/LatestSalary.java diff --git a/os-mes/src/main/java/com/os/mes/api/controller/ERPPortController.java b/os-mes/src/main/java/com/os/mes/api/controller/ERPPortController.java index 007aa20..6d595f8 100644 --- a/os-mes/src/main/java/com/os/mes/api/controller/ERPPortController.java +++ b/os-mes/src/main/java/com/os/mes/api/controller/ERPPortController.java @@ -19,10 +19,10 @@ import java.util.Map; @RestController @RequestMapping("/erp") public class ERPPortController extends BaseController { + @Autowired private IERPPortService portService; - /** * 获取ERP订单接口 * @@ -55,5 +55,20 @@ public class ERPPortController extends BaseController { return AjaxResult.success(portService.getERPEmployeeWageData(paramDto)); } + /** + * 获取【政策与条款】-最新工资系数 + * + * @param paramMap + * @return + */ + @PostMapping("/getERPLatestSalaryData") + public AjaxResult getERPLatestSalaryData(@RequestBody Map paramMap) { + ERPParamDto paramDto = new ERPParamDto(); + paramDto.setAppCode(String.valueOf(paramMap.get("AppCode"))); + paramDto.setController(String.valueOf(paramMap.get("Controller"))); + paramDto.setActionName(String.valueOf(paramMap.get("ActionName"))); + return AjaxResult.success(portService.getERPLatestSalaryData(paramDto)); + } + } diff --git a/os-mes/src/main/java/com/os/mes/api/domain/LatestSalary.java b/os-mes/src/main/java/com/os/mes/api/domain/LatestSalary.java new file mode 100644 index 0000000..b7b1e78 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/api/domain/LatestSalary.java @@ -0,0 +1,213 @@ +package com.os.mes.api.domain; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.math.BigDecimal; + +/** + * 获取【政策与条款】-最新工资系数 + */ +public class LatestSalary { + + /** + * 调整日期 + */ + @JsonProperty("AdjustDate") + private String AdjustDate; + + /** + * 包胶系数 + */ + @JsonProperty("EncapsulationCoefficient") + private BigDecimal EncapsulationCoefficient; + + /** + * 包胶系数(钢丝带) + */ + @JsonProperty("EncapsulationCoefficientGSD") + private BigDecimal EncapsulationCoefficientGSD; + + /** + * 成型每米薪酬 + */ + @JsonProperty("SalaryPerMeter") + private BigDecimal SalaryPerMeter; + + /** + * 出布系数 + */ + @JsonProperty("DistributionCoefficient") + private BigDecimal DistributionCoefficient; + + /** + * 成型系数 + */ + @JsonProperty("FormingCoefficient") + private BigDecimal FormingCoefficient; + + /** + * 硫化系数 + */ + @JsonProperty("VulcanizationCoefficient") + private BigDecimal VulcanizationCoefficient; + + /** + * 做头薪酬 + */ + @JsonProperty("HeadSalary") + private BigDecimal HeadSalary; + + /** + * 收尾薪酬 + */ + @JsonProperty("ClosingSalary") + private BigDecimal ClosingSalary; + + /** + * 接线每根钢丝绳薪酬 + */ + @JsonProperty("SalaryPerWireRope") + private BigDecimal SalaryPerWireRope; + + /** + * 钢丝绳基础工资系数 + */ + @JsonProperty("BasicSalaryCoefficient") + private BigDecimal BasicSalaryCoefficient; + + /** + * 挡边-每个隔板薪酬 + */ + @JsonProperty("DividerCompensation") + private BigDecimal DividerCompensation; + + /** + * 挡边-每米裙边薪酬 + */ + @JsonProperty("SkirtCompensation") + private BigDecimal SkirtCompensation; + + public String getAdjustDate() { + return AdjustDate; + } + + public void setAdjustDate(String adjustDate) { + AdjustDate = adjustDate; + } + + public BigDecimal getEncapsulationCoefficient() { + return EncapsulationCoefficient; + } + + public void setEncapsulationCoefficient(BigDecimal encapsulationCoefficient) { + EncapsulationCoefficient = encapsulationCoefficient; + } + + public BigDecimal getEncapsulationCoefficientGSD() { + return EncapsulationCoefficientGSD; + } + + public void setEncapsulationCoefficientGSD(BigDecimal encapsulationCoefficientGSD) { + EncapsulationCoefficientGSD = encapsulationCoefficientGSD; + } + + public BigDecimal getSalaryPerMeter() { + return SalaryPerMeter; + } + + public void setSalaryPerMeter(BigDecimal salaryPerMeter) { + SalaryPerMeter = salaryPerMeter; + } + + public BigDecimal getDistributionCoefficient() { + return DistributionCoefficient; + } + + public void setDistributionCoefficient(BigDecimal distributionCoefficient) { + DistributionCoefficient = distributionCoefficient; + } + + public BigDecimal getFormingCoefficient() { + return FormingCoefficient; + } + + public void setFormingCoefficient(BigDecimal formingCoefficient) { + FormingCoefficient = formingCoefficient; + } + + public BigDecimal getVulcanizationCoefficient() { + return VulcanizationCoefficient; + } + + public void setVulcanizationCoefficient(BigDecimal vulcanizationCoefficient) { + VulcanizationCoefficient = vulcanizationCoefficient; + } + + public BigDecimal getHeadSalary() { + return HeadSalary; + } + + public void setHeadSalary(BigDecimal headSalary) { + HeadSalary = headSalary; + } + + public BigDecimal getClosingSalary() { + return ClosingSalary; + } + + public void setClosingSalary(BigDecimal closingSalary) { + ClosingSalary = closingSalary; + } + + public BigDecimal getSalaryPerWireRope() { + return SalaryPerWireRope; + } + + public void setSalaryPerWireRope(BigDecimal salaryPerWireRope) { + SalaryPerWireRope = salaryPerWireRope; + } + + public BigDecimal getBasicSalaryCoefficient() { + return BasicSalaryCoefficient; + } + + public void setBasicSalaryCoefficient(BigDecimal basicSalaryCoefficient) { + BasicSalaryCoefficient = basicSalaryCoefficient; + } + + public BigDecimal getDividerCompensation() { + return DividerCompensation; + } + + public void setDividerCompensation(BigDecimal dividerCompensation) { + DividerCompensation = dividerCompensation; + } + + public BigDecimal getSkirtCompensation() { + return SkirtCompensation; + } + + public void setSkirtCompensation(BigDecimal skirtCompensation) { + SkirtCompensation = skirtCompensation; + } + + @Override + public String toString() { + return "LatestSalary{" + + "AdjustDate='" + AdjustDate + '\'' + + ", EncapsulationCoefficient=" + EncapsulationCoefficient + + ", EncapsulationCoefficientGSD=" + EncapsulationCoefficientGSD + + ", SalaryPerMeter=" + SalaryPerMeter + + ", DistributionCoefficient=" + DistributionCoefficient + + ", FormingCoefficient=" + FormingCoefficient + + ", VulcanizationCoefficient=" + VulcanizationCoefficient + + ", HeadSalary=" + HeadSalary + + ", ClosingSalary=" + ClosingSalary + + ", SalaryPerWireRope=" + SalaryPerWireRope + + ", BasicSalaryCoefficient=" + BasicSalaryCoefficient + + ", DividerCompensation=" + DividerCompensation + + ", SkirtCompensation=" + SkirtCompensation + + '}'; + } +} diff --git a/os-mes/src/main/java/com/os/mes/api/service/IERPPortService.java b/os-mes/src/main/java/com/os/mes/api/service/IERPPortService.java index 0e25fd3..861319f 100644 --- a/os-mes/src/main/java/com/os/mes/api/service/IERPPortService.java +++ b/os-mes/src/main/java/com/os/mes/api/service/IERPPortService.java @@ -2,6 +2,7 @@ package com.os.mes.api.service; import com.os.mes.api.domain.ERPParamDto; +import com.os.mes.api.domain.LatestSalary; import com.os.mes.base.domain.BaseStaffInfo; import com.os.mes.prod.domain.ProdOrderDetail; @@ -30,5 +31,11 @@ public interface IERPPortService { */ List getERPEmployeeWageData(ERPParamDto paramDto); + /** + * 最新工资系数 + * @param paramDto + * @return + */ + LatestSalary getERPLatestSalaryData(ERPParamDto paramDto); } diff --git a/os-mes/src/main/java/com/os/mes/api/service/impl/ERPPortServiceImpl.java b/os-mes/src/main/java/com/os/mes/api/service/impl/ERPPortServiceImpl.java index 6e3d2ad..ecfd391 100644 --- a/os-mes/src/main/java/com/os/mes/api/service/impl/ERPPortServiceImpl.java +++ b/os-mes/src/main/java/com/os/mes/api/service/impl/ERPPortServiceImpl.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategy; import com.os.mes.api.domain.ERPParamDto; +import com.os.mes.api.domain.LatestSalary; import com.os.mes.api.domain.RecordData; import com.os.mes.api.domain.ResponseData; import com.os.mes.api.service.IERPPortService; @@ -110,5 +111,34 @@ public class ERPPortServiceImpl implements IERPPortService { return resultList; } + /** + * 最新工资系数 + * @param paramDto + * @return + */ + @Override + public LatestSalary getERPLatestSalaryData(ERPParamDto paramDto) { + LatestSalary latestSalary = null; + String requestParam = null; + String result = null; + try { + // 创建ObjectMapper实例 对象转JSON字符串 + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE); + requestParam = objectMapper.writeValueAsString(paramDto); + result = ApiUtils.sendERPHttpPost(ERPConstants.ERP_URL, requestParam); + // 处理接口返回消息 + ObjectMapper resultMapper = new ObjectMapper(); + // 将 JSON 字符串转换为 Java 对象 + HashMap hashMap = resultMapper.readValue(result, HashMap.class); + HashMap returnData = (HashMap)hashMap.get("ReturnData"); + HashMap data = (HashMap)returnData.get("data"); + latestSalary = resultMapper.readValue(objectMapper.writeValueAsString(data), LatestSalary.class); + } catch (JsonProcessingException e) { + logger.warn("获取最新工资系数异常:" + requestParam + "|" + result + "|" + e); + } + return latestSalary; + } + } diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseStaffInfo.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseStaffInfo.java index c2105cb..1b009f8 100644 --- a/os-mes/src/main/java/com/os/mes/base/domain/BaseStaffInfo.java +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseStaffInfo.java @@ -70,9 +70,9 @@ public class BaseStaffInfo extends BaseEntity { private String sex; /** - * 卡密 + * 身份证 */ - @Excel(name = "卡密") + @Excel(name = "身份证") private String passWord; /** diff --git a/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java index d9c82e4..88241f5 100644 --- a/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java +++ b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdOrderInfoServiceImpl.java @@ -281,7 +281,7 @@ public class ProdOrderInfoServiceImpl implements IProdOrderInfoService { conveyorBeltsPlan.setOrderCode(prodOrder.getOrderCode()); conveyorBeltsPlan.setPlanCode(PlanCodeUtils.getPlanCode()); conveyorBeltsPlan.setPlanAmount(prodOrder.getOrderDetail().getBeltRequiredLength()); - conveyorBeltsPlan.setMaterialCode("1000099"); + //conveyorBeltsPlan.setMaterialCode("1000099"); String beltLengthSpecifications = prodOrder.getOrderDetail().getBeltLengthSpecifications(); if (beltLengthSpecifications != null && !beltLengthSpecifications.isEmpty()) { int spaceIndex = beltLengthSpecifications.indexOf(' '); diff --git a/os-quartz/src/main/java/com/os/quartz/task/ERPTask.java b/os-quartz/src/main/java/com/os/quartz/task/ERPTask.java index 9752c39..84cb100 100644 --- a/os-quartz/src/main/java/com/os/quartz/task/ERPTask.java +++ b/os-quartz/src/main/java/com/os/quartz/task/ERPTask.java @@ -41,6 +41,14 @@ public class ERPTask { portService.getERPEmployeeWageData(paramDto); } + public void ERPLatestSalaryTask() { + ERPParamDto paramDto = new ERPParamDto(); + paramDto.setAppCode(ERPConstants.salaryAppCode); + paramDto.setController(ERPConstants.salaryController); + paramDto.setActionName(ERPConstants.salaryActionName); + portService.getERPEmployeeWageData(paramDto); + } + /** * 输出days天type的日期 * type: 0-减法;1-加法