Browse Source

子项目列表导入功能开发

user5 4 years ago
parent
commit
5cc40d2b92

+ 24 - 0
src/main/java/com/jeeplus/common/utils/ThisLocalityDownloadUtil.java

@@ -59,4 +59,28 @@ public class ThisLocalityDownloadUtil {
         response.setContentType("application/octet-stream;charset=utf-8");
         response.setCharacterEncoding("UTF-8");
     }
+
+    public void downloadFileTemplate( String fileName,HttpServletRequest request, HttpServletResponse response) {
+        try {
+            //读取服务器的文件下载路径
+            String paths = this.getClass().getResource("/").getPath();
+            String filePath = paths.substring(1, paths.length() - 16);
+            System.out.println("===========os.name:"+System.getProperties().getProperty("os.name"));
+            String path = "";
+            path = this.getClass().getResource("/").getPath()+"template/"+fileName;
+            downCfg(fileName, request, response);
+            OutputStream out;
+            FileInputStream inputStream = new FileInputStream(path);
+            out = response.getOutputStream();
+            byte[] buffer = new byte[1024];
+            int len;
+            while ((len = inputStream.read(buffer)) != -1) {
+                out.write(buffer, 0, len);
+            }
+            inputStream.close();
+            out.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 4 - 1
src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryService.java

@@ -257,6 +257,7 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
      */
     @Transactional(readOnly = false)
     public void saveWorkAttachment(ProjectAccessoryTree projectAccessory){
+        long t1 = System.currentTimeMillis();
         //判断附件信息是否为空
         if(null != projectAccessory.getWorkAttachments()){
             for (WorkClientAttachment workClientAttachment : projectAccessory.getWorkAttachments()) {
@@ -283,5 +284,7 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
                 }
             }
         }
+        long t2 = System.currentTimeMillis();
+        System.out.println("上传文件service层消耗时间:" + (t2-t1));
     }
-}
+}

+ 4 - 0
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java

@@ -400,6 +400,7 @@ public class ProjectAccessoryController extends BaseController {
 	@RequestMapping("saveWorkAttachment")
 	@ResponseBody
 	public Object saveWorkAttachment(ProjectAccessoryTree projectAccessory){
+		long t1 = System.currentTimeMillis();
 		Map<String,Object> map = new HashMap<>();
 		//新增修改删除附件信息
 		projectAccessoryService.saveWorkAttachment(projectAccessory);
@@ -408,6 +409,9 @@ public class ProjectAccessoryController extends BaseController {
 		}else{
 			map.put("str","");
 		}
+
+		long t2 = System.currentTimeMillis();
+		System.out.println("上传文件controller层消耗时间:" + (t2-t1));
 		return map;
 	}
 }

+ 7 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/SubProjectInfoDao.java

@@ -24,4 +24,11 @@ public interface SubProjectInfoDao extends CrudDao<SubProjectInfo> {
      * @param parentProId
      */
     void deleteByParentProId(String parentProId);
+
+    /**
+     * 根据父项目id和项目定义号查询是否存在项目的项目信息
+     * @param subProjectInfo
+     * @return
+     */
+    SubProjectInfo getByParentIdAndProjectId(SubProjectInfo subProjectInfo);
 }

+ 57 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/SubProjectInfo.java

@@ -1,6 +1,7 @@
 package com.jeeplus.modules.ruralprojectrecords.entity;
 
 import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Workattachment;
 
@@ -16,6 +17,7 @@ import java.util.List;
 public class SubProjectInfo extends DataEntity<SubProjectInfo> {
 
     private static final long serialVersionUID = 1L;
+    private Integer index;
     private String projectId;//主键,项目定义号
     private String parentProId;//父项目id
     private String projectName;//项目名称
@@ -73,6 +75,16 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
 
     private String projectType;//父项目类型
 
+    @ExcelField(title="项目定义号", align=2, sort=1)
+    public Integer getIndex() {
+        return index;
+    }
+
+    public void setIndex(Integer index) {
+        this.index = index;
+    }
+
+    @ExcelField(title="项目定义号", align=2, sort=2)
     public String getProjectId() {
         return projectId;
     }
@@ -89,6 +101,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.parentProId = parentProId;
     }
 
+    @ExcelField(title="项目名称", align=2, sort=3)
     public String getProjectName() {
         return projectName;
     }
@@ -97,6 +110,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.projectName = projectName;
     }
 
+    @ExcelField(title="单体工程wbs编号", align=2, sort=4)
     public String getWbsNum() {
         return wbsNum;
     }
@@ -105,6 +119,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.wbsNum = wbsNum;
     }
 
+    @ExcelField(title="工程编号", align=2, sort=5)
     public String getProgrammeId() {
         return programmeId;
     }
@@ -113,6 +128,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.programmeId = programmeId;
     }
 
+    @ExcelField(title="工程名称", align=2, sort=6)
     public String getProgrammeName() {
         return programmeName;
     }
@@ -121,6 +137,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.programmeName = programmeName;
     }
 
+    @ExcelField(title="审计项目类型", align=2, sort=7)
     public String getAuditItemsType() {
         return auditItemsType;
     }
@@ -129,6 +146,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.auditItemsType = auditItemsType;
     }
 
+    @ExcelField(title="电压等级", align=2, sort=8)
     public String getVoltageLevel() {
         return voltageLevel;
     }
@@ -137,6 +155,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.voltageLevel = voltageLevel;
     }
 
+    @ExcelField(title="现场联系人", align=2, sort=9)
     public String getOnSiteContact() {
         return onSiteContact;
     }
@@ -145,6 +164,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.onSiteContact = onSiteContact;
     }
 
+    @ExcelField(title="联系电话", align=2, sort=10)
     public String getContactNumber() {
         return contactNumber;
     }
@@ -153,6 +173,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.contactNumber = contactNumber;
     }
 
+    @ExcelField(title="实际开工时间", align=2, sort=11)
     public Date getActualStartTime() {
         return actualStartTime;
     }
@@ -161,6 +182,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.actualStartTime = actualStartTime;
     }
 
+    @ExcelField(title="实际竣工时间", align=2, sort=12)
     public Date getActualEndTime() {
         return actualEndTime;
     }
@@ -169,6 +191,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.actualEndTime = actualEndTime;
     }
 
+    @ExcelField(title="施工单位名称", align=2, sort=13)
     public String getConstructionUnit() {
         return constructionUnit;
     }
@@ -177,6 +200,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.constructionUnit = constructionUnit;
     }
 
+    @ExcelField(title="合同编号", align=2, sort=14)
     public String getContractId() {
         return contractId;
     }
@@ -185,6 +209,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.contractId = contractId;
     }
 
+    @ExcelField(title="合同金额", align=2, sort=15)
     public Double getContractSum() {
         return contractSum;
     }
@@ -193,6 +218,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.contractSum = contractSum;
     }
 
+    @ExcelField(title="计划开工时间", align=2, sort=16)
     public Date getPlanStartTime() {
         return planStartTime;
     }
@@ -201,6 +227,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.planStartTime = planStartTime;
     }
 
+    @ExcelField(title="计划竣工时间", align=2, sort=17)
     public Date getPlanEndTime() {
         return planEndTime;
     }
@@ -209,6 +236,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.planEndTime = planEndTime;
     }
 
+    @ExcelField(title="结算折扣率", align=2, sort=18)
     public Double getSettleDiscountRate() {
         return settleDiscountRate;
     }
@@ -217,6 +245,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.settleDiscountRate = settleDiscountRate;
     }
 
+    @ExcelField(title="土建结算送审金额(元)下浮后金额", align=2, sort=19)
     public Double getCivilSubmitSum() {
         return civilSubmitSum;
     }
@@ -225,6 +254,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.civilSubmitSum = civilSubmitSum;
     }
 
+    @ExcelField(title="安装结算送审金额(元)下浮后金额", align=2, sort=20)
     public Double getInstallSubmitSum() {
         return installSubmitSum;
     }
@@ -233,6 +263,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.installSubmitSum = installSubmitSum;
     }
 
+    @ExcelField(title="施工费送审金额小计(元)下浮后金额", align=2, sort=21)
     public Double getBuildSubmitSum() {
         return buildSubmitSum;
     }
@@ -241,6 +272,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.buildSubmitSum = buildSubmitSum;
     }
 
+    @ExcelField(title="甲供材送审金额(元)结算书中的物资金额", align=2, sort=22)
     public Double getMaterialSubmitSum() {
         return materialSubmitSum;
     }
@@ -249,6 +281,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.materialSubmitSum = materialSubmitSum;
     }
 
+    @ExcelField(title="土建结算审定金额(元)下浮后金额", align=2, sort=23)
     public Double getCivilAuthorizeSum() {
         return civilAuthorizeSum;
     }
@@ -257,6 +290,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.civilAuthorizeSum = civilAuthorizeSum;
     }
 
+    @ExcelField(title="安装结算审定金额(元)下浮后金额", align=2, sort=24)
     public Double getInstallAuthorizeSum() {
         return installAuthorizeSum;
     }
@@ -265,6 +299,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.installAuthorizeSum = installAuthorizeSum;
     }
 
+    @ExcelField(title="施工费审定金额小计(元)下浮后金额", align=2, sort=25)
     public Double getBuildAuthorizeSum() {
         return buildAuthorizeSum;
     }
@@ -273,6 +308,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.buildAuthorizeSum = buildAuthorizeSum;
     }
 
+    @ExcelField(title="甲供材审定金额(元)", align=2, sort=26)
     public Double getMaterialAuthorizeSum() {
         return materialAuthorizeSum;
     }
@@ -281,6 +317,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.materialAuthorizeSum = materialAuthorizeSum;
     }
 
+    @ExcelField(title="施工费核减金额(元)", align=2, sort=27)
     public Double getBuildDiscountSum() {
         return buildDiscountSum;
     }
@@ -289,6 +326,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.buildDiscountSum = buildDiscountSum;
     }
 
+    @ExcelField(title="施工费核减率(%)", align=2, sort=28)
     public Double getBuildDiscountRate() {
         return buildDiscountRate;
     }
@@ -297,6 +335,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.buildDiscountRate = buildDiscountRate;
     }
 
+    @ExcelField(title="施工单位诚信扣款(元)", align=2, sort=29)
     public Double getCreditDeduction() {
         return creditDeduction;
     }
@@ -305,6 +344,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.creditDeduction = creditDeduction;
     }
 
+    @ExcelField(title="建议结算款(元)", align=2, sort=30)
     public Double getSuggestedSettlement() {
         return suggestedSettlement;
     }
@@ -313,6 +353,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.suggestedSettlement = suggestedSettlement;
     }
 
+    @ExcelField(title="是否查看现场(必填),填是或者否", align=2, sort=31)
     public String getHasViewScene() {
         return hasViewScene;
     }
@@ -321,6 +362,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.hasViewScene = hasViewScene;
     }
 
+    @ExcelField(title="审计费(元)", align=2, sort=32)
     public Double getAuditFee() {
         return auditFee;
     }
@@ -329,6 +371,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.auditFee = auditFee;
     }
 
+    @ExcelField(title="审计部下发意见文号", align=2, sort=33)
     public String getOptionNum() {
         return optionNum;
     }
@@ -337,6 +380,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.optionNum = optionNum;
     }
 
+    @ExcelField(title="事务所审计报告号(必填)", align=2, sort=34)
     public String getOfficeReportNo() {
         return officeReportNo;
     }
@@ -345,6 +389,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.officeReportNo = officeReportNo;
     }
 
+    @ExcelField(title="事务所名称", align=2, sort=35)
     public String getOfficeName() {
         return officeName;
     }
@@ -353,6 +398,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.officeName = officeName;
     }
 
+    @ExcelField(title="事务所审计人员", align=2, sort=36)
     public String getOfficeAuditor() {
         return officeAuditor;
     }
@@ -361,6 +407,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.officeAuditor = officeAuditor;
     }
 
+    @ExcelField(title="打包时间", align=2, sort=37)
     public Date getPackTime() {
         return packTime;
     }
@@ -369,6 +416,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.packTime = packTime;
     }
 
+    @ExcelField(title="审计应结束时间", align=2, sort=38)
     public Date getPlanAuditTime() {
         return planAuditTime;
     }
@@ -377,6 +425,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.planAuditTime = planAuditTime;
     }
 
+    @ExcelField(title="审计方式", align=2, sort=39)
     public String getAuditType() {
         return auditType;
     }
@@ -386,6 +435,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
     }
 
     @Override
+    @ExcelField(title="备注", align=2, sort=40)
     public String getRemarks() {
         return remarks;
     }
@@ -395,6 +445,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.remarks = remarks;
     }
 
+    @ExcelField(title="审计专职", align=2, sort=41)
     public String getAuditProfessional() {
         return auditProfessional;
     }
@@ -403,6 +454,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.auditProfessional = auditProfessional;
     }
 
+    @ExcelField(title="提交送审日期", align=2, sort=42)
     public Date getSubmitApprovalTime() {
         return submitApprovalTime;
     }
@@ -411,6 +463,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.submitApprovalTime = submitApprovalTime;
     }
 
+    @ExcelField(title="送审人", align=2, sort=43)
     public String getSubmitApprovalMan() {
         return submitApprovalMan;
     }
@@ -419,6 +472,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.submitApprovalMan = submitApprovalMan;
     }
 
+    @ExcelField(title="送审部门", align=2, sort=44)
     public String getSubmitApprovalDepartment() {
         return submitApprovalDepartment;
     }
@@ -427,6 +481,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.submitApprovalDepartment = submitApprovalDepartment;
     }
 
+    @ExcelField(title="二级单位", align=2, sort=45)
     public String getSecondaryUnit() {
         return secondaryUnit;
     }
@@ -435,6 +490,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.secondaryUnit = secondaryUnit;
     }
 
+    @ExcelField(title="一级单位", align=2, sort=46)
     public String getFirstLevelUnit() {
         return firstLevelUnit;
     }
@@ -443,6 +499,7 @@ public class SubProjectInfo extends DataEntity<SubProjectInfo> {
         this.firstLevelUnit = firstLevelUnit;
     }
 
+    @ExcelField(title="送审单ID(勿动)", align=2, sort=47)
     public String getSubmissionFormId() {
         return submissionFormId;
     }

+ 20 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/SubProjectInfoService.java

@@ -9,6 +9,7 @@ import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.ruralprojectrecords.dao.SubProjectInfoDao;
@@ -815,4 +816,23 @@ public class SubProjectInfoService extends CrudService<SubProjectInfoDao, SubPro
         return map;
     }
 
+    @Transactional(readOnly = false)
+    public void saveList(List<SubProjectInfo> list){
+        for (SubProjectInfo info: list) {
+            info.setOffice(UserUtils.getSelectOffice());
+            info.setCompany(UserUtils.getSelectCompany());
+            //根据父项目id和项目定义号查询是否存在项目的项目信息
+            SubProjectInfo byParentIdAndProjectId = dao.getByParentIdAndProjectId(info);
+            if(null != byParentIdAndProjectId){
+                try {
+                    MyBeanUtils.copyBeanNotNull2Bean(byParentIdAndProjectId, info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+
+            super.save(info);
+        }
+    }
+
 }

+ 51 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/SubProjectInfoController.java

@@ -5,6 +5,8 @@ import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
+import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -15,15 +17,15 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageServic
 import com.jeeplus.modules.ruralprojectrecords.service.SubProjectInfoService;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -232,4 +234,49 @@ public class SubProjectInfoController extends BaseController {
         return map;
     }
 
+
+
+    /**
+     * 下载导入设计概算编制审核调整数据模板
+     */
+    @RequestMapping(value = "importTable/template")
+    public String importFileTemplate(HttpServletResponse response, HttpServletRequest request) {
+        try {
+            ThisLocalityDownloadUtil download = new ThisLocalityDownloadUtil();
+            download.downloadFileTemplate("项目审计审定数据表.xls",request,response);
+        } catch (Exception e) {
+            logger.error("项目审计审定数据表模板下载失败!",e);
+        }
+        return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectView/list/?repage";
+    }
+
+
+    /**
+     * 导入Excel数据
+     */
+    @ResponseBody
+    @RequestMapping(value = "importTable", method= RequestMethod.POST)
+    public Object importTable(MultipartFile file,String parentId) {
+        ResponseEntity<SubProjectInfo> responseEntity = new ResponseEntity<>();
+        try {
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<SubProjectInfo> list = ei.getDataList(SubProjectInfo.class);
+            List<SubProjectInfo> listAll = new ArrayList<>();
+            for (SubProjectInfo info : list) {
+                if(StringUtils.isNotBlank(info.getProjectId()) && StringUtils.isNotBlank(info.getProjectName())){
+                    info.setParentProId(parentId);
+                    listAll.add(info);
+                }
+            }
+            responseEntity.setData(listAll);
+            subProjectInfoService.saveList(listAll);
+            responseEntity.setMessage("子项目导入成功!");
+        } catch (Exception e) {
+            logger.error("子项目导入失败!",e);
+            responseEntity.setCode(400);
+            responseEntity.setMessage("子项目导入失败!"+e.getMessage());
+        }
+        return responseEntity;
+    }
+
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/workcontent/entity/WorkPreliminaryDesignEstimate.java

@@ -192,4 +192,4 @@ public class WorkPreliminaryDesignEstimate extends DataEntity<WorkPreliminaryDes
 	public void setType(String type) {
 		this.type = type;
 	}
-}
+}

+ 17 - 8
src/main/resources/mappings/modules/ruralprojectrecords/SubProjectInfoDao.xml

@@ -58,12 +58,12 @@
 		a.first_level_unit as "firstLevelUnit",
 		a.submission_form_id as "submissionFormId"
 	</sql>
-	
+
 	<sql id="projectRecordsJoins">
 		LEFT JOIN sys_user su ON su.id = a.create_by
 	</sql>
-	
-    
+
+
 	<select id="get" resultType="com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo" >
 		SELECT
 			<include refid="subProjectInfoColumns"/>
@@ -71,7 +71,16 @@
 		<include refid="projectRecordsJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
+	<select id="getByParentIdAndProjectId" resultType="com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo" >
+		SELECT
+			<include refid="subProjectInfoColumns"/>
+        FROM sub_project_info a
+		<include refid="projectRecordsJoins"/>
+		WHERE a.parent_pro_id = #{parentProId} and a.project_id = #{projectId}
+		and a.del_flag=0
+	</select>
+
 	<select id="findList" resultType="com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo" >
 		SELECT
 			<include refid="subProjectInfoColumns"/>
@@ -167,7 +176,7 @@
 			</if>
 		</where>
 	</select>
-	
+
 	<insert id="insert">
 		insert into sub_project_info (
 		  id,
@@ -285,7 +294,7 @@
 			#{company.id}
 		  )
 	</insert>
-	
+
 	<update id="update">
 		update
 		  sub_project_info
@@ -341,7 +350,7 @@
 		  submission_form_id = #{submissionFormId}
 		where id = #{id}
 	</update>
-	
+
 	<!--逻辑删除-->
 	<update id="delete">
 		UPDATE sub_project_info SET
@@ -352,4 +361,4 @@
 	<delete id="deleteByParentProId">
 		delete from sub_project_info where parent_pro_id = #{parentProId}
 	</delete>
-</mapper>
+</mapper>

BIN
src/main/resources/template/项目审计审定数据表.xls


+ 59 - 0
src/main/webapp/WEB-INF/tags/table/importExcelBySubProject.tag

@@ -0,0 +1,59 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="url" type="java.lang.String" required="true"%>
+<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入controller的url --%>
+<button id="btnImport" class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" title="导入"> 导入</button>
+<div id="importBox" class="hide">
+	<form id="importForm2" action="${url}" method="post" enctype="multipart/form-data" onsubmit="loading('正在导入,请稍等...');">
+		<br/>
+		<input id="uploadFile" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>  
+
+	</form>
+</div>
+<script type="text/javascript">
+	$(document).ready(function() {
+		$("#btnImport").click(function(){
+			top.layer.open({
+				type: 1,
+				area: [500, 300],
+				title:"导入数据",
+				content:$("#importBox").html() ,
+				btn: ['下载模板','确定', '关闭'],
+				btn1: function(index, layero){
+					var newUrl = '${url}';
+					var arr1=newUrl.split("?");
+					window.location.href=arr1[0]+'/template';
+				},
+				btn2: function(index, layero){
+					var formData = new FormData();
+					formData.append("file",top.$("#uploadFile")[0].files[0]);
+					$.ajax({
+						type: 'post',
+						url: "${url}",
+						data: formData,
+						dataType: "json",
+						cache: false,
+						processData: false,
+						contentType: false,
+					}).success(function (result) {
+						if(result.code == 0){
+							top.layer.msg(result.message, {icon: 1});
+							location.reload();
+							top.layer.close(index);
+						}else {
+							top.layer.msg(result.message, {icon: 0});
+						}
+					}).error(function () {
+						top.layer.msg("导入文件失败!");
+					});
+					top.layer.close(index);
+				},
+				btn3: function(index){
+					top.layer.close(index);
+				}
+			});
+		});
+
+	});
+
+</script>

+ 1 - 1
src/main/webapp/WEB-INF/tags/table/importExcelCost.tag

@@ -67,4 +67,4 @@
 
 	});
 
-</script>
+</script>

+ 70 - 0
src/main/webapp/webpage/modules/projectAccessory/selectCollectingAccessory.jsp

@@ -0,0 +1,70 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			$('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+				$('#contentTable tbody tr td input.i-checks').iCheck('check');
+			});
+
+			$('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+				$('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			});
+			$("#td4").addClass("hide");
+
+				var radioVal = ${extId};
+				if(radioVal == 1){
+					$("#td1").removeClass("hide");
+					$("#td2").removeClass("hide");
+					$("#td3").removeClass("hide");
+					$("#td4").addClass("hide");
+					$("#tr1").show()
+				}else{
+					$("#td1").addClass("hide");
+					$("#td2").addClass("hide");
+					$("#td3").addClass("hide");
+					$("#td4").removeClass("hide");
+					$("#tr1").hide()
+				}
+			});
+
+		function getSelectedItem() {
+			radio=0;
+			var reimburseRemarks = $("#reimburseRemarks").val();
+			if(reimburseRemarks == undefined || reimburseRemarks == null || reimburseRemarks == ''){
+				top.layer.msg("请输入报销详情")
+			}
+			return radio + "_item_" + reimburseRemarks;
+		}
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="obj" action="${url}" method="post" class="form-inline">
+					<input type="hidden" name="url" value="${url}"/>
+					<input type="hidden" name="isTotal" value="${isTotal}"/>
+					<input type="hidden" name="fieldLabels" value="${fieldLabels}"/>
+					<input type="hidden" name="fieldKeys" value="${fieldKeys}"/>
+					<input type="hidden" name="searchLabel" value="${searchLabel}"/>
+					<input type="hidden" name="searchKey" value="${searchKey}"/>
+					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<input id="extId" name="extid" type="hidden" value="${extId}"/>
+					<div class="layui-item layui-col-sm12 with-textarea">
+						<label class="layui-form-label"><span class="require-item">*</span>报销详情:</label>
+						<div class="layui-input-block">
+							<textarea  id="reimburseRemarks" name="reimburseRemarks" style="width: 100%" rows="7" class="form-control required" maxlength="255"></textarea>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 3 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm.jsp

@@ -1769,6 +1769,7 @@
 			}
 		});
 		if(validateForm.form()){
+			var t1=new Date().getTime();
 			$($document.getElementById(inputForm)).ajaxSubmit({
 				success:function(data) {
 					var d = data;
@@ -1776,6 +1777,8 @@
 					if(d.str.length>0){
 						parent.layer.msg(d.str,{icon:1});
 					}
+					var t2=new Date().getTime();
+					console.log(t2-t1);
 					//刷新当前模块
 					var reviewFee = $("#reviewFee").val();
 					$("#"+tableId).load(location.href+"&reviewFee="+reviewFee + " #"+tableId);

+ 3 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportModify.jsp

@@ -1610,6 +1610,7 @@
 			}
 		});
 		if(validateForm.form()){
+			var t1=new Date().getTime();
 			$($document.getElementById(inputForm)).ajaxSubmit({
 				success:function(data) {
 					var d = data;
@@ -1617,6 +1618,8 @@
 					if(d.str.length>0){
 						parent.layer.msg(d.str,{icon:1});
 					}
+					var t2=new Date().getTime();
+					console.log(t2-t1);
 					$("#"+tableId).load(location.href + " #"+tableId);
 					//关闭当前页
 					top.layer.close(index)

+ 35 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/subProjectInfo/subProjectInfoList.jsp

@@ -202,6 +202,36 @@
 			});
 		}
 
+		function btnImportTable(){
+			var parentProId = $("#parentProId").val();
+			top.layer.open({
+				type: 2,
+				area: ['25%', '50%'],
+				title: "上传文件",
+				content: "${ctx}/subProject/subProject/exportTableFile?parentProId="+parentProId+"&projectType=${subProjectInfo.projectType}",
+				//  btn: ['确定', '关闭'],
+				yes: function (index, layero) {
+					var body = top.layer.getChildFrame('body', index);
+					var inputForm = body.find('#inputForm');
+					var top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					inputForm.validate();
+					if (inputForm.valid()) {
+						loading("正在提交,请稍等...");
+						inputForm.submit();
+					} else {
+						return;
+					}
+					top.layer.close(index);//关闭对话框。
+				},
+				cancel: function (index) {
+				}
+				,end: function () {
+					location.reload();
+				}
+			});
+		}
+
 	</script>
 	<style>
 		body{
@@ -320,7 +350,10 @@
 							<table:subProjectAddRow url="${ctx}/subProject/subProject/form?parentProId=${subProjectInfo.parentProId}" title="项目"></table:subProjectAddRow><!-- 增加按钮 -->
 						</shiro:hasPermission>
 						<shiro:hasPermission name="ruralProject:ruralProjectRecords:export">
-							<button id="btnImport" class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" onclick="btnImport()" title="导入">导入</button>
+							<table:importExcelBySubProject url="${ctx}/subProject/subProject/importTable?parentId=${subProjectInfo.parentProId}"></table:importExcelBySubProject><!-- 导入按钮 -->
+						</shiro:hasPermission>
+						<shiro:hasPermission name="ruralProject:ruralProjectRecords:export">
+							<button id="btnImport" class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" onclick="btnImport()" title="导入">导入压缩文件</button>
 						</shiro:hasPermission>
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新">&nbsp;刷新</button>
 					</div>
@@ -413,4 +446,4 @@
     });
 </script>
 </body>
-</html>
+</html>