Przeglądaj źródła

(1)增加是否完成领退料查询
(2)变更字段显示排序,将完成领退料时间拆分,未完成与完成分开显示
(3)配置超期时间节点

yue 5 lat temu
rodzic
commit
167e0457bf

+ 24 - 0
src/main/java/com/jeeplus/modules/sg/information/entity/constant.java

@@ -0,0 +1,24 @@
+package com.jeeplus.modules.sg.information.entity;
+/**
+ * 用于记录项目中的一些常量存储
+ * */
+public class constant {
+    private String overType;
+    private String overTime;
+
+    public String getOverType() {
+        return overType;
+    }
+
+    public void setOverType(String overType) {
+        this.overType = overType;
+    }
+
+    public String getOverTime() {
+        return overTime;
+    }
+
+    public void setOverTime(String overTime) {
+        this.overTime = overTime;
+    }
+}

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

@@ -7,6 +7,7 @@ import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.entity.append;
+import com.jeeplus.modules.sg.information.entity.constant;
 import com.jeeplus.modules.sg.material.entity.Material;
 import org.apache.ibatis.annotations.Param;
 
@@ -56,4 +57,9 @@ public interface InformationMapper extends BaseMapper<Information> {
 
     //根据页面得到项目定义号
     List<Information> findIdByList(List<Information> list);
+
+    //获取超期时间节点
+    String findOverTime(String overType);
+
+    int updateConstant(constant constant);
 }

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

@@ -520,4 +520,12 @@
 			</foreach>
 		</where>
 	</select>
+
+	<select id="findOverTime" resultType="string">
+		select overTime from project_constant where overType = #{overType} ;
+	</select>
+
+	<update id="updateConstant" parameterType="com.jeeplus.modules.sg.information.entity.constant">
+		update project_constant set overTime = #{overTime} where overType = 'overTime';
+	</update>
 </mapper>

+ 22 - 7
src/main/java/com/jeeplus/modules/sg/information/service/InformationService.java

@@ -9,6 +9,7 @@ import java.util.List;
 
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.entity.append;
+import com.jeeplus.modules.sg.information.entity.constant;
 import com.jeeplus.modules.sg.information.mapper.InformationMapper;
 import com.jeeplus.modules.sg.material.entity.Material;
 import io.swagger.models.auth.In;
@@ -49,13 +50,14 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 		Page<Information> page1 = super.findPage(page, entity);
 		List<Information> list = page1.getList();
+		String find = informationMapper.findOverTime("overTime");
+		int overTime = Integer.parseInt(find);
 		Calendar cal = Calendar.getInstance();
 		long between_days = 0;
 		for (Information in : list) {
 			//判断审定日期是否为空
 //			if (in.getApprovalDate() != null) {
 				//格式化审定日期
-
 				if ("否".equals(in.getFirstFinish()) || "否".equals(in.getSecondFinish())) {
 					in.setComplete("否");
 					if (in.getApprovalDate() != null) {
@@ -77,7 +79,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 								long secondDate = cal.getTimeInMillis();
 								between_days = (secondDate - appDay) / (1000 * 3600 * 24);
 								in.setFinishDate(String.valueOf(between_days) + "天");
-								if (between_days > 14) {
+								if (between_days > overTime) {
 									in.setOverdue("是");
 								} else {
 									in.setOverdue("否");
@@ -87,7 +89,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 								long firstDate = cal.getTimeInMillis();
 								between_days = (firstDate - appDay) / (1000 * 3600 * 24);
 								in.setFinishDate(String.valueOf(between_days) + "天");
-								if (between_days > 14) {
+								if (between_days > overTime) {
 									in.setOverdue("是");
 								} else {
 									in.setOverdue("否");
@@ -163,6 +165,8 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 	public List<Information> exportInfor(List<Information> list) {
 		List<Information> informationList = informationMapper.exportInfor(list);
+		String find = informationMapper.findOverTime("overTime");
+		int overTime = Integer.parseInt(find);
 		Calendar cal = Calendar.getInstance();
 		long between_days = 0;
 		for (Information in : informationList) {
@@ -187,7 +191,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 							long secondDate = cal.getTimeInMillis();
 							between_days = (secondDate - appDay) / (1000 * 3600 * 24);
 							in.setFinishDate(String.valueOf(between_days) + "天");
-							if (between_days > 14) {
+							if (between_days > overTime) {
 								in.setOverdue("是");
 							} else {
 								in.setOverdue("否");
@@ -197,7 +201,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 							long firstDate = cal.getTimeInMillis();
 							between_days = (firstDate - appDay) / (1000 * 3600 * 24);
 							in.setFinishDate(String.valueOf(between_days) + "天");
-							if (between_days > 14) {
+							if (between_days > overTime) {
 								in.setOverdue("是");
 							} else {
 								in.setOverdue("否");
@@ -212,6 +216,8 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 	public List<Information> export(List<Information> list) {
 		List<Information> export = informationMapper.export(list);
+		String find = informationMapper.findOverTime("overTime");
+		int overTime = Integer.parseInt(find);
 		Calendar cal = Calendar.getInstance();
 		long between_days = 0;
 		for (Information in : export) {
@@ -236,7 +242,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 							long secondDate = cal.getTimeInMillis();
 							between_days = (secondDate - appDay) / (1000 * 3600 * 24);
 							in.setFinishDate(String.valueOf(between_days) + "天");
-							if (between_days > 14) {
+							if (between_days > overTime) {
 								in.setOverdue("是");
 							} else {
 								in.setOverdue("否");
@@ -246,7 +252,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 							long firstDate = cal.getTimeInMillis();
 							between_days = (firstDate - appDay) / (1000 * 3600 * 24);
 							in.setFinishDate(String.valueOf(between_days) + "天");
-							if (between_days > 14) {
+							if (between_days > overTime) {
 								in.setOverdue("是");
 							} else {
 								in.setOverdue("否");
@@ -263,4 +269,13 @@ public class InformationService extends CrudService<InformationMapper, Informati
 	public List<Information> findIdByList(List<Information> list) {
 		return informationMapper.findIdByList(list);
 	}
+
+	public String findOverTime(String overType){
+		return informationMapper.findOverTime(overType);
+	}
+
+	@Transactional(readOnly = false)
+	public int updateConstant(constant constant) {
+		return informationMapper.updateConstant(constant);
+	}
 }

+ 22 - 0
src/main/java/com/jeeplus/modules/sg/information/web/InformationController.java

@@ -22,6 +22,7 @@ import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.modules.sg.information.entity.Information;
 import com.jeeplus.modules.sg.information.entity.InformationDto;
 import com.jeeplus.modules.sg.information.entity.append;
+import com.jeeplus.modules.sg.information.entity.constant;
 import com.jeeplus.modules.sg.information.service.InformationService;
 import com.jeeplus.modules.sg.information.utils.FreemarkerUtil;
 import com.jeeplus.modules.sg.information.utils.ImportInformation;
@@ -50,6 +51,7 @@ import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.web.BaseController;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ImportExcel;
+import sun.tools.jconsole.JConsole;
 
 import static org.quartz.jobs.FileScanJob.FILE_NAME;
 
@@ -109,6 +111,26 @@ public class InformationController extends BaseController {
 		return "modules/sg/information/informationForm";
 	}
 
+	//配置超期时间节点页
+	@RequestMapping(value = "editOverTime")
+	public String constant(constant constant, Model model) {
+		String overTime = informationService.findOverTime("overTime");
+		constant.setOverTime(overTime);
+		model.addAttribute("constant", constant);
+		return "modules/sg/information/constantForm";
+	}
+
+	//变更超期时间节点
+	@RequestMapping(value = "updateConstant")
+	@ResponseBody
+	public String updateConstant(constant constant) {
+		int s = informationService.updateConstant(constant);
+		if (s > 0 ) {
+			return "修改成功";
+		} else {
+			return "修改失败";
+		}
+	}
 
 
 

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

@@ -47,5 +47,6 @@ public interface MaterialMapper extends BaseMapper<Material> {
 
     List<Material> findStatus();
 
+    String findNeedBack(String id);
 
 }

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

@@ -316,4 +316,8 @@
     <select id="findStatus" resultType="com.jeeplus.modules.sg.material.entity.Material">
         select * from material_information where status is not null
     </select>
+
+    <select id="findNeedBack" resultType="string">
+        select isBack from material_information where id = #{id};
+    </select>
 </mapper>

+ 3 - 0
src/main/java/com/jeeplus/modules/sg/material/service/MaterialService.java

@@ -114,5 +114,8 @@ public class MaterialService extends CrudService<MaterialMapper, Material> {
 		return materialMapper.findStatus();
 	}
 
+	public String findNeedBack(String id) {
+		return materialMapper.findNeedBack(id);
+	}
 
 }

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

@@ -88,6 +88,18 @@ public class MaterialController extends BaseController {
 			return "修改失败";
 		}
 	}
+
+
+	@RequestMapping(value = "findNeedBack")
+	@ResponseBody
+	public String findNeedBack(String id) {
+		String s = materialService.findNeedBack(id);
+		if (s.equals("是")) {
+			return "是";
+		} else {
+			return "否";
+		}
+	}
 /*
 	*/
 /**

+ 56 - 0
src/main/webapp/webpage/modules/sg/information/constantForm.jsp

@@ -0,0 +1,56 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<script src="/${ctx}/act/rest/js/common/jquery-1.8.3.js"></script>
+	<title>物料详细</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			$("#saveInfo").click(function () {
+				$.ajax({
+					url: "${ctx}/sg/information/updateConstant",
+					type: "post",
+					data: $("form").serialize(),
+					dataType: "text",
+					success: function (data) {
+						console.log(data)
+						if (data == "修改成功") {
+							jp.success("修改成功");
+							jp.getParent().refresh();
+							var index = parent.layer.getFrameIndex(window.name);
+							jp.close(index);
+						} else {
+							jp.error("修改失败");
+							jp.getParent().refresh();
+							var index = parent.layer.getFrameIndex(window.name);
+							jp.close(index)
+						}
+					}
+				});
+			})
+		});
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm"  modelAttribute="constant" method="post" class="form-horizontal">
+		<table class="table table-bordered" style="margin: 0 auto;text-align: center;width: 600px">
+		   <tbody>
+				<tr>
+					<td class="width-35" style="text-align: center;margin: 0 auto">
+						<label class="pull-right"><font color="red">*</font>配置超期时间节点:</label>
+					</td>
+					<td class="width-35" style="text-align: center;margin: 0 auto">
+						<form:input path="overTime"  id="overTime" htmlEscape="false" cssClass="form-control" />
+					</td>
+				</tr>
+				<tr>
+					<td class="width-35" style="text-align: center;margin: 0 auto" colspan="2">
+						<input type="button" id="saveInfo" value="保存"  class="btn btn-primary btn-block btn-lg btn-parsley"/>
+					</td>
+		  		</tr>
+		 	</tbody>
+		</table>
+		</form:form>
+</body>
+</html>

+ 5 - 3
src/main/webapp/webpage/modules/sg/information/informationList.js

@@ -1,8 +1,6 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
 <script>
-
 $(document).ready(function() {
-
 	//定义方法---在bootstrap数据循环中使用,必须定义在bootstrapTable之前
 	window.operateEvents = {
 		'click #TableView': function (e, value, row, index) {
@@ -10,7 +8,6 @@ $(document).ready(function() {
 		}
 	};
 	var h = $(window).height() - 100;
-
 	//bootstrapTable加载数据
 	$('#informationTable').bootstrapTable({
 		  //请求方法
@@ -458,6 +455,10 @@ $(document).ready(function() {
 		jp.downloadFile('${ctx}/sg/information/exportInformation?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits);
 	});
 
+	$("#editOverTime").click(function () {
+		jp.openViewDialog('配置超期时间','${ctx}/sg/information/editOverTime','1000px','800px');
+	});
+
 	// 绑定查询按扭
 	$("#search").click("click", function() {
 		  sessionStorage.removeItem("path");
@@ -480,6 +481,7 @@ $(document).ready(function() {
 
 
 
+
     //刷新列表
   function refresh() {
       $('#informationTable').bootstrapTable('refresh');

+ 3 - 0
src/main/webapp/webpage/modules/sg/information/informationList.jsp

@@ -109,6 +109,9 @@
 		<button id="exportInformation" class="btn btn-warning">
 			<i class="fa fa-file-excel-o"></i> 导出欠供说明
 		</button>
+		<button id="editOverTime" class="btn btn-danger">
+			<i class="fa fa-file-excel-o"></i> 配置超期时间
+		</button>
 		    </div>
 		
 	<!-- 表格 -->

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

@@ -3,7 +3,6 @@
 <html>
 <head>
 	<script src="/${ctx}/act/rest/js/common/jquery-1.8.3.js"></script>
-
 	<title>物料详细</title>
 	<meta name="decorator" content="ani"/>
 	<script type="text/javascript">
@@ -13,7 +12,7 @@
 					url: "${ctx}/sg/material/update",
 					type: "post",
 					data: $("form").serialize(),
-					dataType: "json",
+					dataType: "text",
 					success: function (data) {
 						console.log(data);
 						if (data == "修改成功") {

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

@@ -156,11 +156,17 @@ $(document).ready(function() {
 		});
 
 	function operateFormatter(value, row, index) {
-		return [
-			'<input id="TableView" type="button" value="调整" class="btn btn-default">',
-		].join('');
+		if (row.isBack == "是") {
+
+		} else {
+			return [
+				'<input id="TableView" type="button" value="调整" class="btn btn-default">'
+			].join('');
+		}
 	}
 
+
+
 	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
 		  $('#informationTable').bootstrapTable("toggleView");
 		}