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

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

新增流程
上级 d59d5c53
......@@ -375,7 +375,13 @@ public enum LogType {
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,"省直属等待出库"),
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;
......
......@@ -329,8 +329,16 @@ public enum StatusEnum {
* 盘存自查状态
*/
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;
......
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;
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.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.daily.*;
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.UnitsCache;
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.misc.qrcode.vo.TaskData;
import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -26,10 +26,10 @@ import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
......@@ -55,9 +55,6 @@ public class DailyCheckController {
@Resource
private TaskService taskService;
@Resource
private StoreCache storeCache;
@Resource
private UserCache userCache;
......@@ -67,15 +64,64 @@ public class DailyCheckController {
@Resource
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 = "发起日常检查业务")
@PostMapping(value = "/addDayBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo){
dailyCheckBillService.addDayBill(selfCheckSaveVo);
public ResponseEntity addDayBill(@RequestBody @Validated DailyCheckSaveVo dailyCheckSaveVo){
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("发起成功");
}
@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 = "保存和更新日常检查的装备列表")
@PostMapping(value = "/saveDayDevice")
@Transactional(rollbackFor = Exception.class)
......@@ -86,8 +132,8 @@ public class DailyCheckController {
@ApiOperation(value = "查询自查任务", notes = "可以通过这个接口查询自查任务")
@PostMapping(value = "/summary")
public ResponseEntity selectSelfExaminationBill(@RequestBody SelfCheckSelectVo selfCheckSelectVo) {
Page<DailyCheckBill> page = dailyCheckBillService.getDailyCheckPage(selfCheckSelectVo);
public ResponseEntity selectSelfExaminationBill(@RequestBody DailyCheckSelectVo dailyCheckSelectVo) {
Page<DailyCheckBill> page = dailyCheckBillService.getDailyCheckPage(dailyCheckSelectVo);
for (DailyCheckBill dailyCheckBill : page.getContent()) {
if (dailyCheckBill.getCreateUnitId()!=null) {
dailyCheckBill.setCreateUnit(unitsCache.findById(dailyCheckBill.getId()).getName());
......@@ -102,15 +148,19 @@ public class DailyCheckController {
dailyCheckBill.setCreateUser(userCache.findById(dailyCheckBill.getUseraId()).getName());
}
if (dailyCheckBill.getId()!=null){
dailyCheckBill.setTaskId(taskService.get(dailyCheckBill.getId(),4).getId());
}
if (dailyCheckBill.getStorageLocationId() != null){
dailyCheckBill.setStorageLocationName(storeCache.idToName(dailyCheckBill.getStorageLocationId()));
dailyCheckBill.setTaskId(taskService.get(dailyCheckBill.getId(),32).getId());
}
}
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查询日常检查选择的设备")
@GetMapping(value = "/findByUnitId")
@Transactional(rollbackFor = Exception.class)
......@@ -127,9 +177,19 @@ public class DailyCheckController {
deviceIds.add(i1);
}
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
deviceLibraryList.forEach(DeviceLibrary::setConfigName);
checkUnitBill.setDeviceLibraryList(deviceLibraryList);
}
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 {
// return ResultUtil.success(selfExaminationBillEntity);
// }
@ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表")
@PostMapping(value = "/saveDayDevice")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity saveDayDevice(@RequestBody SelfCheckUnitBill selfCheckUnitBill) {
SelfCheckUnitBill unitBill = service.add(selfCheckUnitBill);
return ResultUtil.success(unitBill);
}
@ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备")
@GetMapping(value = "/findByUnitId")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity findByUnitId() {
Integer unitId = userUtils.getCurrentUnitId();
SelfCheckUnitBill checkUnitBill = service.findByUnitId(unitId);
if (checkUnitBill != null){
//取出设备的id
String dayDeviceList = checkUnitBill.getDayDeviceList();
String[] ids = dayDeviceList.split("x");
List<Integer> deviceIds = new ArrayList<>();
for (int i = 0; i < ids.length; i++) {
int i1 = Integer.parseInt(ids[i]);
deviceIds.add(i1);
}
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
checkUnitBill.setDeviceLibraryList(deviceLibraryList);
}
return ResultUtil.success(checkUnitBill);
}
@ApiOperation(value = "生成二维码", notes = "生成二维码")
@PostMapping(value = "/createCode")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity createCode(@RequestBody TaskData taskData) {
List<String> qrcode = selfCheckBillService.createQrcode(taskData);
return ResultUtil.success(qrcode);
}
@ApiOperation(value = "解析二维码", notes = "解析二维码")
@PostMapping(value = "/parseCode")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity parseCode(@RequestBody List<String> strings) {
return ResultUtil.success(selfCheckBillService.parseQrCode(strings));
}
@ApiOperation(value = "更新日常检查(日常检查的完结)", notes = "更新日常检查(日常检查的完结)")
@PostMapping(value = "/updateDayCheck")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateDayCheck(@RequestBody DayVO dayVO) {
Integer billId = dayVO.getId();
SelfCheckBill selfCheckBill = selfCheckBillService.getOne(billId);
BeanUtils.copyProperties(dayVO,selfCheckBill);
Integer currentUserId = userUtils.getCurrentUserId();
Integer taskId = dayVO.getTaskId();
if (dayVO.getNewDeviceList() != null) {
//按新增不在系统的装备按rfid卡号拼接保存
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(".");
for (String s : dayVO.getNewDeviceList()) {
stringBuffer.append(s);
stringBuffer.append(".");
}
selfCheckBill.setNewDeviceDetail(stringBuffer.toString());
}
//添加日志
String deviceIdDetail = dayVO.getCheckDetail();
String[] strings = deviceIdDetail.split("x");
List<FileVo> fileVoList = new ArrayList<>();
if(dayVO.getCheckFiles()!=null&&dayVO.getCheckFiles().size()>0) {
selfCheckBill.setCheckFiles(FilesUtil.stringFileToList(dayVO.getCheckFiles()));
dayVO.getCheckFiles().forEach(fileRet -> {
fileVoList.add(new FileVo("日常检查单", fileRet.getName(), fileRet.getPreviewPath()));
});
}
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
for (String s:strings) {
if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"发起日常检查",fileVoList,currentUserId,dayVO.getTaskId());
deviceLogDtos.add(deviceLogDto);
}
}
executor.execute(()->deviceLogService.addAllLog(deviceLogDtos));
TaskBto taskBto = taskService.get(taskId);
//任务推至完结
TaskBto taskBto1 = taskService.moveToEnd(taskBto);
//更新自查单
selfCheckBill.setCheckStatus(2);
selfCheckBill.setTaskId(taskBto1.getId());
SelfCheckBill save = selfCheckBillDao.save(selfCheckBill);
return ResultUtil.success(save);
}
// @ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表")
// @PostMapping(value = "/saveDayDevice")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity saveDayDevice(@RequestBody SelfCheckUnitBill selfCheckUnitBill) {
// SelfCheckUnitBill unitBill = service.add(selfCheckUnitBill);
// return ResultUtil.success(unitBill);
// }
//
// @ApiOperation(value = "根据单位id查询日常检查选择的设备", notes = "根据单位id查询日常检查选择的设备")
// @GetMapping(value = "/findByUnitId")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity findByUnitId() {
// Integer unitId = userUtils.getCurrentUnitId();
// SelfCheckUnitBill checkUnitBill = service.findByUnitId(unitId);
// if (checkUnitBill != null){
// //取出设备的id
// String dayDeviceList = checkUnitBill.getDayDeviceList();
// String[] ids = dayDeviceList.split("x");
// List<Integer> deviceIds = new ArrayList<>();
// for (int i = 0; i < ids.length; i++) {
// int i1 = Integer.parseInt(ids[i]);
// deviceIds.add(i1);
// }
// List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
// checkUnitBill.setDeviceLibraryList(deviceLibraryList);
// }
// return ResultUtil.success(checkUnitBill);
// }
//
// @ApiOperation(value = "生成二维码", notes = "生成二维码")
// @PostMapping(value = "/createCode")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity createCode(@RequestBody TaskData taskData) {
// List<String> qrcode = selfCheckBillService.createQrcode(taskData);
// return ResultUtil.success(qrcode);
// }
//
// @ApiOperation(value = "解析二维码", notes = "解析二维码")
// @PostMapping(value = "/parseCode")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity parseCode(@RequestBody List<String> strings) {
// return ResultUtil.success(selfCheckBillService.parseQrCode(strings));
// }
//
// @ApiOperation(value = "更新日常检查(日常检查的完结)", notes = "更新日常检查(日常检查的完结)")
// @PostMapping(value = "/updateDayCheck")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity updateDayCheck(@RequestBody DayVO dayVO) {
// Integer billId = dayVO.getId();
// SelfCheckBill selfCheckBill = selfCheckBillService.getOne(billId);
// BeanUtils.copyProperties(dayVO,selfCheckBill);
// Integer currentUserId = userUtils.getCurrentUserId();
// Integer taskId = dayVO.getTaskId();
//
// if (dayVO.getNewDeviceList() != null) {
// //按新增不在系统的装备按rfid卡号拼接保存
// StringBuilder stringBuffer = new StringBuilder();
// stringBuffer.append(".");
// for (String s : dayVO.getNewDeviceList()) {
// stringBuffer.append(s);
// stringBuffer.append(".");
// }
// selfCheckBill.setNewDeviceDetail(stringBuffer.toString());
// }
// //添加日志
// String deviceIdDetail = dayVO.getCheckDetail();
// String[] strings = deviceIdDetail.split("x");
// List<FileVo> fileVoList = new ArrayList<>();
// if(dayVO.getCheckFiles()!=null&&dayVO.getCheckFiles().size()>0) {
// selfCheckBill.setCheckFiles(FilesUtil.stringFileToList(dayVO.getCheckFiles()));
// dayVO.getCheckFiles().forEach(fileRet -> {
// fileVoList.add(new FileVo("日常检查单", fileRet.getName(), fileRet.getPreviewPath()));
// });
// }
// List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
// for (String s:strings) {
// if (s.length()>=2) {
// Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
// DeviceLogDto deviceLogDto = new DeviceLogDto(id,"发起日常检查",fileVoList,currentUserId,dayVO.getTaskId());
// deviceLogDtos.add(deviceLogDto);
// }
// }
// executor.execute(()->deviceLogService.addAllLog(deviceLogDtos));
// TaskBto taskBto = taskService.get(taskId);
// //任务推至完结
// TaskBto taskBto1 = taskService.moveToEnd(taskBto);
// //更新自查单
// selfCheckBill.setCheckStatus(2);
// selfCheckBill.setTaskId(taskBto1.getId());
// SelfCheckBill save = selfCheckBillDao.save(selfCheckBill);
// return ResultUtil.success(save);
// }
// @ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情")
// @GetMapping(value = "/selectDetail")
......
......@@ -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.vo.SelfCheckSaveVo;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......@@ -33,12 +34,28 @@ public interface DailyCheckBillService {
*/
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 {
*/
Map<String,Object> selectDetail(Integer billId);
/**
* 根据业务id查询详情
* @param taskId 任务id
* @return 详情
*/
Map<String,Object> selectDetailForTaskId(Integer taskId);
/**
* 查询日常检查列表
* @param selfCheckSelectVo
* @param dailyCheckSelectVo
* @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;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDailyDeviceBill;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill;
import java.util.List;
......@@ -14,7 +15,7 @@ public interface HistoryDailyDeviceBillService {
* 批量保存
* @param historyDeviceBillList historyDeviceBillList
*/
void batchSave(List<HistoryDeviceBill> historyDeviceBillList);
void batchSave(List<HistoryDailyDeviceBill> historyDeviceBillList);
/**
......@@ -22,5 +23,8 @@ public interface HistoryDailyDeviceBillService {
* @param billId 业务id
* @return 实体对象
*/
List<HistoryDeviceBill> selectByBillId(Integer billId);
List<HistoryDailyDeviceBill> selectByBillId(Integer billId);
void deleteList(List<HistoryDailyDeviceBill> deviceBillList);
}
......@@ -2,21 +2,29 @@ package com.tykj.dev.device.selfcheck.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.repository.DailyCheckBillDao;
import com.tykj.dev.device.selfcheck.service.DailyCheckBillService;
import com.tykj.dev.device.selfcheck.service.HistoryDailyDeviceBillService;
import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill;
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.SelfCheckBill;
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.daily.*;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.user.cache.StoreCache;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
......@@ -24,18 +32,23 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.qrcode.QrCodeBillUtil;
import com.tykj.dev.misc.qrcode.vo.DeviceCodeVO;
import com.tykj.dev.misc.qrcode.vo.TaskData;
import com.tykj.dev.misc.utils.DateUtil;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.SpringUtils;
import com.tykj.dev.misc.utils.TaskDisposeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -57,9 +70,6 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
@Resource
private DeviceLibraryService deviceLibraryService;
@Resource
private DeviceLibraryCacheService deviceLibraryCacheService;
@Resource
private TaskService taskService;
......@@ -69,6 +79,13 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
@Resource
private UserUtils userUtils;
@Resource
private HistoryDailyDeviceBillService historyDailyDeviceBillService;
@Resource
private UserCache userCache;
@Override
public DailyCheckBill getOne(Integer id) {
......@@ -81,62 +98,113 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
}
@Override
public void addDayBill(SelfCheckSaveVo selfCheckSaveVo) {
//当前登录的用户ID
public DailyCheckBill createBill() {
DailyCheckBill dailyCheckBill = new DailyCheckBill();
dailyCheckBill.setCheckStartTime(DateUtil.getLocalDateTime(new Date()));
Integer currentUserId = userUtils.getCurrentUserId();
//当前登录的单位ID
Integer unitId = userUtils.getCurrentUnitId();
//当前登录的单位名称
String currentUserUnitName = userUtils.getCurrentUserUnitName();
//添加账单
DailyCheckBill checkBill;
TaskBto taskBto;
if (selfCheckSaveVo.getTaskId()!=null){
taskBto = taskService.get(selfCheckSaveVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(), StatusEnum.WAIT_SELF_CHECK);
checkBill = getOne(taskBto.getBillId());
checkBill.setCheckTime(new Date());
BeanUtils.copyProperties(selfCheckSaveVo,checkBill);
if (selfCheckSaveVo.getUnStockDevices()!=null&&selfCheckSaveVo.getUnStockDevices().size()>0){
checkBill.setUnStockDetail(JacksonUtil.toJSon(selfCheckSaveVo.getUnStockDevices()));
}
if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码");
//添加涉及人员
taskService.addInvolveUser(taskBto,currentUserId);
}else {
throw new ApiException("type只能为0或1");
}
checkBill.setTaskId(selfCheckSaveVo.getTaskId());
dailyCheckBill.setUseraId(currentUserId);
//设置状态为待检查
dailyCheckBill.setCheckStatus(0);
dailyCheckBill.setCheckUnitId(unitId);
dailyCheckBill.setCheckUnit(currentUserUnitName);
dailyCheckBill.setTitle(currentUserUnitName + "发起的日常检查任务");
//保存业务
DailyCheckBill save = dailyCheckBillDao.save(dailyCheckBill);
List<Integer> userIds = new ArrayList<>();
userIds.add(currentUserId);
TaskBto taskBto = new TaskBto(StatusEnum.WAIT_CHECK.id, currentUserUnitName + "发起的日常检查任务",
null, ".", save.getId(), BusinessEnum.DAILY_SELF_CHECK.id,
currentUserId, 0, null, userIds);
TaskBto start = taskService.start(taskBto);
log.info("[日常检查模块]:日常检查代办生成");
save.setTaskId(start.getId());
return save;
}
@Override
public DailyCheckBill addDayBill(DailyCheckSaveVo dailyCheckSaveVo) {
//当前登录的用户ID
Integer taskId = dailyCheckSaveVo.getTaskId();
//业务id
Integer id = dailyCheckSaveVo.getId();
//任务推进
TaskBto taskBto = taskService.get(taskId);
taskService.moveToSpecial(taskBto,StatusEnum.WAIT_CHECK_RESULT);
//更新列表设备
DailyCheckBill checkBill = getOne(id);
checkBill.setCheckStatus(0);
BeanUtils.copyProperties(dailyCheckSaveVo, checkBill);
DailyCheckBill update = update(checkBill);
log.info("[日常检查模块]:发起日常检查");
return update;
}
@Override
public DailyCheckBill updateBill(DailyCheckUpdateVo dailyCheckUpdateVo) {
TaskBto taskBto = taskService.get(dailyCheckUpdateVo.getTaskId());
taskService.moveToSpecial(taskBto,StatusEnum.WAIT_CHECK_FILE);
Integer id = dailyCheckUpdateVo.getId();
DailyCheckBill checkBill = getOne(id);
BeanUtils.copyProperties(dailyCheckUpdateVo,checkBill);
//处理文件
if(dailyCheckUpdateVo.getCheckFiles()!=null&&dailyCheckUpdateVo.getCheckFiles().size()>0){
checkBill.setCheckFiles(FilesUtil.stringFileToList(dailyCheckUpdateVo.getCheckFiles()));
}
else {
//发起任务
checkBill = selfCheckSaveVo.toDailyCheckBill();
checkBill.setTitle(currentUserUnitName + "发起的日常检查任务");
checkBill.setCheckUnit(currentUserUnitName);
checkBill.setCheckUnitId(unitId);
//发起任务
List<Integer> userIds = new ArrayList<>();
userIds.add(currentUserId);
taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, currentUserUnitName + "发起的日常检查任务",
null, ".", checkBill.getId(), BusinessEnum.DAILY_SELF_CHECK.id,
currentUserId, 0, null, userIds);
TaskBto taskBto1 = new TaskBto();
if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码");
taskBto1 = taskService.start(taskBto);
//未检查
checkBill.setCheckStatus(3);
checkBill.setTaskId(taskBto1.getId());
}
checkBill.setCheckStatus(1);
DailyCheckBill update = update(checkBill);
List<HistoryDailyDeviceBill> historyDailyDeviceBills =
historyDailyDeviceBillService.selectByBillId(update.getId());
historyDailyDeviceBillService.deleteList(historyDailyDeviceBills);
//处理存储历史设备数据
List<HistoryDailyDeviceBill> historyDeviceBillList0 = new ArrayList<>();
batchSave(dailyCheckUpdateVo.getCheckDeviceList0(),Integer.valueOf("0"),historyDeviceBillList0,update.getId());
List<HistoryDailyDeviceBill> historyDeviceBillList1 = new ArrayList<>();
batchSave(dailyCheckUpdateVo.getCheckDeviceList1(),Integer.valueOf("1"),historyDeviceBillList1,update.getId());
return update;
}
@Override
public void endDayBill(DailyCheckEndVo dailyCheckEndVo) {
Integer taskId = dailyCheckEndVo.getTaskId();
TaskBto taskBto = taskService.get(taskId);
//如果是直接提交
if (StatusEnum.WAIT_CHECK_RESULT.id.equals(taskBto.getBillStatus())){
//推进一步
taskService.moveToSpecial(taskBto,StatusEnum.WAIT_CHECK_FILE);
}
//任务完结
taskService.moveToEnd(taskBto);
Integer id = dailyCheckEndVo.getId();
//处理业务
DailyCheckBill checkBill = getOne(id);
BeanUtils.copyProperties(dailyCheckEndVo,checkBill);
//处理文件
if(dailyCheckEndVo.getCheckFiles()!=null&&dailyCheckEndVo.getCheckFiles().size()>0){
checkBill.setCheckFiles(FilesUtil.stringFileToList(dailyCheckEndVo.getCheckFiles()));
}
//更新
//正常完成 超时完成
LocalDate startTime = checkBill.getCheckStartTime().toLocalDate();
LocalDateTime endTime = DateUtil.getLocalDateTime(new Date());
checkBill.setCheckEndTime(endTime);
if (!startTime.equals(endTime.toLocalDate())){
//说明是超时完成
checkBill.setCheckStatus(3);
}else {
checkBill.setCheckStatus(2);
}
//日常检查设备
String dayCheckDetail = selfCheckSaveVo.getDayCheckDetail();
checkBill.setDayCheckDetail(dayCheckDetail);
checkBill.setUseraId(currentUserId);
checkBill.setCreateUnitId(unitId);
update(checkBill);
log.info("[自查模块]:发起日常检查");
DailyCheckBill update = update(checkBill);
List<HistoryDailyDeviceBill> historyDailyDeviceBills =
historyDailyDeviceBillService.selectByBillId(update.getId());
historyDailyDeviceBillService.deleteList(historyDailyDeviceBills);
//处理存储历史设备数据
List<HistoryDailyDeviceBill> historyDeviceBillList0 = new ArrayList<>();
batchSave(dailyCheckEndVo.getCheckDeviceList0(),Integer.valueOf("0"),historyDeviceBillList0,update.getId());
List<HistoryDailyDeviceBill> historyDeviceBillList1 = new ArrayList<>();
batchSave(dailyCheckEndVo.getCheckDeviceList1(),Integer.valueOf("1"),historyDeviceBillList1,update.getId());
}
@Override
......@@ -190,68 +258,36 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
@Override
public Map<String, Object> selectDetail(Integer billId) {
Map<Integer, DeviceLibrary> deviceLibraryMap =
deviceLibraryCacheService.getAllDeviceLibraryList().stream().collect(Collectors.toMap(DeviceLibrary::getId,
Function.identity()));
Map<String, Object> map = new HashMap<>();
//根据billid查询实体
DailyCheckBill checkBill = getOne(billId);
//日常设备信息
if (checkBill.getDayCheckDetail() != null) {
if (checkBill.getCheckDetail() != null) {
String dayDeviceList = checkBill.getDayCheckDetail();
String[] ids = dayDeviceList.split("x");
String dayDeviceList = checkBill.getCheckDetail();
String[] ids = dayDeviceList.split(",");
List<Integer> deviceIds = new ArrayList<>();
for (int i = 0; i < ids.length; i++) {
int i1 = Integer.parseInt(ids[i]);
deviceIds.add(i1);
}
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
deviceLibraryList.forEach(DeviceLibrary::setConfigName);
checkBill.setDayDeviceLibraries(deviceLibraryList);
}
//设备信息
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
String checkDetail = checkBill.getCheckDetail();
if (checkDetail != null) {
String[] split = checkDetail.split("x");
//添加自查装备
for (String s : split) {
if (s.length() >= 2) {
Integer i = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(i);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries.add(deviceLibraryEntity);
}
}
}
checkBill.setInDeviceLibraries(deviceLibraries);
//新增的
String newDeviceDetail = checkBill.getNewDeviceDetail();
List<DeviceLibrary> newDeviceList = new ArrayList<>();
if (newDeviceDetail != null) {
//分隔字符获得rfid卡号
String[] split2 = newDeviceDetail.split("\\.");
newDeviceList = new ArrayList<>();
for (String rfid : split2) {
if (rfid.length() > 0) {
DeviceLibrary d = new DeviceLibrary();
d.setCheckResult(2);
d.setSeqNumber("-");
d.setName("-");
d.setType(0);
d.setRfidSurfaceId("-");
d.setProdNumber("-");
d.setRfidCardId(rfid);
newDeviceList.add(d);
}
}
}
checkBill.setNewDeviceLibraries(newDeviceList);
List<HistoryDailyDeviceBill> historyDailyDeviceBills = historyDailyDeviceBillService.selectByBillId(billId);
checkBill.setHistoryDailyDeviceBills(historyDailyDeviceBills);
//处理文件
if (checkBill.getCheckFiles() != null && checkBill.getCheckFiles().length() >0){
checkBill.setCheckFileList(FilesUtil.stringFileToList(checkBill.getCheckFiles()));
}
//处理A B名称
if (checkBill.getUseraId() != null){
checkBill.setCheckUser(userCache.findById(checkBill.getUseraId()).getName());
}
if (checkBill.getUserbId() != null){
checkBill.setConfirmUser(userCache.findById(checkBill.getUserbId()).getName());
}
map.put("checkBill", checkBill);
//根据业务id查询任务日志
TaskBto taskBto = taskService.get(billId, BusinessEnum.DAILY_SELF_CHECK.id);
......@@ -264,54 +300,76 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
}
@Override
public Page<DailyCheckBill> getDailyCheckPage(SelfCheckSelectVo selfCheckSelectVo) {
return dailyCheckBillDao.findAll(getSelectSpecification(selfCheckSelectVo),
selfCheckSelectVo.getPageable());
public Map<String, Object> selectDetailForTaskId(Integer taskId) {
Integer billId = taskService.get(taskId).getBillId();
Map<String, Object> detail = selectDetail(billId);
return detail;
}
private Specification<DailyCheckBill> getSelectSpecification(SelfCheckSelectVo selfCheckSelectVo) {
@Override
public Page<DailyCheckBill> getDailyCheckPage(DailyCheckSelectVo dailyCheckSelectVo) {
return dailyCheckBillDao.findAll(getSelectSpecification(dailyCheckSelectVo),
dailyCheckSelectVo.getPageable());
}
@Override
public void isSave(SaveDailyTaskVo saveDailyTaskVo) {
//保存自查任务
if (saveDailyTaskVo.getIsSave() == 0){
DailyCheckSaveVo dailyCheckSaveVo = saveDailyTaskVo.getDailyCheckSaveVo();
this.addDayBill(dailyCheckSaveVo);
}else {
//删除task
TaskBto taskBto = taskService.get(saveDailyTaskVo.getTaskId());
//将任务进封存
taskService.moveToArchive(taskBto);
//将业务删除
DailyCheckBill checkBill = getOne(saveDailyTaskVo.getDailyCheckId());
delete(checkBill);
}
}
@Override
public void delete(DailyCheckBill dailyCheckBill) {
dailyCheckBillDao.delete(dailyCheckBill);
}
private Specification<DailyCheckBill> getSelectSpecification(DailyCheckSelectVo dailyCheckSelectVo) {
PredicateBuilder<DailyCheckBill> predicateBuilder = Specifications.and();
predicateBuilder.eq("checkUnitId", userUtils.getCurrentUnitId());
if (selfCheckSelectVo != null) {
if (selfCheckSelectVo.getCheckStatus() != null) {
predicateBuilder.eq("checkStatus", selfCheckSelectVo.getCheckStatus());
}
if (selfCheckSelectVo.getSelfExaminationUnit() != null) {
predicateBuilder.eq("checkUnit", selfCheckSelectVo.getSelfExaminationUnit());
if (dailyCheckSelectVo != null) {
if (dailyCheckSelectVo.getCheckStatus() != null) {
predicateBuilder.eq("checkStatus", dailyCheckSelectVo.getCheckStatus());
}
if (selfCheckSelectVo.getCheckUserId() != null) {
predicateBuilder.eq("useraId", selfCheckSelectVo.getCheckUserId());
}
if (selfCheckSelectVo.getConfirmUserId() != null) {
predicateBuilder.eq("userbId", selfCheckSelectVo.getConfirmUserId());
}
if (selfCheckSelectVo.getSelfExaminationCycle() != null) {
predicateBuilder.eq("cycle", selfCheckSelectVo.getSelfExaminationCycle());
}
if (selfCheckSelectVo.getCreateUnitId() != null) {
predicateBuilder.eq("createUnitId", selfCheckSelectVo.getCreateUnitId());
}
if (selfCheckSelectVo.getCreateUserId() != null) {
predicateBuilder.eq("createUserId", selfCheckSelectVo.getCreateUserId());
}
if (selfCheckSelectVo.getContent() != null) {
Class<SelfCheckBill> selfExaminationBillEntityClass = SelfCheckBill.class;
Field[] declaredFields = selfExaminationBillEntityClass.getDeclaredFields();
PredicateBuilder<SelfCheckBill> p = Specifications.or();
for (Field field : declaredFields) {
if (field.getType().equals(String.class) && field.getAnnotation(Transient.class) == null) {
p.like(field.getName(), "%" + selfCheckSelectVo.getContent() + "%");
}
}
predicateBuilder.predicate(p.build());
}
if (selfCheckSelectVo.getStartTime() != null) {
predicateBuilder.gt("createTime", selfCheckSelectVo.getStartTime());
}
if (selfCheckSelectVo.getEndTime() != null) {
predicateBuilder.lt("createTime", selfCheckSelectVo.getEndTime());
if (dailyCheckSelectVo.getCheckUserId() != null) {
predicateBuilder.eq("useraId", dailyCheckSelectVo.getCheckUserId());
}
}
return predicateBuilder.build();
}
private void batchSave(List<DeviceLibrary> deviceLibraries,Integer integer,
List<HistoryDailyDeviceBill> historyDeviceBillList,Integer billId){
for (DeviceLibrary deviceLibrary : deviceLibraries) {
HistoryDailyDeviceBill historyDailyDeviceBill = new HistoryDailyDeviceBill();
historyDailyDeviceBill.setBillId(billId);
historyDailyDeviceBill.setModel(deviceLibrary.getModel());
historyDailyDeviceBill.setName(deviceLibrary.getName());
historyDailyDeviceBill.setDeviceId(deviceLibrary.getId());
historyDailyDeviceBill.setRfidCardId(deviceLibrary.getRfidCardId());
historyDailyDeviceBill.setLocationUnit(deviceLibrary.getLocationUnit());
historyDailyDeviceBill.setOwnUnit(deviceLibrary.getOwnUnit());
historyDailyDeviceBill.setCheckResult(integer);
historyDailyDeviceBill.setSeqNumber(deviceLibrary.getSeqNumber());
historyDailyDeviceBill.setTypeName(deviceLibrary.getTypeName());
historyDailyDeviceBill.setInvisibleRangeName(deviceLibrary.getInvisibleRangeName());
historyDailyDeviceBill.setSecretLevelName(deviceLibrary.getSecretLevelName());
historyDeviceBillList.add(historyDailyDeviceBill);
}
historyDailyDeviceBillService.batchSave(historyDeviceBillList);
}
}
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.subject.domin.HistoryDailyDeviceBill;
import com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -12,13 +15,23 @@ import java.util.List;
*/
@Service
public class HistoryDailyDeviceBillServiceImpl implements HistoryDailyDeviceBillService {
@Resource
private HistoryDailyDeviceBillDao historyDailyDeviceBillDao;
@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
public List<HistoryDeviceBill> selectByBillId(Integer billId) {
return null;
public void deleteList(List<HistoryDailyDeviceBill> deviceBillList) {
historyDailyDeviceBillDao.deleteAll(deviceBillList);
}
}
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.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
......@@ -12,8 +13,9 @@ import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -57,8 +59,20 @@ public class DailyCheckBill {
/**
* 自查时间
*/
@ApiModelProperty(value = "自查时间")
private Date checkTime;
@ApiModelProperty(value = "自查时间(创建任务的时间)")
@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 {
*/
@ApiModelProperty(value = "自查结果")
private String checkResult;
/**
* 自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
@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;
@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")
@ApiModelProperty(value = "非在库装备转JSon")
private String unStockDetail;
/**
* 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)
*/
@ApiModelProperty(value = "自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)")
@ApiModelProperty(value = "自查状态(0:待检查,1:未完成,2:已完成,3:超时完成)")
private Integer checkStatus;
/**
* 创建用户id
......@@ -131,33 +151,13 @@ public class DailyCheckBill {
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
/**
* 自查未入库新增装备详情(RFID卡号以.为分隔符)
*/
@Column(name = "new_device_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查未入库新增装备详情(RFID卡号以.为分隔符)")
private String newDeviceDetail;
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房")
private Integer storageLocationId;
@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;
@Column(name = "remake",columnDefinition = "TEXT")
@ApiModelProperty(value = "备注说明")
private String remake;
@ApiModelProperty(value = "检查人")
@Transient
......@@ -196,10 +196,7 @@ public class DailyCheckBill {
private List<DeviceLibrary> dayDeviceLibraries;
@Transient
@ApiModelProperty("日常检查设备信息列表")
private List<DeviceLibrary> inDeviceLibraries;
@ApiModelProperty("0和1")
private List<HistoryDailyDeviceBill> historyDailyDeviceBills;
@Transient
@ApiModelProperty("日常检查的设备新增设备列表")
private List<DeviceLibrary> newDeviceLibraries;
}
......@@ -65,11 +65,20 @@ public class HistoryDailyDeviceBill {
@ApiModelProperty(value = "所属单位")
private String ownUnit;
@ApiModelProperty(value = "密级")
private String secretLevelName;
@ApiModelProperty(value = "可见范围")
private String invisibleRangeName;
@ApiModelProperty(value = "形态")
private String typeName;
/**
* 设备的状态
*/
@ApiModelProperty(value = "设备的状态",example = "0 缺失 1 正常 2 新增")
private Integer deviceStatus;
private Integer checkResult;
@ApiModelProperty(value = "业务id")
private Integer billId;
......
......@@ -97,17 +97,4 @@ public class SelfCheckSaveVo {
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论