Commit 45307280 by liuyang

2024-05-20 优化设备预警

parent ce891bcb
...@@ -43,6 +43,7 @@ public class HGSB004 extends DaoEPBase { ...@@ -43,6 +43,7 @@ public class HGSB004 extends DaoEPBase {
public static final String FIELD_INSPEC_USER_ID = "inspecUserId"; /* 点检人编码*/ public static final String FIELD_INSPEC_USER_ID = "inspecUserId"; /* 点检人编码*/
public static final String FIELD_INSPEC_USER_NAME = "inspecUserName"; /* 点检人名称*/ public static final String FIELD_INSPEC_USER_NAME = "inspecUserName"; /* 点检人名称*/
public static final String FIELD_CHECK_STATUS = "checkStatus"; /* 审核状态 0-停止 1-启用*/ public static final String FIELD_CHECK_STATUS = "checkStatus"; /* 审核状态 0-停止 1-启用*/
public static final String FIELD_INIT_CHECK_STATUS = "initCheckStatus"; /* 审核状态 0-停止 1-启用*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
......
...@@ -5,7 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,7 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001; import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB002A; import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -18,10 +21,7 @@ import com.baosight.iplat4j.core.resource.I18nMessages; ...@@ -18,10 +21,7 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -81,11 +81,18 @@ public class ServiceHGSB002A extends ServiceEPBase { ...@@ -81,11 +81,18 @@ public class ServiceHGSB002A extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (Map resultRow : resultRows) {
HGSB002A hgsb002a = new HGSB002A(); HGSB002A hgsb002a = new HGSB002A();
hgsb002a.fromMap(resultRows.get(i)); hgsb002a.fromMap(resultRow);
Long parentId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002A.FIELD_PARENT_ID));
HGSB002 hgsb002 = HGSBTools.Hgsb002.get(parentId);
// 任务状态==1抛出异常
if (hgsb002.getTaskStatus()==1) {
String str = hgsb002.getPlanType() == 1?"设备计划已生成点检任务,添加失败":"设备计划已生成保养任务,添加失败";
throw new PlatException(str);
}
if (hgsb002a.getId() == null || hgsb002a.getId() == 0) { if (hgsb002a.getId() == null || hgsb002a.getId() == 0) {
hgsb002a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002A.FIELD_PARENT_ID))); hgsb002a.setParentId(parentId);
this.add(hgsb002a); this.add(hgsb002a);
} else { } else {
this.modify(hgsb002a); this.modify(hgsb002a);
......
...@@ -22,18 +22,19 @@ public class ServiceHGSB006 extends ServiceEPBase { ...@@ -22,18 +22,19 @@ public class ServiceHGSB006 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_INIT_CHECK_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006()); inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
); );
inInfo.getBlock(EiConstant.queryBlock).removeCol(HGSB004.FIELD_CHECK_STATUS);
return inInfo; return inInfo;
} }
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_INIT_CHECK_STATUS, CommonConstant.YesNo.YES_1);
return super.query(inInfo,HGSB006.QUERY,new HGSB006()); return super.query(inInfo,HGSB006.QUERY,new HGSB006());
} }
} }
...@@ -128,15 +128,15 @@ ...@@ -128,15 +128,15 @@
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId# A.DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus"> <isNotEmpty prepend=" AND " property="initCheckStatus">
B.CHECK_STATUS = #checkStatus# B.CHECK_STATUS = #initCheckStatus#
</isNotEmpty> </isNotEmpty>
<!--<isEqual prepend=" AND " property="checkStatus" compareValue="1"> <isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = '' trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual> </isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2"> <isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '') (trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>--> </isEqual>
</sql> </sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB006"> <select id="query" parameterClass="HashMap" resultClass="HGSB006">
......
...@@ -137,12 +137,12 @@ ...@@ -137,12 +137,12 @@
<isNotEmpty prepend=" AND " property="checkStatus"> <isNotEmpty prepend=" AND " property="checkStatus">
B.CHECK_STATUS = #checkStatus# B.CHECK_STATUS = #checkStatus#
</isNotEmpty> </isNotEmpty>
<!--<isEqual prepend=" AND " property="upkeepStatus" compareValue="1"> <isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = '' trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual> </isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2"> <isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '') (trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>--> </isEqual>
</sql> </sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB007"> <select id="query" parameterClass="HashMap" resultClass="HGSB007">
......
...@@ -25,6 +25,16 @@ public class HGSBTools { ...@@ -25,6 +25,16 @@ public class HGSBTools {
*/ */
public static class Hgsb002 { public static class Hgsb002 {
public static HGSB002 get(Long id){
AssertUtils.isNull(id, "设备计划不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSB002.FIELD_ID, id);
queryMap.put(HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGSB002> results = DaoBase.getInstance().query(HGSB002.QUERY, queryMap);
AssertUtils.isEmpty(results, "设备计划不存在");
return results.get(0);
}
/** /**
* 查询设备计划详情 * 查询设备计划详情
* *
......
...@@ -8,12 +8,19 @@ $(function () { ...@@ -8,12 +8,19 @@ $(function () {
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFAutoComplete = { IPLATUI.EFAutoComplete = {
"inqu_status-0-deviceName": { "inqu_status-0-deviceName": {
minLength: 1, minLength: 1,
dataSource: { dataSource: {
pageSize: 10, pageSize: 0,
serverPaging: true, serverPaging: true,
serverFiltering: true serverFiltering: true
} }
......
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date" <EF:EFColumn ename="planDate" cname="计划日期" width="100" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/> <EF:EFColumn ename="planCode" cname="计划单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="planType" cname="计划类型" <EF:EFComboColumn ename="planType" cname="计划类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
......
...@@ -8,6 +8,13 @@ $(function () { ...@@ -8,6 +8,13 @@ $(function () {
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
pageable: { pageable: {
......
...@@ -7,7 +7,14 @@ $(function () { ...@@ -7,7 +7,14 @@ $(function () {
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
$("#BUE_PLAN").on("click",taskResult) $("#BUE_PLAN").on("click",taskResult);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
......
...@@ -7,6 +7,12 @@ $(function () { ...@@ -7,6 +7,12 @@ $(function () {
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
......
...@@ -7,7 +7,14 @@ $(function () { ...@@ -7,7 +7,14 @@ $(function () {
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
$("#BUE_PLAN").on("click",taskResult) $("#BUE_PLAN").on("click",taskResult);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
......
...@@ -4,6 +4,13 @@ $(function () { ...@@ -4,6 +4,13 @@ $(function () {
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
pageable: { pageable: {
......
...@@ -123,7 +123,7 @@ $(function () { ...@@ -123,7 +123,7 @@ $(function () {
template: function (item) { template: function (item) {
let earlyStatus; let earlyStatus;
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){ if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
earlyStatus = "<span>已完成</span>";; earlyStatus = "<span>已完成</span>";
}else if (item.remainderDays == 0){ }else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>保养期</span>"; earlyStatus = "<span style='color: #67c20b'>保养期</span>";
}else if (item.remainderDays < 0){ }else if (item.remainderDays < 0){
......
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