Browse Source

年度物资上报统计,年度物资上报明细

[user3] 4 năm trước cách đây
mục cha
commit
0d864d9855
17 tập tin đã thay đổi với 2615 bổ sung0 xóa
  1. 116 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/ExportDetails.java
  2. 154 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/NewMaterialReport.java
  3. 116 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/ReportDetails.java
  4. 44 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/NewMaterialReportMapper.java
  5. 40 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/ReportDetailsMapper.java
  6. 248 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/xml/NewMaterialReportMapper.xml
  7. 196 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/xml/ReportDetailsMapper.xml
  8. 72 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/service/NewMaterialReportService.java
  9. 128 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/service/ReportDetailsService.java
  10. 312 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/web/NewMaterialProjectController.java
  11. 186 0
      src/main/java/com/jeeplus/modules/sg/annualmaterialreport/web/ReportDetailsController.java
  12. 229 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/annualMaterialReportList.js
  13. 70 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/annualMaterialReportList.jsp
  14. 207 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/importMore.jsp
  15. 104 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectForm.jsp
  16. 288 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectList.js
  17. 105 0
      src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectList.jsp

+ 116 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/ExportDetails.java

@@ -0,0 +1,116 @@
+package com.jeeplus.modules.sg.annualmaterialreport.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+/**
+ * 年度物资上报明细实体类
+ *
+ * @author QY
+ */
+public class ExportDetails extends DataEntity<ExportDetails> {
+    /**
+     * 储备项目名称
+     */
+    private String reserveProjectName;
+    /**
+     * 物料编码
+     * */
+    private String materialCode;
+    /**
+     * 物料描述
+     * */
+    private String materialDescription;
+    /**
+     * 新扩展编码栏
+     * */
+    private String newExtendedCodeBar;
+    /**
+     * 扩展描述
+     * */
+    private String extendedDescription;
+    /**
+     * 单位
+     * */
+    private String company;
+    /**
+     * 单价
+     * */
+    private String unitPrice;
+    /**
+     * 数量
+     * */
+    private String quantity;
+
+
+    public String getReserveProjectName() {
+        return reserveProjectName;
+    }
+
+    public void setReserveProjectName(String reserveProjectName) {
+        this.reserveProjectName = reserveProjectName;
+    }
+
+    @ExcelField(title="物料编码", align=2, sort=1)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title="物料描述", align=2, sort=2)
+    public String getMaterialDescription() {
+        return materialDescription;
+    }
+
+    public void setMaterialDescription(String materialDescription) {
+        this.materialDescription = materialDescription;
+    }
+
+    @ExcelField(title="新扩展编码栏", align=2, sort=3)
+    public String getNewExtendedCodeBar() {
+        return newExtendedCodeBar;
+    }
+
+    public void setNewExtendedCodeBar(String newExtendedCodeBar) {
+        this.newExtendedCodeBar = newExtendedCodeBar;
+    }
+
+    @ExcelField(title="扩展描述", align=2, sort=4)
+    public String getExtendedDescription() {
+        return extendedDescription;
+    }
+
+    public void setExtendedDescription(String extendedDescription) {
+        this.extendedDescription = extendedDescription;
+    }
+
+    @ExcelField(title="单位", align=2, sort=5)
+    public String getCompany() {
+        return company;
+    }
+
+    public void setCompany(String company) {
+        this.company = company;
+    }
+
+    @ExcelField(title="单价", align=2, sort=6)
+    public String getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(String unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    @ExcelField(title="数量", align=2, sort=7)
+    public String getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(String quantity) {
+        this.quantity = quantity;
+    }
+}

+ 154 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/NewMaterialReport.java

@@ -0,0 +1,154 @@
+package com.jeeplus.modules.sg.annualmaterialreport.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+/**
+ * 新年度物资上报统计实体类
+ * @author enford
+ */
+public class NewMaterialReport extends DataEntity<NewMaterialReport> {
+    /**
+     * 储备项目名称
+     * */
+    private String reserveProjectName;
+    /**
+     * 储备编码
+     * */
+    private String reserveCode;
+    /**
+     * 项目类型
+     * */
+    private String projectType;
+    /**
+     * 项目计划年度批次
+     * */
+    private String batchPlan;
+    /**
+     * 项目正式发文批次
+     * */
+    private String issuePlan;
+    /**
+     * 项目年度实施计划(月份)
+     * */
+    private String monthPlan;
+    /**
+     * 年度计划有无预测
+     * */
+    private String hasPlan;
+    /**
+     * 项目物资执行计划(上半年/下半年)
+     * */
+    private String halfPlan;
+    /**
+     * 项目定义
+     * */
+    private String projectId;
+    /**
+     * 项目名称
+     * */
+    private String projectName;
+    /**
+     * 归属年份
+     * */
+    private String attributionYear;
+
+    @ExcelField(title="储备项目名称", align=2, sort=1)
+    public String getReserveProjectName() {
+        return reserveProjectName;
+    }
+
+    public void setReserveProjectName(String reserveProjectName) {
+        this.reserveProjectName = reserveProjectName;
+    }
+
+    @ExcelField(title="储备编码", align=2, sort=2)
+    public String getReserveCode() {
+        return reserveCode;
+    }
+
+    public void setReserveCode(String reserveCode) {
+        this.reserveCode = reserveCode;
+    }
+
+    @ExcelField(title="项目类型", align=2, sort=3)
+    public String getProjectType() {
+        return projectType;
+    }
+
+    public void setProjectType(String projectType) {
+        this.projectType = projectType;
+    }
+
+    @ExcelField(title="项目计划年度批次", align=2, sort=4)
+    public String getBatchPlan() {
+        return batchPlan;
+    }
+
+    public void setBatchPlan(String batchPlan) {
+        this.batchPlan = batchPlan;
+    }
+
+    @ExcelField(title="项目正式发文批次", align=2, sort=5)
+    public String getIssuePlan() {
+        return issuePlan;
+    }
+
+    public void setIssuePlan(String issuePlan) {
+        this.issuePlan = issuePlan;
+    }
+
+    @ExcelField(title="项目年度实施计划(月份)", align=2, sort=6)
+    public String getMonthPlan() {
+        return monthPlan;
+    }
+
+    public void setMonthPlan(String monthPlan) {
+        this.monthPlan = monthPlan;
+    }
+
+    @ExcelField(title="年度计划有无预测", align=2, sort=7)
+    public String getHasPlan() {
+        return hasPlan;
+    }
+
+    public void setHasPlan(String hasPlan) {
+        this.hasPlan = hasPlan;
+    }
+
+    @ExcelField(title="项目物资执行计划(上半年/下半年)", align=2, sort=8)
+    public String getHalfPlan() {
+        return halfPlan;
+    }
+
+    public void setHalfPlan(String halfPlan) {
+        this.halfPlan = halfPlan;
+    }
+
+    @ExcelField(title="项目定义", align=2, sort=9)
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    @ExcelField(title="项目名称", align=2, sort=10)
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    @ExcelField(title="归属年份", align=2, sort=11)
+    public String getAttributionYear() {
+        return attributionYear;
+    }
+
+    public void setAttributionYear(String attributionYear) {
+        this.attributionYear = attributionYear;
+    }
+}

+ 116 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/entity/ReportDetails.java

@@ -0,0 +1,116 @@
+package com.jeeplus.modules.sg.annualmaterialreport.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+/**
+ * 年度物资上报明细实体类
+ *
+ * @author QY
+ */
+public class ReportDetails extends DataEntity<ReportDetails> {
+    /**
+     * 储备项目名称
+     */
+    private String reserveProjectName;
+    /**
+     * 物料编码
+     * */
+    private String materialCode;
+    /**
+     * 物料描述
+     * */
+    private String materialDescription;
+    /**
+     * 新扩展编码栏
+     * */
+    private String newExtendedCodeBar;
+    /**
+     * 扩展描述
+     * */
+    private String extendedDescription;
+    /**
+     * 单位
+     * */
+    private String company;
+    /**
+     * 单价
+     * */
+    private String unitPrice;
+    /**
+     * 数量
+     * */
+    private String quantity;
+
+    @ExcelField(title="储备项目名称", align=2, sort=1)
+    public String getReserveProjectName() {
+        return reserveProjectName;
+    }
+
+    public void setReserveProjectName(String reserveProjectName) {
+        this.reserveProjectName = reserveProjectName;
+    }
+
+    @ExcelField(title="物料编码", align=2, sort=2)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title="物料描述", align=2, sort=3)
+    public String getMaterialDescription() {
+        return materialDescription;
+    }
+
+    public void setMaterialDescription(String materialDescription) {
+        this.materialDescription = materialDescription;
+    }
+
+    @ExcelField(title="新扩展编码栏", align=2, sort=4)
+    public String getNewExtendedCodeBar() {
+        return newExtendedCodeBar;
+    }
+
+    public void setNewExtendedCodeBar(String newExtendedCodeBar) {
+        this.newExtendedCodeBar = newExtendedCodeBar;
+    }
+
+    @ExcelField(title="扩展描述", align=2, sort=5)
+    public String getExtendedDescription() {
+        return extendedDescription;
+    }
+
+    public void setExtendedDescription(String extendedDescription) {
+        this.extendedDescription = extendedDescription;
+    }
+
+    @ExcelField(title="单位", align=2, sort=6)
+    public String getCompany() {
+        return company;
+    }
+
+    public void setCompany(String company) {
+        this.company = company;
+    }
+
+    @ExcelField(title="单价", align=2, sort=7)
+    public String getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(String unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    @ExcelField(title="数量", align=2, sort=8)
+    public String getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(String quantity) {
+        this.quantity = quantity;
+    }
+}

+ 44 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/NewMaterialReportMapper.java

@@ -0,0 +1,44 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 新年度物资上报明细mapper
+ * @author QY
+ */
+@MyBatisMapper
+public interface NewMaterialReportMapper extends BaseMapper<NewMaterialReport> {
+	int insertList(@Param("list") List<ReportDetails> list);
+
+	/**
+	 * 通过批量项目储备名称查询项目是否存在
+	 * @param list 项目储备名称集合
+	 * @return 存在的项目集合
+	 * */
+	List<NewMaterialReport> findByList(@Param("list") List<String> list);
+	void deleteByPro(String projectName);
+
+	/**
+	 * 通过储备项目名称,判断项目是否存在
+	 * @param reserveProjectName 储备项目名称
+	 * @return 返回查询结果
+	 * */
+	NewMaterialReport findByName(String reserveProjectName);
+
+	/**
+	 * 通过储备项目名称更新基础信息
+	 * @param list 更新的信息
+	 * @return 完成的条数
+	 * */
+	int updateList(@Param("list") List<NewMaterialReport> list);
+}

+ 40 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/ReportDetailsMapper.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 新年度物资上报明细mapper
+ * @author QY
+ */
+@MyBatisMapper
+public interface ReportDetailsMapper extends BaseMapper<ReportDetails> {
+	/**
+	 * 批量添加年度物资上报明细情况
+	 * @param list 年度物资上报list
+	 * @return 返回插入的条数
+	 * */
+	int insertList(@Param("list") List<ReportDetails> list);
+
+	/**
+	 * 根据项目储备名称删除数据
+	 * @param reserveProjectName 储备项目名称
+	 * */
+	void delByName(String reserveProjectName);
+
+	/**
+	 * 通过查询到的储备项目名称查询出所有的上报明细
+	 * @param list 储备项目名称
+	 * @return 上报信息
+	 * */
+	List<ReportDetails> exportList(@Param("list") List<NewMaterialReport> list);
+}

+ 248 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/xml/NewMaterialReportMapper.xml

@@ -0,0 +1,248 @@
+<?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.annualmaterialreport.mapper.NewMaterialReportMapper">
+
+    <sql id="infoColumns">
+        a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+        a.reserveProjectName AS "reserveProjectName",
+        a.reserveCode AS "reserveCode",
+        a.projectType AS "projectType",
+        a.batchPlan AS "batchPlan",
+        a.issuePlan AS "issuePlan",
+        a.monthPlan AS "monthPlan",
+        a.hasPlan AS "hasPlan",
+        a.halfPlan AS "halfPlan",
+        a.projectId AS "projectId",
+        a.projectName AS "projectName",
+        a.attributionYear AS "attributionYear"
+    </sql>
+
+
+    <select id="get" resultType="NewMaterialReport">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_material_project a
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="NewMaterialReport">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_material_project a
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            ${dataScope}
+            <if test="reserveProjectName != null and reserveProjectName != '' and reserveProjectName != 'undefined' ">
+                AND reserveProjectName LIKE CONCAT(CONCAT('%',#{reserveProjectName},'%'))
+            </if>
+            <if test="reserveCode != null and reserveCode != '' and reserveCode != 'undefined'">
+                AND a.reserveCode = #{reserveCode}
+            </if>
+            <if test="projectType != null and projectType != '' and projectType != 'undefined'">
+                AND a.projectType = #{projectType}
+            </if>
+            <if test="batchPlan != null and batchPlan != '' and batchPlan != 'undefined' ">
+                AND a.batchPlan = #{batchPlan}
+            </if>
+            <if test="issuePlan != null and issuePlan != '' and issuePlan != 'undefined' ">
+                AND a.issuePlan = #{issuePlan}
+            </if>
+            <if test="monthPlan != null and monthPlan != '' and monthPlan != 'undefined' ">
+                AND a.monthPlan = #{monthPlan}
+            </if>
+            <if test="hasPlan != null and hasPlan != '' and hasPlan != 'undefined' ">
+                AND a.hasPlan = #{hasPlan}
+            </if>
+            <if test="halfPlan != null and halfPlan != '' and halfPlan != 'undefined' ">
+                AND a.halfPlan = #{halfPlan}
+            </if>
+            <if test="projectId != null and projectId != '' and projectId != 'undefined' ">
+                AND a.projectId = #{projectId}
+            </if>
+            <if test="projectName != null and projectName != '' and projectName != 'undefined' ">
+                AND a.projectName = #{projectName}
+            </if>
+        </where>
+        <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="findAllList" resultType="NewMaterialReport">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_report_details a
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            ${dataScope}
+        </where>
+        <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>
+
+    <insert id="insert">
+        INSERT INTO new_material_project
+        (id,
+         create_by,
+         create_date,
+         update_by,
+         update_date,
+         remarks,
+         del_flag,
+         reserveProjectName,
+         attributionYear
+        )
+        VALUES (#{id},
+                #{createBy.id},
+                #{createDate},
+                #{updateBy.id},
+                #{updateDate},
+                #{remarks},
+                #{delFlag},
+                #{reserveProjectName},
+                #{attributionYear})
+    </insert>
+
+    <insert id="insertList">
+        replace INTO xm_material_data(
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        project_name,
+        material_code,
+        material_name,
+        extend_description ,
+        unit ,
+        total_count,
+        weight_kg,
+        weight_ton,
+        supply_type,
+        note,
+        state
+        ) VALUES
+        <foreach collection="list" item="item" index="index" separator=",">
+            (
+            #{item.id},
+            #{item.createBy.id},
+            #{item.createDate},
+            #{item.updateBy.id},
+            #{item.updateDate},
+            #{item.remarks},
+            #{item.delFlag},
+            #{item.projectName},
+            #{item.materialCode},
+            #{item.materialName},
+            #{item.extendDescription},
+            #{item.unit},
+            #{item.totalCount},
+            #{item.weightKg},
+            #{item.weightTon},
+            #{item.supplyType},
+            #{item.note},
+            #{item.state}
+            )
+        </foreach>
+    </insert>
+
+
+    <update id="update">
+        UPDATE new_material_project
+        SET update_by   = #{updateBy.id},
+            update_date = #{updateDate},
+            remarks     = #{remarks},
+            reserveCode = #{reserveCode},
+            projectType = #{projectType},
+            batchPlan = #{batchPlan},
+            issuePlan = #{issuePlan},
+            monthPlan = #{monthPlan},
+            hasPlan = #{hasPlan},
+            halfPlan = #{halfPlan},
+            projectId = #{projectId},
+            projectName = #{projectName}
+        WHERE id = #{id}
+    </update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+        DELETE
+        FROM new_material_project
+        WHERE id = #{id}
+    </update>
+
+    <delete id="deleteByPro">
+        DELETE
+        FROM xm_material_data
+        WHERE project_name = #{projectName}
+    </delete>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+        UPDATE xm_material_data
+        SET del_flag = #{DEL_FLAG_DELETE}
+        WHERE id = #{id}
+    </update>
+    <update id="updateList">
+        <foreach collection="list" item="item" index="index">
+            update new_material_project set
+            update_by = #{item.updateBy.id},
+            update_date = #{item.createDate},
+            reserveCode = #{item.reserveCode},
+            projectType = #{item.projectType},
+            batchPlan = #{item.batchPlan},
+            issuePlan = #{item.issuePlan},
+            monthPlan = #{item.monthPlan},
+            hasPlan = #{item.hasPlan},
+            halfPlan = #{item.halfPlan},
+            projectId = #{item.projectId},
+            projectName = #{item.projectName}
+            where reserveProjectName = #{item.reserveProjectName};
+        </foreach>
+    </update>
+
+
+    <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+    <select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+        select *
+        FROM xm_material_data
+        where ${propertyName} = '${value}'
+    </select>
+
+    <select id="findByList" resultType="com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_material_project a
+        <where>
+            a.reserveProjectName in
+            <foreach collection="list" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </where>
+    </select>
+    <select id="findByName" resultType="com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport">
+        SELECT reserveProjectName
+        FROM new_material_project a
+        where reserveProjectName = #{reserveProjectName};
+    </select>
+</mapper>

+ 196 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/mapper/xml/ReportDetailsMapper.xml

@@ -0,0 +1,196 @@
+<?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.annualmaterialreport.mapper.ReportDetailsMapper">
+
+    <sql id="infoColumns">
+        a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+        a.reserveProjectName AS "reserveProjectName",
+        a.materialCode AS "materialCode",
+        a.materialDescription AS "materialDescription",
+        a.newExtendedCodeBar AS "newExtendedCodeBar",
+        a.extendedDescription AS "extendedDescription",
+        a.company AS "company",
+        a.unitPrice AS "unitPrice",
+        a.quantity AS "quantity"
+    </sql>
+
+
+    <select id="get" resultType="ReportDetails">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_report_details a
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="ReportDetails">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_report_details a
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            ${dataScope}
+            <if test="reserveProjectName != null and reserveProjectName != '' ">
+                AND reserveProjectName LIKE CONCAT(CONCAT('%',#{reserveProjectName},'%'))
+            </if>
+            <if test="materialCode != null and materialCode != '' ">
+                AND materialCode =#{materialCode}
+            </if>
+            <if test="materialDescription != null and materialDescription != '' ">
+                AND materialDescription LIKE CONCAT(CONCAT('%',#{materialDescription},'%'))
+            </if>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.reserveProjectName DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="findAllList" resultType="ReportDetails">
+        SELECT
+        <include refid="infoColumns"/>
+        FROM new_report_details a
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            ${dataScope}
+        </where>
+        <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>
+
+    <insert id="insert">
+        INSERT INTO xm_material_data(id,
+                                     create_by,
+                                     create_date,
+                                     update_by,
+                                     update_date,
+                                     remarks,
+                                     del_flag,
+                                     project_name,
+                                     material_code,
+                                     material_name,
+                                     extend_description,
+                                     unit,
+                                     total_count,
+                                     weight_kg,
+                                     weight_ton,
+                                     supply_type,
+                                     note)
+        VALUES (#{id},
+                #{createBy.id},
+                #{createDate},
+                #{updateBy.id},
+                #{updateDate},
+                #{remarks},
+                #{delFlag},
+                #{projectName},
+                #{materialCode},
+                #{materialName},
+                #{extendDescription},
+                #{unit},
+                #{totalCount},
+                #{weightKg},
+                #{weightTon},
+                #{supplyType},
+                #{note})
+    </insert>
+
+    <insert id="insertList">
+        insert INTO new_report_details(
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        reserveProjectName,
+        materialCode,
+        materialDescription,
+        newExtendedCodeBar,
+        extendedDescription,
+        company,
+        unitPrice,
+        quantity
+        ) VALUES
+        <foreach collection="list" item="item" index="index" separator=",">
+            (
+            #{item.id},
+            #{item.createBy.id},
+            #{item.createDate},
+            #{item.updateBy.id},
+            #{item.updateDate},
+            #{item.remarks},
+            #{item.delFlag},
+            #{item.reserveProjectName},
+            #{item.materialCode},
+            #{item.materialDescription},
+            #{item.newExtendedCodeBar},
+            #{item.extendedDescription},
+            #{item.company},
+            #{item.unitPrice},
+            #{item.quantity}
+            )
+        </foreach>
+    </insert>
+
+    <update id="update">
+        UPDATE xm_material_data
+        SET update_by   = #{updateBy.id},
+            update_date = #{updateDate},
+            remarks     = #{remarks}
+        WHERE id = #{id}
+    </update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+        DELETE
+        FROM xm_material_data
+        WHERE id = #{id}
+    </update>
+
+    <delete id="delByName">
+        DELETE
+        FROM new_report_details
+        WHERE reserveProjectName = #{reserveProjectName}
+    </delete>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+        UPDATE xm_material_data
+        SET del_flag = #{DEL_FLAG_DELETE}
+        WHERE id = #{id}
+    </update>
+
+
+    <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+    <select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+        select *
+        FROM xm_material_data
+        where ${propertyName} = '${value}'
+    </select>
+
+    <select id="exportList" resultType="com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails">
+        select * from new_report_details where reserveProjectName in
+        <foreach collection="list" separator="," open="(" close=")" index="index" item="item">
+            #{item.reserveProjectName}
+        </foreach>
+    </select>
+
+</mapper>

+ 72 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/service/NewMaterialReportService.java

@@ -0,0 +1,72 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.service;
+
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.mapper.NewMaterialReportMapper;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+
+/**
+ * 新年度物资上报services
+ * @author QY
+ */
+@Service
+@Transactional(readOnly = true)
+public class NewMaterialReportService extends CrudService<NewMaterialReportMapper, NewMaterialReport> {
+
+
+	@Override
+	public NewMaterialReport get(String id) {
+		return super.get(id);
+	}
+
+	@Override
+	public List<NewMaterialReport> findList(NewMaterialReport entity) {
+		return super.findList(entity);
+	}
+
+	@Override
+	public Page<NewMaterialReport> findPage(Page<NewMaterialReport> page, NewMaterialReport entity) {
+		return super.findPage(page, entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void save(NewMaterialReport entity) {
+		super.save(entity);
+	}
+
+	/**
+	 * 通过获取多文件的项目名称,查询存在的项目信息,提示
+	 * */
+	public List<NewMaterialReport> findByList(List<String> list){
+		return mapper.findByList(list);
+	}
+
+	/**
+	 * 通过储备项目名称修改对应的数据
+	 */
+	@Transactional(readOnly = false)
+	public void updateList(List<NewMaterialReport> list) {
+		for (NewMaterialReport n :
+				list) {
+			n.preInsert();
+		}
+		mapper.updateList(list);
+	}
+
+
+}

+ 128 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/service/ReportDetailsService.java

@@ -0,0 +1,128 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.service;
+
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails;
+import com.jeeplus.modules.sg.annualmaterialreport.mapper.NewMaterialReportMapper;
+import com.jeeplus.modules.sg.annualmaterialreport.mapper.ReportDetailsMapper;
+import com.jeeplus.modules.sg.audit.report.mapper.ReportMapper;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+/**
+ * 新年度物资上报services
+ *
+ * @author QY
+ */
+@Service
+@Transactional(readOnly = true)
+public class ReportDetailsService extends CrudService<ReportDetailsMapper, ReportDetails> {
+
+	@Autowired
+	private ReportDetailsMapper reportDetailsMapper;
+
+	@Autowired
+	private NewMaterialReportMapper newMaterialReportMapper;
+
+	@Override
+	public ReportDetails get(String id) {
+		return super.get(id);
+	}
+
+	@Override
+	public List<ReportDetails> findList(ReportDetails entity) {
+		return super.findList(entity);
+	}
+
+	@Override
+	public Page<ReportDetails> findPage(Page<ReportDetails> page, ReportDetails entity) {
+		return super.findPage(page, entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void save(ReportDetails entity) {
+		super.save(entity);
+	}
+
+
+	/**
+	 * 在年度物资上报统计表中保存项目信息,在年度上报明细表中保存物资信息
+	 */
+	@Transactional(readOnly = false)
+	public void saveData(MultipartFile file, String reserveProjectName) throws IOException, InvalidFormatException {
+		ImportExcel importExcel = new ImportExcel(file, 1, "甲供材清单");
+		List<ReportDetails> reportDetailsList = new ArrayList<>();
+		int lastRow = importExcel.getLastDataRowNum();
+
+		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
+		String format = simpleDateFormat.format(new Date());
+		//判断项目是否存在,存在删除年度物资上报明细信息,不存在直接插入信息
+		NewMaterialReport byName = newMaterialReportMapper.findByName(reserveProjectName);
+		if (null == byName) {
+			NewMaterialReport newMaterialReport = new NewMaterialReport();
+			newMaterialReport.setReserveProjectName(reserveProjectName);
+			newMaterialReport.setAttributionYear(format);
+			newMaterialReport.preInsert();
+			newMaterialReportMapper.insert(newMaterialReport);
+		} else {
+			//项目存在,删除该项目的详细信息,重新添加
+			reportDetailsMapper.delByName(reserveProjectName);
+		}
+		for (int i = 1; i < lastRow; i++) {
+			Row row = importExcel.getRow(i);
+			ReportDetails reportDetails = new ReportDetails();
+			reportDetails.setMaterialCode((String) importExcel.getCellValue(row, 4));
+			reportDetails.setMaterialDescription((String) importExcel.getCellValue(row, 5));
+			reportDetails.setNewExtendedCodeBar((String) importExcel.getCellValue(row, 6));
+			reportDetails.setExtendedDescription((String) importExcel.getCellValue(row, 7));
+			reportDetails.setCompany((String) importExcel.getCellValue(row, 8));
+			reportDetails.setUnitPrice((String) importExcel.getCellValue(row, 9));
+			reportDetails.setQuantity((String) importExcel.getCellValue(row, 10));
+			reportDetails.setReserveProjectName(reserveProjectName);
+			reportDetails.preInsert();
+			reportDetailsList.add(reportDetails);
+		}
+		reportDetailsMapper.insertList(reportDetailsList);
+/*		String projectName = ((String) obj).trim();
+		MaterialProject project = mapper.findByReserveName(projectName);
+		//若年度物资上报统计表中存在该项目 则删除对应物资明细数据,否则在上报统计表中新增一条项目数据
+		if(project!=null){
+			mapper.deleteByPro(projectName);
+		}else{
+			MaterialProject materialProject = new MaterialProject();
+			materialProject.setReserveProjectName(projectName);
+			mapper.sa(materialProject);
+		}
+		//保存物资明细数据
+		ImportExcel pick = new ImportExcel(file,1,"领料清单");
+		List<MaterialInfo> materialInfos = MaterialInfoUtil.getData(pick,projectName);   //获取领料清单数据
+		List<MaterialInfo> list = MaterialInfoUtil.combineData(materialInfos);      //合并数据
+		saveList(list);
+		insertOldList(list);*/
+	}
+
+	@Transactional(readOnly = false)
+	public void delByName(NewMaterialReport newMaterialReport) {
+		mapper.delByName(newMaterialReport.getReserveProjectName());
+	}
+
+	public List<ReportDetails> exportList(List<NewMaterialReport> list) {
+		return mapper.exportList(list);
+	}
+}

+ 312 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/web/NewMaterialProjectController.java

@@ -0,0 +1,312 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.act.service.ActProcessService;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails;
+import com.jeeplus.modules.sg.annualmaterialreport.service.NewMaterialReportService;
+import com.jeeplus.modules.sg.annualmaterialreport.service.ReportDetailsService;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.entity.append;
+import com.jeeplus.modules.sg.audit.information.utils.ImportInformation;
+import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+
+import com.jeeplus.modules.sg.managementcenter.materialproject.util.ImportUtil;
+import com.jeeplus.modules.sg.managementcenter.materialproject.util.MaterialProUtil;
+import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
+import com.jeeplus.modules.sg.managementcenter.project.service.ProjectService;
+import com.jeeplus.modules.sg.managementcenter.project.util.ProjectImportUtil;
+import com.jeeplus.modules.sg.materialmodule.activiti.entity.NonPower;
+import com.jeeplus.modules.sg.materialmodule.activiti.service.NonPowerService;
+import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
+import com.jeeplus.modules.sg.picking.activiti.service.ShowListService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.shiro.authz.annotation.Logical;
+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.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.math.BigDecimal;
+import java.util.*;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/new/materialProject")
+public class NewMaterialProjectController extends BaseController {
+
+
+    @Autowired
+    private NewMaterialReportService newMaterialReportService;
+
+    @Autowired
+    private ReportDetailsService reportDetailsService;
+
+    @ModelAttribute
+    public NewMaterialReport get(@RequestParam(required = false) String id) {
+        NewMaterialReport entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = newMaterialReportService.get(id);
+        }
+        if (entity == null) {
+            entity = new NewMaterialReport();
+        }
+        return entity;
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequiresPermissions("new:materialProject:list")
+    @RequestMapping(value = "list")
+    public String list(NewMaterialReport newMaterialReport, Model model) {
+        model.addAttribute("newMaterialReport", newMaterialReport);
+        return "modules/sg/annualMaterialReport/newMaterialProjectList";
+    }
+
+    /**
+     * 列表数据
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:list")
+    @RequestMapping(value = "data")
+    public Map<String, Object> data(NewMaterialReport newMaterialReport, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<NewMaterialReport> page = newMaterialReportService.findPage(new Page<NewMaterialReport>(request, response), newMaterialReport);
+        return getBootstrapData(page);
+    }
+
+    /**
+     * 查看,增加,编辑表单页面
+     */
+    @RequiresPermissions(value = {"new:materialProject:view", "new:materialProject:add", "new:materialProject:edit"}, logical = Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(NewMaterialReport newMaterialReport, Model model) {
+        model.addAttribute("newMaterialReport", newMaterialReport);
+        return "modules/sg/annualMaterialReport/newMaterialProjectForm";
+    }
+
+    /**
+     * 保存
+     */
+    @ResponseBody
+    @RequiresPermissions(value = {"new:materialProject:add", "new:materialProject:edit"}, logical = Logical.OR)
+    @RequestMapping(value = "save")
+    public AjaxJson save(NewMaterialReport newMaterialReport, Model model) throws Exception {
+        AjaxJson j = new AjaxJson();
+        /**
+         * 后台hibernate-validation插件校验
+         */
+        String errMsg = beanValidator(newMaterialReport);
+        if (StringUtils.isNotBlank(errMsg)) {
+            j.setSuccess(false);
+            j.setMsg(errMsg);
+            return j;
+        }
+        //新增或编辑表单保存
+        newMaterialReportService.save(newMaterialReport);//保存
+        j.setSuccess(true);
+        j.setMsg("保存项目成功");
+        return j;
+    }
+
+    /**
+     * 删除项目
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:del")
+    @RequestMapping(value = "delete")
+    public AjaxJson delete(NewMaterialReport newMaterialReport) {
+        AjaxJson j = new AjaxJson();
+        newMaterialReportService.delete(newMaterialReport);
+        j.setMsg("删除项目成功");
+        return j;
+    }
+
+    /**
+     * 批量删除
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:del")
+    @RequestMapping(value = "deleteAll")
+    public AjaxJson deleteAll(String ids) {
+        AjaxJson j = new AjaxJson();
+        String[] idArray = ids.split(",");
+        for (String id : idArray) {
+            //通过id查询项目信息获取到储备项目名称,删除对应的年度物资上报信息及其明细信息
+            NewMaterialReport newMaterialReport = newMaterialReportService.get(id);
+            newMaterialReportService.delete(newMaterialReport);
+            reportDetailsService.delByName(newMaterialReport);
+        }
+        j.setMsg("删除项目成功");
+        return j;
+    }
+
+
+    /**
+     * 年度物资上报模板下载
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:export")
+    @RequestMapping(value = "templates")
+    public AjaxJson importFileTemplateS(HttpServletResponse response) {
+        AjaxJson j = new AjaxJson();
+        try {
+            String fileName = "年度物资上报统计模板.xlsx";
+            List<append> list = Lists.newArrayList();
+            new ExportExcel("", NewMaterialReport.class, 1).setDataList(list).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入送审下载失败!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
+
+    /**
+     * 项目列表导出
+     * @param newMaterialReport
+     * @param request
+     * @param response
+     * @return 返回符合条件的项目列表excel
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:export")
+    @RequestMapping(value = "export")
+    public AjaxJson export(NewMaterialReport newMaterialReport, HttpServletRequest request, HttpServletResponse response) {
+        AjaxJson j = new AjaxJson();
+        try {
+            String fileName = "年度物资上报统计物料详细" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+            List<ReportDetails> returnList = new ArrayList<>();
+            List<NewMaterialReport> list = newMaterialReportService.findList(newMaterialReport);
+            List<ReportDetails> reportDetailsList = reportDetailsService.exportList(list);
+            HashMap<String, ReportDetails> map = new HashMap<String, ReportDetails>();
+            for (ReportDetails a :
+                    reportDetailsList) {
+                String materialCode = a.getMaterialCode();
+                String materialDescription = a.getMaterialDescription();
+                String extendedDescription = a.getExtendedDescription();
+                String s = materialCode + materialDescription + extendedDescription;
+                if (map.containsKey(s)) {
+                    ReportDetails reportDetails = map.get(s);
+                    BigDecimal bigDecimal = new BigDecimal(reportDetails.getQuantity());
+                    BigDecimal bigDecimal1 = new BigDecimal(a.getQuantity());
+                    BigDecimal add = bigDecimal.add(bigDecimal1);
+                    reportDetails.setQuantity(add.toString());
+                    map.put(s, reportDetails);
+                } else {
+                    map.put(s, a);
+                }
+            }
+            for (String r :
+                    map.keySet()) {
+                ReportDetails reportDetails = map.get(r);
+                returnList.add(reportDetails);
+            }
+            new ExportExcel(null, ReportDetails.class).setDataList(returnList).write(response, fileName).dispose();
+            j.setSuccess(true);
+            j.setMsg("导出成功!");
+            return j;
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导出失败!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
+
+
+    /**
+     * 项目列表导出
+     * @param newMaterialReport
+     * @param request
+     * @param response
+     * @return 返回符合条件的项目列表excel
+     */
+    @ResponseBody
+    @RequiresPermissions("new:materialProject:export")
+    @RequestMapping(value = "exportPro")
+    public AjaxJson exportPro(NewMaterialReport newMaterialReport, HttpServletRequest request, HttpServletResponse response) {
+        AjaxJson j = new AjaxJson();
+        try {
+            String fileName = "年度物资上报统计" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+            Page<NewMaterialReport> page = newMaterialReportService.findPage(new Page<NewMaterialReport>(request, response, -1), newMaterialReport);
+            new ExportExcel(null, NewMaterialReport.class).setDataList(page.getList()).write(response, fileName).dispose();
+            j.setSuccess(true);
+            j.setMsg("导出成功!");
+            return j;
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导出失败!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
+
+
+
+    /**
+     * 导入年度物资上报后续信息
+     */
+    @RequiresPermissions("new:materialProject:import")
+    @ResponseBody
+    @RequestMapping(value = "import")
+    public AjaxJson importFileCom(@RequestParam("file") MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+        AjaxJson j = new AjaxJson();
+        List<NewMaterialReport> list = new ArrayList<>();
+        int successNum = 0;
+        try {
+            StringBuilder failureMsg = new StringBuilder();
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            int lastDataRowNum = ei.getLastDataRowNum();
+            for (int i = 1; i < lastDataRowNum; i++) {
+                NewMaterialReport newMaterialReport = new NewMaterialReport();
+                Row row = ei.getRow(i);
+                String cellValue = (String) ei.getCellValue(row, 0);
+                if (null == cellValue || "".equals(cellValue)) {
+                    continue;
+                }
+                newMaterialReport.setReserveProjectName(cellValue);
+                newMaterialReport.setReserveCode((String)ei.getCellValue(row, 1));
+                newMaterialReport.setProjectType((String)ei.getCellValue(row, 2));
+                newMaterialReport.setBatchPlan((String)ei.getCellValue(row, 3));
+                newMaterialReport.setIssuePlan((String)ei.getCellValue(row, 4));
+                newMaterialReport.setMonthPlan((String)ei.getCellValue(row, 5));
+                newMaterialReport.setHasPlan((String)ei.getCellValue(row, 6));
+                newMaterialReport.setHalfPlan((String)ei.getCellValue(row, 7));
+                newMaterialReport.setProjectId((String)ei.getCellValue(row, 8));
+                newMaterialReport.setProjectName((String)ei.getCellValue(row, 9));
+                list.add(newMaterialReport);
+                successNum++;
+            }
+            //批量更新年度物资上报信息
+            newMaterialReportService.updateList(list);
+            j.setMsg("已成功导入 " + successNum + " 项目管理记录" + failureMsg);
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入项审定日期失败!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
+}

+ 186 - 0
src/main/java/com/jeeplus/modules/sg/annualmaterialreport/web/ReportDetailsController.java

@@ -0,0 +1,186 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.annualmaterialreport.web;
+
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.NewMaterialReport;
+import com.jeeplus.modules.sg.annualmaterialreport.entity.ReportDetails;
+import com.jeeplus.modules.sg.annualmaterialreport.service.NewMaterialReportService;
+import com.jeeplus.modules.sg.annualmaterialreport.service.ReportDetailsService;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfoBean;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+import org.apache.poi.ss.usermodel.Row;
+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.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 新年度物资上报明细controller
+ *
+ * @author QY
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/annualMaterial/reportDetails")
+public class ReportDetailsController extends BaseController {
+
+	@Autowired
+	private ReportDetailsService reportDetailsService;
+
+	@Autowired
+	private NewMaterialReportService newMaterialReportService;
+
+	
+	@ModelAttribute
+	public ReportDetails get(@RequestParam(required=false) String id) {
+		ReportDetails entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = reportDetailsService.get(id);
+		}
+		if (entity == null){
+			entity = new ReportDetails();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 年度物资上报明细 列表页面
+	 */
+	@RequiresPermissions("annualMaterial:reportDetails:list")
+	@RequestMapping(value = "list")
+	public String list(ReportDetails reportDetails, Model model) {
+		model.addAttribute("reportDetails", reportDetails);
+		return "modules/sg/annualMaterialReport/annualMaterialReportList";
+	}
+	
+	/**
+	 * 年度物资上报明细 列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("annualMaterial:reportDetails:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(ReportDetails reportDetails, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ReportDetails> page = reportDetailsService.findPage(new Page<ReportDetails>(request, response), reportDetails);
+		return getBootstrapData(page);
+	}
+
+    /**
+     * 年度物资上报明细 多文件导入
+     */
+    @ResponseBody
+    @RequiresPermissions("annualMaterial:reportDetails:import")
+    @RequestMapping(value = "imports")
+    public AjaxJson importFile(@RequestParam("file")MultipartFile[] file, HttpServletResponse response, HttpServletRequest request) {
+        AjaxJson j = new AjaxJson();
+        try {
+            for(int i=0;i<file.length;i++) {
+				String originalFilename = file[i].getOriginalFilename();
+				originalFilename = originalFilename.substring(0, originalFilename.indexOf("_"));
+				reportDetailsService.saveData(file[i],originalFilename);
+            }
+            j.setMsg("导入成功");
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
+
+	/**
+	 * 年度物资上报明细 多文件导入页面
+	 */
+	@RequestMapping(value = "/importMore/Form")
+	public String importMoreForm(Model model){
+		return "modules/sg/annualMaterialReport/importMore";
+	}
+
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+	@RequiresPermissions("annualMaterial:reportDetails:export")
+	@RequestMapping(value = "export")
+	public AjaxJson exportFile(ReportDetails reportDetails, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		HttpSession session = request.getSession();
+		try {
+			String fileName = "年度物资上报表"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+			Page<ReportDetails> page = reportDetailsService.findPage(new Page<ReportDetails>(request, response, -1), reportDetails);
+			new ExportExcel("", ReportDetails.class).setDataList(page.getList()).write(response, fileName).dispose();
+			j.setSuccess(true);
+			j.setMsg("导出成功!");
+			return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出物料信息表单记录失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+    /**
+     * 新年度物资上报明细 多文件导入验证
+	 * 获取文件名称,根据_分割,获取项目名称
+	 * 若年度上报统计中已经存在某些项目,则返回消息由操作者选择是否进行覆盖,否则直接导入物资明细及项目信息
+     */
+    @ResponseBody
+    @RequestMapping(value = "importValidations")
+    public AjaxJson importValidations(@RequestParam("file")MultipartFile[] file) {
+        AjaxJson j = new AjaxJson();
+        List<ReportDetails> list = new ArrayList<>();
+		List<String> searchList = new ArrayList<>();
+        try {
+        	//获取项目名称列表
+            for(int i = 0;i<file.length;i++) {
+				String name = file[i].getOriginalFilename();
+				name = name.substring(0, name.indexOf("_"));
+				System.out.println(name);
+				searchList.add(name);
+            }
+            List<NewMaterialReport> projects = newMaterialReportService.findByList(searchList);
+            //判断是否有已存在项目
+            if(projects != null && projects.size()>0){
+            	StringBuilder stringBuilder = new StringBuilder();
+            	for(ReportDetails reportDetails : list){
+            		stringBuilder.append(reportDetails.getReserveProjectName()+",");
+				}
+            	j.setMsg(stringBuilder.toString());
+                j.setSuccess(true);
+            }else {
+                for(int k=0;k<file.length;k++) {
+					String originalFilename = file[k].getOriginalFilename();
+					originalFilename = originalFilename.substring(0, originalFilename.indexOf("_"));
+                    reportDetailsService.saveData(file[k],originalFilename);
+                }
+                j.setSuccess(true);
+                j.setErrorCode("0");
+                j.setMsg("导入成功");
+            }
+        } catch (Exception e) {
+            j.setSuccess(true);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
+}

+ 229 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/annualMaterialReportList.js

@@ -0,0 +1,229 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+    <script>
+    $(document).ready(function () {
+        $('#dataTable').bootstrapTable({
+
+            //请求方法
+            method: 'post',
+            //类型json
+            dataType: "json",
+            contentType: "application/x-www-form-urlencoded",
+            //显示检索按钮
+            showSearch: true,
+            //显示刷新按钮
+            showRefresh: true,
+            //显示切换手机试图按钮
+            showToggle: true,
+            //显示 内容列下拉框
+            showColumns: true,
+            //显示到处按钮
+            showExport: true,
+            //显示切换分页按钮
+            showPaginationSwitch: true,
+            //最低显示2行
+            minimumCountColumns: 2,
+            //是否显示行间隔色
+            striped: true,
+            //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+            cache: false,
+            //是否显示分页(*)
+            pagination: true,
+            //排序方式
+            sortOrder: "asc",
+            //初始化加载第一页,默认第一页
+            pageNumber: 1,
+            //每页的记录行数(*)
+            pageSize: 10,
+            //可供选择的每页的行数(*)
+            pageList: [10, 25, 50, 100],
+            //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
+            url: "${ctx}/annualMaterial/reportDetails/data",
+            //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+            //queryParamsType:'',
+            ////查询参数,每次调用是会带上这个参数,可自定义
+            queryParams: function (params) {
+                var searchParam = $("#searchForm").serializeJSON();
+                searchParam.pageNo = params.limit === undefined ? "1" : params.offset / params.limit + 1;
+                searchParam.pageSize = params.limit === undefined ? -1 : params.limit;
+                searchParam.orderBy = params.sort === undefined ? "" : params.sort + " " + params.order;
+                return searchParam;
+            },
+            //分页方式:client客户端分页,server服务端分页(*)
+            sidePagination: "server",
+            contextMenuTrigger: "right",//pc端 按右键弹出菜单
+            contextMenuTriggerMobile: "press",//手机端 弹出菜单,click:单击, press:长按。
+            contextMenu: '#context-menu',
+            onContextMenuItem: function (row, $el) {
+                if ($el.data("item") == "edit") {
+                    edit(row.id);
+                } else if ($el.data("item") == "view") {
+                    view(row.id);
+                } else if ($el.data("item") == "delete") {
+                    jp.confirm('确认要删除该数据记录吗?', function () {
+                        jp.loading();
+                        jp.get("${ctx}/annualMaterial/reportDetails/delete?id=" + row.id, function (data) {
+                            if (data.success) {
+                                $('#dataTable').bootstrapTable('refresh');
+                                jp.success(data.msg);
+                            } else {
+                                jp.error(data.msg);
+                            }
+                        })
+
+                    });
+
+                }
+            },
+            onClickRow: function (row, $el) {
+            },
+            onLoadSuccess: function () {  //加载成功时执行
+                getTdValue();
+            },
+            onShowSearch: function () {
+                $("#search-collapse").slideToggle();
+            },
+            columns: [
+                {
+                    field: 'reserveProjectName',
+                    width: 230,
+                    title: '储备项目名称'
+                }
+                , {
+                    field: 'materialCode',
+                    width: 100,
+                    title: '物料编码'
+                }
+                , {
+                    field: 'materialDescription',
+                    width: 200,
+                    title: '物料描述'
+                }
+                , {
+                    field: 'newExtendedCodeBar',
+                    width: 200,
+                    title: '新扩展编码栏'
+                }
+                , {
+                    field: 'extendedDescription',
+                    width: 200,
+                    title: '扩展描述'
+                }
+                , {
+                    field: 'company',
+                    width: 60,
+                    title: '单位'
+                }
+                , {
+                    field: 'unitPrice',
+                    width: 60,
+                    title: '单价'
+                }
+                , {
+                    field: 'quantity',
+                    width: 60,
+                    title: '数量'
+                }
+            ]
+
+        });
+
+
+        if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端
+
+
+            $('#dataTable').bootstrapTable("toggleView");
+        }
+
+        $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+            'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', !$('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length != 1);
+        });
+
+        $("#moreImport").click(function () {
+            jp.open({
+                type: 2,
+                area: [800, 400],
+                auto: true,
+                title: "导入数据",
+                content: "${ctx}/annualMaterial/reportDetails/importMore/Form",
+                btn: ['确定', '关闭'],
+                btn1: function (index, layero) {
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    iframeWin.contentWindow.importExcel('${ctx}/annualMaterial/reportDetails/importValidations', function (data) {
+                        if (data.success) {
+                            jp.success(data.msg);
+                            refresh();
+                        } else {
+                            jp.error(data.msg);
+                        }
+                        jp.close(index);
+                    });//调用保存事件
+                    return false;
+                },
+                btn2: function (index) {
+                    jp.close(index);
+                }
+            });
+        })
+
+
+        $("#export").click(function () {//导出Excel文件
+            let reserveProjectName = $("#reserveProjectName").val();
+            let materialCode = $("#materialCode").val();
+            let materialDescription = $("#materialDescription").val();
+            jp.downloadFile('${ctx}/annualMaterial/reportDetails/export?reserveProjectName=' + reserveProjectName + '&materialCode=' + materialCode + '&materialDescription=' + materialDescription);
+        });
+
+
+        $("#search").click("click", function () {// 绑定查询按扭
+            $('#dataTable').bootstrapTable('refresh');
+        });
+
+
+        $("#reset").click("click", function () {// 绑定查询按扭
+            $("#searchForm  input").val("");
+            $("#searchForm  select").val("");
+            $("#searchForm  .select-item").html("");
+            $('#dataTable').bootstrapTable('refresh');
+        });
+
+
+    });
+
+function getIdSelections() {
+    return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+        return row.id
+    });
+}
+
+
+function getTdValue() {
+}
+
+
+//刷新列表
+function refresh() {
+    $('#dataTable').bootstrapTable('refresh');
+}
+
+function add() {
+    jp.openSaveDialog('新增', "${ctx}/annualMaterial/reportDetails/form", '800px', '500px');
+}
+
+
+function edit(id) {//没有权限时,不显示确定按钮
+    if (id == undefined) {
+        id = getIdSelections();
+    }
+    jp.openSaveDialog('编辑', "${ctx}/annualMaterial/reportDetails/form?id=" + id, '800px', '500px');
+}
+
+function view(id) {//没/managementcenter/materialproject/data有权限时,不显示确定按钮
+    if (id == undefined) {
+        id = getIdSelections();
+    }
+    jp.openViewDialog('查看', "${ctx}/annualMaterial/reportDetails/form?id=" + id, '800px', '500px');
+}
+
+</script>

+ 70 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/annualMaterialReportList.jsp

@@ -0,0 +1,70 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>年度物资上报明细</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="annualMaterialReportList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">年度物资上报明细</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="reportDetails" class="form form-horizontal well clearfix">
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="储备项目名称:">储备项目名称:</label>
+					<form:input path="reserveProjectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="物料编码:">物料编码:</label>
+					<form:input path="materialCode" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="物料描述:">物料描述:</label>
+					<form:input path="materialDescription" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+		<div id="toolbar">
+			<shiro:hasPermission name="annualMaterial:reportDetails:import">
+	        		<button id="moreImport" class="btn btn-info">
+					<i class="fa fa-file-excel-o"></i> 多文件导入
+				</button>
+			 </shiro:hasPermission>
+				<shiro:hasPermission name="annualMaterial:reportDetails:export">
+					<button id="export" class="btn btn-warning">
+						<i class="fa fa-file-excel-o"></i> 导出
+					</button>
+				</shiro:hasPermission>
+		</div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"  style="table-layout:fixed"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 207 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/importMore.jsp

@@ -0,0 +1,207 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<link rel="stylesheet" href="${ctxStatic}/plugin/layui/dist/css/layui.css">
+<script src="${pageContext.request.contextPath}/act/rest/js/common/jquery-1.8.3.js"></script>
+<script src="${ctxStatic}/plugin/layui/dist/layui.js"></script>
+<script src="${ctxStatic}/common/js/jeeplus.js"></script>
+
+<html>
+<head>
+    <title>添加</title>
+    <meta http-equiv=Content-Type content=“text/html;charset=utf-8″>
+    <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7>
+    <meta name="renderer" content="webkit">
+    <style>
+        .layui-input{ height: 28px;margin-top: 6px;line-height: 28px}
+        .layui-table-view .layui-table {width:100%}
+        .myselect{border: none;padding: 5px 7px;min-height: 20px;color: #666666;line-height: 20px}
+        .mydiv{padding: 5px 7px;min-height: 20px;border: whitesmoke;line-height: 20px}
+        .mydiv:empty:before{content: attr(placeholder);color:#999999;}
+        .mydiv:focus:before{content:none}
+        .layui-table-tips-main{display:none}
+        .layui-table-tips-c{display:none}
+    </style>
+</head>
+<body style="height: 100%;line-height: 100%">
+<div style="padding: 10px;">
+    <div class="layui-main-bgc">
+        <div class="layui-row layui-col-space15">
+            <div class="layui-col-md12">
+                <div class="layui-card">
+                        <div class="layui-card-body" style="margin-top: 2px;">
+                            <div class="layui-upload">
+                                <button type="button" class="layui-btn layui-btn-normal" id="add_List">添加文件</button>
+                                <div class="layui-upload-list">
+                                        <table class="layui-table" id="mytable">
+                                        <thead>
+                                        <tr>
+                                            <th width="45%">*文件名称</th>
+                                            <th width="22%" style="text-align: center">操作</th>
+                                        </tr></thead>
+                                        <tbody id="tbody_List">
+                                        </tbody>
+                                    </table>
+                                </div>
+                        </div>
+                    </div>
+                </div>
+             </div>
+        </div>
+    </div>
+</div>
+</body>
+<script type="text/javascript">
+    /*//定义存放文件数组*/
+    var arrayFile=[];
+    /*加载layui文件上传*/
+    layui.use('upload', function(){
+        var $ = layui.jquery
+            ,upload = layui.upload;
+        //多文件列表示例
+        var tbodyListView = $('#tbody_List')
+            ,uploadListIns = upload.render({
+            elem: '#add_List'
+            ,accept: 'file'
+            ,exts:'xls|xlsx'
+            ,multiple: true
+            ,auto: false
+            ,choose: function(obj){
+                // var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
+                //读取本地文件
+                obj.preview(function(index, file, result){
+                    //添加 id 到数组
+                    arrayFile.push(index);
+                    //添加文件到数组
+                    arrayFile.push(file);
+                    //拼接生成表格
+                    var tr = $(['<tr id='+index+'>'
+                        ,'<td hidden><div class="td_id">'+index+'</div></td>'
+                        ,'<td readonly="readonly"><input id="myDiv" type="textarea" style="width: 100%" contenteditable="true" readonly="true" disabled="true" class="mydiv1 mydiv" placeholder="请输入项目名称" value="'+file.name.split(".")[0]+'"></input></td>'
+                        // ,'<td>'
+                        // ,' <select name="type" class="myselect"><option value="">请选择项目类型</option><option value="1">架空线路工程</option><option value="2">电缆工程</option><option value="3">变电站工程</option></select>'
+                        // ,'<td><div contenteditable="true" class="mydiv2 mydiv" placeholder="请输入项目编号"></div></td>'
+                        // ,'<td><div contenteditable="true" class="mydiv3 mydiv" placeholder="请输入供应商"></div></td>'
+                        ,'<td style="text-align: center">'
+                        ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
+                        ,'</td>'
+                        ,'</tr>'].join(''));
+                    //删除
+                    tr.find('.demo-delete').on('click', function(){
+                        // delete files[index]; //删除对应的文件
+                        tr.remove();//删除tr
+                        //清空input file当中已经存在文件
+                        uploadListIns.config.elem.next()[0].value = '';
+                    });
+
+                    tbodyListView.append(tr);
+                    //清空input file当中已经存在文件
+                    uploadListIns.config.elem.next()[0].value = '';
+                });
+            }
+        });
+    });
+
+    function importExcel(url, fn) {
+        var formdata = new FormData();
+        // 获取表格id的值
+        var file = $(":file").val;
+        //获取输入的项目名称
+        var div1 =  $(".mydiv1");
+        console.log(div1);
+        //判断列表中项目名称是否为空
+        if (div1.length<=0){
+            layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        //存储列表中 输入项目名称的值
+        var divvalue=[];
+        //存储列表中 输入项目名称的值
+        var div_val=[];
+        //循环获取当前项目列表的项目名称
+        for (var i = 0; i < div1.length; i++) {
+            //存放到集合当中
+            divvalue[i]=div1[i].defaultValue;
+            console.log('div1[i].defaultValue');
+            console.log(div1[i].defaultValue);
+            div_val[i]=div1[i].defaultValue;
+        }
+        //判断项目名称是否重复
+        for (var i = 0; i < divvalue.length; i++) {
+            if(div_val[i] === divvalue[i+1]){
+                layer.msg("选择文件重复",{icon: 5,offset:['40%','40%']});
+                throw SyntaxError;
+            }
+        }
+        //根据id获取对象文件传入后台
+        for (var j = 0; j < arrayFile.length; j++) {
+            //追加文件到表单当中
+            formdata.append("file",arrayFile[j+1]);
+        }
+        jp.loading('  正在导入,请稍等...');
+        $.ajax({
+            type: "POST",
+            enctype: 'multipart/form-data',
+            url: url,
+            data: formdata,
+            processData: false, //prevent jQuery from automatically transforming the data into a query string
+            contentType: false,
+            cache: false,
+            timeout: 600000,
+            success: function (result) {
+                if(result.success && result.errorCode === '-1'){
+                    jp.confirm('项目'+result.msg+'已存在,确定覆盖嘛?', function(){
+                        jp.loading('  正在导入,请稍等...');
+                        $.ajax({
+                            type: "POST",
+                            enctype: 'multipart/form-data',
+                            url: '${ctx}/annualMaterial/reportDetails/imports',
+                            data: formdata,
+                            processData: false, //prevent jQuery from automatically transforming the data into a query string
+                            contentType: false,
+                            cache: false,
+                            timeout: 600000,
+                            success: function (result) {
+                                fn(result);
+                            }
+                        })
+                    });
+                }else if((result.success && result.errorCode === '0')){
+                    fn(result)
+                }
+            },
+            error:function(xhr, textStatus){
+                if(xhr.status == 0){
+                    jp.info("连接失败,请检查网络!")
+                }else if(xhr.status == 404){
+                    var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"请求出错"
+                    })
+                }else if(xhr.status && xhr.responseText){
+                    var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['80%','70%'],
+                        title:xhr.status+"错误"
+                    })
+                }else{
+                    var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"真悲剧,后台抛出异常了"
+                    })
+                }
+            }
+        })
+    }
+</script>
+<script>
+    layui.use('form',function () {
+        var  form = layui.form;
+        form.render();
+    })
+</script>
+</html>

+ 104 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectForm.jsp

@@ -0,0 +1,104 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>年度物资上报统计</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			// $('#startDate').datetimepicker({
+			// 	format: "YYYY-MM-DD"
+			// });
+			// $('#endDate').datetimepicker({
+			// 	format: "YYYY-MM-DD"
+			// });
+		});
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/new/materialProject/save",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="newMaterialReport" class="form-horizontal">
+		<form:hidden path="id"/>	
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">储备项目名称:</label></td>
+					<td class="width-35">
+						<form:input path="reserveProjectName" htmlEscape="false" class="form-control required" readonly="true"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">储备编码:</label></td>
+					<td class="width-35">
+						<form:input path="reserveCode" htmlEscape="false"    class="form-control "/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">项目类型:</label></td>
+					<td class="width-35">
+						<form:input path="projectType" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目计划年度批次:</label></td>
+					<td class="width-35">
+						<form:input path="batchPlan" htmlEscape="false"    class="form-control "/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">项目正式发文批次:</label></td>
+					<td class="width-35">
+						<form:input path="issuePlan" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目年度实施计划(月份):</label></td>
+					<td class="width-35">
+						<form:input path="monthPlan" htmlEscape="false"    class="form-control "/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">年度计划有无预测:</label></td>
+					<td class="width-35">
+						<form:input path="hasPlan" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目物资执行计划(上半年/下半年):</label></td>
+					<td class="width-35">
+						<form:input path="halfPlan" htmlEscape="false"    class="form-control "/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">项目定义:</label></td>
+					<td class="width-35">
+						<form:input path="projectId"  htmlEscape="false"  class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">项目名称:</label></td>
+					<td class="width-35">
+						<form:input path="projectName"  htmlEscape="false"  class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">归属年份:</label></td>
+					<td class="width-35">
+						<form:input path="attributionYear" readonly="true" htmlEscape="false" class="form-control required"/>
+					</td>
+				</tr>
+		 	</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 288 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectList.js

@@ -0,0 +1,288 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#dataTable').bootstrapTable({
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/new/materialProject/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该数据记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/new/materialProject/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#dataTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+
+		    }
+			,{
+		        field: 'reserveProjectName',
+		        title: '储备项目暂定名称',
+               formatter:function(value, row , index){
+                   value = jp.unescapeHTML(value);
+                   return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+               }
+		    }
+			,{
+                  field: 'reserveCode',
+                  title: '储备编码'
+		    }
+			,{
+		              field: 'projectType',
+		              title: '项目类型'
+		    }
+		    ,{
+					   field: 'batchPlan',
+					   title: '项目计划年度批次'
+               }
+             ,{
+					   field: 'issuePlan',
+					   title: '项目正式发文批次'
+               }
+             ,{
+					   field: 'monthPlan',
+                       width:200,
+					   title: '项目年度实施计划(月份)'
+               }
+             ,{
+					   field: 'hasPlan',
+					   title: '年度计划有无预测'
+               }
+               ,{
+                   field: 'halfPlan',
+                   width:260,
+                   title: '项目物资执行计划(上半年/下半年)'
+               }
+               ,{
+                       field: 'projectId',
+                       title: '项目定义'
+                }
+               ,{
+                   field: 'projectName',
+                   title: '项目名称'
+               },{
+                       field: 'attributionYear',
+                       title: '归属年份'
+                   }
+
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#dataTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length!=1);
+        });
+    $("#btnImport").click(function(){
+        jp.open({
+            type: 2,
+            area: [500, 200],
+            auto: true,
+            title:"导入数据",
+            content: "${ctx}/tag/importExcel" ,
+            btn: ['确定', '关闭'],
+            btn1: function(index, layero){
+                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                iframeWin.contentWindow.importExcel('${ctx}/new/materialProject/import', function (data) {
+                    if(data.success){
+                        jp.success(data.msg);
+                        refresh();
+                    }else{
+                        jp.error(data.msg);
+                    }
+                    jp.close(index);
+                });//调用保存事件
+                return false;
+            },
+            btn2: function(index){
+                //  jp.close(index);
+            }
+        });
+    });
+
+		
+		
+	 $("#export").click(function(){//导出Excel文件物料
+         let reserveProjectName  = $("reserveProjectName").val();
+         let reserveCode  = $("reserveCode").val();
+         let projectType  = $("projectType").val();
+         let batchPlan  = $("batchPlan").val();
+         let issuePlan  = $("issuePlan").val();
+         let monthPlan  = $("monthPlan").val();
+         let hasPlan  = $("hasPlan").val();
+         let halfPlan  = $("halfPlan").val();
+         let projectId  = $("projectId").val();
+         let projectName  = $("projectName").val();
+			jp.downloadFile('${ctx}/new/materialProject/export?reserveProjectName='+reserveProjectName
+                +'&reserveCode='+reserveCode
+                +'&projectType='+projectType
+                +'&batchPlan='+batchPlan
+                +'&issuePlan='+issuePlan
+                +'&monthPlan='+monthPlan
+                +'&hasPlan='+hasPlan
+                +'&halfPlan='+halfPlan
+                +'&projectId='+projectId
+                +'&projectName='+projectName);
+	  });
+    $("#exportpro").click(function(){//导出Excel文件
+        let reserveProjectName  = $("reserveProjectName").val();
+        let reserveCode  = $("reserveCode").val();
+        let projectType  = $("projectType").val();
+        let batchPlan  = $("batchPlan").val();
+        let issuePlan  = $("issuePlan").val();
+        let monthPlan  = $("monthPlan").val();
+        let hasPlan  = $("hasPlan").val();
+        let halfPlan  = $("halfPlan").val();
+        let projectId  = $("projectId").val();
+        let projectName  = $("projectName").val();
+         jp.downloadFile('${ctx}/new/materialProject/exportPro?reserveProjectName='+reserveProjectName
+             +'&reserveCode='+reserveCode
+             +'&projectType='+projectType
+             +'&batchPlan='+batchPlan
+             +'&issuePlan='+issuePlan
+             +'&monthPlan='+monthPlan
+             +'&hasPlan='+hasPlan
+             +'&halfPlan='+halfPlan
+             +'&projectId='+projectId
+             +'&projectName='+projectName);
+    });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+		jp.confirm('确认要删除该项目信息?,会删除该项目所有基础信息及详细信息。', function(){
+			jp.loading();  	
+			jp.get("${ctx}/new/materialProject/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#dataTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#dataTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增', "${ctx}/new/materialProject/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑', "${ctx}/new/materialProject/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看', "${ctx}/new/materialProject/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 105 - 0
src/main/webapp/webpage/modules/sg/annualMaterialReport/newMaterialProjectList.jsp

@@ -0,0 +1,105 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>年度物资上报统计</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="newMaterialProjectList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">年度物资上报统计</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="newMaterialReport" class="form form-horizontal well clearfix">
+			    <div class="col-xs-12 col-sm-6 col-md-4">
+				   <label class="label-item single-overflow pull-left" title="储备项目暂定名称:">储备项目暂定名称:</label>
+				   <form:input path="reserveProjectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+			    </div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="储备编码:">储备编码:</label>
+					<form:input path="reserveCode" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目类型:">项目类型:</label>
+					<form:input path="projectType" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目计划年度批次:">项目计划年度批次:</label>
+					<form:input path="batchPlan" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目正式发文批次:">项目正式发文批次:</label>
+					<form:input path="issuePlan" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目年度实施计划:">项目年度实施计划:</label>
+					<form:input path="monthPlan" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="年度计划有无预测:">年度计划有无预测:</label>
+					<form:input path="hasPlan" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目物资执行计划:">项目物资执行计划:</label>
+					<form:input path="halfPlan" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目定义:">项目定义:</label>
+					<form:input path="projectId" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				<div class="col-xs-12 col-sm-6 col-md-4">
+					<label class="label-item single-overflow pull-left" title="项目名称:">项目名称:</label>
+					<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control"/>
+				</div>
+				 <div class="col-xs-12 col-sm-6 col-md-4">
+					<div style="margin-top:26px">
+					  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+					  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+					 </div>
+				</div>
+			</form:form>
+		</div>
+	</div>
+	
+		<!-- 工具栏 -->
+			<div id="toolbar">
+				<shiro:hasPermission name="new:materialProject:del">
+					<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+						<i class="glyphicon glyphicon-remove"></i> 删除项目
+					</button>
+				</shiro:hasPermission>
+				<shiro:hasPermission name="new:materialProject:import">
+					<button id="btnImport" class="btn btn-info">
+						<i class="fa fa-folder-open-o"></i> 导入
+					</button>
+				</shiro:hasPermission>
+				<shiro:hasPermission name="new:materialProject:export">
+						<button id="export" class="btn btn-warning">
+						<i class="fa fa-file-excel-o"></i> 导出物料
+					</button>
+				 </shiro:hasPermission>
+				<shiro:hasPermission name="new:materialProject:export">
+					<button id="exportpro" class="btn btn-warning">
+						<i class="fa fa-file-excel-o"></i> 导出项目
+					</button>
+				</shiro:hasPermission>
+			</div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"  style="table-layout:fixed"   data-toolbar="#toolbar"></table>
+
+	</div>
+	</div>
+	</div>
+</body>
+</html>