提交 ece3b0d3 authored 作者: zhoushaopan's avatar zhoushaopan

feat(日常检查模块): 新增流程

新增流程
上级 d59d5c53
...@@ -375,7 +375,13 @@ public enum LogType { ...@@ -375,7 +375,13 @@ public enum LogType {
REPAIR_BACK_21(171,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_UNDER_DRAFT.id, "省直属等待出库"), REPAIR_BACK_21(171,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_UNDER_DRAFT.id, "省直属等待出库"),
ALLOT_BACK_21(172,ALLOT_BACK.id,ORIGIN_STATUS.id,BACK_UNDER_DRAFT.id,"省直属等待出库"), ALLOT_BACK_21(172,ALLOT_BACK.id,ORIGIN_STATUS.id,BACK_UNDER_DRAFT.id,"省直属等待出库"),
READ_SELF(173,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK.id,"开始进行盘点自查"), READ_SELF(173,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK.id,"开始进行盘点自查"),
READ_SELF_END(174,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK_END.id,"盘点自查结束"); READ_SELF_END(174,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK_END.id,"盘点自查结束"),
DAILY_CHECK_START(175,DAILY_SELF_CHECK.id,ORIGIN_STATUS.id,WAIT_CHECK.id,"发起日常检查"),
DAILY_CHECKED(176,DAILY_SELF_CHECK.id,WAIT_CHECK.id,WAIT_CHECK_RESULT.id,"等待上传校验结果"),
DAILY_CHECK_END(177,DAILY_SELF_CHECK.id,WAIT_CHECK_FILE.id,END.id,"日常检查任务完结"),
DAILY_CHECK_RE(178,DAILY_SELF_CHECK.id,WAIT_CHECK_RESULT.id,WAIT_CHECK_FILE.id,"提交检查结果"),
DAILY_CHECK_RE2(179,DAILY_SELF_CHECK.id,WAIT_CHECK_FILE.id,WAIT_CHECK_FILE.id,"提交检查结果");
public Integer id; public Integer id;
......
...@@ -329,8 +329,16 @@ public enum StatusEnum { ...@@ -329,8 +329,16 @@ public enum StatusEnum {
* 盘存自查状态 * 盘存自查状态
*/ */
READ_SELF_CHECK(3002,"开始进行盘点自查"), READ_SELF_CHECK(3002,"开始进行盘点自查"),
READ_SELF_CHECK_END(3003,"盘点自查结束") READ_SELF_CHECK_END(3003,"盘点自查结束"),
;
/**
* 日常检查
*/
WAIT_CHECK(3004,"待检查"),
WAIT_CHECK_RESULT(3005,"等待上传校验结果"),
WAIT_CHECK_FILE(3006,"等待上传日常检查单")
;
public Integer id; public Integer id;
......
package com.tykj.dev.misc.utils;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
/**
* @author zsp
* @create 2022/4/20 9:32
*/
public class DateUtil {
public static LocalDateTime getLocalDateTime(Date date){
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
return instant.atZone(zoneId).toLocalDateTime();
}
public static LocalDate getLocalDate(Date date){
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime();
return localDateTime.toLocalDate();
}
}
...@@ -8,15 +8,15 @@ import com.tykj.dev.device.selfcheck.service.SelfCheckUnitBillService; ...@@ -8,15 +8,15 @@ import com.tykj.dev.device.selfcheck.service.SelfCheckUnitBillService;
import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSaveVo;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo; import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import com.tykj.dev.device.selfcheck.subject.vo.daily.*;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.cache.StoreCache; import com.tykj.dev.device.user.cache.StoreCache;
import com.tykj.dev.device.user.cache.UnitsCache; import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.cache.UserCache; import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.subject.service.PublicService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.qrcode.vo.TaskData;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -26,10 +26,10 @@ import org.springframework.http.ResponseEntity; ...@@ -26,10 +26,10 @@ import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -55,9 +55,6 @@ public class DailyCheckController { ...@@ -55,9 +55,6 @@ public class DailyCheckController {
@Resource @Resource
private TaskService taskService; private TaskService taskService;
@Resource
private StoreCache storeCache;
@Resource @Resource
private UserCache userCache; private UserCache userCache;
...@@ -67,15 +64,64 @@ public class DailyCheckController { ...@@ -67,15 +64,64 @@ public class DailyCheckController {
@Resource @Resource
private DeviceLibraryService deviceLibraryService; private DeviceLibraryService deviceLibraryService;
@ApiOperation(value = "发起任务", notes = "发起任务")
@GetMapping(value = "/createBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity createBill(){
DailyCheckBill checkBill = dailyCheckBillService.createBill();
return ResponseEntity.ok(checkBill);
}
@ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务") @ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务")
@PostMapping(value = "/addDayBill") @PostMapping(value = "/addDayBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo){ public ResponseEntity addDayBill(@RequestBody @Validated DailyCheckSaveVo dailyCheckSaveVo){
dailyCheckBillService.addDayBill(selfCheckSaveVo); DailyCheckBill dailyCheckBill = dailyCheckBillService.addDayBill(dailyCheckSaveVo);
return ResponseEntity.ok(dailyCheckBill);
}
@ApiOperation(value = "保存", notes = "保存")
@PostMapping(value = "/updateBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateBill(@RequestBody DailyCheckUpdateVo dailyCheckUpdateVo){
dailyCheckBillService.updateBill(dailyCheckUpdateVo);
return ResponseEntity.ok("保存成功");
}
@ApiOperation(value = "完结", notes = "完结")
@PostMapping(value = "/endDayBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity endDayBill(@RequestBody @Validated DailyCheckEndVo dailyCheckEndVo){
dailyCheckBillService.endDayBill(dailyCheckEndVo);
return ResponseEntity.ok("发起成功"); return ResponseEntity.ok("发起成功");
} }
@ApiOperation(value = "生成二维码", notes = "生成二维码")
@PostMapping(value = "/createQrcode")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity createQrcode(@RequestBody TaskData taskData){
List<String> qrcode = dailyCheckBillService.createQrcode(taskData);
return ResponseEntity.ok(qrcode);
}
@ApiOperation(value = "解析二维码", notes = "解析二维码")
@PostMapping(value = "/parseQrCode")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity parseQrCode(@RequestBody List<String> strings){
List<DeviceLibrary> deviceLibraries = dailyCheckBillService.parseQrCode(strings);
deviceLibraries.forEach(DeviceLibrary::setConfigName);
return ResponseEntity.ok(deviceLibraries);
}
@ApiOperation(value = "查询详情", notes = "查询详情")
@GetMapping(value = "/selectDetail")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity selectDetail(Integer billId){
Map<String, Object> detail = dailyCheckBillService.selectDetail(billId);
return ResponseEntity.ok(detail);
}
@ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表") @ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表")
@PostMapping(value = "/saveDayDevice") @PostMapping(value = "/saveDayDevice")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -86,8 +132,8 @@ public class DailyCheckController { ...@@ -86,8 +132,8 @@ public class DailyCheckController {
@ApiOperation(value = "查询自查任务", notes = "可以通过这个接口查询自查任务") @ApiOperation(value = "查询自查任务", notes = "可以通过这个接口查询自查任务")
@PostMapping(value = "/summary") @PostMapping(value = "/summary")
public ResponseEntity selectSelfExaminationBill(@RequestBody SelfCheckSelectVo selfCheckSelectVo) { public ResponseEntity selectSelfExaminationBill(@RequestBody DailyCheckSelectVo dailyCheckSelectVo) {
Page<DailyCheckBill> page = dailyCheckBillService.getDailyCheckPage(selfCheckSelectVo); Page<DailyCheckBill> page = dailyCheckBillService.getDailyCheckPage(dailyCheckSelectVo);
for (DailyCheckBill dailyCheckBill : page.getContent()) { for (DailyCheckBill dailyCheckBill : page.getContent()) {
if (dailyCheckBill.getCreateUnitId()!=null) { if (dailyCheckBill.getCreateUnitId()!=null) {
dailyCheckBill.setCreateUnit(unitsCache.findById(dailyCheckBill.getId()).getName()); dailyCheckBill.setCreateUnit(unitsCache.findById(dailyCheckBill.getId()).getName());
...@@ -102,15 +148,19 @@ public class DailyCheckController { ...@@ -102,15 +148,19 @@ public class DailyCheckController {
dailyCheckBill.setCreateUser(userCache.findById(dailyCheckBill.getUseraId()).getName()); dailyCheckBill.setCreateUser(userCache.findById(dailyCheckBill.getUseraId()).getName());
} }
if (dailyCheckBill.getId()!=null){ if (dailyCheckBill.getId()!=null){
dailyCheckBill.setTaskId(taskService.get(dailyCheckBill.getId(),4).getId()); dailyCheckBill.setTaskId(taskService.get(dailyCheckBill.getId(),32).getId());
}
if (dailyCheckBill.getStorageLocationId() != null){
dailyCheckBill.setStorageLocationName(storeCache.idToName(dailyCheckBill.getStorageLocationId()));
} }
} }
return ResultUtil.success(page); return ResultUtil.success(page);
} }
@ApiOperation(value = "查询自查任务", notes = "可以通过这个接口查询自查任务")
@GetMapping(value = "/taskId")
public ResponseEntity findByTaskId(Integer taskId) {
Map<String, Object> detail = dailyCheckBillService.selectDetailForTaskId(taskId);
return ResultUtil.success(detail);
}
@ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备") @ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备")
@GetMapping(value = "/findByUnitId") @GetMapping(value = "/findByUnitId")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -127,9 +177,19 @@ public class DailyCheckController { ...@@ -127,9 +177,19 @@ public class DailyCheckController {
deviceIds.add(i1); deviceIds.add(i1);
} }
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds); List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
deviceLibraryList.forEach(DeviceLibrary::setConfigName);
checkUnitBill.setDeviceLibraryList(deviceLibraryList); checkUnitBill.setDeviceLibraryList(deviceLibraryList);
} }
return ResultUtil.success(checkUnitBill); return ResultUtil.success(checkUnitBill);
} }
@ApiOperation(value = "是否保存", notes = "是否保存")
@PostMapping(value = "/isSave")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity isSave(@RequestBody SaveDailyTaskVo saveDailyTaskVo) {
dailyCheckBillService.isSave(saveDailyTaskVo);
return ResponseEntity.ok("操作成功");
}
} }
...@@ -1143,98 +1143,98 @@ public class SelfCheckController { ...@@ -1143,98 +1143,98 @@ public class SelfCheckController {
// return ResultUtil.success(selfExaminationBillEntity); // return ResultUtil.success(selfExaminationBillEntity);
// } // }
@ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表") // @ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表")
@PostMapping(value = "/saveDayDevice") // @PostMapping(value = "/saveDayDevice")
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public ResponseEntity saveDayDevice(@RequestBody SelfCheckUnitBill selfCheckUnitBill) { // public ResponseEntity saveDayDevice(@RequestBody SelfCheckUnitBill selfCheckUnitBill) {
SelfCheckUnitBill unitBill = service.add(selfCheckUnitBill); // SelfCheckUnitBill unitBill = service.add(selfCheckUnitBill);
return ResultUtil.success(unitBill); // return ResultUtil.success(unitBill);
} // }
//
@ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备") // @ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备")
@GetMapping(value = "/findByUnitId") // @GetMapping(value = "/findByUnitId")
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public ResponseEntity findByUnitId() { // public ResponseEntity findByUnitId() {
Integer unitId = userUtils.getCurrentUnitId(); // Integer unitId = userUtils.getCurrentUnitId();
SelfCheckUnitBill checkUnitBill = service.findByUnitId(unitId); // SelfCheckUnitBill checkUnitBill = service.findByUnitId(unitId);
if (checkUnitBill != null){ // if (checkUnitBill != null){
//取出设备的id // //取出设备的id
String dayDeviceList = checkUnitBill.getDayDeviceList(); // String dayDeviceList = checkUnitBill.getDayDeviceList();
String[] ids = dayDeviceList.split("x"); // String[] ids = dayDeviceList.split("x");
List<Integer> deviceIds = new ArrayList<>(); // List<Integer> deviceIds = new ArrayList<>();
for (int i = 0; i < ids.length; i++) { // for (int i = 0; i < ids.length; i++) {
int i1 = Integer.parseInt(ids[i]); // int i1 = Integer.parseInt(ids[i]);
deviceIds.add(i1); // deviceIds.add(i1);
} // }
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds); // List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
checkUnitBill.setDeviceLibraryList(deviceLibraryList); // checkUnitBill.setDeviceLibraryList(deviceLibraryList);
} // }
return ResultUtil.success(checkUnitBill); // return ResultUtil.success(checkUnitBill);
} // }
//
@ApiOperation(value = "生成二维码", notes = "生成二维码") // @ApiOperation(value = "生成二维码", notes = "生成二维码")
@PostMapping(value = "/createCode") // @PostMapping(value = "/createCode")
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public ResponseEntity createCode(@RequestBody TaskData taskData) { // public ResponseEntity createCode(@RequestBody TaskData taskData) {
List<String> qrcode = selfCheckBillService.createQrcode(taskData); // List<String> qrcode = selfCheckBillService.createQrcode(taskData);
return ResultUtil.success(qrcode); // return ResultUtil.success(qrcode);
} // }
//
@ApiOperation(value = "解析二维码", notes = "解析二维码") // @ApiOperation(value = "解析二维码", notes = "解析二维码")
@PostMapping(value = "/parseCode") // @PostMapping(value = "/parseCode")
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public ResponseEntity parseCode(@RequestBody List<String> strings) { // public ResponseEntity parseCode(@RequestBody List<String> strings) {
return ResultUtil.success(selfCheckBillService.parseQrCode(strings)); // return ResultUtil.success(selfCheckBillService.parseQrCode(strings));
} // }
//
@ApiOperation(value = "更新日常检查(日常检查的完结)", notes = "更新日常检查(日常检查的完结)") // @ApiOperation(value = "更新日常检查(日常检查的完结)", notes = "更新日常检查(日常检查的完结)")
@PostMapping(value = "/updateDayCheck") // @PostMapping(value = "/updateDayCheck")
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public ResponseEntity updateDayCheck(@RequestBody DayVO dayVO) { // public ResponseEntity updateDayCheck(@RequestBody DayVO dayVO) {
Integer billId = dayVO.getId(); // Integer billId = dayVO.getId();
SelfCheckBill selfCheckBill = selfCheckBillService.getOne(billId); // SelfCheckBill selfCheckBill = selfCheckBillService.getOne(billId);
BeanUtils.copyProperties(dayVO,selfCheckBill); // BeanUtils.copyProperties(dayVO,selfCheckBill);
Integer currentUserId = userUtils.getCurrentUserId(); // Integer currentUserId = userUtils.getCurrentUserId();
Integer taskId = dayVO.getTaskId(); // Integer taskId = dayVO.getTaskId();
//
if (dayVO.getNewDeviceList() != null) { // if (dayVO.getNewDeviceList() != null) {
//按新增不在系统的装备按rfid卡号拼接保存 // //按新增不在系统的装备按rfid卡号拼接保存
StringBuilder stringBuffer = new StringBuilder(); // StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append("."); // stringBuffer.append(".");
for (String s : dayVO.getNewDeviceList()) { // for (String s : dayVO.getNewDeviceList()) {
stringBuffer.append(s); // stringBuffer.append(s);
stringBuffer.append("."); // stringBuffer.append(".");
} // }
selfCheckBill.setNewDeviceDetail(stringBuffer.toString()); // selfCheckBill.setNewDeviceDetail(stringBuffer.toString());
} // }
//添加日志 // //添加日志
String deviceIdDetail = dayVO.getCheckDetail(); // String deviceIdDetail = dayVO.getCheckDetail();
String[] strings = deviceIdDetail.split("x"); // String[] strings = deviceIdDetail.split("x");
List<FileVo> fileVoList = new ArrayList<>(); // List<FileVo> fileVoList = new ArrayList<>();
if(dayVO.getCheckFiles()!=null&&dayVO.getCheckFiles().size()>0) { // if(dayVO.getCheckFiles()!=null&&dayVO.getCheckFiles().size()>0) {
selfCheckBill.setCheckFiles(FilesUtil.stringFileToList(dayVO.getCheckFiles())); // selfCheckBill.setCheckFiles(FilesUtil.stringFileToList(dayVO.getCheckFiles()));
dayVO.getCheckFiles().forEach(fileRet -> { // dayVO.getCheckFiles().forEach(fileRet -> {
fileVoList.add(new FileVo("日常检查单", fileRet.getName(), fileRet.getPreviewPath())); // fileVoList.add(new FileVo("日常检查单", fileRet.getName(), fileRet.getPreviewPath()));
}); // });
} // }
List<DeviceLogDto> deviceLogDtos = new ArrayList<>(); // List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
for (String s:strings) { // for (String s:strings) {
if (s.length()>=2) { // if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1)); // Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"发起日常检查",fileVoList,currentUserId,dayVO.getTaskId()); // DeviceLogDto deviceLogDto = new DeviceLogDto(id,"发起日常检查",fileVoList,currentUserId,dayVO.getTaskId());
deviceLogDtos.add(deviceLogDto); // deviceLogDtos.add(deviceLogDto);
} // }
} // }
executor.execute(()->deviceLogService.addAllLog(deviceLogDtos)); // executor.execute(()->deviceLogService.addAllLog(deviceLogDtos));
TaskBto taskBto = taskService.get(taskId); // TaskBto taskBto = taskService.get(taskId);
//任务推至完结 // //任务推至完结
TaskBto taskBto1 = taskService.moveToEnd(taskBto); // TaskBto taskBto1 = taskService.moveToEnd(taskBto);
//更新自查单 // //更新自查单
selfCheckBill.setCheckStatus(2); // selfCheckBill.setCheckStatus(2);
selfCheckBill.setTaskId(taskBto1.getId()); // selfCheckBill.setTaskId(taskBto1.getId());
SelfCheckBill save = selfCheckBillDao.save(selfCheckBill); // SelfCheckBill save = selfCheckBillDao.save(selfCheckBill);
return ResultUtil.success(save); // return ResultUtil.success(save);
} // }
// @ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情") // @ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情")
// @GetMapping(value = "/selectDetail") // @GetMapping(value = "/selectDetail")
......
...@@ -5,6 +5,7 @@ import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill; ...@@ -5,6 +5,7 @@ import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSaveVo; import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSaveVo;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo; import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import com.tykj.dev.device.selfcheck.subject.vo.daily.*;
import com.tykj.dev.misc.qrcode.vo.TaskData; import com.tykj.dev.misc.qrcode.vo.TaskData;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
...@@ -33,12 +34,28 @@ public interface DailyCheckBillService { ...@@ -33,12 +34,28 @@ public interface DailyCheckBillService {
*/ */
DailyCheckBill update(DailyCheckBill dailyCheckBill); DailyCheckBill update(DailyCheckBill dailyCheckBill);
/**
* 生成代办
* @return 实体对象
*/
DailyCheckBill createBill();
/** /**
* 发起日常检查 * 发起日常检查
* @param selfCheckSaveVo 日常检查的vo * @param dailyCheckSaveVo 更新保存列表设备
*/
DailyCheckBill addDayBill(DailyCheckSaveVo dailyCheckSaveVo);
/**
* 暂时保存
* @param dailyCheckUpdateVo
*/
DailyCheckBill updateBill(DailyCheckUpdateVo dailyCheckUpdateVo);
/**
* 完结日常检查
*/ */
void addDayBill(SelfCheckSaveVo selfCheckSaveVo); void endDayBill(DailyCheckEndVo dailyCheckEndVo);
/** /**
* 生成二维码 * 生成二维码
...@@ -60,11 +77,22 @@ public interface DailyCheckBillService { ...@@ -60,11 +77,22 @@ public interface DailyCheckBillService {
*/ */
Map<String,Object> selectDetail(Integer billId); Map<String,Object> selectDetail(Integer billId);
/**
* 根据业务id查询详情
* @param taskId 任务id
* @return 详情
*/
Map<String,Object> selectDetailForTaskId(Integer taskId);
/** /**
* 查询日常检查列表 * 查询日常检查列表
* @param selfCheckSelectVo * @param dailyCheckSelectVo
* @return * @return
*/ */
Page<DailyCheckBill> getDailyCheckPage(SelfCheckSelectVo selfCheckSelectVo); Page<DailyCheckBill> getDailyCheckPage(DailyCheckSelectVo dailyCheckSelectVo);
void isSave(SaveDailyTaskVo saveDailyTaskVo);
void delete(DailyCheckBill dailyCheckBill);
} }
package com.tykj.dev.device.selfcheck.service; package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDailyDeviceBill;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill; import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ public interface HistoryDailyDeviceBillService { ...@@ -14,7 +15,7 @@ public interface HistoryDailyDeviceBillService {
* 批量保存 * 批量保存
* @param historyDeviceBillList historyDeviceBillList * @param historyDeviceBillList historyDeviceBillList
*/ */
void batchSave(List<HistoryDeviceBill> historyDeviceBillList); void batchSave(List<HistoryDailyDeviceBill> historyDeviceBillList);
/** /**
...@@ -22,5 +23,8 @@ public interface HistoryDailyDeviceBillService { ...@@ -22,5 +23,8 @@ public interface HistoryDailyDeviceBillService {
* @param billId 业务id * @param billId 业务id
* @return 实体对象 * @return 实体对象
*/ */
List<HistoryDeviceBill> selectByBillId(Integer billId); List<HistoryDailyDeviceBill> selectByBillId(Integer billId);
void deleteList(List<HistoryDailyDeviceBill> deviceBillList);
} }
package com.tykj.dev.device.selfcheck.service.impl; package com.tykj.dev.device.selfcheck.service.impl;
import com.tykj.dev.device.selfcheck.repository.HistoryDailyDeviceBillDao;
import com.tykj.dev.device.selfcheck.service.HistoryDailyDeviceBillService; import com.tykj.dev.device.selfcheck.service.HistoryDailyDeviceBillService;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDailyDeviceBill;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill; import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
...@@ -12,13 +15,23 @@ import java.util.List; ...@@ -12,13 +15,23 @@ import java.util.List;
*/ */
@Service @Service
public class HistoryDailyDeviceBillServiceImpl implements HistoryDailyDeviceBillService { public class HistoryDailyDeviceBillServiceImpl implements HistoryDailyDeviceBillService {
@Resource
private HistoryDailyDeviceBillDao historyDailyDeviceBillDao;
@Override @Override
public void batchSave(List<HistoryDeviceBill> historyDeviceBillList) { public void batchSave(List<HistoryDailyDeviceBill> historyDeviceBillList) {
historyDailyDeviceBillDao.saveAll(historyDeviceBillList);
}
@Override
public List<HistoryDailyDeviceBill> selectByBillId(Integer billId) {
return historyDailyDeviceBillDao.findAllByBillId(billId);
} }
@Override @Override
public List<HistoryDeviceBill> selectByBillId(Integer billId) { public void deleteList(List<HistoryDailyDeviceBill> deviceBillList) {
return null; historyDailyDeviceBillDao.deleteAll(deviceBillList);
} }
} }
package com.tykj.dev.device.selfcheck.subject.domin; package com.tykj.dev.device.selfcheck.subject.domin;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -12,8 +13,9 @@ import org.springframework.data.annotation.CreatedDate; ...@@ -12,8 +13,9 @@ import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -57,8 +59,20 @@ public class DailyCheckBill { ...@@ -57,8 +59,20 @@ public class DailyCheckBill {
/** /**
* 自查时间 * 自查时间
*/ */
@ApiModelProperty(value = "自查时间") @ApiModelProperty(value = "自查时间(创建任务的时间)")
private Date checkTime; @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime checkStartTime;
@ApiModelProperty(value = "完成的时间(上传单据的时间)")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime checkEndTime;
@ApiModelProperty(value = "扫码完成时间")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime scanCodeTime;
/** /**
* 自查单位 * 自查单位
*/ */
...@@ -82,20 +96,26 @@ public class DailyCheckBill { ...@@ -82,20 +96,26 @@ public class DailyCheckBill {
*/ */
@ApiModelProperty(value = "自查结果") @ApiModelProperty(value = "自查结果")
private String checkResult; private String checkResult;
/**
* 自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
@Column(name = "check_detail",columnDefinition = "TEXT") @Column(name = "check_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增") @ApiModelProperty(value = "设备id 1,2,3")
private String checkDetail; private String checkDetail;
@Column(name = "check_detail0",columnDefinition = "TEXT")
@ApiModelProperty(value = "0 代表缺失")
private String checkDetail0;
@Column(name = "check_detail1",columnDefinition = "TEXT")
@ApiModelProperty(value = "1 代表无误")
private String checkDetail1;
@Column(name = "un_stock_detail",columnDefinition = "TEXT") @Column(name = "un_stock_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "非在库装备转JSon") @ApiModelProperty(value = "非在库装备转JSon")
private String unStockDetail; private String unStockDetail;
/** /**
* 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检) * 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)
*/ */
@ApiModelProperty(value = "自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)") @ApiModelProperty(value = "自查状态(0:待检查,1:未完成,2:已完成,3:超时完成)")
private Integer checkStatus; private Integer checkStatus;
/** /**
* 创建用户id * 创建用户id
...@@ -131,33 +151,13 @@ public class DailyCheckBill { ...@@ -131,33 +151,13 @@ public class DailyCheckBill {
*/ */
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
/**
* 自查未入库新增装备详情(RFID卡号以.为分隔符)
*/
@Column(name = "new_device_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查未入库新增装备详情(RFID卡号以.为分隔符)")
private String newDeviceDetail;
@ApiModelProperty(value = "手持终端信息") @ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation; private String handheldTerminalInformation;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房") @Column(name = "remake",columnDefinition = "TEXT")
private Integer storageLocationId; @ApiModelProperty(value = "备注说明")
private String remake;
@ApiModelProperty(value = "是否是日常检查",notes = "0代表 常规检查, 1代表 日常检查")
private Integer isDayCheck = 0;
// @ApiModelProperty(value = "生成二维码的地址")
// @Column(name = "qr_code_path",columnDefinition = "TEXT")
// private String qrcodePath ;
@ApiModelProperty(value = "日常检查装备的集合",example = "id 以x进行分割 id")
@Column(name = "day_check_detail",columnDefinition = "TEXT")
private String dayCheckDetail;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房")
@Transient
private String storageLocationName;
@ApiModelProperty(value = "检查人") @ApiModelProperty(value = "检查人")
@Transient @Transient
...@@ -196,10 +196,7 @@ public class DailyCheckBill { ...@@ -196,10 +196,7 @@ public class DailyCheckBill {
private List<DeviceLibrary> dayDeviceLibraries; private List<DeviceLibrary> dayDeviceLibraries;
@Transient @Transient
@ApiModelProperty("日常检查设备信息列表") @ApiModelProperty("0和1")
private List<DeviceLibrary> inDeviceLibraries; private List<HistoryDailyDeviceBill> historyDailyDeviceBills;
@Transient
@ApiModelProperty("日常检查的设备新增设备列表")
private List<DeviceLibrary> newDeviceLibraries;
} }
...@@ -65,11 +65,20 @@ public class HistoryDailyDeviceBill { ...@@ -65,11 +65,20 @@ public class HistoryDailyDeviceBill {
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
private String ownUnit; private String ownUnit;
@ApiModelProperty(value = "密级")
private String secretLevelName;
@ApiModelProperty(value = "可见范围")
private String invisibleRangeName;
@ApiModelProperty(value = "形态")
private String typeName;
/** /**
* 设备的状态 * 设备的状态
*/ */
@ApiModelProperty(value = "设备的状态",example = "0 缺失 1 正常 2 新增") @ApiModelProperty(value = "设备的状态",example = "0 缺失 1 正常 2 新增")
private Integer deviceStatus; private Integer checkResult;
@ApiModelProperty(value = "业务id") @ApiModelProperty(value = "业务id")
private Integer billId; private Integer billId;
......
...@@ -97,17 +97,4 @@ public class SelfCheckSaveVo { ...@@ -97,17 +97,4 @@ public class SelfCheckSaveVo {
return selfExaminationBillEntity; return selfExaminationBillEntity;
} }
public DailyCheckBill toDailyCheckBill() {
DailyCheckBill dailyCheckBill = new DailyCheckBill();
BeanUtils.copyProperties(this, dailyCheckBill);
dailyCheckBill.setCheckTime(new Date());
dailyCheckBill.setCheckStatus(0);
if(this.checkFiles!=null&&this.checkFiles.size()>0){
dailyCheckBill.setCheckFiles(FilesUtil.stringFileToList(this.checkFiles));
}
if (this.unStockDevices!=null&&this.unStockDevices.size()>0){
dailyCheckBill.setUnStockDetail(JacksonUtil.toJSon(this.unStockDevices));
}
return dailyCheckBill;
}
} }
package com.tykj.dev.device.selfcheck.subject.vo.daily;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("日常检查更新列表类vo")
@Repository
public class DailyCheckEndVo {
@ApiModelProperty(name = "主键id")
private Integer id;
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(name = "任务id", example = "1")
private Integer taskId;
@NotNull(message = "userbId不能为空")
@Min(value = 1,message = "userbId不能小于1")
@ApiModelProperty(name = "审核人ID", example = "1")
private Integer userbId;
@NotNull(message = "checkingCount不能为空")
@Min(value = 0,message = "checkingCount不能小于0")
@ApiModelProperty(name = "应查数量", example = "1")
private Integer checkingCount;
@NotNull(message = "checkedCount不能为空")
@Min(value = 0,message = "checkedCount不能小于0")
@ApiModelProperty(name = "实查数量", example = "1")
private Integer checkedCount;
@NotNull(message = "checkResult不能为空")
@ApiModelProperty(name = "自查结果", example = "通过")
private String checkResult;
@ApiModelProperty(name = "自查详情 1 正常")
private List<DeviceLibrary> checkDeviceList1;
@ApiModelProperty(name = "自查详情 0 缺失")
private List<DeviceLibrary> checkDeviceList0;
@ApiModelProperty(value = "检查附件名")
private List<FileRet> checkFiles;
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
@ApiModelProperty(value = "备注说明")
private String remake;
@ApiModelProperty(value = "设备id 1,2,3")
private String checkDetail;
@ApiModelProperty(value = "扫码完成时间")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime scanCodeTime;
}
package com.tykj.dev.device.selfcheck.subject.vo.daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author zsp
*/
@Data
@ApiModel("日常检查保存列表类vo")
public class DailyCheckSaveVo {
@ApiModelProperty(name = "主键id")
private Integer id;
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(name = "任务id", example = "1")
private Integer taskId;
@NotNull(message = "checkingCount不能为空")
@Min(value = 0,message = "checkingCount不能小于0")
@ApiModelProperty(name = "应查数量", example = "1")
private Integer checkingCount;
@ApiModelProperty(value = "日常检查装备详情(设备id 格式:1,2,3)")
private String checkDetail;
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
}
package com.tykj.dev.device.selfcheck.subject.vo.daily;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author zsp
*/
@Data
@ApiModel("日常检查单查询类")
public class DailyCheckSelectVo extends CustomPage {
@ApiModelProperty(value = "检查人的id", example = "检查人的id")
public Integer checkUserId;
@ApiModelProperty(value = "检查状态", example = "2")
public Integer checkStatus;
}
package com.tykj.dev.device.selfcheck.subject.vo.daily;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("日常检查暂时保存类vo")
@Repository
public class DailyCheckUpdateVo {
@ApiModelProperty(name = "主键id")
private Integer id;
@NotNull
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(name = "任务id", example = "1")
private Integer taskId;
@ApiModelProperty(name = "审核人ID", example = "1")
private Integer userbId;
@NotNull(message = "checkingCount不能为空")
@Min(value = 0,message = "checkingCount不能小于0")
@ApiModelProperty(name = "应查数量", example = "1")
private Integer checkingCount;
@NotNull(message = "checkedCount不能为空")
@Min(value = 0,message = "checkedCount不能小于0")
@ApiModelProperty(name = "实查数量", example = "1")
private Integer checkedCount;
@NotNull(message = "checkResult不能为空")
@ApiModelProperty(name = "自查结果", example = "通过")
private String checkResult;
@ApiModelProperty(name = "自查详情 1 正常")
private List<DeviceLibrary> checkDeviceList1;
@ApiModelProperty(name = "自查详情 0 缺失")
private List<DeviceLibrary> checkDeviceList0;
@ApiModelProperty(value = "检查附件名")
private List<FileRet> checkFiles;
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
@ApiModelProperty(value = "设备id 1,2,3")
private String checkDetail;
@ApiModelProperty(value = "扫码完成时间")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime scanCodeTime;
}
package com.tykj.dev.device.selfcheck.subject.vo.daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* DATE:2021-7-14
* Author:zsp
* @author zsp
*/
@Data
@ApiModel("是否保存日常检查任务")
public class SaveDailyTaskVo {
@ApiModelProperty(value = "是否保存",notes = "0 是保存,1是不保存")
private Integer isSave;
@ApiModelProperty("任务id")
private Integer taskId;
@ApiModelProperty("日常检查id")
private Integer dailyCheckId;
@ApiModelProperty("更新日常检查的vo")
private DailyCheckSaveVo dailyCheckSaveVo;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论