2024-09-20 设备-两个改动 手持接口+快读工单重复

master
元气满满(jgy) 7 months ago
parent 48c6ee4db1
commit b501b7059d

@ -38,110 +38,62 @@ public class DevicePDAController extends BaseController {
@Autowired
private IEquRepairWorkOrderService equRepairWorkOrderService;
/**
* list
*
* @param pdadto
* @return
*/
//获取今日任务工单 巡检 保养 点检
@GetMapping("/getTodayTask")
public AjaxResult getTodayTask(PDADTO pdadto) {
return devicePDAService.getTodayTask(pdadto);
}
/**
*
*
* @param pdadto
* @return
*/
//获取 巡检 保养 点检 记录列表
@GetMapping("/getTaskRecord")
public AjaxResult getTaskRecord(PDADTO pdadto) {
return devicePDAService.getTaskRecord(pdadto);
}
/**
*
*
* @param equOrder
* @return
*/
//获取 巡检 点检 保养 任务详情
@PostMapping("/getInspectionOrderInfo")
public AjaxResult getInspectionOrderInfo(@RequestBody EquOrder equOrder) {
return devicePDAService.getInspectionOrderInfo(equOrder);
}
/**
*
*
* @param equOrder
* @return
*/
//填写 巡检、点检、保养记录
@PostMapping("/updateInspectionRecord")
public AjaxResult updateInspectionRecord(@RequestBody EquOrder equOrder) {
return devicePDAService.updateInspectionRecord(equOrder);
}
//////////报修
/**
*
*
* @param equRepairOrder
* @return
*/
//新增手持报修记录
@PostMapping("/addRepairRecord")
public AjaxResult addRepairRecord(@RequestBody EquRepairOrder equRepairOrder) {
return devicePDAService.addRepairRecord(equRepairOrder);
}
//////////维修
/**
*
*
* @param equRepairWorkOrder
* @return
*/
//获取待处理的维修记录
//todo 应该改了改成一个接口写
@GetMapping("/getMaintenancePendRecords")
public AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.getMaintenancePendRecords(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
//todo 应该改了改成一个接口写
@GetMapping("/getMaintenanceRecords")
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.getMaintenanceRecords(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
//是否停机维修
@PutMapping("/updateDowntime")
public AjaxResult updateDowntime(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateDowntime(equRepairWorkOrder);
}
/**
*
*/
//获取设备详细信息
@GetMapping(value = "/queryEquipment/{equipmentCode}")
public AjaxResult queryEquipment(@PathVariable("equipmentCode") String equipmentCode) {
return devicePDAService.selectEquEquipmentByEquEquipmentCode(equipmentCode);
}
/**
*
*/
//查询设备列表
@GetMapping("/getEquipmentList")
public TableDataInfo getEquipmentList(EquEquipment equEquipment) {
startPage();
@ -149,20 +101,13 @@ public class DevicePDAController extends BaseController {
return getDataTable(list);
}
/**
*
*/
//获取维修详情
@GetMapping(value = "/selectPdaRepairWorkOrderDetails/{workId}")
public AjaxResult selectPdaRepairWorkOrderDetails(@PathVariable("workId") String workId) {
return devicePDAService.selectPdaRepairWorkOrderDetails(workId);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
//填写维修记录
@PutMapping("/updateMaintenanceRecords")
public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder);
@ -174,45 +119,34 @@ public class DevicePDAController extends BaseController {
return devicePDAService.queryEquFaultTypeTree(equRepairWorkOrder);
}
/**
*
*
* @param pdadto
* @return
*/
//开始保养任务
@GetMapping("/startMaintenanceTask")
public AjaxResult startMaintenanceTask(PDADTO pdadto) {
return devicePDAService.startMaintenanceTask(pdadto);
}
/**
*
*/
//查询故障描述
@GetMapping("/getFaultDescriptionList")
public AjaxResult getFaultDescriptionList(EquFaultDescription equFaultDescription) {
return devicePDAService.selectEquFaultDescriptionList(equFaultDescription);
}
/**
*
*/
//查询故障维修措施
@GetMapping("/getFaultMeasuresList")
public AjaxResult getFaultMeasuresList(EquFaultMeasures equFaultMeasures) {
return devicePDAService.selectEquFaultMeasuresList(equFaultMeasures);
}
/**
*
*/
//查询故障原因列表
@GetMapping("/getFaultReasonList")
public AjaxResult getFaultReasonList(EquFaultReason equFaultReason) {
return devicePDAService.selectEquFaultReasonList(equFaultReason);
}
//备品备件查询接口
@GetMapping(value = "/querySpareDetailBySpareCode/{spareCode}")
public AjaxResult querySpareDetailBySpareCode(@PathVariable("spareCode") String spareCode) {
return devicePDAService.selectSpareDetailBySpareCode(spareCode);
@PostMapping(value = "/querySpareDetailBySpareCode")
public AjaxResult querySpareDetailBySpareCode(@RequestBody SparePartsLedger sparePartsLedger) {
return devicePDAService.selectSpareDetailBySpareCode(sparePartsLedger.getMaterialCode());
}
//备品备件出入库
@ -221,40 +155,31 @@ public class DevicePDAController extends BaseController {
return equSparepartsInOutService.insertEquSparepartsInOut(equSparepartsInOut);
}
//报修页面查询
//报修审核页面查询
@GetMapping("/getBXList")
public AjaxResult getBXList(EquRepairOrder equRepairOrder) {
return devicePDAService.getBXList(equRepairOrder);
}
/**
*
*/
//获取故障报修的详细信息
@GetMapping(value = "/getBXDetail/{orderId}")
public AjaxResult getBXDetail(@PathVariable("orderId") String orderId) {
return success(equRepairOrderService.selectEquRepairOrderByOrderId(orderId));
}
/**
*
*/
//审核报修单
@PutMapping("/checkBX")
public AjaxResult checkEquRepairOrder(@RequestBody EquRepairOrder equRepairOrder) {
return toAjax(equRepairOrderService.checkEquRepairOrder(equRepairOrder));
}
/**
*
*
* @param upKeepOrderDTO
* @return
*/
//维修工单审核 传参数用保养的对象
@PostMapping("/checkWX")
public AjaxResult checkWX(@RequestBody UpKeepOrderDTO upKeepOrderDTO) {
return equRepairWorkOrderService.checkRepairWorkOrder(upKeepOrderDTO);
}
//维修页面查询
//维修审核页面查询
@GetMapping("/getWXList")
public AjaxResult getWXList(EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.getWXList(equRepairWorkOrder);

@ -85,6 +85,11 @@ public class EquRepairWorkOrderController extends BaseController {
@Log(title = "维修工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
// if (equRepairWorkOrderService.checkWorkCodeUnique(equRepairWorkOrder)) {
// return AjaxResult.error("库区编码已存在!");
// }
return toAjax(equRepairWorkOrderService.insertEquRepairWorkOrder(equRepairWorkOrder));
}

@ -73,7 +73,7 @@ public interface EquRepairWorkOrderMapper {
public int deleteEquRepairWorkOrderByWorkIds(String[] workIds);
//获取流水号
public int selectWorkCodeSerialNumber();
public int selectWorkCodeSerialNumber(EquRepairWorkOrder equRepairWorkOrder);
//转委外
void updateWorkOutsource(EquRepairWorkOrder equRepairWorkOrder);
@ -121,4 +121,7 @@ public interface EquRepairWorkOrderMapper {
//回退维修工单
void returnRepairWorkOrder(EquRepairWorkOrder dto);
//是否存在
// String checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder);
}

@ -73,4 +73,6 @@ public interface IEquRepairWorkOrderService {
//维修故障检验
AjaxResult checkRepairWorkOrder(UpKeepOrderDTO upKeepOrderDTO);
//是否存在
// boolean checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder);
}

@ -166,7 +166,8 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
// 获取流水号
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber(equRepairWorkOrder));
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
//维修单号
equRepairWorkOrder.setOrderCode("无");
@ -174,7 +175,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
equRepairWorkOrder.setWorkCode("WX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setWorkHandle("1");
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
@ -780,4 +781,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
}
return success(msg);
}
// @Override
// @DS("#header.poolName")
// public boolean checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder) {
// String code = equRepairWorkOrderMapper.checkWorkCodeUnique(equRepairWorkOrder);
// if (code == null) {
// return false;
// } else {
// return true;
// }
// }
}

@ -507,6 +507,7 @@
<select id="selectWorkCodeSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(work_id)+1 AS serialNum
FROM equ_repair_work_order
WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time)
</select>
<select id="getMaintenancePersonList" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
@ -583,4 +584,11 @@
and del_flag = '0'
</update>
<select id="checkWorkCodeUnique" parameterType="EquRepairWorkOrder" resultType="java.lang.String">
select work_code
from equ_repair_work_order
where work_code = #{workCode}
and del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save