Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
潘荣晟
2025-11-19 11:05:43 +08:00
4 changed files with 28 additions and 8 deletions

View File

@@ -12,6 +12,7 @@ public interface ErrorCodeConstants {
// ========== 示例模块 1-001-000-000 ==========
ErrorCode MATERIAL_OTHER_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料不存在");
ErrorCode ELEMENT_NOT_EXISTS = new ErrorCode(1_001_000_001, "金属元素不存在");
ErrorCode ELEMENT_EXISTS = new ErrorCode(1_001_000_002, "金属元素已经存在");
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_001_000_001, "联系人不存在");
ErrorCode ACCOUNT_NOT_EXISTS = new ErrorCode(1_001_000_001, "账户条款不存在");
ErrorCode MATERIAL_DESTROY_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料回收率不存在");

View File

@@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_EXISTS;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_NOT_EXISTS;
/**
@@ -95,8 +96,8 @@ public class ElementServiceImpl implements ElementService {
private void validateElementCodeExists(String code) {
ElementDO elementDO = elementMapper.getElementName(code);
if (elementDO == null) {
throw exception(ELEMENT_NOT_EXISTS);
if (elementDO != null) {
throw exception(ELEMENT_EXISTS);
}
}

View File

@@ -26,9 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.error;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_SUBMIT_ERP_FAIL;
@Slf4j
@Tag(name = "管理后台 - 合同管理")
@@ -155,8 +153,10 @@ public class ContractController implements BusinessControllerMarker {
@Operation(summary = "提交ERP")
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
public CommonResult<JSONObject> submitErp(@RequestParam("id") Long id) {
JSONObject res = contractService.submitErp(id);
return res.getBool("success") ? success(res) : error(CONTRACT_SUBMIT_ERP_FAIL.getCode(), res.getStr("data"));
// JSONObject res = contractService.submitErp(id);
// return res.getBool("success") ? success(res) : error(CONTRACT_SUBMIT_ERP_FAIL.getCode(), res.getStr("data"));
// TODO ERP默认返回成功处理 SZHGYL-251
return success(new JSONObject().putOnce("success", true));
}
@GetMapping("/list/up-not-relation")

View File

@@ -1243,8 +1243,26 @@ public class ContractServiceImpl implements ContractService {
queryReqVO.getElementName()
);
// 分页返回
return new PageResult<FormulaRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
// 分页返回结果
PageResult<FormulaRespVO> results = new PageResult<FormulaRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
if (results.getTotal() > 0) {
results.getList().forEach(respVO -> {
// 基础系数配置
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper.selectList("FMU_ID", respVO.getId());
respVO.setCoefficients(BeanUtils.toBean(coefficientDOS, CoefficientRespVO.class));
// 品位等级价配置
List<ContractGradeDO> gradeDOS = contractGradeMapper.selectList("FMU_ID", respVO.getId());
respVO.setGrades(BeanUtils.toBean(gradeDOS, GradeRespVO.class));
// 调整价配置
List<ContractDeductDO> deductDOS = contractDeductMapper.selectList("FMU_ID", respVO.getId());
respVO.setDeducts(BeanUtils.toBean(deductDOS, DeductRespVO.class));
// 市场价配置
List<ContractPriceDO> priceDOS = contractPriceMapper.selectList("FMU_ID", respVO.getId());
respVO.setPrices(BeanUtils.toBean(priceDOS, PriceRespVO.class));
});
}
return results;
}
@Override