2 コミット d02f34a069 ... 4c9eb04333

作者 SHA1 メッセージ 日付
  Danj0rr 4c9eb04333 Merge remote-tracking branch 'origin/develop' into develop 11 ヶ月 前
  Danj0rr 1fd20fadc3 修改合作方证件号码时,判断(证件号码,证件类型)是否重复 11 ヶ月 前

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

@@ -129,6 +129,11 @@ public class CooperatorController {
 
         CooperatorInfo cooperatorInfo = CooperatorService.findByID(cooperatorId);
 
+        CooperatorInfo dupNumCooperatorInfo=CooperatorService.findByCorpCertificateNumAndType(req.getString("corp_certificate_num"),req.getString("corp_certificate_type"));
+        if (dupNumCooperatorInfo!=null)
+            return Result.error("证件号码重复!");
+
+
         cooperatorInfo.setCooperatorName(req.getString("cooperator_name"));
         cooperatorInfo.setCorpCertificateNum(req.getString("corp_certificate_num"));
         cooperatorInfo.setCorpCertificateType(req.getString("corp_certificate_type"));

+ 1 - 0
src/main/java/com/kexun/service/CooperatorService.java

@@ -14,6 +14,7 @@ import java.util.List;
  */
 public interface CooperatorService extends IService<CooperatorInfo> {
     CooperatorInfo findByCooperatorNum(String partnerName);
+    CooperatorInfo findByCorpCertificateNumAndType(String corpCertificateNum, String corpCertificateType);
 //    List<CooperatorField> findCooperatorFieldByNum(String cooperatorNum);
     List<CooperatorField> findCooperatorFieldByNum(String templateId);
     List<CooperatorProduct> findCooperatorProductByNum(String cooperatorNum);

+ 8 - 0
src/main/java/com/kexun/service/impl/CooperatorServiceImpl.java

@@ -26,6 +26,14 @@ public class CooperatorServiceImpl extends ServiceImpl<CooperatorMapper, Coopera
     @Resource
     CooperatorMapper cooperatorMapper;
 
+    @Override
+    public CooperatorInfo findByCorpCertificateNumAndType(String corpCertificateNum,String corpCertificateType) {
+        QueryWrapper wrapper=new QueryWrapper();
+        wrapper.eq("corp_certificate_num",corpCertificateNum);
+        wrapper.eq("corp_certificate_type",corpCertificateType);
+        return getOne(wrapper);
+    }
+
     @Override
     public List<CooperatorField> findCooperatorFieldByNum(String templateId) {
 //        System.out.println("aaa");