Преглед на файлове

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

maqingyang преди 11 месеца
родител
ревизия
3aedce907d

+ 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"));

+ 6 - 4
src/main/java/com/kexun/controller/UploadController.java

@@ -51,10 +51,11 @@ public class UploadController {
     private String jsonTargetPath;
 
     @PostMapping("/uploadUi")
-    public Result uploadUi(@RequestParam("files") MultipartFile[] files ) {
+    public Result uploadUi(@RequestParam("files") MultipartFile[] files ,@RequestParam("customerName") String customerName,
+                           @RequestParam("headInfId") String headInfId) {
         if(files.length>0) {
             for(MultipartFile file : files) {
-                String fileName = file.getOriginalFilename();
+                String fileName = customerName+"_"+headInfId+"_"+file.getOriginalFilename();
                 try{
                     String filePath = "";
                     if(fileName.endsWith("xml")){
@@ -95,10 +96,11 @@ public class UploadController {
     }
 
     @PostMapping("/uploadMod")
-    public Result uploadMod(@RequestParam("files") MultipartFile[] files ) {
+    public Result uploadMod(@RequestParam("files") MultipartFile[] files ,@RequestParam("customerName") String customerName,
+                            @RequestParam("headInfId") String headInfId) {
         if(files.length>0) {
             for(MultipartFile file : files) {
-                String fileName = file.getOriginalFilename();
+                String fileName = customerName+"_"+headInfId+"_"+file.getOriginalFilename();
                 try{
                     File mkdir = new File(modelPath);
                     if(!mkdir.exists()) {

+ 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");