代码更新

This commit is contained in:
2022-09-29 10:48:52 +08:00
parent 2b53710d83
commit 91263261be
10 changed files with 103 additions and 15 deletions

View File

@@ -62,6 +62,7 @@
WHERE
mst.is_delete = '0'
AND file.is_delete = '0'
AND ISNULL(MST.is_passed)
OPTION 输入.device_code <> ""
(file.device_code like 输入.device_code or

View File

@@ -75,14 +75,43 @@ public class DevicefaultcaeServiceImpl implements DevicefaultcaeService {
}
JSONObject json = WQL.getWO("EM_DEVICEFAULTCAE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "re.devicerecord_id DESC");
// 处理平均故障间隔时间 && 平均故障修复时间
WQLObject tab = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest");
/* // 处理平均故障间隔时间 && 平均故障修复时间
WQLObject tab = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest");*/
JSONArray content = json.getJSONArray("content");
for (int i = 0; i < content.size(); i++) {
JSONObject jsonObject = content.getJSONObject(i);
String devicerecord_id = jsonObject.getString("devicerecord_id");
JSONArray arr = tab.query("devicerecord_id = '" + devicerecord_id + "' and is_delete = '0'").getResultJSONArray(0);
/*
* 平均故障间隔时间:运行时间/故障次数(运行时间查运行记录表,故障次数查报修单)
* 平均故障修复时间:故障时间/故障次数(故障时间查运行记录表)
*/
// 根据此设备查询运行记录表计算 运行时间和故障时间
map.put("flag", "4");
map.put("devicerecord_id", devicerecord_id);
JSONObject runAndErr_time = WQL.getWO("EM_DEVICEFAULTCAE01").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(runAndErr_time)) {
String run_times = runAndErr_time.getString("run_times"); // 运行时间
String error_times = runAndErr_time.getString("error_times"); // 故障时间时间
String error_num = jsonObject.getString("nunm"); // 故障次数
try {
// 计算平均故障间隔时间
String avgVal_time = NumberUtil.div(NumberUtil.div(run_times, error_num).toString(), "60").toString();
jsonObject.put("avgVal_time",NumberUtil.round(avgVal_time,2).toString());
} catch (Exception e) {
jsonObject.put("avgVal_time","0");
}
try {
// 平均故障修复时间
String avgRep_time = NumberUtil.div(NumberUtil.div(error_times, error_num).toString(), "60").toString();
jsonObject.put("avgRep_time",NumberUtil.round(avgRep_time,2).toString());
} catch (Exception e) {
jsonObject.put("avgRep_time","0");
}
}
/*JSONArray arr = tab.query("devicerecord_id = '" + devicerecord_id + "' and is_delete = '0'").getResultJSONArray(0);
// 计算平均故障修复时间
String nunm = jsonObject.getString("nunm");
String create_time_all = "0";
@@ -114,7 +143,7 @@ public class DevicefaultcaeServiceImpl implements DevicefaultcaeService {
BigDecimal add = NumberUtil.add(NumberUtil.sub(re_end_time, re_begin_time).toString(), "1");
BigDecimal avgVal_time = NumberUtil.div(NumberUtil.mul(add, 24).toString(), nunm);
jsonObject.put("avgVal_time",avgVal_time.toString());
jsonObject.put("avgVal_time",avgVal_time.toString());*/
}
json.put("content",content);
return json;

View File

@@ -144,6 +144,34 @@
WHERE
is_delete = '0'
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "4"
QUERY
SELECT
SUM(re.run_times) AS run_times,
SUM(re.error_times) AS error_times
FROM
EM_BI_DeviceRunRecord re
WHERE
1=1
OPTION 输入.devicerecord_id <> ""
re.devicerecord_id = 输入.devicerecord_id
ENDOPTION
OPTION 输入.begin_time <> ""
re.run_date >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
re.run_date <= 输入.end_time
ENDOPTION
group by re.devicerecord_id
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -141,13 +141,15 @@
</el-card>
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" @tableChanged1="tableChanged1"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1"/>
</el-dialog>
</template>
<script>
const defaultForm = {
device_code: null,
material_type_id: null,
repair_code: null,
devicerecord_id: null,
maintenancecycle: '02',
@@ -244,6 +246,7 @@ export default {
this.deviceDialog = true
},
putItem() {
this.openParam = this.form
this.itemDialog = true
},
tableChanged1(row) {
@@ -267,7 +270,8 @@ export default {
},
tableChanged2(row) {
this.form.devicerecord_id = row.devicerecord_id
this.form.device_code = row.device_code
this.form.material_type_id = row.material_type_id
this.form.device_code = row.device_name + '-' + row.device_code
},
delRow(index, rows) {
rows.splice(index, 1)

View File

@@ -139,13 +139,15 @@
</el-card>
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" @tableChanged1="tableChanged1"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1"/>
</el-dialog>
</template>
<script>
const defaultForm = {
material_type_id: null,
device_code: null,
repair_plan_code: null,
repair_plan_name: null,
devicerecord_id: null,
@@ -236,6 +238,7 @@ export default {
this.deviceDialog = true
},
putItem() {
this.openParam = this.form
this.itemDialog = true
},
tableChanged1(row) {
@@ -259,7 +262,8 @@ export default {
},
tableChanged2(row) {
this.form.devicerecord_id = row.devicerecord_id
this.form.device_code = row.device_code
this.form.material_type_id = row.material_type_id
this.form.device_code = row.device_name + '-' + row.device_code
},
delRow(index, rows) {
rows.splice(index, 1)

View File

@@ -142,7 +142,7 @@
</el-card>
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" @tableChanged1="tableChanged1"/>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1"/>
</el-dialog>
</template>
@@ -209,6 +209,7 @@ export default {
this.deviceDialog = true
},
putItem() {
this.openParam = this.form1
this.itemDialog = true
},
tableChanged1(row) {
@@ -232,7 +233,8 @@ export default {
},
tableChanged2(row) {
this.form1.devicerecord_id = row.devicerecord_id
this.form1.device_code = row.device_code
this.form1.material_type_id = row.material_type_id
this.form1.device_code = row.device_name + '-' + row.device_code
},
delRow(index, rows) {
rows.splice(index, 1)

View File

@@ -6,6 +6,7 @@
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
@@ -106,6 +107,9 @@ export default {
isSingle: {
type: Boolean,
default: true
},
openParam: {
type: Object
}
},
data() {
@@ -133,11 +137,14 @@ export default {
crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = this.class_idStr
this.crud.toQuery()
this.queryClassId()
})
},
methods: {
open() {
this.query.material_type_id = this.openParam.material_type_id
this.crud.toQuery()
},
clickChange(item) {
this.tableRadio = item
},

View File

@@ -6,6 +6,7 @@
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
@@ -103,6 +104,9 @@ export default {
isSingle: {
type: Boolean,
default: true
},
openParam: {
type: Object
}
},
data() {
@@ -133,7 +137,6 @@ export default {
crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = this.class_idStr
this.crud.toQuery()
this.queryClassId()
})
const data = {
@@ -144,6 +147,10 @@ export default {
})
},
methods: {
open() {
this.query.material_type_id = this.openParam.material_type_id
this.crud.toQuery()
},
clickChange(item) {
this.tableRadio = item
},

View File

@@ -188,7 +188,7 @@
</div>
<PicDialog ref="child" :dialog-show.sync="PicDialog" />
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
<FaultDialog :dialog-show.sync="faultDialog" :is-single="true" @tableChanged="tableChanged"/>
<FaultDialog :dialog-show.sync="faultDialog" :is-single="true" :open-param="openParam" @tableChanged="tableChanged"/>
</div>
</template>
@@ -209,7 +209,7 @@ import DeviceDialog from '@/views/wms/sb/repair/devicevprs/DeviceDialog'
import FaultDialog from '@/views/wms/sb/repair/devicevprs/FaultDialog'
import { getDepts } from '@/api/system/dept'
const defaultForm = { product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
export default {
name: 'Devicevprs',
dicts: ['EM_FAULT_LEVEL'],
@@ -233,6 +233,7 @@ export default {
},
data() {
return {
openParam: null,
deviceDialog: false,
faultDialog: false,
classes: [],
@@ -362,9 +363,11 @@ export default {
},
tableChanged2(row) {
this.form.devicerecord_id = row.devicerecord_id
this.form.device_code = row.device_code
this.form.material_type_id = row.material_type_id
this.form.device_code = row.device_name + '-' + row.device_code
},
putFault() {
this.openParam = this.form
this.faultDialog = true
},
tableChanged(row) {

View File

@@ -48,6 +48,9 @@
<crudOperation :permission="permission" />
<!--表单组件-->
<!--表格渲染-->
<div>
<h5>设备oee=(生产时间-准备时间-故障时间-工装调整时间) / (生产时间-准备时间-工装调整时间) * 单个产品生产时间 * 生产总量 / (生产时间-准备时间-故障时间-工装调整时间) * (生产总量-不合格数) / 生产总量</h5>
</div>
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="runrecord_id" label="记录标识" />