add:维修单挂起功能

This commit is contained in:
zhangzq
2023-11-15 14:52:59 +08:00
parent 9b81e28f67
commit bb88cf869e
9 changed files with 145 additions and 39 deletions

View File

@@ -10,6 +10,7 @@ import cn.hutool.json.JSONObject;
*/
public class MsgUtil {
private static String FS_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/cfe495f7-9bcd-40bb-ab66-038de2131cac";
public static String FS_URL_报修群 = "https://open.feishu.cn/open-apis/bot/v2/hook/07caf042-cdad-4b13-bbfd-a0d53c31a389";
public static void sendMsg(String msg, MsgSend msgType){
switch (msgType){
case FS:

View File

@@ -4,7 +4,6 @@ package org.nl.wms.device_manage.repair.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -37,12 +36,12 @@ public class DevicerepairmstController {
private final DevicerepairmstService devicerepairmstService;
@GetMapping
@ApiOperation("查询维修单维护")
@Log("查询维修单维护")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.queryAll(whereJson, page), HttpStatus.OK);
}
@RequestMapping("/byuser")
@ApiOperation("查询维修单维护")
@Log("查询维修单维护")
public ResponseEntity<Object> querybyuser(@RequestParam Map whereJson, Pageable page) {
String currentNickName = SecurityUtils.getCurrentNickName();
if (!StringUtils.isEmpty(currentNickName) && !currentNickName.equals("管理员")){
@@ -54,151 +53,157 @@ public class DevicerepairmstController {
@GetMapping("/query")
@ApiOperation("查询维修单维护2")
@Log("查询维修单维护2")
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.query(whereJson, page), HttpStatus.OK);
}
@GetMapping("/query3")
@ApiOperation("查询维修单维护3")
@Log("查询维修单维护3")
public ResponseEntity<Object> query3(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.query3(whereJson, page), HttpStatus.OK);
}
@GetMapping("/query4")
@ApiOperation("查询维修单维护4")
@Log("查询维修单维护4")
public ResponseEntity<Object> query4(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.query4(whereJson, page), HttpStatus.OK);
}
@GetMapping("/query5")
@ApiOperation("查询维修单维护5")
@Log("查询维修单维护5")
public ResponseEntity<Object> query5(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.query5(whereJson, page), HttpStatus.OK);
}
@GetMapping("/queryBom")
@ApiOperation("查询备件bom")
@Log("查询备件bom")
public ResponseEntity<Object> queryBom(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(devicerepairmstService.queryBom(whereJson, page), HttpStatus.OK);
}
@GetMapping("/findByCode")
@ApiOperation("查询")
@Log("查询")
public ResponseEntity<Object> findByCode(@RequestParam Map whereJson) {
String code = (String) whereJson.get("id");
return new ResponseEntity<>(devicerepairmstService.findByCode(code), HttpStatus.OK);
}
@PostMapping
@ApiOperation("新增维修单维护")
@Log("新增维修单维护")
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
devicerepairmstService.create(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@ApiOperation("修改维修单维护")
@Log("修改维修单维护")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
devicerepairmstService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@ApiOperation("删除维修单维护")
@Log("删除维修单维护")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
devicerepairmstService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("编辑时获取明细")
@Log("编辑时获取明细")
@PostMapping("/getDtl")
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(TableDataInfo.build(devicerepairmstService.getDtl(whereJson)),HttpStatus.OK);
}
@ApiOperation("提交")
@Log("提交")
@PostMapping("/submit")
public ResponseEntity<Object> submit(@RequestBody JSONObject whereJson) {
devicerepairmstService.submit(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("开始维修")
@Log("开始维修")
@PostMapping("/startRepair")
public ResponseEntity<Object> startRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.startRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("结束维修")
@Log("结束维修")
@PostMapping("/endRepair")
public ResponseEntity<Object> endRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.endRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("结束维修")
@PostMapping("/pendingRepair")
public ResponseEntity<Object> pendingRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.pendingRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("执行维修保存")
@Log("执行维修保存")
@PostMapping("/submitRepair")
public ResponseEntity<Object> submitRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.submitRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("确认维修")
@Log("确认维修")
@PostMapping("/confirmRepair")
public ResponseEntity<Object> confirmRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.confirmRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("结果录入保存")
@Log("结果录入保存")
@PostMapping("/submitResuft")
public ResponseEntity<Object> submitResuft(@RequestBody JSONObject whereJson) {
devicerepairmstService.submitResuft(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("获取录入结果")
@Log("获取录入结果")
@PostMapping("/getResult")
public ResponseEntity<Object> getResult(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(devicerepairmstService.getResult(whereJson),HttpStatus.OK);
}
@ApiOperation("委外维修")
@Log("委外维修")
@PostMapping("/outRepair")
public ResponseEntity<Object> outRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.outRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("委外验收")
@Log("委外验收")
@PostMapping("/checkRepair")
public ResponseEntity<Object> checkRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.checkRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("审核")
@Log("审核")
@PostMapping("/uditRepair")
public ResponseEntity<Object> uditRepair(@RequestBody JSONObject whereJson) {
devicerepairmstService.uditRepair(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("获取设备标准bom")
@Log("获取设备标准bom")
@PostMapping("/getNormBom")
public ResponseEntity<Object> getNormBom(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(devicerepairmstService.getNormBom(whereJson),HttpStatus.OK);
}
@ApiOperation("获取档案bom")
@Log("获取档案bom")
@PostMapping("/getFileBom")
public ResponseEntity<Object> getFileBom(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(devicerepairmstService.getFileBom(whereJson),HttpStatus.OK);
}
@ApiOperation("保存维修领用")
@Log("保存维修领用")
@PostMapping("/submitReceive")
public ResponseEntity<Object> submitReceive(@RequestBody JSONObject whereJson) {
devicerepairmstService.submitReceive(whereJson);
@@ -206,13 +211,13 @@ public class DevicerepairmstController {
}
@GetMapping("/createExcel")
@ApiOperation("下载Excel")
@Log("下载Excel")
public ResponseEntity<Object> createExcel(@RequestParam Map whereJson, HttpServletResponse response) {
devicerepairmstService.createExcel(whereJson,response);
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("获取人员")
@Log("获取人员")
@PostMapping("/getUser")
public ResponseEntity<Object> getUser(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(devicerepairmstService.getUser(whereJson),HttpStatus.OK);

View File

@@ -104,6 +104,12 @@ public interface DevicerepairmstService {
*/
void startRepair(JSONObject whereJson);
/**
* 挂起维修
* @param whereJson
*/
void pendingRepair(JSONObject whereJson);
/**
* 结束维修
*

View File

@@ -17,6 +17,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.MapOf;
import org.nl.common.utils.MsgUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
@@ -385,6 +387,22 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
}
}
@Override
public void pendingRepair(JSONObject whereJson) {
// 1. 更新设备维修单主表
WQLObject.getWQLObject("EM_BI_DeviceRepairMst")
.update(MapOf.of("invstatus","04","remark",whereJson.getString("remark"))
,"repair_id = '" + whereJson.getString("repair_id")+"'");
String source_bill_code = whereJson.getString("source_bill_code");
if (StringUtils.isNotEmpty(whereJson.getString("source_bill_code")) && source_bill_code.contains("BXD")){
MsgUtil.sendMsg("lms维修挂起,操作人"+SecurityUtils.getCurrentNickName()+",报修单"+source_bill_code+"设备"+whereJson.getString("device_code")+",说明:"+whereJson.getString("remark"),
MsgUtil.MsgSend.FS,
MsgUtil.FS_URL_报修群
);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void endRepair(JSONObject whereJson2) {

View File

@@ -163,8 +163,6 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
@Override
@Transactional(rollbackFor = Exception.class)
public void create(DevicerepairrequestDto dto) {
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
WQLObject userTab = WQLObject.getWQLObject("sys_user");
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
String nickName = SecurityUtils.getCurrentNickName();
@@ -219,7 +217,9 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.insert(json);
MsgUtil.sendMsg("lms报修提醒:报修人:"+dto.getCreate_name()+",报修单:"+dto.getRequest_code()+",故障描述:"+dto.getFault_desc() ,MsgUtil.MsgSend.FS);
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + json.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
// MsgUtil.sendMsg("lms报修:报修人:"+dto.getCreate_name()+",报修单"+dto.getRequest_code()+",设备"+jsonFile.getString("device_code")+",故障描述:"+dto.getFault_desc() ,MsgUtil.MsgSend.FS);
}
@Override

View File

@@ -291,7 +291,7 @@
WHERE
mst.is_delete = '0'
AND file.is_delete = '0'
AND mst.invstatus not in ('04','06','07','99')
AND mst.invstatus not in ('01','06','07','99')
OPTION 输入.device_code <> ""
(file.device_code like 输入.device_code or
file.device_name like 输入.device_code)

View File

@@ -2,7 +2,8 @@ package org.nl.wms.system_manage.service.quartz.config;
import lombok.RequiredArgsConstructor;
import org.nl.wms.system_manage.service.quartz.ISysQuartzJobService;
import org.nl.wms.system_manage.service.quartz.utils.QuartzManage;
import org.nl.wms.system_manage.service.quartz.dao.SysQuartzJob;
import org.nl.wms.system_manage.service.quartz.utils.QuartzManage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
@@ -10,6 +11,8 @@ import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@RequiredArgsConstructor
@Order(100)
@@ -26,8 +29,8 @@ public class JobRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments applicationArguments) {
log.info("--------------------注入定时任务---------------------");
// List<SysQuartzJob> quartzJobs = quartzJobService.findByIsPauseIsFalse();
// quartzJobs.forEach(quartzManage::addJob);
List<SysQuartzJob> quartzJobs = quartzJobService.findByIsPauseIsFalse();
quartzJobs.forEach(quartzManage::addJob);
log.info("--------------------定时任务注入完成---------------------");
}
}

View File

@@ -56,6 +56,14 @@ export function startRepair(data) {
})
}
export function pendingRepair(data) {
return request({
url: 'api/devicerepairmst/pendingRepair',
method: 'post',
data
})
}
export function endRepair(data) {
return request({
url: 'api/devicerepairmst/endRepair',
@@ -168,4 +176,4 @@ export function getUser(data) {
})
}
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst, getUser }
export default { findByCode, add, edit, del, getDtl, submit, startRepair,pendingRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst, getUser }

View File

@@ -129,7 +129,37 @@
>
结束维修
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="Pending_flag"
@click="PendingStart"
>
维修单挂起
</el-button>
</crudOperation>
<el-dialog
:before-close="crud.cancelCU"
:close-on-click-modal="false"
title="维修单挂起"
:visible.sync="PendingVisible"
width="450px"
>
<el-form ref="form" :model="PendingForm" :rules="rules" size="mini">
<el-form-item label="备注" prop="remark">
<el-input v-model="PendingForm.remark" style="width: 350px;" rows="2" type="textarea" />
</el-form-item>
<br>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="info" @click="PendingClose">取消</el-button>
<el-button type="primary" @click="Pending">挂起</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :row-style="tableRowClassName" :data="crud.data" size="mini" style="width: 100%;" @selection-change="mySelectionChange">
<el-table-column type="selection" min-width="35" />
@@ -195,6 +225,7 @@ import resuftDialog from '@/views/wms/device_manage/repair/devicerepairpa/resuft
import ReceiveDialog from '@/views/wms/device_manage/repair/devicerepairpa/ReceiveDialog'
import StartDialog from '@/views/wms/device_manage/repair/devicerepairpa/StartDialog'
import AddDialog from '@/views/wms/device_manage/repair/devicerepair/AddDialog'
import {pendingRepair} from "../devicerepair/devicerepairmst";
export default {
name: 'Devicerepairpa',
@@ -220,12 +251,15 @@ export default {
data() {
return {
start_flag: true,
Pending_flag: true,
execu_flag: true,
end_flag: true,
open_flag: true,
confirm_flag: true,
result_flag: true,
classes: [],
PendingVisible: false,
PendingForm: {},
class_idStr: null,
materOpt_code: '23',
openParam: null,
@@ -234,6 +268,11 @@ export default {
receiveDialog: false,
startDialog: false,
permission: {
},
rules: {
remark: [
{ required: true, message: '标识不能为空', trigger: 'blur' }
]
}
}
},
@@ -249,6 +288,24 @@ export default {
})
},
methods: {
PendingStart() {
this.PendingVisible = true
this.PendingForm = {}
},
PendingClose() {
this.PendingForm = {}
this.PendingVisible = false
},
Pending() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
data.remark = this.PendingForm.remark
crudDevicerepairmst.pendingRepair(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
this.dialogVisible = false
})
},
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
@@ -306,7 +363,7 @@ export default {
const _selectData = this.$refs.table.selection
debugger
const data = _selectData[0]
if (data.invstatus === '03' || data.invstatus === '05') {
if (data.invstatus === '03' || data.invstatus === '05' || data.invstatus === '04') {
crudDevicerepairmst.getDtl(data).then(res => {
this.openParam = {
'form': data,
@@ -391,18 +448,25 @@ export default {
if (rows.length !== 0) {
this.start_flag = false
this.execu_flag = false
this.Pending_flag = false
this.end_flag = false
this.open_flag = false
this.confirm_flag = false
this.result_flag = false
for (let i = 0; i < rows.length; i++) {
if ('03,04,05,06,07,99'.includes(rows[i].invstatus)) {
if ('03,05,06,07,99'.includes(rows[i].invstatus)) {
this.start_flag = true
}
if ('04'.includes(rows[i].invstatus)) {
this.Pending_flag = true
}
if ('01'.includes(rows[i].invstatus)) {
this.Pending_flag = true
}
if ('01,02,04,05,06,07,99'.includes(rows[i].invstatus)) {
this.execu_flag = true
}
if ('01,02,04,06,07,99'.includes(rows[i].invstatus)) {
if ('01,02,06,07,99'.includes(rows[i].invstatus)) {
this.end_flag = true
}
if ('01,02,06,07,99'.includes(rows[i].invstatus)) {
@@ -424,6 +488,7 @@ export default {
},
handleCurrentChange() {
this.start_flag = true
this.Pending_flag = true
this.execu_flag = true
this.end_flag = true
this.open_flag = true