guoyujia 3 周之前
父節點
當前提交
773c410dac

+ 6 - 4
src/main/java/cn/ezhizao/project/business/controller/BizCompanyController.java

@@ -89,8 +89,8 @@ public class BizCompanyController extends BaseController
     public AjaxResult add(@RequestBody BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
     public AjaxResult add(@RequestBody BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
     {
     {
         //tenant_id,companyCode,company_alias不能为空
         //tenant_id,companyCode,company_alias不能为空
-        if(bizCompany.getTenantId() == null || bizCompany.getCompanyCode() == null || bizCompany.getCompanyCode() == "" || bizCompany.getCompanyAlias() == null || bizCompany.getCompanyAlias() ==""|| bizCompany.getCompanyName() == null || bizCompany.getCompanyName() ==""){
-            return error("新增客户失败,必填项:厂别,公司编码,公司名称,公司别名不能为空");
+        if(bizCompany.getJdId() == null ||bizCompany.getTenantId() == null || bizCompany.getCompanyCode() == null || bizCompany.getCompanyCode() == "" || bizCompany.getCompanyAlias() == null || bizCompany.getCompanyAlias() ==""|| bizCompany.getCompanyName() == null || bizCompany.getCompanyName() ==""){
+            return error("新增客户失败,必填项:金蝶id,厂别,公司编码,公司名称,公司别名不能为空");
         }
         }
         //判断厂别是否存在
         //判断厂别是否存在
         List<BizTenant> tenantList = bizTenantService.query().eq("id", bizCompany.getTenantId()).list();
         List<BizTenant> tenantList = bizTenantService.query().eq("id", bizCompany.getTenantId()).list();
@@ -102,7 +102,8 @@ public class BizCompanyController extends BaseController
         if(!companyList.isEmpty()){
         if(!companyList.isEmpty()){
             return error("新增客户失败,相同厂别不能有重复的公司编码");
             return error("新增客户失败,相同厂别不能有重复的公司编码");
         }
         }
-        return toAjax(bizCompanyService.save(bizCompany));
+        bizCompanyService.save(bizCompany);
+        return success(bizCompany.getId());
     }
     }
 
 
     /**
     /**
@@ -149,7 +150,8 @@ public class BizCompanyController extends BaseController
                 return error("修改客户失败,相同厂别不能有重复的公司编码");
                 return error("修改客户失败,相同厂别不能有重复的公司编码");
             }
             }
         }
         }
-        return toAjax(bizCompanyService.updateById(bizCompany));
+        bizCompanyService.updateById(bizCompany);
+        return success(bizCompany.getId());
     }
     }
 
 
     /**
     /**

+ 6 - 4
src/main/java/cn/ezhizao/project/business/controller/BizCompanyProductPackageController.java

@@ -117,8 +117,8 @@ public class BizCompanyProductPackageController extends BaseController
     @PostMapping
     @PostMapping
     public AjaxResult add(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
     public AjaxResult add(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
     {
     {
-        if(bizCompanyProductPackage.getProductCode() == null || bizCompanyProductPackage.getProductCode() == ""||bizCompanyProductPackage.getCompanyCode() == null || bizCompanyProductPackage.getCompanyCode() == "" || bizCompanyProductPackage.getPackageCode() == null || bizCompanyProductPackage.getPackageCode() == ""){
-            return error("新增包装方式失败,必填项:产品编码,客户编码,包装箱辅料编码不能为空");
+        if(bizCompanyProductPackage.getJdId() == null||bizCompanyProductPackage.getProductCode() == null || bizCompanyProductPackage.getProductCode() == ""||bizCompanyProductPackage.getCompanyCode() == null || bizCompanyProductPackage.getCompanyCode() == "" || bizCompanyProductPackage.getPackageCode() == null || bizCompanyProductPackage.getPackageCode() == ""){
+            return error("新增包装方式失败,必填项:金蝶id,产品编码,客户编码,包装箱辅料编码不能为空");
         }
         }
         if(bizCompanyProductPackage.getAreaType() != null && bizCompanyProductPackage.getAreaType() != "" && !(bizCompanyProductPackage.getAreaType().equals("Manual")|| bizCompanyProductPackage.getAreaType().equals("Automatic"))){
         if(bizCompanyProductPackage.getAreaType() != null && bizCompanyProductPackage.getAreaType() != "" && !(bizCompanyProductPackage.getAreaType().equals("Manual")|| bizCompanyProductPackage.getAreaType().equals("Automatic"))){
             return error("新增包装方式失败,区域类型只能为1或2");
             return error("新增包装方式失败,区域类型只能为1或2");
@@ -172,7 +172,8 @@ public class BizCompanyProductPackageController extends BaseController
             return error("新增包装方式失败,包装箱辅料编码不存在");
             return error("新增包装方式失败,包装箱辅料编码不存在");
         }
         }
         bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
         bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
-        return toAjax(bizCompanyProductPackageService.save(bizCompanyProductPackage));
+        bizCompanyProductPackageService.save(bizCompanyProductPackage);
+        return success(bizCompanyProductPackage.getId());
     }
     }
 
 
     /**
     /**
@@ -280,7 +281,8 @@ public class BizCompanyProductPackageController extends BaseController
             }
             }
             bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
             bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
         }
         }
-        return toAjax(bizCompanyProductPackageService.updateById(bizCompanyProductPackage));
+        bizCompanyProductPackageService.updateById(bizCompanyProductPackage);
+        return success(bizCompanyProductPackage.getId());
     }
     }
 
 
     /**
     /**

+ 22 - 2
src/main/java/cn/ezhizao/project/business/controller/BizMeasurementController.java

@@ -72,6 +72,9 @@ public class BizMeasurementController extends BaseController
             if (bizMeasurementList.stream().anyMatch(measurement -> measurement.getCode() == null || measurement.getCode() == "")) {
             if (bizMeasurementList.stream().anyMatch(measurement -> measurement.getCode() == null || measurement.getCode() == "")) {
                 throw new RuntimeException("新增失败,编码不能为空");
                 throw new RuntimeException("新增失败,编码不能为空");
             }
             }
+        if (bizMeasurementList.stream().anyMatch(measurement -> measurement.getJdId() == null)) {
+            throw new RuntimeException("新增失败,金蝶id不能为空");
+        }
             //判断编码是否有重复
             //判断编码是否有重复
             List<String> measurementCodes = bizMeasurementList.stream()
             List<String> measurementCodes = bizMeasurementList.stream()
                     .map(BizMeasurement::getCode)
                     .map(BizMeasurement::getCode)
@@ -86,7 +89,16 @@ public class BizMeasurementController extends BaseController
                 if (!measurements.isEmpty()){
                 if (!measurements.isEmpty()){
                     throw new RuntimeException("新增失败,存在重复的编码");
                     throw new RuntimeException("新增失败,存在重复的编码");
                 }
                 }
-        return toAjax(bizMeasurementService.saveBatch(bizMeasurementList));
+        bizMeasurementService.saveBatch(bizMeasurementList);
+
+        return success(bizMeasurementList.stream()
+                .map(v -> {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("id", v.getId());
+                    map.put("code", v.getCode());
+                    return map;
+                })
+                .collect(Collectors.toList()));
     }
     }
 
 
     /**
     /**
@@ -206,7 +218,15 @@ public class BizMeasurementController extends BaseController
             }
             }
 
 
         }
         }
-            return toAjax(bizMeasurementService.updateBatchById(measurementList));
+        bizMeasurementService.updateBatchById(measurementList);
+            return success(measurementList.stream()
+                    .map(v -> {
+                        Map<String, Object> map = new HashMap<>();
+                        map.put("id", v.getId());
+                        map.put("code", v.getCode());
+                        return map;
+                    })
+                    .collect(Collectors.toList()));
     }
     }
 
 
     /**
     /**

+ 2 - 2
src/main/java/cn/ezhizao/project/business/controller/BizSupplierController.java

@@ -89,8 +89,8 @@ public class BizSupplierController extends BaseController
     @Transactional
     @Transactional
     public AjaxResult add(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     public AjaxResult add(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     {
     {
-        if(bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
-            return error("新增供应商失败,必填项:供应商编码,供应商名称,结算方式不能为空");
+        if(bizSupplier.getJdId() == null||bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
+            return error("新增供应商失败,必填项:金蝶id,供应商编码,供应商名称,结算方式不能为空");
         }
         }
         if (bizSupplier.getTenantId() != null) {
         if (bizSupplier.getTenantId() != null) {
             List<BizTenant> tenantList = bizTenantService.query().eq("id", bizSupplier.getTenantId()).list();
             List<BizTenant> tenantList = bizTenantService.query().eq("id", bizSupplier.getTenantId()).list();

+ 1 - 0
src/main/resources/mybatis/business/BizCompanyMapper.xml

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
             <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
             <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
             <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
             <if test="region != null  and region != ''"> AND region = #{region}</if>
             <if test="region != null  and region != ''"> AND region = #{region}</if>
+            <if test="jdId != null  and jdId != ''"> AND jd_id = #{jdId}</if>
             <if test="salemanCode != null  and salemanCode != ''"> AND saleman_code = #{salemanCode}</if>
             <if test="salemanCode != null  and salemanCode != ''"> AND saleman_code = #{salemanCode}</if>
         </trim>
         </trim>
     </select>
     </select>

+ 1 - 0
src/main/resources/mybatis/business/BizCompanyProductPackageMapper.xml

@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             deleted = 0
             deleted = 0
             <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
             <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
+            <if test="jdId != null  and jdId != ''"> AND jd_id = #{jdId}</if>
             <if test="companyCode != null  and companyCode != ''"> AND company_code like concat('%',#{companyCode},'%') </if>
             <if test="companyCode != null  and companyCode != ''"> AND company_code like concat('%',#{companyCode},'%') </if>
             <if test="packageTypeCode != null  and packageTypeCode != ''"> AND package_type_code = #{packageTypeCode}</if>
             <if test="packageTypeCode != null  and packageTypeCode != ''"> AND package_type_code = #{packageTypeCode}</if>
             <if test="productDescription != null  and productDescription != ''"> AND product_description like concat('%',#{productDescription}, '%')</if>
             <if test="productDescription != null  and productDescription != ''"> AND product_description like concat('%',#{productDescription}, '%')</if>