chengqiang 4 роки тому
батько
коміт
27cd774d30
31 змінених файлів з 1196 додано та 514 видалено
  1. 4 0
      src/main/java/com/jeeplus/modules/act/web/ActTaskController.java
  2. 5 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/ConstructionMapper.java
  3. 6 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/xml/ConstructionMapper.xml
  4. 29 21
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/service/ConstructionService.java
  5. 47 8
      src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/ConstructionController.java
  6. 3 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/entity/MaterialInventory.java
  7. 3 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/entity/MaterialRequisition.java
  8. 2 2
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/mapper/MaterialInventoryMapper.java
  9. 13 13
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/mapper/xml/MaterialInventoryMapper.xml
  10. 9 4
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/service/MaterialInventoryService.java
  11. 72 82
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/util/ImportPro.java
  12. 26 26
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/web/MaterialInventoryController.java
  13. 7 1
      src/main/java/com/jeeplus/modules/sg/managementcenter/project/mapper/xml/ProjectMapper.xml
  14. 64 58
      src/main/java/com/jeeplus/modules/sg/managementcenter/project/util/ExportUtil.java
  15. 6 2
      src/main/java/com/jeeplus/modules/sg/managementcenter/project/web/ProjectController.java
  16. 21 13
      src/main/java/com/jeeplus/modules/sg/picking/activiti/web/PickIngController.java
  17. 6 0
      src/main/java/com/jeeplus/modules/sg/scheduleView/mapper/xml/ScheduleViewMapper.xml
  18. 10 0
      src/main/java/com/jeeplus/modules/sg/scheduleView/service/ScheduleViewService.java
  19. 181 0
      src/main/java/com/jeeplus/modules/sg/scheduleView/util/ExportUtil.java
  20. 286 0
      src/main/java/com/jeeplus/modules/sg/scheduleView/util/ScheduleViewUtil.java
  21. 289 265
      src/main/java/com/jeeplus/modules/sg/scheduleView/web/ScheduleViewController.java
  22. BIN
      src/main/resources/freemarker/excelmodel/scheduleViewDisclose.xlsx
  23. BIN
      src/main/resources/freemarker/excelmodel/scheduleViewRec.xlsx
  24. 10 1
      src/main/webapp/webpage/modules/sg/managementcenter/activiti/discloseList.js
  25. 31 12
      src/main/webapp/webpage/modules/sg/managementcenter/activiti/discloseList.jsp
  26. 2 2
      src/main/webapp/webpage/modules/sg/managementcenter/materialInventory/materialInventory.js
  27. 2 2
      src/main/webapp/webpage/modules/sg/picking/activiti/pickingApplication.jsp
  28. 8 0
      src/main/webapp/webpage/modules/sg/scheduleView/show/disView.js
  29. 15 0
      src/main/webapp/webpage/modules/sg/scheduleView/show/disView.jsp
  30. 8 0
      src/main/webapp/webpage/modules/sg/scheduleView/show/recView.js
  31. 31 2
      src/main/webapp/webpage/modules/sg/scheduleView/show/recView.jsp

+ 4 - 0
src/main/java/com/jeeplus/modules/act/web/ActTaskController.java

@@ -1651,6 +1651,10 @@ public class ActTaskController extends BaseController {
     @RequestMapping(value = "constructionLeader")
     public AjaxJson constructionLeader(Act act) {
         AjaxJson j = new AjaxJson();
+        if ("no".equals(act.getFlag())) {
+            //驳回后删除本次流程的所有领料清单信息
+            constructionService.delProcessList(act.getProcInsId());
+        }
         actTaskService.constructionLeader(act);
         j.setMsg("审批成功");
         return j;

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/ConstructionMapper.java

@@ -168,4 +168,9 @@ public interface ConstructionMapper extends BaseMapper<Construction> {
      *根据项目名称修改项目政策处理状态
      * */
     void updatePolicyStatus(@Param("reserveProjectName") String reserveProjectName,@Param("policyStatus") String policyStatus);
+
+    /**
+     * 通过流程定义号,删除本次领料流程中所有的领料单2020-09-23
+     */
+    void delProcessList(String procInsId);
 }

+ 6 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/mapper/xml/ConstructionMapper.xml

@@ -863,6 +863,7 @@
            OR xsp.proc_ins_id = #{procInsId}
            OR mpa.proc_ins_id = #{procInsId}
           </if>
+        group by reserveProjectName
     </select>
     <select id="findProcInsIDAll"
             resultType="com.jeeplus.modules.sg.managementcenter.activiti.entity.ReturnTodo">
@@ -908,6 +909,11 @@
         from xm_other_amount
         where id = #{id}
     </delete>
+    <delete id="delProcessList">
+        delete
+        from md_process_list
+        where procInsId = #{procInsId};
+    </delete>
     <update id="updatePolicyStatus">
         update xm_material_project
         set policyStatus = #{policyStatus}

+ 29 - 21
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/service/ConstructionService.java

@@ -21,6 +21,7 @@ import java.util.List;
 
 /**
  * 施工交底Service
+ *
  * @author
  * @version 2019-11-08
  */
@@ -33,13 +34,13 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	public Construction get(String id) {
 		Construction construction = super.get(id);
-		return  MyImportUtils.getAddUnit(construction);
+		return MyImportUtils.getAddUnit(construction);
 	}
-	
+
 	public List<Construction> findList(Construction construction) {
 		return super.findList(construction);
 	}
-	
+
 	public Page<Construction> findPage(Page<Construction> page, Construction construction) {
 		return super.findPage(page, construction);
 	}
@@ -56,7 +57,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 	 */
 	@Transactional(readOnly = false)
 	public void replaceDisclose(List<Construction> constructionList) {
-		for (Construction c :constructionList) {
+		for (Construction c : constructionList) {
 			c.preInsert();
 		}
 		constructionMapper.replaceDisclose(constructionList);
@@ -67,7 +68,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 	 */
 	@Transactional(readOnly = false)
 	public void quantityInsert(List<Construction> constructionList) {
-		for (Construction c :constructionList) {
+		for (Construction c : constructionList) {
 			c.preInsert();
 		}
 		constructionMapper.quantityInsert(constructionList);
@@ -91,14 +92,14 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 	public void save(Construction construction) {
 		super.save(construction);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(Construction construction) {
 		super.delete(construction);
 	}
 
 	@Transactional(readOnly = false)
-	public void newUpdate(Construction construction){
+	public void newUpdate(Construction construction) {
 		constructionMapper.newUpdate(construction);
 	}
 
@@ -108,7 +109,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 根据登陆名查询角色
-	 * */
+	 */
 	public List<String> nameFindOffice(String loginName) {
 		return constructionMapper.nameFindOffice(loginName);
 	}
@@ -124,7 +125,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 文件数据显示列表
-	 * */
+	 */
 	public Page<UploadImages> findUploadPage(Page<UploadImages> page, UploadImages uploadImages) {
 		dataRuleFilter(uploadImages);
 		uploadImages.setPage(page);
@@ -152,7 +153,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 根据项目定义号修改项目的土建流程状态
-	 * */
+	 */
 	@Transactional(readOnly = false)
 	public void updateAdvStatus(String id) {
 		constructionMapper.updateAdvStatus(id);
@@ -212,7 +213,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 	}
 
 	//根据输入的项目名称,分别从流程表中查询对应的项目信息
-	public List<String> insIdByName(String projectName){
+	public List<String> insIdByName(String projectName) {
 		List<String> strings = constructionMapper.insIdByName(projectName);
 		List<String> strings1 = constructionMapper.insIdByName2(projectName);
 		List<String> strings2 = constructionMapper.insIdByName3(projectName);
@@ -225,7 +226,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 根据流程定义号查询提前物料申请流程的项目名称
-	 * */
+	 */
 	public Project1 findNameByInsID(String procInsId) {
 		return constructionMapper.findNameByInsID(procInsId);
 	}
@@ -268,7 +269,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 查找其它工程量信息
-	 * */
+	 */
 	public OtherAmount getOtherAmount(OtherAmount otherAmount) {
 		return constructionMapper.getOtherAmount(otherAmount);
 	}
@@ -276,7 +277,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 土建工程量修改
-	 * */
+	 */
 	@Transactional(readOnly = false)
 	public void EngAmountSave(EngineeringAmount engineeringAmount) {
 		if (engineeringAmount.getId() == null || "".equals(engineeringAmount.getId())) {
@@ -287,7 +288,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 其它工程量修改
-	 * */
+	 */
 	@Transactional(readOnly = false)
 	public void addOther(OtherAmount otherAmount) {
 		if (otherAmount.getId() == null || "".equals(otherAmount.getId())) {
@@ -298,7 +299,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 删除土建工程量信息
-	 * */
+	 */
 	@Transactional(readOnly = false)
 	public void delEngAmount(String id) {
 		constructionMapper.delEngAmount(id);
@@ -306,18 +307,25 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 
 	/**
 	 * 删除其它工程量信息
-	 * */
+	 */
 	@Transactional(readOnly = false)
 	public void delOtherAmount(String id) {
 		constructionMapper.delOtherAmount(id);
 	}
 
 	/**
-	 *根据项目名称修改项目政策处理状态
-	 * */
+	 * 根据项目名称修改项目政策处理状态
+	 */
 	@Transactional(readOnly = false)
-	public void updatePolicyStatus(String reserveProjectName,String policyStatus) {
-		constructionMapper.updatePolicyStatus(reserveProjectName,policyStatus);
+	public void updatePolicyStatus(String reserveProjectName, String policyStatus) {
+		constructionMapper.updatePolicyStatus(reserveProjectName, policyStatus);
 	}
 
+	/**
+	 * 通过流程定义号,删除本次领料流程中所有的领料单(新增2020-09-23)
+	 */
+	@Transactional(readOnly = false)
+	public void delProcessList(String procInsId) {
+		constructionMapper.delProcessList(procInsId);
+	}
 }

+ 47 - 8
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/web/ConstructionController.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.sg.managementcenter.activiti.web;
 
 import java.io.*;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.util.*;
 
 import com.jeeplus.common.config.Global;
@@ -23,6 +24,7 @@ import com.jeeplus.modules.sg.managementcenter.activiti.service.UploadImagesServ
 import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
 import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyImportUtils;
 import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfoBean;
 import com.jeeplus.modules.sg.managementcenter.materialinfo.service.MaterialInfoService;
 import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
 import com.jeeplus.modules.sg.managementcenter.materialproject.service.MaterialProjectService;
@@ -166,6 +168,43 @@ public class ConstructionController extends BaseController {
     }
 
     /**
+     * 导出施工交底进度
+     */
+    @ResponseBody
+    @RequestMapping(value = "exportDisclose")
+    public AjaxJson exportDisclose(Construction construction, HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
+        AjaxJson j = new AjaxJson();
+
+        String reserveProjectName =  URLDecoder.decode(construction.getReserveProjectName(),"UTF-8");
+        construction.setProjectId(URLDecoder.decode(construction.getProjectId(),"UTF-8"));
+        construction.setProjectName(URLDecoder.decode(construction.getProjectName(),"UTF-8"));
+        List<String> reserveList = new ArrayList<>();
+        if (null != reserveProjectName && !"".equals(reserveProjectName)) {
+            String[] split = reserveProjectName.split("\\s+");
+            String reserveName = "";
+            for (int i = 0; i < split.length; i++) {
+                reserveName = split[i];
+                reserveList.add(reserveName);
+            }
+            construction.setReserveList(reserveList);
+        }
+        Page<Construction> page = constructionService.findDisclosePage(new Page<Construction>(request, response,-1), construction);
+
+        try {
+            String fileName = "施工交底进度"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            new ExportExcel("施工交底进度", Construction.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;
+
+    }
+
+    /**
      * 人工审核页面
      */
     @RequestMapping(value = "artificial")
@@ -503,27 +542,27 @@ public class ConstructionController extends BaseController {
         Integer ringCages = 0;
         Integer poleMounted = 0;
         for (MaterialInfo m : list) {
-            String materialName = m.getMaterialName();
+            String materialName = m.getExtendDescription();
             if (materialName != null && materialName != "") {
-                if (materialName.equals("FTU,三遥数量")) {
+                if (materialName.contains("FTU,三遥")) {
                     ftuThree += 1;
                 }
-                if (materialName.equals("FTU,二遥数量")) {
+                if (materialName.contains("FTU,二遥")) {
                     ftuTwo += 1;
                 }
-                if (materialName.equals("DTU,三遥,遮蔽立式数量")) {
+                if (materialName.contains("DTU,三遥,遮蔽立式")) {
                     dtuVertical += 1;
                 }
-                if (materialName.equals("DTU,三遥,户外立式数量")) {
+                if (materialName.contains("DTU,三遥,户外立式")) {
                     dtuOutdoor += 1;
                 }
-                if (materialName.equals("DTU,三遥,组屏式数量")) {
+                if (materialName.contains("DTU,三遥,组屏式")) {
                     dtuGroup += 1;
                 }
-                if (materialName.equals("一二次融合成套环网箱(2进2出)数量")) {
+                if (materialName.contains("一二次融合成套环网箱(2进2出)")) {
                     ringCages += 1;
                 }
-                if (materialName.equals("一二次融合成套柱上负荷开关(户外)数量")) {
+                if (materialName.contains("一二次融合成套柱上负荷开关(户外)")) {
                     poleMounted += 1;
                 }
                 construction.setFtuThree(ftuThree.toString());

+ 3 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/entity/MaterialInventory.java

@@ -6,6 +6,9 @@ package com.jeeplus.modules.sg.managementcenter.materialInventory.entity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
+/**
+ * 库存物料对象
+ */
 public class MaterialInventory extends DataEntity<MaterialInventory> {
 	private static final long serialVersionUID = 1L;
 	private String materialCode;   //物料编码

+ 3 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/entity/MaterialRequisition.java

@@ -1,5 +1,8 @@
 package com.jeeplus.modules.sg.managementcenter.materialInventory.entity;
 
+/**
+ * 领料单表对象
+ */
 public class MaterialRequisition {
     private String materialCode;//物料编码
     private Double requireCount;//需求数量

+ 2 - 2
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/mapper/MaterialInventoryMapper.java

@@ -15,9 +15,9 @@ import java.util.List;
 
 @MyBatisMapper
 public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory> {
-    public Integer insertList(@Param("list") List<MaterialInventory> list);
+    Integer insertList(@Param("list") List<MaterialInventory> list);
 
     List<MaterialInventory> findByList(@Param("list") List<MaterialRequisition> list);
 
-    List<MaterialInventory> findListInventory(@Param("list") List<PickingRequisition> list);
+//    List<MaterialInventory> findListInventory(@Param("list") List<PickingRequisition> list);
 }

+ 13 - 13
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/mapper/xml/MaterialInventoryMapper.xml

@@ -183,17 +183,17 @@
 		</where>
 	</select>
 
-	<select id="findListInventory" parameterType="java.util.List" resultType="com.jeeplus.modules.sg.managementcenter.materialInventory.entity.MaterialInventory">
-		select
-		<include refid="materialColumns"/>
-		FROM xm_material_inventory a
-		WHERE a.del_flag = '0'
-		and a.materialCode in
-		<if test="list != null">
-			<foreach collection="list" index="index" item="item" open="("
-					 separator="," close=")">
-				#{item.materialCode}
-			</foreach>
-		</if>
-	</select>
+	<!--<select id="findListInventory" parameterType="java.util.List" resultType="com.jeeplus.modules.sg.managementcenter.materialInventory.entity.MaterialInventory">-->
+		<!--select-->
+		<!--<include refid="materialColumns"/>-->
+		<!--FROM xm_material_inventory a-->
+		<!--WHERE a.del_flag = '0'-->
+		<!--and a.materialCode in-->
+		<!--<if test="list != null">-->
+			<!--<foreach collection="list" index="index" item="item" open="("-->
+					 <!--separator="," close=")">-->
+				<!--#{item.materialCode}-->
+			<!--</foreach>-->
+		<!--</if>-->
+	<!--</select>-->
 </mapper>

+ 9 - 4
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/service/MaterialInventoryService.java

@@ -51,12 +51,17 @@ public class MaterialInventoryService extends CrudService<MaterialInventoryMappe
 		materialInventoryMapper.insertList(list);
 	}
 
+	/**
+	 * 根据领料单数据对象列表获取对应库存对象列表
+	 * @param list
+	 * @return
+	 */
 	public List<MaterialInventory> findByList(List<MaterialRequisition> list){
 		return materialInventoryMapper.findByList(list);
 	}
 
-	//根据物料编码查找库存信息
-	public List<MaterialInventory> findByListPicking(List<PickingRequisition> list){
-		return materialInventoryMapper.findListInventory(list);
-	}
+//	//根据物料编码查找库存信息
+//	public List<MaterialInventory> findByListPicking(List<PickingRequisition> list){
+//		return materialInventoryMapper.findListInventory(list);
+//	}
 }

+ 72 - 82
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/util/ImportPro.java

@@ -1,20 +1,19 @@
 package com.jeeplus.modules.sg.managementcenter.materialInventory.util;
+import com.jeeplus.modules.sg.financial.erpcredit.util.DoubleUtil;
 import com.jeeplus.modules.sg.managementcenter.materialInventory.entity.MaterialInventory;
 import com.jeeplus.modules.sg.managementcenter.materialInventory.entity.MaterialRequisition;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Row;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 public class ImportPro {
     /**
-     * 获取库存表格数据
+     * 获取库存物料数据
      * @param importUtil
      * @return List<ErpAccount> 导入表格数据
      */
-    public static List<MaterialInventory> getMaterialInventoryUtil(ImportUtil importUtil)  {
+    public static List<MaterialInventory> getInventoryData(ImportUtil importUtil)  {
         int lastRow = importUtil.getLastDataRowNum();
         List<MaterialInventory> list = new ArrayList<MaterialInventory>();
         MaterialInventory materialInventory = null;
@@ -28,6 +27,7 @@ public class ImportPro {
                 materialInventory.setMaterialDetail((String)importUtil.getCellValue(row,4));//物料描述
                 materialInventory.setStockQuantity(new Double((String)importUtil.getCellValue(row,6)));//非限制库存数量
                 materialInventory.setFrozenQuantity(new Double((String)importUtil.getCellValue(row,8)));//已冻结库存数量
+                materialInventory.setAvailableStockQuantity(new Double((String)importUtil.getCellValue(row,6)));//可用库存,初始化使用非限制库存
                 list.add(materialInventory);
             }
         }
@@ -39,12 +39,13 @@ public class ImportPro {
      * @param importUtil
      * @return List<ErpAccount> 导入表格数据
      */
-    public static List<MaterialRequisition> getMaterialRequisitionUtil(ImportUtil importUtil)  {
+    public static List<MaterialRequisition> getRequisitionData(ImportUtil importUtil)  {
         int lastRow = importUtil.getLastDataRowNum();
         List<MaterialRequisition> list = new ArrayList<MaterialRequisition>();
         MaterialRequisition materialRequisition = null;
         String materialCode="";//物料编码
-        for(int i=1; i<lastRow;i++){
+//        for(int i=1; i<lastRow;i++){
+        for(int i=4; i<lastRow;i++){
             materialRequisition = new MaterialRequisition();
             Row row = importUtil.getRow(i);
             materialCode = (String)importUtil.getCellValue(row,12);
@@ -59,95 +60,79 @@ public class ImportPro {
         }
         return list;
     }
-    /*
-        得到可使用库存数量
+
+    /**
+     * 将领料对象与库存对象合并,同时计算得到可用库存数量。这一步操作会丢弃无基础库存数据的领料数据
+     * @param list
+     * @param map
+     * @return
      */
-    public static List<MaterialInventory> getMaterial(List<MaterialInventory> materialInventories,List<MaterialRequisition> materialRequisitions){
-        Double availableStockQuantity = 0.0;
-        Double requireCount =0.0;
-        Double outCount = 0.0;
-        for (MaterialInventory materialInventory:materialInventories){
-            for (MaterialRequisition materialRequisition:materialRequisitions){
-                if (materialInventory.getMaterialCode().equals(materialRequisition.getMaterialCode())){
-                    availableStockQuantity = materialRequisition.getRequireCount()-materialRequisition.getOutCount();
-                    requireCount = materialRequisition.getRequireCount();
-                    outCount = materialRequisition.getOutCount();
-                    break;
+    public static List<MaterialInventory> getMaterial(List<MaterialInventory> list,Map<String,MaterialRequisition> map){
+        if(list!=null&&map!=null){
+            for(MaterialInventory inventory:list){
+                MaterialRequisition requisition = map.get(inventory.getMaterialCode());
+                if(requisition!=null){
+                    inventory.setRequireCount(requisition.getRequireCount());
+                    inventory.setOutCount(requisition.getOutCount());
+                    inventory.setAvailableStockQuantity(DoubleUtil.add(inventory.getStockQuantity(),-requisition.getRequireCount(),
+                            requisition.getOutCount()));//可用库存=非限制库存-(需求数量-出库数量)
                 }
             }
-            materialInventory.setRequireCount(requireCount);
-            materialInventory.setOutCount(outCount);
-            availableStockQuantity = materialInventory.getStockQuantity() - availableStockQuantity;
-            materialInventory.setAvailableStockQuantity(availableStockQuantity);
         }
-        return materialInventories;
+        return list;
     }
 
-    /*
-     * 去重库存表
+    /**
+     * 库存物料相同物料编码汇总
+     * @param materialInventories
+     * @return
      */
-    public static List<MaterialInventory> getSetMaterialInvenntory(List<MaterialInventory> materialInventories){
-        List<MaterialInventory> materialInventoryList = new ArrayList<MaterialInventory>();
-        boolean flag = true;
-        MaterialInventory material = null;
-        double count = 0.0;
-        for (MaterialInventory materialInventory:materialInventories){
-            flag = true;
-            for (MaterialInventory materialInventory1:materialInventoryList){
-                if (materialInventory1.getMaterialCode().equals(materialInventory.getMaterialCode())){
-                    count = materialInventory.getStockQuantity()+materialInventory1.getStockQuantity();
-                    materialInventory1.setStockQuantity(count);//非限制库存数量
-                    count = materialInventory.getFrozenQuantity()+materialInventory1.getFrozenQuantity();
-                    materialInventory1.setFrozenQuantity(count);//已冻结库存数量
-                    flag = false;
-                    break;
+    public static List<MaterialInventory> getInventorySet(List<MaterialInventory> materialInventories){
+        Map<String,MaterialInventory> map = new HashMap<>();
+        if(materialInventories!=null && materialInventories.size()>0){
+            for(MaterialInventory material:materialInventories){
+                String code = material.getMaterialCode();
+                MaterialInventory mapMaterial = map.get(code);
+                if(mapMaterial == null){
+                    map.put(code,material);
+                }else{
+                    mapMaterial.setStockQuantity(DoubleUtil.add(mapMaterial.getStockQuantity(),material.getStockQuantity()));//非限制库存数量
+                    mapMaterial.setFrozenQuantity(DoubleUtil.add(mapMaterial.getFrozenQuantity(),material.getFrozenQuantity()));//已冻结库存数量
+                    mapMaterial.setAvailableStockQuantity(DoubleUtil.add(mapMaterial.getAvailableStockQuantity(),material.getAvailableStockQuantity()));//可用库存数量
                 }
             }
-            if (flag){
-                material = new MaterialInventory();
-                material.setMaterialCode(materialInventory.getMaterialCode());//物料编码
-                material.setMaterialDetail(materialInventory.getMaterialDetail());//物料描述
-                material.setStockQuantity(materialInventory.getStockQuantity());//非限制库存数量
-                material.setFrozenQuantity(materialInventory.getFrozenQuantity());//已冻结库存数量
-                materialInventoryList.add(material);
-            }
-        }
-        for (MaterialInventory materialInventory:materialInventoryList){
-            System.out.println(materialInventory);
         }
-        return materialInventoryList;
+        List<MaterialInventory> list = new ArrayList<>(map.values());
+        return list;
     }
 
-    /*
-     * 去重 附件5
+    /**
+     * 领料单数据 相同物料编码汇总
+     * @param requisitions
+     * @return
      */
-    public static List<MaterialRequisition> getSetMaterialRequisition(List<MaterialRequisition> requisitions){
-        List<MaterialRequisition> requisitionList = new ArrayList<MaterialRequisition>();
-        boolean flag = true;
-        MaterialRequisition requisition = null;
-        double count = 0.0;
-        for (MaterialRequisition materialRequisition:requisitions){
-            flag = true;
-            for (MaterialRequisition materialRequisition1:requisitionList){
-                if (materialRequisition.getMaterialCode().equals(materialRequisition1.getMaterialCode())){
-                    count = materialRequisition.getRequireCount()+materialRequisition1.getRequireCount();
-                    materialRequisition1.setRequireCount(count);
-                    count = materialRequisition.getOutCount()+materialRequisition1.getOutCount();
-                    materialRequisition1.setOutCount(count);
-                    flag = false;
+    public static Map<String,MaterialRequisition> getRequisitionMap(List<MaterialRequisition> requisitions){
+        Map<String,MaterialRequisition> map = new HashMap<>();
+        if(requisitions!=null && requisitions.size()>0){
+            for(MaterialRequisition requisition:requisitions){
+                String code = requisition.getMaterialCode();
+                MaterialRequisition mapRequisition = map.get(code);
+                if(mapRequisition == null){
+                    map.put(code,requisition);
+                }else{
+                    mapRequisition.setRequireCount(DoubleUtil.add(mapRequisition.getRequireCount(),requisition.getRequireCount()));//需求数量
+                    mapRequisition.setOutCount(DoubleUtil.add(mapRequisition.getOutCount(),requisition.getOutCount()));//出库数量
                 }
             }
-            if (flag){
-                requisition = new MaterialRequisition();
-                requisition.setMaterialCode(materialRequisition.getMaterialCode());
-                requisition.setRequireCount(materialRequisition.getRequireCount());
-                requisition.setOutCount(materialRequisition.getOutCount());
-                requisitionList.add(requisition);
-            }
         }
-        return requisitionList;
+        return map;
     }
-    //验证库存表
+
+    /**
+     * 验证导入的物料库存表
+     * @param importUtil
+     * @return
+     */
     public static boolean getJudgeInventory(ImportUtil importUtil){
         boolean flag = false;
         Row row = importUtil.getRow(0);
@@ -158,12 +143,17 @@ public class ImportPro {
         }
         return false;
     }
-    //验证库存表
+
+    /**
+     * 验证导入的领料表
+     * @param importUtil
+     * @return
+     */
     public static boolean getJudgeRequisition(ImportUtil importUtil){
         boolean flag = false;
         Row row = importUtil.getRow(3);
-        String requireCount = (String) importUtil.getCellValue(row,15);//物理编码
-        String outCount = (String) importUtil.getCellValue(row,16);//物料描述
+        String requireCount = (String) importUtil.getCellValue(row,15);//需求数量
+        String outCount = (String) importUtil.getCellValue(row,16);//已出库
         if (!requireCount.contains("需求")||!outCount.contains("出库")){
             return true;
         }

+ 26 - 26
src/main/java/com/jeeplus/modules/sg/managementcenter/materialInventory/web/MaterialInventoryController.java

@@ -33,23 +33,26 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * 库存物料管理
+ */
 @Controller
 @RequestMapping(value = "${adminPath}/sg/managementcenter/materialInventory")
 public class MaterialInventoryController extends BaseController {
-
 	@Autowired
 	private MaterialInventoryService materialInventoryService;
 	@Autowired
 	private PickingRequisitionService pickingRequisitionService;
-	@Autowired
-	private OaNotifyMaterialService oaNotifyMaterialService;
-	@Autowired
-	private ProjectService projectService;
-	@Autowired
-	private OaNotifyService oaNotifyService;
+//	@Autowired
+//	private OaNotifyMaterialService oaNotifyMaterialService;
+//	@Autowired
+//	private ProjectService projectService;
+//	@Autowired
+//	private OaNotifyService oaNotifyService;
 	
 	@ModelAttribute
 	public MaterialInventory get(@RequestParam(required=false) String id) {
@@ -64,7 +67,7 @@ public class MaterialInventoryController extends BaseController {
 	}
 	
 	/**
-	 * 列表页面
+	 * 库存物料管理页面
 	 */
 	@RequiresPermissions("managementcenter:materialInventory:list")
 	@RequestMapping(value = {"list", ""})
@@ -73,8 +76,8 @@ public class MaterialInventoryController extends BaseController {
 		return "modules/sg/managementcenter/materialInventory/materialInventory";
 	}
 
-		/**
-	 * 列表数据
+	/**
+	 * 库存物料列表数据
 	 */
 	@ResponseBody
 	@RequiresPermissions("managementcenter:materialInventory:list")
@@ -170,17 +173,15 @@ public class MaterialInventoryController extends BaseController {
     }
 
 	/**
-	 * 导入Excel数据
-        导入库存表
+	 * 导入库存物料数据(即附件4)
 	 */
 	@ResponseBody
 	@RequiresPermissions("managementcenter:materialInventory:import")
-    @RequestMapping(value = "import")
+    @RequestMapping(value = "importInventory")
    	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request){
 		AjaxJson j = new AjaxJson();
 		try {
 			StringBuilder failureMsg = new StringBuilder();
-//			new ImportUtil(file,failureMsg,1,0);
 			ImportUtil importUtil = new ImportUtil(file,1,0);
 			boolean judgeInventory = ImportPro.getJudgeInventory(importUtil);
 			if (judgeInventory){
@@ -188,10 +189,10 @@ public class MaterialInventoryController extends BaseController {
 				j.setMsg("导入失败:表格不符合规范!");
 				return j;
 			}
-			List<MaterialInventory> materialInventoryUtil = ImportPro.getMaterialInventoryUtil(importUtil);
-			List<MaterialInventory> materialInventories = ImportPro.getSetMaterialInvenntory(materialInventoryUtil);//去重
-			materialInventoryService.saveList(materialInventories);
-			j.setMsg( "已成功导入"+materialInventories.size()+"条,"+"库存记录"+failureMsg);
+			List<MaterialInventory> inventoryData = ImportPro.getInventoryData(importUtil);
+			List<MaterialInventory> list = ImportPro.getInventorySet(inventoryData);//相同物料编码数据汇总
+			materialInventoryService.saveList(list);
+			j.setMsg( "已成功导入"+list.size()+"条,"+"库存记录"+failureMsg);
 		} catch (Exception e) {
 			j.setSuccess(false);
 			j.setMsg("导入库存失败!失败信息:"+e.getMessage());
@@ -199,12 +200,11 @@ public class MaterialInventoryController extends BaseController {
 		return j;
     }
     /**
-     * 导入Excel数据
-		导入附件五2
+     * 导入领料单数据(即附件5)
      */
     @ResponseBody
     @RequiresPermissions("managementcenter:materialInventory:import")
-    @RequestMapping(value = "import1")
+    @RequestMapping(value = "importRequisition")
     public AjaxJson importFile1(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request){
         AjaxJson j = new AjaxJson();
 		String str = "";//提示
@@ -217,15 +217,15 @@ public class MaterialInventoryController extends BaseController {
 				j.setMsg("导入失败:表格不符合规范!");
 				return j;
 			}
-			List<MaterialRequisition> materialRequisitionUtil = ImportPro.getMaterialRequisitionUtil(importUtil);//得到数据表格
-			List<MaterialRequisition> materialRequisitionList = ImportPro.getSetMaterialRequisition(materialRequisitionUtil);//去重
-			List<MaterialInventory> byList = materialInventoryService.findByList(materialRequisitionList);//得到数据库中匹配的物料编码
-			if (null==byList||byList.size()<=0){
+			List<MaterialRequisition> requisitionData = ImportPro.getRequisitionData(importUtil);//得到领料单原始数据
+			Map<String,MaterialRequisition> map = ImportPro.getRequisitionMap(requisitionData);//领料单数据汇总map,key为物料编码
+			List<MaterialInventory> inventoryList = materialInventoryService.findByList(new ArrayList<>(map.values()));//得到数据库中匹配的物料编码
+			if (null==inventoryList||inventoryList.size()<=0){
 				j.setSuccess(false);
 				j.setMsg("导入领料单失败!失败信息:无基础数据");
 				return j;
 			}
-			List<MaterialInventory> materialInventories = ImportPro.getMaterial(byList, materialRequisitionList);//得到可使用库存数量
+			List<MaterialInventory> materialInventories = ImportPro.getMaterial(inventoryList, map);//得到可使用库存数量
 			materialInventoryService.saveList(materialInventories);
 
 			//发送通知-------------

+ 7 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/project/mapper/xml/ProjectMapper.xml

@@ -257,7 +257,12 @@
                 and a.settStatus = #{settStatus}
             </if>
             <if test="earlyMaterial!=null and earlyMaterial !=''">
-                and a.earlyMaterial = #{earlyMaterial}
+                <if test="earlyMaterial == 0">
+                    and a.eaArlyMaterial = #{earlyMaterial}
+                </if>
+                <if test="earlyMaterial == 1">
+                    or a.earlyMaterial = #{earlyMaterial}
+                </if>
             </if>
             <if test="preConstruction!=null and preConstruction !=''">
                 and a.preConstruction = #{preConstruction}
@@ -1859,6 +1864,7 @@
         a.projectId,
         a.projectName,
         a.acquisitionStatus,
+        a.constructionStatus,
         a.canEnter,
         xpq.blackoutLine as `quantity.blackoutLine`,
         <include refid="assignmentColumns"/>

+ 64 - 58
src/main/java/com/jeeplus/modules/sg/managementcenter/project/util/ExportUtil.java

@@ -84,27 +84,29 @@ public class ExportUtil {
                 BasicInformation export = project.getBasicInformation();
 
                 cell0.setCellValue(String.valueOf(index++));
-                cell1.setCellValue(export.getReserveProjectName());
+                cell1.setCellValue(project.getReserveProjectName());
                 cell2.setCellValue(project.getProjectName());
                 cell3.setCellValue(project.getProjectId());
-                cell4.setCellValue(export.getMunicipalCompany());
-                cell5.setCellValue(export.getCountyCompany());
-                cell6.setCellValue(export.getProjectNature());
-                cell7.setCellValue(export.getDemandUnit());
-                cell8.setCellValue(export.getOperationUnit());
-                cell9.setCellValue(export.getPowerSupplyArea());
-                cell10.setCellValue(export.getGridNumber());
-                cell11.setCellValue(export.getCellNumber());
-                cell12.setCellValue(export.getProjectReserveNo());
-                cell13.setCellValue(export.getGridProjectNo());
-                cell14.setCellValue(export.getErpNo());
-                cell15.setCellValue(export.getNecessityContent());
-                cell16.setCellValue(export.getSubStationName());
-                cell17.setCellValue(export.getLineName());
-                cell18.setCellValue(export.getProjectType());
-                cell19.setCellValue(export.getWhetherSummer());
-                cell20.setCellValue(export.getBasicDescription());
-                cell21.setCellValue(export.getWorkAreaRemarks());
+                if(export!=null){
+                    cell4.setCellValue(export.getMunicipalCompany());
+                    cell5.setCellValue(export.getCountyCompany());
+                    cell6.setCellValue(export.getProjectNature());
+                    cell7.setCellValue(export.getDemandUnit());
+                    cell8.setCellValue(export.getOperationUnit());
+                    cell9.setCellValue(export.getPowerSupplyArea());
+                    cell10.setCellValue(export.getGridNumber());
+                    cell11.setCellValue(export.getCellNumber());
+                    cell12.setCellValue(export.getProjectReserveNo());
+                    cell13.setCellValue(export.getGridProjectNo());
+                    cell14.setCellValue(export.getErpNo());
+                    cell15.setCellValue(export.getNecessityContent());
+                    cell16.setCellValue(export.getSubStationName());
+                    cell17.setCellValue(export.getLineName());
+                    cell18.setCellValue(export.getProjectType());
+                    cell19.setCellValue(export.getWhetherSummer());
+                    cell20.setCellValue(export.getBasicDescription());
+                    cell21.setCellValue(export.getWorkAreaRemarks());
+                }
             }
 
             String str = URLEncoder.encode("项目前期基本信息.xlsx", "UTF8");
@@ -163,33 +165,35 @@ public class ExportUtil {
                 Project project = list.get(i);
                 Assignment ass = project.getAssignment();
 
-                cell0.setCellValue(ass.getReserveProjectName());
-                cell1.setCellValue(ass.getDisclosureType());
-                cell2.setCellValue(ass.getProjectReleaseBatch());
-                cell3.setCellValue(ass.getDeliveryDate());
-                cell4.setCellValue(ass.getPackageNo());
-                cell5.setCellValue(ass.getRate());
-                cell6.setCellValue(ass.getAssignedUnit());
-                cell7.setCellValue(ass.getConstructionUnit());
-                cell8.setCellValue(ass.getConstructionSubcontractor());
-                cell9.setCellValue(ass.getBehalf());
-                cell10.setCellValue(ass.getConstructionFullTime());
-                cell11.setCellValue(ass.getConstructionTechnical());
-                cell12.setCellValue(ass.getConstructionManage());
-                cell13.setCellValue(ass.getConstructionLeader());
-                cell14.setCellValue(ass.getSubcontractingContact());
-                cell15.setCellValue(ass.getDesigner());
-                cell16.setCellValue(ass.getDesignLeader());
-                cell17.setCellValue(ass.getOwnerManager());
-                cell18.setCellValue(ass.getDistribution());
-                cell19.setCellValue(ass.getDistributionFullTime());
-                cell20.setCellValue(ass.getDistributionSystem());
-                cell21.setCellValue(ass.getDistributionPolicy());
-                cell22.setCellValue(ass.getCenterLeader());
-                cell23.setCellValue(ass.getCenterTechnical());
-                cell24.setCellValue(ass.getInstituteRole());
-                cell25.setCellValue(ass.getRepUnit());
-                cell26.setCellValue(ass.getInspectionUnit());
+                cell0.setCellValue(project.getReserveProjectName());
+                if(ass!=null){
+                    cell1.setCellValue(ass.getDisclosureType());
+                    cell2.setCellValue(ass.getProjectReleaseBatch());
+                    cell3.setCellValue(ass.getDeliveryDate());
+                    cell4.setCellValue(ass.getPackageNo());
+                    cell5.setCellValue(ass.getRate());
+                    cell6.setCellValue(ass.getAssignedUnit());
+                    cell7.setCellValue(ass.getConstructionUnit());
+                    cell8.setCellValue(ass.getConstructionSubcontractor());
+                    cell9.setCellValue(ass.getBehalf());
+                    cell10.setCellValue(ass.getConstructionFullTime());
+                    cell11.setCellValue(ass.getConstructionTechnical());
+                    cell12.setCellValue(ass.getConstructionManage());
+                    cell13.setCellValue(ass.getConstructionLeader());
+                    cell14.setCellValue(ass.getSubcontractingContact());
+                    cell15.setCellValue(ass.getDesigner());
+                    cell16.setCellValue(ass.getDesignLeader());
+                    cell17.setCellValue(ass.getOwnerManager());
+                    cell18.setCellValue(ass.getDistribution());
+                    cell19.setCellValue(ass.getDistributionFullTime());
+                    cell20.setCellValue(ass.getDistributionSystem());
+                    cell21.setCellValue(ass.getDistributionPolicy());
+                    cell22.setCellValue(ass.getCenterLeader());
+                    cell23.setCellValue(ass.getCenterTechnical());
+                    cell24.setCellValue(ass.getInstituteRole());
+                    cell25.setCellValue(ass.getRepUnit());
+                    cell26.setCellValue(ass.getInspectionUnit());
+                }
             }
 
             String str = URLEncoder.encode("施工任务分配信息.xlsx", "UTF8");
@@ -235,18 +239,20 @@ public class ExportUtil {
                 DisclosurePlan plan = project.getDisclosurePlan();
 
                 cell0.setCellValue(project.getReserveProjectName());
-                cell1.setCellValue(plan.getDisclosureType());
-                cell2.setCellValue(plan.getProjectType());
-                cell3.setCellValue(plan.getDisclosureMethod());
-                cell4.setCellValue(plan.getOperationUnit());
-                cell5.setCellValue(plan.getConstructionUnit());
-                cell6.setCellValue(plan.getPowerSupplyStation());
-                cell7.setCellValue(plan.getConstructionManage());
-                cell8.setCellValue(plan.getMaintenance());
-                cell9.setCellValue(plan.getAutomationContacts());
-                cell10.setCellValue(plan.getLiveSurveyContact());
-                cell11.setCellValue(plan.getInspector());
-                cell12.setCellValue(plan.getDisclosurePlanDate());
+                if(plan!=null){
+                    cell1.setCellValue(plan.getDisclosureType());
+                    cell2.setCellValue(plan.getProjectType());
+                    cell3.setCellValue(plan.getDisclosureMethod());
+                    cell4.setCellValue(plan.getOperationUnit());
+                    cell5.setCellValue(plan.getConstructionUnit());
+                    cell6.setCellValue(plan.getPowerSupplyStation());
+                    cell7.setCellValue(plan.getConstructionManage());
+                    cell8.setCellValue(plan.getMaintenance());
+                    cell9.setCellValue(plan.getAutomationContacts());
+                    cell10.setCellValue(plan.getLiveSurveyContact());
+                    cell11.setCellValue(plan.getInspector());
+                    cell12.setCellValue(plan.getDisclosurePlanDate());
+                }
             }
 
             String str = URLEncoder.encode("交底计划安排.xlsx", "UTF8");

+ 6 - 2
src/main/java/com/jeeplus/modules/sg/managementcenter/project/web/ProjectController.java

@@ -1142,8 +1142,9 @@ public class ProjectController extends BaseController {
         return getBootstrapData(page);
     }
 
+
     /**
-     * 领料模块项目选择框
+     * 领料模块项目选择框(修改)2020-09-22
      */
     @ResponseBody
     @RequestMapping(value = "dataPicking")
@@ -1152,6 +1153,9 @@ public class ProjectController extends BaseController {
 		project1.setWhetherCloseStatus("0");
 		project1.setEarlyMaterial(1);
 		project1.setConstructionUnitManage(UserUtils.getUser().getLoginName());*/
+        project.setStatus("2");
+        project.setWhetherCloseStatus("0");
+        project.setEarlyMaterial("1");
         BasicInformation basicInformation = new BasicInformation();
         project.setBasicInformation(basicInformation);
         Page<Project> page = projectService.findPage(new Page<Project>(request, response), project);
@@ -1159,7 +1163,7 @@ public class ProjectController extends BaseController {
     }
 
     /**
-     * 土建流程项目选择
+     * 土建流程项目选择(修改2020-09-23)
      */
     @ResponseBody
     @RequestMapping(value = "materialDataPicking")

+ 21 - 13
src/main/java/com/jeeplus/modules/sg/picking/activiti/web/PickIngController.java

@@ -269,6 +269,7 @@ public class PickIngController extends BaseController {
     }
 
     //    manager
+    /**修改2020-09-23*/
     @ResponseBody
     @RequestMapping(value = "constructionData")
     public Map<String, Object> constructionData(ShowList showList, String procInsId, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -327,22 +328,25 @@ public class PickIngController extends BaseController {
         return getBootstrapData(page);
     }
 
+    /**
+     * 修改2020-09-23
+     * */
     @ResponseBody
     @RequestMapping(value = "inventoryComparisonData")
     public Map<String, Object> inventoryComparisonData(ShowList showList, HttpServletRequest request, HttpServletResponse response, Model model) {
-
         //先查出所有在物资专职的节点的信息
         List<String> activity = MyActiviUtils.findMdActivity("领料:配网物资专职审核领料单");
-        if (activity.size() >= 0) {
+/*        if (activity.size() >= 0) {
             activity.add("错误提示");
             Page<ShowList> page = showListService.inventoryComparisonData(new Page<ShowList>(request, response), showList, activity);
             return getBootstrapData(page);
-        }
+        }*/
         Page<ShowList> page = showListService.inventoryComparisonData(new Page<ShowList>(request, response), showList, activity);
         List<ShowList> list = page.getList();
         //相同的物料信息相加
         HashMap<String, ShowList> tempMap = new HashMap<String, ShowList>();
         for (ShowList show : list) {
+
             String materialCode = show.getMaterialCode() + "|" + show.getExtensionDescription() + "|" + show.getExtensionDescription();
             if (tempMap.containsKey(materialCode)) {
                 ShowList needShow = new ShowList();
@@ -368,6 +372,9 @@ public class PickIngController extends BaseController {
                     show.setAvailableStockQuantity(ava.getAvailableStockQuantity());
                 }
             }
+            if (null == show.getAvailableStockQuantity()) {
+                show.setAvailableStockQuantity(0.0);
+            }
         }
         page.setList(newShowList);
         return getBootstrapData(page);
@@ -483,10 +490,13 @@ public class PickIngController extends BaseController {
         }
         if (flag) {
             vars.put("full", true);
-//            Project project1 = projectService.get(pickApplication.getProjectId());
-//            vars.put("manager", UserUtils.getByUserName(project1.getProjectManageRole()).getLoginName());
+            Project project = new Project();
+            project.setId(pickApplication.getProjectId());
+            Project ass = projectService.getAss(project);
+            vars.put("manager", ass.getAssignment().getOwnerManager());
             j.setMsg("发起流程审批成功!");
         } else {
+            //更改项目提前领料标识
             showListService.projectUpdate(pickApplication);
             vars.put("noFull", true);
             j.setMsg("项目可发起领料流程!");
@@ -681,7 +691,7 @@ public class PickIngController extends BaseController {
     }
 
     /**
-     * 成本
+     * 成本(修改)2020-09-22
      */
     @ResponseBody
     @RequestMapping(value = "exportErpData")
@@ -770,10 +780,9 @@ public class PickIngController extends BaseController {
                         pickIngService.updateProjectEnter(updateProjectList);
                         for (String name :
                                 updateProjectList) {
-                            //查询出所有更改项目状态的信息,判断是否完成土建流程,发送施工流程
+                            //判断项目是否发送过电气流程
                             Project byName = projectService.findByName(name);
-                            if ("2".equals(byName.getAcquisitionStatus())) {
-                                //判断是否包含土建
+                            if ("0".equals(byName.getConstructionStatus())) {
                                 boolean electric = false;
                                 //判单钢管杠,水泥杠,存在电气,判断是否包含
                                 List<MaterialInfo> allInfo = projectService.findAllInfo(byName.getId());
@@ -825,7 +834,7 @@ public class PickIngController extends BaseController {
                                     materialModuleService.updateConstructionStatus("1", blockAss.getReserveProjectName());
                                     String procDefId = projectService.findDefId("sgys");
                                     // 启动流程
-                                    ProcessDefinition p = actProcessService.getProcessDefinition(materialModule.getAct().getProcDefId());
+                                    ProcessDefinition p = actProcessService.getProcessDefinition(procDefId);
                                     String title = materialModule.getCurrentUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
                                     actTaskService.startProcess(p.getKey(), "sg_construction_process", materialModule.getId(), title, vars);
                                 }
@@ -852,7 +861,7 @@ public class PickIngController extends BaseController {
     }
 
     /**
-     * 资本
+     * 资本(修改)2020-09-22
      */
     @ResponseBody
     @RequestMapping(value = "exportZb")
@@ -945,9 +954,8 @@ public class PickIngController extends BaseController {
                                 updateProjectList) {
                             //查询出所有更改项目状态的信息,判断是否完成土建流程,发送施工流程
                             Project byName = projectService.findByName(name);
-                            if ("2".equals(byName.getAcquisitionStatus())) {
+                            if ("0".equals(byName.getConstructionStatus())) {
                                 //判断是否包含电气
-
                                 boolean electric = false;
                                 //判单钢管杠,水泥杠,存在电气,判断是否包含
                                 List<MaterialInfo> allInfo = projectService.findAllInfo(byName.getId());

+ 6 - 0
src/main/java/com/jeeplus/modules/sg/scheduleView/mapper/xml/ScheduleViewMapper.xml

@@ -157,6 +157,12 @@
                 </foreach>
                 )
             </if>
+            <if test="reserveProjectName!=null and reserveProjectName!=''">
+                and a.reserveProjectName like concat('%',#{reserveProjectName}, '%')
+            </if>
+            <if test="projectName!=null and projectName!=''">
+                and a.projectName like concat('%', #{projectName}, '%')
+            </if>
             <if test="dataScope != null and dataScope != ''">
                 ${dataScope}
             </if>

+ 10 - 0
src/main/java/com/jeeplus/modules/sg/scheduleView/service/ScheduleViewService.java

@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.List;
+
 /**
  * 查询模块Service
  * @author
@@ -40,6 +42,10 @@ public class ScheduleViewService extends CrudService<ScheduleViewMapper, Schedul
 		return page;
 	}
 
+	public List<ScheduleView> disAll(ScheduleView view){
+		return scheduleViewMapper.disAll(view);
+	}
+
 	public Page<ScheduleView> recAll(Page<ScheduleView> page, ScheduleView scheduleView) {
 		dataRuleFilter(scheduleView);
 		scheduleView.setPage(page);
@@ -47,6 +53,10 @@ public class ScheduleViewService extends CrudService<ScheduleViewMapper, Schedul
 		return page;
 	}
 
+	public List<ScheduleView> recAll(ScheduleView view){
+		return scheduleViewMapper.recAll(view);
+	}
+
 	public Page<ScheduleView> settAll(Page<ScheduleView> page, ScheduleView scheduleView) {
 		dataRuleFilter(scheduleView);
 		scheduleView.setPage(page);

+ 181 - 0
src/main/java/com/jeeplus/modules/sg/scheduleView/util/ExportUtil.java

@@ -0,0 +1,181 @@
+package com.jeeplus.modules.sg.scheduleView.util;
+
+import com.jeeplus.modules.sg.managementcenter.project.entity.Assignment;
+import com.jeeplus.modules.sg.managementcenter.project.entity.BasicInformation;
+import com.jeeplus.modules.sg.managementcenter.project.entity.DisclosurePlan;
+import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
+import com.jeeplus.modules.sg.scheduleView.entity.DisView;
+import com.jeeplus.modules.sg.scheduleView.entity.ReceiveView;
+import com.jeeplus.modules.sg.scheduleView.entity.ScheduleView;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.List;
+
+public class ExportUtil {
+
+    private  XSSFCellStyle style = null;
+
+    public static ExportUtil getOne(){
+
+        return new ExportUtil();
+    }
+
+    /**
+     * 传入excel模板名称 获取workbook对象
+     * @param fileName excel模板名称
+     * @return
+     */
+    public  XSSFWorkbook getWorkbook(String fileName){
+        InputStream inputStream = null;
+        XSSFWorkbook workbook = null;
+        try {
+            String path = this.getClass().getResource("/").getPath() + "/freemarker/excelmodel/"+fileName+".xlsx";
+            File file = new File(path);
+            inputStream = new FileInputStream(file);// 将excel文件转为输入流
+            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return workbook;
+    }
+
+
+
+    /**
+     * 导出施工交底进度信息
+     * @param response
+     * @param workbook
+     * @param list
+     */
+    public void exportDisclose(HttpServletResponse response, XSSFWorkbook workbook, List<ScheduleView> list){
+        try {
+            int rowNum = 1;
+            Sheet sheet = workbook.getSheetAt(0);
+            if(list!=null&&list.size()>0){
+                for(int i=0;i<list.size();i++){
+                    Row row = sheet.createRow(rowNum+i);
+                    Cell cell0 = crateCell(workbook,row,0); //项目定义号
+                    Cell cell1 = crateCell(workbook,row,1); //项目名称
+                    Cell cell2 = crateCell(workbook,row,2); //储备项目名称
+                    Cell cell3 = crateCell(workbook,row,3); //发起流程
+                    Cell cell4 = crateCell(workbook,row,4); //项目经理交底内容
+                    Cell cell5 = crateCell(workbook,row,5); //导入材料表和拆旧物资表
+                    Cell cell6 = crateCell(workbook,row,6); //填写部分工程量信息
+                    Cell cell7 = crateCell(workbook,row,7); //项目关闭
+                    Cell cell8 = crateCell(workbook,row,8); //设计变更
+                    Cell cell9 = crateCell(workbook,row,9); //政策处理
+                    Cell cell10 = crateCell(workbook,row,10); //完成技术交底时间
+
+                    ScheduleView view = list.get(i);
+                    DisView disclose = view.getDisView();
+
+                    cell0.setCellValue(view.getProjectId());
+                    cell1.setCellValue(view.getProjectName());
+                    cell2.setCellValue(view.getReserveProjectName());
+                    if(disclose!=null){
+                        cell3.setCellValue(disclose.getFullTimeStart());
+                        cell4.setCellValue(disclose.getProjectManagerImport());
+                        cell5.setCellValue(disclose.getUnitManagerJudge());
+                        cell6.setCellValue(disclose.getProjectManagerJudge());
+                        cell7.setCellValue(disclose.getProjectClosure());
+                        cell8.setCellValue(disclose.getDesignChange());
+                        cell9.setCellValue(disclose.getPolicyType());
+                        cell10.setCellValue(disclose.getFinTime());
+                    }
+                }
+            }
+            String str = URLEncoder.encode("施工交底进度.xlsx", "UTF8");
+            response.setHeader("Content-Disposition", "attachment;filename="+str);
+            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+            OutputStream outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+            outputStream.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 导出施工交底进度信息
+     * @param response
+     * @param workbook
+     * @param list
+     */
+    public void exportRec(HttpServletResponse response, XSSFWorkbook workbook, List<ScheduleView> list){
+        try {
+            int rowNum = 1;
+            Sheet sheet = workbook.getSheetAt(0);
+            if(list!=null&&list.size()>0){
+                for(int i=0;i<list.size();i++){
+                    Row row = sheet.createRow(rowNum+i);
+                    Cell cell0 = crateCell(workbook,row,0); //项目定义号
+                    Cell cell1 = crateCell(workbook,row,1); //项目名称
+                    Cell cell2 = crateCell(workbook,row,2); //储备项目名称
+                    Cell cell3 = crateCell(workbook,row,3); //项目第几次领料
+                    Cell cell4 = crateCell(workbook,row,4); //项目经理开领料单
+                    Cell cell5 = crateCell(workbook,row,5); //经理填写项目模块
+                    Cell cell6 = crateCell(workbook,row,6); //施工单位领导审核
+                    Cell cell7 = crateCell(workbook,row,7); //施工单位物资专职审核
+                    Cell cell8 = crateCell(workbook,row,8); //配网项目经理审核领料单
+                    Cell cell9 = crateCell(workbook,row,9); //配网物资专职审核领料单
+                    Cell cell10 = crateCell(workbook,row,10); //完成时间
+
+                    ScheduleView view = list.get(i);
+                    ReceiveView receive = view.getReceiveView();
+
+                    cell0.setCellValue(view.getProjectId());
+                    cell1.setCellValue(view.getProjectName());
+                    cell2.setCellValue(view.getReserveProjectName());
+                    if(receive!=null){
+                        cell3.setCellValue(receive.getTheNumber());
+                        cell4.setCellValue(receive.getOpenList());
+                        cell5.setCellValue(receive.getMangagerFile());
+                        cell6.setCellValue(receive.getMaLeaderReviewed());
+                        cell7.setCellValue(receive.getConUnitReviewed());
+                        cell8.setCellValue(receive.getConMangagerReviewed());
+                        cell9.setCellValue(receive.getFullReviewed());
+                        cell10.setCellValue(receive.getRecFinTime());
+                    }
+                }
+            }
+            String str = URLEncoder.encode("物资领料进度.xlsx", "UTF8");
+            response.setHeader("Content-Disposition", "attachment;filename="+str);
+            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+            OutputStream outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+            outputStream.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+
+
+    /**
+     * 创建Cell对象 同时设置style
+     * @param workbook
+     * @param row
+     * @param num
+     * @return
+     */
+    Cell crateCell(XSSFWorkbook workbook,Row row, int num){
+        Cell cell = row.createCell(num);
+        if(style == null){
+            style =workbook.createCellStyle();
+            style.setWrapText(true);
+            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+        }
+        cell.setCellStyle(style);
+        return cell;
+    }
+}

+ 286 - 0
src/main/java/com/jeeplus/modules/sg/scheduleView/util/ScheduleViewUtil.java

@@ -0,0 +1,286 @@
+package com.jeeplus.modules.sg.scheduleView.util;
+
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Disclose;
+import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
+import com.jeeplus.modules.sg.scheduleView.entity.DisView;
+import com.jeeplus.modules.sg.scheduleView.entity.ReceiveView;
+import com.jeeplus.modules.sg.scheduleView.entity.ScheduleView;
+import org.activiti.engine.history.HistoricActivityInstance;
+import org.activiti.engine.task.Task;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+/*
+处理流程进度信息工具类
+ */
+public class ScheduleViewUtil {
+
+    /**
+     * 处理进度信息中的施工交底信息
+     * @param list
+     */
+    public static void dealDiscloseList(List<ScheduleView> list){
+        if(list!=null&&list.size()>0){
+            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String fin = "";
+            boolean flag;
+            boolean designFlag;
+            boolean closeFlag;
+            boolean finalClose;
+            boolean policyStart1;
+            boolean policyStart2;
+            boolean policyStart3;
+            boolean policyEnd1;
+            boolean policyEnd2;
+            boolean policyEnd3;
+            boolean policy1;
+            boolean policy2;
+            boolean policy3;
+            for (ScheduleView s : list) {
+                String status = s.getStatus();
+
+                flag = false;
+                designFlag = false;
+                closeFlag = false;
+                finalClose = false;
+                policyStart1 = false;
+                policyStart2 = false;
+                policyStart3 = false;
+                policyEnd1 = false;
+                policyEnd2 = false;
+                policyEnd3 = false;
+                String procInsId = s.getProcInsId();
+                if (procInsId != null && !"".equals(procInsId)) {
+                    List<HistoricActivityInstance> historicActivityInstances = MyActiviUtils.hisTask(procInsId);
+                    for (HistoricActivityInstance a : historicActivityInstances) {
+                        String activityName = a.getActivityName();
+                        String format = formatter.format(a.getEndTime());
+                        if (s.getDisView() == null) {
+                            s.setDisView(new DisView());
+                        }
+                        if ("2".equals(status)) {
+                            s.getDisView().setPolicyType("政策处理完成");
+                            s.getDisView().setProjectClosure("项目关闭完成");
+                            s.getDisView().setDesignChange("设计变更完成");
+                            continue;
+                        }
+                        if ("开始".equals(activityName)) {
+                            DisView disView = s.getDisView();
+                            if (disView != null) {
+                                s.getDisView().setFullTimeStart(format);
+                            } else {
+                                DisView disView1 = new DisView();
+                                disView1.setFullTimeStart(format);
+                                s.setDisView(disView1);
+                            }
+                        }
+                        //交底:项目经理交底内容
+                        if ("交底:项目经理交底内容".equals(activityName)) {
+                            s.getDisView().setProjectManagerImport(format);
+                        }
+                        //交底:导入材料表和拆旧物资表
+                        if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
+                            s.getDisView().setUnitManagerJudge(format);
+                        }
+                        //交底:填写部分工程量信息
+                        if ("交底:填写部分工程量信息".equals(activityName)) {
+                            s.getDisView().setProjectManagerJudge(format);
+                        }
+                        if ("交底:填写部分工程量信息".equals(activityName)) {
+                            if (fin.equals("")) {
+                                fin = format;
+                            }
+                            if (fin.compareTo(format) < 1) {
+                                fin = format;
+                            }
+                        }
+
+
+                        //设计变更
+                        if ("交底:配网项目经理判定设计变更".equals(activityName)
+                                || "交底:经研所判定是否设计变更".equals(activityName)
+                                || "交底:运行单位经理审核方案".equals(activityName)
+                                || "交底:设计单位人员重新设计".equals(activityName)
+                                || "交底:运行经理审核设计变更后".equals(activityName)
+                                || "交底:配网经理审核设计变更后".equals(activityName)
+                                ) {
+                            s.getDisView().setDesignChange("设计变更流程中");
+                        }
+                        //项目关闭
+                        if ("交底:项目经理判定是否关闭".equals(activityName)
+                                || "交底:配网工程专职判定是否关闭".equals(activityName)
+                                || "交底:配网运行人员判定是否关闭".equals(activityName)
+                                || "交底:配网工程专职判定变更或关闭".equals(activityName)
+                                || "交底:配网系统专职确认系统关闭".equals(activityName)
+
+                                ) {
+                            s.getDisView().setProjectClosure("项目关闭流程中");
+                        }
+
+
+                        //如果因为各种原因完成了设计变更流程或者项目关闭流程
+                        if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
+                            flag = true;
+                        }
+
+                        if ("交底:配网项目经理判定设计变更".equals(activityName)) {
+                            designFlag = true;
+                        }
+
+                        if ("交底:项目经理判定是否关闭".equals(activityName)) {
+                            closeFlag = true;
+                        }
+
+                        if ("交底:配网项目经理判定变更或关闭".equals(activityName) || "交底:配网系统专职确认系统关闭".equals(activityName)) {
+                            finalClose = true;
+                        }
+
+                        //政策处理
+                        if ("交底:农村政处".equals(activityName)
+                                || "交底:政策处理专职判断".equals(activityName)
+                                || "交底:政策处理专职判断".equals(activityName)
+                                || "交底:农村上传文件".equals(activityName)
+                                || "交底:行政政处".equals(activityName)
+                                || "行政:政策处理专职判断".equals(activityName)
+                                || "交底:行政上传文件".equals(activityName)
+                                || "交底:民事政处".equals(activityName)
+                                || "民事:政策处理专职判断".equals(activityName)
+                                || "交底:民事上传文件".equals(activityName)
+                                || "是否需要农村政处".equals(activityName)
+                                || "是否需要行政政处".equals(activityName)
+                                || "是否需要民事政处".equals(activityName)
+                                ) {
+                            s.getDisView().setPolicyType("政策处理流程中");
+                        }
+                        //判断是否发起农村政处
+                        if ("交底:农村政处".equals(activityName)) {
+                            policyStart1 = true;
+                        }
+                        //判断是否发起行政政处
+                        if ("交底:行政政处".equals(activityName)) {
+                            policyStart2 = true;
+                        }
+                        //判断是否发起民事政处
+                        if ("交底:民事政处".equals(activityName)) {
+                            policyStart3 = true;
+                        }
+                        //判断农村政处是否完成
+                        if ("交底:民事是否支付".equals(activityName)
+                                || "交底:民事是完成否借款".equals(activityName)) {
+                            policyEnd1 = true;
+                        }
+                        //判断行政政处是否完成
+                        if ("交底:行政是否支付".equals(activityName)
+                                || "交底:行政是完成否借款".equals(activityName)) {
+                            policyEnd2 = true;
+                        }
+                        //判断民事政处是否完成
+                        if ("交底:农村是否支付".equals(activityName)
+                                || "交底:农村是完成否借款".equals(activityName)) {
+                            policyEnd3 = true;
+                        }
+                    }
+                    //判断项目是否完成
+                    if ("2".equals(s.getStatus())) {
+                        s.getDisView().setFinTime(fin);
+                    }
+                    //判断是否已经导入拆旧表
+                    if (flag) {
+                        //判断是否发起过设计变更
+                        if (designFlag) {
+                            s.getDisView().setDesignChange("设计变更完成");
+                        }
+                    }
+                    //判断是否发起过项目关闭
+                    if (closeFlag) {
+                        if (finalClose) {
+                            s.getDisView().setProjectClosure("项目关闭完成");
+                        }
+                    }
+                    if (policyStart1) {
+                        if (policyEnd1) {
+                            policy1 = true;
+                        } else {
+                            policy1 = false;
+                        }
+                    } else {
+                        policy1 = true;
+
+                    }
+                    if (policyStart2) {
+                        if (policyEnd2) {
+                            policy2 = true;
+                        } else {
+                            policy2 = false;
+                        }
+                    } else {
+                        policy2 = true;
+                    }
+                    if (policyStart3) {
+                        if (policyEnd3) {
+                            policy3 = true;
+                        } else {
+                            policy3 = false;
+                        }
+                    } else {
+                        policy3 = true;
+                    }
+                    if (policyStart1 == false && policyStart2 == false && policyStart3 == false) {
+
+                    } else {
+                        if (policy1 == true && policy2 == true && policy3 == true) {
+                            s.getDisView().setPolicyType("政策处理完成");
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 处理进度信息中的领料信息
+     * @param list
+     */
+    public static void dealRec(List<ScheduleView> list){
+        if(list!=null && list.size()>0){
+            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            for (ScheduleView s : list) {
+                String procInsId = s.getProcInsId();
+                if (procInsId != null && !"".equals(procInsId)) {
+                    List<HistoricActivityInstance> historicActivityInstances = MyActiviUtils.hisTask(procInsId);
+//                    List<Task> tasks = MyActiviUtils.runNowTask(procInsId);
+                    for (HistoricActivityInstance a : historicActivityInstances) {
+                        String activityName = a.getActivityName();
+                        String format = formatter.format(a.getEndTime());
+                        if (s.getReceiveView() == null) {
+                            s.setReceiveView(new ReceiveView());
+                        }
+                        if ("项目经理开领料单".equals(activityName)) {
+                            s.getReceiveView().setOpenList(format);
+                        }
+                        if ("领料:经理填写项目模块".equals(activityName)) {
+                            s.getReceiveView().setMangagerFile(format);
+                        }
+                        if ("领料:施工单位领导审核".equals(activityName)) {
+                            s.getReceiveView().setMaLeaderReviewed(format);
+                        }
+                        if ("领料:施工单位物资专职审核".equals(activityName)) {
+                            s.getReceiveView().setConUnitReviewed(format);
+                        }
+                        if ("领料:配网项目经理审核领料单".equals(activityName)) {
+                            s.getReceiveView().setConMangagerReviewed(format);
+                        }
+                        if ("领料:配网物资专职审核领料单".equals(activityName)) {
+                            s.getReceiveView().setFullReviewed(format);
+                            s.getReceiveView().setRecFinTime(format);
+                        }
+/*                    if ("领料:项目中心领导审核领料单".equals(activityName)) {
+                        s.getReceiveView().setLeaderReviewed(format);
+                        s.getReceiveView().setRecFinTime(format);
+                    }*/
+                    }
+                }
+            }
+        }
+    }
+}

+ 289 - 265
src/main/java/com/jeeplus/modules/sg/scheduleView/web/ScheduleViewController.java

@@ -1,12 +1,16 @@
 package com.jeeplus.modules.sg.scheduleView.web;
 
+import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.web.BaseController;
 import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
+import com.jeeplus.modules.sg.scheduleView.util.ExportUtil;
+import com.jeeplus.modules.sg.scheduleView.util.ScheduleViewUtil;
 import com.jeeplus.modules.sg.scheduleView.entity.*;
 import com.jeeplus.modules.sg.scheduleView.service.ScheduleViewService;
 import org.activiti.engine.history.HistoricActivityInstance;
 import org.activiti.engine.task.Task;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -15,6 +19,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -184,239 +190,270 @@ public class ScheduleViewController extends BaseController {
     @RequestMapping(value = "disData")
     public Map<String, Object> disData(ScheduleView scheduleView, HttpServletRequest request, HttpServletResponse response, Model model) {
         String projectId = scheduleView.getProjectId();
-        String[] projectList = null;
-        List<String> searchList = new ArrayList<>();
-        if (!projectId.equals("")) {
-            projectList = projectId.split("\\s+");
-            for (int i = 0; i < projectList.length; i++) {
-                searchList.add(projectList[i]);
-            }
-            scheduleView.setProjectList(searchList);
+//        String[] projectList = null;
+//        List<String> searchList = new ArrayList<>();
+//        if (!projectId.equals("")) {
+//            projectList = projectId.split("\\s+");
+//            for (int i = 0; i < projectList.length; i++) {
+//                searchList.add(projectList[i]);
+//            }
+//            scheduleView.setProjectList(searchList);
+//        }
+        if(StringUtils.isNotBlank(projectId)){
+            String[] idArr = projectId.split("\\s+");
+            List<String> idList = Arrays.asList(idArr);
+            scheduleView.setProjectList(idList);
         }
+
         Page<ScheduleView> scheduleViewPage = scheduleViewService.disAll(new Page<ScheduleView>(request, response), scheduleView);
         List<ScheduleView> list = scheduleViewPage.getList();
-        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String fin = "";
-        boolean flag;
-        boolean designFlag;
-        boolean closeFlag;
-        boolean finalClose;
-        boolean policyStart1;
-        boolean policyStart2;
-        boolean policyStart3;
-        boolean policyEnd1;
-        boolean policyEnd2;
-        boolean policyEnd3;
-        boolean policy1;
-        boolean policy2;
-        boolean policy3;
-        for (ScheduleView s : list) {
-            String status = s.getStatus();
-
-            flag = false;
-            designFlag = false;
-            closeFlag = false;
-            finalClose = false;
-            policyStart1 = false;
-            policyStart2 = false;
-            policyStart3 = false;
-            policyEnd1 = false;
-            policyEnd2 = false;
-            policyEnd3 = false;
-            policy1 = false;
-            policy2 = false;
-            policy3 = false;
-            String procInsId = s.getProcInsId();
-            if (procInsId != null && !"".equals(procInsId)) {
-                List<HistoricActivityInstance> historicActivityInstances = MyActiviUtils.hisTask(procInsId);
-/*                List<Task> tasks = MyActiviUtils.runNowTask(procInsId);
-                String runNowName = "";
-                for (Task a : tasks) {
-                    runNowName += a.getName();
-                }*/
-                for (HistoricActivityInstance a : historicActivityInstances) {
-                    String activityName = a.getActivityName();
-                    String format = formatter.format(a.getEndTime());
-                    if (s.getDisView() == null) {
-                        s.setDisView(new DisView());
-                    }
-                    if ("2".equals(status)) {
-                        s.getDisView().setPolicyType("政策处理完成");
-                        s.getDisView().setProjectClosure("项目关闭完成");
-                        s.getDisView().setDesignChange("设计变更完成");
-                        continue;
-                    }
-                    if ("开始".equals(activityName)) {
-                        DisView disView = s.getDisView();
-                        if (disView != null) {
-                            s.getDisView().setFullTimeStart(format);
-                        } else {
-                            DisView disView1 = new DisView();
-                            disView1.setFullTimeStart(format);
-                            s.setDisView(disView1);
-                        }
-                    }
-                    //交底:项目经理交底内容
-                    if ("交底:项目经理交底内容".equals(activityName)) {
-                        s.getDisView().setProjectManagerImport(format);
-                    }
-                    //交底:导入材料表和拆旧物资表
-                    if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
-                        s.getDisView().setUnitManagerJudge(format);
-                    }
-                    //交底:填写部分工程量信息
-                    if ("交底:填写部分工程量信息".equals(activityName)) {
-                        s.getDisView().setProjectManagerJudge(format);
-                    }
-                    if ("交底:填写部分工程量信息".equals(activityName)) {
-                        if (fin.equals("")) {
-                            fin = format;
-                        }
-                        if (fin.compareTo(format) < 1) {
-                            fin = format;
-                        }
-                    }
-
-
-                    //设计变更
-                    if ("交底:配网项目经理判定设计变更".equals(activityName)
-                            || "交底:经研所判定是否设计变更".equals(activityName)
-                            || "交底:运行单位经理审核方案".equals(activityName)
-                            || "交底:设计单位人员重新设计".equals(activityName)
-                            || "交底:运行经理审核设计变更后".equals(activityName)
-                            || "交底:配网经理审核设计变更后".equals(activityName)
-                    ) {
-                        s.getDisView().setDesignChange("设计变更流程中");
-                    }
-                    //项目关闭
-                    if ("交底:项目经理判定是否关闭".equals(activityName)
-                            || "交底:配网工程专职判定是否关闭".equals(activityName)
-                            || "交底:配网运行人员判定是否关闭".equals(activityName)
-                            || "交底:配网工程专职判定变更或关闭".equals(activityName)
-                            || "交底:配网系统专职确认系统关闭".equals(activityName)
-
-                    ) {
-                        s.getDisView().setProjectClosure("项目关闭流程中");
-                    }
-
-
-                    //如果因为各种原因完成了设计变更流程或者项目关闭流程
-                    if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
-                        flag = true;
-                    }
-
-                    if ("交底:配网项目经理判定设计变更".equals(activityName)) {
-                        designFlag = true;
-                    }
+        ScheduleViewUtil.dealDiscloseList(list);
+//        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        String fin = "";
+//        boolean flag;
+//        boolean designFlag;
+//        boolean closeFlag;
+//        boolean finalClose;
+//        boolean policyStart1;
+//        boolean policyStart2;
+//        boolean policyStart3;
+//        boolean policyEnd1;
+//        boolean policyEnd2;
+//        boolean policyEnd3;
+//        boolean policy1;
+//        boolean policy2;
+//        boolean policy3;
+//        for (ScheduleView s : list) {
+//            String status = s.getStatus();
+//
+//            flag = false;
+//            designFlag = false;
+//            closeFlag = false;
+//            finalClose = false;
+//            policyStart1 = false;
+//            policyStart2 = false;
+//            policyStart3 = false;
+//            policyEnd1 = false;
+//            policyEnd2 = false;
+//            policyEnd3 = false;
+//            policy1 = false;
+//            policy2 = false;
+//            policy3 = false;
+//            String procInsId = s.getProcInsId();
+//            if (procInsId != null && !"".equals(procInsId)) {
+//                List<HistoricActivityInstance> historicActivityInstances = MyActiviUtils.hisTask(procInsId);
+///*                List<Task> tasks = MyActiviUtils.runNowTask(procInsId);
+//                String runNowName = "";
+//                for (Task a : tasks) {
+//                    runNowName += a.getName();
+//                }*/
+//                for (HistoricActivityInstance a : historicActivityInstances) {
+//                    String activityName = a.getActivityName();
+//                    String format = formatter.format(a.getEndTime());
+//                    if (s.getDisView() == null) {
+//                        s.setDisView(new DisView());
+//                    }
+//                    if ("2".equals(status)) {
+//                        s.getDisView().setPolicyType("政策处理完成");
+//                        s.getDisView().setProjectClosure("项目关闭完成");
+//                        s.getDisView().setDesignChange("设计变更完成");
+//                        continue;
+//                    }
+//                    if ("开始".equals(activityName)) {
+//                        DisView disView = s.getDisView();
+//                        if (disView != null) {
+//                            s.getDisView().setFullTimeStart(format);
+//                        } else {
+//                            DisView disView1 = new DisView();
+//                            disView1.setFullTimeStart(format);
+//                            s.setDisView(disView1);
+//                        }
+//                    }
+//                    //交底:项目经理交底内容
+//                    if ("交底:项目经理交底内容".equals(activityName)) {
+//                        s.getDisView().setProjectManagerImport(format);
+//                    }
+//                    //交底:导入材料表和拆旧物资表
+//                    if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
+//                        s.getDisView().setUnitManagerJudge(format);
+//                    }
+//                    //交底:填写部分工程量信息
+//                    if ("交底:填写部分工程量信息".equals(activityName)) {
+//                        s.getDisView().setProjectManagerJudge(format);
+//                    }
+//                    if ("交底:填写部分工程量信息".equals(activityName)) {
+//                        if (fin.equals("")) {
+//                            fin = format;
+//                        }
+//                        if (fin.compareTo(format) < 1) {
+//                            fin = format;
+//                        }
+//                    }
+//
+//
+//                    //设计变更
+//                    if ("交底:配网项目经理判定设计变更".equals(activityName)
+//                            || "交底:经研所判定是否设计变更".equals(activityName)
+//                            || "交底:运行单位经理审核方案".equals(activityName)
+//                            || "交底:设计单位人员重新设计".equals(activityName)
+//                            || "交底:运行经理审核设计变更后".equals(activityName)
+//                            || "交底:配网经理审核设计变更后".equals(activityName)
+//                    ) {
+//                        s.getDisView().setDesignChange("设计变更流程中");
+//                    }
+//                    //项目关闭
+//                    if ("交底:项目经理判定是否关闭".equals(activityName)
+//                            || "交底:配网工程专职判定是否关闭".equals(activityName)
+//                            || "交底:配网运行人员判定是否关闭".equals(activityName)
+//                            || "交底:配网工程专职判定变更或关闭".equals(activityName)
+//                            || "交底:配网系统专职确认系统关闭".equals(activityName)
+//
+//                    ) {
+//                        s.getDisView().setProjectClosure("项目关闭流程中");
+//                    }
+//
+//
+//                    //如果因为各种原因完成了设计变更流程或者项目关闭流程
+//                    if ("交底:导入材料表和拆旧物资表".equals(activityName)) {
+//                        flag = true;
+//                    }
+//
+//                    if ("交底:配网项目经理判定设计变更".equals(activityName)) {
+//                        designFlag = true;
+//                    }
+//
+//                    if ("交底:项目经理判定是否关闭".equals(activityName)) {
+//                        closeFlag = true;
+//                    }
+//
+//                    if ("交底:配网项目经理判定变更或关闭".equals(activityName) || "交底:配网系统专职确认系统关闭".equals(activityName)) {
+//                        finalClose = true;
+//                    }
+//
+//                    //政策处理
+//                    if ("交底:农村政处".equals(activityName)
+//                            || "交底:政策处理专职判断".equals(activityName)
+//                            || "交底:政策处理专职判断".equals(activityName)
+//                            || "交底:农村上传文件".equals(activityName)
+//                            || "交底:行政政处".equals(activityName)
+//                            || "行政:政策处理专职判断".equals(activityName)
+//                            || "交底:行政上传文件".equals(activityName)
+//                            || "交底:民事政处".equals(activityName)
+//                            || "民事:政策处理专职判断".equals(activityName)
+//                            || "交底:民事上传文件".equals(activityName)
+//                            || "是否需要农村政处".equals(activityName)
+//                            || "是否需要行政政处".equals(activityName)
+//                            || "是否需要民事政处".equals(activityName)
+//                    ) {
+//                        s.getDisView().setPolicyType("政策处理流程中");
+//                    }
+//                    //判断是否发起农村政处
+//                    if ("交底:农村政处".equals(activityName)) {
+//                        policyStart1 = true;
+//                    }
+//                    //判断是否发起行政政处
+//                    if ("交底:行政政处".equals(activityName)) {
+//                        policyStart2 = true;
+//                    }
+//                    //判断是否发起民事政处
+//                    if ("交底:民事政处".equals(activityName)) {
+//                        policyStart3 = true;
+//                    }
+//                    //判断农村政处是否完成
+//                    if ("交底:民事是否支付".equals(activityName)
+//                            || "交底:民事是完成否借款".equals(activityName)) {
+//                        policyEnd1 = true;
+//                    }
+//                    //判断行政政处是否完成
+//                    if ("交底:行政是否支付".equals(activityName)
+//                            || "交底:行政是完成否借款".equals(activityName)) {
+//                        policyEnd2 = true;
+//                    }
+//                    //判断民事政处是否完成
+//                    if ("交底:农村是否支付".equals(activityName)
+//                            || "交底:农村是完成否借款".equals(activityName)) {
+//                        policyEnd3 = true;
+//                    }
+//                }
+//                //判断项目是否完成
+//                if ("2".equals(s.getStatus())) {
+//                    s.getDisView().setFinTime(fin);
+//                }
+//                //判断是否已经导入拆旧表
+//                if (flag) {
+//                    //判断是否发起过设计变更
+//                    if (designFlag) {
+//                        s.getDisView().setDesignChange("设计变更完成");
+//                    }
+//                }
+//                //判断是否发起过项目关闭
+//                if (closeFlag) {
+//                    if (finalClose) {
+//                        s.getDisView().setProjectClosure("项目关闭完成");
+//                    }
+//                }
+//                if (policyStart1) {
+//                    if (policyEnd1) {
+//                        policy1 = true;
+//                    } else {
+//                        policy1 = false;
+//                    }
+//                } else {
+//                    policy1 = true;
+//
+//                }
+//                if (policyStart2) {
+//                    if (policyEnd2) {
+//                        policy2 = true;
+//                    } else {
+//                        policy2 = false;
+//                    }
+//                } else {
+//                    policy2 = true;
+//                }
+//                if (policyStart3) {
+//                    if (policyEnd3) {
+//                        policy3 = true;
+//                    } else {
+//                        policy3 = false;
+//                    }
+//                } else {
+//                    policy3 = true;
+//                }
+//                if (policyStart1 == false && policyStart2 == false && policyStart3 == false) {
+//
+//                } else {
+//                    if (policy1 == true && policy2 == true && policy3 == true) {
+//                        s.getDisView().setPolicyType("政策处理完成");
+//                    }
+//                }
+//            }
+//        }
+        return getBootstrapData(scheduleViewPage);
+    }
 
-                    if ("交底:项目经理判定是否关闭".equals(activityName)) {
-                        closeFlag = true;
-                    }
-
-                    if ("交底:配网项目经理判定变更或关闭".equals(activityName) || "交底:配网系统专职确认系统关闭".equals(activityName)) {
-                        finalClose = true;
-                    }
-
-                    //政策处理
-                    if ("交底:农村政处".equals(activityName)
-                            || "交底:政策处理专职判断".equals(activityName)
-                            || "交底:政策处理专职判断".equals(activityName)
-                            || "交底:农村上传文件".equals(activityName)
-                            || "交底:行政政处".equals(activityName)
-                            || "行政:政策处理专职判断".equals(activityName)
-                            || "交底:行政上传文件".equals(activityName)
-                            || "交底:民事政处".equals(activityName)
-                            || "民事:政策处理专职判断".equals(activityName)
-                            || "交底:民事上传文件".equals(activityName)
-                            || "是否需要农村政处".equals(activityName)
-                            || "是否需要行政政处".equals(activityName)
-                            || "是否需要民事政处".equals(activityName)
-                    ) {
-                        s.getDisView().setPolicyType("政策处理流程中");
-                    }
-                    //判断是否发起农村政处
-                    if ("交底:农村政处".equals(activityName)) {
-                        policyStart1 = true;
-                    }
-                    //判断是否发起行政政处
-                    if ("交底:行政政处".equals(activityName)) {
-                        policyStart2 = true;
-                    }
-                    //判断是否发起民事政处
-                    if ("交底:民事政处".equals(activityName)) {
-                        policyStart3 = true;
-                    }
-                    //判断农村政处是否完成
-                    if ("交底:民事是否支付".equals(activityName)
-                            || "交底:民事是完成否借款".equals(activityName)) {
-                        policyEnd1 = true;
-                    }
-                    //判断行政政处是否完成
-                    if ("交底:行政是否支付".equals(activityName)
-                            || "交底:行政是完成否借款".equals(activityName)) {
-                        policyEnd2 = true;
-                    }
-                    //判断民事政处是否完成
-                    if ("交底:农村是否支付".equals(activityName)
-                            || "交底:农村是完成否借款".equals(activityName)) {
-                        policyEnd3 = true;
-                    }
-                }
-                //判断项目是否完成
-                if ("2".equals(s.getStatus())) {
-                    s.getDisView().setFinTime(fin);
-                }
-                //判断是否已经导入拆旧表
-                if (flag) {
-                    //判断是否发起过设计变更
-                    if (designFlag) {
-                        s.getDisView().setDesignChange("设计变更完成");
-                    }
-                }
-                //判断是否发起过项目关闭
-                if (closeFlag) {
-                    if (finalClose) {
-                        s.getDisView().setProjectClosure("项目关闭完成");
-                    }
-                }
-                if (policyStart1) {
-                    if (policyEnd1) {
-                        policy1 = true;
-                    } else {
-                        policy1 = false;
-                    }
-                } else {
-                    policy1 = true;
+    /**
+     * 导出施工交底项目进度列表
+     */
+    @ResponseBody
+    @RequestMapping(value = "disExport")
+    public void disExport(ScheduleView scheduleView, HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
+        scheduleView.setReserveProjectName(URLDecoder.decode(scheduleView.getReserveProjectName(),"UTF-8"));
+        scheduleView.setProjectId(URLDecoder.decode(scheduleView.getProjectId(),"UTF-8"));
+        scheduleView.setProjectName(URLDecoder.decode(scheduleView.getProjectName(),"UTF-8"));
+        String projectId = scheduleView.getProjectId();
+        if(StringUtils.isNotBlank(projectId)){
+            String[] idArr = projectId.split("\\s+");
+            List<String> idList = Arrays.asList(idArr);
+            scheduleView.setProjectList(idList);
+        }
 
-                }
-                if (policyStart2) {
-                    if (policyEnd2) {
-                        policy2 = true;
-                    } else {
-                        policy2 = false;
-                    }
-                } else {
-                    policy2 = true;
-                }
-                if (policyStart3) {
-                    if (policyEnd3) {
-                        policy3 = true;
-                    } else {
-                        policy3 = false;
-                    }
-                } else {
-                    policy3 = true;
-                }
-                if (policyStart1 == false && policyStart2 == false && policyStart3 == false) {
+        List<ScheduleView> list = scheduleViewService.disAll(scheduleView);
+        ScheduleViewUtil.dealDiscloseList(list);
 
-                } else {
-                    if (policy1 == true && policy2 == true && policy3 == true) {
-                        s.getDisView().setPolicyType("政策处理完成");
-                    }
-                }
-            }
-        }
-        return getBootstrapData(scheduleViewPage);
+        ExportUtil util = ExportUtil.getOne();
+        XSSFWorkbook workbook = util.getWorkbook("scheduleViewDisclose");
+        util.exportDisclose(response,workbook,list);
     }
 
     /**
@@ -437,48 +474,35 @@ public class ScheduleViewController extends BaseController {
         }
         Page<ScheduleView> scheduleViewPage = scheduleViewService.recAll(new Page<ScheduleView>(request, response), scheduleView);
         List<ScheduleView> list = scheduleViewPage.getList();
-        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        for (ScheduleView s : list) {
-            String procInsId = s.getProcInsId();
-            if (procInsId != null && !"".equals(procInsId)) {
-                List<HistoricActivityInstance> historicActivityInstances = MyActiviUtils.hisTask(procInsId);
-                List<Task> tasks = MyActiviUtils.runNowTask(procInsId);
-                for (HistoricActivityInstance a : historicActivityInstances) {
-                    String activityName = a.getActivityName();
-                    String format = formatter.format(a.getEndTime());
-                    if (s.getReceiveView() == null) {
-                        s.setReceiveView(new ReceiveView());
-                    }
-                    if ("项目经理开领料单".equals(activityName)) {
-                        s.getReceiveView().setOpenList(format);
-                    }
-                    if ("领料:经理填写项目模块".equals(activityName)) {
-                        s.getReceiveView().setMangagerFile(format);
-                    }
-                    if ("领料:施工单位领导审核".equals(activityName)) {
-                        s.getReceiveView().setMaLeaderReviewed(format);
-                    }
-                    if ("领料:施工单位物资专职审核".equals(activityName)) {
-                        s.getReceiveView().setConUnitReviewed(format);
-                    }
-                    if ("领料:配网项目经理审核领料单".equals(activityName)) {
-                        s.getReceiveView().setConMangagerReviewed(format);
-                    }
-                    if ("领料:配网物资专职审核领料单".equals(activityName)) {
-                        s.getReceiveView().setFullReviewed(format);
-                        s.getReceiveView().setRecFinTime(format);
-                    }
-/*                    if ("领料:项目中心领导审核领料单".equals(activityName)) {
-                        s.getReceiveView().setLeaderReviewed(format);
-                        s.getReceiveView().setRecFinTime(format);
-                    }*/
-                }
-            }
-        }
+        ScheduleViewUtil.dealRec(list);
         return getBootstrapData(scheduleViewPage);
     }
 
     /**
+     * 导出物资领料项目进度列表
+     */
+    @ResponseBody
+    @RequestMapping(value = "recExport")
+    public void recExport(ScheduleView scheduleView, HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
+        scheduleView.setReserveProjectName(URLDecoder.decode(scheduleView.getReserveProjectName(),"UTF-8"));
+        scheduleView.setProjectId(URLDecoder.decode(scheduleView.getProjectId(),"UTF-8"));
+        scheduleView.setProjectName(URLDecoder.decode(scheduleView.getProjectName(),"UTF-8"));
+        String projectId = scheduleView.getProjectId();
+        if(StringUtils.isNotBlank(projectId)){
+            String[] idArr = projectId.split("\\s+");
+            List<String> idList = Arrays.asList(idArr);
+            scheduleView.setProjectList(idList);
+        }
+
+        List<ScheduleView> list = scheduleViewService.recAll(scheduleView);
+        ScheduleViewUtil.dealRec(list);
+
+        ExportUtil util = ExportUtil.getOne();
+        XSSFWorkbook workbook = util.getWorkbook("scheduleViewRec");
+        util.exportRec(response,workbook,list);
+    }
+
+    /**
      * 结算流程数据
      */
     @ResponseBody

BIN
src/main/resources/freemarker/excelmodel/scheduleViewDisclose.xlsx


BIN
src/main/resources/freemarker/excelmodel/scheduleViewRec.xlsx


+ 10 - 1
src/main/webapp/webpage/modules/sg/managementcenter/activiti/discloseList.js

@@ -380,8 +380,17 @@ $(document).ready(function() {
     //     jp.downloadFile('${ctx}/sg/managementcenter/project/export1');
     // });
 
+    $("#btnExport").click(function () {
+        var id = getIdSelections();
+        var projectId = encodeURI(encodeURI($("#projectId").val()));
+        var reserveProjectName = encodeURI(encodeURI($("#reserveProjectName").val()));
+        var projectName = encodeURI(encodeURI($("#projectName").val()));
+        jp.downloadFile('${ctx}/sg/managementcenter/activiti/btnExport?id=' + id + '&reserveProjectName=' + reserveProjectName + '&projectId=' + projectId + '&projectName=' + projectName);
+    });
+
+
 
-	  $("#search").click("click", function() {// 绑定查询按扭
+    $("#search").click("click", function() {// 绑定查询按扭
 		  $('#projectTable').bootstrapTable('refresh');
 		});
 

+ 31 - 12
src/main/webapp/webpage/modules/sg/managementcenter/activiti/discloseList.jsp

@@ -52,22 +52,41 @@
 			</div>
 		</div>
 
+		<!-- 工具栏 -->
+		<div id="toolbar">
+			<%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:edit">--%>
+				<%--<button id="edit" class="btn btn-primary" onclick="edit()">--%>
+					<%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:import">--%>
+				<%--<button id="btnImport" class="btn btn-info">--%>
+					<%--<i class="fa fa-folder-open-o"></i> 导入--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
+			<shiro:hasPermission name="sg:managementcenter:activiti:export">
+				<button id="btnExport" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			</shiro:hasPermission>
+		</div>
+
 	<!-- 表格 -->
 	<table id="projectTable"  style="table-layout:fixed"  data-toolbar="#toolbar"></table>
 
     <!-- context menu -->
-    <ul id="context-menu" class="dropdown-menu">
-    	<shiro:hasPermission name="sg:managementcenter:project:view">
-        <li data-item="view"><a>查看</a></li>
-        </shiro:hasPermission>
-    	<shiro:hasPermission name="sg:managementcenter:project:edit">
-        <li data-item="edit"><a>编辑</a></li>
-        </shiro:hasPermission>
-        <shiro:hasPermission name="sg:managementcenter:project:del">
-        <li data-item="delete"><a>删除</a></li>
-        </shiro:hasPermission>
-        <li data-item="action1"><a>取消</a></li>
-    </ul>  
+    <%--<ul id="context-menu" class="dropdown-menu">--%>
+    	<%--<shiro:hasPermission name="sg:managementcenter:project:view">--%>
+        <%--<li data-item="view"><a>查看</a></li>--%>
+        <%--</shiro:hasPermission>--%>
+    	<%--<shiro:hasPermission name="sg:managementcenter:project:edit">--%>
+        <%--<li data-item="edit"><a>编辑</a></li>--%>
+        <%--</shiro:hasPermission>--%>
+        <%--<shiro:hasPermission name="sg:managementcenter:project:del">--%>
+        <%--<li data-item="delete"><a>删除</a></li>--%>
+        <%--</shiro:hasPermission>--%>
+        <%--<li data-item="action1"><a>取消</a></li>--%>
+    <%--</ul>  --%>
 	</div>
 	</div>
 	</div>

+ 2 - 2
src/main/webapp/webpage/modules/sg/managementcenter/materialInventory/materialInventory.js

@@ -181,7 +181,7 @@ $(document).ready(function() {
 			    btn: ['确定', '关闭'],
 			    btn1: function(index, layero){
 				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-						iframeWin.contentWindow.importExcel('${ctx}/sg/managementcenter/materialInventory/import', function (data) {
+						iframeWin.contentWindow.importExcel('${ctx}/sg/managementcenter/materialInventory/importInventory', function (data) {
 							if(data.success){
 								jp.success(data.msg);
 								refresh();
@@ -208,7 +208,7 @@ $(document).ready(function() {
             btn: ['确定', '关闭'],
             btn1: function(index, layero){
                 var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-                iframeWin.contentWindow.importExcel('${ctx}/sg/managementcenter/materialInventory/import1', function (data) {
+                iframeWin.contentWindow.importExcel('${ctx}/sg/managementcenter/materialInventory/importRequisition', function (data) {
                     if(data.success){
                         jp.success(data.msg);
                         refresh();

+ 2 - 2
src/main/webapp/webpage/modules/sg/picking/activiti/pickingApplication.jsp

@@ -36,8 +36,8 @@
 							<tr>
 								<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称:</label></td>
 								<td class="width-35">
-									<sys:itemselect url="${ctx}/sg/managementcenter/project/pickingApplication" id="project" name="projectId" value="${showList.projectName}" labelName="project.requireName" labelValue="${showList.projectName}"
-													title="选择项目号" cssClass="form-control " fieldLabels="${fns:urlEncode('项目需求名称|工程编号|项目名称|项目定义号')}" fieldKeys="requireName|projecId|projectName|projectNumber" searchLabels="${fns:urlEncode('项目需求名称')}" searchKeys="requireName"  isMultiSelected="false"></sys:itemselect>
+									<sys:itemselect url="${ctx}/sg/managementcenter/project/pickingApplication" id="project" name="projectId" value="${construction.reserveProjectName}" labelName="project.reserveProjectName" labelValue="${construction.reserveProjectName}"
+													title="选择项目号" cssClass="form-control " fieldLabels="${fns:urlEncode('储备项目名称|项目名称|项目定义号')}" fieldKeys="reserveProjectName|projectId|projectName" searchLabels="${fns:urlEncode('储备项目名称')}|${fns:urlEncode('项目名称')}|${fns:urlEncode('项目定义号')}" searchKeys="reserveProjectName|projectName|projectId"  isMultiSelected="false"></sys:itemselect>
 								</td>
 							</tr>
 							<tr>

+ 8 - 0
src/main/webapp/webpage/modules/sg/scheduleView/show/disView.js

@@ -146,6 +146,14 @@
 			$('#settTable').bootstrapTable('refresh');
 		});
 
+        $("#btnExport").click(function () {
+        	//方法用于获取选中id
+            // var id = getIdSelections();
+            var projectId = encodeURI(encodeURI($("#projectId").val()));
+            var reserveProjectName = encodeURI(encodeURI($("#reserveProjectName").val()));
+            var projectName = encodeURI(encodeURI($("#projectName").val()));
+            jp.downloadFile('${ctx}/scheduleView/disExport?reserveProjectName=' + reserveProjectName + '&projectId=' + projectId + '&projectName=' + projectName);
+        });
 
 		$("#printf").click(function () {
 			var procInsId = $("#procInsId").val();

+ 15 - 0
src/main/webapp/webpage/modules/sg/scheduleView/show/disView.jsp

@@ -67,6 +67,21 @@
                     </div>
                     <!-- 工具栏 -->
                     <div id="toolbar">
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:edit">--%>
+                            <%--<button id="edit" class="btn btn-primary" onclick="edit()">--%>
+                                <%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+                            <%--</button>--%>
+                        <%--</shiro:hasPermission>--%>
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:import">--%>
+                            <%--<button id="btnImport" class="btn btn-info">--%>
+                                <%--<i class="fa fa-folder-open-o"></i> 导入--%>
+                            <%--</button>--%>
+                        <%--</shiro:hasPermission>--%>
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:export">--%>
+                            <button id="btnExport" class="btn btn-warning">
+                                <i class="fa fa-file-excel-o"></i> 导出
+                            </button>
+                        <%--</shiro:hasPermission>--%>
                     </div>
                     <!-- 表格 -->
                     <table id="settTable" data-toolbar="#toolbar" class="table"></table>

+ 8 - 0
src/main/webapp/webpage/modules/sg/scheduleView/show/recView.js

@@ -124,6 +124,14 @@ $(document).ready(function () {
         $('#settTable').bootstrapTable('refresh');
     });
 
+    $("#btnExport").click(function () {
+        // var id = getIdSelections();
+        var projectId = encodeURI(encodeURI($("#projectId").val()));
+        var reserveProjectName = encodeURI(encodeURI($("#reserveProjectName").val()));
+        var projectName = encodeURI(encodeURI($("#projectName").val()));
+        jp.downloadFile('${ctx}/scheduleView/recExport?reserveProjectName=' + reserveProjectName + '&projectId=' + projectId + '&projectName=' + projectName);
+    });
+
 
     $("#printf").click(function () {
         var procInsId = $("#procInsId").val();

+ 31 - 2
src/main/webapp/webpage/modules/sg/scheduleView/show/recView.jsp

@@ -38,11 +38,25 @@
                     <div id="search-collapse" class="collapse">
                         <div class="accordion-inner">
                             <form:form id="searchForm" modelAttribute="scheduleView" 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="projectId" htmlEscape="false"  class=" form-control"/>--%>
+                                <%--</div>--%>
+
+                                <div class="col-xs-12 col-sm-6 col-md-4">
+                                    <label class="label-item single-overflow pull-left" title="储备项目暂定名称:">储备项目暂定名称:</label>
+                                    <form:input path="reserveProjectName" htmlEscape="false" maxlength="100"  class=" form-control"/>
+                                </div>
                                 <div class="col-xs-12 col-sm-6 col-md-4">
-                                    <label class="label-item single-overflow pull-left" title="项目定义编码:">项目定义编码:</label>
-                                    <form:input path="projectId" htmlEscape="false"  class=" form-control"/>
+                                    <label class="label-item single-overflow pull-left" title="项目定义:">项目定义号:</label>
+                                    <form:input path="projectId" htmlEscape="false" maxlength="100"  class=" form-control"/>
                                 </div>
                                 <div class="col-xs-12 col-sm-6 col-md-4">
+                                    <label class="label-item single-overflow pull-left" title="项目名称:">项目名称:</label>
+                                    <form:input path="projectName" htmlEscape="false" maxlength="100"  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>
@@ -53,6 +67,21 @@
                     </div>
                     <!-- 工具栏 -->
                     <div id="toolbar">
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:edit">--%>
+                        <%--<button id="edit" class="btn btn-primary" onclick="edit()">--%>
+                        <%--<i class="glyphicon glyphicon-edit"></i> 修改--%>
+                        <%--</button>--%>
+                        <%--</shiro:hasPermission>--%>
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:import">--%>
+                        <%--<button id="btnImport" class="btn btn-info">--%>
+                        <%--<i class="fa fa-folder-open-o"></i> 导入--%>
+                        <%--</button>--%>
+                        <%--</shiro:hasPermission>--%>
+                        <%--<shiro:hasPermission name="sg:managementcenter:project:basicInformation:export">--%>
+                        <button id="btnExport" class="btn btn-warning">
+                            <i class="fa fa-file-excel-o"></i> 导出
+                        </button>
+                        <%--</shiro:hasPermission>--%>
                     </div>
                     <!-- 表格 -->
                     <table id="settTable" data-toolbar="#toolbar" class="table"></table>