Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

xs 5 лет назад
Родитель
Сommit
150c48ce7c
19 измененных файлов с 1486 добавлено и 21 удалено
  1. 5 7
      src/main/java/com/jeeplus/modules/sg/audit/information/entity/OutInformation.java
  2. 9 0
      src/main/java/com/jeeplus/modules/sg/audit/report/entity/SgReport.java
  3. 4 0
      src/main/java/com/jeeplus/modules/sg/audit/report/mapper/ReportMapper.java
  4. 107 10
      src/main/java/com/jeeplus/modules/sg/audit/report/mapper/xml/ReportMapper.xml
  5. 73 0
      src/main/java/com/jeeplus/modules/sg/audit/report/service/ReportService.java
  6. 118 0
      src/main/java/com/jeeplus/modules/sg/audit/report/web/ReportController.java
  7. 157 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialStandard.java
  8. 15 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialVersion.java
  9. 24 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialVersionMapper.java
  10. 137 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialVersionMapper.xml
  11. 88 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java
  12. 199 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java
  13. 3 2
      src/main/webapp/webpage/modules/sg/audit/report/reportList.jsp
  14. 3 2
      src/main/webapp/webpage/modules/sg/audit/report/reportList1.jsp
  15. 130 0
      src/main/webapp/webpage/modules/sg/audit/report/reportList2.jsp
  16. 5 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp
  17. 108 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/importexcel.jsp
  18. 218 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.js
  19. 83 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.jsp

+ 5 - 7
src/main/java/com/jeeplus/modules/sg/audit/information/entity/OutInformation.java

@@ -14,8 +14,6 @@ public class OutInformation {
     private String projectName;
     //	项目类型
     private String projectType;
-    //工作状态(是否关闭)
-    private String outConstruction;
     //	审定日期
     private Date approvalDate;
     //是否完成甲供物资领退料
@@ -53,7 +51,7 @@ public class OutInformation {
     //	实际竣工日期
     private Date projectStop;
     //施工单位
-    private String construction;
+    private String department;
     //	结算审计单位名称
     private String projectFirm;
     //	提交送审日期
@@ -269,12 +267,12 @@ public class OutInformation {
     }
 
     @ExcelField(title="施工单位", align=2, sort=23)
-    public String getConstruction() {
-        return construction;
+    public String getDepartment() {
+        return department;
     }
 
-    public void setConstruction(String construction) {
-        this.construction = construction;
+    public void setDepartment(String department) {
+        this.department = department;
     }
 
     @ExcelField(title="结算审计单位名称", align=2, sort=24)

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/entity/SgReport.java

@@ -14,6 +14,15 @@ public class SgReport extends DataEntity<SgReport> {
     private String endDate;
     private Integer finishCount;
     private Integer unfinishCount;
+    private String condition;
+
+    public String getCondition() {
+        return condition;
+    }
+
+    public void setCondition(String condition) {
+        this.condition = condition;
+    }
 
     public String getName() {
         return name;

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/mapper/ReportMapper.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.sg.audit.report.mapper;
 
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
 import com.jeeplus.modules.sg.audit.report.entity.SgReport;
 
 import java.util.List;
@@ -16,4 +17,7 @@ public interface ReportMapper extends BaseMapper<SgReport> {
    List<SgReport> findList(SgReport sgReport);
    List<SgReport> findUnitData(SgReport sgReport);
    List<SgReport> findUnitList(SgReport sgReport);
+   List<SgReport> findSecondData(SgReport sgReport);
+   List<SgReport> findSecondList(SgReport sgReport);
+   List<Information> findInformationList(SgReport sgReport);
 }

+ 107 - 10
src/main/java/com/jeeplus/modules/sg/audit/report/mapper/xml/ReportMapper.xml

@@ -1,7 +1,33 @@
 <?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.audit.report.mapper.ReportMapper">
-
+	<sql id="newInformationColumns">
+		a.id,
+		a.project_id,
+		a.project_name,
+		a.project_type,
+		a.project_grade,
+		a.project_year,
+		a.project_total,
+		a.project_start,
+		a.project_stop,
+		a.department,
+		a.project_firm,
+		a.subDate,
+		a.releaseDate,
+		a.endDate,
+		a.resultDate,
+		a.approvalDate,
+		a.second_units,
+		a.first_units,
+		a.firstFinish,
+		a.firstFinishDate,
+		a.secondFinish,
+		a.secondFinishDate,
+		a.finishDate,
+		a.overdue,
+		a.underCentralized
+	</sql>
 	<select id="findData" resultType="SgReport" parameterType="SgReport">
 		SELECT a.department as name ,
 		sum(a.st1) as finishCount,
@@ -111,17 +137,88 @@
 
 	</select>
 
+	<select id="findSecondData" resultType="SgReport" parameterType="SgReport">
+		SELECT a.second_units as name,
+		sum(a.st1) as finishCount,
+		SUM(a.st2) as unfinishCount
+		from
+		(SELECT if(t1.second_units is null,'未知部门',t1.second_units) as second_units,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',0,1) as st1,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',1,0) as st2
+		from sj_project_information t1
+		<where>
+			1=1
+			<if test="dataScope != null and dataScope != ''">
+				${dataScope}
+			</if>
+		</where>
+		) a
+		GROUP BY a.second_units
+	</select>
 
+	<select id="findSecondList" parameterType="SgReport" resultType="SgReport">
+		SELECT b.second_units as name,
+		sum(b.level1) as level1,
+		sum(b.level2) as level2,
+		sum(b.level3) as level3,
+		sum(b.level4) as level4 from
+		(SELECT a.id, a.second_units,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;=7,1,0) as level1,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;= 14 and DATEDIFF(a.da, a.approvalDate)&gt;7,1,0) as level2,
+		if(DATEDIFF(a.da, a.approvalDate)&lt;= 21 and DATEDIFF(a.da, a.approvalDate)&gt;14,1,0) as level3,
+		if(DATEDIFF(a.da, a.approvalDate)&gt;21 or a.approvalDate is null,1,0) as level4,
+		a.status as status
+		from
+		(SELECT id,
+		if(t1.second_units is null,'未知部门',t1.second_units) as second_units,
+		if(t1.firstFinish='否' or t1.secondFinish = '否',NOW(),if(t1.secondFinish = '是',t1.secondFinishDate,t1.firstFinishDate) )as da ,
+		t1.approvalDate ,if(t1.firstFinish='否' or t1.secondFinish = '否','0','1') as status
+		from sj_project_information t1
+		<where>
+			1=1
+			<if test="dataScope != null and dataScope != ''">
+				${dataScope}
+			</if>
+		</where>
+		) a
+		<where>
+			<if test="status != null and status != ''">
+				a.status = #{status} and
+			</if>
+			1=1
+		</where>
+		) b   GROUP BY b.second_units
 
+	</select>
 
 
-
-
-
-
-
-	
-
-
-
+	<select id="findInformationList" resultType="Information">
+		SELECT
+		<include refid="newInformationColumns"/>,b.trial,b.appendStatus,
+		datediff(if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate)),approvalDate) as newdate
+		FROM sj_project_information as a
+		left JOIN sj_project_append as b on a.project_id = b.project_id
+		<where>
+			1=1
+			<if test="type!=null and type!=''">
+				<if test="type==0">
+					and a.department = #{condition}
+				</if>
+				<if test="type==1">
+					and a.underCentralized = #{condition}
+				</if>
+				<if test="type==2">
+					and a.second_units = #{condition}
+				</if>
+			</if>
+			<if test="status!=null and status !=''">
+				<if test="status==0">
+					and a.firstFinish='是' and (a.secondFinish != '否' or a.secondFinish is null)
+				</if>
+				<if test="status==1">
+					and (a.firstFinish='否' or a.secondFinish = '否')
+				</if>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 73 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/service/ReportService.java

@@ -1,11 +1,15 @@
 package com.jeeplus.modules.sg.audit.report.service;
 
 import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.mapper.InformationMapper;
 import com.jeeplus.modules.sg.audit.report.entity.SgReport;
 import com.jeeplus.modules.sg.audit.report.mapper.ReportMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -13,6 +17,9 @@ public class ReportService extends CrudService<ReportMapper, SgReport> {
     @Autowired
     private ReportMapper reportMapper;
 
+    @Autowired
+    private InformationMapper informationMapper;
+
 
     public List<SgReport> findData(SgReport sgReport){
         dataRuleFilter(sgReport);
@@ -33,4 +40,70 @@ public class ReportService extends CrudService<ReportMapper, SgReport> {
         dataRuleFilter(sgReport);
         return reportMapper.findUnitList(sgReport);
     }
+    public List<SgReport> findSecondList(SgReport sgReport){
+        dataRuleFilter(sgReport);
+        return reportMapper.findSecondList(sgReport);
+    }
+
+    public List<SgReport> findSecondData(SgReport sgReport){
+        dataRuleFilter(sgReport);
+        return reportMapper.findSecondData(sgReport);
+    }
+
+    public List<Information> findInformationList(SgReport sgReport) {
+        dataRuleFilter(sgReport);
+        List<Information> list = reportMapper.findInformationList(sgReport);
+        String find = informationMapper.findOverTime("overTime");
+        int overTime = Integer.parseInt(find);
+        Calendar cal = Calendar.getInstance();
+        long between_days = 0;
+        for (Information in : list) {
+            //判断审定日期是否为空
+//			if (in.getApprovalDate() != null) {
+            //格式化审定日期
+            if ("否".equals(in.getFirstFinish()) || "否".equals(in.getSecondFinish())) {
+                in.setComplete("否");
+                if (in.getApprovalDate() != null) {
+                    cal.setTime(in.getApprovalDate());
+                    long appDay = cal.getTimeInMillis();
+                    cal.setTime(new Date());
+                    long nowDate = cal.getTimeInMillis();
+                    between_days = (nowDate - appDay) / (1000 * 3600 * 24);
+                    in.setNoFinishDate(String.valueOf(between_days) + "天");
+                }
+            } else {
+                in.setComplete("是");
+                if (in.getApprovalDate() != null) {
+                    cal.setTime(in.getApprovalDate());
+                    long appDay = cal.getTimeInMillis();
+                    if (in.getFirstFinishDate() != null || in.getSecondFinishDate() != null) {
+                        if (in.getSecondFinishDate() != null) {
+                            cal.setTime(in.getSecondFinishDate());
+                            long secondDate = cal.getTimeInMillis();
+                            between_days = (secondDate - appDay) / (1000 * 3600 * 24);
+                            in.setFinishDate(String.valueOf(between_days) + "天");
+                            if (between_days > overTime) {
+                                in.setOverdue("是");
+                            } else {
+                                in.setOverdue("否");
+                            }
+                        } else {
+                            cal.setTime(in.getFirstFinishDate());
+                            long firstDate = cal.getTimeInMillis();
+                            between_days = (firstDate - appDay) / (1000 * 3600 * 24);
+                            in.setFinishDate(String.valueOf(between_days) + "天");
+                            if (between_days > overTime) {
+                                in.setOverdue("是");
+                            } else {
+                                in.setOverdue("否");
+                            }
+                        }
+                    }
+                }
+            }
+//			}
+        }
+        return list;
+    }
+
 }

+ 118 - 0
src/main/java/com/jeeplus/modules/sg/audit/report/web/ReportController.java

@@ -7,7 +7,13 @@ import com.github.abel533.echarts.code.Trigger;
 import com.github.abel533.echarts.feature.MagicType;
 import com.github.abel533.echarts.json.GsonOption;
 import com.github.abel533.echarts.series.Bar;
+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.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.entity.OutInformation;
+import com.jeeplus.modules.sg.audit.material.entity.Material;
 import com.jeeplus.modules.sg.audit.report.entity.SgReport;
 import com.jeeplus.modules.sg.audit.report.service.ReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,6 +74,25 @@ public class ReportController {
     }
 
 
+    /**
+     * 二级单位项目报表
+     */
+    @RequestMapping("/secondlist")
+    public String list2(SgReport sgReport, Model model) {
+        String status = sgReport.getStatus();
+        model.addAttribute("sgReport", sgReport);
+        List<SgReport> list = reportService.findSecondData(sgReport);
+//        List<SgReport> list1 = reportService.findList(sgReport);
+        model.addAttribute("list",list);
+//        model.addAttribute("list1",list1);
+        if(StringUtils.isNotBlank(status)) {
+            model.addAttribute("dataURL", "/sg/report/secondoption?status=" + status);
+        }else {
+            model.addAttribute("dataURL", "/sg/report/secondoption");
+        }
+        return "modules/sg/audit/report/reportList2";
+    }
+
 
 
     /**
@@ -212,4 +237,97 @@ public class ReportController {
         return option;
     }
 
+
+    @ResponseBody
+    @RequestMapping("secondoption")
+    public GsonOption getOption2(HttpServletRequest request){
+        String status = request.getParameter("status");
+        SgReport sgReport = new SgReport();
+        sgReport.setStatus(status);
+        List<SgReport> list = reportService.findSecondList(sgReport);
+        String[] str = new String[list.size()];
+        int[] level1 = new int[list.size()];
+        int[] level2 = new int[list.size()];
+        int[] level3 = new int[list.size()];
+        int[] level4 = new int[list.size()];
+        for(int i=0;i<list.size();i++){
+            str[i] = list.get(i).getName();
+            level1[i] = list.get(i).getLevel1();
+            level2[i] = list.get(i).getLevel2();
+            level3[i] = list.get(i).getLevel3();
+            level4[i] = list.get(i).getLevel4();
+        }
+        GsonOption option = new GsonOption();
+//        option.title("ECharts2 vs ECharts1", "Chrome下测试数据");
+        option.tooltip(Trigger.axis);
+        option.legend(
+                "1-7天", "8-14天", "15-21天",
+                "21天以上");
+        option.toolbox().show(true)
+                .feature(
+                        Tool.mark, Tool.dataView,
+                        new MagicType(Magic.line, Magic.bar),
+                        Tool.restore, Tool.saveAsImage);
+        option.calculable(true);
+        option.grid().y(70).y2(30).x2(60).bottom(120);
+        CategoryAxis categoryAxis = new CategoryAxis();
+        for(int j=0;j<str.length;j++){
+            categoryAxis.data(str[j]);
+        }
+        option.xAxis(
+                categoryAxis.axisLabel(new AxisLabel().rotate(40).interval(0))
+//                new CategoryAxis()
+//                        .axisLine(new AxisLine().show(false))
+//                        .axisTick(new AxisTick().show(false))
+//                        .axisLabel(new AxisLabel().show(false))
+//                        .splitArea(new SplitArea().show(false))
+//                        .axisLine(new AxisLine().show(false))
+//                        .data("Line", "Bar")
+        );
+        option.yAxis(new ValueAxis().axisLabel(new AxisLabel().formatter("{value} 个")));
+        Bar b1 = new Bar("1-7天");
+        b1.itemStyle().normal().color("rgba(193,35,43,0.5)").label().show(true);
+        Bar b2 = new Bar("8-14天");
+        b2.itemStyle().normal().color("rgba(181,195,52,1)").label().show(true).textStyle().color("#27727B");
+        Bar b3 = new Bar("15-21天");
+        b3.itemStyle().normal().color("rgba(252,206,16,1)").label().show(true).textStyle().color("#E87C25");
+        Bar b4 = new Bar("21天以上");
+        b4.itemStyle().normal().color("rgba(193,35,43,1)").label().show(true);
+        for (int k=0;k<list.size();k++){
+            b1.data(level1[k] );
+            b2.data(level2[k] );
+            b3.data(level3[k] );
+            b4.data(level4[k] );
+        }
+        option.series(b1, b2, b3, b4);
+        return option;
+    }
+
+    /**
+     * 导出项目清单
+     * */
+    @ResponseBody
+    @RequestMapping(value = "exportInformation")
+    public AjaxJson exportInformation(SgReport sgReport,HttpServletRequest request, HttpServletResponse response) {
+        AjaxJson j = new AjaxJson();
+        try {
+            String condition =  request.getParameter("condition");
+            condition = new String(condition.getBytes("iso8859-1"), "utf-8");
+            String status =  request.getParameter("status");
+            String type =  request.getParameter("type");
+            sgReport.setStatus(status);
+            sgReport.setType(type);
+            sgReport.setCondition(condition);
+            String fileName = "导出项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+            List<Information> informationList = reportService.findInformationList(sgReport);
+            new ExportExcel("导出项目信息", OutInformation.class).setDataList(informationList).write(response, fileName).dispose();
+            j.setSuccess(true);
+            j.setMsg("导出成功!");
+            return j;
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导出物料清单!失败信息:" + e.getMessage());
+        }
+        return j;
+    }
 }

+ 157 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialStandard.java

@@ -0,0 +1,157 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialStandard extends DataEntity<MaterialStandard> {
+    private String batch;            //批次
+    private String bigClassification;           //大分类
+    private String midClassification;         //中分类
+    private String smallClassification;    //小分类
+    private String materialCode;              //物料编码
+    private String materialDescription;      //物料描述
+    private String extendCode;        //扩展编码
+    private String combinationCode;      //物料编码&扩展编码
+    private String extendDescription;   //扩展描述
+    private String unit;      //单位
+    private String price;      //价格
+    private String batchType;      //批次类型
+    private String specificationId;      //电子商务平台技术规范书ID
+    private String section;      //标段
+    private String note;      //备注
+
+    @ExcelField(title="批次", align=2, sort=1)
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+
+    @ExcelField(title="大分类", align=2, sort=2)
+    public String getBigClassification() {
+        return bigClassification;
+    }
+
+    public void setBigClassification(String bigClassification) {
+        this.bigClassification = bigClassification;
+    }
+
+    @ExcelField(title="中分类", align=2, sort=3)
+    public String getMidClassification() {
+        return midClassification;
+    }
+
+    public void setMidClassification(String midClassification) {
+        this.midClassification = midClassification;
+    }
+
+    @ExcelField(title="小分类", align=2, sort=4)
+    public String getSmallClassification() {
+        return smallClassification;
+    }
+
+    public void setSmallClassification(String smallClassification) {
+        this.smallClassification = smallClassification;
+    }
+
+    @ExcelField(title="物料编码", align=2, sort=5)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title="物料描述", align=2, sort=6)
+    public String getMaterialDescription() {
+        return materialDescription;
+    }
+
+    public void setMaterialDescription(String materialDescription) {
+        this.materialDescription = materialDescription;
+    }
+
+    @ExcelField(title="扩展编码", align=2, sort=7)
+    public String getExtendCode() {
+        return extendCode;
+    }
+
+    public void setExtendCode(String extendCode) {
+        this.extendCode = extendCode;
+    }
+
+    @ExcelField(title="物料编码&扩展编码", align=2, sort=8)
+    public String getCombinationCode() {
+        return combinationCode;
+    }
+
+    public void setCombinationCode(String combinationCode) {
+        this.combinationCode = combinationCode;
+    }
+
+    @ExcelField(title="扩展描述", align=2, sort=9)
+    public String getExtendDescription() {
+        return extendDescription;
+    }
+
+    public void setExtendDescription(String extendDescription) {
+        this.extendDescription = extendDescription;
+    }
+
+    @ExcelField(title="单位", align=2, sort=10)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    @ExcelField(title="价格", align=2, sort=11)
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
+    @ExcelField(title="批次类型", align=2, sort=12)
+    public String getBatchType() {
+        return batchType;
+    }
+
+    public void setBatchType(String batchType) {
+        this.batchType = batchType;
+    }
+
+    @ExcelField(title="电子商务平台技术规范书ID", align=2, sort=13)
+    public String getSpecificationId() {
+        return specificationId;
+    }
+
+    public void setSpecificationId(String specificationId) {
+        this.specificationId = specificationId;
+    }
+
+    @ExcelField(title="标段", align=2, sort=14)
+    public String getSection() {
+        return section;
+    }
+
+    public void setSection(String section) {
+        this.section = section;
+    }
+
+    @ExcelField(title="备注", align=2, sort=15)
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
+}

+ 15 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialVersion.java

@@ -0,0 +1,15 @@
+package com.jeeplus.modules.sg.managementcenter.materialinfo.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class MaterialVersion extends DataEntity<MaterialVersion> {
+    private String batch;   //批次
+
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+}

+ 24 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/MaterialVersionMapper.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface MaterialVersionMapper extends BaseMapper<MaterialVersion> {
+	int insertList(@Param("list") List<MaterialStandard> list);
+	List<MaterialVersion> findSat(String batch);
+	void deleteByBatch(String batch);
+	void deleteData(String batch);
+
+}

+ 137 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/mapper/xml/MaterialVersionMapper.xml

@@ -0,0 +1,137 @@
+<?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.managementcenter.materialinfo.mapper.MaterialVersionMapper">
+    
+	<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.batch AS "batch"
+	</sql>
+
+    
+	<select id="get" resultType="MaterialVersion" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_version a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="MaterialVersion" >
+		SELECT 
+			<include refid="infoColumns"/>
+		FROM xm_material_version a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="batch != null and batch != '' ">
+				AND batch = #{batch}
+			</if>
+		</where>
+		ORDER BY a.update_date DESC
+	</select>
+	
+
+	
+	<insert id="insert">
+		INSERT INTO xm_material_version(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			batch
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{batch}
+		)
+	</insert>
+
+    <insert id="insertList">
+        INSERT INTO xm_material_standard(
+		batch,
+		big_classification,
+		mid_classification,
+		small_classification,
+		material_code,
+		material_description,
+		extend_code,
+		combination_code,
+		extend_description,
+		unit,
+		price,
+		batch_type,
+		specification_id,
+		section,
+		note
+		) VALUES
+        <foreach collection="list" item="item" index="index" separator="," >
+		(
+			#{item.batch},
+			#{item.bigClassification},
+			#{item.midClassification},
+			#{item.smallClassification},
+			#{item.materialCode},
+			#{item.materialDescription},
+			#{item.extendCode},
+			#{item.combinationCode},
+			#{item.extendDescription},
+			#{item.unit},
+			#{item.price},
+			#{item.batchType},
+			#{item.specificationId},
+			#{item.section},
+			#{item.note}
+		)
+        </foreach>
+	</insert>
+	
+
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM xm_material_version
+		WHERE id = #{id}
+	</update>
+
+	<update id="deleteData">
+		DELETE FROM xm_material_version
+		WHERE batch = #{batch}
+	</update>
+
+	<delete id="deleteByBatch">
+		DELETE FROM xm_material_standard
+		WHERE batch = #{batch}
+	</delete>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE xm_material_version SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
+		select * FROM xm_material_version  where ${propertyName} = '${value}'
+	</select>
+
+
+
+
+
+</mapper>

+ 88 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java

@@ -0,0 +1,88 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.service;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.mapper.MaterialVersionMapper;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
+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.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class MaterialVersionService extends CrudService<MaterialVersionMapper, MaterialVersion> {
+
+	@Autowired
+	private MaterialVersionMapper materialVersionMapper;
+
+	public MaterialVersion get(String id) {
+		return super.get(id);
+	}
+	
+	public List<MaterialVersion> findList(MaterialVersion materialVersion) {
+		return super.findList(materialVersion);
+	}
+	
+	
+	public Page<MaterialVersion> findPage(Page<MaterialVersion> page, MaterialVersion materialVersion) {
+		return super.findPage(page, materialVersion);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(MaterialVersion materialVersion) {
+		super.save(materialVersion);
+	}
+
+	@Transactional(readOnly = false)
+	public void saveList(List<MaterialStandard> list,String batch) {
+		MaterialVersion materialVersion = new MaterialVersion();
+		materialVersion.setBatch(batch);
+        List<MaterialVersion> list1 = materialVersionMapper.findList(materialVersion);
+        if(list1 != null && list1.size()>0){
+        	materialVersionMapper.deleteByBatch(batch);
+        	materialVersionMapper.deleteData(batch);
+		}
+        save(materialVersion);
+		materialVersionMapper.insertList(list);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(MaterialVersion materialVersion) {
+		super.delete(materialVersion);
+		deleteByPro(materialVersion.getBatch());
+	}
+
+	@Transactional(readOnly = false)
+	public void deleteByPro(String batch) {
+		materialVersionMapper.deleteByBatch(batch);
+	}
+
+
+
+
+
+
+
+
+
+
+	
+}

+ 199 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java

@@ -0,0 +1,199 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.managementcenter.materialinfo.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.managementcenter.materialinfo.entity.MaterialStandard;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialVersion;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialVersionService;
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+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 java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/managementcenter/materialversion")
+public class MaterialVersionController extends BaseController {
+
+	@Autowired
+	private MaterialVersionService materialVersionService;
+	
+	
+	@ModelAttribute
+	public MaterialVersion get(@RequestParam(required=false) String id) {
+		MaterialVersion entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = materialVersionService.get(id);
+		}
+		if (entity == null){
+			entity = new MaterialVersion();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 项目列表页面
+	 */
+	@RequiresPermissions("managementcenter:materialversion:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(MaterialVersion materialVersion, Model model) {
+		model.addAttribute("materialVersion", materialVersion);
+		return "modules/sg/managementcenter/materialversion/materialVersionList";
+	}
+	
+		/**
+	 * 列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(MaterialVersion materialVersion, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<MaterialVersion> page = materialVersionService.findPage(new Page<MaterialVersion>(request, response), materialVersion);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑表单页面
+	 */
+	@RequiresPermissions(value={"managementcenter:materialversion:view","managementcenter:materialversion:add","managementcenter:materialversion:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(MaterialVersion materialVersion, Model model) {
+		model.addAttribute("materialVersion", materialVersion);
+		return "modules/sg/managementcenter/materialversion/materialVersionForm";
+	}
+
+	/**
+	 * 保存
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"managementcenter:materialversion:add","managementcenter:materialversion:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(MaterialVersion materialVersion, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(materialVersion);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		materialVersionService.save(materialVersion);//保存
+		j.setSuccess(true);
+		j.setMsg("保存项目成功");
+		return j;
+	}
+
+	@RequestMapping(value = "importExcel")
+	public String importExcel(Model model) {
+		return "modules/sg/managementcenter/materialversion/importexcel";
+	}
+
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:import")
+	@RequestMapping(value = "import")
+	public AjaxJson importFile(@RequestParam("file") MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		String batch = request.getParameter("batch");
+		AjaxJson j = new AjaxJson();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<MaterialStandard> list = ei.getDataList(MaterialStandard.class);
+			for(MaterialStandard materialStandard : list){
+				materialStandard.setBatch(batch);
+			}
+			materialVersionService.saveList(list,batch);
+			j.setMsg( "导入成功");
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+	@ResponseBody
+	@RequestMapping(value = "importValidation")
+	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch) throws IOException, InvalidFormatException, IllegalAccessException, InstantiationException {
+		AjaxJson j = new AjaxJson();
+		try {
+			MaterialVersion materialVersion = new MaterialVersion();
+			materialVersion.setBatch(batch);
+			List<MaterialVersion> list = materialVersionService.findList(materialVersion);
+			if(list != null && list.size()>0){
+				j.setSuccess(true);
+			}else {
+				ImportExcel ei = new ImportExcel(file, 1, 0);
+				List<MaterialStandard> list1 = ei.getDataList(MaterialStandard.class);
+				for(MaterialStandard materialStandard1 : list1){
+					materialStandard1.setBatch(batch);
+				}
+				materialVersionService.saveList(list1,batch);
+				j.setSuccess(true);
+				j.setErrorCode("0");
+				j.setMsg("导入成功");
+			}
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+	
+	/**
+	 * 删除项目
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(MaterialVersion materialVersion) {
+		AjaxJson j = new AjaxJson();
+		materialVersionService.delete(materialVersion);
+		j.setMsg("删除项目成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialversion:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			materialVersionService.delete(materialVersionService.get(id));
+		}
+		j.setMsg("删除项目成功");
+		return j;
+	}
+
+
+
+	
+
+
+}

+ 3 - 2
src/main/webapp/webpage/modules/sg/audit/report/reportList.jsp

@@ -25,6 +25,7 @@
 		<ul class="nav nav-tabs">
 			<li role="presentation" class="active"><a href="">按施工单位</a></li>
 			<li role="presentation"><a href="${ctx}/sg/report/unitlist">按归口部门</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/secondlist">按二级单位</a> </li>
 		</ul>
 		</div>
 		
@@ -45,13 +46,13 @@
 			<tr>
 				<th>完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.finishCount}</th>
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=0&type=0">${data.finishCount}</a></th>
 				</c:forEach>
 			</tr>
 			<tr>
 				<th>未完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.unfinishCount}</th>
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=1&type=0">${data.unfinishCount}</a></th>
 				</c:forEach>
 			</tr>
 			</thead>

+ 3 - 2
src/main/webapp/webpage/modules/sg/audit/report/reportList1.jsp

@@ -25,6 +25,7 @@
 		<ul class="nav nav-tabs">
 			<li role="presentation"><a href="${ctx}/sg/report/">按施工单位</a></li>
 			<li role="presentation" class="active"><a href="#">按归口部门</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/secondlist">按二级单位</a> </li>
 		</ul>
 		</div>
 		
@@ -45,13 +46,13 @@
 			<tr>
 				<th>完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.finishCount}</th>
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=0&type=1">${data.finishCount}</a></th>
 				</c:forEach>
 			</tr>
 			<tr>
 				<th>未完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-				<th>${data.unfinishCount}</th>
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=1&type=1">${data.unfinishCount}</a></th>
 				</c:forEach>
 			</tr>
 			</thead>

+ 130 - 0
src/main/webapp/webpage/modules/sg/audit/report/reportList2.jsp

@@ -0,0 +1,130 @@
+<%@ 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/echarts.jsp"%>
+	<%--<%@include file="reportList.js" %>--%>
+	<style type="text/css">
+		#div1{
+			margin-top: 10px;
+		}
+	</style>
+</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>
+		<ul class="nav nav-tabs">
+			<li role="presentation"><a href="${ctx}/sg/report/">按施工单位</a></li>
+			<li role="presentation"><a href="${ctx}/sg/report/unitlist">按归口部门</a></li>
+			<li role="presentation" class="active"><a href="#">按二级单位</a> </li>
+		</ul>
+		</div>
+		
+	<!-- 表格 -->
+	<%--<table id="reportTable"   data-toolbar="#toolbar"></table>--%>
+
+    <!-- context menu -->
+		<div id="div1">
+		<table class="table table-bordered">
+
+            <thead>
+			<tr>
+				<th> </th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+				<th>${data.name}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=0&type=2">${data.finishCount}</a></th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>未完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=1&type=2">${data.unfinishCount}</a></th>
+				</c:forEach>
+			</tr>
+			</thead>
+		</table>
+		</div>
+
+		<%--<table class="table table-bordered">--%>
+
+			<%--<thead>--%>
+			<%--<tr>--%>
+				<%--<th> </th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.name}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>1-7天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level1}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>8-14天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level2}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>15-21天</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level3}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+			<%--<tr>--%>
+				<%--<th>21天以上</th>--%>
+				<%--<c:forEach items="${list1}" var="data" varStatus="index">--%>
+					<%--<th>${data.level4}</th>--%>
+				<%--</c:forEach>--%>
+			<%--</tr>--%>
+
+			<%--</thead>--%>
+
+
+		<%--</table>--%>
+		<div class="btn-group" role="group" aria-label="...">
+			<div class="btn-group" role="group">
+				<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+					项目状态
+					<span class="caret"></span>
+				</button>
+				<ul class="dropdown-menu">
+					<li><a href="${ctx}/sg/report/secondlist?status=1">完成</a></li>
+					<li><a href="${ctx}/sg/report/secondlist?status=0">未完成</a></li>
+				</ul>
+			</div>
+		</div>
+		<div id="main" style="width: 100%;height: 400px"></div>
+		<script type="text/javascript">
+			// 基于准备好的dom,初始化echarts实例4
+			var myChart = echarts.init(document.getElementById('main'));
+			window.onresize = myChart.resize;
+
+			$(function () {
+				jp.get("${ctx}${dataURL}", function (option) {
+					// 指定图表的配置项和数据
+					// 使用刚指定的配置项和数据显示图表。
+					myChart.setOption(option);
+				})
+			})
+		</script>
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 5 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp

@@ -176,6 +176,10 @@
             layer.msg("请输入项目批次",{icon: 3,offset:['40%','40%']});
             return false;
         }
+        if(suppliesBatch == null || suppliesBatch === ''){
+            layer.msg("请选择物料批次",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
         var td_id=document.getElementsByClassName("td_id");
         //存放id的数组
         var array_id = [];
@@ -193,6 +197,7 @@
             }
         }
         formdata.append("itemBatch",itemBatch);
+        formdata.append("batch",suppliesBatch);
 
         jp.loading('  正在导入,请稍等...');
         $.ajax({

+ 108 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/importexcel.jsp

@@ -0,0 +1,108 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>导入Excel</title>
+    <meta name="decorator" content="ani"/>
+    <script>
+        function importExcel(url, fn) {
+            var importForm =$("#importForm")[0];
+            var file = $("#uploadFile").val();
+            var itemBatch = $("#itemBatch").val();
+            if(file.length === 0){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(itemBatch == null || itemBatch === ''){
+                layer.msg("请输入物料批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            jp.loading('  正在导入,请稍等...');
+            // jp.uploadFile(importForm, url,function (data) {
+            //    fn(data);
+            // })
+                var data = new FormData(importForm);
+                // data.append("CustomField", "This is some extra data, testing");//如果要添加参数
+                $.ajax({
+                    type: "POST",
+                    enctype: 'multipart/form-data',
+                    url: url,
+                    data: data,
+                    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('该项目已存在,确定覆盖嘛?', function(){
+                                jp.loading('  正在导入,请稍等...');
+                                $.ajax({
+                                    type: "POST",
+                                    enctype: 'multipart/form-data',
+                                    url: '${ctx}/managementcenter/materialversion/import',
+                                    data: data,
+                                    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)
+                        }
+                        // 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>
+</head>
+<body class="bg-white">
+    <div class="wrapper wrapper-content">
+        <div id="importBox" >
+            <form id="importForm" action="${url}" method="post" enctype="multipart/form-data"
+                  style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');">
+                <div>
+                    <label class="label-item single-overflow pull-left" title="选择文件:">选择文件:</label>
+                <input id="uploadFile" name="file" type="file" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+                    <input id="itemBatch" name="batch" type="text" class="form-control" style="width:300px"/>
+                </div>
+                 
+
+            </form>
+        </div>
+    </div>
+</body>
+</html>

+ 218 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.js

@@ -0,0 +1,218 @@
+<%@ 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}/managementcenter/materialversion/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}/managementcenter/materialversion/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: 'batch',
+		              title: '批次'
+		    }
+			,{
+		              field: 'createDate',
+		              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);
+        });
+		  
+
+		
+		
+	//  $("#export").click(function(){//导出Excel文件
+    //         var batch = $("#bat").val();
+	// 		jp.downloadFile('${ctx}/managementcenter/materialproject/export?projectBatch='+batch);
+	//   });
+    //
+    // $("#exportpro").click(function(){//导出Excel文件
+    //      var batch = $("#bat").val();
+    //      jp.downloadFile('${ctx}/managementcenter/materialproject/exportpro?projectBatch='+batch);
+    // });
+  $("#btnImport").click(function(){
+                jp.open({
+                        type: 2,
+                        area: [500, 300],
+                        auto: true,
+                        title:"导入数据",
+  // content: "${ctx}/managementcenter/materialinfo/importExcel" ,
+                        content: "${ctx}/managementcenter/materialversion/importExcel" ,
+                         btn: ['确定', '关闭'],
+                          btn1: function(index, layero){
+                             var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                              iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialversion/importValidation', 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);
+                         }
+                        });
+                         });
+
+		    
+	  $("#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}/managementcenter/materialversion/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}/managementcenter/materialproject/form",'800px', '500px');*/}
+  {/*}*/}
+
+
+  
+   {/*function edit(id){//没有权限时,不显示确定按钮*/}
+       {/*if(id == undefined){*/}
+	      {/*id = getIdSelections();*/}
+	{/*}*/}
+	{/*jp.openSaveDialog('编辑', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');*/}
+  {/*}*/}
+  
+ {/*function view(id){//没有权限时,不显示确定按钮*/}
+      {/*if(id == undefined){*/}
+             {/*id = getIdSelections();*/}
+      {/*}*/}
+        {/*jp.openViewDialog('查看', "${ctx}/managementcenter/materialproject/form?id=" + id, '800px', '500px');*/}
+ {/*}*/}
+
+
+
+</script>

+ 83 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialversion/materialVersionList.jsp

@@ -0,0 +1,83 @@
+<%@ 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="materialVersionList.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="materialVersion" 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="batch" 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="managementcenter:materialproject:add">--%>
+				<%--<button id="add" class="btn btn-primary" onclick="add()">--%>
+					<%--<i class="glyphicon glyphicon-plus"></i> 新建--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="managementcenter:materialproject:edit">--%>
+			    <%--<button id="edit" class="btn btn-success" disabled onclick="edit()">--%>
+	            	<%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+	        	<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<shiro:hasPermission name="managementcenter:materialversion:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="managementcenter:materialversion:import">
+	        		<button id="btnImport" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导入物料
+				</button>
+			 </shiro:hasPermission>
+
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="dataTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="managementcenter:materialproject:add">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="managementcenter:materialproject:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="managementcenter:materialproject:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>