Merge branch 'dev' into test

This commit is contained in:
chenbowen
2025-10-22 16:07:47 +08:00
9 changed files with 31 additions and 18 deletions

View File

@@ -114,8 +114,8 @@ zt:
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
swagger:
title: 管理后台
description: 提供管理员管理的所有功能
title: Base 模块
description: 提供基础管理模块的所有功能
version: ${zt.info.version}
tenant: # 多租户相关配置项
enable: true

View File

@@ -32,10 +32,10 @@ public class DeductRespDTO {
private String rangeWay;
@Schema(description = "上限")
private String up;
private BigDecimal up;
@Schema(description = "下限")
private String down;
private BigDecimal down;
@Schema(description = "类型(字典STLM_COEF)")
private String type;

View File

@@ -31,10 +31,10 @@ public class DeductRespVO {
private String rangeWay;
@Schema(description = "上限")
private String up;
private BigDecimal up;
@Schema(description = "下限")
private String down;
private BigDecimal down;
@Schema(description = "类型(字典STLM_COEF)")
private String type;

View File

@@ -31,10 +31,10 @@ public class DeductSaveReqVO {
private String rangeWay;
@Schema(description = "上限")
private String up;
private BigDecimal up;
@Schema(description = "下限")
private String down;
private BigDecimal down;
@Schema(description = "类型(字典STLM_COEF)")
private String type;

View File

@@ -63,12 +63,12 @@ public class ContractDeductDO extends BusinessBaseDO {
* 上限
*/
@TableField("UP")
private String up;
private BigDecimal up;
/**
* 下限
*/
@TableField("DOWN")
private String down;
private BigDecimal down;
/**
* 类型(字典STLM_COEF)
*/

View File

@@ -54,6 +54,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -171,7 +172,11 @@ public class ContractServiceImpl implements ContractService {
// 合同状态保存为草稿
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);
@@ -1352,7 +1357,7 @@ public class ContractServiceImpl implements ContractService {
} else {
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode());
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_RLBK.getCode());
// contractMainDO.setCause(erpResult.getStr("errMsg"));
contractMainDO.setCause(erpResult.getStr("errMsg"));
contractMainMapper.updateById(contractMainDO);
}
} else {
@@ -1366,8 +1371,14 @@ public class ContractServiceImpl implements ContractService {
private JSONObject sendToErp(ErpContractSaveReqVO erpContractVO) {
JSONObject erpResult = new JSONObject();
try {
String result = erpContractService.submitErp(erpContractVO);
erpResult.putOnce("success", true);
HashMap<String, String> result = erpContractService.submitErp(erpContractVO);
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) {
erpResult.putOnce("success", false);
erpResult.putOnce("errMsg", e.getMessage());

View File

@@ -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 jakarta.validation.Valid;
import java.util.HashMap;
import java.util.List;
/**
@@ -77,5 +78,5 @@ public interface ErpContractService {
* @param erpContractVO ERP合同映射数据
* @return ERP合同映射
*/
String submitErp(ErpContractSaveReqVO erpContractVO);
HashMap<String, String> submitErp(ErpContractSaveReqVO erpContractVO);
}

View File

@@ -30,7 +30,6 @@ import java.util.Map;
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 dm.jdbc.util.DriverUtil.log;
/**
* ERP合同映射 Service 实现类
@@ -227,7 +226,7 @@ public class ErpContractServiceImpl implements ErpContractService {
}
@Override
public String submitErp(ErpContractSaveReqVO erpContractVO) {
public HashMap<String, String> submitErp(ErpContractSaveReqVO erpContractVO) {
// 转换为DO
ErpContractDO erpContract = BeanUtils.toBean(erpContractVO, ErpContractDO.class);
@@ -337,7 +336,7 @@ public class ErpContractServiceImpl implements ErpContractService {
HashMap<String, String> response = erpExternalApi.submitDataToErp(erpSubmitReqDTO);
return response.get("resStr");
return response;
}
/**

View File

@@ -151,6 +151,8 @@ public class ErpConfig {
if (StrUtil.isBlank(E_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("flag", flag);
}