代码更新

This commit is contained in:
2022-09-14 10:53:22 +08:00
parent fafff4b0e4
commit 66ec2c6905
10 changed files with 75 additions and 105 deletions

View File

@@ -2,6 +2,7 @@
package org.nl.wms.sb.re.service.impl; package org.nl.wms.sb.re.service.impl;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
@@ -48,6 +49,20 @@ public class InstrumentaccountServiceImpl implements InstrumentaccountService {
map.put("beginuse_date", MapUtil.getStr(whereJson, "beginuse_date")); map.put("beginuse_date", MapUtil.getStr(whereJson, "beginuse_date"));
map.put("docimasy_result", MapUtil.getStr(whereJson, "docimasy_result")); map.put("docimasy_result", MapUtil.getStr(whereJson, "docimasy_result"));
JSONObject json = WQL.getWO("QEM_BI_INSTRUMENTACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); JSONObject json = WQL.getWO("QEM_BI_INSTRUMENTACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
JSONArray content = json.getJSONArray("content");
for (int i = 0; i < content.size(); i++) {
JSONObject jsonObject = content.getJSONObject(i);
Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期
Date date2 = DateUtil.parse(jsonObject.getString("beginuse_date")); // 下次检验日期
long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false);
if (betweenDay < 15) {
jsonObject.put("is_red", "1");
}
}
return json; return json;
} }

View File

@@ -2,6 +2,7 @@
package org.nl.wms.sb.re.service.impl; package org.nl.wms.sb.re.service.impl;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -45,6 +46,20 @@ public class SafeaccountServiceImpl implements SafeaccountService {
if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%"); if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%");
map.put("docimasy_date", docimasy_date); map.put("docimasy_date", docimasy_date);
JSONObject json = WQL.getWO("QEM_BI_SAFEACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); JSONObject json = WQL.getWO("QEM_BI_SAFEACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
JSONArray content = json.getJSONArray("content");
for (int i = 0; i < content.size(); i++) {
JSONObject jsonObject = content.getJSONObject(i);
Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期
Date date2 = DateUtil.parse(jsonObject.getString("next_docimasy_date")); // 下次检验日期
long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false);
if (betweenDay < 15) {
jsonObject.put("is_red", "1");
}
}
return json; return json;
} }

View File

@@ -2,6 +2,7 @@
package org.nl.wms.sb.re.service.impl; package org.nl.wms.sb.re.service.impl;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -35,7 +36,6 @@ import java.util.*;
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class SpecialaccountServiceImpl implements SpecialaccountService { public class SpecialaccountServiceImpl implements SpecialaccountService {
@Override @Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) { public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String device_code = (String) whereJson.get("device_code"); String device_code = (String) whereJson.get("device_code");
@@ -45,6 +45,20 @@ public class SpecialaccountServiceImpl implements SpecialaccountService {
if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%"); if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%");
map.put("valid_term", valid_term); map.put("valid_term", valid_term);
JSONObject json = WQL.getWO("QEM_BI_SPECIALACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); JSONObject json = WQL.getWO("QEM_BI_SPECIALACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
JSONArray content = json.getJSONArray("content");
for (int i = 0; i < content.size(); i++) {
JSONObject jsonObject = content.getJSONObject(i);
Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期
Date date2 = DateUtil.parse(jsonObject.getString("valid_term")); // 检验日期
long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false);
if (betweenDay < 30) {
jsonObject.put("is_red", "1");
}
}
return json; return json;
} }

View File

@@ -58,11 +58,15 @@
class.class_name, class.class_name,
file.device_code, file.device_code,
file.device_name, file.device_name,
file.extend_code file.extend_code,
d1.name AS dept_name,
d2.name AS use_name
FROM FROM
EM_BI_DeviceRepairMst mst EM_BI_DeviceRepairMst mst
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
LEFT JOIN sys_dept d1 ON file.belong_deptid = d1.dept_id
LEFT JOIN sys_dept d2 ON file.use_groupid = d2.dept_id
WHERE WHERE
mst.is_delete = '0' mst.is_delete = '0'
AND file.is_delete = '0' AND file.is_delete = '0'

View File

@@ -248,37 +248,8 @@ export default {
} }
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.beginuse_date
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
// 进行比较符合条件表格就变化颜色
const stylejson = {} const stylejson = {}
if (a < 15) { if (row.is_red !== undefined) {
stylejson.background = '#e0838f' stylejson.background = '#e0838f'
stylejson.color = 'green' stylejson.color = 'green'
return stylejson return stylejson

View File

@@ -217,37 +217,8 @@ export default {
return true return true
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.next_docimasy_date
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
// 进行比较符合条件表格就变化颜色
const stylejson = {} const stylejson = {}
if (a < 15) { if (row.is_red !== undefined) {
stylejson.background = '#e0838f' stylejson.background = '#e0838f'
stylejson.color = 'green' stylejson.color = 'green'
return stylejson return stylejson

View File

@@ -216,38 +216,8 @@ export default {
return true return true
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.valid_term
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
debugger
// 进行比较符合条件表格就变化颜色
const stylejson = {} const stylejson = {}
if (a < 30) { if (row.is_red !== undefined) {
stylejson.background = '#e0838f' stylejson.background = '#e0838f'
stylejson.color = 'green' stylejson.color = 'green'
return stylejson return stylejson

View File

@@ -94,14 +94,16 @@
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <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 type="selection" width="55" />
<el-table-column v-if="false" prop="repair_id" label="设备维修单标识" /> <el-table-column v-if="false" prop="repair_id" label="设备维修单标识" />
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip /> <el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip>
<el-table-column prop="device_code" label="设备编码" width="120px" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link> <el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="device_code" label="设备编码" width="120px" show-overflow-tooltip />
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip /> <el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip /> <el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
<el-table-column prop="dept_name" label="归属部门" show-overflow-tooltip />
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
<el-table-column prop="invstatus" label="单据状态" :formatter="formatStatusName"/> <el-table-column prop="invstatus" label="单据状态" :formatter="formatStatusName"/>
<el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatTypeName"/> <el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatTypeName"/>
<el-table-column prop="fault_level" label="故障等级" :formatter="formatLevelName"/> <el-table-column prop="fault_level" label="故障等级" :formatter="formatLevelName"/>

View File

@@ -84,7 +84,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="start_flag"
@click="startRepair" @click="startRepair"
> >
开始维修 开始维修
@@ -95,7 +95,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="execu_flag"
@click="executeRepair" @click="executeRepair"
> >
维修执行 维修执行
@@ -106,7 +106,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="end_flag"
@click="endRepair" @click="endRepair"
> >
结束维修 结束维修
@@ -117,7 +117,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="open_flag"
@click="openReceive" @click="openReceive"
> >
维修领用 维修领用
@@ -128,7 +128,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="confirm_flag"
@click="confirmRepair" @click="confirmRepair"
> >
维修确认 维修确认
@@ -139,7 +139,7 @@
type="success" type="success"
icon="el-icon-position" icon="el-icon-position"
size="mini" size="mini"
:disabled="crud.selections.length !== 1" :disabled="result_flag"
@click="resuftRepair" @click="resuftRepair"
> >
结果录入 结果录入
@@ -221,6 +221,12 @@ export default {
}, },
data() { data() {
return { return {
start_flag: true,
execu_flag: true,
end_flag: true,
open_flag: true,
confirm_flag: true,
result_flag: true,
classes: [], classes: [],
class_idStr: null, class_idStr: null,
materOpt_code: '23', materOpt_code: '23',

View File

@@ -105,14 +105,16 @@
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <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 type="selection" width="55" />
<el-table-column v-if="false" prop="maint_id" label="保养单标识" /> <el-table-column v-if="false" prop="maint_id" label="保养单标识" />
<el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip /> <el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip>
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link> <el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.maint_code }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip />
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip /> <el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip /> <el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
<el-table-column prop="dept_name" label="归属部门" show-overflow-tooltip />
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
<el-table-column prop="invstatus" label="单据状态" show-overflow-tooltip :formatter="formatInvsName" /> <el-table-column prop="invstatus" label="单据状态" show-overflow-tooltip :formatter="formatInvsName" />
<el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatMainName" /> <el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatMainName" />
<el-table-column prop="plan_start_date" label="计划保养日期" width="150px" /> <el-table-column prop="plan_start_date" label="计划保养日期" width="150px" />