Bladeren bron

项目申报的附件修改2020年 产业供地的追加咨询bug修复

huZhiHao 5 jaren geleden
bovenliggende
commit
4828e15c97

+ 8 - 2
src/main/java/platform/modules/company/service/ProjectApplicationService.java

@@ -913,8 +913,14 @@ public class ProjectApplicationService extends BaseService<ProjectApplication> {
         //模版文件
         List<ProjectMaterial> materials = projectMaterialService.findProjectMaterialByType(apply.getProject_id());
         for (ProjectMaterial material : materials) {
+
+            Template template = new Template();
+            template.setId(material.getTemplate_id());
+            FileDown file = templateService.setFile(template);
+            String fileUrl = CommonUtils.isNull(file) ? null : file.getFile_url();
+
             fileDowns.add(new FileDown(material.getTemplate_id(),
-                    material.getContent(), null, material.getTemplate_id() + ""));
+                    material.getContent(), fileUrl, material.getTemplate_id() + ""));
         }
 
         return fileDowns;
@@ -1018,7 +1024,7 @@ public class ProjectApplicationService extends BaseService<ProjectApplication> {
      */
     private FileDown annexOne(ProjectApplication apply) {
 //        final String annexName = "2019年苏州高新区工业经济发展专项扶持资金申请资料";
-        final String annexName = "2019年苏州高新区工业经济发展专项扶持资金申报材料(封面)";
+        final String annexName = "2020年苏州高新区工业经济发展专项扶持资金申报材料(封面)";
 //        String annexTempUrl = "/Users/xikaiwen/Downloads/annex1.docx";
         String annexTempUrl = repositoryPath + "/docs/annex_template/annex1.docx";
         //文件数据库存储路径

+ 40 - 23
src/main/java/platform/modules/government/service/IndustrialLandSupplyDetailService.java

@@ -534,12 +534,14 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
             }
             //是否同意
             if (landSupplyConsultation.getIsAgree() != null) {
-                String feedback = landSupplyConsultation.getFeedback();
+                String feedback = landSupplyConsultation.getFeedback() == null ? "" : landSupplyConsultation.getFeedback();
                 String str = "";
-                if (landSupplyConsultation.getIsAgree()) {
-                    str = "同意。";
-                } else {
-                    str = "不同意。";
+                if (!feedback.contains("同意。")) {
+                    if (landSupplyConsultation.getIsAgree()) {
+                        str = "同意。";
+                    } else {
+                        str = "不同意。";
+                    }
                 }
                 landSupplyConsultation.setFeedback(str + feedback);
             }
@@ -806,12 +808,14 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
             landSupplyConsultation.setDepartment_name(depart.getName());
             //是否同意
             if (landSupplyConsultation.getIsAgree() != null) {
-                String feedback = landSupplyConsultation.getFeedback();
+                String feedback = landSupplyConsultation.getFeedback() == null ? "" : landSupplyConsultation.getFeedback();
                 String str = "";
-                if (landSupplyConsultation.getIsAgree()) {
-                    str = "同意。";
-                } else {
-                    str = "不同意。";
+                if (!feedback.contains("同意。")) {
+                    if (landSupplyConsultation.getIsAgree()) {
+                        str = "同意。";
+                    } else {
+                        str = "不同意。";
+                    }
                 }
                 landSupplyConsultation.setFeedback(str + feedback);
             }
@@ -906,12 +910,13 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     break;
                 }
             }
-            //接受咨询的办 负责的状态
+            //接受咨询的办 负责的状态
             group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_2, null);
             userGroups = userGroupService.findByGroupId(group.getId());
             for (UserGroup userGroup : userGroups) {
                 if (Objects.equals(userGroup.getUser_id(), user_id)) {
                     apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
+                    apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
                     industriallandsupply_2_flag = true;
                     break;
                 }
@@ -1019,15 +1024,19 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
             if (
                     Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK, entity.getApprove_status())
                             || Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK, entity.getApprove_status())
+                            || Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY, entity.getApprove_status())
             ) {
                 if (industriallandsupply_2_flag || industriallandsupply_5_flag) {
 
+                    //被问数 回答数
+                    int consulNum1 = 0, consulNum2 = 0;
                     //是否被问
                     boolean consulFlag = false;
                     for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
                         if (Objects.equals(entity.getId() + "", industrialLandSupplyConsultation.getIndustrial_land_supply_id())) {
-                            consulFlag = true;
-                            break;
+//                            consulFlag = true;
+//                            break;
+                            consulNum1++;
                         }
                     }
                     //是否回答
@@ -1041,8 +1050,9 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                                 Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
                                 Date d2 = DateUtil.parseTimeStringToDate(approval.getCreate_time(), "yyyy-MM-dd hh:mm:ss");
                                 if (d1.before(d2)) {
-                                    consulApproveFlag = true;
-                                    break;
+//                                    consulApproveFlag = true;
+//                                    break;
+                                    consulNum2++;
                                 }
                             } catch (ParseException e) {
                                 e.printStackTrace();
@@ -1050,12 +1060,15 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                         }
                     }
 
+                    //被问数 回答数
+                    int distNum1 = 0, distNum2 = 0;
                     //是否被问
                     boolean distFlag = false;
                     for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
                         if (Objects.equals(entity.getId() + "", industrialLandSupplyDistribution.getIndustrial_land_supply_id())) {
-                            distFlag = true;
-                            break;
+//                            distFlag = true;
+//                            break;
+                            distNum1++;
                         }
                     }
                     //是否回答
@@ -1066,8 +1079,9 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                                 Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
                                 Date d2 = DateUtil.parseTimeStringToDate(approval.getCreate_time(), "yyyy-MM-dd hh:mm:ss");
                                 if (d1.before(d2)) {
-                                    distApproveFlag = true;
-                                    break;
+//                                    distApproveFlag = true;
+//                                    break;
+                                    distNum2++;
                                 }
                             } catch (ParseException e) {
                                 e.printStackTrace();
@@ -1075,7 +1089,10 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                         }
                     }
 
-                    if ((consulFlag && !consulApproveFlag) || (distFlag && !distApproveFlag)) {
+//                    if ((consulFlag && !consulApproveFlag) || (distFlag && !distApproveFlag)) {
+//                        result.add(entity.getId().toString());
+//                    }
+                    if ((consulNum1 > consulNum2) || (distNum1 > distNum2)) {
                         result.add(entity.getId().toString());
                     }
                 } else {
@@ -3358,7 +3375,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     }
                 }
             }
-             if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
+            if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
                 industrialLandSupplyConsultationService.saveList(industrialLandSupplyConsultationList);
             }
         }
@@ -3956,8 +3973,8 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
         final String name = "苏州国家高新区产业用地预审办文单" + "-" + time + ".docx";
 //        String templateUrl = repositoryPath + "/docs/annex_template/annex4.docx";
 //        String templateUrl = "template/苏州高新区产业用地预审办文单.docx";
-        String classesPath=Thread.currentThread().getContextClassLoader().getResource("").getPath();
-        String templateUrl =classesPath+ "template/苏州高新区产业用地预审办文单.docx";
+        String classesPath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
+        String templateUrl = classesPath + "template/苏州高新区产业用地预审办文单.docx";
         //文件数据库存储路径
 //        String outputUrl = getFilePath(name, "docs") + ".docx";
 

+ 14 - 0
src/main/java/platform/modules/government/web/IndustrialLandSupplyController.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.WebDataBinder;
 import org.springframework.web.bind.annotation.*;
 import platform.common.Constant;
 import platform.common.annotation.OperationLog;
@@ -633,4 +634,17 @@ public class IndustrialLandSupplyController extends BaseController {
         }
         return ResponseMessage.success("保存成功!");
     }
+
+    /**
+     * 由于Spring在接受前台传入的List时,就会出现256的IndexOutOfBoundsException异常
+     * 设置setAutoGrowCollectionLimit为1024
+     * @param binder
+     * @see [类、类#方法、类#成员]
+     */
+    @InitBinder
+    public void initListBinder(WebDataBinder binder)
+    {
+        // 设置需要包裹的元素个数,默认为256
+        binder.setAutoGrowCollectionLimit(3000);
+    }
 }

+ 4 - 4
src/main/resources/static/js/company/project_application/apply_add.js

@@ -140,8 +140,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-1);
                         }
                     }
                     , cancel: function () {
@@ -150,8 +150,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-1);
                         }
                         return true;
                     }

+ 4 - 4
src/main/resources/static/js/company/project_application/apply_edit.js

@@ -125,8 +125,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                     }
                     , cancel: function () {
@@ -135,8 +135,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                         return true;
                     }

+ 4 - 4
src/main/resources/static/js/company/project_intelligent/apply_add.js

@@ -120,8 +120,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                     }
                     , cancel: function () {
@@ -130,8 +130,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                         return true;
                     }

+ 4 - 4
src/main/resources/static/js/company/project_intelligent/apply_edit.js

@@ -114,8 +114,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                     }
                     , cancel: function () {
@@ -124,8 +124,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                         return true;
                     }

+ 4 - 4
src/main/resources/static/js/company/project_provinces/apply_add.js

@@ -137,8 +137,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/index/#/projectList";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/index/#/projectList";
+                            history.back(-2);
                         }
                     }
                     , cancel: function () {
@@ -147,8 +147,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath+"/index/#/projectList";
-                            //history.back(-2);
+                            // window.location.href = pagePath+"/index/#/projectList";
+                            history.back(-2);
                         }
                         return true;
                     }

+ 4 - 4
src/main/resources/static/js/company/project_provinces/apply_edit.js

@@ -122,8 +122,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                     }
                     , cancel: function () {
@@ -132,8 +132,8 @@ function submit() {
                             parent.location.reload();
                             parent.layer.close(index);
                         } else {
-                            window.location.href = pagePath + "/home/informList/69";
-                            //history.back(-2);
+                            // window.location.href = pagePath + "/home/informList/69";
+                            history.back(-2);
                         }
                         return true;
                     }

+ 3 - 4
src/main/resources/templates/admin/government/industrial_land_supply/feedback.html

@@ -113,9 +113,8 @@
                 <div class="row cl">
                     <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否同意:</label>
                     <div class="formControls col-xs-8 col-sm-9">
-                        <input type="radio" th:name="'consultationList['+${itemStat.index}+'].isAgree'"
-                               value="true">同意</input>
-                        <input type="radio" th:name="'consultationList['+${itemStat.index}+'].isAgree'" value="false">不同意</input>
+                        <input type="radio" th:name="'consultationList['+${itemStat.index}+'].isAgree'" th:checked="${item.isAgree}" value="true">同意</input>
+                        <input type="radio" th:name="'consultationList['+${itemStat.index}+'].isAgree'" th:checked="${!item.isAgree}" value="false">不同意</input>
                     </div>
                 </div>
             </th:block>
@@ -190,7 +189,7 @@
     function save() {
 
         var index = 0, valiAgree = false;
-        //判断是否有默认的咨询 以及是否校验选择同
+        //判断是否有默认的咨询 以及是否校验选择同
         var consultationList = [[${data.consultationList}]];
         for (var i = 0; i < consultationList.length; i++) {
             if (consultationList[i].isDefault) {

+ 2 - 1
src/main/resources/templates/admin/government/industrial_land_supply/feedback_append.html

@@ -130,7 +130,7 @@
                             <td class="td_material">
                                 <input type="text" class="input-text consultation" placeholder="请输入咨询的问题"
                                        th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].consultation'"
-                                       th:value="${landSupplyCons.consultation}"/>
+                                       th:value="${landSupplyCons.consultation}" readonly = "readonly"/>
                                 <input class="department_id" type="hidden"
                                        th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].department_id'"
                                        th:value="${item.id}"/>
@@ -203,6 +203,7 @@
             $("#" + divId).find(".add_file_line  tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
                 .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
                 .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
+                .find(".consultation").removeAttr("readonly").end()
                 .find(".icon_font").html(html).end();
         } else {
             var str = "";

+ 1 - 1
src/main/resources/templates/admin/government/industrial_land_supply/index.html

@@ -183,7 +183,7 @@
 
                             <a title="咨询反馈" href="javascript:;" class="ml-5" style="text-decoration:none"
                                th:onclick="'javascript:jump_to(\'咨询反馈\',\'/land_supply/feedback/'+*{id}+'\');'"
-                               th:if="*{approve_status=='6'}">咨询反馈</a>
+                               th:if="*{approve_status=='6'|| approve_status=='7'}">咨询反馈</a>
 
                         </th:block>