Commit d627b56b by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/baosight/hggp/common/DdynamicEnum.java
#	src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
parents 399da434 58b70e01
......@@ -74,6 +74,14 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID("invent_record_block_id","inventCode","inventName","HGPZ005.queryComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
* 编写:
*/
INVENT_ALL_BLOCK_ID("invent_all_block_id", "id", "spec", "material", "unit", "length", "width", "thick",
"coefficient", "HGPZ005.queryComboBoxAll"),
/**
* 模块:规格(无ID)
* 用途:存货档案下拉框
* 编写:
......
......@@ -220,7 +220,7 @@ public class ServiceHGPZ004 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框")
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "父级下拉框")
public EiInfo queryParComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
......@@ -232,4 +232,6 @@ public class ServiceHGPZ004 extends ServiceBase {
return inInfo;
}
}
......@@ -19,10 +19,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 存货档案
......@@ -223,4 +220,41 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryComboBoxAll(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_ALL_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
}
......@@ -7,10 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -21,10 +18,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 仓库档案
......@@ -218,4 +212,22 @@ public class ServiceHGPZ007 extends ServiceBase {
return inInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "仓库档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.WH_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ010;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
......@@ -19,6 +21,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -41,6 +44,9 @@ public class ServiceHGPZ010 extends ServiceBase {
@OperationLogAnnotation(operModul = "库存预警", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_TYPE_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -298,6 +298,24 @@
ORDER BY INVENT_CODE
</select>
<!-- 缺省下拉框 -->
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
ID AS "id",
(CASE WHEN SPEC = '' THEN '无规格' ELSE SPEC END) AS "spec",
LENGTH AS "length" , <!-- 长 -->
WIDTH AS "width" , <!-- 宽 -->
THICK AS "thick" , <!-- 厚 -->
COEFFICIENT AS "coefficient" , <!-- 系数 -->
MATERIAL AS "material" , <!-- 材质 -->
UNIT AS "unit" <!-- 单位 -->
FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0
AND STATUS = 1
<include refid="condition"/>
ORDER BY ID
</select>
<!-- 规格下拉框(无ID) -->
<select id="queryComboBoxSpecName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
......@@ -233,8 +233,7 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ010 WHERE
ID = #id#
UPDATE ${hggpSchema}.HGPZ010 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
......
......@@ -168,7 +168,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
PURCHASE_DATE desc,MAINTAIN_DATE desc,ID asc
PURCHASE_DATE desc,CREATED_TIME DESC,ID asc
</isEmpty>
</dynamic>
......
let InventNameGlobalData = [];
let WhNameGlobalData = [];
let inventAllGlobalData = [];
$(function() {
// 查询
......@@ -9,6 +12,85 @@ $(function() {
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "whCode",
template: function (dataItem) {
for (let i = 0; i < WhNameGlobalData.length; i++) {
if (WhNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return WhNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whType", options.model["whType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return InventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventRecordId",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBoxAll");
inInfo.set("blockId", "invent_all_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param2Field'];
}
}
return "";
}
},{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
......@@ -19,6 +101,22 @@ $(function() {
return showUserName(options.updatedBy, options.updatedName);
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
}
}
}
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
......@@ -45,6 +143,9 @@ $(function() {
$(window).load(function () {
// 查询
query();
initWh();
initInvent();
initSpec();
});
/**
......@@ -55,6 +156,50 @@ let query = function () {
}
/**
* 初始化存货
*/
let initWh = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
WhNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) {
InventNameGlobalData = ei.getBlock("invent_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 保存
*/
let save = function () {
......@@ -65,45 +210,39 @@ let save = function () {
}
let flag = true;
$.each(rows, function(index, item) {
let custType= item.get("custType");
let custName= item.get("custName");
let companyName= item.get("companyName");
let headName= item.get("headName");
let phoneName= item.get("phoneName");
let address= item.get("address");
let status= item.get("status");
if(isBlank(custType)){
message("选中的第"+(index+1)+"行\"供应商类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(custName)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
let whType= item.get("whType");
let whCode= item.get("whCode");
let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let inventRecordId= item.get("inventRecordId");
let warnNum= item.get("warnNum");
if(isBlank(whType)){
message("选中的第"+(index+1)+"行\"仓库类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(companyName)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(headName)){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(phoneName)){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(address)){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
if(isBlank(inventRecordId)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
if(!isPositiveInteger(warnNum)){
message("选中的第"+(index+1)+"行\"预警值\",必须是大于0的整数!");
flag = false;
return false;
}
......
......@@ -15,7 +15,7 @@
<EF:EFSelect cname="仓库类型" blockId="inqu_status" ename="whType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_type_record_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="wh_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -23,11 +23,17 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
<EF:EFComboColumn ename="whType" cname="仓库类型" width="120" align="center" required="true"
blockName="wh_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
......
......@@ -9,8 +9,12 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="设备台账">
<EF:EFRegion id="inqu" title="查询条件">
......@@ -68,7 +72,7 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="maintainDate" cname="保养日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFComboColumn ename="deviceUserId" cname="设备负责人"
<EF:EFComboColumn ename="deviceUserId" cname="设备负责人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
......
......@@ -9,8 +9,13 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="设备计划">
<EF:EFRegion id="inqu" title="查询条件">
......@@ -67,7 +72,7 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFComboColumn ename="planUserId" cname="计划人"
<EF:EFComboColumn ename="planUserId" cname="计划人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
......
......@@ -9,8 +9,12 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="设备维修申请">
<EF:EFRegion id="inqu" title="查询条件">
......@@ -52,7 +56,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="160" align="center"/>
<EF:EFComboColumn ename="applyUserId" cname="申请人"
<EF:EFComboColumn ename="applyUserId" cname="申请人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment