5-20 设备数据

dev_test1.0
wangwei 11 months ago
parent b952f02c2b
commit 629f9ca983

@ -77,7 +77,7 @@ public class HdSchemaExecutor implements ApplicationRunner {
// schema.add(new SchemaData("v2.1", "schema_v2.1.sql"));
// schema.add(new SchemaData("v2.2", "schema_v2.2.sql"));
schema.add(new SchemaData("v2.3", "schema_v2.3.sql"));
// schema.add(new SchemaData("v2.4", "schema_v2.4.sql"));
schema.add(new SchemaData("v2.4", "schema_v2.4.sql"));
}
}

@ -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("删除成功");
}
}

@ -17,9 +17,7 @@ import com.glxp.api.entity.dev.DeviceInfoEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.dev.DeviceInfoDetailByDeptCodeQuery;
import com.glxp.api.req.dev.DeviceInfoDetailQuery;
import com.glxp.api.req.dev.DeviceInfoQuery;
import com.glxp.api.req.dev.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.dev.DeviceChangeLogService;
import com.glxp.api.service.dev.DeviceInfoService;
@ -41,18 +39,19 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.awt.*;
import java.awt.font.LineMetrics;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Base64;
import java.util.HashMap;
import java.util.*;
import java.util.List;
import java.util.Map;
@RestController
@ -76,13 +75,7 @@ public class DeviceInfoController extends BaseController {
@AuthRuleAnnotation("")
@GetMapping("/udi/device/code/gen")
public BaseResponse genDeviceCode() {
String deviceCode = "";
DeviceInfoEntity deviceInfo = null;
do {
deviceCode = "S" + RandomUtil.randomNumbers(10);
deviceInfo = deviceInfoService.getById(deviceCode);
} while (deviceInfo != null);
return ResultVOUtils.success(deviceCode);
return ResultVOUtils.success(deviceInfoService.genDeviceCode());
}
/**
@ -151,6 +144,8 @@ public class DeviceInfoController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udi/device/info/detailByDeptCode/page")
public BaseResponse detailByDeptCode(@RequestBody @Valid DeviceInfoDetailByDeptCodeQuery query) {
AuthAdmin user = super.getUser();
query.setDeptCode(user.getLocDeptCode());
List<DeviceInfoVo> list = deviceInfoService.detail(query);
PageInfo pageInfo = new PageInfo<>(list);
PageSimpleResponse page = new PageSimpleResponse();
@ -168,8 +163,6 @@ public class DeviceInfoController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udi/device/detailInfo/page")
public BaseResponse detailInfoPage(@RequestBody DeviceInfoDetailQuery query) {
AuthAdmin user = super.getUser();
query.setDeptCode(user.getLocDeptCode());
List<DeviceInfoVo> list = deviceInfoService.detail(query);
PageInfo pageInfo = new PageInfo<>(list);
PageSimpleResponse page = new PageSimpleResponse();

@ -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);
}
}

@ -9,21 +9,16 @@ import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.dev.DeviceRepairApplyEntity;
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.req.dev.DeviceRepairApplyAddParam;
import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam;
import com.glxp.api.req.dev.DeviceRepairApplyHallQuery;
import com.glxp.api.req.dev.DeviceRepairApplyQuery;
import com.glxp.api.req.dev.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.dev.DeviceRepairApplyService;
import com.glxp.api.vo.dev.DeviceRepairApplyVo;
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 org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@ -63,9 +58,15 @@ public class DeviceRepairApplyController extends BaseController {
@PostMapping("/udi/device/repair/apply/hall/page")
public BaseResponse adminPage(@RequestBody DeviceRepairApplyHallQuery query) {
DeviceRepairApplyQuery applyQuery = new DeviceRepairApplyQuery();
applyQuery.setStatus(DeviceRepairApplyStatusEnum.WAIT_PROCESS);
applyQuery.setApplyId(query.getApplyId());
applyQuery.setApplyDeptCode(query.getApplyDeptCode());
ArrayList<DeviceRepairApplyStatusEnum> statusEnums = new ArrayList<>();
if (query.getIsFinish() == 1){
statusEnums.add(DeviceRepairApplyStatusEnum.FINISH);
}else {
statusEnums.add(DeviceRepairApplyStatusEnum.WAIT_PROCESS);
statusEnums.add(DeviceRepairApplyStatusEnum.PROCESSING);
}
applyQuery.setStatuss(statusEnums);
BeanUtil.copyProperties(query,applyQuery);
List<DeviceRepairApplyEntity> list = deviceRepairApplyService.pageList(applyQuery);
PageInfo pageInfo = new PageInfo<>(list);
PageSimpleResponse page = new PageSimpleResponse();

@ -8,11 +8,13 @@ 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.DeviceRepairApplyDetailEntity;
import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam;
import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery;
import com.glxp.api.entity.dev.DeviceRepairApplyEntity;
import com.glxp.api.req.dev.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.dev.DeviceRepairApplyDetailService;
import com.glxp.api.service.dev.DeviceRepairApplyService;
import com.glxp.api.vo.dev.DeviceRepairApplyDetailVo;
import com.glxp.api.vo.dev.DeviceRepairApplyVo;
import groovy.util.logging.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
@ -65,4 +67,18 @@ public class DeviceRepairApplyDetailController extends BaseController {
}
/**
*
*
* @param query
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/udi/device/repair/apply/listByIdAndCode")
public BaseResponse listByIdAndCode(@RequestBody @Valid DeviceRepairApplyListByIdAndCodeQuery query) {
DeviceRepairApplyDetailEntity entity = deviceRepairApplyDetailService.listByIdAndCode(query);
return ResultVOUtils.success(entity);
}
}

@ -1,19 +1,25 @@
package com.glxp.api.controller.dev;
import cn.hutool.core.bean.BeanUtil;
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.DeviceRepairApplyEntity;
import com.glxp.api.entity.dev.DeviceRepairEntity;
import com.glxp.api.req.dev.DeviceRepairQuery;
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.req.dev.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.dev.DeviceRepairApplyService;
import com.glxp.api.service.dev.DeviceRepairService;
import com.glxp.api.vo.dev.DeviceRepairApplyVo;
import groovy.util.logging.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@ -46,14 +52,14 @@ public class DeviceRepairController extends BaseController {
/**
*
*
* @param repairId id
* @param deviceRepairEntity
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("/udi/device/repair/finishByUser/{repairId}")
public BaseResponse finishByUser(@PathVariable Long repairId) {
@PostMapping("/udi/device/repair/finishByUser/repairId")
public BaseResponse finishByUser(@RequestBody DeviceRepairEntity deviceRepairEntity) {
AuthAdmin user = super.getUser();
deviceRepairService.finishByUser(repairId, user);
deviceRepairService.finishByUser(deviceRepairEntity, user);
return ResultVOUtils.successMsg("操作成功");
}

@ -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("操作成功");
}
}

@ -2,6 +2,12 @@ package com.glxp.api.dao.dev;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity;
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery;
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Administrator
@ -11,6 +17,7 @@ import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity;
*/
public interface DeviceRepairApplyDetailMapper extends BaseMapperPlus<DeviceRepairApplyDetailMapper,DeviceRepairApplyDetailEntity,DeviceRepairApplyDetailEntity> {
List<DeviceRepairApplyDetailMiniResponse> miniPage(@Param("param") DeviceRepairApplyDetailMiniQuery query);
}

@ -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);
}

@ -43,7 +43,7 @@ public class DeviceCheckItemDictEntity {
* id
*/
@TableField(value = "createUserId")
private Long createUserId;
private String createUserId;
/**
*
@ -51,9 +51,18 @@ public class DeviceCheckItemDictEntity {
@TableField(value = "createUserName")
private String createUserName;
/**
* 1: 2:
*/
@TableField(value = "type")
private Integer type;
/**
*
*/
@TableField(value = "createTime")
private LocalDateTime createTime;
}
}

@ -50,6 +50,12 @@ public class DevicePlanDetailItemEntity {
@TableField(value = "name")
private String name;
/**
* 1 2
*/
@TableField(value = "type")
private String type;
/**
*
*/

@ -91,6 +91,12 @@ public class DevicePlanEntity {
@TableField(value = "status")
private Integer status;
/**
* 1: 2:
*/
@TableField(value = "type")
private Integer type;
/**
*
*/

@ -195,6 +195,20 @@ public class DeviceRepairApplyDetailEntity {
@TableField(value = "confirmRemark")
private String confirmRemark;
/**
*
*/
@TableField(value = "livePath")
private String livePath;
/**
*
*/
@TableField(value = "diagnosisLivePath")
private String diagnosisLivePath;
/**
*
*/
@ -207,4 +221,11 @@ public class DeviceRepairApplyDetailEntity {
*/
@TableField(value = "updateTime")
private LocalDateTime updateTime;
/**
*
*/
@TableField(exist = false)
private String repairUserPhone;
}

@ -250,6 +250,39 @@ public class DeviceRepairEntity {
@TableField(value = "confirmRemark")
private String confirmRemark;
/**
*
*/
@TableField(value = "repairDescription")
private String repairDescription;
/**
*
*/
@TableField(value = "livePath")
private String livePath;
/**
*
*/
@TableField(value = "serviceLivePath")
private String serviceLivePath;
/**
*
*/
@TableField(value = "diagnosisLivePath")
private String diagnosisLivePath;
/**
* id
*/
@TableField(value = "repairUserId")
private Long repairUserId;
/**
*
*/

@ -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;
}

@ -13,4 +13,6 @@ public class DeviceRepairApplyHallQuery extends ListPageRequest {
*/
String applyDeptCode;
Integer isFinish;
}

@ -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;
}

@ -4,6 +4,8 @@ import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.List;
@Data
public class DeviceRepairApplyQuery extends ListPageRequest {
@ -33,4 +35,6 @@ public class DeviceRepairApplyQuery extends ListPageRequest {
*/
String repairInfo;
List<DeviceRepairApplyStatusEnum> statuss;
}

@ -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;
}

@ -3,6 +3,7 @@ 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.DeviceCheckDetailEntity;
import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery;
import com.glxp.api.req.dev.DeviceCheckDetailParam;
import com.glxp.api.req.dev.DeviceCheckDetailQuery;
import com.glxp.api.req.dev.DeviceCheckDetailRepairParam;
@ -32,4 +33,5 @@ public interface DeviceCheckDetailService extends IService<DeviceCheckDetailEnti
void finish(DeviceCheckDetailParam param, AuthAdmin user);
List<DeviceCheckDetailEntity> miniPage(DeviceCheckDetailMiniQuery query);
}

@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity;
import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam;
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery;
import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery;
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
import java.util.List;
@ -30,4 +33,8 @@ public interface DeviceRepairApplyDetailService extends IService<DeviceRepairApp
* @param deviceCode
*/
void finishDeviceRepair(Long applyId, String deviceCode);
DeviceRepairApplyDetailEntity listByIdAndCode(DeviceRepairApplyListByIdAndCodeQuery query);
List<DeviceRepairApplyDetailMiniResponse> miniPage(DeviceRepairApplyDetailMiniQuery query);
}

@ -6,7 +6,9 @@ import com.glxp.api.entity.dev.DeviceRepairApplyEntity;
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.req.dev.DeviceRepairApplyAddParam;
import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam;
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
import com.glxp.api.req.dev.DeviceRepairApplyQuery;
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
import java.util.List;
@ -36,4 +38,5 @@ public interface DeviceRepairApplyService extends IService<DeviceRepairApplyEnti
* @param applyId id
*/
void finishDeviceRepair(Long applyId);
}

@ -26,8 +26,8 @@ public interface DeviceRepairService extends IService<DeviceRepairEntity> {
*
*
*
* @param repairId id
* @param deviceRepairEntity id
* @param user
*/
void finishByUser(Long repairId, AuthAdmin user);
void finishByUser(DeviceRepairEntity deviceRepairEntity, AuthAdmin user);
}

@ -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);
}

@ -2,6 +2,7 @@ package com.glxp.api.service.dev.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
@ -10,6 +11,7 @@ import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.dev.DeviceCheckDetailEntity;
import com.glxp.api.entity.dev.DeviceRepairEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.dev.DeviceCheckDetailMiniQuery;
import com.glxp.api.req.dev.DeviceCheckDetailParam;
import com.glxp.api.req.dev.DeviceCheckDetailQuery;
import com.glxp.api.req.dev.DeviceCheckDetailRepairParam;
@ -140,6 +142,26 @@ public class DeviceCheckDetailServiceImpl extends ServiceImpl<DeviceCheckDetailM
@Override
public void finish(DeviceCheckDetailParam param, AuthAdmin user) {
}
@Override
public List<DeviceCheckDetailEntity> miniPage(DeviceCheckDetailMiniQuery query) {
if (query.getPage() != null) {
PageHelper.startPage(query.getPage(), query.getLimit());
}
LambdaQueryWrapper<DeviceCheckDetailEntity> queryWrapper = Wrappers.lambdaQuery(DeviceCheckDetailEntity.class)
.eq(DeviceCheckDetailEntity::getDeptCode, query.getDeptCode());
if (StrUtil.isNotBlank(query.getDeviceCodeAndUdi())) {
queryWrapper.and(qW -> {
qW.like(DeviceCheckDetailEntity::getDeviceCode, query.getDeviceCodeAndUdi())
.or().like(DeviceCheckDetailEntity::getUdi, query.getDeviceCodeAndUdi());
});
}
if (query.getFinishFlag() != null) {
queryWrapper.eq(DeviceCheckDetailEntity::getFinishFlag, query.getFinishFlag());
}
List<DeviceCheckDetailEntity> list = super.list(queryWrapper);
return list;
}
}

@ -13,7 +13,10 @@ import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum;
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.dev.DeviceRepairApplyDetailDiagnosisParam;
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
import com.glxp.api.req.dev.DeviceRepairApplyDetailQuery;
import com.glxp.api.req.dev.DeviceRepairApplyListByIdAndCodeQuery;
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
import com.glxp.api.service.dev.DeviceInfoService;
import com.glxp.api.service.dev.DeviceRepairApplyDetailService;
import com.glxp.api.service.dev.DeviceRepairApplyService;
@ -134,6 +137,32 @@ public class DeviceRepairApplyDetailServiceImpl extends ServiceImpl<DeviceRepair
deviceRepairApplyService.finishDeviceRepair(applyId);
}
}
@Override
public DeviceRepairApplyDetailEntity listByIdAndCode(DeviceRepairApplyListByIdAndCodeQuery query) {
DeviceRepairApplyEntity apply = deviceRepairApplyService.getOne(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class)
.eq(DeviceRepairApplyEntity::getId, query.getApplyId()));
if (apply == null) {
throw new JsonException("请核对报修单Id");
}
DeviceRepairApplyDetailEntity one = super.getOne(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class)
.eq(DeviceRepairApplyDetailEntity::getApplyId, query.getApplyId())
.eq(DeviceRepairApplyDetailEntity::getDeviceCode, query.getDeviceCode())
);
if (one == null) {
throw new JsonException(String.format("该设备不处于[%s]状态,无法完成维修", DeviceRepairApplyDetailStatusEnum.REPAIRING.getDesc()));
}
one.setRepairUserPhone(apply.getApplyUserPhone());
return one;
}
@Override
public List<DeviceRepairApplyDetailMiniResponse> miniPage(DeviceRepairApplyDetailMiniQuery query) {
if (query.getPage() != null) {
PageHelper.startPage(query.getPage(), query.getLimit());
}
return super.baseMapper.miniPage(query);
}
}

@ -13,7 +13,9 @@ import com.glxp.api.entity.dev.DeviceRepairApplyEntity;
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
import com.glxp.api.req.dev.DeviceRepairApplyAddParam;
import com.glxp.api.req.dev.DeviceRepairApplyConfirmParam;
import com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery;
import com.glxp.api.req.dev.DeviceRepairApplyQuery;
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
import com.glxp.api.service.dev.DeviceInfoService;
import com.glxp.api.service.dev.DeviceRepairApplyDetailService;
import com.glxp.api.service.dev.DeviceRepairApplyService;
@ -147,6 +149,7 @@ public class DeviceRepairApplyServiceImpl extends ServiceImpl<DeviceRepairApplyM
.last("and deviceCount = finishCount")
);
}
}

@ -59,9 +59,14 @@ public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, Dev
}
}
@Override
@Transactional
public void finishByUser(Long repairId, AuthAdmin user) {
public void finishByUser(DeviceRepairEntity deviceRepairEntity, AuthAdmin user) {
Long repairId = deviceRepairEntity.getId();
if (repairId == null) {
throw new JsonException("未找到维修单");
}
// 获取维修单信息
DeviceRepairEntity entity = super.getById(repairId);
if (entity == null) {
@ -74,6 +79,8 @@ public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, Dev
.set(DeviceRepairEntity::getConfirmDeptCode, user.getLocDeptCode())
.set(DeviceRepairEntity::getConfirmDeptName, user.getDeptName())
.set(DeviceRepairEntity::getConfirmTime, LocalDateTime.now())
.set(DeviceRepairEntity::getRepairDescription, deviceRepairEntity.getRepairDescription())
.set(DeviceRepairEntity::getServiceLivePath, deviceRepairEntity.getServiceLivePath())
.set(DeviceRepairEntity::getUpdateTime,LocalDateTime.now())
.eq(DeviceRepairEntity::getId, repairId)
.eq(DeviceRepairEntity::getCreateUserId, user.getId())
@ -87,6 +94,8 @@ public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, Dev
deviceInfoService.finishRepair(entity.getDeviceCode(), entity.getDeptCode(), repairId, entity.getRepairUserName(), entity.getRepairUserPhone());
}
}

@ -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;
}

@ -45,4 +45,69 @@
supName,confirmUserId,confirmUserName,
confirmTime,confirmRemark,updateTime
</sql>
<select id="miniPage" parameterType="com.glxp.api.req.dev.DeviceRepairApplyDetailMiniQuery"
resultType="com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse">
select
drad.applyId,
drad.deviceCode,
drad.deptCode,
drad.deptName,
drad.description,
drad.status,
drad.repairFlag,
drad.repairId,
drad.productId,
drad.udi,
drad.nameCode,
drad.productName,
drad.ggxh,
drad.batchNo,
drad.serialNo,
drad.productionDate,
drad.expireDate,
drad.manufactory,
drad.measname,
drad.zczbhhzbapzbh,
drad.supId,
drad.supName,
drad.confirmUserId,
drad.confirmUserName,
drad.confirmTime,
drad.confirmRemark,
dra.id,
dra.applyDeptCode,
dra.applyDeptName,
dra.applyUserId,
dra.applyUserName,
dra.applyUserPhone,
dra.applyTime,
dra.deviceCount,
dra.finishCount,
dra.confirmUserId,
dra.confirmUserName,
dra.confirmTime,
dra.finishTime
from device_repair_apply_detail drad
Left Join device_repair_apply dra ON drad.applyId = dra.id
<where>
<if test="param.deviceCodeAndUdi!=null and param.deviceCodeAndUdi!=''">
and (
drad.deviceCode like concat('%',#{param.deviceCodeAndUdi},'%')
or
drad.udi like concat('%',#{param.deviceCodeAndUdi},'%')
)
</if>
<if test="param.deptCode != null and param.deptCode != ''">
AND drad.deptCode = #{param.deptCode}
</if>
<if test="param.status != null and param.status != ''">
AND drad.status = #{param.status}
</if>
</where>
</select>
</mapper>

@ -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>

@ -817,3 +817,7 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailProductAttributes',
'tinyint NULL DEFAULT NULL COMMENT ''校验产品属性 1校验2.无需校验''', 1);
CALL Pro_Temp_ColumnWork('auth_user', 'lastUpdatePwdTime', 'datetime', 1);

@ -132,7 +132,7 @@ CREATE TABLE if not exists `device_check`
ROW_FORMAT=Dynamic;
CREATE TABLE IF NOT EXISTS `device_check_detail`
CREATE TABLE IF NOT EXISTS `device_check_detail`
(
`taskId` bigint NOT NULL COMMENT '任务id',
`deviceCode` varbinary(255) NOT NULL COMMENT '设备编码',
@ -168,7 +168,7 @@ CREATE TABLE if not exists `device_check`
COLLATE=utf8mb4_0900_ai_ci COMMENT='巡检任务明细'
ROW_FORMAT=Dynamic;
CREATE TABLE IF NOT EXISTS `device_check_detail_item`
CREATE TABLE IF NOT EXISTS `device_check_detail_item`
(
`taskId` bigint NOT NULL COMMENT '任务id',
`deviceCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
@ -389,7 +389,7 @@ DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci COMMENT='设备变更日志表'
ROW_FORMAT=Dynamic;
CREATE TABLE `device_change_order` (
CREATE TABLE IF NOT EXISTS `device_change_order` (
`orderId` bigint NOT NULL COMMENT '编码',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库change:变更归属',
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 2.完成(目标确认接收) 3.目标部门拒收4.取消',
@ -430,12 +430,23 @@ CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription',
' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''',
1);
INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43');
INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`) VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36');
INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'processing', '1002', '手术室', 1, '超级用户', '18238132561', '2024-05-07 19:07:56', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:11:48', NULL, '2024-05-09 11:59:52');
INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'processing', '1002', '手术室', 1, '超级用户', '15866936214', '2024-05-07 19:09:32', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:10:46', NULL, '2024-05-09 14:29:19');
INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801533814042624, 'S0185624335', '1002', '手术室', 'SUCCESS!!!!!!!!!!', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', 'zxzxz111', '11111111111111111', '2024-05-01', '2024-05-30', '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:07:56');
INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`) VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32');
INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`)
VALUES ('S0790586160', '1002', 'change', b'1', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 0, 0, 0, 1788043097458315264, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:09:15', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:43');
INSERT ignore INTO `device_info` (`deviceCode`, `deptCode`, `status`, `checkLock`, `udi`, `nameCode`, `productId`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `changeCount`, `repairApplyCount`, `repairCount`, `checkCount`, `lastChangeOrderId`, `lastRepairApplyId`, `lastRepairApplyTime`, `lastRepairId`, `lastRepairUserName`, `lastRepairUserPhone`, `lastRepairTime`, `lastCheckUserId`, `lastCheckUserName`, `lastCheckPhone`, `lastCheckTime`, `lastCheckTaskId`, `createTime`, `createUserId`, `createUserName`, `assetType`, `sasacType`, `assetMnemonicCode`, `number`, `acquisitionMethod`, `purpose`, `depreciationYear`, `depreciationMonth`, `invCode`, `estimatedTotalHour`, `dayHour`, `assetValue`, `ownFund`, `financialAppropriation`, `educationFund`, `otherFund`, `nonPeerFinancialAppropriation`, `ybbm`, `catalogname1`, `catalogname2`, `catalogname3`, `catalogCode`, `catalogCode1`, `catalogCode2`, `catalogCode3`, `managementCategory`, `endUser`, `estimatedResidualValue`, `currencyType`, `purType`, `purchaseDate`, `addDate`, `assetName`, `isImperative`, `isMaintain`, `imperativeCycle`, `maintainCycle`, `startImperativeDate`, `startMaintainDate`, `serviceType`, `maintainType`, `managerUser`, `approveUser`, `ledgerAccount`, `impairmentProvision`, `estimatedWorkload`, `completedWorkload`, `maintenanceType`, `maintenanceCycle`, `startMaintenancDate`, `endMaintenancDate`, `networkType`, `UserRole`, `isAddDomain`, `isUDisc`, `ascriptionType`, `assetReserveType`, `updateTime`)
VALUES ('S3054245435', '1002', 'repair_apply', b'0', NULL, '06902139333834', 700205494, '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, 0, 1, 0, 0, 1788042594527952896, '1788055560932900864', '2024-05-08 11:57:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-08 11:06:23', 1, '超级用户', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-09 10:48:36');
INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`)
VALUES (1787801533814042624, 'processing', '1002', '手术室', 1, '超级用户', '18238132561', '2024-05-07 19:07:56', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:11:48', NULL, '2024-05-09 11:59:52');
INSERT ignore INTO `device_repair_apply` (`id`, `status`, `applyDeptCode`, `applyDeptName`, `applyUserId`, `applyUserName`, `applyUserPhone`, `applyTime`, `deviceCount`, `finishCount`, `confirmDeptCode`, `confirmDeptName`, `confirmUserId`, `confirmUserName`, `confirmPhone`, `confirmTime`, `finishTime`, `updateTime`)
VALUES (1787801935535218688, 'processing', '1002', '手术室', 1, '超级用户', '15866936214', '2024-05-07 19:09:32', 1, 0, '1002', '手术室', 1, '超级用户', '15752121213', '2024-05-07 19:10:46', NULL, '2024-05-09 14:29:19');
INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`)
VALUES (1787801533814042624, 'S0185624335', '1002', '手术室', 'SUCCESS!!!!!!!!!!', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', 'zxzxz111', '11111111111111111', '2024-05-01', '2024-05-30', '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:07:56');
INSERT ignore INTO `device_repair_apply_detail` (`applyId`, `deviceCode`, `deptCode`, `deptName`, `description`, `diagnosisInfo`, `status`, `repairFlag`, `repairId`, `productId`, `udi`, `nameCode`, `productName`, `ggxh`, `batchNo`, `serialNo`, `productionDate`, `expireDate`, `manufactory`, `measname`, `zczbhhzbapzbh`, `supId`, `supName`, `confirmUserId`, `confirmUserName`, `confirmTime`, `confirmRemark`, `confirmDeptCode`, `confirmDeptName`, `finishTime`, `updateTime`)
VALUES (1787801935535218688, 'S1216934642', '1002', '手术室', 'ZZZZZZZZZZZZZZZZZZZZZZZ', NULL, 'wait_diagnosis', NULL, NULL, 700205494, NULL, '06902139333834', '金属骨针', 'GZZH04YB φ2.0×200mm', NULL, NULL, NULL, NULL, '大博医疗科技股份有限公司', '', '国械注准20173461003,国械注准20173131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-05-07 19:09:32');
CREATE TABLE IF NOT EXISTS `thr_manufacturer`
@ -463,6 +474,44 @@ COLLATE=utf8mb4_0900_ai_ci COMMENT='第三方往来单位类型'
ROW_FORMAT=Dynamic;
CALL Pro_Temp_ColumnWork('device_check_item_dict', 'type',
' tinyint NULL DEFAULT NULL COMMENT ''项目字典类型 1:巡检项目;2:保养项目''',
1);
CALL Pro_Temp_ColumnWork('device_plan', 'type',
' tinyint NULL DEFAULT NULL COMMENT ''计划类型 1:巡检计划; 2:保养计划''',
1);
CALL Pro_Temp_ColumnWork('device_plan_detail_item', 'type',
' tinyint NULL DEFAULT NULL COMMENT ''项目类型 1:巡检项目; 2:保养项目''',
1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'produceBusiness',
' tinyint NULL DEFAULT NULL COMMENT ''生产企业信息''',
1);
CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'livePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修现场照片''',
1);
CALL Pro_Temp_ColumnWork('device_repair', 'livePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''报修现场照片''',
1);
CALL Pro_Temp_ColumnWork('device_repair', 'serviceLivePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修后现场照片''',
1);
CALL Pro_Temp_ColumnWork('device_repair', 'diagnosisLivePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''',
1);
CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'diagnosisLivePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''',
1);
CALL Pro_Temp_ColumnWork('device_repair', 'repairUserId', 'bigint DEFAULT NULL COMMENT''报修人id''', 1);
CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription',
' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''',
1);
ALTER TABLE device_repair
MODIFY COLUMN `diagnosisInfo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '诊断信息' AFTER `description`;
ALTER TABLE device_plan_detail_item
DROP PRIMARY KEY,
ADD PRIMARY KEY (`planId`, `productId`, `itemCode`, `deviceCode`) USING BTREE;

Loading…
Cancel
Save