Commit f670d693 by liuyang

2024-04-30 优化设备管理日志和异常显示数据显示

parent a92aa82a
......@@ -21,6 +21,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.StringJoiner;
public class ServiceHPTCP001 extends ServiceBase {
public EiInfo logAnalysis(EiInfo inInfo) {
......@@ -92,15 +93,37 @@ public class ServiceHPTCP001 extends ServiceBase {
hpsb001.setEquipmentType(hpsb00A.getEquipmentType());
Integer errorCode = Integer.parseInt(cutterbarWarning.getErrorCode());
if(errorCode.compareTo(new Integer(200))>=0 && errorCode.compareTo(new Integer(299))<=0){
hpsb001.setErrorText(String.format("(程序号:%s,行号 %s)goto 跳转行%s 不存在", cutterbarWarning.getProgramNo(),
cutterbarWarning.getRowNo(),cutterbarWarning.getGotoRowNone()));
hpsb002.setLogInivalue(String.format("(程序号:%s,行号 %s)goto 跳转行%s 不存在", cutterbarWarning.getProgramNo(),
cutterbarWarning.getRowNo(),cutterbarWarning.getGotoRowNone()));
hpsb001.setErrorText(stringConcat(cutterbarWarning));
hpsb002.setLogInivalue(stringConcat(cutterbarWarning));
/*String.format("异常编码:%s 异常等级:%s 程序号:%s 文件:%s 行号:%s 跳转行:%s 不存在",
cutterbarWarning.getErrorCode()==null?"":cutterbarWarning.getErrorCode(),
cutterbarWarning.getPrio()==null?"":cutterbarWarning.getPrio(),
cutterbarWarning.getProgramNo()==null?"":cutterbarWarning.getProgramNo(),
cutterbarWarning.getFileName()==null?"":cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()==null?"":cutterbarWarning.getRowNo(),
cutterbarWarning.getGotoRowNone()==null?"":cutterbarWarning.getGotoRowNone());*/
/*hpsb002.setLogInivalue(String.format("异常编码:%s 异常等级:%s 程序号:%s 文件:%s 行号:%s 跳转行:%s 不存在",
cutterbarWarning.getErrorCode()==null?"":cutterbarWarning.getErrorCode(),
cutterbarWarning.getPrio()==null?"":cutterbarWarning.getPrio(),
cutterbarWarning.getProgramNo()==null?"":cutterbarWarning.getProgramNo(),
cutterbarWarning.getFileName()==null?"":cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()==null?"":cutterbarWarning.getRowNo(),
cutterbarWarning.getGotoRowNone()==null?"":cutterbarWarning.getGotoRowNone()));*/
}else if(errorCode.compareTo(new Integer(300))>=0 && errorCode.compareTo(new Integer(399))<=0){
hpsb001.setErrorText(String.format(" (文件:%s,行号 %s)括号不匹配", cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()));
hpsb002.setLogInivalue(String.format(" (文件:%s,行号 %s)括号不匹配", cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()));
hpsb001.setErrorText(stringConcat(cutterbarWarning));
hpsb002.setLogInivalue(stringConcat(cutterbarWarning));
/*hpsb001.setErrorText(String.format("异常编码:%s 异常等级:%s 程序号:%s 文件:%s 行号:%s 不匹配",
cutterbarWarning.getErrorCode()==null?"":cutterbarWarning.getErrorCode(),
cutterbarWarning.getPrio()==null?"":cutterbarWarning.getPrio(),
cutterbarWarning.getProgramNo()==null?"":cutterbarWarning.getProgramNo(),
cutterbarWarning.getFileName()==null?"":cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()==null?"":cutterbarWarning.getRowNo()));
hpsb002.setLogInivalue(String.format("异常编码:%s 异常等级:%s 程序号:%s 文件:%s,行号:%s 不匹配",
cutterbarWarning.getErrorCode()==null?"":cutterbarWarning.getErrorCode(),
cutterbarWarning.getPrio()==null?"":cutterbarWarning.getPrio(),
cutterbarWarning.getProgramNo()==null?"":cutterbarWarning.getProgramNo(),
cutterbarWarning.getFileName()==null?"":cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()==null?"":cutterbarWarning.getRowNo()));*/
}
hpsb001.setCreatedBy("自动化中转程序");
......@@ -141,4 +164,27 @@ public class ServiceHPTCP001 extends ServiceBase {
}
return str;
}
public String stringConcat(CutterbarWarning cutterbarWarning){
StringJoiner sj = new StringJoiner(";");
if (StringUtils.isNotEmpty(cutterbarWarning.getErrorCode())){
sj.add("异常编码:"+cutterbarWarning.getErrorCode());
}
if (StringUtils.isNotEmpty(cutterbarWarning.getPrio())) {
sj.add(" 异常等级:"+cutterbarWarning.getPrio());
}
if (StringUtils.isNotEmpty(cutterbarWarning.getProgramNo())){
sj.add(" 程序号:"+cutterbarWarning.getProgramNo());
}
if (StringUtils.isNotEmpty(cutterbarWarning.getFileName())) {
sj.add(" 文件:"+cutterbarWarning.getFileName());
}
if (StringUtils.isNotEmpty(cutterbarWarning.getRowNo())) {
sj.add(" 行号:"+cutterbarWarning.getRowNo());
}
if (StringUtils.isNotEmpty(cutterbarWarning.getGotoRowNone())){
sj.add(" 跳转行:"+cutterbarWarning.getGotoRowNone());
}
return sj.toString();
}
}
......@@ -24,14 +24,14 @@
<EF:EFComboColumn ename="equipmentCode" cname="设备编码" blockName="deviceCode_block_id"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#"
textField="#=textField#" valueField="valueField"
enable="false" readonly="true" width="100" align="center">
enable="false" readonly="true" width="80" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="errorCode" cname="异常编码" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="prio" cname="数据内容" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="rowno" cname="行号" enable="false" readonly="true" width="30" align="center"/>
<EF:EFColumn ename="gotoRowNone" cname="不存在跳转行" enable="false" readonly="true" width="50" align="center"/>
<EF:EFColumn ename="errorCode" cname="异常编码" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="prio" cname="异常等级" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="fileName" cname="文件名" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="rowno" cname="行号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="gotoRowNone" cname="不存在跳转行" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="errorText" cname="异常文本" width="150" readonly="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="100" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
......
......@@ -17,7 +17,6 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<%--<EF:EFColumn ename="createdBy" cname="操作人" enable="false" readonly="true" width="150" align="center"/>--%>
<EF:EFColumn ename="equipmentType" cname="日志类型" enable="false" readonly="true" width="100" align="center"/>
<EF:EFComboColumn ename="equipmentType" cname="日志类型" enable="false" readonly="true" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hppz.equipmentType" />
</EF:EFComboColumn>
......@@ -26,7 +25,7 @@
textField="#=textField#" valueField="valueField"
enable="false" readonly="true" width="100" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="logInivalue" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="logInivalue" cname="日志内容" enable="false" readonly="true" width="200" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
......
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