代码更新
This commit is contained in:
@@ -83,11 +83,22 @@ public class DeviceScrapServiceImpl implements DeviceScrapService {
|
|||||||
|
|
||||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
||||||
WQLObject lifeTab = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle");
|
WQLObject lifeTab = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle");
|
||||||
|
WQLObject mainTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养单
|
||||||
|
WQLObject reTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单
|
||||||
|
|
||||||
// 更新设备档案表状态为报废
|
// 更新设备档案表状态为报废
|
||||||
JSONObject json = fileTab.query("devicerecord_id ='" + devicerecord_id + "' and is_delete = '0'").uniqueResult(0);
|
JSONObject json = fileTab.query("devicerecord_id ='" + devicerecord_id + "' and is_delete = '0'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(json)) throw new BootstrapMethodError("档案已被删除");
|
if (ObjectUtil.isEmpty(json)) throw new BootstrapMethodError("档案已被删除");
|
||||||
|
|
||||||
|
String status = json.getString("status");
|
||||||
|
if (StrUtil.equals(status, "11")) {
|
||||||
|
// 需完成保养单或者维修单
|
||||||
|
JSONObject jsonMain = mainTab.query("devicerecord_id = '" + devicerecord_id + "' and is_delete = '0' and invstatus = '99'").uniqueResult(0);
|
||||||
|
JSONObject jsonRe = reTab.query("devicerecord_id = '" + devicerecord_id + "' and is_delete = '0' and invstatus = '99'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonMain) || ObjectUtil.isEmpty(jsonRe)) {
|
||||||
|
throw new BadRequestException("保养单或维修单未完成");
|
||||||
|
}
|
||||||
|
}
|
||||||
json.put("status", "90");
|
json.put("status", "90");
|
||||||
json.put("update_optid", currentUserId);
|
json.put("update_optid", currentUserId);
|
||||||
json.put("update_optname", nickName);
|
json.put("update_optname", nickName);
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ public class DevicerunrecordServiceImpl implements DevicerunrecordService {
|
|||||||
String run_date = whereJson.getString("run_date");
|
String run_date = whereJson.getString("run_date");
|
||||||
|
|
||||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + devicerecord_id + "'").uniqueResult(0);
|
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + devicerecord_id + "'").uniqueResult(0);
|
||||||
|
String status = jsonFile.getString("status");
|
||||||
|
if (!"10,11,20,30,40".contains(status)) {
|
||||||
|
throw new BadRequestException("此设备不能填报");
|
||||||
|
}
|
||||||
|
|
||||||
double run_times = whereJson.getDoubleValue("run_times"); //生产时间
|
double run_times = whereJson.getDoubleValue("run_times"); //生产时间
|
||||||
double prepare_times = whereJson.getDoubleValue("prepare_times");//准备时间
|
double prepare_times = whereJson.getDoubleValue("prepare_times");//准备时间
|
||||||
@@ -185,6 +189,9 @@ public class DevicerunrecordServiceImpl implements DevicerunrecordService {
|
|||||||
json.put("oee_value", 0);
|
json.put("oee_value", 0);
|
||||||
}
|
}
|
||||||
tab.update(json);
|
tab.update(json);
|
||||||
|
String run_date = json.getString("run_date");
|
||||||
|
JSONArray jsonMst = tab.query("devicerecord_id = '" + devicerecord_id + "' and run_date = '" + run_date + "'").getResultJSONArray(0);
|
||||||
|
if (jsonMst.size() > 1) throw new BadRequestException("填报信息已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
label-suffix=":"
|
label-suffix=":"
|
||||||
>
|
>
|
||||||
<el-form-item label="填报日期">
|
<el-form-item label="填报日期">
|
||||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类别">
|
<el-form-item label="设备类别">
|
||||||
<treeselect
|
<treeselect
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
label-suffix=":"
|
label-suffix=":"
|
||||||
>
|
>
|
||||||
<el-form-item label="启用日期">
|
<el-form-item label="启用日期">
|
||||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类别">
|
<el-form-item label="设备类别">
|
||||||
<treeselect
|
<treeselect
|
||||||
@@ -266,9 +266,9 @@ export default {
|
|||||||
scrap() {
|
scrap() {
|
||||||
const _selectData = this.$refs.table.selection
|
const _selectData = this.$refs.table.selection
|
||||||
const data = _selectData[0]
|
const data = _selectData[0]
|
||||||
if (data.is_active !== '1') {
|
// if (data.status !== '10') {
|
||||||
return this.crud.notify('设备未启用或不存在', CRUD.NOTIFICATION_TYPE.INFO)
|
// return this.crud.notify('设备未启用或不存在', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
}
|
// }
|
||||||
if (data.device_is_delete === '1') {
|
if (data.device_is_delete === '1') {
|
||||||
return this.crud.notify('设备不存在或被删除', CRUD.NOTIFICATION_TYPE.INFO)
|
return this.crud.notify('设备不存在或被删除', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user