Răsfoiți Sursa

Merge remote-tracking branch 'origin/develop' into develop

zishan-an 11 luni în urmă
părinte
comite
8b35a9f51b

+ 5 - 5
src/main/java/com/kexun/controller/CooperatorController.java

@@ -97,19 +97,19 @@ public class CooperatorController {
     {
         JSONObject req = JSON.parseObject(json);
         String cooperator_name=req.getString("cooperator_name");
-        CooperatorInfo dupCooperatorInfo= CooperatorService.findByCooperatorNum(cooperator_name);
-        if (dupCooperatorInfo!=null){
+
+
+        List<CooperatorInfo> dupNumCooperatorInfo=CooperatorService.findByCorpCertificateNumAndType(req.getString("corpCertificateNum"),req.getString("corp_certificate_type"));
+        if (!dupNumCooperatorInfo.isEmpty())
             return Result.error("合作方已存在!");
-        }
 
+        System.out.println(req.getString("corp_certificate_type"));
         CooperatorInfo cooperatorInfo = new CooperatorInfo();
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
         long time1 = System.currentTimeMillis();
         cooperatorInfo.setCooperatorNum(Long.toString(time1));
         cooperatorInfo.setCorpCertificateNum(req.getString("corpCertificateNum"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));
-//        long time1 = System.currentTimeMillis();
-//        cooperatorInfo.setCooperatorNum(Long.toString(time1));
         cooperatorInfo.setTemplateId(req.getString("field_template_id"));
         Calendar calendar= Calendar.getInstance();
         SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :HH:mm:ss");

+ 11 - 0
src/main/java/com/kexun/controller/CooperatorProductController.java

@@ -120,6 +120,17 @@ public class CooperatorProductController {
 //        return Result.success("ok", result);
 //    }
 
+    @PostMapping("checkDupProdNum")
+    public  Result checkDupProdNum(@RequestBody String json)
+    {
+        JSONObject req = JSON.parseObject(json);
+        List<CooperatorProduct> dupCooperatorProductInfo=CooperatorProductService.getProductByProductNum(req.getString("product_num"));
+        if(!dupCooperatorProductInfo.isEmpty()){
+            return Result.error("合作方产品编号重复!");
+        }
+        return Result.success();
+    }
+
     // 申请合作产品
     @PostMapping("apply")
     public Result cooperatorProductApply(@RequestBody String json)

+ 2 - 1
src/main/java/com/kexun/controller/ModelController.java

@@ -59,7 +59,8 @@ public class ModelController {
     public Result getModelNo(){
         JSONObject resJson = new JSONObject();
         String model_no=userModelService.getModelNo();
-
+        if (model_no==null)
+            model_no="0";
         System.out.println(model_no);
 
         resJson.put("model_no", model_no);