Quellcode durchsuchen

批量归档功能添加导入功能。签章查询修改

user5 vor 3 Jahren
Ursprung
Commit
0f6f9d1821

+ 54 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingBatchImportInfo.java

@@ -0,0 +1,54 @@
+package com.jeeplus.modules.projectFilingBatch.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 批量归档数据导入
+ * @author: 徐滕
+ * @create: 2022-01-05 10:02
+ **/
+public class ProjectFilingBatchImportInfo {
+    private String reportNumber;    //报告号
+    private String types;        //文件类型
+    private String names;    //文件内容
+    private String proId;       //项目id
+
+    @ExcelField(title="报告号", align=2, sort=1)
+    @NotNull(message = "报告号不能为空")
+    public String getReportNumber() {
+        return reportNumber;
+    }
+
+    public void setReportNumber(String reportNumber) {
+        this.reportNumber = reportNumber;
+    }
+
+    @ExcelField(title="文件类型", align=2, sort=2)
+    @NotNull(message = "文件类型不能为空")
+    public String getTypes() {
+        return types;
+    }
+
+    public void setTypes(String types) {
+        this.types = types;
+    }
+
+    @ExcelField(title="文件内容", align=2, sort=3)
+    public String getNames() {
+        return names;
+    }
+
+    public void setNames(String names) {
+        this.names = names;
+    }
+
+    public String getProId() {
+        return proId;
+    }
+
+    public void setProId(String proId) {
+        this.proId = proId;
+    }
+}

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

@@ -854,7 +854,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                         .save(UtilNotify
                                 .saveNotify(projectFilingBatch.getId(),
                                         projectFilingBatch.getCreateBy(),
-                                        office.getParent().getId(),
+                                        UserUtils.getSelectCompany().getId(),
                                         title,
                                         content,
                                         "100",
@@ -872,7 +872,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                             .save(UtilNotify
                                     .saveNotify(projectFilingBatch.getId(),
                                             projectFilingBatch.getCreateBy(),
-                                            office.getParent().getId(),
+                                            UserUtils.getSelectCompany().getId(),
                                             titleStr,
                                             notifyStr,
                                             "100",
@@ -890,7 +890,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 WorkProjectNotify workProjectNotify = UtilNotify
                         .saveNotify(projectFilingBatch.getId(),
                                 new User(),
-                                office.getParent().getId(),
+                                UserUtils.getSelectCompany().getId(),
                                 titleStr,
                                 str,
                                 "100",
@@ -924,7 +924,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                     WorkProjectNotify workProjectNotify = UtilNotify
                             .saveNotify(projectFilingBatch.getId(),
                                     user,
-                                    office.getParent().getId(),
+                                    UserUtils.getSelectCompany().getId(),
                                     titleStr,
                                     str,
                                     "100",
@@ -942,7 +942,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                         WorkProjectNotify workProjectNotify = UtilNotify
                                 .saveNotify(projectFilingBatch.getId(),
                                         new User(),
-                                        office.getParent().getId(),
+                                        UserUtils.getSelectCompany().getId(),
                                         titleStr,
                                         str,
                                         "100",
@@ -970,7 +970,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                 .save(UtilNotify
                                         .saveNotify(projectFilingBatch.getId(),
                                                 projectFilingBatch.getCreateBy(),
-                                                office.getParent().getId(),
+                                                UserUtils.getSelectCompany().getId(),
                                                 titleStr,
                                                 str,
                                                 "100",

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

@@ -1,21 +1,25 @@
 package com.jeeplus.modules.projectFilingBatch.web;
 
+import com.google.common.collect.Lists;
 import com.google.gson.internal.$Gson$Preconditions;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.utils.IdGen;
-import com.jeeplus.common.utils.MyBeanUtils;
-import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.*;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchProInfoDao;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchImportInfo;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectFilingBatch.service.ProjectFilingBatchService;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.ImportBRuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -26,6 +30,7 @@ import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workengineeringproject.entity.WorkEngineeringProject;
+import net.sf.json.JSONObject;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
@@ -36,6 +41,7 @@ import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import redis.clients.jedis.Jedis;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -558,7 +564,9 @@ public class ProjectFilingBatchController extends BaseController {
         for(int i=0;i<types.length;i++){
             Map<String,String> map=new HashMap<>();
             map.put("type",types[i]);
-            map.put("name",names[i]);
+            if(null != names && names.length>0){
+                map.put("name",names[i]);
+            }
             proInfo.add(map);
         }
         model.addAttribute("proInfo", proInfo);
@@ -581,4 +589,155 @@ public class ProjectFilingBatchController extends BaseController {
         return "success";
     }
 
-}
+    /**
+     * 批量项目信息文档下载
+     */
+    //@RequiresPermissions("projectFilingBatch:projectFilingBatchInfo:import")
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, HttpServletRequest request, RedirectAttributes redirectAttributes) {
+        try {
+            ThisLocalityDownloadUtil download = new ThisLocalityDownloadUtil();
+            download.download("批量归档导入模板.xlsx",request,response);
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "模板下载失败!失败信息:"+e.getMessage());
+        }
+        //return "redirect:" + Global.getAdminPath() + "/projectFilingBatch/projectFilingBatchInfo/?repage";
+        return null;
+    }
+
+    /**
+     * 批量项目信息导入
+     */
+    //@RequiresPermissions("projectFilingBatch:projectFilingBatchInfo:import")
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    @ResponseBody
+    public Map<String,Object> importFile(MultipartFile file) {
+        Map<String,Object> map = new HashMap<>();
+
+        //创建一个UUID
+        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
+        //创建缓存
+        JedisUtils jedis = new JedisUtils();
+        try {
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<ProjectFilingBatchImportInfo> list = ei.getDataList(ProjectFilingBatchImportInfo.class);
+            Set<String> reportNumberSet = new HashSet();
+            //对数据进行处理
+            //将报告号进行筛选去重
+            for (ProjectFilingBatchImportInfo info : list) {
+                if(StringUtils.isBlank(info.getReportNumber())){
+                    map.put("success",false);
+                    map.put("msg","存在未填写报告号的信息");
+                    return map;
+                }
+                if(StringUtils.isBlank(info.getTypes())){
+                    map.put("success",false);
+                    map.put("msg","存在未填写项目类型的信息");
+                    return map;
+                }
+                reportNumberSet.add(info.getReportNumber());
+            }
+            //数据进行分组
+            Map<String, List<ProjectFilingBatchImportInfo>> listMap = ruralProjectRecordsService.dataMessageDispose(list);
+            List<String> projectIdList = Lists.newArrayList();
+            for (String reportNumber: reportNumberSet) {
+                //判断报告号对应的项目是否存在
+                RuralProjectRecords records = ruralProjectRecordsService.getByReportNumber(reportNumber);
+                if(null == records){
+                    map.put("success",false);
+                    map.put("msg","未查询到报告号:"+ reportNumber + " 的项目信息");
+                    return map;
+                }
+                //判断项目登记人是否为当前登陆人
+                if(!UserUtils.getUser().getId().equals(records.getCreateBy().getId())){
+                    map.put("success",false);
+                    map.put("msg","报告号:"+ reportNumber + " 的项目登记人不是您。无法进行归档");
+                    return map;
+                }
+
+                //判断该项目信息是否已经提交归档或者是否归档已完成
+                Integer result = ruralProjectRecordsService.getEfficientProjectFlingbatchRelationByProjectId(records.getId());
+                if(result != 0){
+                    map.put("success",false);
+                    map.put("msg","报告号:"+ reportNumber + " 的项目信息已经归档或正在归档,无法进行二次归档");
+                    return map;
+                }
+
+                List<ProjectFilingBatchImportInfo> projectFilingBatchImportInfos = listMap.get(reportNumber);
+                StringBuilder jedisJsonBuilder = new StringBuilder();
+                for (ProjectFilingBatchImportInfo info: projectFilingBatchImportInfos) {
+                    info.setProId(records.getId());
+                    //1、使用JSONObject
+                    JSONObject json = JSONObject.fromObject(info);
+                    String strJson=json.toString();
+                    jedisJsonBuilder.append(strJson).append(";");
+                }
+                String jedisJson = jedisJsonBuilder.toString();
+                jedisJson.lastIndexOf(";");
+                jedis.set(uuid + "_" + records.getId(),jedisJson,120);
+                projectIdList.add(records.getId());
+            }
+
+            map.put("success",true);
+            map.put("projectIdList",projectIdList);
+            map.put("uuid",uuid);
+            map.put("msg","导入成功");
+        } catch (Exception e) {
+            map.put("success",false);
+            map.put("msg","导入失败。原因:" + e.getMessage());
+        }
+        return map;
+    }
+
+
+    /**
+     * 根据项目id查询项目信息
+     * @param projectId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "getProjectByProjectId")
+    public RuralProjectRecords getProjectByProjectId(@RequestParam("projectId") String projectId) {
+        RuralProjectRecords projectRecords = ruralProjectRecordsService.getProjectByProjectId(projectId);
+        return projectRecords;
+    }
+
+    /**
+     * 根据key键查询导入批量归档中的子节点信息
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "getImportDescendantsInfo")
+    public Map<String,Object> getImportDescendantsInfo(@RequestParam("key") String key){
+        Map map = new HashMap();
+        //创建缓存
+        JedisUtils jedis = new JedisUtils();
+        try {
+            String jedisValue = jedis.get(key);
+            String[] split = jedisValue.split(";");
+            List<String> splitList = Arrays.asList(split);
+            List<ProjectFilingBatchImportInfo> infoList = Lists.newArrayList();
+            List<String> infoStrList = Lists.newArrayList();
+            for (String infoStr: splitList) {
+                //1、使用JSONObject
+                JSONObject jsonObject=JSONObject.fromObject(infoStr);
+                ProjectFilingBatchImportInfo info=(ProjectFilingBatchImportInfo)JSONObject.toBean(jsonObject, ProjectFilingBatchImportInfo.class);
+                infoList.add(info);
+                infoStrList.add(infoStr);
+            }
+
+            map.put("success",true);
+            map.put("infoList",infoList);
+            map.put("infoStrList",infoStrList);
+            //删除缓存数据
+            jedis.del(key);
+
+        } catch (Exception e) {
+            map.put("success",false);
+            map.put("msg","导入失败。原因:" + e.getMessage());
+        }
+        return map;
+    }
+
+
+}

+ 20 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -296,4 +296,24 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     RuralProjectRecords getJudgementSignatureByDocumentId(String documentId);
+
+    /**
+     * 根据报告号查询项目信息
+     * @param reportNumber
+     * @return
+     */
+    RuralProjectRecords getByReportNumber(String reportNumber);
+    /**
+     * 根据项目id查询项目是否可以被进行归档
+     * @param projectId
+     * @return
+     */
+    Integer getEfficientProjectFlingbatchRelationByProjectId(String projectId);
+
+    /**
+     * 根据项目id查询项目信息
+     * @param projectId
+     * @return
+     */
+    RuralProjectRecords getProjectByProjectId(String projectId);
 }

+ 61 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -19,6 +19,7 @@ import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationServ
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchImportInfo;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataTwoDao;
@@ -74,6 +75,7 @@ import org.activiti.engine.RuntimeService;
 import org.activiti.engine.history.HistoricTaskInstance;
 import org.activiti.engine.history.HistoricTaskInstanceQuery;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -1444,6 +1446,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	    return  dao.findUseableByProjectId(projectId);
     }
 
+    public RuralProjectRecords getProjectByProjectId(String projectId) {
+	    return  dao.getProjectByProjectId(projectId);
+    }
+
     public void queryProjectDetail(RuralProjectRecords projectRecords) {
 		if(null != projectRecords.getWorkContractInfo() && StringUtils.isNotBlank(projectRecords.getWorkContractInfo().getId())){
 			this.queryContractInfos(projectRecords);
@@ -2861,5 +2867,60 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		return dao.getJudgementSignatureByDocumentId(documentId);
 	}
 
+	/**
+	 * 根据报告号查询项目信息
+	 * @param reportNumber
+	 * @return
+	 */
+	public RuralProjectRecords getByReportNumber(String reportNumber) {
+		RuralProjectRecords ruralProjectRecords = dao.getByReportNumber(reportNumber);
+		return ruralProjectRecords;
+	}
+
+	/**
+	 * 根据报告号查询项目信息
+	 * @param reportNumber
+	 * @return
+	 */
+	public Integer getEfficientProjectFlingbatchRelationByProjectId(String projectId) {
+		Integer result = dao.getEfficientProjectFlingbatchRelationByProjectId(projectId);
+		return result;
+	}
+
+	/**
+	 * 根据报告号查询项目信息
+	 * @param dataList
+	 * @return
+	 */
+	public Map<String, List<ProjectFilingBatchImportInfo>> dataMessageDispose(List<ProjectFilingBatchImportInfo> dataList) {
+		//所有有效数据均添加到list中,下边将list中的数据根据店号和收银员的id进行分割处理
+		Map<String, List<ProjectFilingBatchImportInfo>> result = listGroup2MapTwo(dataList);
+		return result;
+	}
+
+	private Map<String, List<ProjectFilingBatchImportInfo>> listGroup2MapTwo(List<ProjectFilingBatchImportInfo> list) {
+		Map<String, List<ProjectFilingBatchImportInfo>> userSignSerialMap = new HashMap<>();
+		if (CollectionUtils.isNotEmpty(list)) {
+			// 分组
+			for (ProjectFilingBatchImportInfo vo : list) {
+
+				List<ProjectFilingBatchImportInfo> tempList = userSignSerialMap.get(vo.getReportNumber());
+				/*如果取不到数据,那么直接new一个空的ArrayList**/
+				if (tempList == null) {
+					tempList = new ArrayList<>();
+					tempList.add(vo);
+					userSignSerialMap.put(vo.getReportNumber(), tempList);
+				}
+				else {
+					/*某个vo之前已经存放过了,则直接追加数据到原来的List里**/
+					tempList.add(vo);
+				}
+			}
+		}
+		return userSignSerialMap;
+	}
+
+
+
 
 }

+ 4 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageElectronicSealController.java

@@ -142,7 +142,7 @@ public class RuralProjectMessageElectronicSealController extends BaseController
         }
         //无合同状态下,获取委托方的名称
         List<RuralProjectRecords> list = page.getList();
-        for (int i = 0; i < list.size(); i++) {
+        /*for (int i = 0; i < list.size(); i++) {
             RuralProjectRecords records1 = list.get(i);
             if (records1.getWorkContractInfo() == null) {
                 projectRecordsService.queryLinkmanInfos(records1);
@@ -156,7 +156,7 @@ public class RuralProjectMessageElectronicSealController extends BaseController
             }
             //将生成的文件上传到阿里云中
             ruralProjectMessageElectronicSealService.getFile(records1);
-        }
+        }*/
         if(StringUtils.isNotBlank(oldSubmitMoney)){
             projectRecords.setSubmitMoney(oldSubmitMoney);
         }
@@ -167,7 +167,8 @@ public class RuralProjectMessageElectronicSealController extends BaseController
         }
         model.addAttribute("beginDate", projectRecords.getBeginDate());
         model.addAttribute("endDate", projectRecords.getEndDate());
-        model.addAttribute("moneyAll", ruralProjectMessageAllService.getMoneyAll(projectRecords));
+        //计算营业总收入
+        //model.addAttribute("moneyAll", ruralProjectMessageAllService.getMoneyAll(projectRecords));
         model.addAttribute("reportSwitch", BaseController.REPORTSWITCH);
         if (StringUtils.isNotBlank(oldProjectSort)){
             model.addAttribute("oldProjectSort", oldProjectSort);

+ 15 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -412,6 +412,12 @@ END) as projectScale*/
 			<if test="bzshbUserId!=null and bzshbUserId!=''">
 				and prd.bzshb_user_id=#{bzshbUserId}
 			</if>
+			<if test="reportSignatureStatus!=null and reportSignatureStatus!=''">
+				and prs.status=#{reportSignatureStatus}
+			</if>
+			<if test="approvalSignatureStatus!=null and approvalSignatureStatus!=''">
+				and pas.status=#{approvalSignatureStatus}
+			</if>
 			<if test="projectId != null and projectId != ''">
 				AND a.project_id like concat('%',#{projectId},'%')
 			</if>
@@ -617,8 +623,17 @@ END) as projectScale*/
 		LEFT JOIN sys_user sua on a.create_by = sua.id
 		left join project_paper_filing ppf on ppf.project_id = a.id
 		LEFT JOIN sys_office o ON o.id = a.office_id
+		left join project_approval_signature pas on pas.project_id = a.id
+		left join project_report_signature prs on prs.project_id = a.id
+		left join project_report_signature_info prsi on prsi.project_report_id = prd.number
 		<where>
 			a.status = 5
+			<if test="reportSignatureStatus!=null and reportSignatureStatus!=''">
+				and prs.status=#{reportSignatureStatus}
+			</if>
+			<if test="approvalSignatureStatus!=null and approvalSignatureStatus!=''">
+				and pas.status=#{approvalSignatureStatus}
+			</if>
 			<if test="bzshbUserId!=null and bzshbUserId!=''">
 				and prd.bzshb_user_id=#{bzshbUserId}
 			</if>

+ 41 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -103,6 +103,31 @@
 	</select>
 
 
+	<select id="getByReportNumber" resultType="RuralProjectRecords" >
+		SELECT
+			<include refid="projectRecordsColumns"/>
+		,a.file_num AS "fileNum"
+	    ,a.check_process_instance_id AS "checkProcessInstanceId"
+        ,su.name AS "createBy.name"
+        ,o.top_company AS "office.name"
+		,prd.number AS "projectReportNumber"
+		,prd.id AS "prdId"
+		,prr.id As "prrid"
+		,a.project_master_id as "projectMasterId"
+		,a.submit_money as "submitMoney"
+		,a.engineering_type as "engineeringType"
+		,supmi.name as "projectMasterName"
+        FROM rural_project_records a
+        <include refid="projectRecordsJoins"/>
+        LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+		left join project_report_data prd on prd.project_id = a.id
+		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		WHERE prd.number = #{reportNumber}
+	</select>
+
+
 	<select id="getSignatureByDocumentId" resultType="RuralProjectRecords" >
 		SELECT
 			<include refid="projectRecordsColumns"/>
@@ -863,6 +888,16 @@
         WHERE a.project_id = #{projectId} and a.status != 7
     </select>
 
+	<select id="getProjectByProjectId" resultType="RuralProjectRecords">
+		select
+		<include refid="projectRecordsColumns"/>
+		,prd.number AS "projectReportNumber"
+		FROM rural_project_records a
+		left join project_report_data prd on prd.project_id = a.id
+		<include refid="projectRecordsJoins"/>
+		WHERE a.id = #{projectId} and a.status != 7
+	</select>
+
     <update id="updateProcessIdAndStatus" >
         UPDATE  rural_project_records SET
 		update_date = now()
@@ -1969,4 +2004,10 @@
 	<select id="getBelongingDepartmentNameByBelongingDepartment" parameterType="java.lang.String" resultType="java.lang.String">
 		select name from sys_office where id = #{belongingDepartment}
 	</select>
+
+	<select id="getEfficientProjectFlingbatchRelationByProjectId" resultType="java.lang.Integer">
+		select count(1) from project_flingbatch_relation
+		where project_id = #{projectId}
+		and status in(2,3,5)
+	</select>
 </mapper>

+ 3 - 3
src/main/webapp/WEB-INF/tags/sys/gridselectClientLink.tag

@@ -22,7 +22,7 @@
 function searchGrid${id}(){
     var uri = "${url}?clientType=3";
 	top.layer.open({
-	    type: 2,  
+	    type: 2,
 	    area: ['90%','90%'],
 	    title:"${title}",
 	    name:'friend',
@@ -40,7 +40,7 @@ function searchGrid${id}(){
 			 top.layer.close(index);//关闭对话框。
            	 setClientInfo(item);
 		  },
-		  cancel: function(index){ 
+		  cancel: function(index){
 	       }
 	});
 
@@ -54,6 +54,6 @@ function searchGrid${id}(){
        		 <span class="input-group-btn">
 	       		 <a href=javascript:void(0); style="font-size:14px;" onclick="searchGrid${id}($('#${id}Id').val(),'${id}')" id="${id}Button"  class="nav-btn nav-btn-add"><i class="fa fa-search-plus"></i> 添加项目信息</a>
        		 </span>
-       		
+
     </div>
 	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

BIN
src/main/webapp/dot/批量归档导入模板.xlsx


+ 3 - 3
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchApply.jsp

@@ -18,7 +18,7 @@
                 $("#inputForm").submit();
                 return true;
             }
-	
+
 		  return false;
 		}
 		function listTr(obj){
@@ -169,7 +169,7 @@
 													// "</td>"+
 													"<td style=\"text-align: center;position: relative;\" width=\"20%\">" +
 													"<input name='proInfoType' style='text-align: center' readonly='true' class=\"form-control\" value='"+value.proInfoType+"'/></td>"+
-													"<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='proInfoName' style='text-align: center' class=\"form-control required\" value='"+value.proInfoName+"'/></td>"+
+													"<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='proInfoName' style='text-align: center' class=\"form-control\" value='"+value.proInfoName+"'/></td>"+
 													"<td style=\"text-align: center\" width=\"20%\"></td>"+
 													"<td width=\"20%\" style='padding-top : 8px;'>" +
 													"<span href=javascript:void(0); onclick=\"addRowInfoForm("+tid+","+id+")\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
@@ -434,4 +434,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 145 - 2
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchForm.jsp

@@ -315,6 +315,136 @@
 
         });
 
+        function uploadFile(id){
+                top.layer.open({
+                    type: 1,
+                    area: [500, 300],
+                    title:"导入数据",
+                    skin: 'three-btns with-demo',
+                    content:$("#importBox").html() ,
+                    btn: ['下载模板','确定', '关闭'],
+                    btn1: function(index, layero){
+                        window.location.href='${ctx}/projectFilingBatch/projectFilingBatchInfo/import/template';
+                    },
+                    btn2: function(index, layero){
+                        $.ajax({
+                            url : '${ctx}/projectFilingBatch/projectFilingBatchInfo/import',
+                            type : "post",
+                            async:false,
+                            cache: false,        // 不缓存数据
+                            processData: false,  // 不处理数据
+                            contentType: false,   // 不设置内容类型
+                            data : new FormData(top.$("#importForm")[0]),
+                            success : function(data) {
+                                //导入文件处理结果
+                                if (data.success){
+                                    for(var i=0;i<data.projectIdList.length;i++){
+                                        var arr=data.projectIdList[i];
+                                        $.ajax({
+                                            url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/getProjectByProjectId",
+                                            async:false,
+                                            data:{
+                                                "projectId":arr
+                                            },
+                                            type:"post",
+                                            success:function (d) {
+                                                var id="projectList_"+d.id;
+                                                var pid="project_"+d.id;
+                                                var tid="project_"+d.id+"_proId";
+                                                edit=tid;
+                                                editId=id;
+                                                var inId="#"+tid;
+                                                var size=$("#projectList .rowSize").size();
+                                                var flag=true;
+                                                var dd=$(inId).val();
+                                                for (var i=0;i<size;i++){
+                                                    if (dd==d.id){
+                                                        flag=false;
+                                                    }
+                                                }
+                                                if(flag) {
+                                                    $("#projectList").append("<tr class='rowSize' onclick='listTr(this)'>" +
+                                                        "<td><span class='default_shut' style=\"padding-right: 15px; \"></span><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + d.id + "><input type=\"hidden\" name=\"projectid\" value=" + d.id + ">" + d.projectId + "</td>" +
+                                                        "<td>" + d.projectName + "</td>" +
+                                                        "<td>" + d.projectReportNumber + "</td>" +
+                                                        "<td class=\"text-center op-td\" >" +
+                                                        "<span class=\"op-btn op-btn-add\" onclick=\"addRowInfoForm("+tid+","+id+")\" title=\"添加\"><i class=\"fa fa-plus\"></i>&nbsp;添加</span>" +
+                                                        "<span class=\"op-btn op-btn-delete\" onclick=\"delListRow(this," + id + ")\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                                                        "</td>" +
+                                                        "</tr>")
+                                                    $("#projectList").append("<tr class='"+d.id+"' style='display: none;'> <td colspan='4' style='padding: 0px;'>" +
+                                                        "<table style=\"width: 100%;padding: 0px;margin: 0px;\" class=\"table table-bordered table-condensed details\">" +
+                                                        "<tbody id='" + id + "'>" +
+                                                        "</tbody>" +
+                                                        "<input type='text' id='" + id + "_len' style='display: none;' name='flags' />"+
+                                                        "</table>" +
+                                                        "</td></tr>")
+                                                }
+                                            }
+                                        });
+
+                                        var tbodyId="#projectList_"+arr;
+                                        var JsonId=".projectList_"+arr;
+                                        var jsonInput=JsonId+"_json"
+
+                                        $.ajax({
+                                            type:'post',
+                                            async:false,
+                                            url:'${ctx}/projectFilingBatch/projectFilingBatchInfo/getImportDescendantsInfo',
+                                            data:{
+                                                "key":data.uuid+"_"+arr
+                                            },
+                                            success:function(result){
+                                                if (result.success){
+                                                    $(tbodyId).html("")
+                                                    for (var i=0;i<result.infoList.length;i++){
+                                                        var info = result.infoList[i]
+                                                        var infoStr = result.infoStrList[i]
+                                                        //var s=$(body).find("#file_attachment tr").eq(i).html();
+                                                        //var name=names[i];
+                                                        //var type=types[i];
+                                                        //var proJson=proJsons[i];
+                                                        $(tbodyId).append(
+                                                            "<tr class='listInfo'>"+
+                                                            "<td style=\"text-align: center;position: relative;\" width=\"20%\">" +
+                                                            "<input  readonly='true' name='ProInfoType' style='text-align: center'  class=\"form-control required\" value='"+info.types+"'></td>"+
+                                                            "<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='ProInfoName' style='text-align: center' class=\"form-control\" value='"+info.names+"'></input></td>"+
+                                                            "<td style=\"text-align: center\" width=\"20%\"></td>"+
+                                                            "<td width=\"20%\">" +
+                                                            "<span href=javascript:void(0); onclick=\"addRowInfoForm("+edit+","+editId+")\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
+                                                            "<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                                                            "<input type='text' class='" + jsonInput + "'  name='proInfos' style='display: none;' value='"+infoStr+"' />"+
+                                                            "</td>"+
+                                                            "</tr>"
+                                                        )
+                                                    }
+                                                }
+                                            }
+                                        });
+
+
+
+                                    }
+
+
+
+
+
+
+                                    parent.layer.msg(data.msg, {icon: 1});
+                                }else {
+                                    parent.layer.msg(data.msg, {icon: 2});
+                                }
+                            }
+                        });
+                    },
+
+                    btn3: function(index){
+                        top.layer.close(index);
+                    }
+                });
+        }
+
 
         function setContractValue(obj){
             var clientId = $("#contractClientId").val();
@@ -981,7 +1111,14 @@
     </script>
 </head>
 <body>
-
+<div id="importBox" class="hide">
+    <form id="importForm" style="padding-left:20px;text-align:center;" method="post" enctype="multipart/form-data"><br/>
+        <input  value="" id="file" name="file"  type="file"  style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>  
+        <div>
+            <input type="hidden"  name ="id" id="id"/>
+        </div>
+    </form>
+</div>
 <div class="single-form">
     <div class="container">
         <sys:message content="${message}"/>
@@ -1019,10 +1156,16 @@
 
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>归档项目信息</h2></div>
-                <div class="layui-item nav-btns">
+                <div class="layui-item nav-btns" style="float: left;width: 100px">
                     <sys:gridselectClientLink url="${ctx}/projectFilingBatch/projectFilingBatchInfo/finishListShow" id="constructionOrgList"   title="选择项目"
                                               cssClass="form-control required" fieldLabels="${fns:urlEncode('项目编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientLink>
+
                 </div>
+                <div id="addUserButton" class="layui-item nav-btns" style="float: left;">
+                    <a href=javascript:void(0); style="font-size:14px;" onclick="uploadFile()" id="btnImport"  class="nav-btn nav-btn-add"> 导入</a>
+                </div>
+
+
                 <input id="attachment_file" type="file" name="attachment_file" onclick="addFile()" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTable2" class="table table-bordered table-condensed details tree_table">

+ 32 - 11
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

@@ -1011,7 +1011,7 @@
 												cssStyle="background-color:#fff" title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false" />
 							</div>
 						</div>
-						<div class="layui-item query athird">
+						<%--<div class="layui-item query athird">
 							<label class="layui-form-label">工程类别:</label>
 							<div class="layui-input-block">
 								<input id="demo100" value="${engineeringInfo.engineeringName}" readonly="true" style="background-color: #fff" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
@@ -1049,7 +1049,7 @@
 							<div class="layui-input-block">
 								<input id="workContractInfoClientName" name="workContractInfo.client.name" value="${workContractInfoClientName}" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
-						</div>
+						</div>--%>
 						<div class="layui-item query athird ">
 							<label class="layui-form-label">创建时间:</label>
 							<div class="layui-input-block readOnlyFFF">
@@ -1062,7 +1062,29 @@
 								</input>
 							</div>
 						</div>
+
 						<div class="layui-item query athird ">
+							<label class="layui-form-label double-line">审定单申请:</label>
+							<div class="layui-input-block readOnlyFFF">
+								<form:select path="approvalSignatureStatus" class="form-control  simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getDictList('signature_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+
+						<div class="layui-item query athird ">
+							<label class="layui-form-label double-line">报告签章申请:</label>
+							<div class="layui-input-block readOnlyFFF">
+								<form:select path="reportSignatureStatus" class="form-control  simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getDictList('signature_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+
+
+						<%--<div class="layui-item query athird ">
 							<label class="layui-form-label double-line">复核状态:</label>
 							<div class="layui-input-block readOnlyFFF">
 								<form:select path="projectReportStatus" class="form-control  simple-select">
@@ -1097,7 +1119,6 @@
 									<form:option value="0" label="未归档"/>
 									<form:option value="2" label="归档中"/>
 									<form:option value="5" label="已归档"/>
-									<%--									<form:options items="${fns:getDictList('rural_report_audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
 								</form:select>
 							</div>
 						</div>
@@ -1120,7 +1141,7 @@
 									</c:forEach>
 								</form:select>
 							</div>
-						</div>
+						</div>--%>
 						<div class="layui-item query athird ">
 							<label class="layui-form-label double-line">项目等级:</label>
 							<div class="layui-input-block readOnlyFFF">
@@ -1157,9 +1178,9 @@
 							<a href="javascript:void(0)" style='background-color: #FFB800' onclick="downloadDialogre('上报信息导出', '${ctx}/ruralProject/ruralProjectMessageAll/skipDownloadReportedForm','40%', '70%','','下载,关闭')" class="layui-btn layui-btn-sm layui-bg-blue" > 上报信息导出</a>
 						</shiro:hasPermission>
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
-						<div class=" layui-btn-sm" style="float: right;width: 300px">
+						<%--<div class=" layui-btn-sm" style="float: right;width: 300px">
 							<span style="color: red">咨询营业收入:${moneyAll}(万元)</span>
-						</div>
+						</div>--%>
 					</div>
 					<shiro:hasPermission name="ruralProject:ruralCostProjectMessage:reportSwitch">
 						<div style="float: right;margin-right: 30px;">
@@ -1249,7 +1270,7 @@
 						}
 						<%--return "<a class=\"attention-info\" title=\"" + d.projectReportNumber + "\" href=\"javascript:void(0);\" onclick=\"openDialogReportView('查看报告信息', '${ctx}/ruralProject/ruralCostProjectMessage/modify?projectId=" + d.id + "&view=view&reportedId="+d.id+"','"+ d.id +"','95%', '95%')\">" + d.projectReportNumber + "</a>";--%>
 					}}
-				,{field:'contract', align:'center',title: '合同名称',minWidth:250,templet:function(d){
+				/*,{field:'contract', align:'center',title: '合同名称',minWidth:250,templet:function(d){
 						if(""!= d.contract && null!= d.contract ){
 							return "<a class=\"attention-info pid\" title=\""+d.contract+"\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/workcontractinfo/workContractInfo/lookForm?id=" + d.contractId + "','95%', '95%')\">" + d.contract + "</a>";
 							// return d.contractName;
@@ -1257,14 +1278,14 @@
 							return "<span title='暂无合同'  style='color: #FF5722'>暂无合同</span>";
 						}
 					<%--return "<a class=\"attention-info\" title=\""+d.contract+"\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/workcontractinfo/workContractInfo/lookForm?id=" + d.contractId + "','95%', '95%')\">" + d.contract + "</a>";--%>
-					}}
+					}}*/
 				,{field: 'projMaster', align:'center', title: '责任人',width:100,templet: function(d){
 						return "<font style = 'font-size:14px;'>"+d.projMaster+"</font>";
 					}}
-				,{field: 'client', align:'center', title: '委托方',width:250,templet: function(d){
+				/*,{field: 'client', align:'center', title: '委托方',width:250,templet: function(d){
 						return "<font style = 'font-size:14px;font-weight:500;'>"+d.client+"</font>";
-					}}
-                ,{field:'money',align:'center', title: '咨询营业收入(万元)',  width:140}
+					}}*/
+                /*,{field:'money',align:'center', title: '咨询营业收入(万元)',  width:140}*/
                 ,{field:'createName',align:'center', title: '登记人',  width:80}
                 ,{field: 'createDate', align:'center', title: '创建日期/打包时间',width:140,templet: function(d){
 					var date=d.createDate;