ソースを参照

利库管理,物资非段长导入,导出

[user3] 4 年 前
コミット
67e6a266e0
24 ファイル変更7372 行追加0 行削除
  1. 351 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/entity/LiKuResourcePool.java
  2. 39 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/mapper/LiKuResourcePoolMapper.java
  3. 258 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/mapper/xml/LiKuResourcePoolMapper.xml
  4. 77 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/service/LiKuResourcePoolService.java
  5. 66 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/utils/LiKuUtils.java
  6. 250 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/web/LiKuResourcePoolController.java
  7. 61 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/CompareHistory.java
  8. 57 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/MaterialDetails.java
  9. 456 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/MaterialReportDetails.java
  10. 22 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/mapper/MaterialReportDetailsMapper.java
  11. 215 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/mapper/xml/MaterialReportDetailsMapper.xml
  12. 59 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/service/MaterialReportDetailsService.java
  13. 3501 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/web/MaterialReportDetailsController.java
  14. 130 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/entity/ReplaceMaterial.java
  15. 28 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/mapper/ReplaceMaterialMapper.java
  16. 166 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/mapper/xml/ReplaceMaterialMapper.xml
  17. 62 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/service/ReplaceMaterialService.java
  18. 273 0
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/web/ReplaceMaterialController.java
  19. 409 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/liKuResourcePool/liKuResourcePoolList.js
  20. 76 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/liKuResourcePool/liKuResourcePoolList.jsp
  21. 395 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/materialReportDetails/MaterialReportDetailsList.js
  22. 71 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/materialReportDetails/MaterialReportDetailslList.jsp
  23. 269 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/replaceMaterial/replaceMaterialList.js
  24. 81 0
      src/main/webapp/webpage/modules/sg/balancedlibrary/replaceMaterial/replaceMaterialList.jsp

+ 351 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/entity/LiKuResourcePool.java

@@ -0,0 +1,351 @@
+package com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+/**
+ * 利库资源池Entity
+ * @author enford
+ * @version 1.0
+ */
+public class LiKuResourcePool extends DataEntity<LiKuResourcePool> {
+    /**
+     * 序号
+     * */
+    private String serialNumber;
+    /**
+     * 工厂
+     * */
+    private String factory;
+    /**
+     * 批次
+     * */
+    private String batch;
+    /**
+     * 物料编码
+     * */
+    private String materialCode;
+    /**
+     * 物料描述
+     * */
+    private String materialDescription;
+    /**
+     * 计量单位
+     * */
+    private String unitOfMeasurement;
+    /**
+     * 库存数量
+     * */
+    private Double inventoryAmount;
+    /**
+     * 库存金额
+     * */
+    private String inventoryLocation;
+    /**
+     * 库存地
+     * */
+    private String invLocation;
+    /**
+     * 库存地描述
+     * */
+    private String invLocationDes;
+    /**
+     * 供应商名称
+     * */
+    private String supplierName;
+    /**
+     * 特殊库存标识
+     * */
+    private String specialStock;
+    /**
+     * 扩展编码
+     * */
+    private String extendedCoding;
+    /**
+     * 扩展描述
+     * */
+    private String extendedDescription;
+    /**
+     * 线缆段长
+     * */
+    private String lengthOfCable;
+    /**
+     * 环网箱尺寸
+     * */
+    private String ringCage;
+    /**
+     * 终端质保期
+     * */
+    private String terminalWarranty;
+    /**
+     * 特殊参数
+     * */
+    private String specialParameters;
+
+    /**
+     * 库龄(日)
+     * */
+    private Integer daysStorage;
+    /**
+     * 库龄(月)
+     * */
+    private Integer monthStorage;
+    /**
+     * 是否业扩
+     * */
+    private String isExpansion;
+    /**
+     * 利库数量
+     * */
+    private Double numberOfNiches;
+    /**
+     * 剩余数量列
+     * */
+    private Double remaining;
+    /**
+     * 是否是段长材料资源库
+     * */
+    private Integer isSectionLength;
+
+    /**
+     * 判断资源库来自什么地区
+     * */
+    private Integer whereFrom;
+
+    @ExcelField(title = "序号", align = 2, sort = 1)
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    @ExcelField(title = "工厂", align = 2, sort = 2)
+    public String getFactory() {
+        return factory;
+    }
+
+    public void setFactory(String factory) {
+        this.factory = factory;
+    }
+
+    @ExcelField(title = "批次", align = 2, sort = 3)
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+
+    @ExcelField(title = "物料编码", align = 2, sort = 4)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title = "物料描述", align = 2, sort = 5)
+    public String getMaterialDescription() {
+        return materialDescription;
+    }
+
+    public void setMaterialDescription(String materialDescription) {
+        this.materialDescription = materialDescription;
+    }
+
+    @ExcelField(title = "计量单位", align = 2, sort = 6)
+    public String getUnitOfMeasurement() {
+        return unitOfMeasurement;
+    }
+
+    public void setUnitOfMeasurement(String unitOfMeasurement) {
+        this.unitOfMeasurement = unitOfMeasurement;
+    }
+
+    @ExcelField(title = "库存数量", align = 2, sort = 7)
+    public Double getInventoryAmount() {
+        return inventoryAmount;
+    }
+
+    public void setInventoryAmount(Double inventoryAmount) {
+        this.inventoryAmount = inventoryAmount;
+    }
+
+
+
+    @ExcelField(title = "库存金额", align = 2, sort = 8)
+    public String getInventoryLocation() {
+        return inventoryLocation;
+    }
+
+    public void setInventoryLocation(String inventoryLocation) {
+        this.inventoryLocation = inventoryLocation;
+    }
+
+    @ExcelField(title = "库存地", align = 2, sort = 9)
+    public String getInvLocation() {
+        return invLocation;
+    }
+
+    public void setInvLocation(String invLocation) {
+        this.invLocation = invLocation;
+    }
+
+    @ExcelField(title = "库存地描述", align = 2, sort = 10)
+    public String getInvLocationDes() {
+        return invLocationDes;
+    }
+
+    public void setInvLocationDes(String invLocationDes) {
+        this.invLocationDes = invLocationDes;
+    }
+
+    @ExcelField(title = "供应商名称", align = 2, sort = 11)
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    @ExcelField(title = "特殊库存标识", align = 2, sort = 12)
+    public String getSpecialStock() {
+        return specialStock;
+    }
+
+    public void setSpecialStock(String specialStock) {
+        this.specialStock = specialStock;
+    }
+
+    @ExcelField(title = "扩展编码", align = 2, sort = 13)
+    public String getExtendedCoding() {
+        return extendedCoding;
+    }
+
+    public void setExtendedCoding(String extendedCoding) {
+        this.extendedCoding = extendedCoding;
+    }
+
+    @ExcelField(title = "扩展描述", align = 2, sort = 14)
+    public String getExtendedDescription() {
+        return extendedDescription;
+    }
+
+    public void setExtendedDescription(String extendedDescription) {
+        this.extendedDescription = extendedDescription;
+    }
+
+    @ExcelField(title = "线缆段长", align = 2, sort = 15)
+    public String getLengthOfCable() {
+        return lengthOfCable;
+    }
+
+    public void setLengthOfCable(String lengthOfCable) {
+        this.lengthOfCable = lengthOfCable;
+    }
+
+    @ExcelField(title = "环网箱尺寸", align = 2, sort = 16)
+    public String getRingCage() {
+        return ringCage;
+    }
+
+    public void setRingCage(String ringCage) {
+        this.ringCage = ringCage;
+    }
+
+    @ExcelField(title = "终端质保期", align = 2, sort = 17)
+    public String getTerminalWarranty() {
+        return terminalWarranty;
+    }
+
+    public void setTerminalWarranty(String terminalWarranty) {
+        this.terminalWarranty = terminalWarranty;
+    }
+
+    @ExcelField(title = "特殊参数", align = 2, sort = 18)
+    public String getSpecialParameters() {
+        return specialParameters;
+    }
+
+    public void setSpecialParameters(String specialParameters) {
+        this.specialParameters = specialParameters;
+    }
+
+    @Override
+    @ExcelField(title = "备注", align = 2, sort = 19)
+    public String getRemarks() {
+        return super.getRemarks();
+    }
+
+    @Override
+    public void setRemarks(String remarks) {
+        super.setRemarks(remarks);
+    }
+
+    @ExcelField(title = "库龄(日)", align = 2, sort = 20)
+    public Integer getDaysStorage() {
+        return daysStorage;
+    }
+
+    public void setDaysStorage(Integer daysStorage) {
+        this.daysStorage = daysStorage;
+    }
+
+
+    @ExcelField(title = "库龄(月)", align = 2, sort = 21)
+    public Integer getMonthStorage() {
+        return monthStorage;
+    }
+
+    public void setMonthStorage(Integer monthStorage) {
+        this.monthStorage = monthStorage;
+    }
+
+    @ExcelField(title = "是否业扩", align = 2, sort = 22)
+    public String getIsExpansion() {
+        return isExpansion;
+    }
+
+    public void setIsExpansion(String isExpansion) {
+        this.isExpansion = isExpansion;
+    }
+
+    @ExcelField(title = "利库数量", align = 2, sort = 23)
+    public Double getNumberOfNiches() {
+        return numberOfNiches;
+    }
+
+    public void setNumberOfNiches(Double numberOfNiches) {
+        this.numberOfNiches = numberOfNiches;
+    }
+
+    @ExcelField(title = "剩余数量", align = 2, sort = 24)
+    public Double getRemaining() {
+        return remaining;
+    }
+
+    public void setRemaining(Double remaining) {
+        this.remaining = remaining;
+    }
+
+    public Integer getIsSectionLength() {
+        return isSectionLength;
+    }
+
+    public void setIsSectionLength(Integer isSectionLength) {
+        this.isSectionLength = isSectionLength;
+    }
+
+    public Integer getWhereFrom() {
+        return whereFrom;
+    }
+
+    public void setWhereFrom(Integer whereFrom) {
+        this.whereFrom = whereFrom;
+    }
+}

+ 39 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/mapper/LiKuResourcePoolMapper.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 利库资源池MAPPER接口
+ * @author enford
+ * @version 1.0
+ */
+@MyBatisMapper
+public interface LiKuResourcePoolMapper extends BaseMapper<LiKuResourcePool> {
+    /**
+     * 利库资源池数据
+     * @param list 数据列表
+     * */
+    void insertList(@Param("list") List<LiKuResourcePool> list);
+
+    /**
+     * 清空利库资源池数据
+     */
+    void clearLiKuResource();
+
+    /**
+     * 根据条件查询利库资源池数据
+     * @return 符合条件的利库资源池数据
+     * @param  isSectionLength 是否是段长数据
+     * @param whereFrom 归属地区
+     */
+    List<LiKuResourcePool> findLiKuList(@Param("isSectionLength") Integer isSectionLength, @Param("whereFrom")Integer whereFrom);
+
+}

+ 258 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/mapper/xml/LiKuResourcePoolMapper.xml

@@ -0,0 +1,258 @@
+<?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.balancedlibrary.liKuResourcePool.mapper.LiKuResourcePoolMapper">
+	<sql id="resourceColumns">
+		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.serialNumber AS "serialNumber",
+		a.factory AS "factory",
+		a.batch AS "batch",
+		a.materialCode AS "materialCode",
+		a.materialDescription AS "materialDescription",
+		a.unitOfMeasurement AS "unitOfMeasurement",
+		a.inventoryAmount AS "inventoryAmount",
+		a.inventoryLocation AS "inventoryLocation",
+		a.invLocation AS "invLocation",
+		a.invLocationDes AS "invLocationDes",
+		a.supplierName AS "supplierName",
+		a.specialStock AS "specialStock",
+		a.extendedCoding AS "extendedCoding",
+		a.extendedDescription AS "extendedDescription",
+		a.lengthOfCable AS "lengthOfCable",
+		a.ringCage AS "ringCage",
+		a.terminalWarranty AS "terminalWarranty",
+		a.specialParameters AS "specialParameters",
+		a.daysStorage AS "daysStorage",
+		a.monthStorage AS "monthStorage",
+		a.isExpansion AS "isExpansion",
+		a.numberOfNiches AS "numberOfNiches",
+		a.remaining AS "remaining"
+	</sql>
+
+	<sql id="liKuColumns">
+		a.id AS "id",
+		a.serialNumber AS "serialNumber",
+		a.factory AS "factory",
+		a.batch AS "batch",
+		a.materialCode AS "materialCode",
+		a.materialDescription AS "materialDescription",
+		a.unitOfMeasurement AS "unitOfMeasurement",
+		a.inventoryAmount AS "inventoryAmount",
+		a.inventoryLocation AS "inventoryLocation",
+		a.invLocation AS "invLocation",
+		a.invLocationDes AS "invLocationDes",
+		a.supplierName AS "supplierName",
+		a.specialStock AS "specialStock",
+		a.extendedCoding AS "extendedCoding",
+		a.extendedDescription AS "extendedDescription",
+		a.lengthOfCable AS "lengthOfCable",
+		a.ringCage AS "ringCage",
+		a.terminalWarranty AS "terminalWarranty",
+		a.specialParameters AS "specialParameters",
+		a.daysStorage AS "daysStorage",
+		a.monthStorage AS "monthStorage",
+		a.isExpansion AS "isExpansion",
+		a.numberOfNiches AS "numberOfNiches",
+		a.remaining AS "remaining"
+	</sql>
+
+	<sql id="leftJoins">
+		LEFT JOIN sys_office office ON office.id = a.office_id
+		LEFT JOIN sys_user tuser ON tuser.id = a.user_id
+	</sql>
+
+
+
+
+	<select id="get" resultType="LiKuResourcePool" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_resource_pool a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="LiKuResourcePool" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_resource_pool a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="materialCode != null and materialCode != ''">
+				AND a.materialCode = #{materialCode}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.serialNumber asc
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findAllList" resultType="LiKuResourcePool" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_resource_pool 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 bla_resource_pool(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag}
+		)
+	</insert>
+	
+	<insert id="insertList">
+		replace into bla_resource_pool(
+		id,
+ 		create_by,
+ 		create_date,
+ 		update_by,
+ 		update_date,
+ 		del_flag,
+ 		remarks,
+ 		serialNumber,
+ 		factory,
+ 		batch,
+ 		materialCode,
+ 		materialDescription,
+ 		unitOfMeasurement,
+ 		inventoryAmount,
+ 		inventoryLocation,
+ 		invLocation,
+ 		invLocationDes,
+ 		supplierName,
+ 		specialStock,
+ 		extendedCoding,
+ 		extendedDescription,
+ 		lengthOfCable,
+ 		ringCage,
+ 		terminalWarranty,
+ 		specialParameters,
+ 		daysStorage,
+ 		monthStorage,
+ 		isExpansion,
+ 		numberOfNiches,
+ 		remaining,
+		isSectionLength,
+		whereFrom
+		)VALUES
+		<foreach collection="list" item="item" index="index" separator=",">
+			(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.delFlag},
+			#{item.remarks},
+			#{item.serialNumber},
+			#{item.factory},
+			#{item.batch},
+			#{item.materialCode},
+			#{item.materialDescription},
+			#{item.unitOfMeasurement},
+			#{item.inventoryAmount},
+			#{item.inventoryLocation},
+			#{item.invLocation},
+			#{item.invLocationDes},
+			#{item.supplierName},
+			#{item.specialStock},
+			#{item.extendedCoding},
+			#{item.extendedDescription},
+			#{item.lengthOfCable},
+			#{item.ringCage},
+			#{item.terminalWarranty},
+			#{item.specialParameters},
+			#{item.daysStorage},
+			#{item.monthStorage},
+			#{item.isExpansion},
+			#{item.numberOfNiches},
+			#{item.remaining},
+			#{item.isSectionLength},
+			#{item.whereFrom}
+			)
+		</foreach>
+	</insert>
+
+	<delete id="clearLiKuResource">
+		truncate table bla_resource_pool
+	</delete>
+
+	<update id="update">
+		UPDATE bla_resource_pool SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM bla_resource_pool
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE bla_resource_pool SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="LiKuResourcePool" statementType="STATEMENT">
+		select * FROM bla_resource_pool  where ${propertyName} = '${value}'
+	</select>
+	<!--根据条件查询出是否是段长数据,所属区域数据-->
+	<select id="findLiKuList"
+			resultType="com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool">
+		SELECT
+		<include refid="liKuColumns"/>
+		FROM bla_resource_pool a
+		<where>
+		1=1
+			<if test="isSectionLength != null and isSectionLength != ''">
+				AND a.isSectionLength = #{isSectionLength}
+			</if>
+			<if test="whereFrom != null and whereFrom != ''">
+				AND a.whereFrom = #{whereFrom}
+			</if>
+		</where>
+	</select>
+</mapper>

+ 77 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/service/LiKuResourcePoolService.java

@@ -0,0 +1,77 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.mapper.LiKuResourcePoolMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 利库资源池Service
+ * @author enford
+ * @version 1.0
+ */
+@Service
+@Transactional(readOnly = true)
+public class LiKuResourcePoolService extends CrudService<LiKuResourcePoolMapper, LiKuResourcePool> {
+
+	@Override
+	public LiKuResourcePool get(String id) {
+		return super.get(id);
+	}
+
+	@Override
+	public List<LiKuResourcePool> findList(LiKuResourcePool entity) {
+		return super.findList(entity);
+	}
+
+	@Override
+	public Page<LiKuResourcePool> findPage(Page<LiKuResourcePool> page, LiKuResourcePool entity) {
+		return super.findPage(page, entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void save(LiKuResourcePool entity) {
+		super.save(entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void delete(LiKuResourcePool entity) {
+		super.delete(entity);
+	}
+
+	@Transactional(readOnly = false)
+	public void insertList(List<LiKuResourcePool> list) {
+		for (LiKuResourcePool li :
+				list) {
+			li.preInsert();
+		}
+		mapper.insertList(list);
+	}
+
+
+	/**
+	 * 清空利库资源池数据
+	 */
+	@Transactional(readOnly = false)
+	public void clearLiKuResource() {
+		mapper.clearLiKuResource();
+	}
+
+	/**
+	 * 查询所有本部利库资源数据
+	 */
+	public List<LiKuResourcePool> findLiKuList(Integer isSectionLength, Integer whereFrom) {
+		return mapper.findLiKuList(isSectionLength, whereFrom);
+	}
+
+
+}

+ 66 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/utils/LiKuUtils.java

@@ -0,0 +1,66 @@
+package com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.utils;
+
+public class LiKuUtils {
+    /**
+     * 判断是否是段长数据
+     * YES-是 NO-不是
+     */
+    public static final Integer YES = 1;
+    public static final Integer NO = 0;
+
+    /**
+     * 地区编号值
+     * HLA2-市公司 HLD1-扬中 HLB1-丹阳 句容-HLC1 未知地区-NO_PLACE
+     */
+    public static final String HLA2 = "HLA2";
+    public static final String HLD1 = "HLD1";
+    public static final String HLB1 = "HLB1";
+    public static final String HLC1 = "HLC1";
+
+    /**
+     * 上报地区所属值
+     */
+    public static final String BB_PLACE = "市公司";
+    public static final String YZ_PLACE = "扬中";
+    public static final String DY_PLACE = "丹阳";
+    public static final String JR_PLACE = "句容";
+
+    /**
+     * 判断库存地所属标记
+     * BB_FLAG-市公司 YZ_FLAG-扬中 DY_FLAG-丹阳 JR_FLAG-句容 NO_FLAG-未知地区
+     * */
+    public static final Integer BB_FLAG = 1;
+    public static final Integer YZ_FLAG = 2;
+    public static final Integer DY_FLAG = 3;
+    public static final Integer JR_FLAG = 4;
+    public static final Integer NO_FLAG = 0;
+
+    /**
+     * 判断单位
+     * */
+    public static final String METER = "米";
+    public static final String Kilometer = "千米";
+
+
+    public static Integer isTheUnitMeter(String unit) {
+        if (METER.equals(unit) || Kilometer.equals(unit)) {
+            return YES;
+        } else {
+            return NO;
+        }
+    }
+
+    public static Integer judgmentArea(String area) {
+        if (HLA2.equals(area) || area.contains(BB_PLACE)) {
+            return BB_FLAG;
+        } else if (HLD1.equals(area) || area.contains(YZ_PLACE)) {
+            return YZ_FLAG;
+        } else if (HLB1.equals(area) || area.contains(DY_PLACE)) {
+            return DY_FLAG;
+        } else if (HLC1.equals(area) || area.contains(JR_PLACE)) {
+            return JR_FLAG;
+        } else {
+            return NO_FLAG;
+        }
+    }
+}

+ 250 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/liKuResourcePool/web/LiKuResourcePoolController.java

@@ -0,0 +1,250 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.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.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.service.LiKuResourcePoolService;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.utils.LiKuUtils;
+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.validation.ConstraintViolationException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 利库资源池Controller
+ * @author lgf
+ * @version 2018-06-12
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/liKuResourcePool")
+public class LiKuResourcePoolController extends BaseController {
+
+	@Autowired
+	private LiKuResourcePoolService service;
+
+
+
+	@ModelAttribute
+	public LiKuResourcePool get(@RequestParam(required=false) String id) {
+		LiKuResourcePool entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = service.get(id);
+		}
+		if (entity == null){
+			entity = new LiKuResourcePool();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 利库资源池列表页面
+	 */
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:list")
+	@RequestMapping(value = "list")
+	public String list(LiKuResourcePool entity, Model model) {
+		model.addAttribute("entity", entity);
+		return "modules/sg/balancedlibrary/liKuResourcePool/liKuResourcePoolList";
+	}
+	
+		/**
+	 * 利库资源池列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(LiKuResourcePool entity, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<LiKuResourcePool> page = service.findPage(new Page<LiKuResourcePool>(request, response), entity);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑利库资源池表单页面
+	 */
+	@RequiresPermissions(value={"sg:balancedlibrary:liKuResourcePool:view","sg:balancedlibrary:liKuResourcePool:add","sg:balancedlibrary:liKuResourcePool:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(LiKuResourcePool entity, Model model) {
+		model.addAttribute("entity", entity);
+		return "modules/test/one/dialog/liKuResourcePoolForm";
+	}
+
+	/**
+	 * 保存利库资源池
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"sg:balancedlibrary:liKuResourcePool:add","sg:balancedlibrary:liKuResourcePool:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(LiKuResourcePool entity, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(entity);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		service.save(entity);
+		j.setSuccess(true);
+		j.setMsg("保存利库资源池成功");
+		return j;
+	}
+	
+	/**
+	 * 删除利库资源池
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(LiKuResourcePool entity) {
+		AjaxJson j = new AjaxJson();
+		service.delete(entity);
+		j.setMsg("删除利库资源池成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除利库资源池
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			service.delete(service.get(id));
+		}
+		j.setMsg("删除利库资源池成功");
+		return j;
+	}
+	
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(LiKuResourcePool entity, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "利库资源池"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<LiKuResourcePool> page = service.findPage(new Page<LiKuResourcePool>(request, response, -1), entity);
+    		new ExportExcel("", LiKuResourcePool.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;
+    }
+
+	/**
+	 * 利库资源池-导入Excel数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:import")
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+		String unit = "";
+		String area = "";
+		try {
+			ImportExcel ei = new ImportExcel(file, 0, 0);
+			List<LiKuResourcePool> list = new ArrayList<>();
+			for (int i = 1; i <= ei.getLastDataRowNum(); i++) {
+				LiKuResourcePool pool = new LiKuResourcePool();
+				Row row = ei.getRow(i);
+				pool.setSerialNumber(String.valueOf(row.getCell(0)));
+				pool.setFactory(String.valueOf(row.getCell(1)));
+				pool.setBatch(String.valueOf(row.getCell(2)));
+				pool.setMaterialCode(String.valueOf(row.getCell(3)));
+				pool.setMaterialDescription(String.valueOf(row.getCell(4)));
+				pool.setUnitOfMeasurement(String.valueOf(row.getCell(5)));
+				pool.setInventoryAmount(Double.valueOf(String.valueOf(row.getCell(6))));
+				pool.setInventoryLocation(String.valueOf(row.getCell(7)));
+				pool.setInvLocation(String.valueOf(row.getCell(8)));
+				pool.setInvLocationDes(String.valueOf(row.getCell(9)));
+				pool.setSupplierName(String.valueOf(row.getCell(10)));
+				pool.setSpecialStock(String.valueOf(row.getCell(11)));
+				pool.setExtendedCoding(String.valueOf(row.getCell(12)));
+				pool.setExtendedDescription(String.valueOf(row.getCell(13)));
+				pool.setLengthOfCable(String.valueOf(row.getCell(14)));
+				pool.setRingCage(String.valueOf(row.getCell(15)));
+				pool.setTerminalWarranty(String.valueOf(row.getCell(16)));
+				pool.setSpecialParameters(String.valueOf(row.getCell(17)));
+				pool.setRemarks(String.valueOf(row.getCell(18)));
+				pool.setDaysStorage(Double.valueOf(String.valueOf(row.getCell(19))).intValue());
+				pool.setMonthStorage(Double.valueOf(String.valueOf(row.getCell(20))).intValue());
+				pool.setIsExpansion(String.valueOf(row.getCell(21)));
+				//获取计量单位,判断是否是段长数据
+				unit = pool.getUnitOfMeasurement();
+				pool.setIsSectionLength(LiKuUtils.isTheUnitMeter(unit));
+				//获取库存地描述,标记数据所属区域
+				pool.setWhereFrom(LiKuUtils.judgmentArea(pool.getInvLocation()));
+				pool.setRemaining(pool.getInventoryAmount());
+				pool.setNumberOfNiches(0.0);
+				list.add(pool);
+			}
+			if (list.size() > 0) {
+				//利库资源池每次重新导入数据,将原有数据清空
+				service.clearLiKuResource();
+				service.insertList(list);
+			}
+			j.setMsg("已成功导入 " + list.size() + " 条利库资源池记录");
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入利库资源池失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+
+
+	/**
+	 * 下载导入利库资源池数据模板
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:liKuResourcePool:import")
+    @RequestMapping(value = "import/template")
+     public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "利库资源池数据导入模板.xlsx";
+    		List<LiKuResourcePool> list = Lists.newArrayList(); 
+    		new ExportExcel("", LiKuResourcePool.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+}

+ 61 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/CompareHistory.java

@@ -0,0 +1,61 @@
+package com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+/**
+ * @author enford
+ * 利库比对历史记录实体类
+ */
+public class CompareHistory extends DataEntity<CompareHistory> {
+    /**
+     * 利库资源id
+     */
+    private String liKuId;
+
+    /**
+     * 物料资源id
+     */
+    private String materialId;
+
+    /**
+     * 利库数量
+     */
+    private Double numberNiches;
+
+    /**
+     * 比对类型
+     */
+    private String comparisonType;
+
+    public String getLiKuId() {
+        return liKuId;
+    }
+
+    public void setLiKuId(String liKuId) {
+        this.liKuId = liKuId;
+    }
+
+    public String getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(String materialId) {
+        this.materialId = materialId;
+    }
+
+    public Double getNumberNiches() {
+        return numberNiches;
+    }
+
+    public void setNumberNiches(Double numberNiches) {
+        this.numberNiches = numberNiches;
+    }
+
+    public String getComparisonType() {
+        return comparisonType;
+    }
+
+    public void setComparisonType(String comparisonType) {
+        this.comparisonType = comparisonType;
+    }
+}

+ 57 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/MaterialDetails.java

@@ -0,0 +1,57 @@
+package com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.entity;
+
+/**
+ * @author enford
+ * 利库详细记录
+ */
+public class MaterialDetails {
+    /**
+     * 利库型号
+     */
+    private String liKuModel;
+    /**
+     * 利库批次号
+     */
+    private String liKuBatch;
+    /**
+     * 利库库存地
+     */
+    private String warehouseLocation;
+    /**
+     * 利库数量
+     */
+    private String numberOfNiches;
+
+
+    public String getLiKuModel() {
+        return liKuModel;
+    }
+
+    public void setLiKuModel(String liKuModel) {
+        this.liKuModel = liKuModel;
+    }
+
+    public String getLiKuBatch() {
+        return liKuBatch;
+    }
+
+    public void setLiKuBatch(String liKuBatch) {
+        this.liKuBatch = liKuBatch;
+    }
+
+    public String getWarehouseLocation() {
+        return warehouseLocation;
+    }
+
+    public void setWarehouseLocation(String warehouseLocation) {
+        this.warehouseLocation = warehouseLocation;
+    }
+
+    public String getNumberOfNiches() {
+        return numberOfNiches;
+    }
+
+    public void setNumberOfNiches(String numberOfNiches) {
+        this.numberOfNiches = numberOfNiches;
+    }
+}

+ 456 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/MaterialReportDetails.java

@@ -0,0 +1,456 @@
+package com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+
+import java.util.List;
+
+/**
+ * 物资上报明细Entity
+ * @author enford
+ * @version 1.0
+ */
+public class MaterialReportDetails extends DataEntity<MaterialReportDetails> {
+    /**
+     * 上报地区
+     * */
+    private String reportingArea;
+    /**
+     * 储备项目名称
+     * */
+    private String nameOfReserve;
+    /**
+     * 物料编码
+     * */
+    private String materialCode;
+    /**
+     * 物料名称
+     * */
+    private String materialName;
+    /**
+     * 扩展编码
+     * */
+    private String extendedCoding;
+    /**
+     * 扩展描述
+     * */
+    private String extendedDescription;
+    /**
+     * 单位
+     * */
+    private String unit;
+    /**
+     * 总量
+     * */
+    private Double total;
+    /**
+     * 单重/kg
+     * */
+    private String unitWeight;
+    /**
+     * 总重/吨
+     * */
+    private String totalWeight;
+    /**
+     * 甲乙供
+     * */
+    private String supplied;
+
+    /**
+     * 利库数量
+     * */
+    private Double numberOfNiches;
+    /**
+     * 申请数量
+     * */
+    private Double numberOfApplications;
+
+    /**
+     * 本地利库详细
+     */
+    private List<MaterialDetails> localList;
+
+    /**
+     * 跨区利库详细
+     * */
+    private List<MaterialDetails> regionalList;
+
+    /**
+     * 本地以大代小利库
+     * */
+    private List<MaterialDetails> localRepList;
+
+    /**
+     * 跨区以大代小利库
+     * */
+    private List<MaterialDetails> regionalRepList;
+
+    /**
+     * 以大代小编号
+     */
+    private String replaceCode;
+    /**
+     * 以大代小扩展编号
+     */
+    private String replaceExCode;
+
+    /**
+     * 本地利库批次号
+     * */
+    private String localWareBatch;
+    /**
+     * 本地利库库存地
+     * */
+    private String localWareHouse;
+    /**
+     * 本地利库数量
+     * */
+    private String numberOfLocal;
+    /**
+     * 跨区利库批次号
+     * */
+    private String regionalBatch;
+    /**
+     * 跨区利库库存地
+     * */
+    private String regionalHouse;
+    /**
+     * 跨区利库数量
+     * */
+    private String numberOfRegional;
+    /**
+     * 本地以大代小利库型号
+     * */
+    private String localLiKuModel;
+    /**
+     * 本地以大代小利库批次号
+     * */
+    private String localLiKuBatch;
+    /**
+     * 本地以大代小利库库存地
+     * */
+    private String localLiKuWareHouse;
+    /**
+     * 本地以大代小利库数量
+     * */
+    private String numberOfLocalLiKu;
+    /**
+     * 跨区以大代小利库型号
+     * */
+    private String regionLiKuModel;
+    /**
+     * 跨区以大代小利库批次号
+     * */
+    private String regionLiKuBatch;
+    /**
+     * 跨区以大代小利库库存地
+     * */
+    private String regionLiKuWareHouse;
+    /**
+         * 跨区以大代小利库数量
+     * */
+    private String numberOfRegionalLiKu;
+
+
+    @ExcelField(title = "上报地区", align = 2, sort = 1)
+    public String getReportingArea() {
+        return reportingArea;
+    }
+
+    public void setReportingArea(String reportingArea) {
+        this.reportingArea = reportingArea;
+    }
+
+    @ExcelField(title = "储备项目名称", align = 2, sort = 2)
+    public String getNameOfReserve() {
+        return nameOfReserve;
+    }
+
+    public void setNameOfReserve(String nameOfReserve) {
+        this.nameOfReserve = nameOfReserve;
+    }
+
+    @ExcelField(title = "物料编码", align = 2, sort = 3)
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    @ExcelField(title = "物料名称", align = 2, sort = 4)
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    @ExcelField(title = "扩展编码", align = 2, sort = 5)
+    public String getExtendedCoding() {
+        return extendedCoding;
+    }
+
+    public void setExtendedCoding(String extendedCoding) {
+        this.extendedCoding = extendedCoding;
+    }
+
+    @ExcelField(title = "扩展描述", align = 2, sort = 6)
+    public String getExtendedDescription() {
+        return extendedDescription;
+    }
+
+    public void setExtendedDescription(String extendedDescription) {
+        this.extendedDescription = extendedDescription;
+    }
+
+    @ExcelField(title = "单位", align = 2, sort = 7)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+
+    @ExcelField(title = "总量", align = 2, sort = 8)
+    public Double getTotal() {
+        return total;
+    }
+
+    public void setTotal(Double total) {
+        this.total = total;
+    }
+
+    @ExcelField(title = "单重/kg", align = 2, sort = 9)
+    public String getUnitWeight() {
+        return unitWeight;
+    }
+
+    public void setUnitWeight(String unitWeight) {
+        this.unitWeight = unitWeight;
+    }
+
+    @ExcelField(title = "总重/吨", align = 2, sort = 10)
+    public String getTotalWeight() {
+        return totalWeight;
+    }
+
+    public void setTotalWeight(String totalWeight) {
+        this.totalWeight = totalWeight;
+    }
+
+    @ExcelField(title = "甲乙供", align = 2, sort = 11)
+    public String getSupplied() {
+        return supplied;
+    }
+
+    public void setSupplied(String supplied) {
+        this.supplied = supplied;
+    }
+
+    @Override
+    public String getRemarks() {
+        return super.getRemarks();
+    }
+
+    @Override
+    public void setRemarks(String remarks) {
+        super.setRemarks(remarks);
+    }
+
+    @ExcelField(title = "利库数量", align = 2, sort = 12)
+    public Double getNumberOfNiches() {
+        return numberOfNiches;
+    }
+
+    public void setNumberOfNiches(Double numberOfNiches) {
+        this.numberOfNiches = numberOfNiches;
+    }
+
+    @ExcelField(title = "申请数量", align = 2, sort = 13)
+    public Double getNumberOfApplications() {
+        return numberOfApplications;
+    }
+
+    public void setNumberOfApplications(Double numberOfApplications) {
+        this.numberOfApplications = numberOfApplications;
+    }
+
+    public List<MaterialDetails> getLocalList() {
+        return localList;
+    }
+
+    public void setLocalList(List<MaterialDetails> localList) {
+        this.localList = localList;
+    }
+
+    public List<MaterialDetails> getRegionalList() {
+        return regionalList;
+    }
+
+    public void setRegionalList(List<MaterialDetails> regionalList) {
+        this.regionalList = regionalList;
+    }
+
+    public List<MaterialDetails> getLocalRepList() {
+        return localRepList;
+    }
+
+    public void setLocalRepList(List<MaterialDetails> localRepList) {
+        this.localRepList = localRepList;
+    }
+
+    public List<MaterialDetails> getRegionalRepList() {
+        return regionalRepList;
+    }
+
+    public void setRegionalRepList(List<MaterialDetails> regionalRepList) {
+        this.regionalRepList = regionalRepList;
+    }
+
+    public String getReplaceCode() {
+        return replaceCode;
+    }
+
+    public void setReplaceCode(String replaceCode) {
+        this.replaceCode = replaceCode;
+    }
+
+    public String getReplaceExCode() {
+        return replaceExCode;
+    }
+
+    public void setReplaceExCode(String replaceExCode) {
+        this.replaceExCode = replaceExCode;
+    }
+
+    @ExcelField(title = "本地利库批次号", align = 2, sort = 14)
+    public String getLocalWareBatch() {
+        return localWareBatch;
+    }
+
+    public void setLocalWareBatch(String localWareBatch) {
+        this.localWareBatch = localWareBatch;
+    }
+
+    @ExcelField(title = "本地利库库存地", align = 2, sort = 15)
+    public String getLocalWareHouse() {
+        return localWareHouse;
+    }
+
+    public void setLocalWareHouse(String localWareHouse) {
+        this.localWareHouse = localWareHouse;
+    }
+
+    @ExcelField(title = "本地利库数量", align = 2, sort = 16)
+    public String getNumberOfLocal() {
+        return numberOfLocal;
+    }
+
+    public void setNumberOfLocal(String numberOfLocal) {
+        this.numberOfLocal = numberOfLocal;
+    }
+
+    @ExcelField(title = "跨区利库批次号", align = 2, sort = 17)
+    public String getRegionalBatch() {
+        return regionalBatch;
+    }
+
+    public void setRegionalBatch(String regionalBatch) {
+        this.regionalBatch = regionalBatch;
+    }
+
+    @ExcelField(title = "跨区利库库存地", align = 2, sort = 18)
+    public String getRegionalHouse() {
+        return regionalHouse;
+    }
+
+    public void setRegionalHouse(String regionalHouse) {
+        this.regionalHouse = regionalHouse;
+    }
+
+    @ExcelField(title = "跨区利库数量", align = 2, sort = 19)
+    public String getNumberOfRegional() {
+        return numberOfRegional;
+    }
+
+    public void setNumberOfRegional(String numberOfRegional) {
+        this.numberOfRegional = numberOfRegional;
+    }
+
+    @ExcelField(title = "本地以大代小利库型号", align = 2, sort = 20)
+    public String getLocalLiKuModel() {
+        return localLiKuModel;
+    }
+
+    public void setLocalLiKuModel(String localLiKuModel) {
+        this.localLiKuModel = localLiKuModel;
+    }
+
+    @ExcelField(title = "本地以大代小利库批次号", align = 2, sort = 21)
+    public String getLocalLiKuBatch() {
+        return localLiKuBatch;
+    }
+
+    public void setLocalLiKuBatch(String localLiKuBatch) {
+        this.localLiKuBatch = localLiKuBatch;
+    }
+
+    @ExcelField(title = "本地以大代小利库库存地", align = 2, sort = 22)
+    public String getLocalLiKuWareHouse() {
+        return localLiKuWareHouse;
+    }
+
+    public void setLocalLiKuWareHouse(String localLiKuWareHouse) {
+        this.localLiKuWareHouse = localLiKuWareHouse;
+    }
+
+    @ExcelField(title = "本地以大代小利库数量", align = 2, sort = 23)
+    public String getNumberOfLocalLiKu() {
+        return numberOfLocalLiKu;
+    }
+
+    public void setNumberOfLocalLiKu(String numberOfLocalLiKu) {
+        this.numberOfLocalLiKu = numberOfLocalLiKu;
+    }
+
+    @ExcelField(title = "跨区以大代小利库型号", align = 2, sort = 24)
+    public String getRegionLiKuModel() {
+        return regionLiKuModel;
+    }
+
+    public void setRegionLiKuModel(String regionLiKuModel) {
+        this.regionLiKuModel = regionLiKuModel;
+    }
+
+    @ExcelField(title = "跨区以大代小利库批次号", align = 2, sort = 25)
+    public String getRegionLiKuBatch() {
+        return regionLiKuBatch;
+    }
+
+    public void setRegionLiKuBatch(String regionLiKuBatch) {
+        this.regionLiKuBatch = regionLiKuBatch;
+    }
+
+    @ExcelField(title = "跨区以大代小利库库存地", align = 2, sort = 26)
+    public String getRegionLiKuWareHouse() {
+        return regionLiKuWareHouse;
+    }
+
+    public void setRegionLiKuWareHouse(String regionLiKuWareHouse) {
+        this.regionLiKuWareHouse = regionLiKuWareHouse;
+    }
+
+    @ExcelField(title = "跨区以大代小利库数量", align = 2, sort = 27)
+    public String getNumberOfRegionalLiKu() {
+        return numberOfRegionalLiKu;
+    }
+
+    public void setNumberOfRegionalLiKu(String numberOfRegionalLiKu) {
+        this.numberOfRegionalLiKu = numberOfRegionalLiKu;
+    }
+}

+ 22 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/mapper/MaterialReportDetailsMapper.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.entity.MaterialReportDetails;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 物资上报明细MAPPER接口
+ * @author enford
+ * @version 1.0
+ */
+@MyBatisMapper
+public interface MaterialReportDetailsMapper extends BaseMapper<MaterialReportDetails> {
+    void insertList(List<MaterialReportDetails> list);
+}

+ 215 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/mapper/xml/MaterialReportDetailsMapper.xml

@@ -0,0 +1,215 @@
+<?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.balancedlibrary.materialReportDetails.mapper.MaterialReportDetailsMapper">
+	<sql id="resourceColumns">
+		a.id as "id",
+		a.create_by as "create_by",
+		a.create_date as "create_date",
+		a.update_by as "update_by",
+		a.update_date as "update_date",
+		a.del_flag as "del_flag",
+		a.remarks as "remarks",
+		a.reportingArea as "reportingArea",
+		a.nameOfReserve as "nameOfReserve",
+		a.materialCode as "materialCode",
+		a.materialName as "materialName",
+		a.extendedCoding as "extendedCoding",
+		a.extendedDescription as "extendedDescription",
+		a.unit as "unit",
+		a.total as "total",
+		a.unitWeight as "unitWeight",
+		a.totalWeight as "totalWeight",
+		a.supplied as "supplied",
+		a.numberOfNiches as "numberOfNiches",
+		a.numberOfApplications as "numberOfApplications",
+		a.localWareBatch as "localWareBatch",
+		a.localWareHouse as "localWareHouse",
+		a.numberOfLocal as "numberOfLocal",
+		a.regionalBatch as "regionalBatch",
+		a.regionalHouse as "regionalHouse",
+		a.numberOfRegional as "numberOfRegional",
+		a.localLiKuModel as "localLiKuModel",
+		a.localLiKuBatch as "localLiKuBatch",
+		a.localLiKuWareHouse as "localLiKuWareHouse",
+		a.numberOfLocalLiKu as "numberOfLocalLiKu",
+		a.regionLiKuModel as "regionLiKuModel",
+		a.regionLiKuBatch as "regionLiKuBatch",
+		a.regionLiKuWareHouse as "regionLiKuWareHouse",
+		a.numberOfRegionalLiKu as "numberOfRegionalLiKu"
+	</sql>
+
+	<sql id="leftJoins">
+		LEFT JOIN sys_office office ON office.id = a.office_id
+		LEFT JOIN sys_user tuser ON tuser.id = a.user_id
+	</sql>
+
+
+	<select id="get" resultType="MaterialReportDetails" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_resource_pool a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="MaterialReportDetails" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_material_report 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.id asc
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findAllList" resultType="MaterialReportDetails" >
+		SELECT
+			<include refid="resourceColumns"/>
+		FROM bla_resource_pool 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 bla_resource_pool(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag}
+		)
+	</insert>
+    <insert id="insertList">
+		insert into bla_material_report(
+		                                id,
+		                                create_by,
+		                                create_date,
+		                                update_by,
+		                                update_date,
+		                                del_flag,
+		                                remarks,
+		                                reportingArea,
+		                                nameOfReserve,
+		                                materialCode,
+		                                materialName,
+		                                extendedCoding,
+		                                extendedDescription,
+		                                unit,
+		                                total,
+		                                unitWeight,
+		                                totalWeight,
+		                                supplied,
+		                                numberOfNiches,
+		                                numberOfApplications,
+		                                localWareBatch,
+		                                localWareHouse,
+		                                numberOfLocal,
+		                                regionalBatch,
+		                                regionalHouse,
+		                                numberOfRegional,
+		                                localLiKuModel,
+		                                localLiKuBatch,
+		                                localLiKuWareHouse,
+		                                numberOfLocalLiKu,
+		                                regionLiKuModel,
+		                                regionLiKuBatch,
+		                                regionLiKuWareHouse,
+		                                numberOfRegionalLiKu
+		)VALUES
+		<foreach collection="list" item="item" index="index" separator=",">
+			(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.delFlag},
+			#{item.remarks},
+			#{item.reportingArea},
+			#{item.nameOfReserve},
+			#{item.materialCode},
+			#{item.materialName},
+			#{item.extendedCoding},
+			#{item.extendedDescription},
+			#{item.unit},
+			#{item.total},
+			#{item.unitWeight},
+			#{item.totalWeight},
+			#{item.supplied},
+			#{item.numberOfNiches},
+			#{item.numberOfApplications},
+			#{item.localWareBatch},
+			#{item.localWareHouse},
+			#{item.numberOfLocal},
+			#{item.regionalBatch},
+			#{item.regionalHouse},
+			#{item.numberOfRegional},
+			#{item.localLiKuModel},
+			#{item.localLiKuBatch},
+			#{item.localLiKuWareHouse},
+			#{item.numberOfLocalLiKu},
+			#{item.regionLiKuModel},
+			#{item.regionLiKuBatch},
+			#{item.regionLiKuWareHouse},
+			#{item.numberOfRegionalLiKu}
+			)
+		</foreach>
+	</insert>
+
+
+    <update id="update">
+		UPDATE bla_resource_pool SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM bla_resource_pool
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE bla_resource_pool SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="LiKuResourcePool" statementType="STATEMENT">
+		select * FROM bla_resource_pool  where ${propertyName} = '${value}'
+	</select>
+
+</mapper>

+ 59 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/service/MaterialReportDetailsService.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.mapper.LiKuResourcePoolMapper;
+import com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.entity.MaterialReportDetails;
+import com.jeeplus.modules.sg.balancedlibrary.materialReportDetails.mapper.MaterialReportDetailsMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 物资上报明细Service
+ *
+ * @author enford
+ * @version 1.0
+ */
+@Service
+@Transactional(readOnly = true)
+public class MaterialReportDetailsService extends CrudService<MaterialReportDetailsMapper, MaterialReportDetails> {
+
+	@Override
+	public MaterialReportDetails get(String id) {
+		return super.get(id);
+	}
+
+	@Override
+	public List<MaterialReportDetails> findList(MaterialReportDetails entity) {
+		return super.findList(entity);
+	}
+
+	@Override
+	public Page<MaterialReportDetails> findPage(Page<MaterialReportDetails> page, MaterialReportDetails entity) {
+		return super.findPage(page, entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void save(MaterialReportDetails entity) {
+		super.save(entity);
+	}
+
+	@Override
+	@Transactional(readOnly = false)
+	public void delete(MaterialReportDetails entity) {
+		super.delete(entity);
+	}
+
+	@Transactional(readOnly = false)
+	public void insertList(List<MaterialReportDetails> list) {
+		mapper.insertList(list);
+
+	}
+}

ファイルの差分が大きいため隠しています
+ 3501 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/web/MaterialReportDetailsController.java


+ 130 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/entity/ReplaceMaterial.java

@@ -0,0 +1,130 @@
+package com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.core.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.Office;
+
+/**
+ * 物料替换Entity
+ * @author enford
+ * @version 1.0
+ */
+public class ReplaceMaterial extends DataEntity<ReplaceMaterial> {
+    /**
+     * 物料编码
+     */
+    private String materialCode;
+    /**
+     * 物料描述
+     */
+    private String materialDescription;
+    /**
+     * 扩展编码
+     */
+    private String extendedCoding;
+    /**
+     * 扩展描述
+     */
+    private String extendedDescription;
+    /**
+     * 代替物料,替换列
+     */
+    private String subMaterial;
+    /**
+     * 物料编码-替换
+     */
+    private String materialCodeRep;
+    /**
+     * 物料描述-替换
+     */
+    private String materialDescriptionRep;
+    /**
+     * 扩展编码-替换
+     */
+    private String extendedCodingRep;
+    /**
+     * 扩展描述-替换
+     */
+    private String extendedDescriptionRep;
+
+    @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 getExtendedCoding() {
+        return extendedCoding;
+    }
+
+    public void setExtendedCoding(String extendedCoding) {
+        this.extendedCoding = extendedCoding;
+    }
+
+    @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 getSubMaterial() {
+        return subMaterial;
+    }
+
+    public void setSubMaterial(String subMaterial) {
+        this.subMaterial = subMaterial;
+    }
+
+    @ExcelField(title = "物料编码-替换", align = 2, sort = 6)
+    public String getMaterialCodeRep() {
+        return materialCodeRep;
+    }
+
+    public void setMaterialCodeRep(String materialCodeRep) {
+        this.materialCodeRep = materialCodeRep;
+    }
+
+    @ExcelField(title = "物料描述-替换", align = 2, sort = 7)
+    public String getMaterialDescriptionRep() {
+        return materialDescriptionRep;
+    }
+
+    public void setMaterialDescriptionRep(String materialDescriptionRep) {
+        this.materialDescriptionRep = materialDescriptionRep;
+    }
+
+    @ExcelField(title = "扩展编码-替换", align = 2, sort = 8)
+    public String getExtendedCodingRep() {
+        return extendedCodingRep;
+    }
+
+    public void setExtendedCodingRep(String extendedCodingRep) {
+        this.extendedCodingRep = extendedCodingRep;
+    }
+
+    @ExcelField(title = "扩展描述-替换", align = 2, sort = 9)
+    public String getExtendedDescriptionRep() {
+        return extendedDescriptionRep;
+    }
+
+    public void setExtendedDescriptionRep(String extendedDescriptionRep) {
+        this.extendedDescriptionRep = extendedDescriptionRep;
+    }
+}

+ 28 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/mapper/ReplaceMaterialMapper.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.entity.ReplaceMaterial;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 物料替换MAPPER接口
+ * @author enford
+ * @version 1.0
+ */
+@MyBatisMapper
+public interface ReplaceMaterialMapper extends BaseMapper<ReplaceMaterial> {
+    /**
+     * 批量插入替换物料信息
+     * @param list 插入信息
+     * */
+    void insertList(@Param("list") List<ReplaceMaterial> list);
+
+    List<ReplaceMaterial> findAll();
+}

+ 166 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/mapper/xml/ReplaceMaterialMapper.xml

@@ -0,0 +1,166 @@
+<?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.balancedlibrary.replaceMaterial.mapper.ReplaceMaterialMapper">
+	<sql id="replaceColumns">
+		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.materialCode AS "materialCode",
+		a.materialDescription AS "materialDescription",
+		a.extendedCoding AS "extendedCoding",
+		a.extendedDescription AS "extendedDescription",
+		a.materialCodeRep AS "materialCodeRep",
+		a.materialDescriptionRep AS "materialDescriptionRep",
+		a.extendedCodingRep AS "extendedCodingRep",
+		a.extendedDescriptionRep AS "extendedDescriptionRep"
+	</sql>
+
+	<sql id="leftJoins">
+		LEFT JOIN sys_office office ON office.id = a.office_id
+		LEFT JOIN sys_user tuser ON tuser.id = a.user_id
+	</sql>
+
+
+	<select id="get" resultType="ReplaceMaterial" >
+		SELECT
+			<include refid="replaceColumns"/>
+		FROM bla_replace_material a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="ReplaceMaterial" >
+		SELECT
+			<include refid="replaceColumns"/>
+		FROM bla_replace_material a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="materialCode != null and materialCode != ''">
+				AND a.materialCode = #{materialCode}
+			</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="ReplaceMaterial" >
+		SELECT
+			<include refid="replaceColumns"/>
+		FROM bla_replace_material 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 bla_replace_material(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag}
+		)
+	</insert>
+	<insert id="insertList">
+		replace into bla_replace_material(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			remarks,
+			materialCode,
+			materialDescription,
+			extendedCoding,
+			extendedDescription,
+			materialCodeRep,
+			materialDescriptionRep,
+			extendedCodingRep,
+			extendedDescriptionRep
+		)VALUES
+		<foreach collection="list" item="item" index="index" separator=",">
+			(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.delFlag},
+			#{item.remarks},
+			#{item.materialCode},
+			#{item.materialDescription},
+			#{item.extendedCoding},
+			#{item.extendedDescription},
+			#{item.materialCodeRep},
+			#{item.materialDescriptionRep},
+			#{item.extendedCodingRep},
+			#{item.extendedDescriptionRep}
+			)
+		</foreach>
+	</insert>
+
+	<update id="update">
+		UPDATE bla_replace_material SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM bla_replace_material
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE bla_replace_material SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ReplaceMaterial" statementType="STATEMENT">
+		select * FROM bla_replace_material  where ${propertyName} = '${value}'
+	</select>
+    <select id="findAll"
+            resultType="com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.entity.ReplaceMaterial">
+		SELECT
+		<include refid="replaceColumns"/>
+		FROM bla_replace_material a
+	</select>
+
+</mapper>

+ 62 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/service/ReplaceMaterialService.java

@@ -0,0 +1,62 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.mapper.LiKuResourcePoolMapper;
+import com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.entity.ReplaceMaterial;
+import com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.mapper.ReplaceMaterialMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 物料替换Service
+ * @author enford
+ * @version 1.0
+ */
+@Service
+@Transactional(readOnly = true)
+public class ReplaceMaterialService extends CrudService<ReplaceMaterialMapper, ReplaceMaterial> {
+
+	@Override
+	public ReplaceMaterial get(String id) {
+		return super.get(id);
+	}
+	
+	@Override
+	public List<ReplaceMaterial> findList(ReplaceMaterial entity) {
+		return super.findList(entity);
+	}
+	
+	@Override
+	public Page<ReplaceMaterial> findPage(Page<ReplaceMaterial> page, ReplaceMaterial entity) {
+		return super.findPage(page, entity);
+	}
+	
+	@Override
+	@Transactional(readOnly = false)
+	public void save(ReplaceMaterial entity) {
+		super.save(entity);
+	}
+	
+	@Override
+	@Transactional(readOnly = false)
+	public void delete(ReplaceMaterial entity) {
+		super.delete(entity);
+	}
+
+	@Transactional(readOnly = false)
+	public void insertList(List<ReplaceMaterial> list) {
+		mapper.insertList(list);
+	}
+
+	public List<ReplaceMaterial> findAll() {
+		return mapper.findAll();
+	}
+}

+ 273 - 0
src/main/java/com/jeeplus/modules/sg/balancedlibrary/replaceMaterial/web/ReplaceMaterialController.java

@@ -0,0 +1,273 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.web;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import com.jeeplus.modules.sys.entity.User;
+
+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.sg.balancedlibrary.liKuResourcePool.entity.LiKuResourcePool;
+import com.jeeplus.modules.sg.balancedlibrary.liKuResourcePool.service.LiKuResourcePoolService;
+import com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.entity.ReplaceMaterial;
+import com.jeeplus.modules.sg.balancedlibrary.replaceMaterial.service.ReplaceMaterialService;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.DataFormat;
+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.validation.ConstraintViolationException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 物料替换Controller
+ * @author enford
+ * @version 1.0
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/replaceMaterial")
+public class ReplaceMaterialController extends BaseController {
+
+	@Autowired
+	private ReplaceMaterialService service;
+	
+	@ModelAttribute
+	public ReplaceMaterial get(@RequestParam(required=false) String id) {
+		ReplaceMaterial entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = service.get(id);
+		}
+		if (entity == null){
+			entity = new ReplaceMaterial();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 物料替换列表页面
+	 */
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:list")
+	@RequestMapping(value = "list")
+	public String list(ReplaceMaterial entity, Model model) {
+		model.addAttribute("entity", entity);
+		return "modules/sg/balancedlibrary/replaceMaterial/replaceMaterialList";
+	}
+	
+		/**
+	 * 物料替换列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(ReplaceMaterial entity, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ReplaceMaterial> page = service.findPage(new Page<ReplaceMaterial>(request, response), entity);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑物料替换表单页面
+	 */
+	@RequiresPermissions(value={"sg:balancedlibrary:ReplaceMaterial:view","sg:balancedlibrary:ReplaceMaterial:add","sg:balancedlibrary:ReplaceMaterial:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(ReplaceMaterial entity, Model model) {
+		model.addAttribute("entity", entity);
+		return "modules/test/one/dialog/ReplaceMaterialForm";
+	}
+
+	/**
+	 * 保存物料替换
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"sg:balancedlibrary:ReplaceMaterial:add","sg:balancedlibrary:ReplaceMaterial:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(ReplaceMaterial entity, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(entity);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		service.save(entity);
+		j.setSuccess(true);
+		j.setMsg("保存物料替换成功");
+		return j;
+	}
+	
+	/**
+	 * 删除物料替换
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(ReplaceMaterial entity) {
+		AjaxJson j = new AjaxJson();
+		service.delete(entity);
+		j.setMsg("删除物料替换成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除物料替换
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			service.delete(service.get(id));
+		}
+		j.setMsg("删除物料替换成功");
+		return j;
+	}
+	
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(ReplaceMaterial entity, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "物料替换"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<ReplaceMaterial> page = service.findPage(new Page<ReplaceMaterial>(request, response, -1), entity);
+    		new ExportExcel("", ReplaceMaterial.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;
+    }
+
+	/**
+	 * 导入Excel数据
+
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:import")
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+		List<ReplaceMaterial> insertList = new ArrayList<>();
+		try {
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			for (int i = 1; i < ei.getLastDataRowNum(); i++) {
+				Row row = ei.getRow(i);
+				ReplaceMaterial replaceMaterial = new ReplaceMaterial();
+				Cell cell = row.getCell(0);
+				String value = cell.toString();
+				if ("".equals(value) || null == value || value.contains("注:")) {
+					continue;
+				}
+				BigDecimal bigDecimal = new BigDecimal(value);
+				String cellOne = bigDecimal.toPlainString();
+				replaceMaterial.setMaterialCode(cellOne);
+				replaceMaterial.setMaterialDescription(String.valueOf(row.getCell(1)));
+				BigDecimal decTwo = new BigDecimal(row.getCell(2).toString());
+				replaceMaterial.setExtendedCoding(decTwo.toPlainString());
+				replaceMaterial.setExtendedDescription(String.valueOf(row.getCell(3)));
+				BigDecimal decFive = new BigDecimal(row.getCell(5).toString());
+				replaceMaterial.setMaterialCodeRep(decFive.toPlainString());
+				replaceMaterial.setMaterialDescriptionRep(String.valueOf(row.getCell(6)));
+				BigDecimal decSeven = new BigDecimal(row.getCell(7).toString());
+				replaceMaterial.setExtendedCodingRep(decSeven.toPlainString());
+				String cellEight = String.valueOf(row.getCell(8));
+				if ("null".equals(cellEight)) {
+					cellEight = "";
+				}
+				replaceMaterial.setExtendedDescriptionRep(cellEight);
+				replaceMaterial.preInsert();
+				insertList.add(replaceMaterial);
+			}
+			if (insertList.size() > 0) {
+				service.insertList(insertList);
+			}
+			j.setMsg( "已成功导入 "+insertList.size()+" 条替换记录");
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入物料替换失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+	
+	/**
+	 * 下载导入物料替换数据模板
+	 */
+	@ResponseBody
+	@RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:import")
+    @RequestMapping(value = "import/template")
+     public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "物料替换数据导入模板.xlsx";
+    		List<ReplaceMaterial> list = Lists.newArrayList(); 
+    		new ExportExcel("", ReplaceMaterial.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+
+	/**
+	 * 当使用POI处理excel的时候,遇到了比较长的数字,
+	 * 虽然excel里面设置该单元格是文本类型的,但是POI的cell的类型就会变成数字类型
+	 * 而且无论数字是否小数,使用cell.getNumbericCellValue() 去获取值的时候,会得到一个double,
+	 * 而且当长度大一点的时候会变成科学计数法形式
+	 * 使用DecimalFormat对这个double进行了格式话,
+	 * 随后使用format方法获得的String就是你想要的值了。
+	 * @param hssfcell
+	 * @return
+	 */
+	public static String getValue(HSSFCell hssfcell){
+		String str;
+		DecimalFormat df = new DecimalFormat("0");
+		if(hssfcell.getCellType()==HSSFCell.CELL_TYPE_BOOLEAN){
+			str = String.valueOf(hssfcell.getBooleanCellValue());
+			return str;
+		} else if(hssfcell.getCellType()==HSSFCell.CELL_TYPE_NUMERIC){
+			str = df.format(hssfcell.getNumericCellValue());
+			return str;
+		} else{
+			str = hssfcell.getStringCellValue();
+			return str;
+		}
+	}
+
+}

+ 409 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/liKuResourcePool/liKuResourcePoolList.js

@@ -0,0 +1,409 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#leave1Table').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}/liKuResourcePool/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}/liKuResourcePool/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#leave1Table').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    },{
+				   field: 'serialNumber',
+				   title: '序号',
+				   sortable: true,
+				   sortName: 'serialNumber'
+
+			   }
+			,{
+		        field: 'factory',
+		        title: '工厂',
+		        sortable: true,
+		        sortName: 'factory'
+		       
+		    }
+			,{
+		        field: 'batch',
+		        title: '批次',
+		        sortable: true,
+		        sortName: 'batch'
+		       
+		    }
+			,{
+		        field: 'materialCode',
+		        title: '物料编码',
+		        sortable: true,
+		        sortName: 'materialCode'
+		       
+		    }
+			,{
+		        field: 'materialDescription',
+		        title: '物料描述',
+		        sortable: true,
+		        sortName: 'materialDescription'
+		       
+		    }
+			,{
+		        field: 'unitOfMeasurement',
+		        title: '计量单位',
+		        sortable: true,
+		        sortName: 'unitOfMeasurement'
+		       
+		    }
+				   ,{
+					   field: 'inventoryAmount',
+					   title: '库存数量',
+					   sortable: true,
+					   sortName: 'inventoryAmount'
+
+				   }
+				   ,{
+					   field: 'inventoryLocation',
+					   title: '库存金额',
+					   sortable: true,
+					   sortName: 'inventoryLocation'
+
+				   }
+				   ,{
+					   field: 'invLocation',
+					   title: '库存地',
+					   sortable: true,
+					   sortName: 'invLocation'
+
+				   }
+				   ,{
+					   field: 'invLocationDes',
+					   title: '库存地描述',
+					   sortable: true,
+					   sortName: 'invLocationDes'
+
+				   }
+				   ,{
+					   field: 'supplierName',
+					   title: '供应商名称',
+					   sortable: true,
+					   sortName: 'supplierName'
+
+				   }
+				   ,{
+					   field: 'specialStock',
+					   title: '特殊库存标识',
+					   sortable: true,
+					   sortName: 'specialStock'
+
+				   }
+				   ,{
+					   field: 'extendedCoding',
+					   title: '扩展编码',
+					   sortable: true,
+					   sortName: 'extendedCoding'
+
+				   }
+				   ,{
+					   field: 'extendedDescription',
+					   title: '扩展描述',
+					   sortable: true,
+					   sortName: 'extendedDescription'
+
+				   }
+				   ,{
+					   field: 'lengthOfCable',
+					   title: '线缆段长',
+					   sortable: true,
+					   sortName: 'lengthOfCable'
+
+				   }
+				   ,{
+					   field: 'ringCage',
+					   title: '环网箱尺寸',
+					   sortable: true,
+					   sortName: 'ringCage'
+
+				   }
+				   ,{
+					   field: 'terminalWarranty',
+					   title: '终端质保期',
+					   sortable: true,
+					   sortName: 'terminalWarranty'
+
+				   }
+				   ,{
+					   field: 'specialParameters',
+					   title: '特殊参数',
+					   sortable: true,
+					   sortName: 'specialParameters'
+
+				   }
+				   ,{
+					   field: 'daysStorage',
+					   title: '库龄(日)',
+					   sortable: true,
+					   sortName: 'daysStorage'
+
+				   }
+				   ,{
+					   field: 'monthStorage',
+					   title: '库龄(月)',
+					   sortable: true,
+					   sortName: 'monthStorage'
+
+				   }
+				   ,{
+					   field: 'isExpansion',
+					   title: '是否业扩',
+					   sortable: true,
+					   sortName: 'isExpansion'
+
+				   }
+				   ,{
+					   field: 'numberOfNiches',
+					   title: '利库数量',
+					   sortable: true,
+					   sortName: 'numberOfNiches'
+
+				   }
+				   ,{
+					   field: 'remaining',
+					   title: '申请数量',
+					   sortable: true,
+					   sortName: 'remaining'
+
+				   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#leave1Table').bootstrapTable("toggleView");
+		}
+	  
+	  $('#leave1Table').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#leave1Table').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#leave1Table').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){
+				  jp.downloadFile('${ctx}/liKuResourcePool/import/template');
+			  },
+			btn2: function(index, layero){
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					iframeWin.contentWindow.importExcel('${ctx}/liKuResourcePool/import', function (data) {
+						if(data.success){
+							jp.success(data.msg);
+							refresh();
+						}else{
+							jp.error(data.msg);
+						}
+						jp.close(index);
+					});//调用保存事件
+					return false;
+			  },
+
+			  btn3: function(index){
+				//  jp.close(index);
+			   }
+		});
+	});
+
+	/**
+	 * 导入物资上报明细表
+	 * */
+	$("#importMaterial").click(function(){
+		jp.open({
+			type: 2,
+			area: [500, 200],
+			auto: true,
+			title:"导入数据",
+			content: "${ctx}/tag/importExcel" ,
+			btn: ['下载模板','确定', '关闭'],
+			btn1: function(index, layero){
+				jp.downloadFile('${ctx}/MaterialReportDetails/import/template');
+			},
+			btn2: function(index, layero){
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				iframeWin.contentWindow.importExcel('${ctx}/MaterialReportDetails/import', function (data) {
+					if(data.success){
+						jp.success(data.msg);
+						refresh();
+					}else{
+						jp.error(data.msg);
+					}
+					jp.close(index);
+				});//调用保存事件
+				return false;
+			},
+
+			btn3: function(index){
+				//  jp.close(index);
+			}
+		});
+	})
+		
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/liKuResourcePool/export');
+	  });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+		
+		$('#beginBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#leave1Table").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该利库资源记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/liKuResourcePool/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#leave1Table').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#leave1Table').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增利库资源', "${ctx}/liKuResourcePool/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑利库资源', "${ctx}/liKuResourcePool/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看利库资源', "${ctx}/liKuResourcePool/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 76 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/liKuResourcePool/liKuResourcePoolList.jsp

@@ -0,0 +1,76 @@
+<%@ 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="liKuResourcePoolList.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="entity" 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="materialCode" htmlEscape="false" maxlength="257"  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="sg:balancedlibrary:liKuResourcePool:del">
+			<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+				<i class="glyphicon glyphicon-remove"></i> 删除
+			</button>
+		</shiro:hasPermission>
+		<shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:import">
+			<button id="btnImport" class="btn btn-info">
+				<i class="fa fa-folder-open-o"></i> 导入利库资源池基础数据
+			</button>
+		</shiro:hasPermission>
+<%--		<shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:import">
+			<button id="importMaterial" class="btn btn-info">
+				<i class="fa fa-folder-open-o"></i> 导入物资上报明细
+			</button>
+		</shiro:hasPermission>--%>
+		<shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:export">
+			<button id="export" class="btn btn-warning">
+				<i class="fa fa-file-excel-o"></i> 导出
+			</button>
+		 </shiro:hasPermission>
+	</div>
+		
+	<!-- 表格 -->
+	<table id="leave1Table"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+        <shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 395 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/materialReportDetails/MaterialReportDetailsList.js

@@ -0,0 +1,395 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#leave1Table').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}/MaterialReportDetails/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}/MaterialReportDetails/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#leave1Table').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+
+                   	});
+
+                   }
+               },
+
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+				   field: 'reportingArea',
+				   title: '上报地区',
+				   sortable: true,
+				   sortName: 'reportingArea'
+
+			   }
+			,{
+		        field: 'nameOfReserve',
+		        title: '储备项目名称',
+		        sortable: true,
+		        sortName: 'nameOfReserve'
+
+		    }
+			,{
+		        field: 'materialCode',
+		        title: '物料编码',
+		        sortable: true,
+		        sortName: 'materialCode'
+
+		    }
+			,{
+		        field: 'materialName',
+		        title: '物料名称',
+		        sortable: true,
+		        sortName: 'materialName'
+
+		    }
+			,{
+		        field: 'extendedCoding',
+		        title: '扩展编码',
+		        sortable: true,
+		        sortName: 'extendedCoding'
+
+		    }
+			,{
+		        field: 'extendedDescription',
+		        title: '扩展描述',
+		        sortable: true,
+		        sortName: 'extendedDescription'
+
+		    }
+				   ,{
+					   field: 'unit',
+					   title: '单位',
+					   sortable: true,
+					   sortName: 'unit'
+
+				   }
+				   ,{
+					   field: 'total',
+					   title: '总量',
+					   sortable: true,
+					   sortName: 'total'
+
+				   }
+				   ,{
+					   field: 'unitWeight',
+					   title: '单重/kg',
+					   sortable: true,
+					   sortName: 'unitWeight'
+
+				   }
+				   ,{
+					   field: 'totalWeight',
+					   title: '总重/吨',
+					   sortable: true,
+					   sortName: 'totalWeight'
+
+				   }
+				   ,{
+					   field: 'supplied',
+					   title: '甲乙供',
+					   sortable: true,
+					   sortName: 'supplied'
+
+				   }
+				   ,{
+					   field: 'numberOfNiches',
+					   title: '利库数量',
+					   sortable: true,
+					   sortName: 'numberOfNiches'
+
+				   }
+				   ,{
+					   field: 'numberOfApplications',
+					   title: '申请数量',
+					   sortable: true,
+					   sortName: 'numberOfApplications'
+
+				   }
+				   ,{
+					   field: 'localWareBatch',
+					   title: '本地利库批次号',
+					   sortable: true,
+					   sortName: 'localWareBatch'
+
+				   }
+				   ,{
+					   field: 'localWareHouse',
+					   title: '本地利库库存地',
+					   sortable: true,
+					   sortName: 'localWareHouse'
+
+				   }
+				   ,{
+					   field: 'numberOfLocal',
+					   title: '本地利库数量',
+					   sortable: true,
+					   sortName: 'numberOfLocal'
+
+				   }
+				   ,{
+					   field: 'regionalBatch',
+					   title: '跨区利库批次号',
+					   sortable: true,
+					   sortName: 'regionalBatch'
+
+				   }
+				   ,{
+					   field: 'regionalHouse',
+					   title: '跨区利库库存地',
+					   sortable: true,
+					   sortName: 'regionalHouse'
+
+				   }
+				   ,{
+					   field: 'numberOfRegional',
+					   title: '跨区利库数量',
+					   sortable: true,
+					   sortName: 'numberOfRegional'
+
+				   }
+				   ,{
+					   field: 'localLiKuModel',
+					   title: '本地以大代小利库型号',
+					   sortable: true,
+					   sortName: 'localLiKuModel'
+
+				   }
+				   ,{
+					   field: 'localLiKuBatch',
+					   title: '本地以大代小利库批次号',
+					   sortable: true,
+					   sortName: 'localLiKuBatch'
+
+				   }
+				   ,{
+					   field: 'localLiKuWareHouse',
+					   title: '本地以大代小利库库存地',
+					   sortable: true,
+					   sortName: 'localLiKuWareHouse'
+
+				   }
+				   ,{
+					   field: 'numberOfLocalLiKu',
+					   title: '本地以大代小利库数量',
+					   sortable: true,
+					   sortName: 'numberOfLocalLiKu'
+
+				   },{
+					   field: 'regionLiKuModel',
+					   title: '跨区以大代小利库型号',
+					   sortable: true,
+					   sortName: 'regionLiKuModel'
+
+				   },{
+					   field: 'regionLiKuBatch',
+					   title: '跨区以大代小利库批次号',
+					   sortable: true,
+					   sortName: 'regionLiKuBatch'
+
+				   },{
+					   field: 'regionLiKuWareHouse',
+					   title: '跨区以大代小利库库存地',
+					   sortable: true,
+					   sortName: 'regionLiKuWareHouse'
+
+				   },{
+					   field: 'numberOfRegionalLiKu',
+					   title: '跨区以大代小利库数量',
+					   sortable: true,
+					   sortName: 'numberOfRegionalLiKu'
+
+				   }
+		     ]
+
+		});
+
+
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+
+		  $('#leave1Table').bootstrapTable("toggleView");
+		}
+
+	  $('#leave1Table').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#leave1Table').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#leave1Table').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){
+					jp.downloadFile('${ctx}/MaterialReportDetails/import/template');
+				},
+				btn2: function(index, layero){
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					iframeWin.contentWindow.importExcel('${ctx}/MaterialReportDetails/import', function (data) {
+						if(data.success){
+							jp.success(data.msg);
+							jp.downloadFile('${ctx}/MaterialReportDetails/export','finalAccount');//给个name是为了能够在某些条件下下载两个文件							refresh();
+							refresh();
+						}else{
+							jp.error(data.msg);
+						}
+						jp.close(index);
+					});//调用保存事件
+					return false;
+				},
+
+				btn3: function(index){
+					//  jp.close(index);
+				}
+			});
+		});
+
+
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/MaterialReportDetails/export');
+	  });
+
+
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+
+		$('#beginBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+
+	});
+
+  function getIdSelections() {
+        return $.map($("#leave1Table").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+
+  function deleteAll(){
+
+		jp.confirm('确认要删除该利库资源记录吗?', function(){
+			jp.loading();
+			jp.get("${ctx}/MaterialReportDetails/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#leave1Table').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#leave1Table').bootstrapTable('refresh');
+  }
+
+   function add(){
+	  jp.openSaveDialog('新增利库资源', "${ctx}/MaterialReportDetails/form",'800px', '500px');
+  }
+
+
+
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑利库资源', "${ctx}/MaterialReportDetails/form?id=" + id, '800px', '500px');
+  }
+
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看利库资源', "${ctx}/MaterialReportDetails/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 71 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/materialReportDetails/MaterialReportDetailslList.jsp

@@ -0,0 +1,71 @@
+<%@ 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="MaterialReportDetailsList.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="entity" 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="materialCode" htmlEscape="false" maxlength="257"  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="sg:balancedlibrary:liKuResourcePool:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>--%>
+			<shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:import">
+				<button id="btnImport" class="btn btn-info">
+					<i class="fa fa-folder-open-o"></i> 导入
+				</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:export">
+				<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 </shiro:hasPermission>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="leave1Table"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+<%--        <shiro:hasPermission name="sg:balancedlibrary:liKuResourcePool:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>--%>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 269 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/replaceMaterial/replaceMaterialList.js

@@ -0,0 +1,269 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#leave1Table').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}/replaceMaterial/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}/test/one/dialog/leave1/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#leave1Table').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+			,{
+		        field: 'materialCode',
+		        title: '物料编码',
+		        sortable: true,
+		        sortName: 'materialCode'
+		       
+		    }
+			,{
+		        field: 'materialDescription',
+		        title: '物料描述',
+		        sortable: true,
+		        sortName: 'materialDescription'
+		       
+		    }
+			,{
+		        field: 'extendedCoding',
+		        title: '扩展编码',
+		        sortable: true,
+		        sortName: 'extendedCoding'
+		       
+		    }
+			,{
+		        field: 'extendedDescription',
+		        title: '扩展描述',
+		        sortable: true,
+		        sortName: 'extendedDescription'
+		       
+		    }
+			,{
+		        field: 'materialCodeRep',
+		        title: '物料编码-替换',
+		        sortable: true,
+		        sortName: 'materialCodeRep'
+		       
+		    }
+				   ,{
+					   field: 'materialDescriptionRep',
+					   title: '物料描述-替换',
+					   sortable: true,
+					   sortName: 'materialDescriptionRep'
+
+				   }
+				   ,{
+					   field: 'extendedCodingRep',
+					   title: '扩展编码-替换',
+					   sortable: true,
+					   sortName: 'extendedCodingRep'
+
+				   }
+				   ,{
+					   field: 'extendedDescriptionRep',
+					   title: '扩展描述-替换',
+					   sortable: true,
+					   sortName: 'extendedDescriptionRep'
+
+				   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#leave1Table').bootstrapTable("toggleView");
+		}
+	  
+	  $('#leave1Table').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#leave1Table').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#leave1Table').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){
+					  jp.downloadFile('${ctx}/replaceMaterial/import/template');
+				  },
+			    btn2: function(index, layero){
+				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/replaceMaterial/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+                            jp.close(index);
+						});//调用保存事件
+						return false;
+				  },
+
+				  btn3: function(index){
+					//  jp.close(index);
+	    	       }
+			}); 
+		});
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/replaceMaterial/export');
+	  });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#leave1Table').bootstrapTable('refresh');
+		});
+		
+		$('#beginBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#leave1Table").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该物料替换记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/replaceMaterial/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#leave1Table').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#leave1Table').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增物料替换', "${ctx}/replaceMaterial/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑物料替换', "${ctx}/replaceMaterial/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看物料替换', "${ctx}/test/one/dialog/leave1/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 81 - 0
src/main/webapp/webpage/modules/sg/balancedlibrary/replaceMaterial/replaceMaterialList.jsp

@@ -0,0 +1,81 @@
+<%@ 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="replaceMaterialList.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="entity" 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="materialCode" htmlEscape="false" maxlength="257"  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="sg:balancedlibrary:ReplaceMaterial:add">
+			<button id="add" class="btn btn-primary" onclick="add()">
+				<i class="glyphicon glyphicon-plus"></i> 新建
+			</button>
+		</shiro:hasPermission>
+		<shiro:hasPermission name="sg:balancedlibrary:ReplaceMaterial:edit">
+			<button id="edit" class="btn btn-success" disabled onclick="edit()">
+				<i class="glyphicon glyphicon-edit"></i> 修改
+			</button>
+		</shiro:hasPermission>
+			<shiro:hasPermission name="sg:balancedlibrary:ReplaceMaterial:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="sg:balancedlibrary:ReplaceMaterial:import">
+				<button id="btnImport" class="btn btn-info">
+					<i class="fa fa-folder-open-o"></i> 导入
+				</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="sg:balancedlibrary:ReplaceMaterial:export">
+				<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 </shiro:hasPermission>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="leave1Table"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+        <shiro:hasPermission name="sg:balancedlibrary:ReplaceMaterial:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>