Leon 3 years ago
commit a08852be3a

@ -48,6 +48,16 @@ public class AbnormalBillDto extends AbnormalBill {
private String productionCategory;
private String checkUsr;
public String getCheckUsr() {
return checkUsr;
}
public void setCheckUsr(String checkUsr) {
this.checkUsr = checkUsr;
}
public String getSeq() {
return seq;
}

@ -957,11 +957,16 @@
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZANC.ABNORMAL_BILL_BO = ZAB.HANDLE
LEFT JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = 'NCCodeBO:'|| ZAB.SITE || ',' || ZANC.NC_CODE AND NCT.LOCALE = #{language}
LEFT JOIN RESRCE R ON R.RESRCE = ZAB.RESRCE AND R.SITE = ZAB.SITE
LEFT JOIN CUSTOM_FIELDS CFA ON CFA.HANDLE = R.HANDLE AND CFA."ATTRIBUTE" = 'CHECK_USR'
<where>
<if test="abnormalBill != null">
<if test="abnormalBill.site != null and abnormalBill.site != ''">
zab.SITE = #{abnormalBill.site}
</if>
<if test="abnormalBill.checkUsr != null and abnormalBill.checkUsr != ''">
AND CFA.VALUE = #{abnormalBill.checkUsr}
</if>
<if test="abnormalBill.resrce != null and abnormalBill.resrce != ''">
AND zab.RESRCE = #{abnormalBill.resrce}
</if>

@ -703,7 +703,7 @@
AND C3.VALUE LIKE '%'||#{texture}||'%'
</if>
<if test="matSpec != null and matSpec != ''">
AND C4.VALUE LIKE '%'||#{matSpec}||'%'
AND C4.VALUE = #{matSpec}
</if>
<if test="startFromDate != null">
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
@ -1053,7 +1053,7 @@
AND ZCI.REQUIRED_DATE_TIME &lt;= #{requiredToDT}
</if>
<if test="spec != null and spec != ''">
AND CFA.VALUE LIKE '%' || #{spec} || '%'
AND CFA.VALUE = #{spec}
</if>
<if test="texture != null and texture != ''">
AND CFB.VALUE LIKE '%' || #{texture} || '%'
@ -1095,7 +1095,7 @@
AND ZCI.REQUIRED_DATE_TIME &lt;= #{requiredToDT}
</if>
<if test="spec != null and spec != ''">
AND CFA.VALUE LIKE '%' || #{spec} || '%'
AND CFA.VALUE = #{spec}
</if>
<if test="texture != null and texture != ''">
AND CFB.VALUE LIKE '%' || #{texture} || '%'
@ -1152,7 +1152,7 @@
AND MML.STATUS = #{callItem.status}
</if>
<if test="callItem.spec != null and callItem.spec != ''">
AND MML.SPEC LIKE '%' || #{callItem.spec} || '%'
AND MML.SPEC = #{callItem.spec}
</if>
<if test="callItem.texture != null and callItem.texture != ''">
AND MML.TEXTURE LIKE '%' || #{callItem.texture} || '%'

@ -8,6 +8,7 @@ import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -62,6 +63,7 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
@Override
public String parseResourceFaultInfo(String text) {
String user = CommonMethods.getUser();
JSONObject jsonObject = JSONObject.parseObject(text);
String handle = jsonObject.getString("TRANID");
@ -81,6 +83,10 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
logger.error("站点不能为空!");
throw BusinessException.build("站点不能为空!");
}
if (StringUtil.isBlank(faultList)) {
logger.error("故障参数列表不能为空!");
throw BusinessException.build("故障参数列表不能为空!");
}
if (StringUtil.isBlank(resource)) {
logger.error("设备编号不能为空!");
throw BusinessException.build("设备编号不能为空!");
@ -95,13 +101,17 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
List<ResourceFaultReceive> list = new ArrayList<>();
// 故障编码及故障时间
JSONArray jsonArray = JSON.parseArray(faultList);
if (jsonArray == null || jsonArray.size() < 1){
logger.error("设备编号:" + resource + ",故障参数列表不能为空!");
throw BusinessException.build("设备编号:" + resource + ",故障参数列表不能为空!");
}
for (int i = 0; i < jsonArray.size(); i++) {
ResourceFaultReceive resourceFaultReceive = new ResourceFaultReceive();
// 设备编号、站点、创建时间-使用SEND_TIME、创建用户
resourceFaultReceive.setResrce(resource);
resourceFaultReceive.setSite(site);
resourceFaultReceive.setCreatedDateTime(sendDate);
resourceFaultReceive.setCreateUser("SITE_ADMIN");
resourceFaultReceive.setCreateUser(user);
JSONObject jsonObj = (JSONObject) jsonArray.get(i);
String faultCode = jsonObj.getString("FAULT_CODE");

Loading…
Cancel
Save