|
@@ -94,7 +94,8 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
@Service
|
|
@Service
|
|
public class SalesServiceImpl implements SalesService {
|
|
public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
- private static final Logger log = LoggerUtil.logger(LoggerUtil.LogFileNameEnum.SERVICES_LOG);;
|
|
|
|
|
|
+ private static final Logger log = LoggerUtil.logger(LoggerUtil.LogFileNameEnum.SERVICES_LOG);
|
|
|
|
+ ;
|
|
@Resource
|
|
@Resource
|
|
private CustomerUserService customerUserService;
|
|
private CustomerUserService customerUserService;
|
|
@Resource
|
|
@Resource
|
|
@@ -590,13 +591,13 @@ public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 校验销售合同参数
|
|
* 校验销售合同参数
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param salesContractDto
|
|
* @param salesContractDto
|
|
* @param transferFile
|
|
* @param transferFile
|
|
* @param salesContractExist
|
|
* @param salesContractExist
|
|
*/
|
|
*/
|
|
private void checkSalesContractParameter(SalesContractDto salesContractDto, MultipartFile transferFile,
|
|
private void checkSalesContractParameter(SalesContractDto salesContractDto, MultipartFile transferFile,
|
|
- SalesContract salesContractExist) {
|
|
|
|
|
|
+ SalesContract salesContractExist) {
|
|
if (!salesContractDto.getTemplateType()) {
|
|
if (!salesContractDto.getTemplateType()) {
|
|
if (salesContractDto.getContractNo() == null || salesContractDto.getSignDate() == null) {
|
|
if (salesContractDto.getContractNo() == null || salesContractDto.getSignDate() == null) {
|
|
throw new ValidatorException(HttpStatus.ERROR, "合同编号与签署日期不能为空!");
|
|
throw new ValidatorException(HttpStatus.ERROR, "合同编号与签署日期不能为空!");
|
|
@@ -628,7 +629,7 @@ public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
/***
|
|
/***
|
|
* 处理合同文件
|
|
* 处理合同文件
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param salesContractDto
|
|
* @param salesContractDto
|
|
* @param customerUser
|
|
* @param customerUser
|
|
* @param transferFile
|
|
* @param transferFile
|
|
@@ -636,7 +637,7 @@ public class SalesServiceImpl implements SalesService {
|
|
* @return 合同文件信息
|
|
* @return 合同文件信息
|
|
*/
|
|
*/
|
|
private ContractFile handleContractFile(SalesContractDto salesContractDto, CustomerUser customerUser,
|
|
private ContractFile handleContractFile(SalesContractDto salesContractDto, CustomerUser customerUser,
|
|
- MultipartFile transferFile, boolean isTemplate) {
|
|
|
|
|
|
+ MultipartFile transferFile, boolean isTemplate) {
|
|
try {
|
|
try {
|
|
ContractFile contractFile = new ContractFile();
|
|
ContractFile contractFile = new ContractFile();
|
|
contractFile.setSignFileType(FileTypeEnum.SALES_CONTRACT.getCode());
|
|
contractFile.setSignFileType(FileTypeEnum.SALES_CONTRACT.getCode());
|
|
@@ -682,7 +683,7 @@ public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 处理合同文件
|
|
* 处理合同文件
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param salesContract
|
|
* @param salesContract
|
|
* @param customerUser
|
|
* @param customerUser
|
|
* @param contractTerms
|
|
* @param contractTerms
|
|
@@ -690,7 +691,7 @@ public class SalesServiceImpl implements SalesService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private ContractFile handleInkassoContractFile(SalesContract salesContract, CustomerUser customerUser,
|
|
private ContractFile handleInkassoContractFile(SalesContract salesContract, CustomerUser customerUser,
|
|
- ContractTerms contractTerms, List<ContractTermsExtend> paymentInfos, List<ContractTermsExtend> titleInfos) {
|
|
|
|
|
|
+ ContractTerms contractTerms, List<ContractTermsExtend> paymentInfos, List<ContractTermsExtend> titleInfos) {
|
|
try {
|
|
try {
|
|
List<SalesCommodity> salesCommodities = salesCommodityService.lambdaQuery()
|
|
List<SalesCommodity> salesCommodities = salesCommodityService.lambdaQuery()
|
|
.eq(SalesCommodity::getSalesContractId, salesContract.getId()).eq(SalesCommodity::getDeleted, 0)
|
|
.eq(SalesCommodity::getSalesContractId, salesContract.getId()).eq(SalesCommodity::getDeleted, 0)
|
|
@@ -757,7 +758,7 @@ public class SalesServiceImpl implements SalesService {
|
|
contractTemplateDto.setAccountNumber(contractTerms.getAccountNumber());
|
|
contractTemplateDto.setAccountNumber(contractTerms.getAccountNumber());
|
|
contractTemplateDto.setSwiftCode(contractTerms.getSwiftCode());
|
|
contractTemplateDto.setSwiftCode(contractTerms.getSwiftCode());
|
|
contractTemplateDto.setOpeningBank(contractTerms.getOpeningBank());
|
|
contractTemplateDto.setOpeningBank(contractTerms.getOpeningBank());
|
|
- ImporterEntity importerEntity = IImporterEntityService.getByEntityNo(salesContract.getImporterCertNo());
|
|
|
|
|
|
+ ImporterEntity importerEntity = IImporterEntityService.getByCertNo(salesContract.getImporterCertNo());
|
|
if (importerEntity != null) {
|
|
if (importerEntity != null) {
|
|
contractTemplateDto.setBuyerContact(importerEntity.getContactName());
|
|
contractTemplateDto.setBuyerContact(importerEntity.getContactName());
|
|
contractTemplateDto.setBuyerAddress(importerEntity.getBusinessAddress());
|
|
contractTemplateDto.setBuyerAddress(importerEntity.getBusinessAddress());
|
|
@@ -807,7 +808,7 @@ public class SalesServiceImpl implements SalesService {
|
|
SalesContract salesContract = salesContractService.getByContractNo(
|
|
SalesContract salesContract = salesContractService.getByContractNo(
|
|
salesContractDto.getSalesContract().getContractNo(),
|
|
salesContractDto.getSalesContract().getContractNo(),
|
|
salesContractDto.getSalesContract().getCustomerUserId());
|
|
salesContractDto.getSalesContract().getCustomerUserId());
|
|
- if (salesContract != null) {
|
|
|
|
|
|
+ if (salesContract != null && !salesContract.getId().equals(salesContractDto.getSalesContract().getId())) {
|
|
throw new ValidatorException(HttpStatus.BAD_REQUEST, "请您检查合同编号,合同编号存在重复");
|
|
throw new ValidatorException(HttpStatus.BAD_REQUEST, "请您检查合同编号,合同编号存在重复");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -849,7 +850,7 @@ public class SalesServiceImpl implements SalesService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 校验合同条款
|
|
* 校验合同条款
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param contractTermsDto
|
|
* @param contractTermsDto
|
|
*/
|
|
*/
|
|
private void checkContractTerms(ContractTermsDto contractTermsDto) {
|
|
private void checkContractTerms(ContractTermsDto contractTermsDto) {
|