Commit dd9952e8 by liuyang

2024-10-12

1.设备点检和设备保养,增加增行功能,可以手工录入
parent db7a2fae
package com.baosight.hpjx.hp.sb.domain; package com.baosight.hpjx.hp.sb.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
...@@ -530,11 +531,11 @@ public class HPSB006 extends DaoEPBase { ...@@ -530,11 +531,11 @@ public class HPSB006 extends DaoEPBase {
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode)); setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName)); setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setInspecDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_DATE)), inspecDate)); setInspecDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_INSPEC_DATE))), inspecDate));
setInspecCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_CODE)), inspecCode)); setInspecCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_CODE)), inspecCode));
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode)); setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate)); setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_PLAN_START_DATE))), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate)); setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_PLAN_END_DATE))), planEndDate));
setInspecUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_ID)), inspecUserId)); setInspecUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_ID)), inspecUserId));
setInspecUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_NAME)), inspecUserName)); setInspecUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSPEC_USER_NAME)), inspecUserName));
setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus)); setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus));
......
package com.baosight.hpjx.hp.sb.domain; package com.baosight.hpjx.hp.sb.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
...@@ -530,11 +531,11 @@ public class HPSB007 extends DaoEPBase { ...@@ -530,11 +531,11 @@ public class HPSB007 extends DaoEPBase {
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode)); setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName)); setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setUpkeepDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_DATE)), upkeepDate)); setUpkeepDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_UPKEEP_DATE))), upkeepDate));
setUpkeepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_CODE)), upkeepCode)); setUpkeepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_CODE)), upkeepCode));
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode)); setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate)); setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_PLAN_START_DATE))), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate)); setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_PLAN_END_DATE))), planEndDate));
setUpkeepUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_USER_ID)), upkeepUserId)); setUpkeepUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_USER_ID)), upkeepUserId));
setUpkeepUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_USER_NAME)), upkeepUserName)); setUpkeepUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPKEEP_USER_NAME)), upkeepUserName));
setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus)); setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus));
......
...@@ -127,7 +127,7 @@ public class ServiceHPSB007 extends ServiceEPBase { ...@@ -127,7 +127,7 @@ public class ServiceHPSB007 extends ServiceEPBase {
*/ */
public void add(HPSB007 hgsb005) { public void add(HPSB007 hgsb005) {
//生成保养单号 //生成保养单号
hgsb005.setUpkeepDate(SequenceGenerator.getNextSequence(HPConstant.SequenceId.UPKEEP_CODE)); hgsb005.setUpkeepCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.UPKEEP_CODE));
DaoUtils.insert(HPSB007.INSERT, hgsb005); DaoUtils.insert(HPSB007.INSERT, hgsb005);
} }
......
...@@ -340,15 +340,14 @@ ...@@ -340,15 +340,14 @@
<select id="queryFactoryCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryFactoryCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT SELECT
FACTORY_CODE as "factoryCode", ORG_ID as "factoryCode",
FACTORY_NAME as "factoryName" ORG_CNAME as "factoryName"
FROM ${platSchema}.txsog01 FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' AND FACTORY_CODE IS NOT NULL WHERE IS_DELETED = '0' AND FACTORY_CODE IS NOT NULL AND ORG_TYPE = 'factory'
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
<!--and ORG_ID IN (<include refid="queryLoginNameBase"/>)--> <!--and ORG_ID IN (<include refid="queryLoginNameBase"/>)-->
</isNotEmpty> </isNotEmpty>
group by FACTORY_CODE,FACTORY_NAME
</select> </select>
<select id="queryGroupCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryGroupCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
...@@ -208,27 +208,29 @@ ...@@ -208,27 +208,29 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSB007 (ID, <!-- ID --> INSERT INTO ${hpjxSchema}.T_HPSB007 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 --> UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 --> UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 --> UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 --> DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FACTORY_CODE, <!-- 工厂代码 --> FACTORY_CODE, <!-- 工厂代码 -->
FACTORY_NAME, <!-- 工厂名称 --> FACTORY_NAME, <!-- 工厂名称 -->
UPKEEP_DATE, <!-- 保养日期 --> UPKEEP_DATE, <!-- 保养日期 -->
UPKEEP_CODE, <!-- 保养单号 --> UPKEEP_CODE, <!-- 保养单号 -->
PLAN_CODE, <!-- 计划单号 --> PLAN_CODE, <!-- 计划单号 -->
PLAN_START_DATE, <!-- 计划开始日期 --> PLAN_START_DATE, <!-- 计划开始日期 -->
PLAN_END_DATE, <!-- 计划结束日期 --> PLAN_END_DATE, <!-- 计划结束日期 -->
UPKEEP_USER_ID, <!-- 保养人编码 --> UPKEEP_USER_ID, <!-- 保养人编码 -->
UPKEEP_USER_NAME, <!-- 保养人名称 --> UPKEEP_USER_NAME, <!-- 保养人名称 -->
CHECK_STATUS <!-- 审核状态 0-停止 1-启用 --> CHECK_STATUS <!-- 审核状态 0-停止 1-启用 -->
) )
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #upkeepDate#, #upkeepCode#, #planCode#, #planStartDate#, #planEndDate#, #upkeepUserId#, #upkeepUserName#, #checkStatus#) VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #upkeepDate#, #upkeepCode#, #planCode#,
#planStartDate#, #planEndDate#, #upkeepUserId#, #upkeepUserName#, #checkStatus#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="userIdBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="userIdBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" enable="false" readonly="false" required="true" defaultValue="1"> <EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" enable="false"
readonly="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpsb.approveStatus"/> <EF:EFCodeOption codeName="hpjx.hpsb.approveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" <%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
......
...@@ -84,10 +84,17 @@ $(function () { ...@@ -84,10 +84,17 @@ $(function () {
if (e.field === "deviceType") { if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode"); loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") { }else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){ for (let i = 0; i < deviceCodeBox.length; i++) {
loadChange(grid,e,"deviceType"); if (deviceCodeBox[i]['valueField'] === e.items[0]['deviceCode']){
resultGrid.setCellValue(e.items[0],"deviceName",deviceCodeBox[i]['textField']);
resultGrid.setCellValue(e.items[0],"groupCode",deviceCodeBox[i]['param3Field']);
if (e.items[0].deviceType.length===0){
resultGrid.setCellValue(e.items[0],"deviceType",deviceCodeBox[i]['param1Field']);
}
break;
}
} }
//loadChange(grid,e,"userId"); loadChange(grid,e,"checkItem");
} }
}); });
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<EF:EFPage title="设备点检详情"> <EF:EFPage title="设备点检详情">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂名称" colWidth="3" filter="contains" readonly="true">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/> <EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="groupCode" cname="设备区域" hidden="true"/>
<EF:EFColumn ename="groupName" cname="设备区域名称" hidden="true"/>
<EF:EFComboColumn ename="deviceType" cname="设备类型" <EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
......
...@@ -217,14 +217,14 @@ let save = function (btnNode) { ...@@ -217,14 +217,14 @@ let save = function (btnNode) {
} }
let flag = true; let flag = true;
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let companyCode= item.get("companyCode"); let factoryCode= item.get("factoryCode");
let upkeepDate= item.get("upkeepDate"); let upkeepDate= item.get("upkeepDate");
let planStartDate= item.get("planStartDate"); let planStartDate= item.get("planStartDate");
let planEndDate= item.get("planEndDate"); let planEndDate= item.get("planEndDate");
let upkeepUserId= item.get("upkeepUserId"); let upkeepUserId= item.get("upkeepUserId");
let checkStatus= item.get("checkStatus"); let checkStatus= item.get("checkStatus");
if(isBlank(companyCode)){ if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!"); message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false; flag = false;
return false; return false;
} }
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="userIdBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="userIdBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" enable="false" required="true" defaultValue="1"> <EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" enable="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpsb.approveStatus"/> <EF:EFCodeOption codeName="hpjx.hpsb.approveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" <%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
......
...@@ -78,10 +78,17 @@ $(function () { ...@@ -78,10 +78,17 @@ $(function () {
if (e.field === "deviceType") { if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode"); loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") { }else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){ for (let i = 0; i < deviceCodeBox.length; i++) {
loadChange(grid,e,"deviceType"); if (deviceCodeBox[i]['valueField'] === e.items[0]['deviceCode']){
resultGrid.setCellValue(e.items[0],"deviceName",deviceCodeBox[i]['textField']);
resultGrid.setCellValue(e.items[0],"groupCode",deviceCodeBox[i]['param3Field']);
if (e.items[0].deviceType.length===0){
resultGrid.setCellValue(e.items[0],"deviceType",deviceCodeBox[i]['param1Field']);
}
break;
}
} }
//loadChange(grid,e,"userId"); loadChange(grid,e,"checkItem");
} }
}); });
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<EF:EFPage title="设备保养详情"> <EF:EFPage title="设备保养详情">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂名称" colWidth="3" filter="contains" readonly="true">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/> <EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="groupCode" cname="设备区域" hidden="true"/>
<EF:EFColumn ename="groupName" cname="设备区域名称" hidden="true"/>
<EF:EFComboColumn ename="deviceType" cname="设备类型" <EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
......
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