bms改造;

This commit is contained in:
王奎兴
2026-09-01 16:58:39 +08:00
parent 3349552e10
commit 2c60dc8f84
42 changed files with 1561 additions and 16 deletions
@@ -31,6 +31,7 @@ import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.UserServiceFeign;
import com.mhd.system.api.domain.BatchDetailFeignPO;
import com.mhd.system.api.domain.ContractManageFeignDTO;
import com.mhd.system.api.domain.ContractManageParametersFeign;
import com.mhd.system.api.domain.WarehouseFeignPO;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
@@ -39,6 +40,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@@ -243,6 +245,7 @@ public class SettlementCustomersApplicationService {
/**
* 修改结算对象
*/
@Transactional
public Boolean update(SettlementCustomersDO settlementCustomersDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
@@ -305,6 +308,7 @@ public class SettlementCustomersApplicationService {
contractManageDTO.setContractState(2);
contractManageDTO.setPaymentDate(new Date());
contractManageDTO.setBillDays(10);
contractManageDTO.setContractType(1);
AjaxResult ajaxResult = systemServiceFeign.feignSave(contractManageDTO);
if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) {
ContractManageFeignDTO contractManageFeignDTO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ContractManageFeignDTO.class);
@@ -312,6 +316,18 @@ public class SettlementCustomersApplicationService {
String originalContractNumber = contractManageFeignDTO.getOriginalContractNumber();
settlementCustomersParameters.setContractManageId(contractManageId);
settlementCustomersParameters.setContractNumber(originalContractNumber);
ContractManageParametersFeign contractManageParametersFeign = new ContractManageParametersFeign();
contractManageParametersFeign.setContractManageId(contractManageId);
contractManageParametersFeign.setContractName(contractManageFeignDTO.getContractName());
contractManageParametersFeign.setContractNumber(contractManageFeignDTO.getContractNumber());
contractManageParametersFeign.setParametersJson(settlementCustomersParametersDTO.getContent());
contractManageParametersFeign.setOrganizationId(settlementCustomersDO.getOrganizationId());
contractManageParametersFeign.setOrganizationName(settlementCustomersDO.getOrganizationName());
contractManageParametersFeign.setTopOrganizationId(settlementCustomersDO.getTopOrganizationId());
AjaxResult paramResult = systemServiceFeign.feignSaveContractParameters(contractManageParametersFeign);
if (paramResult == null || !"200".equals(String.valueOf(paramResult.get("code")))) {
throw new ServiceException("保存合同参数失败");
}
} else {
throw new ServiceException("创建临时合同失败");
}
@@ -5,6 +5,10 @@ import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers;
import com.mhd.bms.domain.settlementCustomers.repository.facade.ISettlementCustomersService;
import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO;
import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO;
import com.mhd.bms.domain.settlementCustomersNcConfig.entity.SettlementCustomersNcConfig;
import com.mhd.bms.domain.settlementCustomersNcConfig.repository.facade.ISettlementCustomersNcConfigService;
import com.mhd.bms.domain.settlementCustomersParameters.entity.SettlementCustomersParameters;
import com.mhd.bms.domain.settlementCustomersParameters.repository.facade.ISettlementCustomersParametersService;
import com.mhd.common.security.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +28,11 @@ public class SettlementCustomersDomainService {
@Autowired
private ISettlementCustomersService settlementCustomersService;
@Autowired
private ISettlementCustomersNcConfigService settlementCustomersNcConfigService;
@Autowired
private ISettlementCustomersParametersService settlementCustomersParametersService;
/**
* 分页查询结算对象列表
@@ -64,7 +73,17 @@ public class SettlementCustomersDomainService {
*/
public SettlementCustomersPO getInfo(Long settlementCustomersId)
{
return settlementCustomersService.getInfo(settlementCustomersId);
SettlementCustomersPO info = settlementCustomersService.getInfo(settlementCustomersId);
LambdaQueryWrapper<SettlementCustomersNcConfig> ncConfigWrapper = new LambdaQueryWrapper<>();
ncConfigWrapper.eq(SettlementCustomersNcConfig::getSettlementCustomersId, settlementCustomersId);
info.setSettlementCustomersNcConfigs(settlementCustomersNcConfigService.list(ncConfigWrapper));
LambdaQueryWrapper<SettlementCustomersParameters> parametersWrapper = new LambdaQueryWrapper<>();
parametersWrapper.eq(SettlementCustomersParameters::getSettlementCustomersId, settlementCustomersId);
info.setSettlementCustomersParameters(settlementCustomersParametersService.list(parametersWrapper));
return info;
}