wanglang пре 1 месец
родитељ
комит
a81347000b

+ 7 - 3
trade-client/src/main/java/com/trade/client/trade/salescontract/service/impl/SalesServiceImpl.java

@@ -814,9 +814,13 @@ public class SalesServiceImpl implements SalesService {
             }
             EnterpriseDto enterpriseDto = enterpriseService.queryMyEnterprise();
             String exportType = enterpriseDto.getExportType();
-            if (DictConstants.EXPORT_TYPE_PROXY.equals(exportType)
-                    && StringUtils.isBlank(salesContractDto.getSalesContract().getAgencyCertNo())) {
-                throw new ValidatorException(HttpStatus.BAD_REQUEST, "代理公司信息不能为空!");
+            if (DictConstants.EXPORT_TYPE_PROXY.equals(exportType)) {
+                if (StringUtils.isBlank(salesContractDto.getSalesContract().getAgencyCertNo())) {
+                    throw new ValidatorException(HttpStatus.BAD_REQUEST, "代理公司信息不能为空!");
+                }
+                if (salesContractDto.getSalesContract().getExchangeRate() == null) {
+                    throw new ValidatorException(HttpStatus.BAD_REQUEST, "代理出口模式下成交汇率不能为空!");
+                }
             }
             ValidatorUtil.validator(ValidatorGroup.ValidatorType.SUBMIT, salesContractDto.getSalesContract());
             if (CollectionUtil.isEmpty(salesContractDto.getSalesCommoditys())) {

+ 3 - 3
trade-service/src/main/java/com/trade/service/trade/salescontract/dto/SalesContractDto.java

@@ -101,8 +101,8 @@ public class SalesContractDto extends CommonEntity<SalesContractDto> {
     @ApiModelProperty(name = "exportType", value = "出口类型")
     private String exportType;
     @ApiModelProperty(name = "exchangeRate", value = "成交汇率")
-    @NotNull(message = "成交汇率不能为空", groups = {
-            ValidatorGroup.Submit.class
-    })
+//    @NotNull(message = "成交汇率不能为空", groups = {
+//            ValidatorGroup.Submit.class
+//    })
     private BigDecimal exchangeRate;
 }