提交 9151c603 authored 作者: zhoushaopan's avatar zhoushaopan

feat(日常检查模块): 新增了日常检查的模块接口

新增了日常检查的模块接口
上级 48e35ba5
......@@ -124,6 +124,8 @@ public enum BusinessEnum {
READMACHINE(30,"盘存盘点"),
READMACHINE_SELFCHECK(31,"盘存自查"),
DAILY_SELF_CHECK(32,"日常检查"),
;
public Integer id;
......
package com.tykj.dev.device.selfcheck.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.service.DailyCheckBillService;
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.task.service.TaskService;
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.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
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;
/**
* @author zsp
* @create 2022/5/23 9:45
*/
@RestController
@RequestMapping(value = "/dailyCheck")
@AutoDocument
@Api(tags = "日常检查模块",description = "日常检查模块")
@Slf4j
public class DailyCheckController {
@Resource
private DailyCheckBillService dailyCheckBillService;
@Resource
private SelfCheckUnitBillService service;
@Resource
private UserUtils userUtils;
@Resource
private TaskService taskService;
@Resource
private StoreCache storeCache;
@Resource
private UserCache userCache;
@Resource
private UnitsCache unitsCache;
@Resource
private DeviceLibraryService deviceLibraryService;
@ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务")
@PostMapping(value = "/addDayBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo){
dailyCheckBillService.addDayBill(selfCheckSaveVo);
return ResponseEntity.ok("发起成功");
}
@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 = "查询自查任务", notes = "可以通过这个接口查询自查任务")
@PostMapping(value = "/summary")
public ResponseEntity selectSelfExaminationBill(@RequestBody SelfCheckSelectVo selfCheckSelectVo) {
Page<DailyCheckBill> page = dailyCheckBillService.getDailyCheckPage(selfCheckSelectVo);
for (DailyCheckBill dailyCheckBill : page.getContent()) {
if (dailyCheckBill.getCreateUnitId()!=null) {
dailyCheckBill.setCreateUnit(unitsCache.findById(dailyCheckBill.getId()).getName());
}
if (dailyCheckBill.getUseraId()!=null) {
dailyCheckBill.setCheckUser(userCache.findById(dailyCheckBill.getUseraId()).getName());
}
if (dailyCheckBill.getUserbId()!=null) {
dailyCheckBill.setCheckUser(userCache.findById(dailyCheckBill.getUseraId()).getName());
}
if (dailyCheckBill.getCreateUserId()!=null) {
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()));
}
}
return ResultUtil.success(page);
}
@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);
}
}
......@@ -986,70 +986,70 @@ public class SelfCheckController {
return ResultUtil.success(map);
}
@ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务")
@PostMapping(value = "/addDayBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo) {
//当前登录的用户ID
Integer currentUserId = userUtils.getCurrentUserId();
//当前登录的单位ID
Integer unitId = userUtils.getCurrentUnitId();
//当前登录的单位名称
String currentUserUnitName = userUtils.getCurrentUserUnitName();
//添加账单
SelfCheckBill selfExaminationBillEntity;
TaskBto taskBto;
if (selfCheckSaveVo.getTaskId()!=null){
taskBto = taskService.get(selfCheckSaveVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.WAIT_SELF_CHECK);
selfExaminationBillEntity = selfExaminationBillService.getOne(taskBto.getBillId());
selfExaminationBillEntity.setCheckTime(new Date());
BeanUtils.copyProperties(selfCheckSaveVo,selfExaminationBillEntity);
if (selfCheckSaveVo.getUnStockDevices()!=null&&selfCheckSaveVo.getUnStockDevices().size()>0){
selfExaminationBillEntity.setUnStockDetail(JacksonUtil.toJSon(selfCheckSaveVo.getUnStockDevices()));
}
if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码");
//添加涉及人员
taskService.addInvolveUser(taskBto,currentUserId);
}else {
throw new ApiException("type只能为0或1");
}
selfExaminationBillEntity.setTaskId(selfCheckSaveVo.getTaskId());
}
else {
//发起任务
selfExaminationBillEntity = selfCheckSaveVo.toDo();
selfExaminationBillEntity.setTitle(currentUserUnitName + "发起的日常检查任务");
selfExaminationBillEntity.setCheckUnit(currentUserUnitName);
selfExaminationBillEntity.setCheckUnitId(unitId);
//更新
selfCheckBillService.addEntity(selfExaminationBillEntity);
//发起任务
List<Integer> userIds = new ArrayList<>();
userIds.add(currentUserId);
taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, currentUserUnitName + "发起的日常检查任务",
null, ".", selfExaminationBillEntity.getId(), 4,
currentUserId, 0, null, userIds);
TaskBto taskBto1 = new TaskBto();
if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码");
taskBto1 = taskService.start(taskBto);
//未检查
selfExaminationBillEntity.setCheckStatus(3);
selfExaminationBillEntity.setTaskId(taskBto1.getId());
}
}
//日常检查设备
String dayDeviceList = selfCheckSaveVo.getDayCheckList();
selfExaminationBillEntity.setDayCheckList(dayDeviceList);
selfExaminationBillEntity.setUseraId(currentUserId);
selfExaminationBillEntity.setCreateUnitId(unitId);
selfExaminationBillService.update(selfExaminationBillEntity);
log.info("[自查模块]:发起日常检查");
return ResultUtil.success(selfExaminationBillEntity);
}
// @ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务")
// @PostMapping(value = "/addDayBill")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo) {
// //当前登录的用户ID
// Integer currentUserId = userUtils.getCurrentUserId();
// //当前登录的单位ID
// Integer unitId = userUtils.getCurrentUnitId();
// //当前登录的单位名称
// String currentUserUnitName = userUtils.getCurrentUserUnitName();
// //添加账单
// SelfCheckBill selfExaminationBillEntity;
// TaskBto taskBto;
// if (selfCheckSaveVo.getTaskId()!=null){
// taskBto = taskService.get(selfCheckSaveVo.getTaskId());
// TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.WAIT_SELF_CHECK);
// selfExaminationBillEntity = selfExaminationBillService.getOne(taskBto.getBillId());
// selfExaminationBillEntity.setCheckTime(new Date());
//
// BeanUtils.copyProperties(selfCheckSaveVo,selfExaminationBillEntity);
// if (selfCheckSaveVo.getUnStockDevices()!=null&&selfCheckSaveVo.getUnStockDevices().size()>0){
// selfExaminationBillEntity.setUnStockDetail(JacksonUtil.toJSon(selfCheckSaveVo.getUnStockDevices()));
// }
// if (selfCheckSaveVo.getType()==1){
// taskBto.setCustomInfo("扫码");
// //添加涉及人员
// taskService.addInvolveUser(taskBto,currentUserId);
// }else {
// throw new ApiException("type只能为0或1");
// }
// selfExaminationBillEntity.setTaskId(selfCheckSaveVo.getTaskId());
// }
// else {
// //发起任务
// selfExaminationBillEntity = selfCheckSaveVo.toDo();
// selfExaminationBillEntity.setTitle(currentUserUnitName + "发起的日常检查任务");
// selfExaminationBillEntity.setCheckUnit(currentUserUnitName);
// selfExaminationBillEntity.setCheckUnitId(unitId);
// //更新
// selfCheckBillService.addEntity(selfExaminationBillEntity);
// //发起任务
// List<Integer> userIds = new ArrayList<>();
// userIds.add(currentUserId);
// taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, currentUserUnitName + "发起的日常检查任务",
// null, ".", selfExaminationBillEntity.getId(), 4,
// currentUserId, 0, null, userIds);
// TaskBto taskBto1 = new TaskBto();
// if (selfCheckSaveVo.getType()==1){
// taskBto.setCustomInfo("扫码");
// taskBto1 = taskService.start(taskBto);
// //未检查
// selfExaminationBillEntity.setCheckStatus(3);
// selfExaminationBillEntity.setTaskId(taskBto1.getId());
// }
// }
// //日常检查设备
// String dayDeviceList = selfCheckSaveVo.getDayCheckList();
// selfExaminationBillEntity.setDayCheckList(dayDeviceList);
// selfExaminationBillEntity.setUseraId(currentUserId);
// selfExaminationBillEntity.setCreateUnitId(unitId);
// selfExaminationBillService.update(selfExaminationBillEntity);
// log.info("[自查模块]:发起日常检查");
// return ResultUtil.success(selfExaminationBillEntity);
// }
@ApiOperation(value = "保存和更新日常检查的装备列表", notes = "保存和更新日常检查的装备列表")
@PostMapping(value = "/saveDayDevice")
......@@ -1144,12 +1144,12 @@ public class SelfCheckController {
return ResultUtil.success(save);
}
@ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情")
@GetMapping(value = "/selectDetail")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity selectDetail(Integer billId) {
Map<String, Object> detail = selfCheckBillService.selectDetail(billId);
return ResultUtil.success(detail);
}
// @ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情")
// @GetMapping(value = "/selectDetail")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity selectDetail(Integer billId) {
// Map<String, Object> detail = selfCheckBillService.selectDetail(billId);
// return ResultUtil.success(detail);
// }
}
package com.tykj.dev.device.selfcheck.repository;
import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zsp
* @create 2022/5/23 9:22
*/
public interface DailyCheckBillDao extends JpaRepository<DailyCheckBill,Integer>, JpaSpecificationExecutor<DailyCheckBill> {
}
package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
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.misc.qrcode.vo.TaskData;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author zsp
* @create 2022/5/23 9:21
*/
public interface DailyCheckBillService {
/**
* 根据id查询
* @param id id
* @return 业务对象
*/
DailyCheckBill getOne(Integer id);
/**
* 保存和更新接口
* @param dailyCheckBill 要更新的实体
* @return 更新后的实体
*/
DailyCheckBill update(DailyCheckBill dailyCheckBill);
/**
* 发起日常检查
* @param selfCheckSaveVo 日常检查的vo
*/
void addDayBill(SelfCheckSaveVo selfCheckSaveVo);
/**
* 生成二维码
* @param taskData 需要传递的参数vo
* @return 二维码的地址的集合
*/
List<String> createQrcode(TaskData taskData);
/**
* 解析二维码
* @return 返回检验后的设备数据
*/
List<DeviceLibrary> parseQrCode(List<String> strings);
/**
* 根据业务id查询详情
* @param billId 业务id
* @return 详情
*/
Map<String,Object> selectDetail(Integer billId);
/**
* 查询日常检查列表
* @param selfCheckSelectVo
* @return
*/
Page<DailyCheckBill> getDailyCheckPage(SelfCheckSelectVo selfCheckSelectVo);
}
......@@ -61,5 +61,5 @@ public interface SelfCheckBillService {
*/
List<DeviceLibrary> parseQrCode(List<String> strings);
Map<String,Object> selectDetail(Integer billId);
// Map<String,Object> selectDetail(Integer billId);
}
......@@ -211,8 +211,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
private QrCodeBillUtil qrCodeBillUtil;
@Override
public List<String> createQrcode(TaskData taskData) {
List<String> code = qrCodeBillUtil.createCode(taskData);
return code;
return qrCodeBillUtil.createCode(taskData);
}
......@@ -261,80 +260,80 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
return deviceLibraries;
}
@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查询实体
SelfCheckBill checkBill = getOne(billId);
//日常设备信息
if (checkBill.getDayCheckList() != null) {
String dayDeviceList = checkBill.getDayCheckList();
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);
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);
//处理文件
if (checkBill.getCheckFiles() != null && checkBill.getCheckFiles().length() >0){
checkBill.setCheckFileList(FilesUtil.stringFileToList(checkBill.getCheckFiles()));
}
map.put("checkBill", checkBill);
//根据业务id查询任务日志
TaskBto taskBto = taskService.get(billId, BusinessEnum.SELF_CHECK.id);
List<TaskLogUserVo> taskLogUserVoList = taskLogService.getByTaskId(taskBto.getId());
map.put("taskLogUserVoList", taskLogUserVoList);
//查询任务
TaskUserVo taskUserVo = taskBto.toVo();
map.put("taskUserVo", taskUserVo);
return map;
}
// @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查询实体
// SelfCheckBill checkBill = getOne(billId);
// //日常设备信息
// if (checkBill.getDayCheckList() != null) {
//
// String dayDeviceList = checkBill.getDayCheckList();
// 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);
// 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);
// //处理文件
// if (checkBill.getCheckFiles() != null && checkBill.getCheckFiles().length() >0){
// checkBill.setCheckFileList(FilesUtil.stringFileToList(checkBill.getCheckFiles()));
// }
// map.put("checkBill", checkBill);
// //根据业务id查询任务日志
// TaskBto taskBto = taskService.get(billId, BusinessEnum.SELF_CHECK.id);
// List<TaskLogUserVo> taskLogUserVoList = taskLogService.getByTaskId(taskBto.getId());
// map.put("taskLogUserVoList", taskLogUserVoList);
// //查询任务
// TaskUserVo taskUserVo = taskBto.toVo();
// map.put("taskUserVo", taskUserVo);
// return map;
// }
public static void main(String[] args) {
List<String> strings = new ArrayList<>();
......
package com.tykj.dev.device.selfcheck.subject.domin;
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.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
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 javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author zsp
* @create 2022/5/23 9:20
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update daily_check_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("日常检查账单")
public class DailyCheckBill {
/**
* 主键id
*/
@Id
@GeneratedValue
@ApiModelProperty(name = "主键id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id;
/**
* 自查周期(1:月度,2:季度,3:年度,0:未设定周期)
*/
@ApiModelProperty(value = "自查周期(1:月度,2:季度,3:年度,0:未设定周期)")
private Integer cycle;
/**
* 自查标题
*/
@ApiModelProperty(value = "自查标题")
private String title;
/**
* 经办人id(A岗)
*/
@ApiModelProperty(value = "经办人id(A岗)")
private Integer useraId;
/**
* 审核人id(B岗)
*/
@ApiModelProperty(value = "审核人id(B岗)")
private Integer userbId;
/**
* 自查时间
*/
@ApiModelProperty(value = "自查时间")
private Date checkTime;
/**
* 自查单位
*/
@ApiModelProperty(value = "自查单位")
private String checkUnit;
@ApiModelProperty(value = "自查单位Id")
private Integer checkUnitId;
/**
* 应查数量
*/
@ApiModelProperty(value = "应查数量")
private Integer checkingCount;
/**
* 实查数量
*/
@ApiModelProperty(value = "实查数量")
private Integer checkedCount;
/**
* 自查结果
*/
@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的新增")
private String checkDetail;
@Column(name = "un_stock_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "非在库装备转JSon")
private String unStockDetail;
/**
* 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)
*/
@ApiModelProperty(value = "自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)")
private Integer checkStatus;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建单位id
*/
@ApiModelProperty(value = "创建单位id")
private Integer createUnitId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty(value = "更新用户id")
private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@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;
@ApiModelProperty(value = "检查人")
@Transient
private String checkUser;
@ApiModelProperty(value = "确认人")
@Transient
private String confirmUser;
@ApiModelProperty(value = "创建人")
@Transient
private String createUser;
@ApiModelProperty(value = "创建单位")
@Transient
private String createUnit;
@ApiModelProperty(value = "区块链记录id")
private String recordId;
@Column(name = "check_files",columnDefinition = "TEXT")
private String checkFiles;
@Transient
private List<FileRet> checkFileList = new ArrayList<>();
@Transient
private Integer taskId;
@Transient
@ApiModelProperty(name = "任务创建时间")
private Integer taskCreateDate;
@Transient
@ApiModelProperty("日常检查的设备列表")
private List<DeviceLibrary> dayDeviceLibraries;
@Transient
@ApiModelProperty("日常检查设备信息列表")
private List<DeviceLibrary> inDeviceLibraries;
@Transient
@ApiModelProperty("日常检查的设备新增设备列表")
private List<DeviceLibrary> newDeviceLibraries;
}
......@@ -148,17 +148,6 @@ public class SelfCheckBill {
@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_list",columnDefinition = "TEXT")
private String dayCheckList;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房")
@Transient
private String storageLocationName;
......@@ -191,20 +180,4 @@ public class SelfCheckBill {
@Transient
private Integer taskId;
@Transient
@ApiModelProperty(name = "")
private Integer taskCreateDate;
@Transient
@ApiModelProperty("日常检查的设备列表")
private List<DeviceLibrary> dayDeviceLibraries;
@Transient
@ApiModelProperty("日常检查设备信息列表")
private List<DeviceLibrary> inDeviceLibraries;
@Transient
@ApiModelProperty("日常检查的设备新增设备列表")
private List<DeviceLibrary> newDeviceLibraries;
}
......@@ -3,6 +3,7 @@ package com.tykj.dev.device.selfcheck.subject.vo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.misc.utils.JacksonUtil;
import io.swagger.annotations.ApiModel;
......@@ -70,8 +71,8 @@ public class SelfCheckSaveVo {
@ApiModelProperty(value = "是否是日常检查",notes = "0代表 常规检查, 1代表 日常检查")
private Integer isDayCheck = 0;
@ApiModelProperty(value = "日常检查装备")
private String dayCheckList ;
@ApiModelProperty(value = "日常检查装备详情")
private String dayCheckDetail ;
public SelfCheckBill toDo() {
SelfCheckBill selfExaminationBillEntity = new SelfCheckBill();
......@@ -86,4 +87,18 @@ 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;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论