Bladeren bron

informationcontroller requestmapping地址调整 完成
informationcontroller importcom方法遍历时候新建simpledateformat对象提到外面 完成
导入时将处理excel代码单独拎出来,保证controller方法功能单一,代码逻辑清晰 完成
import方法返回信息 成功条数 完成
materialcontroller updateinfo 完成
用replace into实现list批量插入更新完成,

yue 5 jaren geleden
bovenliggende
commit
c43ec66728

+ 119 - 9
src/main/java/com/jeeplus/modules/sg/information/entity/Information.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.sg.information.entity;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
 /**
@@ -17,25 +18,44 @@ public class Information extends DataEntity<Information>  {
 
 	//项目定义号
 	private String projectId;
-	//项目名称
+//	项目名称
 	private String projectName;
-	//送审部门
+//	项目类型
+	private String projectType;
+//	电压等级
+	private String projectGrade;
+//	项目预算年度
+	private String projectYear;
+//	项目总投资(元)
+	private Double projectTotal;
+//	实际开工日期
+	private Date projectStart;
+//	实际竣工日期
+	private Date projectStop;
+//	施工单位
 	private String department;
-	//审定日期
+//	事务所名称
+	private String projectFirm;
+//	提交送审日期
+	private Date subDate;
+//	审计任务下达日期
+	private Date releaseDate;
+//	审计应结束日时间
+	private Date endDate;
+//	结果上传时间
+	private Date resultDate;
+//	审定日期
 	private Date approvalDate;
-	//二级单位
+//	二级单位
 	private String secondUnits;
-	//一级单位
+//	一级单位
 	private String firstUnits;
 
 	public Information(){
 		super();
 	}
 
-	public Information(String id){
-		super(id);
-	}
-
+	@ExcelField(title="项目定义号", align=2, sort=1)
 	public String getProjectId() {
 		return projectId;
 	}
@@ -44,6 +64,7 @@ public class Information extends DataEntity<Information>  {
 		this.projectId = projectId;
 	}
 
+	@ExcelField(title="项目名称", align=2, sort=2)
 	public String getProjectName() {
 		return projectName;
 	}
@@ -85,4 +106,93 @@ public class Information extends DataEntity<Information>  {
 	public void setFirstUnits(String firstUnits) {
 		this.firstUnits = firstUnits;
 	}
+
+	public String getProjectType() {
+		return projectType;
+	}
+
+	public void setProjectType(String projectType) {
+		this.projectType = projectType;
+	}
+
+	public String getProjectGrade() {
+		return projectGrade;
+	}
+
+	public void setProjectGrade(String projectGrade) {
+		this.projectGrade = projectGrade;
+	}
+
+	public String getProjectYear() {
+		return projectYear;
+	}
+
+	public void setProjectYear(String projectYear) {
+		this.projectYear = projectYear;
+	}
+
+	public Double getProjectTotal() {
+		return projectTotal;
+	}
+
+	public void setProjectTotal(Double projectTotal) {
+		this.projectTotal = projectTotal;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getProjectStart() {
+		return projectStart;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public void setProjectStart(Date projectStart) {
+		this.projectStart = projectStart;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getProjectStop() {
+		return projectStop;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public void setProjectStop(Date projectStop) {
+		this.projectStop = projectStop;
+	}
+
+	public String getProjectFirm() {
+		return projectFirm;
+	}
+
+	public void setProjectFirm(String projectFirm) {
+		this.projectFirm = projectFirm;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getSubDate() {
+		return subDate;
+	}
+
+	public void setSubDate(Date subDate) {
+		this.subDate = subDate;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(Date releaseDate) {
+		this.releaseDate = releaseDate;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getResultDate() {
+		return resultDate;
+	}
+
+	public void setResultDate(Date resultDate) {
+		this.resultDate = resultDate;
+	}
+
 }

+ 12 - 0
src/main/java/com/jeeplus/modules/sg/information/mapper/InformationMapper.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.sg.information.mapper;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.information.entity.Information;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,7 +19,18 @@ import java.util.List;
 public interface InformationMapper extends BaseMapper<Information> {
     List<Information> findAllInformationList();
 
+    int insertInfor(Information information);
+
+    int successCount();
+
+    Information findListById(@Param("projectId") String projectId);
+
+    //    void save(List<Information> entity);
+    int saveInfo(@Param("information") List<Information> list);
+
     int updateInformationDate(Information information);
 
     Information findInformationByID(Information information);
+
+
 }

+ 249 - 41
src/main/java/com/jeeplus/modules/sg/information/mapper/xml/InformationMapper.xml

@@ -3,17 +3,183 @@
 <mapper namespace="com.jeeplus.modules.sg.information.mapper.InformationMapper">
 
     <sql id="informationColumns">
-		project_Id,
-		project_Name,
+		id,
+		project_id,
+		project_name,
+		project_type,
+		project_grade,
+		project_year,
+		project_total,
+		project_start,
+		project_stop,
 		department,
+		project_firm,
+		subDate,
+		releaseDate,
+		endDate,
+		resultDate,
 		approvalDate,
-		second_Units,
-		first_Units
+		second_units,
+		first_units
 	</sql>
     <select id="findAllInformationList" resultType="com.jeeplus.modules.sg.information.entity.Information">
 		select project_id,project_name from project_information
 	</select>
 
+    <insert id="insert">
+		INSERT INTO project_information(
+			id,
+			project_id,
+			project_name,
+			project_type,
+			project_grade,
+			project_year,
+			project_total,
+			project_start,
+			project_stop,
+			department,
+			project_firm,
+			subDate,
+			releaseDate,
+			endDate,
+			resultDate,
+			approvalDate,
+			second_units,
+			first_units,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag
+		) VALUES (
+			 #{id},
+			 #{projectId},
+			 #{projectName},
+			 #{projectType},
+			 #{projectGrade},
+			 #{projectYear},
+			 #{projectTotal},
+			 #{projectStart},
+			 #{projectStop},
+			 #{department},
+			 #{projectFirm},
+			 #{subDate},
+			 #{releaseDate},
+			 #{endDate},
+			 #{resultDate},
+			 #{approvalDate},
+			 #{secondUnits},
+			 #{firstUnits},
+			 #{createBy.id},
+			 #{createDate},
+			 #{updateBy.id},
+			 #{updateDate},
+			 #{delFlag}
+		)on duplicate key update
+		id=           #{id},
+		project_id=   #{projectId},
+		project_name= #{projectName},
+		project_type= #{projectType},
+		project_grade=#{projectGrade},
+		project_year= #{projectYear},
+		project_total=#{projectTotal},
+		project_start=#{projectStart},
+		project_stop= #{projectStop},
+		department=   #{department},
+		project_firm= #{projectFirm},
+		subDate=      #{subDate},
+		releaseDate=  #{releaseDate},
+		endDate=      #{endDate},
+		resultDate=   #{resultDate},
+		approvalDate= #{approvalDate},
+		second_units= #{secondUnits},
+		first_units=  #{firstUnits},
+		create_by = #{createBy.id},
+		create_date = #{createDate},
+		update_by = #{updateBy.id},
+		update_date = #{updateDate},
+		del_flag = #{delFlag}
+	</insert>
+
+	<select id="successCount" resultType="int">
+		select count(*) from project_information
+	</select>
+
+	<insert id="insertInfor">
+	INSERT INTO project_information(
+		id,
+		project_id,
+		project_name,
+		project_type,
+		project_grade,
+		project_year,
+		project_total,
+		project_start,
+		project_stop,
+		department,
+		project_firm,
+		subDate,
+		releaseDate,
+		endDate,
+		resultDate,
+		approvalDate,
+		second_units,
+		first_units,
+		create_by,
+		create_date,
+		update_by,
+		update_date,
+		del_flag
+	) VALUES (
+		 #{id},
+		 #{projectId},
+		 #{projectName},
+		 #{projectType},
+		 #{projectGrade},
+		 #{projectYear},
+		 #{projectTotal},
+		 #{projectStart},
+		 #{projectStop},
+		 #{department},
+		 #{projectFirm},
+		 #{subDate},
+		 #{releaseDate},
+		 #{endDate},
+		 #{resultDate},
+		 #{approvalDate},
+		 #{secondUnits},
+		 #{firstUnits},
+		 #{createBy.id},
+		 #{createDate},
+		 #{updateBy.id},
+		 #{updateDate},
+		 #{delFlag}
+	)on duplicate key update
+		id=           #{id},
+		project_id=   #{projectId},
+		project_name= #{projectName},
+		project_type= #{projectType},
+		project_grade=#{projectGrade},
+		project_year= #{projectYear},
+		project_total=#{projectTotal},
+		project_start=#{projectStart},
+		project_stop= #{projectStop},
+		department=   #{department},
+		project_firm= #{projectFirm},
+		subDate=      #{subDate},
+		releaseDate=  #{releaseDate},
+		endDate=      #{endDate},
+		resultDate=   #{resultDate},
+		approvalDate= #{approvalDate},
+		second_units= #{secondUnits},
+		first_units=  #{firstUnits},
+		create_by = #{createBy.id},
+		create_date = #{createDate},
+		update_by = #{updateBy.id},
+		update_date = #{updateDate},
+		del_flag = #{delFlag}
+	</insert>
+
     <update id="updateInformationDate" parameterType="com.jeeplus.modules.sg.information.entity.Information">
 		update project_information set
 		approvalDate = #{approvalDate}
@@ -73,44 +239,86 @@
         </choose>
     </select>
 
-    <insert id="insert">
-		INSERT INTO project_information(
-			id,
-			project_Id,
-			project_Name,
-			department,
-			second_Units,
-			first_Units,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			del_flag
-		) VALUES (
-			#{id},
-			#{projectId},
-			#{projectName},
-			#{department},
-			#{secondUnits},
-			#{firstUnits},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{delFlag}
-		)on duplicate key update
-			id = #{id},
-			project_Id = #{projectId},
-			project_Name = #{projectName},
-			department = #{department},
-			second_Units = #{secondUnits},
-			first_Units = #{firstUnits},
-			create_by = #{createBy.id},
-			create_date = #{createDate},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			del_flag = #{delFlag}
+    <insert id="saveInfo" parameterType="java.util.List">
+		replace into  project_information(
+		id,
+		project_id,
+		project_name,
+		project_type,
+		project_grade,
+		project_year,
+		project_total,
+		project_start,
+		project_stop,
+		department,
+		project_firm,
+		subDate,
+		releaseDate,
+		endDate,
+		resultDate,
+		approvalDate,
+		second_units,
+		first_units,
+		create_by,
+		create_date,
+		update_by,
+		update_date,
+		del_flag
+		) VALUES
+		<foreach collection="information" item="item" index="index" separator="," >
+		(
+			#{item.id},
+			#{item.projectId},
+			#{item.projectName},
+			#{item.projectType},
+			#{item.projectGrade},
+			#{item.projectYear},
+			#{item.projectTotal},
+			#{item.projectStart},
+			#{item.projectStop},
+			#{item.department},
+			#{item.projectFirm},
+			#{item.subDate},
+			#{item.releaseDate},
+			#{item.endDate},
+			#{item.resultDate},
+			#{item.approvalDate},
+			#{item.secondUnits},
+			#{item.firstUnits},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.delFlag}
+            )
+		</foreach>
 	</insert>
 
+	<select id="findListBy" resultType="com.jeeplus.modules.sg.information.entity.Information">
+			select
+			<include refid="informationColumns"/>
+			from project_information
+			where project_Id in
+			<foreach collection="list" item="information" index="index" open="(" separator="," close=")">
+				#{information.projectId}
+			</foreach>
+			<foreach collection="list" item="information" index="index">
+				<if test="information.projectName != null and information.projectName !='' ">
+				or
+				project_Name in (
+				SELECT project_Name from project_information where
+				<foreach collection="list" item="information" index="index" separator="or" >
+					<if test="information.projectName != null and information.projectName !='' ">
+					project_Name LIKE concat('%',#{information.projectName},'%')
+					</if>
+				</foreach>
+					)
+				</if>
+			</foreach>
+	</select>
+
+	<select id="findListById" resultType="com.jeeplus.modules.sg.information.entity.Information">
+		select project_id,project_name from project_information where project_Id=#{projectId}
+	</select>
 
 </mapper>

+ 33 - 1
src/main/java/com/jeeplus/modules/sg/information/service/InformationService.java

@@ -7,6 +7,7 @@ import java.util.List;
 
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.mapper.InformationMapper;
+import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -35,6 +36,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 		return super.findList(information);
 	}
 
+
 	public List<Information> findAllList(Information entity) {
 		return super.findAllList(entity);
 	}
@@ -43,9 +45,39 @@ public class InformationService extends CrudService<InformationMapper, Informati
 		return super.findPage(page, entity);
 	}
 
+	@Override
+	public List<Information> findListBy(List<Information> entity) {
+		return super.findListBy(entity);
+	}
+
+
+/*	@Transactional(readOnly = false)
+	public void insert(List<Information> entity) {
+		for (int i = 0; i < entity.size(); i++) {
+			if (entity.get(i).getIsNewRecord()) {
+				entity.get(i).preInsert();
+			}
+		}
+		informationMapper.save(entity);
+	}*/
+
+	public Information findListById(String projectId){
+		return informationMapper.findListById(projectId);
+	}
+
 	@Transactional(readOnly = false)
 	public void save(Information entity) {
-		super.save(entity);
+		entity.preInsert();
+		informationMapper.insert(entity);
+	}
+
+	@Transactional(readOnly = false)
+	public int saveInfo(List<Information> entity) {
+		return informationMapper.saveInfo(entity);
+	}
+
+	public int successCount() {
+		return informationMapper.successCount();
 	}
 
 	public  List<Information> findAllInformationList() {

+ 246 - 0
src/main/java/com/jeeplus/modules/sg/information/utils/ImportInformation.java

@@ -0,0 +1,246 @@
+package com.jeeplus.modules.sg.information.utils;
+
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.SpringContextHolder;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.modules.sg.information.entity.Information;
+import com.jeeplus.modules.sg.information.service.InformationService;
+import com.jeeplus.modules.sg.material.entity.Material;
+import com.jeeplus.modules.sg.material.service.MaterialService;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.validation.ConstraintViolationException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public  class ImportInformation {
+    @Autowired
+    private static InformationService informationService = SpringContextHolder.getBean(InformationService.class);
+    @Autowired
+    private static MaterialService materialService = SpringContextHolder.getBean(MaterialService.class);
+
+    public static Map<String,Object> importmation(ImportExcel ei,int lastDataRowNum){
+        HashMap<String,Object> hashMap = new HashMap<String,Object>();
+        int successNum = 0;
+        int failureNum = 0;
+        List<Information> informations = new ArrayList<Information>();
+        List<Material> materials = new ArrayList<Material>();
+        List<Material> errorMaterial = new ArrayList<Material>();
+        User user = UserUtils.getUser();
+        Double difference = 0.0;
+        for (int i = 1; i < lastDataRowNum; i++) {
+            Material material = new Material();
+            try {
+                Row row = ei.getRow(i);
+                Object projectId = ei.getCellValue(row, 1);
+//                Object projectName = ei.getCellValue(row, 2);
+                Object inforId = ei.getCellValue(row, 3);
+                Object materialName = ei.getCellValue(row, 4);
+                Object outboundAmount = ei.getCellValue(row, 5);
+                Object authorizedAmount = ei.getCellValue(row, 6);
+//                Object difference = ei.getCellValue(row, 7);
+                Object outboundNumber = ei.getCellValue(row, 8);
+                Object authorizedNumber = ei.getCellValue(row, 9);
+                Object price = ei.getCellValue(row, 11);
+                Object unit = ei.getCellValue(row, 12);
+                Object materialSmall = ei.getCellValue(row, 13);
+                Object materialMid = ei.getCellValue(row, 14);
+                Object materialBig = ei.getCellValue(row, 15);
+                Object Flag = ei.getCellValue(row, 10);
+/*                Object department = ei.getCellValue(row, 16);
+                Object secondUnits = ei.getCellValue(row, 17);
+                Object firstUnits = ei.getCellValue(row, 18);*/
+                String isBack = "";
+                if (Flag.equals("0")) {
+                    isBack = "是";
+                } else {
+                    isBack = "否";
+                }
+
+                if (outboundAmount.equals("")) {
+                    outboundAmount = "0.0";
+                }
+                if (authorizedAmount.equals("")) {
+                    authorizedAmount = "0.0";
+                }
+                if (outboundNumber.equals("")) {
+                    outboundNumber = "0.0";
+                }
+                if (authorizedNumber.equals("")) {
+                    authorizedNumber = "0.0";
+                }
+                if (price.equals("")) {
+                    price = "0.0";
+                }
+                difference = Double.parseDouble(outboundNumber.toString()) - Double.parseDouble(authorizedNumber.toString());
+
+                Material myMaterial = materialService.findByProIn(projectId.toString(), inforId.toString());
+                if (myMaterial != null) {
+                    if (myMaterial.getDifference() != Double.parseDouble(difference.toString())) {
+                        material.setInforId(inforId.toString());
+                        material.setProjectId(projectId.toString());
+                        material.setMaterialName(materialName.toString());
+                        material.setOutboundAmount(Double.parseDouble(outboundAmount.toString()));
+                        material.setAuthorizedAmount(Double.parseDouble(authorizedAmount.toString()));;
+                        material.setDifference(Double.parseDouble(difference.toString()));
+                        material.setOutboundNumber(Double.parseDouble(outboundNumber.toString()));
+                        material.setAuthorizedNumber(Double.parseDouble(authorizedNumber.toString()));
+                        material.setPrice(Double.parseDouble(price.toString()));
+                        material.setUnit(unit.toString());
+                        material.setMaterialSmall(materialSmall.toString());
+                        material.setMaterialMid(materialMid.toString());
+                        material.setMaterialBig(materialBig.toString());
+                        material.preInsert();
+                        material.setIsBack(isBack);
+                        material.setCreateBy(user);
+                        material.setCreateDate(new Date());
+                        material.setUpdateBy(user);
+                        material.setUpdateDate(new Date());
+                        errorMaterial.add(material);
+                    }
+                }
+
+
+                material.setInforId(inforId.toString());
+                material.setProjectId(projectId.toString());
+                material.setMaterialName(materialName.toString());
+                material.setOutboundAmount(Double.parseDouble(outboundAmount.toString()));
+                material.setAuthorizedAmount(Double.parseDouble(authorizedAmount.toString()));;
+                material.setDifference(Double.parseDouble(difference.toString()));
+                material.setOutboundNumber(Double.parseDouble(outboundNumber.toString()));
+                material.setAuthorizedNumber(Double.parseDouble(authorizedNumber.toString()));
+                material.setPrice(Double.parseDouble(price.toString()));
+                material.setUnit(unit.toString());
+                material.setMaterialSmall(materialSmall.toString());
+                material.setMaterialMid(materialMid.toString());
+                material.setMaterialBig(materialBig.toString());
+                material.preInsert();
+                material.setIsBack(isBack);
+                material.setCreateBy(user);
+                material.setCreateDate(new Date());
+                material.setUpdateBy(user);
+                material.setUpdateDate(new Date());
+                materials.add(material);
+
+                    successNum++;
+
+                if (materials.size() == 1000) {
+                    materialService.saveMater(materials);
+                    materials.clear();
+                }
+            }catch (Exception ex) {
+                ex.getMessage();
+                failureNum++;
+            }
+
+        }
+        if (materials.size() != 0) {
+            materialService.saveMater(materials);
+        }
+
+        hashMap.put("errorMaterial", errorMaterial);
+        hashMap.put("successNum",successNum);
+        hashMap.put("failureNum",failureNum);
+        return hashMap;
+    }
+
+    public static Map<String,Integer> importCom(ImportExcel ei,int lastDataRowNum) {
+        HashMap<String,Integer> hashMap = new HashMap<String,Integer>();
+        int successNum = 0;
+        int failureNum = 0;
+        int startNum = informationService.successCount();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        List<Information> informationList = new ArrayList<>();
+        User user = UserUtils.getUser();
+        for (int i = 2; i < lastDataRowNum; i++) {
+            Information information = new Information();
+            try {
+                Row row = ei.getRow(i);
+                Object projectId = ei.getCellValue(row, 1);
+                Object projectName = ei.getCellValue(row, 2);
+                Object projectType = ei.getCellValue(row, 3);
+                Object projectGrade = ei.getCellValue(row, 4);
+                Object projectYear = ei.getCellValue(row, 6);
+                Object projectTotal = ei.getCellValue(row, 7);
+                Object projectStart = ei.getCellValue(row, 14);
+                Object projectStop = ei.getCellValue(row, 15);
+                Object department = ei.getCellValue(row, 16);
+                Object projectFirm = ei.getCellValue(row, 38);
+                Object subDate = ei.getCellValue(row, 40);
+                Object releaseDate = ei.getCellValue(row, 41);
+                Object endDate = ei.getCellValue(row, 42);
+                Object resultDate = ei.getCellValue(row, 43);
+                Object approvalDate = ei.getCellValue(row, 44);
+                Object secondUnits = ei.getCellValue(row, 53);
+                Object firstUnits = ei.getCellValue(row, 54);
+
+
+                if (projectTotal.equals("")) {
+                    projectTotal = "0.0";
+                }
+                if (projectId.equals("")) {
+                    continue;
+                }
+                information.setProjectId(projectId.toString());
+                information.setProjectName(projectName.toString());
+                information.setProjectType(projectType.toString());
+                information.setProjectGrade(projectGrade.toString());
+                information.setProjectYear(projectYear.toString());
+                information.setProjectTotal(Double.parseDouble(projectTotal.toString()));
+                if (!projectStart.equals("")&&projectStart!=null) {
+                    information.setProjectStart(simpleDateFormat.parse(projectStart.toString()));
+                }
+                if (!projectStop.equals("")&&projectStop!=null) {
+                    information.setProjectStop(simpleDateFormat.parse(projectStop.toString()));
+                }
+                information.setDepartment(department.toString());
+                information.setProjectFirm(projectFirm.toString());
+                if (!subDate.equals("")&&subDate!=null) {
+                    information.setSubDate(simpleDateFormat.parse(subDate.toString()));
+                }
+                if (!releaseDate.equals("")&&releaseDate!=null) {
+                    information.setReleaseDate(simpleDateFormat.parse(releaseDate.toString()));
+                }
+                if (!endDate.equals("")&&endDate!=null) {
+                    information.setEndDate(simpleDateFormat.parse(endDate.toString()));
+                }
+                if (!resultDate.equals("")&&resultDate!=null) {
+                    information.setResultDate(simpleDateFormat.parse(resultDate.toString()));
+                }
+                if (!approvalDate.equals("")&&approvalDate!=null) {
+                    information.setApprovalDate(simpleDateFormat.parse(approvalDate.toString()));
+                }
+                information.setSecondUnits(secondUnits.toString());
+                information.setFirstUnits(firstUnits.toString());
+                information.preInsert();
+                information.setCreateBy(user);
+                information.setCreateDate(new Date());
+                information.setUpdateBy(user);
+                information.setUpdateDate(new Date());
+                informationList.add(information);
+
+                if (informationList.size() == 1000) {
+                    informationService.saveInfo(informationList);
+                    informationList.clear();
+                }
+            } catch (Exception ex) {
+                failureNum++;
+            }
+
+        }
+        if (informationList.size() != 0) {
+            informationService.saveInfo(informationList);
+        }
+        int successCount = informationService.successCount();
+        successNum = successCount - startNum;
+        hashMap.put("successNum",successNum);
+        hashMap.put("failureNum",failureNum);
+        return hashMap;
+    }
+
+
+
+}

+ 87 - 118
src/main/java/com/jeeplus/modules/sg/information/web/InformationController.java

@@ -3,21 +3,25 @@
  */
 package com.jeeplus.modules.sg.information.web;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.validation.ConstraintViolationException;
 
 
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.service.InformationService;
-import com.jeeplus.modules.sg.material.entity.Material;
+import com.jeeplus.modules.sg.information.utils.ImportInformation;
 import com.jeeplus.modules.sg.material.service.MaterialService;
+import io.swagger.models.auth.In;
 import org.apache.poi.ss.usermodel.Row;
+import org.h2.util.New;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.method.P;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -38,14 +42,14 @@ import com.jeeplus.common.utils.excel.ImportExcel;
  * @version
  */
 @Controller
-@RequestMapping(value = "${adminPath}/sg/information/information")
+@RequestMapping(value = "${adminPath}/sg/information")
 public class InformationController extends BaseController {
 
 	@Autowired
 	private InformationService informationService;
 	@Autowired
 	private MaterialService materialService;
-	
+
 	@ModelAttribute
 	public Information get(@RequestParam(required=false) String id) {
 		Information entity = null;
@@ -57,7 +61,7 @@ public class InformationController extends BaseController {
 		}
 		return entity;
 	}
-	
+
 	/**
 	 * 项目管理列表页
 	 */
@@ -67,7 +71,7 @@ public class InformationController extends BaseController {
 		model.addAttribute("informationList", information);
 		return "modules/sg/information/informationList";
 	}
-	
+
 		/**
 	 * 项目管理列表数据
 	 */
@@ -79,6 +83,7 @@ public class InformationController extends BaseController {
 		return getBootstrapData(page);
 	}
 
+
 	@RequestMapping(value = "form")
 	public String form(Information information, Model model) {
 		model.addAttribute("Information", information);
@@ -97,97 +102,28 @@ public class InformationController extends BaseController {
    	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
 		AjaxJson j = new AjaxJson();
 		try {
-			int successNum = 0;
-			int failureNum = 0;
-			int inforNum = 0;
+
 			StringBuilder failureMsg = new StringBuilder();
+			StringBuilder failInformation = new StringBuilder();
 			ImportExcel ei = new ImportExcel(file, 1, 0);
 //			List<Information> list = ei.getDataList(Information.class);
 			int lastDataRowNum = ei.getLastDataRowNum();
-			for (int i = 1; i < lastDataRowNum; i++) {
-				try {
-					Row row = ei.getRow(i);
-					Object projectId = ei.getCellValue(row, 1);
-					Object projectName = ei.getCellValue(row, 2);
-					Object inforId = ei.getCellValue(row, 3);
-					Object materialName = ei.getCellValue(row, 4);
-					Object outboundAmount = ei.getCellValue(row, 5);
-					Object authorizedAmount = ei.getCellValue(row, 6);
-					Object difference = ei.getCellValue(row, 7);
-					Object outboundNumber = ei.getCellValue(row, 8);
-					Object authorizedNumber = ei.getCellValue(row, 9);
-					Object price = ei.getCellValue(row, 11);
-					Object unit = ei.getCellValue(row, 12);
-					Object materialSmall = ei.getCellValue(row, 13);
-					Object materialMid = ei.getCellValue(row, 14);
-					Object materialBig = ei.getCellValue(row, 15);
-					Object Flag = ei.getCellValue(row, 10);
-					Object department = ei.getCellValue(row, 16);
-					Object secondUnits = ei.getCellValue(row, 17);
-					Object firstUnits = ei.getCellValue(row, 18);
-					String isBack = "";
-					if (Flag.equals("0")) {
-						isBack = "是";
-					} else {
-						isBack = "否";
-					}
-
-					if (outboundAmount.equals("")) {
-						outboundAmount = "0.0";
-					}
-					if (authorizedAmount.equals("")) {
-						authorizedAmount = "0.0";
-					}
-					if (difference.equals("")) {
-						difference = "0.0";
-					}
-					if (outboundNumber.equals("")) {
-						outboundNumber = "0.0";
-					}
-					if (authorizedNumber.equals("")) {
-						authorizedNumber = "0.0";
-					}
-					if (price.equals("")) {
-						price = "0.0";
-					}
-
-
-					Material material = new Material();
-					material.setInforId(inforId.toString());
-					material.setProjectId(projectId.toString());
-					material.setMaterialName(materialName.toString());
-					material.setOutboundAmount(Double.parseDouble(outboundAmount.toString()));
-					material.setAuthorizedAmount(Double.parseDouble(authorizedAmount.toString()));;
-					material.setDifference(Double.parseDouble(difference.toString()));
-					material.setOutboundNumber(Double.parseDouble(outboundNumber.toString()));
-					material.setAuthorizedNumber(Double.parseDouble(authorizedNumber.toString()));
-					material.setPrice(Double.parseDouble(price.toString()));
-					material.setUnit(unit.toString());
-					material.setMaterialSmall(materialSmall.toString());
-					material.setMaterialMid(materialMid.toString());
-					material.setMaterialBig(materialBig.toString());
-					material.setIsBack(isBack);
-					materialService.save(material);
-					inforNum++;
-						Information information2 = new Information();
-						information2.setProjectId(projectId.toString());
-						information2.setProjectName(projectName.toString());
-						information2.setDepartment(department.toString());
-						information2.setSecondUnits(secondUnits.toString());
-						information2.setFirstUnits(firstUnits.toString());
-						informationService.save(information2);
-						successNum++;
-				} catch(ConstraintViolationException ex){
-					failureNum++;
-				}catch (Exception ex) {
-					failureNum++;
-				}
-			}
+			Map<String, Object> information = ImportInformation.importmation(ei, lastDataRowNum);
+			int failureNum = Integer.parseInt(information.get("failureNum").toString());
+			int successNum = Integer.parseInt(information.get("successNum").toString());
+			List<Information> informationList= (List<Information>)information.get("importmation");
 			if (failureNum>0){
 				failureMsg.insert(0, ",失败 "+failureNum+" 项目管理记录。");
 			}
-			j.setMsg( "已成功导入 "+successNum+" 项目管理记录"+failureMsg);
-			j.setMsg( "已成功导入 "+inforNum+" 项目管理记录"+failureMsg);
+			if (informationList != null) {
+				if (informationList.size() >0) {
+					for (Information in :informationList) {
+						failInformation.append(in.getProjectName()+";");
+					}
+					failInformation.append("以上物料因出库数量与数据库中不一致未能插入");
+				}
+			}
+			j.setMsg( "已成功导入 "+successNum+" 项目管理记录"+failureMsg+failInformation);
 		} catch (Exception e) {
 			j.setSuccess(false);
 			j.setMsg("导入项目管理信息失败!失败信息:"+e.getMessage());
@@ -203,36 +139,16 @@ public class InformationController extends BaseController {
 	public AjaxJson importFileCom(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
 		AjaxJson j = new AjaxJson();
 		try {
-			int successNum = 0;
-			int failureNum = 0;
 			StringBuilder failureMsg = new StringBuilder();
 			ImportExcel ei = new ImportExcel(file, 1, 0);
 			int lastDataRowNum = ei.getLastDataRowNum();
-			for (int i = 2; i < lastDataRowNum; i++) {
-				try {
-					Row row = ei.getRow(i);
-					Object projectId = ei.getCellValue(row, 1);
-					Object projectName = ei.getCellValue(row, 2);
-					Object appDate = ei.getCellValue(row, 44);
-						Information information2 = new Information();
-						information2.setProjectId(projectId.toString());
-						information2.setProjectName(projectName.toString());
-						SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-						Date parse = simpleDateFormat.parse(appDate.toString());
-						simpleDateFormat.format(parse);
-						information2.setApprovalDate(parse);
-						informationService.updateInformationDate(information2);
-						successNum++;
-				} catch(ConstraintViolationException ex){
-					failureNum++;
-				}catch (Exception ex) {
-					failureNum++;
-				}
-			}
+			Map<String, Integer> importCom = ImportInformation.importCom(ei, lastDataRowNum);
+			int failureNum = importCom.get("failureNum");
+			int successNum = importCom.get("successNum");
 			if (failureNum>0){
-				failureMsg.insert(0, ",失败 "+failureNum+" 审定日期记录。");
+				failureMsg.insert(0, ",失败 "+failureNum+" 项目管理记录。");
 			}
-			j.setMsg( "已成功导入 "+successNum+" 审定日期记录"+failureMsg);
+			j.setMsg( "已成功导入 "+successNum+" 项目管理记录"+failureMsg);
 		} catch (Exception e) {
 			j.setSuccess(false);
 			j.setMsg("导入项审定日期失败!失败信息:"+e.getMessage());
@@ -240,6 +156,59 @@ public class InformationController extends BaseController {
 		return j;
 	}
 
+	/**
+	 * 批量导入模板
+	 * */
+	@ResponseBody
+//	@RequiresPermissions("test:onetomany:form:testDataMain2:import")
+	@RequestMapping(value = "import/template")
+	public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+			String fileName = "批量项目查询导入模板.xlsx";
+			List<Information> list = Lists.newArrayList();
+			new ExportExcel("", Information.class, 1).setDataList(list).write(response, fileName).dispose();
+			return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "批量项目查询下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+
+	@ResponseBody
+	@RequestMapping(value = "btnSearch")
+	public Map<String, Object> btnSearch(@RequestParam("file")MultipartFile file, Information information, HttpServletRequest request, HttpServletResponse response, Model model) {
+		AjaxJson j = new AjaxJson();
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = null;
+			try {
+				ei = new ImportExcel(file, 1, 0);
+			}catch (Exception e) {
+				j.setSuccess(false);
+				j.setMsg("导入项审定日期失败!失败信息:"+e.getMessage());
+			}
+			int lastDataRowNum = ei.getLastDataRowNum();
+			List<Information> infor = new ArrayList<>();
+			for (int i = 1; i < lastDataRowNum; i++) {
+				Information information1 = new Information();
+				Row row = ei.getRow(i);
+				Object projectId = ei.getCellValue(row, 0);
+				Object projectName = ei.getCellValue(row, 1);
+				information1.setProjectId(projectId.toString());
+				information1.setProjectName(projectName.toString());
+				infor.add(information1);
+			}
+			List<Information> listBy = informationService.findListBy(infor);
+			String listCount = String.valueOf(listBy.size());
+			long l = Long.parseLong(listCount);
+		Page<Information> page = new Page(1, listBy.size(), l, listBy);
+		List<Information> list = page.getList();
+		long count = page.getCount();
+		return getBootstrapData(page);
+		}
+
+}
 
 
-}

+ 4 - 11
src/main/java/com/jeeplus/modules/sg/material/entity/Material.java

@@ -3,26 +3,18 @@
  */
 package com.jeeplus.modules.sg.material.entity;
 
+import com.google.common.collect.Lists;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
+import java.util.List;
+
 /**
  * 项目信息Entity
  * @author qiuyue
  * @version 2019-09-04
  */
 public class Material extends DataEntity<Material>  {
-    private String id;
-
-    @Override
-    public String getId() {
-        return id;
-    }
-
-    @Override
-    public void setId(String id) {
-        this.id = id;
-    }
 
     //项目编号
     private String projectId;
@@ -57,6 +49,7 @@ public class Material extends DataEntity<Material>  {
     //备注说明
     private String info;
 
+
     @ExcelField(title="是否完成领退料", align=2, sort=13)
     public String getIsBack() {
         return isBack;

+ 7 - 0
src/main/java/com/jeeplus/modules/sg/material/mapper/MaterialMapper.java

@@ -6,6 +6,9 @@ package com.jeeplus.modules.sg.material.mapper;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.material.entity.Material;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 项目管理MAPPER接口
@@ -17,4 +20,8 @@ public interface MaterialMapper extends BaseMapper<Material> {
     Material findByMaterialId(Material material);
 
     Integer updateInfo(Material material);
+
+    void saveMater(List<Material> list);
+
+    Material findByProIn(@Param("projectId") String projectId, @Param("inforId") String infoId);
 }

+ 106 - 51
src/main/java/com/jeeplus/modules/sg/material/mapper/xml/MaterialMapper.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.sg.material.mapper.MaterialMapper">
-    
-	<sql id="materialColumns">
+
+    <sql id="materialColumns">
 		id,
 		project_id,
 		infor_id,
@@ -22,56 +22,109 @@
 		info
 	</sql>
 
-	<select id="findByMaterialId" resultType="com.jeeplus.modules.sg.material.entity.Material">
-		SELECT
-		<include refid="materialColumns"/>
-		FROM material_information
-		where project_Id = #{projectId} and infor_id = #{inforId} and material_name = #{materialName}
-	</select>
+    <select id="findByMaterialId" resultType="com.jeeplus.modules.sg.material.entity.Material">
+        SELECT
+        <include refid="materialColumns"/>
+        FROM material_information
+        where project_Id = #{projectId} and infor_id = #{inforId} and material_name = #{materialName}
+    </select>
 
-	<update id="updateInfo" parameterType="com.jeeplus.modules.sg.material.entity.Material">
+    <update id="updateInfo" parameterType="com.jeeplus.modules.sg.material.entity.Material">
 		update material_information set status = #{status},info = #{info},isback = "是" where id = #{id};
 	</update>
-	<select id="findList" resultType="Material" >
-		SELECT 
-			<include refid="materialColumns"/>
-		FROM material_information
-		<where>
-			1 = 1
-			<if test="projectId != null and projectId != ''">
-				AND project_id = #{projectId}
-			</if>
-			<if test="id != null and id!=''">
-				AND id=#{id}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="Material" >
-		SELECT 
-			<include refid="materialColumns"/>
-		FROM material_information
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	<select id="get" resultType="Material">
+    <select id="findList" resultType="Material">
+        SELECT
+        <include refid="materialColumns"/>
+        FROM material_information
+        <where>
+            1 = 1
+            <if test="projectId != null and projectId != ''">
+                AND project_id = #{projectId}
+            </if>
+            <if test="id != null and id!=''">
+                AND id=#{id}
+            </if>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="findAllList" resultType="Material">
+        SELECT
+        <include refid="materialColumns"/>
+        FROM material_information
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+    <select id="get" resultType="Material">
 		select id,status,info from material_information where id = #{id}
 	</select>
-	<insert id="insert">
+    <insert id="saveMater">
+        replace into material_information(
+        id,
+        project_id,
+        infor_id,
+        material_name,
+        outbound_amount,
+        authorized_amount,
+        difference,
+        outbound_number,
+        authorized_number,
+        price,
+        unit,
+        material_small,
+        material_mid,
+        material_big,
+        isBack,
+        status,
+        info,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        del_flag
+        ) VALUES
+        <foreach collection="list" item="material" index="index" separator=",">
+            (
+            #{material.id},
+            #{material.projectId},
+            #{material.inforId},
+            #{material.materialName},
+            #{material.outboundAmount},
+            #{material.authorizedAmount},
+            #{material.difference},
+            #{material.outboundNumber},
+            #{material.authorizedNumber},
+            #{material.price},
+            #{material.unit},
+            #{material.materialSmall},
+            #{material.materialMid},
+            #{material.materialBig},
+            #{material.isBack},
+            #{material.status},
+            #{material.info},
+            #{material.createBy.id},
+            #{material.createDate},
+            #{material.updateBy.id},
+            #{material.updateDate},
+            #{material.delFlag}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="insert">
 		INSERT INTO material_information(
 			id,
 			project_id,
@@ -143,8 +196,10 @@
 			del_flag = #{delFlag}
 	</insert>
 
-	
-
-	
-
+<select id="findByProIn" resultType="com.jeeplus.modules.sg.material.entity.Material">
+        SELECT
+        <include refid="materialColumns"/>
+        FROM material_information
+        where project_Id = #{projectId} and infor_id = #{inforId}
+    </select>
 </mapper>

+ 27 - 1
src/main/java/com/jeeplus/modules/sg/material/service/MaterialService.java

@@ -39,9 +39,35 @@ public class MaterialService extends CrudService<MaterialMapper, Material> {
 		return super.findPage(page, entity);
 	}
 
+	@Override
+	public List<Material> findListBy(List<Material> entity) {
+		return super.findListBy(entity);
+	}
+
 	@Transactional(readOnly = false)
 	public void save(Material entity) {
-		super.save(entity);
+		entity.preInsert();
+		materialMapper.insert(entity);
+	}
+	/*
+	@Transactional(readOnly = false)
+	public void insert(List<Material> entity) {
+		for (int i = 0; i < entity.size(); i++) {
+			if (entity.get(i).getIsNewRecord()) {
+				entity.get(i).preInsert();
+			}
+		}
+		materialMapper.save(entity);
+	}
+*/
+
+	@Transactional(readOnly = false)
+	public void saveMater(List<Material> entity) {
+		materialMapper.saveMater(entity);
+	}
+
+	public Material findByProIn(String projectId,String infoId) {
+		return materialMapper.findByProIn(projectId, infoId);
 	}
 
 	@Transactional(readOnly = false)

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/material/web/MaterialController.java

@@ -83,9 +83,9 @@ public class MaterialController extends BaseController {
 	public String updateInfo(Material material) {
 		Integer s = materialService.updateInfo(material);
 		if (s > 0 ) {
-			return "1";
+			return "修改成功";
 		} else {
-			return "2";
+			return "修改失败";
 		}
 	}
 /*
@@ -113,7 +113,7 @@ public class MaterialController extends BaseController {
 			return j;
     }
 
-	
+
 
 	
 

+ 107 - 16
src/main/webapp/webpage/modules/sg/information/informationList.js

@@ -45,7 +45,7 @@ $(document).ready(function() {
                //可供选择的每页的行数(*)
                pageList: [10, 25, 50, 100],
                //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
-               url: "${ctx}/sg/information/information/data",
+               url: "${ctx}/sg/information/data",
                //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
                //queryParamsType:'',
                ////查询参数,每次调用是会带上这个参数,可自定义
@@ -82,29 +82,90 @@ $(document).ready(function() {
 		        sortName: 'projectName'
 		    }
 			,{
-		        field: 'department',
-		        title: '送审部门',
+		        field: 'projectType',
+		        title: '项目类型',
 		        sortable: true,
-		        sortName: 'department'
+		        sortName: 'projectType'
 		    }
 			,{
-		        field: 'approvalDate',
-		        title: '审定日期',
+		        field: 'projectGrade',
+		        title: '电压等级',
 		        sortable: true,
-		        sortName: 'approvalDate'
+		        sortName: 'projectGrade'
 		    }
 			,{
-		        field: 'secondUnits',
-		        title: '二级单位',
+		        field: 'projectYear',
+		        title: '项目预算年度',
 		        sortable: true,
-		        sortName: 'secondUnits'
+		        sortName: 'projectYear'
 		    }
 			,{
-		        field: 'firstUnits',
-		        title: '一级单位',
+		        field: 'projectTotal',
+		        title: '项目总投资(元)',
 		        sortable: true,
-		        sortName: 'firstUnits'
-		    },{
+		        sortName: 'projectTotal'
+		    }
+				   ,{
+					   field: 'projectStart',
+					   title: '实际开工日期',
+					   sortable: true,
+					   sortName: 'projectStart'
+				   }
+				   ,{
+					   field: 'projectStop',
+					   title: '实际竣工日期',
+					   sortable: true,
+					   sortName: 'projectStop'
+				   }
+				   ,{
+					   field: 'projectFirm',
+					   title: '事务所名称',
+					   sortable: true,
+					   sortName: 'projectFirm'
+				   }
+				   ,{
+					   field: 'subDate',
+					   title: '提交送审日期',
+					   sortable: true,
+					   sortName: 'subDate'
+				   }
+				   ,{
+					   field: 'releaseDate',
+					   title: '审计任务下达日期',
+					   sortable: true,
+					   sortName: 'releaseDate'
+				   }
+				   ,{
+					   field: 'endDate',
+					   title: '审计应结束日时间',
+					   sortable: true,
+					   sortName: 'endDate'
+				   }
+				   ,{
+					   field: 'resultDate',
+					   title: '结果上传时间',
+					   sortable: true,
+					   sortName: 'resultDate'
+				   }
+				   ,{
+					   field: 'approvalDate',
+					   title: '审定日期',
+					   sortable: true,
+					   sortName: 'approvalDate'
+				   }
+				   ,{
+					   field: 'secondUnits',
+					   title: '二级单位',
+					   sortable: true,
+					   sortName: 'secondUnits'
+				   }
+				   ,{
+					   field: 'firstUnits',
+					   title: '一级单位',
+					   sortable: true,
+					   sortName: 'firstUnits'
+				   }
+		    ,{
 					   field: 'operate',
 					   title: '操作',
 					   width: '80px',
@@ -141,7 +202,7 @@ $(document).ready(function() {
 				btn: ['确定', '关闭'],
 				btn1: function(index, layero){
 					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-					iframeWin.contentWindow.importExcel('${ctx}/sg/information/information/import', function (data) {
+					iframeWin.contentWindow.importExcel('${ctx}/sg/information/import', function (data) {
 						if(data.success){
 							jp.success(data.msg);
 							refresh();
@@ -168,7 +229,7 @@ $(document).ready(function() {
 			btn: ['确定', '关闭'],
 			btn1: function(index, layero){
 				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-				iframeWin.contentWindow.importExcel('${ctx}/sg/information/information/importCom', function (data) {
+				iframeWin.contentWindow.importExcel('${ctx}/sg/information/importCom', function (data) {
 					if(data.success){
 						jp.success(data.msg);
 						refresh();
@@ -185,6 +246,36 @@ $(document).ready(function() {
 		})
 	})
 
+    $("#btnSearch").click(function () {
+        jp.open({
+            type: 2,
+            area: [500, 200],
+            auto: true,
+            title:"导入数据",
+            content: "${ctx}/tag/importExcel" ,
+            btn: ['下载模板','确定', '关闭'],
+            btn1: function(index, layero){
+                jp.downloadFile('${ctx}/sg/information/import/template');
+            },
+            btn2: function(index, layero){
+                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                iframeWin.contentWindow.importExcel('${ctx}/sg/information/btnSearch', function (data) {
+					if(data.success){
+						jp.success(data.msg);
+						refresh();
+					}else{
+						jp.error(data.msg);
+					}
+					jp.close(index);
+                });//调用保存事件
+                return false;
+            },
+            btn3: function(index){
+                jp.close(index);
+            }
+        })
+    })
+
 	  $("#search").click("click", function() {// 绑定查询按扭
 		  $('#informationTable').bootstrapTable('refresh');
 		});

+ 10 - 5
src/main/webapp/webpage/modules/sg/information/informationList.jsp

@@ -59,16 +59,21 @@
 	
 	<!-- 工具栏 -->
 	<div id="toolbar">
+		<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">
+			<button id="btnCom" class="btn btn-info">
+				<i class="fa fa-folder-open-o"></i> 导入综合信息表
+			</button>
+		</shiro:hasPermission>
 			<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">
 				<button id="btnInformation" class="btn btn-info">
 					<i class="fa fa-folder-open-o"></i> 导入欠供物资
 				</button>
 			</shiro:hasPermission>
-			<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">
-			    <button id="btnCom" class="btn btn-info">
-	            	<i class="fa fa-folder-open-o"></i> 导入综合信息表
-	        	</button>
-			</shiro:hasPermission>
+		<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">
+			<button id="btnSearch" class="btn btn-info">
+				<i class="fa fa-folder-open-o"></i> 导入批量项目查询
+			</button>
+		</shiro:hasPermission>
 		    </div>
 		
 	<!-- 表格 -->

+ 1 - 1
src/main/webapp/webpage/modules/sg/material/materialForm.jsp

@@ -16,7 +16,7 @@
 					dataType: "json",
 					success: function (data) {
 						console.log(data);
-						if (data == "1") {
+						if (data == "修改成功") {
 							jp.success("修改成功");
 							jp.getParent().refresh();
 							var index = parent.layer.getFrameIndex(window.name);

+ 1 - 1
src/main/webapp/webpage/modules/sg/material/materialList.js

@@ -92,7 +92,7 @@ $(document).ready(function() {
 		    }
 			,{
 		        field: 'difference',
-		        title: '差额',
+		        title: '差额(元)',
 		        sortable: true,
 		        sortName: 'difference'
 		    }