소스 검색

物料详细页中对已完成领退料的物料进行屏蔽,不予展示修改按钮
数据源同步栏目独立,显示每次导入情况记录,记录导入如,同步时间

yue 5 년 전
부모
커밋
d6527c65e3

+ 46 - 0
src/main/java/com/jeeplus/modules/sg/record/entity/Record.java

@@ -0,0 +1,46 @@
+package com.jeeplus.modules.sg.record.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class Record extends DataEntity<Record> {
+    //记录导入综合信息表是否完成
+    private String information;
+    //记录导入甲供材表是否完成
+    private String material;
+    //导入人
+    private String importUser;
+    //同步时间
+    private String importDate;
+
+    public String getInformation() {
+        return information;
+    }
+
+    public void setInformation(String information) {
+        this.information = information;
+    }
+
+    public String getMaterial() {
+        return material;
+    }
+
+    public void setMaterial(String material) {
+        this.material = material;
+    }
+
+    public String getImportUser() {
+        return importUser;
+    }
+
+    public void setImportUser(String importUser) {
+        this.importUser = importUser;
+    }
+
+    public String getImportDate() {
+        return importDate;
+    }
+
+    public void setImportDate(String importDate) {
+        this.importDate = importDate;
+    }
+}

+ 25 - 0
src/main/java/com/jeeplus/modules/sg/record/mapper/RecordMapper.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.record.mapper;
+
+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 com.jeeplus.modules.sg.record.entity.Record;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目管理MAPPER接口
+ * @author
+ * @version
+ */
+@MyBatisMapper
+public interface RecordMapper extends BaseMapper<Record> {
+
+}

+ 70 - 0
src/main/java/com/jeeplus/modules/sg/record/mapper/xml/RecordMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.sg.record.mapper.RecordMapper">
+
+    <sql id="recordColumns">
+		id,
+		information,
+		material,
+		importUser,
+		importDate
+	</sql>
+
+	<select id="get" resultType="Record" >
+		SELECT
+		<include refid="recordColumns"/>
+		FROM project_record a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="Record" >
+		SELECT
+		<include refid="recordColumns"/>
+		FROM project_record a
+<!--		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+			<if test="tuser != null and tuser.id != null and tuser.id != ''">
+				AND a.user_id = #{tuser.id}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="sex != null and sex != ''">
+				AND a.sex = #{sex}
+			</if>
+			<if test="beginInDate != null and endInDate != null ">
+				AND a.in_date BETWEEN #{beginInDate} AND #{endInDate}
+			</if>
+		</where>-->
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findAllList" resultType="Record" >
+		SELECT
+		<include refid="recordColumns"/>
+		FROM project_record a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+</mapper>

+ 49 - 0
src/main/java/com/jeeplus/modules/sg/record/service/RecordService.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.record.service;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.information.entity.Information;
+import com.jeeplus.modules.sg.material.entity.Material;
+import com.jeeplus.modules.sg.material.mapper.MaterialMapper;
+import com.jeeplus.modules.sg.record.entity.Record;
+import com.jeeplus.modules.sg.record.mapper.RecordMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 项目管理Service
+ * @author
+ * @version
+ */
+@Service
+@Transactional(readOnly = true)
+public class RecordService extends CrudService<RecordMapper, Record> {
+
+	@Autowired
+	private RecordMapper recordMapper;
+
+	public Record get(String id) {
+		Record record = super.get(id);
+		return record;
+	}
+
+	public List<Record> findList(Record record) {
+		return super.findList(record);
+	}
+
+	public Page<Record> findPage(Page<Record> page, Record entity) {
+		return super.findPage(page, entity);
+	}
+
+	@Override
+	public List<Record> findListBy(List<Record> entity) {
+		return super.findListBy(entity);
+	}
+
+}

+ 77 - 0
src/main/java/com/jeeplus/modules/sg/record/web/RecordController.java

@@ -0,0 +1,77 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.record.web;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.information.entity.Information;
+import com.jeeplus.modules.sg.information.service.InformationService;
+import com.jeeplus.modules.sg.material.entity.Material;
+import com.jeeplus.modules.sg.material.service.MaterialService;
+import com.jeeplus.modules.sg.record.entity.Record;
+import com.jeeplus.modules.sg.record.service.RecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+/**
+ * 项目管理列表Controller
+ * @author
+ * @version
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/sg/record")
+public class RecordController extends BaseController {
+
+	@Autowired
+	private InformationService informationService;
+	@Autowired
+	private RecordService recordService;
+
+	@ModelAttribute
+	public Record get(@RequestParam(required=false) String id) {
+		Record entity = null;
+		if (StringUtils.isNotBlank(id)){
+			recordService.get(id);
+		}
+		if (entity == null){
+			entity = new Record();
+		}
+		return entity;
+	}
+
+	/**
+	 * 项目管理列表页
+	 */
+//	@RequiresPermissions("modules:sg:information:information:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(Record record, Model model) {
+		model.addAttribute("recordList", record);
+		return "modules/sg/record/recordList";
+	}
+
+		/**
+	 * 项目管理列表数据
+	 */
+	@ResponseBody
+//	@RequiresPermissions("modules:sg:information:information:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(Record record, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<Record> page = recordService.findPage(new Page<Record>(request, response), record);
+		return getBootstrapData(page);
+	}
+
+
+}
+
+

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

@@ -75,6 +75,7 @@
 	
 	<!-- 工具栏 -->
 	<div id="toolbar">
+		<input id="excelFile" type="file" value="导入综合信息表" class="btn btn-info">
 		<shiro:hasPermission name="modules:sg:information:information:import">
 			<button id="btnCom" class="btn btn-info">
 				<i class="fa fa-folder-open-o"></i> 导入综合信息表

+ 159 - 0
src/main/webapp/webpage/modules/sg/record/recordList.js

@@ -0,0 +1,159 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+
+$(document).ready(function() {
+
+	$('#informationTable').bootstrapTable({
+
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	       		showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+               cache: false,
+               //是否显示分页(*)
+               pagination: true,
+                //排序方式
+               sortOrder: "asc",
+               //初始化加载第一页,默认第一页
+               pageNumber:1,
+               //每页的记录行数(*)
+               pageSize: 10,
+               //可供选择的每页的行数(*)
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
+               url: "${ctx}/sg/record/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',
+               ////查询参数,每次调用是会带上这个参数,可自定义
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+			},
+               columns: [ {
+				   field: 'information',
+				   title: '综合信息表是否完成',
+					visible:true
+			   },{
+				   field: 'material',
+				   title: '甲供材表是否完成',
+				   visible:true
+			   },{
+				   field: 'importUser',
+				   title: '导入人',
+				   visible:true
+			   },{
+				   field: 'importDate',
+				   title: '同步时间',
+				   visible:true
+			   }
+
+		     ]
+		});
+
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+		  $('#informationTable').bootstrapTable("toggleView");
+		}
+
+	  $('#informationTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#informationTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#informationTable').bootstrapTable('getSelections').length!=1);
+        });
+
+
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#informationTable').bootstrapTable('refresh');
+		});
+
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $('#informationTable').bootstrapTable('refresh');
+		});
+
+	document.getElementById("btnCom").addEventListener("change",function () {
+		console.log("change");
+		var val = $("#btnCom").val();
+		console.log(val);
+		if (val != '') {
+			$("table:eq(0) tr:eq(1) td:eq(0)").html('完成');
+
+			$("table:eq(0) tr:eq(1) td:eq(1)").text();
+		} else {
+			$("table:eq(0) tr:eq(1) td:eq(0)").html('-');
+		}
+		change()
+	});
+
+	document.getElementById("btnInformation").addEventListener("change",function () {
+		console.log("change");
+		var val = $("#btnInformation").val();
+		console.log(val);
+		if (val != '') {
+			$("table:eq(0) tr:eq(1) td:eq(1)").html('完成');
+		} else {
+			$("table:eq(0) tr:eq(1) td:eq(1)").html('-');
+		}
+		change()
+	});
+
+	function change() {
+		var btnCom = $("table:eq(0) tr:eq(1) td:eq(0)").text();
+		var btnInformation = $("table:eq(0) tr:eq(1) td:eq(1)").text();
+		console.log(btnCom);
+		console.log(btnInformation);
+		if (btnCom == '完成' && btnInformation == '完成') {
+			$('#exportMaterial').css({'display':'block','text-align':'center','margin':'0 auto'});
+		} else {
+			$('#exportMaterial').css('display','none');
+		}
+	}
+
+	});
+
+    //刷新列表
+  function refresh() {
+      $('#informationTable').bootstrapTable('refresh');
+  }
+
+	function addRow(list, idx, tpl, row){
+		$(list).append(Mustache.render(tpl, {
+			idx: idx, delBtn: true, row: row
+		}));
+	}
+
+
+
+
+</script>

+ 94 - 0
src/main/webapp/webpage/modules/sg/record/recordList.jsp

@@ -0,0 +1,94 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>物料情况页</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="recordList.js" %>
+	<style>
+		#record td {
+			border: 1px solid #dedede;
+			text-align: center;
+			margin: 0 auto;
+		}
+	</style>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">物料情况列表</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="record" 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="importUser" 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>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar" style="float: left;display: flex">
+		<shiro:hasPermission name="test:onetomany:dialog:materialList:export">
+			<button id="export" class="btn btn-warning">
+				<i class="fa fa-file-excel-o"></i> 导出
+			</button>
+		</shiro:hasPermission>
+		<form action="/$">
+		<input type="file" id="btnCom" class="btn btn-info" value="导入综合信息表"/>
+		</form>
+		<form action="/$">
+		<input style="margin-left: 10px" type="file" id="btnInformation" class="btn btn-info" value="导入甲供材"/>
+		</form>
+	</div>
+	<table id="record" width="100%" STYLE="border: 1px solid #dedede;">
+		<tr>
+			<td>综合信息表是否完成</td>
+			<td>甲供材表是否完成</td>
+			<td>操作</td>
+		</tr>
+		<tr>
+			<td>-</td>
+			<td>-</td>
+			<td width="100px">
+				<button id="exportMaterial" class="btn btn-warning" style="display: none">
+					<i class="fa fa-file-excel-o"></i> 同步
+				</button>
+			</td>
+		</tr>
+	</table>
+	<!-- 表格 -->
+	<table id="informationTable"   data-toolbar="#toolbar"></table>
+    <!-- context menu -->
+<%--    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:view">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="test:onetomany:dialog:testDataMain1:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  --%>
+	</div>
+	</div>
+	</div>
+</body>
+</html>