Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -114,8 +114,8 @@ zt:
|
|||||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||||
swagger:
|
swagger:
|
||||||
title: 管理后台
|
title: Base 模块
|
||||||
description: 提供管理员管理的所有功能
|
description: 提供基础管理模块的所有功能
|
||||||
version: ${zt.info.version}
|
version: ${zt.info.version}
|
||||||
tenant: # 多租户相关配置项
|
tenant: # 多租户相关配置项
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
6
pom.xml
6
pom.xml
@@ -211,6 +211,12 @@
|
|||||||
<config.namespace>liss</config.namespace>
|
<config.namespace>liss</config.namespace>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>qsj</id>
|
||||||
|
<properties>
|
||||||
|
<config.namespace>qsj</config.namespace>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-erp-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
|
|||||||
@@ -101,4 +101,12 @@ public class MaterialInfomationController {
|
|||||||
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getOneTest")
|
||||||
|
@Operation(summary = "测试获取生产版本")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
|
||||||
|
public CommonResult<String> getTest() {
|
||||||
|
String getOneTest = materialInfomationService.getOneTest();
|
||||||
|
return success(getOneTest);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,4 +61,5 @@ public interface MaterialInfomationService {
|
|||||||
*/
|
*/
|
||||||
PageResult<MaterialInfomationDO> getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO);
|
PageResult<MaterialInfomationDO> getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
String getOneTest();
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.base.service.base;
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageReqVO;
|
||||||
@@ -8,6 +9,8 @@ import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationRespVO
|
|||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSaveReqVO;
|
||||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
||||||
|
import com.zt.plat.module.erp.api.ErpExternalApi;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -29,6 +32,10 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
|||||||
@Resource
|
@Resource
|
||||||
private MaterialInfomationMapper materialInfomationMapper;
|
private MaterialInfomationMapper materialInfomationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpExternalApi erpExternalApi;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) {
|
public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@@ -86,4 +93,14 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
|||||||
return materialInfomationMapper.selectPage(pageReqVO);
|
return materialInfomationMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOneTest() {
|
||||||
|
ErpProductiveVersionReqDTO reqDTO = new ErpProductiveVersionReqDTO();
|
||||||
|
reqDTO.setFactoryNumber("5020");
|
||||||
|
reqDTO.setMaterialNumber("224814");
|
||||||
|
CommonResult<String> erpProductiveVersion = erpExternalApi.getErpProductiveVersionByFM(reqDTO);
|
||||||
|
return erpProductiveVersion.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -32,10 +32,10 @@ public class DeductRespDTO {
|
|||||||
private String rangeWay;
|
private String rangeWay;
|
||||||
|
|
||||||
@Schema(description = "上限")
|
@Schema(description = "上限")
|
||||||
private String up;
|
private BigDecimal up;
|
||||||
|
|
||||||
@Schema(description = "下限")
|
@Schema(description = "下限")
|
||||||
private String down;
|
private BigDecimal down;
|
||||||
|
|
||||||
@Schema(description = "类型(字典:STLM_COEF)")
|
@Schema(description = "类型(字典:STLM_COEF)")
|
||||||
private String type;
|
private String type;
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
@PostMapping("/submit/erp")
|
@PostMapping("/submit/erp")
|
||||||
@Operation(summary = "提交ERP")
|
@Operation(summary = "提交ERP")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
||||||
public CommonResult<List<String>> submitErp(@RequestBody List<Long> ids) {
|
public CommonResult<JSONObject> submitErp(@RequestParam("id") Long id) {
|
||||||
return success(contractService.submitErp(ids));
|
return success(contractService.submitErp(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list/up-not-relation")
|
@GetMapping("/list/up-not-relation")
|
||||||
|
|||||||
@@ -38,4 +38,7 @@ public class ContractPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
|
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
|
||||||
private BigDecimal basicAmount;
|
private BigDecimal basicAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同分类(字典:SPLY_BSN_TP)")
|
||||||
|
private String businessType;
|
||||||
}
|
}
|
||||||
@@ -31,10 +31,10 @@ public class DeductRespVO {
|
|||||||
private String rangeWay;
|
private String rangeWay;
|
||||||
|
|
||||||
@Schema(description = "上限")
|
@Schema(description = "上限")
|
||||||
private String up;
|
private BigDecimal up;
|
||||||
|
|
||||||
@Schema(description = "下限")
|
@Schema(description = "下限")
|
||||||
private String down;
|
private BigDecimal down;
|
||||||
|
|
||||||
@Schema(description = "类型(字典:STLM_COEF)")
|
@Schema(description = "类型(字典:STLM_COEF)")
|
||||||
private String type;
|
private String type;
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ public class DeductSaveReqVO {
|
|||||||
private String rangeWay;
|
private String rangeWay;
|
||||||
|
|
||||||
@Schema(description = "上限")
|
@Schema(description = "上限")
|
||||||
private String up;
|
private BigDecimal up;
|
||||||
|
|
||||||
@Schema(description = "下限")
|
@Schema(description = "下限")
|
||||||
private String down;
|
private BigDecimal down;
|
||||||
|
|
||||||
@Schema(description = "类型(字典:STLM_COEF)")
|
@Schema(description = "类型(字典:STLM_COEF)")
|
||||||
private String type;
|
private String type;
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同关联 Response VO")
|
||||||
|
@Data
|
||||||
|
public class RelationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "上游主键")
|
||||||
|
private Long upId;
|
||||||
|
|
||||||
|
@Schema(description = "下游主键")
|
||||||
|
private Long downId;
|
||||||
|
}
|
||||||
@@ -63,12 +63,12 @@ public class ContractDeductDO extends BusinessBaseDO {
|
|||||||
* 上限
|
* 上限
|
||||||
*/
|
*/
|
||||||
@TableField("UP")
|
@TableField("UP")
|
||||||
private String up;
|
private BigDecimal up;
|
||||||
/**
|
/**
|
||||||
* 下限
|
* 下限
|
||||||
*/
|
*/
|
||||||
@TableField("DOWN")
|
@TableField("DOWN")
|
||||||
private String down;
|
private BigDecimal down;
|
||||||
/**
|
/**
|
||||||
* 类型(字典:STLM_COEF)
|
* 类型(字典:STLM_COEF)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public interface ContractMainMapper extends BaseMapperX<ContractMainDO> {
|
|||||||
.likeIfPresent(ContractMainDO::getPurchaseCompanyName, reqVO.getPurchaseCompanyName())
|
.likeIfPresent(ContractMainDO::getPurchaseCompanyName, reqVO.getPurchaseCompanyName())
|
||||||
.eqIfPresent(ContractMainDO::getBasicAmount, reqVO.getBasicAmount())
|
.eqIfPresent(ContractMainDO::getBasicAmount, reqVO.getBasicAmount())
|
||||||
.eqIfPresent(ContractMainDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(ContractMainDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(ContractMainDO::getBusinessType, reqVO.getBusinessType())
|
||||||
.orderByDesc(ContractMainDO::getCreateTime));
|
.orderByDesc(ContractMainDO::getCreateTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,10 +102,10 @@ public interface ContractService {
|
|||||||
/**
|
/**
|
||||||
* 提交ERP
|
* 提交ERP
|
||||||
*
|
*
|
||||||
* @param ids 合同ID集合
|
* @param id 合同ID
|
||||||
* @return
|
* @return 提交结果
|
||||||
*/
|
*/
|
||||||
List<String> submitErp(List<Long> ids);
|
JSONObject submitErp(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除合同
|
* 删除合同
|
||||||
@@ -163,6 +163,14 @@ public interface ContractService {
|
|||||||
*/
|
*/
|
||||||
Boolean relation(RelationReqVo reqVo);
|
Boolean relation(RelationReqVo reqVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据合同ID获得关联合同
|
||||||
|
*
|
||||||
|
* @param id 合同ID
|
||||||
|
* @return 上下游合同ID
|
||||||
|
*/
|
||||||
|
RelationRespVO getRelation(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -171,7 +172,11 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
// 合同状态保存为草稿
|
// 合同状态保存为草稿
|
||||||
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_DRAFT.getCode());
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_DRAFT.getCode());
|
||||||
// 生成系统合同编号
|
// 生成系统合同编号
|
||||||
contractMainDO.setSystemContractNumber(generateSystemContractNumber(reqVO.getCategory()));
|
contractMainDO.setSystemContractNumber(generateSystemContractNumber(reqVO.getBusinessType()));
|
||||||
|
// 原币金额-变更后
|
||||||
|
if (contractMainDO.getChangeCooAmount() == null) contractMainDO.setChangeCooAmount(new BigDecimal(0));
|
||||||
|
// 本币金额-变更后
|
||||||
|
if (contractMainDO.getChangeBasicAmount() == null) contractMainDO.setChangeBasicAmount(new BigDecimal(0));
|
||||||
|
|
||||||
// 保存合同主信息
|
// 保存合同主信息
|
||||||
contractMainMapper.insert(contractMainDO);
|
contractMainMapper.insert(contractMainDO);
|
||||||
@@ -1312,62 +1317,65 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> submitErp(List<Long> ids) {
|
public JSONObject submitErp(Long id) {
|
||||||
|
|
||||||
List<String> results = new ArrayList<>();
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
// 遍历合同ID集合
|
// 查询合同信息
|
||||||
ids.forEach(id -> {
|
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
||||||
|
|
||||||
// 查询合同信息
|
// 合同数据不存在
|
||||||
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
if (contractMainDO != null) {
|
// 合同状态校验
|
||||||
|
if (!(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) {
|
||||||
|
|
||||||
// 合同状态校验
|
throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP,
|
||||||
if (!(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(contractMainDO.getStatus())
|
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
||||||
|| DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())
|
}
|
||||||
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) {
|
|
||||||
|
|
||||||
throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP,
|
// 生成ERP合同映射表
|
||||||
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
ErpContractSaveReqVO erpContractVO = getErpContract(contractMainDO);
|
||||||
}
|
|
||||||
|
|
||||||
// 生成ERP合同映射表
|
// 调用ERP模块
|
||||||
ErpContractSaveReqVO erpContractVO = getErpContract(contractMainDO);
|
JSONObject erpResult = sendToErp(erpContractVO);
|
||||||
|
log.info("合同提交ERP结果:{}", erpResult);
|
||||||
|
result.putOnce("success", erpResult.getBool("success"));
|
||||||
|
|
||||||
// 调用ERP模块
|
// 更新合同状态
|
||||||
JSONObject erpResult = sendToErp(erpContractVO);
|
if (erpResult.getBool("success")) {
|
||||||
log.info("合同提交ERP结果:{}", erpResult);
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode());
|
||||||
String result = id
|
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_FIND.getCode());
|
||||||
+"-"+erpResult.getBool("success")
|
contractMainMapper.updateById(contractMainDO);
|
||||||
+(erpResult.getBool("success") ? "" : "-" + erpResult.getStr("errMsg"));
|
|
||||||
results.add(result);
|
|
||||||
|
|
||||||
// 更新合同状态
|
result.putOnce("data", erpResult.getStr("data"));
|
||||||
if (erpResult.getBool("success")) {
|
} else {
|
||||||
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode());
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode());
|
||||||
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_FIND.getCode());
|
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_RLBK.getCode());
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainDO.setCause(erpResult.getStr("errMsg"));
|
||||||
} else {
|
contractMainMapper.updateById(contractMainDO);
|
||||||
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode());
|
|
||||||
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_RLBK.getCode());
|
|
||||||
// contractMainDO.setCause(erpResult.getStr("errMsg"));
|
|
||||||
contractMainMapper.updateById(contractMainDO);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
results.add(id+"-"+"false"+"-"+CONTRACT_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return results;
|
result.putOnce("data", erpResult.getStr("errMsg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject sendToErp(ErpContractSaveReqVO erpContractVO) {
|
private JSONObject sendToErp(ErpContractSaveReqVO erpContractVO) {
|
||||||
JSONObject erpResult = new JSONObject();
|
JSONObject erpResult = new JSONObject();
|
||||||
try {
|
try {
|
||||||
String result = erpContractService.submitErp(erpContractVO);
|
HashMap<String, String> result = erpContractService.submitErp(erpContractVO);
|
||||||
erpResult.putOnce("success", true);
|
if ("E".equals(result.get("flag"))) {
|
||||||
|
erpResult.putOnce("success", false);
|
||||||
|
erpResult.putOnce("errMsg", result.get("resStr")+":"+result.get("E_RESP"));
|
||||||
|
} else {
|
||||||
|
erpResult.putOnce("success", true);
|
||||||
|
erpResult.putOnce("data", result);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
erpResult.putOnce("success", false);
|
erpResult.putOnce("success", false);
|
||||||
erpResult.putOnce("errMsg", e.getMessage());
|
erpResult.putOnce("errMsg", e.getMessage());
|
||||||
@@ -1386,6 +1394,32 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return insert > 0;
|
return insert > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RelationRespVO getRelation(Long id) {
|
||||||
|
|
||||||
|
// 返回结果
|
||||||
|
RelationRespVO resp = new RelationRespVO();
|
||||||
|
|
||||||
|
// 获得上游合同关联
|
||||||
|
SystemRelativityDO upSystemRelativityDO = systemRelativityMapper
|
||||||
|
.selectOne(new LambdaQueryWrapperX<SystemRelativityDO>()
|
||||||
|
.eq(SystemRelativityDO::getDownId, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获得下游合同关联
|
||||||
|
SystemRelativityDO downSystemRelativityDO = systemRelativityMapper
|
||||||
|
.selectOne(new LambdaQueryWrapperX<SystemRelativityDO>()
|
||||||
|
.eq(SystemRelativityDO::getUpId, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 上游合同ID
|
||||||
|
if (upSystemRelativityDO != null) resp.setUpId(upSystemRelativityDO.getId());
|
||||||
|
// 下游合同ID
|
||||||
|
if (downSystemRelativityDO != null) resp.setDownId(downSystemRelativityDO.getId());
|
||||||
|
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<ByteArrayResource> download(List<Long> ids) {
|
public ResponseEntity<ByteArrayResource> download(List<Long> ids) {
|
||||||
try {
|
try {
|
||||||
@@ -1517,10 +1551,10 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 更新合同
|
// 更新合同
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainMapper.updateById(contractMainDO);
|
||||||
});
|
|
||||||
|
|
||||||
// 重新提交erp
|
// 重新提交erp
|
||||||
submitErp(ids);
|
submitErp(id);
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1548,10 +1582,10 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 更新合同
|
// 更新合同
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainMapper.updateById(contractMainDO);
|
||||||
});
|
|
||||||
|
|
||||||
// 重新提交erp
|
// 重新提交erp
|
||||||
submitErp(ids);
|
submitErp(id);
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<configuration>
|
||||||
|
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||||
|
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||||
|
<!-- 变量 cloud.info.base-package,基础业务包 -->
|
||||||
|
<springProperty scope="context" name="cloud.info.base-package" source="cloud.info.base-package"/>
|
||||||
|
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||||
|
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||||
|
|
||||||
|
<!-- 控制台 Appender -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 文件 Appender -->
|
||||||
|
<!-- 参考 Spring Boot 的 file-appender.xml 编写 -->
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
<!-- 日志文件名 -->
|
||||||
|
<file>${LOG_FILE}</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!-- 滚动后的日志文件名 -->
|
||||||
|
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern>
|
||||||
|
<!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
|
||||||
|
<cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
|
||||||
|
<!-- 日志文件,到达多少容量,进行滚动 -->
|
||||||
|
<maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize>
|
||||||
|
<!-- 日志文件的总大小,0 表示不限制 -->
|
||||||
|
<totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap>
|
||||||
|
<!-- 日志文件的保留天数 -->
|
||||||
|
<maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
<!-- 异步写入日志,提升性能 -->
|
||||||
|
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 -->
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 -->
|
||||||
|
<queueSize>256</queueSize>
|
||||||
|
<appender-ref ref="FILE"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- SkyWalking GRPC 日志收集,实现日志中心。注意:SkyWalking 8.4.0 版本开始支持 -->
|
||||||
|
<appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 本地环境 -->
|
||||||
|
<springProfile name="local">
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
<appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 -->
|
||||||
|
<appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 -->
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
<!-- 其它环境 -->
|
||||||
|
<springProfile name="dev,test,stage,prod,default">
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
<appender-ref ref="ASYNC"/>
|
||||||
|
<appender-ref ref="GRPC"/>
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
import com.zt.plat.module.erp.enums.ApiConstants;
|
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||||
@@ -28,4 +30,7 @@ public interface ErpExternalApi {
|
|||||||
@Operation(summary = "erp数据查询")
|
@Operation(summary = "erp数据查询")
|
||||||
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/queryProductiveVersion")
|
||||||
|
@Operation(summary = "生产版本数据查询")
|
||||||
|
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zt.plat.module.erp.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 - 查询 ERP DTO")
|
||||||
|
@Data
|
||||||
|
public class ErpProductiveVersionReqDTO {
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
@NotNull(message = "工厂编码不能为空")
|
||||||
|
private String factoryNumber;
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
@NotNull(message = "物料编码不能为空")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,22 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpProductiveVersionService;
|
||||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERP Api 实现类
|
* ERP Api 实现类
|
||||||
*
|
*
|
||||||
@@ -22,6 +29,8 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ErpConfig erpConfig;
|
private ErpConfig erpConfig;
|
||||||
|
@Resource
|
||||||
|
private ErpProductiveVersionService erpProductiveVersionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
||||||
@@ -34,4 +43,10 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
Map<String, Object> req = new HashMap<>();
|
Map<String, Object> req = new HashMap<>();
|
||||||
return erpConfig.fetchDataFromERP(funcnr, req);
|
return erpConfig.fetchDataFromERP(funcnr, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<String> getErpProductiveVersionByFM(ErpProductiveVersionReqDTO reqDTO) {
|
||||||
|
String productiveVersionNumber = erpProductiveVersionService.getErpProductiveVersionByFM(reqDTO);
|
||||||
|
return success(productiveVersionNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,4 +109,11 @@ public class ErpProductiveVersionController {
|
|||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/isEnable")
|
||||||
|
@Operation(summary = "启用ERP生产版本,相同工厂、物料,只能启用一个")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:update')")
|
||||||
|
public CommonResult<Boolean> enableErpProductiveVersion(@Valid @RequestBody ErpProductiveVersionSaveReqVO updateReqVO) {
|
||||||
|
erpProductiveVersionService.enableErpProductiveVersion(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -29,4 +29,6 @@ public class ErpProductiveVersionPageReqVO extends PageParam {
|
|||||||
@Schema(description = "组计数器", example = "15610")
|
@Schema(description = "组计数器", example = "15610")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
}
|
}
|
||||||
@@ -42,4 +42,7 @@ public class ErpProductiveVersionRespVO {
|
|||||||
@ExcelProperty("组计数器")
|
@ExcelProperty("组计数器")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@@ -38,4 +39,7 @@ public class ErpProductiveVersionSaveReqVO {
|
|||||||
@NotNull(message = "组计数器不能为空")
|
@NotNull(message = "组计数器不能为空")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -63,4 +63,7 @@ public class ErpProductiveVersionDO {
|
|||||||
@TableField("GRP_CNT")
|
@TableField("GRP_CNT")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@TableField("IS_ENB")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,11 @@ package com.zt.plat.module.erp.dal.mysql.erp;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
||||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
import com.zt.plat.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERP生产版本 Mapper
|
* ERP生产版本 Mapper
|
||||||
@@ -27,4 +29,13 @@ public interface ErpProductiveVersionMapper extends BaseMapperX<ErpProductiveVer
|
|||||||
.orderByDesc(ErpProductiveVersionDO::getId));
|
.orderByDesc(ErpProductiveVersionDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enableErpProductiveVersion(@Param("factoryNumber") String factoryNumber,@Param("materialNumber") String materialNumber);
|
||||||
|
|
||||||
|
default String getErpProductiveVersionByFM(ErpProductiveVersionReqDTO reqDTO){
|
||||||
|
return selectOne(new LambdaQueryWrapperX<ErpProductiveVersionDO>()
|
||||||
|
.eq(ErpProductiveVersionDO::getFactoryNumber, reqDTO.getFactoryNumber())
|
||||||
|
.eq(ErpProductiveVersionDO::getMaterialNumber, reqDTO.getMaterialNumber())
|
||||||
|
.eq(ErpProductiveVersionDO::getIsEnable, 1)
|
||||||
|
.last("LIMIT 1")).getProductiveVersionNumber();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractSaveReqVO;
|
|||||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpContractDO;
|
import com.zt.plat.module.erp.dal.dataobject.erp.ErpContractDO;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,5 +78,5 @@ public interface ErpContractService {
|
|||||||
* @param erpContractVO ERP合同映射数据
|
* @param erpContractVO ERP合同映射数据
|
||||||
* @return ERP合同映射
|
* @return ERP合同映射
|
||||||
*/
|
*/
|
||||||
String submitErp(ErpContractSaveReqVO erpContractVO);
|
HashMap<String, String> submitErp(ErpContractSaveReqVO erpContractVO);
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_CONTRACT_NOT_EXISTS;
|
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_CONTRACT_NOT_EXISTS;
|
||||||
import static dm.jdbc.util.DriverUtil.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERP合同映射 Service 实现类
|
* ERP合同映射 Service 实现类
|
||||||
@@ -227,7 +226,7 @@ public class ErpContractServiceImpl implements ErpContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String submitErp(ErpContractSaveReqVO erpContractVO) {
|
public HashMap<String, String> submitErp(ErpContractSaveReqVO erpContractVO) {
|
||||||
|
|
||||||
// 转换为DO
|
// 转换为DO
|
||||||
ErpContractDO erpContract = BeanUtils.toBean(erpContractVO, ErpContractDO.class);
|
ErpContractDO erpContract = BeanUtils.toBean(erpContractVO, ErpContractDO.class);
|
||||||
@@ -337,7 +336,7 @@ public class ErpContractServiceImpl implements ErpContractService {
|
|||||||
|
|
||||||
HashMap<String, String> response = erpExternalApi.submitDataToErp(erpSubmitReqDTO);
|
HashMap<String, String> response = erpExternalApi.submitDataToErp(erpSubmitReqDTO);
|
||||||
|
|
||||||
return response.get("resStr");
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -149,11 +149,12 @@ public class ErpProcessDetailServiceImpl implements ErpProcessDetailService {
|
|||||||
new LambdaQueryWrapperX<ErpProcessDetailDO>()
|
new LambdaQueryWrapperX<ErpProcessDetailDO>()
|
||||||
.in(ErpProcessDetailDO::getProcessId, result.toInsert.stream().map(ErpProcessDetailDO::getProcessId).distinct().collect(Collectors.toList()))
|
.in(ErpProcessDetailDO::getProcessId, result.toInsert.stream().map(ErpProcessDetailDO::getProcessId).distinct().collect(Collectors.toList()))
|
||||||
.in(ErpProcessDetailDO::getProcessingNumber, result.toInsert.stream().map(ErpProcessDetailDO::getProcessingNumber).distinct().collect(Collectors.toList()))
|
.in(ErpProcessDetailDO::getProcessingNumber, result.toInsert.stream().map(ErpProcessDetailDO::getProcessingNumber).distinct().collect(Collectors.toList()))
|
||||||
|
.in(ErpProcessDetailDO::getProcessingName, result.toInsert.stream().map(ErpProcessDetailDO::getProcessingName).distinct().collect(Collectors.toList()))
|
||||||
.in(ErpProcessDetailDO::getWorkCenterNumber, result.toInsert.stream().map(ErpProcessDetailDO::getWorkCenterNumber).distinct().collect(Collectors.toList()))
|
.in(ErpProcessDetailDO::getWorkCenterNumber, result.toInsert.stream().map(ErpProcessDetailDO::getWorkCenterNumber).distinct().collect(Collectors.toList()))
|
||||||
);
|
);
|
||||||
Map<String, Long> numberIdMap = insertedRecords.stream()
|
Map<String, Long> numberIdMap = insertedRecords.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
asset -> asset.getProcessId() + "-" + asset.getProcessingNumber() + "-" + asset.getWorkCenterNumber(),
|
asset -> asset.getProcessId() + "-" + asset.getProcessingNumber() + "-" + asset.getProcessingName() + "-" + asset.getWorkCenterNumber(),
|
||||||
ErpProcessDetailDO::getId, (existing, replacement) -> replacement));
|
ErpProcessDetailDO::getId, (existing, replacement) -> replacement));
|
||||||
myRedisConfig.addRedisCacheMap(result.key, numberIdMap);
|
myRedisConfig.addRedisCacheMap(result.key, numberIdMap);
|
||||||
}
|
}
|
||||||
@@ -188,7 +189,7 @@ public class ErpProcessDetailServiceImpl implements ErpProcessDetailService {
|
|||||||
List<ErpProcessDetailDO> assets = erpProcessDetailMapper.selectList(new LambdaQueryWrapperX<ErpProcessDetailDO>());
|
List<ErpProcessDetailDO> assets = erpProcessDetailMapper.selectList(new LambdaQueryWrapperX<ErpProcessDetailDO>());
|
||||||
Map<String, Long> existingNumbers = new HashMap<>();
|
Map<String, Long> existingNumbers = new HashMap<>();
|
||||||
for (ErpProcessDetailDO asset : assets) {
|
for (ErpProcessDetailDO asset : assets) {
|
||||||
String mapKey = asset.getProcessId() + "-" + asset.getProcessingNumber()+ "-" + asset.getWorkCenterNumber();
|
String mapKey = asset.getProcessId() + "-" + asset.getProcessingNumber()+ "-" + asset.getProcessingName()+ "-" + asset.getWorkCenterNumber();
|
||||||
existingNumbers.put(mapKey, asset.getId());
|
existingNumbers.put(mapKey, asset.getId());
|
||||||
}
|
}
|
||||||
myRedisConfig.addRedisCacheMap(key, existingNumbers);
|
myRedisConfig.addRedisCacheMap(key, existingNumbers);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.service.erp;
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionRespVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionRespVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionSaveReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProductiveVersionSaveReqVO;
|
||||||
@@ -62,4 +63,8 @@ public interface ErpProductiveVersionService {
|
|||||||
PageResult<ErpProductiveVersionDO> getErpProductiveVersionPage(ErpProductiveVersionPageReqVO pageReqVO);
|
PageResult<ErpProductiveVersionDO> getErpProductiveVersionPage(ErpProductiveVersionPageReqVO pageReqVO);
|
||||||
|
|
||||||
void callErpRfcInterface();
|
void callErpRfcInterface();
|
||||||
|
|
||||||
|
void enableErpProductiveVersion(ErpProductiveVersionSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
String getErpProductiveVersionByFM(ErpProductiveVersionReqDTO reqDTO);
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||||
import com.zt.plat.module.erp.utils.MyRedisConfig;
|
import com.zt.plat.module.erp.utils.MyRedisConfig;
|
||||||
import com.zt.plat.module.erp.enums.OftenEnum;
|
import com.zt.plat.module.erp.enums.OftenEnum;
|
||||||
@@ -104,6 +105,22 @@ public class ErpProductiveVersionServiceImpl implements ErpProductiveVersionServ
|
|||||||
return erpProductiveVersionMapper.selectPage(pageReqVO);
|
return erpProductiveVersionMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableErpProductiveVersion(ErpProductiveVersionSaveReqVO updateReqVO) {
|
||||||
|
|
||||||
|
validateErpProductiveVersionExists(updateReqVO.getId());
|
||||||
|
erpProductiveVersionMapper.enableErpProductiveVersion(updateReqVO.getFactoryNumber(), updateReqVO.getMaterialNumber());
|
||||||
|
// 更新
|
||||||
|
ErpProductiveVersionDO updateObj = BeanUtils.toBean(updateReqVO, ErpProductiveVersionDO.class);
|
||||||
|
erpProductiveVersionMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getErpProductiveVersionByFM(ErpProductiveVersionReqDTO reqDTO) {
|
||||||
|
return erpProductiveVersionMapper.getErpProductiveVersionByFM(reqDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@XxlJob("getErpProductiveVersionTask")
|
@XxlJob("getErpProductiveVersionTask")
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ public class ErpConfig {
|
|||||||
if (StrUtil.isBlank(E_MSG)) {
|
if (StrUtil.isBlank(E_MSG)) {
|
||||||
E_MSG = jsonResponse.getString("msg");
|
E_MSG = jsonResponse.getString("msg");
|
||||||
}
|
}
|
||||||
|
String E_RESP = data.getString("E_RESP");
|
||||||
|
resMap.put("E_RESP", E_RESP);
|
||||||
resMap.put("resStr", E_MSG);
|
resMap.put("resStr", E_MSG);
|
||||||
resMap.put("flag", flag);
|
resMap.put("flag", flag);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,4 +9,10 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<update id="enableErpProductiveVersion">
|
||||||
|
UPDATE sply_erp_pdtv_ver
|
||||||
|
SET IS_ENB = 1
|
||||||
|
WHERE FACT_NUM = #{factoryNumber}
|
||||||
|
AND MTRL_NUM = #{materialNumber}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user