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("--------------------定时任务注入完成---------------------");
}
}