Explorar el Código

批量归档,文件添加问题修改

[user3] hace 4 años
padre
commit
3c8af22884

+ 22 - 16
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -998,7 +998,28 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
     public void insertProInfo(String[] proInfos,String[] flags,String[] proId,String filingId){
         String pro="";
         JSONObject json = null;
-        if (flags.length!=0 && proId.length==1){
+        boolean tiao=false;
+        for (int i=0;i<flags.length;i++){
+            if (!flags[i].equals("")){
+                tiao=true;
+            }
+        }
+        if(!tiao || proInfos[1].length()>50){
+            Integer count=0;
+            for (int i=0;i<proInfos.length;i++){
+                if (proInfos[i]!=""&& !"".equals(proInfos[i])) {
+                    json = JSONObject.fromObject(proInfos[i]);
+                    ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
+                    info.setId(IdGen.uuid());
+                    info.setProId(json.get("proId").toString());
+                    info.setProInfofilingBatch(json.get("filingId").toString());
+                    info.setProInfoName(json.get("names").toString());
+                    info.setProInfoType(json.get("types").toString());
+                    if(count==0){ DelProInfo(info);count++;}
+                    proInfoDao.proInfoInsert(info);
+                }
+            }
+        }else if (flags.length!=0 && proInfos.length==4 && tiao ){
             int count=0;
             for (int s=0;s< proInfos.length;s++){
                 count++;
@@ -1016,21 +1037,6 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
             info.setProInfoType(json.get("types").toString());
             DelProInfo(info);
             proInfoDao.proInfoInsert(info);
-        }else{
-            Integer count=0;
-            for (int i=0;i<proInfos.length;i++){
-                if (proInfos[i]!=""&& !"".equals(proInfos[i])) {
-                    json = JSONObject.fromObject(proInfos[i]);
-                    ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
-                    info.setId(IdGen.uuid());
-                    info.setProId(json.get("proId").toString());
-                    info.setProInfofilingBatch(json.get("filingId").toString());
-                    info.setProInfoName(json.get("names").toString());
-                    info.setProInfoType(json.get("types").toString());
-                    if(count==0){ DelProInfo(info);count++;}
-                    proInfoDao.proInfoInsert(info);
-                }
-            }
         }
 
     }

+ 2 - 2
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -355,7 +355,7 @@ public class ProjectFilingBatchController extends BaseController {
                 if (t.getFilingStatus() == 3 ||t.getFilingStatus()==1){
                     MyBeanUtils.copyBeanNotNull2Bean(projectFilingBatch, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
                     projectFilingBatchService.saveProject(proId,t, ProjectStatusEnum.IN_APRL);//保存
-                    if (proInfos!=null){
+                    if (proInfos.length!=0){
                         projectFilingBatchService.insertProInfo(proInfos,flags,proId,projectFilingBatch.getId());
                     }
 
@@ -370,7 +370,7 @@ public class ProjectFilingBatchController extends BaseController {
                 projectFilingBatch.setFilingStatus(1);
                 projectFilingBatchService.saveProject(proId,projectFilingBatch, ProjectStatusEnum.IN_APRL);//保存
                 //新增项目树形信息
-                if (proInfos!=null) {
+                if (proInfos.length!=0) {
                     projectFilingBatchService.insertProInfo(proInfos, flags, proId,projectFilingBatch.getId());
                 }
             }

+ 1 - 1
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchProInfoDao.xml

@@ -38,7 +38,7 @@
 
 	<delete id="delete">
 		delete from project_filingbatch_proinfo
-		where filing_batch=#{proInfofilingBatch} and project_id=#{proId}
+		where filing_batch=#{proInfofilingBatch}
 	</delete>
 	<delete id="deleteById">
 		delete from project_filingbatch_proinfo