Pārlūkot izejas kodu

Merge branch 'master' of http://192.168.0.200:3000/wanglang/trade-platform

wanglang 1 mēnesi atpakaļ
vecāks
revīzija
c20fe83d3a

+ 0 - 1
trade-client/src/main/java/com/trade/client/enterprise/companyrelated/controller/ImporterEntityController.java

@@ -74,7 +74,6 @@ public class ImporterEntityController {
      * 修改进口商信息
      */
     @RequestMapping("/update")
-    @ResponseStatus(HttpStatus.BAD_REQUEST)
     @Validated(OnUpdate.class)
     public ResponseResult<Void> update(@RequestBody @Valid ImporterEntity updateEntity) {
         importerEntityCService.update(updateEntity);

+ 6 - 0
trade-client/src/main/java/com/trade/client/enterprise/companyrelated/service/impl/ImporterEntityCServiceImp.java

@@ -6,6 +6,8 @@ import javax.annotation.Resource;
 
 import com.trade.client.enterprise.companyrelated.service.ImporterEntityCService;
 import com.trade.common.utils.ConstantUtil;
+import com.trade.common.utils.StringUtils;
+import com.trade.service.DictConstants;
 import com.trade.service.trade.salesorder.service.ISalesOrderService;
 import com.trade.service.serialNum.service.SerialNumberGenerator;
 import org.springframework.stereotype.Service;
@@ -55,6 +57,10 @@ public class ImporterEntityCServiceImp extends ServiceImpl<ImporterEntityMapper,
      * @param importEntity 进口商信息
      */
     private void preCheckAndSetParams(ImporterEntity importEntity) {
+        if (DictConstants.DISTRICT_FOREIGN.equals(importEntity.getRegion())
+                && StringUtils.isEmpty(importEntity.getCountry())) {
+            throw new ServiceException("境外进口商国家不能为空", HttpStatus.BAD_REQUEST);
+        }
         ImporterEntity exist = getBaseMapper().getByUserIdAndCertNo(importEntity.getCustomerUserId(),
                 importEntity.getCertNo());
         if (null == importEntity.getId()) {

+ 0 - 1
trade-service/src/main/java/com/trade/service/enterprise/companyrelated/domain/ImporterEntity.java

@@ -43,7 +43,6 @@ public class ImporterEntity extends BizBaseEntity {
     /**
      * 国家
      */
-    @NotBlank(message = "国家不能为空")
     private String country;
     /**
      * 状态 0待生效/1生效

+ 2 - 2
trade-service/src/main/java/com/trade/service/enterprise/companyrelated/service/impl/ImporterEntityServiceImpl.java

@@ -35,7 +35,7 @@ public class ImporterEntityServiceImpl extends ServiceImpl<ImporterEntityMapper,
     @Override
     public List<ImporterEntity> getListByUserId(Long userId) {
         QueryWrapper<ImporterEntity> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id", userId);
+        queryWrapper.eq("customer_user_id", userId);
         return this.list(queryWrapper);
     }
 
@@ -47,7 +47,7 @@ public class ImporterEntityServiceImpl extends ServiceImpl<ImporterEntityMapper,
     @Override
     public List<ImporterEntity> getEnabledListByUserId(Long userId) {
         QueryWrapper<ImporterEntity> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id", userId);
+        queryWrapper.eq("customer_user_id", userId);
         queryWrapper.eq("status", 1);
         return this.list(queryWrapper);
     }