5-20 设备数据
parent
b952f02c2b
commit
629f9ca983
@ -0,0 +1,98 @@
|
|||||||
|
package com.glxp.api.controller.dev;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.controller.BaseController;
|
||||||
|
import com.glxp.api.entity.dev.DeviceCheckItemDictEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceCheckItemDictParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceCheckItemDictQuery;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.dev.DeviceCheckItemDictService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceCheckItemDictController extends BaseController {
|
||||||
|
|
||||||
|
private final DeviceCheckItemDictService deviceCheckItemDictService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成一个项目编码
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/udi/device/checkItemDict/code/gen")
|
||||||
|
public BaseResponse genItemCode() {
|
||||||
|
String code = "";
|
||||||
|
DeviceCheckItemDictEntity info = null;
|
||||||
|
do {
|
||||||
|
code = "XJ" + RandomUtil.randomNumbers(10);
|
||||||
|
info = deviceCheckItemDictService.getById(code);
|
||||||
|
} while (info != null);
|
||||||
|
return ResultVOUtils.success(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备巡检项目字典分页查询
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/checkItemDict/page")
|
||||||
|
public BaseResponse page(@RequestBody DeviceCheckItemDictQuery query) {
|
||||||
|
List<DeviceCheckItemDictEntity> list = deviceCheckItemDictService.pageList(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加巡检项目字典
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/checkItemDict/save")
|
||||||
|
public BaseResponse save(@RequestBody @Valid DeviceCheckItemDictParam param) {
|
||||||
|
DeviceCheckItemDictEntity entity = param.getEntity(super.getUser());
|
||||||
|
int i = deviceCheckItemDictService.insertIgnore(entity);
|
||||||
|
if (i == 0) {
|
||||||
|
return ResultVOUtils.error("项目编码已存在");
|
||||||
|
}
|
||||||
|
return ResultVOUtils.successMsg("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检项目字典
|
||||||
|
*
|
||||||
|
* @param itemCode 项目编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@DeleteMapping("/udi/device/checkItemDict/del/{itemCode}")
|
||||||
|
public BaseResponse del(@PathVariable String itemCode) {
|
||||||
|
|
||||||
|
boolean b = deviceCheckItemDictService.removeById(itemCode);
|
||||||
|
if (!b) {
|
||||||
|
return ResultVOUtils.error("删除失败,请稍后再试");
|
||||||
|
}
|
||||||
|
return ResultVOUtils.successMsg("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.glxp.api.controller.dev;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.controller.BaseController;
|
||||||
|
import com.glxp.api.entity.dev.DeviceCheckDetailEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery;
|
||||||
|
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
|
||||||
|
import com.glxp.api.service.dev.DeviceCheckDetailService;
|
||||||
|
import com.glxp.api.service.dev.DeviceRepairApplyDetailService;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceMiniController extends BaseController {
|
||||||
|
|
||||||
|
private final DeviceRepairApplyDetailService deviceRepairApplyDetailService;
|
||||||
|
private final DeviceCheckDetailService deviceCheckDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细报修单列表分页
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/repair/apply/detail/mini/page")
|
||||||
|
public BaseResponse miniPage(@RequestBody @Valid DeviceRepairApplyDetailMiniQuery query) {
|
||||||
|
List<DeviceRepairApplyDetailMiniResponse> list = deviceRepairApplyDetailService.miniPage(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务单明细列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/check/detail/mini/page")
|
||||||
|
public BaseResponse miniPage(@RequestBody @Valid DeviceCheckDetailMiniQuery query) {
|
||||||
|
List<DeviceCheckDetailEntity> list = deviceCheckDetailService.miniPage(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.glxp.api.controller.dev;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.controller.BaseController;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepQuery;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepService;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepDetailVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepPrintVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepVo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping
|
||||||
|
public class DeviceUpkeepController extends BaseController {
|
||||||
|
|
||||||
|
private final DeviceUpkeepService deviceUpkeepService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养任务单列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/page")
|
||||||
|
public BaseResponse page(@RequestBody DeviceUpkeepQuery query) {
|
||||||
|
List<DeviceUpkeepVo> list = deviceUpkeepService.pageList(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本部门任务单列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
// */
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/pageByDept")
|
||||||
|
public BaseResponse pageByDept(@RequestBody DeviceUpkeepQuery query) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
query.setChargeDeptCode(user.getLocDeptCode());
|
||||||
|
List<DeviceUpkeepVo> list = deviceUpkeepService.pageList(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据计划id生成巡检任务单
|
||||||
|
*
|
||||||
|
* @param planId 计划id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/udi/device/upkeep/gen/{planId}")
|
||||||
|
public BaseResponse genDeviceUpkeep(@PathVariable Long planId) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
deviceUpkeepService.genByPlanId(planId, false, user);
|
||||||
|
return ResultVOUtils.successMsg("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/udi/device/upkeep/info/print/{taskId}")
|
||||||
|
public BaseResponse checkInfoPrint(@PathVariable Long taskId) {
|
||||||
|
DeviceUpkeepPrintVo vo = deviceUpkeepService.checkInfoPrint(taskId, null);
|
||||||
|
return ResultVOUtils.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@GetMapping("/udi/device/upkeep/info/print/{taskId}/{deviceCode}")
|
||||||
|
public BaseResponse checkInfoPrint(@PathVariable Long taskId, @PathVariable String deviceCode) {
|
||||||
|
DeviceUpkeepPrintVo vo = deviceUpkeepService.checkInfoPrint(taskId, deviceCode);
|
||||||
|
return ResultVOUtils.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的维修单
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/byUser/page")
|
||||||
|
public BaseResponse pageByUser(@RequestBody DeviceUpkeepQuery query) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
query.setChargeDeptCode(user.getLocDeptCode());
|
||||||
|
List<DeviceUpkeepDetailVo> list = deviceUpkeepService.pageListDetail(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package com.glxp.api.controller.dev;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.controller.BaseController;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DevicePlanDetailEntity;
|
||||||
|
import com.glxp.api.entity.dev.DevicePlanEntity;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity;
|
||||||
|
import com.glxp.api.req.dev.DevicePlanDetailParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailQuery;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.dev.*;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping
|
||||||
|
public class DeviceUpkeepDetailController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
private final DeviceUpkeepDetailService deviceUpkeepDetailService;
|
||||||
|
|
||||||
|
private final DevicePlanService devicePlanService;
|
||||||
|
|
||||||
|
private final DeviceInfoService deviceInfoService;
|
||||||
|
private final DevicePlanDetailService devicePlanDetailService;
|
||||||
|
private final DeviceUpkeepDetailItemService deviceUpkeepDetailItemService;
|
||||||
|
/**
|
||||||
|
* 保养任务单明细列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/detail/page")
|
||||||
|
public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailQuery query) {
|
||||||
|
List<DeviceUpkeepDetailEntity> list = deviceUpkeepDetailService.pageList(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备保养计划明细新增
|
||||||
|
*
|
||||||
|
* @param param 参数
|
||||||
|
* @return 计划id
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/detail/add")
|
||||||
|
public BaseResponse add(@RequestBody @Valid DevicePlanDetailParam param) {
|
||||||
|
|
||||||
|
|
||||||
|
DevicePlanEntity entity = null;
|
||||||
|
if (!param.valid(devicePlanService)) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
entity = param.getDevicePlanParam().getEntity(user);
|
||||||
|
devicePlanService.save(entity);
|
||||||
|
param.getDevicePlanParam().setPlanId(entity.getPlanId());
|
||||||
|
param.setPlanId(entity.getPlanId());
|
||||||
|
} else {
|
||||||
|
entity = devicePlanService.getById(param.getPlanId());
|
||||||
|
}
|
||||||
|
param.valid(devicePlanService);
|
||||||
|
List<DevicePlanDetailEntity> list = param.getEntity(deviceInfoService);
|
||||||
|
devicePlanDetailService.replaceBatch(list);
|
||||||
|
return ResultVOUtils.success(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成保养任务单明细项目
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/detail/finish")
|
||||||
|
public BaseResponse finish(@RequestBody @Valid DeviceUpkeepDetailParam param) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
deviceUpkeepDetailItemService.finishAll(param, user);
|
||||||
|
return ResultVOUtils.successMsg("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.glxp.api.controller.dev;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import com.glxp.api.controller.BaseController;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemFinishParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemQuery;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepDetailItemService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备巡检单明细
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping
|
||||||
|
public class DeviceUpkeepDetailItemController extends BaseController {
|
||||||
|
|
||||||
|
private final DeviceUpkeepDetailItemService deviceUpkeepDetailItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务单明细项目列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 保养任务单明细项目列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/detail/item/page")
|
||||||
|
public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailItemQuery query) {
|
||||||
|
List<DeviceUpkeepDetailItemEntity> list = deviceUpkeepDetailItemService.pageList(query);
|
||||||
|
PageInfo pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse page = new PageSimpleResponse();
|
||||||
|
page.setTotal(pageInfo.getTotal());
|
||||||
|
page.setList(pageInfo.getList());
|
||||||
|
return ResultVOUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成巡检任务单明细项目
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/udi/device/upkeep/detail/item/finish")
|
||||||
|
public BaseResponse page(@RequestBody @Valid DeviceUpkeepDetailItemFinishParam param) {
|
||||||
|
AuthAdmin user = super.getUser();
|
||||||
|
deviceUpkeepDetailItemService.finish(param, user);
|
||||||
|
return ResultVOUtils.successMsg("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.glxp.api.dao.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep_detail_item(设备保养项目)】的数据库操作Mapper
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepDetailItemMapper extends BaseMapperPlus<DeviceUpkeepDetailItemMapper, DeviceUpkeepDetailItemEntity,DeviceUpkeepDetailItemEntity> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.glxp.api.dao.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Mapper
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepDetailMapper extends BaseMapperPlus<DeviceUpkeepDetailMapper, DeviceUpkeepDetailEntity,DeviceUpkeepDetailEntity> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.glxp.api.dao.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepQuery;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepDetailVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep(保养任务表)】的数据库操作Mapper
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepMapper extends BaseMapperPlus<DeviceUpkeepMapper, DeviceUpkeepEntity,DeviceUpkeepEntity> {
|
||||||
|
|
||||||
|
List<DeviceUpkeepVo> pageVo(DeviceUpkeepQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
DeviceUpkeepVo getVoById(@Param("taskId") Long taskId);
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailVo> pageListDetail(DeviceUpkeepQuery query);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,192 @@
|
|||||||
|
package com.glxp.api.entity.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务明细
|
||||||
|
*
|
||||||
|
* @TableName device_upkeep_detail
|
||||||
|
*/
|
||||||
|
@TableName(value = "device_upkeep_detail")
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DeviceUpkeepDetailEntity {
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
@TableField(value = "taskId")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "deviceCode")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptCode")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptName")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否完成
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishFlag")
|
||||||
|
private Boolean finishFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品id
|
||||||
|
*/
|
||||||
|
@TableField(value = "productId")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UDI码
|
||||||
|
*/
|
||||||
|
@TableField(value = "udi")
|
||||||
|
private String udi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DI码
|
||||||
|
*/
|
||||||
|
@TableField(value = "nameCode")
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "productName")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
@TableField(value = "ggxh")
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
@TableField(value = "batchNo")
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号
|
||||||
|
*/
|
||||||
|
@TableField(value = "serialNo")
|
||||||
|
private String serialNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
@TableField(value = "productionDate")
|
||||||
|
private String productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失效日期
|
||||||
|
*/
|
||||||
|
@TableField(value = "expireDate")
|
||||||
|
private String expireDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
@TableField(value = "manufactory")
|
||||||
|
private String manufactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
@TableField(value = "measname")
|
||||||
|
private String measname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册/备案凭证号
|
||||||
|
*/
|
||||||
|
@TableField(value = "zczbhhzbapzbh")
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "supId")
|
||||||
|
private String supId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "supName")
|
||||||
|
private String supName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检项目数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "itemCount")
|
||||||
|
private Integer itemCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成项目数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishCount")
|
||||||
|
private Integer finishCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常项目数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "exceptionCount")
|
||||||
|
private Integer exceptionCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishTime")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修单id
|
||||||
|
*/
|
||||||
|
// @TableField(value = "repairId")
|
||||||
|
// private Long repairId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检建议
|
||||||
|
*/
|
||||||
|
@TableField(value = "suggestion")
|
||||||
|
private String suggestion;
|
||||||
|
/**
|
||||||
|
* 现场照片
|
||||||
|
*/
|
||||||
|
@TableField(value = "livePath")
|
||||||
|
private String livePath;
|
||||||
|
/**
|
||||||
|
* 正常标识
|
||||||
|
*/
|
||||||
|
@TableField(value = "normalFlag")
|
||||||
|
private Boolean normalFlag;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateTime")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package com.glxp.api.entity.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备保养项目
|
||||||
|
*
|
||||||
|
* @TableName device_upkeep_detail_item
|
||||||
|
*/
|
||||||
|
@TableName(value = "device_upkeep_detail_item")
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DeviceUpkeepDetailItemEntity {
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
@TableField(value = "taskId")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "deviceCode")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "itemCode")
|
||||||
|
private String itemCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "itemName")
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目内容
|
||||||
|
*/
|
||||||
|
@TableField(value = "itemContent")
|
||||||
|
private String itemContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常标识
|
||||||
|
*/
|
||||||
|
@TableField(value = "normalFlag")
|
||||||
|
private Boolean normalFlag;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目完成标识
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishFlag")
|
||||||
|
private Boolean finishFlag;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目完成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishTime")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养建议
|
||||||
|
*/
|
||||||
|
@TableField(value = "suggestion")
|
||||||
|
private String suggestion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepUserId")
|
||||||
|
private Long upkeepUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养人姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepUserName")
|
||||||
|
private String upkeepUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养部门
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepDeptCode")
|
||||||
|
private String upkeepDeptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养部门名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepDeptName")
|
||||||
|
private String upkeepDeptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateTime")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
@ -0,0 +1,140 @@
|
|||||||
|
package com.glxp.api.entity.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养任务表
|
||||||
|
*
|
||||||
|
* @TableName device_upkeep
|
||||||
|
*/
|
||||||
|
@TableName(value = "device_upkeep")
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DeviceUpkeepEntity {
|
||||||
|
/**
|
||||||
|
* 保养任务id
|
||||||
|
*/
|
||||||
|
@TableId(value = "taskId")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划id
|
||||||
|
*/
|
||||||
|
@TableField(value = "planId")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "planName")
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责部门编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "chargeDeptCode")
|
||||||
|
private String chargeDeptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepUserId")
|
||||||
|
private Long upkeepUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养人姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepUserName")
|
||||||
|
private String upkeepUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养人电话
|
||||||
|
*/
|
||||||
|
@TableField(value = "upkeepUserPhone")
|
||||||
|
private String upkeepUserPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "deviceCount")
|
||||||
|
private Integer deviceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成设备数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishCount")
|
||||||
|
private Integer finishCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常设备数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "exceptionCount")
|
||||||
|
private Integer exceptionCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务备注
|
||||||
|
*/
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否系统创建 1/true 是 0/false 否
|
||||||
|
*/
|
||||||
|
@TableField(value = "sysFlag")
|
||||||
|
private Boolean sysFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已完成 1/true 是 0/false 否
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishFlag")
|
||||||
|
private Boolean finishFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishTime")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间 updateTime
|
||||||
|
*/
|
||||||
|
@TableField(value = "createTime")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "createUserId")
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "createUserName")
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateTime")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceCheckDetailMiniQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "缺少部门编码")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模糊设备码和UDI
|
||||||
|
*/
|
||||||
|
private String deviceCodeAndUdi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否完成
|
||||||
|
*/
|
||||||
|
private Boolean finishFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceCheckItemDictEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceCheckItemDictParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "项目编码不能为空")
|
||||||
|
@Pattern(regexp = "^[A-Za-z0-9]{1,20}$", message = "项目编码应该在1~20字之间且只能包含字母和数字")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "项目名称不能为空")
|
||||||
|
@Length(min = 1, max = 100, message = "项目名称应该在1~100字之间")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目内容
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "项目内容不能为空")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
public DeviceCheckItemDictEntity getEntity(AuthAdmin user) {
|
||||||
|
|
||||||
|
DeviceCheckItemDictEntity build = DeviceCheckItemDictEntity.builder()
|
||||||
|
.code(code)
|
||||||
|
.name(name)
|
||||||
|
.content(content)
|
||||||
|
.type(type)
|
||||||
|
.createUserId(user.getCustomerId())
|
||||||
|
.createUserName(user.getEmployeeName())
|
||||||
|
.createTime(LocalDateTime.now())
|
||||||
|
.build();
|
||||||
|
return build;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceRepairApplyDetailMiniQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "缺少部门编码")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模糊设备码和UDI
|
||||||
|
*/
|
||||||
|
private String deviceCodeAndUdi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 待诊断、待维修、维修中、完成',
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceRepairApplyListByIdAndCodeQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
@NotNull(message = "报修单标识不能为空")
|
||||||
|
Long applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修人联系方式
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备标识不可以为空")
|
||||||
|
String deviceCode;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DeviceUpkeepDetailItemFinishParam {
|
||||||
|
|
||||||
|
@NotNull(message = "任务单标识不能为空")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@NotBlank(message = "设备标识不能为空")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
@NotNull(message = "项目标识不能为空")
|
||||||
|
private String itemCode;
|
||||||
|
|
||||||
|
@NotNull(message = "请标记巡检状态")
|
||||||
|
private Boolean normalFlag;
|
||||||
|
|
||||||
|
@NotBlank(message = "巡检意见不能为空")
|
||||||
|
private String suggestion;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepDetailItemQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务单标识
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备标识
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "设备标识不能为空")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepDetailParam {
|
||||||
|
|
||||||
|
@NotNull(message = "任务单标识不能为空")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@NotBlank(message = "设备编码不能为空")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养建议
|
||||||
|
*/
|
||||||
|
private String suggestion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现场照片
|
||||||
|
*/
|
||||||
|
private String livePath;
|
||||||
|
/**
|
||||||
|
* 正常标识
|
||||||
|
*/
|
||||||
|
private Boolean normalFlag;
|
||||||
|
|
||||||
|
private List<DeviceUpkeepDetailItemEntity> detailItemEntities;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepDetailQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
@NotNull(message = "任务单标识不能为空")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepQuery extends ListPageRequest {
|
||||||
|
|
||||||
|
String taskId;
|
||||||
|
String chargeDeptCode;
|
||||||
|
String deviceCode;
|
||||||
|
Boolean finishFlag;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,201 @@
|
|||||||
|
package com.glxp.api.res.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceRepairApplyDetailMiniResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修单id
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyId")
|
||||||
|
private Long applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "deviceCode")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptCode")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "deptName")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
@TableField(value = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诊断信息
|
||||||
|
*/
|
||||||
|
@TableField(value = "diagnosisInfo")
|
||||||
|
private String diagnosisInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 待诊断、待维修、维修中、完成
|
||||||
|
*/
|
||||||
|
@TableField(value = "status")
|
||||||
|
private DeviceRepairApplyDetailStatusEnum status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要维修 true/false
|
||||||
|
*/
|
||||||
|
@TableField(value = "repairFlag")
|
||||||
|
private Boolean repairFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修单id
|
||||||
|
*/
|
||||||
|
@TableField(value = "repairId")
|
||||||
|
private Long repairId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品id
|
||||||
|
*/
|
||||||
|
@TableField(value = "productId")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UDI码
|
||||||
|
*/
|
||||||
|
@TableField(value = "udi")
|
||||||
|
private String udi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DI码
|
||||||
|
*/
|
||||||
|
@TableField(value = "nameCode")
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "productName")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
@TableField(value = "ggxh")
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修单id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 状态 待受理,受理中,维修中,完成
|
||||||
|
// */
|
||||||
|
// @TableField(value = "status")
|
||||||
|
// private DeviceRepairApplyStatusEnum status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修部门编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyDeptCode")
|
||||||
|
private String applyDeptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修部门
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyDeptName")
|
||||||
|
private String applyDeptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyUserId")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修人姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyUserName")
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修人联系方式
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyUserPhone")
|
||||||
|
private String applyUserPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报修时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "applyTime")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "deviceCount")
|
||||||
|
private Integer deviceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishCount")
|
||||||
|
private Integer finishCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认部门
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmDeptCode")
|
||||||
|
private String confirmDeptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认部门名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmDeptName")
|
||||||
|
private String confirmDeptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmUserId")
|
||||||
|
private Long confirmUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认人姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmUserName")
|
||||||
|
private String confirmUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认人联系方式
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmPhone")
|
||||||
|
private String confirmPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "confirmTime")
|
||||||
|
private LocalDateTime confirmTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "finishTime")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.glxp.api.service.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemFinishParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemQuery;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep_detail_item(设备保养项目)】的数据库操作Service
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepDetailItemService extends IService<DeviceUpkeepDetailItemEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailItemEntity> listByTaskId(Long taskId, String deviceCode);
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailItemEntity> pageList(DeviceUpkeepDetailItemQuery query);
|
||||||
|
|
||||||
|
void finish(DeviceUpkeepDetailItemFinishParam param, AuthAdmin user);
|
||||||
|
|
||||||
|
void finishAll(DeviceUpkeepDetailParam param, AuthAdmin user);
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.glxp.api.service.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Service
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepDetailService extends IService<DeviceUpkeepDetailEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailEntity> pageList(DeviceUpkeepDetailQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailEntity> listByTaskId(Long taskId, String deviceCode);
|
||||||
|
DeviceUpkeepDetailEntity getOne(Long taskId, String deviceCode);
|
||||||
|
|
||||||
|
|
||||||
|
void finishItem(Long taskId, String deviceCode, String deptCode, Boolean normalFlag, AuthAdmin user);
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.glxp.api.service.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepQuery;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepDetailVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepPrintVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : zhangsan
|
||||||
|
* @date : 2024/5/12 15:16
|
||||||
|
* @modyified By :
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep(保养任务表)】的数据库操作Service
|
||||||
|
*/
|
||||||
|
public interface DeviceUpkeepService extends IService<DeviceUpkeepEntity> {
|
||||||
|
|
||||||
|
List<DeviceUpkeepVo> pageList(DeviceUpkeepQuery query);
|
||||||
|
|
||||||
|
void genByPlanId(Long planId, boolean b, AuthAdmin user);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DeviceUpkeepPrintVo checkInfoPrint(Long taskId, String deviceCode);
|
||||||
|
|
||||||
|
void finishUpkeep(Long taskId, String deviceCode);
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailVo> pageListDetail(DeviceUpkeepQuery query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成一个保养设备
|
||||||
|
*
|
||||||
|
* @param taskId 任务id
|
||||||
|
* @param deviceCode 设备编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// void finishDevice(Long taskId, String deviceCode);
|
||||||
|
|
||||||
|
// void finishUpkeep(String deviceCode, String deptCode, Long taskId, AuthAdmin user);
|
||||||
|
}
|
@ -0,0 +1,148 @@
|
|||||||
|
package com.glxp.api.service.dev.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.glxp.api.common.enums.ResultEnum;
|
||||||
|
import com.glxp.api.dao.dev.DeviceUpkeepDetailItemMapper;
|
||||||
|
import com.glxp.api.dao.dev.DeviceUpkeepDetailMapper;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepEntity;
|
||||||
|
import com.glxp.api.exception.JsonException;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemFinishParam;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailItemQuery;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailParam;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepDetailItemService;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepDetailService;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepService;
|
||||||
|
import com.glxp.api.util.IntUtil;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_Upkeep_detail_item(设备保养项目)】的数据库操作Service实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceUpkeepDetailItemServiceImpl extends ServiceImpl<DeviceUpkeepDetailItemMapper, DeviceUpkeepDetailItemEntity>
|
||||||
|
implements DeviceUpkeepDetailItemService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
DeviceUpkeepService deviceUpkeepService;
|
||||||
|
@Resource
|
||||||
|
DeviceUpkeepDetailService deviceUpkeepDetailService;
|
||||||
|
@Resource
|
||||||
|
DeviceUpkeepDetailMapper deviceUpkeepDetailMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepDetailItemEntity> listByTaskId(Long taskId, String deviceCode) {
|
||||||
|
List<DeviceUpkeepDetailItemEntity> list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailItemEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getTaskId, taskId)
|
||||||
|
.eq(deviceCode != null, DeviceUpkeepDetailItemEntity::getDeviceCode, deviceCode)
|
||||||
|
.orderByAsc(DeviceUpkeepDetailItemEntity::getDeviceCode, DeviceUpkeepDetailItemEntity::getItemCode)
|
||||||
|
);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepDetailItemEntity> pageList(DeviceUpkeepDetailItemQuery query) {
|
||||||
|
List<DeviceUpkeepDetailItemEntity> list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailItemEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getTaskId, query.getTaskId())
|
||||||
|
.eq(query.getDeviceCode()!=null,DeviceUpkeepDetailItemEntity::getDeviceCode, query.getDeviceCode())
|
||||||
|
.orderByAsc(DeviceUpkeepDetailItemEntity::getFinishFlag, DeviceUpkeepDetailItemEntity::getNormalFlag, DeviceUpkeepDetailItemEntity::getDeviceCode, DeviceUpkeepDetailItemEntity::getItemCode)
|
||||||
|
);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish(DeviceUpkeepDetailItemFinishParam param, AuthAdmin user) {
|
||||||
|
DeviceUpkeepEntity upkeepEntity = deviceUpkeepService.getById(param.getTaskId());
|
||||||
|
if (upkeepEntity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// DeviceUpkeepDetailEntity detailEntity = deviceUpkeepDetailService.getOne(param.getTaskId(), param.getDeviceCode());
|
||||||
|
//// DeviceCheckDetailEntity detailEntity = deviceCheckDetailService.getOne(param.getTaskId(), param.getDeviceCode());
|
||||||
|
|
||||||
|
DeviceUpkeepDetailEntity detailEntity = deviceUpkeepDetailService.getOne(param.getTaskId(), param.getDeviceCode());
|
||||||
|
if (detailEntity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailItemEntity.class)
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getFinishFlag, true)
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getFinishTime, LocalDateTime.now())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getSuggestion, param.getSuggestion())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getNormalFlag, param.getNormalFlag())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getUpkeepUserId, user.getId())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getUpkeepUserName, user.getEmployeeName())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getUpkeepDeptCode, user.getLocDeptCode())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getUpkeepDeptName, user.getDeptName())
|
||||||
|
.set(DeviceUpkeepDetailItemEntity::getUpdateTime,LocalDateTime.now())
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getTaskId, param.getTaskId())
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getDeviceCode, param.getDeviceCode())
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getItemCode, param.getItemCode())
|
||||||
|
.eq(DeviceUpkeepDetailItemEntity::getFinishFlag, false)
|
||||||
|
);
|
||||||
|
if (updated) {
|
||||||
|
deviceUpkeepDetailService.finishItem(param.getTaskId(), param.getDeviceCode(), detailEntity.getDeptCode(), param.getNormalFlag(), user);
|
||||||
|
} else {
|
||||||
|
throw new JsonException("操作失败,该项目可能已经被其他人完成,请刷新重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishAll(DeviceUpkeepDetailParam param, AuthAdmin user) {
|
||||||
|
int finishCount = 0;
|
||||||
|
int exceptionCount = 0;
|
||||||
|
int itemCount = 0;
|
||||||
|
if (CollUtil.isNotEmpty(param.getDetailItemEntities())) {
|
||||||
|
for (DeviceUpkeepDetailItemEntity itemEntity : param.getDetailItemEntities()) {
|
||||||
|
if (!IntUtil.value(itemEntity.getNormalFlag())) {
|
||||||
|
exceptionCount++;
|
||||||
|
}
|
||||||
|
finishCount++;
|
||||||
|
itemCount++;
|
||||||
|
finish(DeviceUpkeepDetailItemFinishParam.builder()
|
||||||
|
.taskId(param.getTaskId())
|
||||||
|
.deviceCode(param.getDeviceCode())
|
||||||
|
.itemCode(itemEntity.getItemCode())
|
||||||
|
.normalFlag(itemEntity.getNormalFlag())
|
||||||
|
.suggestion("")
|
||||||
|
.build(), user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// log.error("修改语句");
|
||||||
|
int update = deviceUpkeepDetailMapper.update(DeviceUpkeepDetailEntity.builder()
|
||||||
|
.finishFlag(true)
|
||||||
|
.finishCount(finishCount)
|
||||||
|
.suggestion(param.getSuggestion())
|
||||||
|
.livePath(param.getLivePath())
|
||||||
|
.normalFlag(param.getNormalFlag())
|
||||||
|
.finishTime(LocalDateTime.now())
|
||||||
|
.updateTime(LocalDateTime.now())
|
||||||
|
.exceptionCount(exceptionCount).itemCount(itemCount).build(),
|
||||||
|
Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, param.getTaskId())
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getDeviceCode, param.getDeviceCode())
|
||||||
|
);
|
||||||
|
if (update<1){
|
||||||
|
|
||||||
|
throw new JsonException(ResultEnum.NOT_NETWORK,"修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.glxp.api.service.dev.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.dev.DeviceUpkeepDetailMapper;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailEntity;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepDetailQuery;
|
||||||
|
import com.glxp.api.service.dev.DeviceInfoService;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepDetailService;
|
||||||
|
import com.glxp.api.service.dev.DeviceUpkeepService;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep_detail(保养任务明细)】的数据库操作Service实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceUpkeepDetailServiceImpl extends ServiceImpl<DeviceUpkeepDetailMapper, DeviceUpkeepDetailEntity>
|
||||||
|
implements DeviceUpkeepDetailService {
|
||||||
|
|
||||||
|
final DeviceUpkeepService deviceUpkeepService;
|
||||||
|
final DeviceInfoService deviceInfoService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepDetailEntity> pageList(DeviceUpkeepDetailQuery query) {
|
||||||
|
if (query.getPage() != null) {
|
||||||
|
PageHelper.startPage(query.getPage(), query.getLimit());
|
||||||
|
}
|
||||||
|
List<DeviceUpkeepDetailEntity> list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, query.getTaskId())
|
||||||
|
.eq(StrUtil.isNotBlank(query.getDeviceCode()), DeviceUpkeepDetailEntity::getDeviceCode, query.getDeviceCode())
|
||||||
|
.orderBy(true, true, DeviceUpkeepDetailEntity::getFinishFlag)
|
||||||
|
.orderBy(true, false, DeviceUpkeepDetailEntity::getExceptionCount)
|
||||||
|
.orderBy(true, true, DeviceUpkeepDetailEntity::getDeptCode)
|
||||||
|
.orderBy(true, true, DeviceUpkeepDetailEntity::getFinishTime)
|
||||||
|
.orderBy(true, true, DeviceUpkeepDetailEntity::getDeptCode)
|
||||||
|
);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepDetailEntity> listByTaskId(Long taskId, String deviceCode) {
|
||||||
|
List<DeviceUpkeepDetailEntity> list = super.list(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, taskId)
|
||||||
|
.eq(deviceCode != null, DeviceUpkeepDetailEntity::getDeviceCode, deviceCode)
|
||||||
|
.orderByAsc(DeviceUpkeepDetailEntity::getDeptCode, DeviceUpkeepDetailEntity::getDeviceCode)
|
||||||
|
);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceUpkeepDetailEntity getOne(Long taskId, String deviceCode) {
|
||||||
|
return super.getOne(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, taskId)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishItem(Long taskId, String deviceCode, String deptCode, Boolean normalFlag, AuthAdmin user) {
|
||||||
|
boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class)
|
||||||
|
.setSql("finishCount = finishCount + 1")
|
||||||
|
.setSql(!normalFlag, "exceptionCount = exceptionCount + 1")
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, taskId)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode)
|
||||||
|
.last("and finishCount+1<=itemCount")
|
||||||
|
);
|
||||||
|
if (updated) {
|
||||||
|
updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepDetailEntity.class)
|
||||||
|
.set(DeviceUpkeepDetailEntity::getFinishFlag, true)
|
||||||
|
.set(DeviceUpkeepDetailEntity::getFinishTime, LocalDateTime.now())
|
||||||
|
.set(DeviceUpkeepDetailEntity::getUpdateTime, LocalDateTime.now())
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getTaskId, taskId)
|
||||||
|
.eq(DeviceUpkeepDetailEntity::getDeviceCode, deviceCode)
|
||||||
|
.last("and finishCount = itemCount")
|
||||||
|
);
|
||||||
|
if (updated) {
|
||||||
|
// 所有项目全部完成。。。修改任务单完成设备 and 关闭设备的巡检锁
|
||||||
|
deviceUpkeepService.finishUpkeep(taskId, deviceCode);
|
||||||
|
deviceInfoService.finishCheck(deviceCode, deptCode, taskId, user);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,227 @@
|
|||||||
|
package com.glxp.api.service.dev.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.dev.DeviceUpkeepMapper;
|
||||||
|
import com.glxp.api.entity.auth.AuthAdmin;
|
||||||
|
import com.glxp.api.entity.dev.*;
|
||||||
|
import com.glxp.api.enums.dev.DeviceStatusEnum;
|
||||||
|
import com.glxp.api.exception.JsonException;
|
||||||
|
import com.glxp.api.req.dev.DeviceUpkeepQuery;
|
||||||
|
import com.glxp.api.service.dev.*;
|
||||||
|
import com.glxp.api.util.SnowflakeUtil;
|
||||||
|
import com.glxp.api.vo.dev.DevicePlanDetailVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepDetailVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepPrintVo;
|
||||||
|
import com.glxp.api.vo.dev.DeviceUpkeepVo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : zhangsan
|
||||||
|
* @date : 2024/5/12 15:19
|
||||||
|
* @modyified By :
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对表【device_upkeep(保养任务表)】的数据库操作Service
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceUpkeepServiceImpl extends ServiceImpl<DeviceUpkeepMapper, DeviceUpkeepEntity>
|
||||||
|
implements DeviceUpkeepService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
DevicePlanService devicePlanService;
|
||||||
|
@Resource
|
||||||
|
DeviceUpkeepDetailService deviceUpkeepDetailService;
|
||||||
|
@Resource
|
||||||
|
DevicePlanDetailItemService devicePlanDetailItemService;
|
||||||
|
@Resource
|
||||||
|
DeviceInfoService deviceInfoService;
|
||||||
|
@Resource
|
||||||
|
DeviceUpkeepDetailItemService deviceUpkeepDetailItemService;
|
||||||
|
@Resource
|
||||||
|
DevicePlanDetailService devicePlanDetailService;
|
||||||
|
|
||||||
|
private final ThreadPoolTaskExecutor taskExecutor;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepVo> pageList(DeviceUpkeepQuery query) {
|
||||||
|
if (query.getPage() != null){
|
||||||
|
PageHelper.startPage(query.getPage(),query.getLimit());
|
||||||
|
}
|
||||||
|
List<DeviceUpkeepVo> list = super.baseMapper.pageVo(query);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genByPlanId(Long planId, boolean b, AuthAdmin user) {
|
||||||
|
DevicePlanEntity plan = devicePlanService.getById(planId);
|
||||||
|
if (plan == null) {
|
||||||
|
throw new JsonException("保养计划不存在");
|
||||||
|
}
|
||||||
|
List<DevicePlanDetailVo> planDetailList = devicePlanDetailService.listByPlanId(planId);
|
||||||
|
if (CollectionUtil.isEmpty(planDetailList)) {
|
||||||
|
throw new JsonException("计划保养产品为空,不创建任务单");
|
||||||
|
}
|
||||||
|
List<DevicePlanDetailItemEntity> itemList = devicePlanDetailItemService.listByPlanId(planId);
|
||||||
|
Map<String, List<DevicePlanDetailItemEntity>> itemMap = new HashMap<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(itemList)) {
|
||||||
|
itemMap = itemList.stream().collect(Collectors.groupingBy(i -> i.getProductId() + "_" + i.getDeviceCode()));
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceUpkeepEntity deviceUpkeepEntity = DeviceUpkeepEntity.builder()
|
||||||
|
.taskId(SnowflakeUtil.getId())
|
||||||
|
.planId(plan.getPlanId())
|
||||||
|
.planName(plan.getName())
|
||||||
|
.chargeDeptCode(plan.getChargeDeptCode())
|
||||||
|
.name(plan.getName())
|
||||||
|
.finishCount(0)
|
||||||
|
.sysFlag(b)
|
||||||
|
.createTime(LocalDateTime.now())
|
||||||
|
.updateTime(LocalDateTime.now())
|
||||||
|
.createUserId(b ? null : user.getId())
|
||||||
|
.createUserName(b ? null : user.getEmployeeName())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
List<DeviceUpkeepDetailEntity> upkeepDetailList = new ArrayList<>();
|
||||||
|
List<DeviceUpkeepDetailItemEntity> upkeepDetailItemList = new ArrayList<>();
|
||||||
|
Map<String, List<DevicePlanDetailItemEntity>> finalItemMap = itemMap;
|
||||||
|
planDetailList.forEach(d -> {
|
||||||
|
List<DevicePlanDetailItemEntity> items = finalItemMap.get(d.getProductId() + "_" + d.getDeviceCode());
|
||||||
|
if (CollectionUtil.isEmpty(items)) {
|
||||||
|
items = new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<DevicePlanDetailItemEntity> productItems = finalItemMap.get(d.getProductId() + "_");
|
||||||
|
if (CollectionUtil.isNotEmpty(productItems)) {
|
||||||
|
items.addAll(productItems);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(items)) {
|
||||||
|
DeviceUpkeepDetailEntity detailEntity = DeviceUpkeepDetailEntity.builder()
|
||||||
|
.taskId(deviceUpkeepEntity.getTaskId())
|
||||||
|
.updateTime(LocalDateTime.now())
|
||||||
|
.finishFlag(false)
|
||||||
|
.build();
|
||||||
|
BeanUtil.copyProperties(d, detailEntity);
|
||||||
|
boolean opened = deviceInfoService.openCheckLock(d.getDeviceCode(), d.getDeptCode());
|
||||||
|
if (opened) {
|
||||||
|
items.forEach(item -> {
|
||||||
|
DeviceUpkeepDetailItemEntity deviceCheckDetailItem = DeviceUpkeepDetailItemEntity.builder()
|
||||||
|
.taskId(deviceUpkeepEntity.getTaskId())
|
||||||
|
.deviceCode(d.getDeviceCode())
|
||||||
|
.itemCode(item.getItemCode())
|
||||||
|
.itemName(item.getName())
|
||||||
|
.itemContent(item.getContent())
|
||||||
|
.finishFlag(false)
|
||||||
|
.updateTime(LocalDateTime.now())
|
||||||
|
.build();
|
||||||
|
// deviceCheckDetailItem.setUpdateTime(LocalDateTime.now());
|
||||||
|
upkeepDetailItemList.add(deviceCheckDetailItem);
|
||||||
|
});
|
||||||
|
detailEntity.setItemCount(items.size());
|
||||||
|
upkeepDetailList.add(detailEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(upkeepDetailList)) {
|
||||||
|
devicePlanService.addExecCount(planId);
|
||||||
|
deviceUpkeepEntity.setDeviceCount(upkeepDetailList.size());
|
||||||
|
super.save(deviceUpkeepEntity);
|
||||||
|
deviceUpkeepDetailService.saveBatch(upkeepDetailList);
|
||||||
|
if (CollectionUtil.isNotEmpty(upkeepDetailItemList)) {
|
||||||
|
deviceUpkeepDetailItemService.saveBatch(upkeepDetailItemList);
|
||||||
|
}else {
|
||||||
|
throw new JsonException(String.format("没有配置巡检项目,无法生成巡检单"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new JsonException(String.format("没有找到处于[%s]状态的设备,无法生成保养单", DeviceStatusEnum.NORMAL.getDesc()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceUpkeepPrintVo checkInfoPrint(Long taskId, String deviceCode) {
|
||||||
|
CompletableFuture<DeviceUpkeepVo> infoFuture = CompletableFuture.supplyAsync(() -> {
|
||||||
|
return super.baseMapper.getVoById(taskId);
|
||||||
|
}, taskExecutor);
|
||||||
|
CompletableFuture<List<DeviceUpkeepDetailEntity>> detailFuture = CompletableFuture.supplyAsync(() -> {
|
||||||
|
return deviceUpkeepDetailService.listByTaskId(taskId, deviceCode);
|
||||||
|
}, taskExecutor);
|
||||||
|
CompletableFuture<List<DeviceUpkeepDetailItemEntity>> detailItemFuture = CompletableFuture.supplyAsync(() -> {
|
||||||
|
return deviceUpkeepDetailItemService.listByTaskId(taskId, deviceCode);
|
||||||
|
}, taskExecutor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
CompletableFuture.allOf(detailItemFuture).get();
|
||||||
|
DeviceUpkeepVo upkeepVo = infoFuture.get();
|
||||||
|
List<DeviceUpkeepDetailEntity> details = detailFuture.get();
|
||||||
|
List<DeviceUpkeepDetailItemEntity> items = detailItemFuture.get();
|
||||||
|
if (upkeepVo == null || details == null || items == null) {
|
||||||
|
throw new JsonException("任务单不存在");
|
||||||
|
}
|
||||||
|
List<DeviceUpkeepPrintVo.DetailVo> detailVos = BeanUtil.copyToList(details, DeviceUpkeepPrintVo.DetailVo.class);
|
||||||
|
Map<String, List<DeviceUpkeepDetailItemEntity>> itemsMap = items.stream().collect(Collectors.groupingBy(DeviceUpkeepDetailItemEntity::getDeviceCode));
|
||||||
|
detailVos.forEach(i -> {
|
||||||
|
i.setDetailItems(itemsMap.get(i.getDeviceCode()));
|
||||||
|
});
|
||||||
|
DeviceUpkeepPrintVo vo = DeviceUpkeepPrintVo.builder()
|
||||||
|
.printTime(LocalDateTime.now())
|
||||||
|
.info(upkeepVo)
|
||||||
|
.details(detailVos)
|
||||||
|
.build();
|
||||||
|
return vo;
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void finishUpkeep(Long taskId, String deviceCode) {
|
||||||
|
boolean updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepEntity.class)
|
||||||
|
.setSql("finishCount = finishCount + 1")
|
||||||
|
.setSql(String.format("exceptionCount = exceptionCount + (select exceptionCount>0 from device_upkeep_detail where taskId = %s and deviceCode = '%s')", taskId, deviceCode))
|
||||||
|
.eq(DeviceUpkeepEntity::getTaskId, taskId)
|
||||||
|
.last("and finishCount+1 <= deviceCount")
|
||||||
|
);
|
||||||
|
if (updated) {
|
||||||
|
updated = super.update(Wrappers.lambdaUpdate(DeviceUpkeepEntity.class)
|
||||||
|
.set(DeviceUpkeepEntity::getFinishFlag, true)
|
||||||
|
.set(DeviceUpkeepEntity::getFinishTime, LocalDateTime.now())
|
||||||
|
.set(DeviceUpkeepEntity::getUpdateTime,LocalDateTime.now())
|
||||||
|
.eq(DeviceUpkeepEntity::getTaskId, taskId)
|
||||||
|
.eq(DeviceUpkeepEntity::getFinishFlag, false)
|
||||||
|
.last("and finishCount = deviceCount")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUpkeepDetailVo> pageListDetail(DeviceUpkeepQuery query) {
|
||||||
|
if (query.getPage() != null){
|
||||||
|
PageHelper.startPage(query.getPage(),query.getLimit());
|
||||||
|
}
|
||||||
|
List<DeviceUpkeepDetailVo> list = super.baseMapper.pageListDetail(query);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.glxp.api.vo.dev;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepDetailVo {
|
||||||
|
|
||||||
|
String deviceCode;
|
||||||
|
String deptName;
|
||||||
|
Boolean finishFlag;
|
||||||
|
String manufactory;
|
||||||
|
Integer itemCount;
|
||||||
|
Integer exceptionCount;
|
||||||
|
Integer finishCount;
|
||||||
|
Integer deviceCount;
|
||||||
|
String createUserName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.glxp.api.vo.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.dev.DeviceCheckDetailEntity;
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepDetailItemEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DeviceUpkeepPrintVo {
|
||||||
|
|
||||||
|
LocalDateTime printTime;
|
||||||
|
|
||||||
|
DeviceUpkeepVo info;
|
||||||
|
|
||||||
|
List<DetailVo> details;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DetailVo extends DeviceCheckDetailEntity {
|
||||||
|
public List<DeviceUpkeepDetailItemEntity> detailItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.glxp.api.vo.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.dev.DeviceUpkeepEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceUpkeepVo extends DeviceUpkeepEntity {
|
||||||
|
|
||||||
|
String chargeDeptName;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.glxp.api.dao.dev.DeviceUpkeepMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceUpkeepEntity">
|
||||||
|
<id property="taskId" column="taskId" jdbcType="BIGINT"/>
|
||||||
|
<result property="planId" column="planId" jdbcType="BIGINT"/>
|
||||||
|
<result property="planName" column="planName" jdbcType="VARCHAR"/>
|
||||||
|
<result property="upkeepUserId" column="upkeepUserId" jdbcType="BIGINT"/>
|
||||||
|
<result property="upkeepUserName" column="upkeepUserName" jdbcType="VARCHAR"/>
|
||||||
|
<result property="upkeepUserPhone" column="upkeepUserPhone" jdbcType="VARCHAR"/>
|
||||||
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||||
|
<result property="sysFlag" column="sysFlag" jdbcType="BIT"/>
|
||||||
|
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="createUserId" column="createUserId" jdbcType="BIGINT"/>
|
||||||
|
<result property="createUserName" column="createUserName" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
taskId,planId,planName,
|
||||||
|
upkeepUserId,upkeepUserName,upkeepUserPhone,
|
||||||
|
name,remark,sysFlag,
|
||||||
|
createTime,createUserId,createUserName
|
||||||
|
</sql>
|
||||||
|
<select id="pageVo" resultType="com.glxp.api.vo.dev.DeviceUpkeepVo">
|
||||||
|
select c.*, d.name chargeDeptName
|
||||||
|
from device_upkeep c
|
||||||
|
left join auth_dept d on d.code = c.chargeDeptCode
|
||||||
|
<where>
|
||||||
|
<if test="taskId!=null">
|
||||||
|
and c.taskId = #{taskId}
|
||||||
|
</if>
|
||||||
|
<if test="chargeDeptCode!=null and chargeDeptCode!=''">
|
||||||
|
and c.chargeDeptCode = #{chargeDeptCode}
|
||||||
|
</if>
|
||||||
|
<if test="finishFlag!=null">
|
||||||
|
and c.finishFlag = #{finishFlag}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by c.createTime desc
|
||||||
|
</select>
|
||||||
|
<select id="getVoById" resultType="com.glxp.api.vo.dev.DeviceUpkeepVo">
|
||||||
|
select u.*, d.name chargeDeptName
|
||||||
|
from device_upkeep u
|
||||||
|
left join auth_dept d on d.code = u.chargeDeptCode
|
||||||
|
where u.taskId = #{taskId}
|
||||||
|
</select>
|
||||||
|
<select id="pageListDetail" resultType="com.glxp.api.vo.dev.DeviceUpkeepDetailVo">
|
||||||
|
select dud.deviceCode deviceCode,dud.deptName deptName,dud.finishFlag finishFlag,dud.manufactory manufactory, itemCount,dud.exceptionCount exceptionCount,dud.finishCount finishCount,
|
||||||
|
createUserName,deviceCount
|
||||||
|
from device_upkeep_detail dud
|
||||||
|
left join device_upkeep du on dud.taskId = du.taskId
|
||||||
|
left join device_upkeep_detail_item dudi on dud.taskId = dudi.taskId
|
||||||
|
where dud.deviceCode = #{deviceCode}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue