提交 6ae038f7 authored 作者: 邓砥奕's avatar 邓砥奕

更新报废单

上级 d8339067
...@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; ...@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.FileVo; import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.repair.repository.RepairBackBillDao; import com.tykj.dev.device.repair.repository.RepairBackBillDao;
import com.tykj.dev.device.repair.repository.RepairDetailDao;
import com.tykj.dev.device.repair.repository.RepairSendBillDao; import com.tykj.dev.device.repair.repository.RepairSendBillDao;
import com.tykj.dev.device.repair.service.RepairBackBillService; import com.tykj.dev.device.repair.service.RepairBackBillService;
import com.tykj.dev.device.repair.service.RepairBillService; import com.tykj.dev.device.repair.service.RepairBillService;
...@@ -22,6 +23,8 @@ import com.tykj.dev.device.task.service.TaskService; ...@@ -22,6 +23,8 @@ import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto; import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.common.BusinessEnum; import com.tykj.dev.device.task.subject.common.BusinessEnum;
import com.tykj.dev.device.task.subject.common.GlobalMap;
import com.tykj.dev.device.task.subject.common.RepairStatusEnum;
import com.tykj.dev.device.task.subject.common.StatusEnum; import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
...@@ -84,6 +87,9 @@ public class RepairController { ...@@ -84,6 +87,9 @@ public class RepairController {
@Autowired @Autowired
private TaskLogService taskLogService; private TaskLogService taskLogService;
@Autowired
private RepairDetailDao repairDetailDao;
@ApiOperation(value = "发起维修",notes = "可以通过这个接口发起维修") @ApiOperation(value = "发起维修",notes = "可以通过这个接口发起维修")
@PostMapping(value = "/form") @PostMapping(value = "/form")
public ResponseEntity<Task> createRepair(@RequestBody RepairBillSaveVo repairBillSaveVo){ public ResponseEntity<Task> createRepair(@RequestBody RepairBillSaveVo repairBillSaveVo){
...@@ -127,7 +133,7 @@ public class RepairController { ...@@ -127,7 +133,7 @@ public class RepairController {
RepairDetail repairDetail = new RepairDetail(); RepairDetail repairDetail = new RepairDetail();
repairDetail.setDeviceId(d.getDeviceId()); repairDetail.setDeviceId(d.getDeviceId());
DeviceLibrary deviceLibraryEntity =deviceLibraryService.getOne(d.getDeviceId()); DeviceLibrary deviceLibraryEntity =deviceLibraryService.getOne(d.getDeviceId());
repairDetail.setLocationUnit(deviceLibraryEntity.getLocationUnit()); repairDetail.setLocationUnit(userUtils.getCurrentUserUnitName());
repairDetail.setModel(deviceLibraryEntity.getModel()); repairDetail.setModel(deviceLibraryEntity.getModel());
repairDetail.setName(deviceLibraryEntity.getName()); repairDetail.setName(deviceLibraryEntity.getName());
repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit()); repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit());
...@@ -188,6 +194,26 @@ public class RepairController { ...@@ -188,6 +194,26 @@ public class RepairController {
//存业务日志 //存业务日志
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null); TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null);
taskLogService.addLog(taskLogBto); taskLogService.addLog(taskLogBto);
// //如果当前为省,改变装备的所在为中办
// if (userUtils.getCurrentUnitLevel()==1){
// //获取当前业务维修详情
// List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId());
// //获取所有父业务id
// List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
// fathers.forEach(integer -> {
// //筛选出父业务相同装备的维修详情
// List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
// .filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
// .collect(Collectors.toList());
// //添加维修详情
// repairDetailEntities.addAll(repairDetails);
// });
// //改变维修详情装备所在单位为中办
// repairDetailEntities.forEach(repairDetail -> {
// repairDetail.setLocationUnit("中办");
// deviceRepairDetailService.update(repairDetail);
// });
// }
//更新维修单和送修单状态 //更新维修单和送修单状态
repairBill.setRepairStatus(2); repairBill.setRepairStatus(2);
deviceRepairBillService.update(repairBill); deviceRepairBillService.update(repairBill);
...@@ -272,11 +298,14 @@ public class RepairController { ...@@ -272,11 +298,14 @@ public class RepairController {
deviceRepairSendBillService.update(repairSendBill); deviceRepairSendBillService.update(repairSendBill);
//分隔装备id //分隔装备id
String[] strings = deviceIdDetail.split("x"); String[] strings = deviceIdDetail.split("x");
//存接收无误的装备id
List<Integer> idList = new ArrayList<>();
for (String s:strings) { for (String s:strings) {
if (s.length() > 2) { if (s.length() > 2) {
//接收无误 //接收无误
if ("1".equals(s.substring(s.length() - 1))) { if ("1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1)); Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
idList.add(id);
//改变装备状态 //改变装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(0); deviceLibraryEntity.setLifeStatus(0);
...@@ -299,10 +328,20 @@ public class RepairController { ...@@ -299,10 +328,20 @@ public class RepairController {
} }
} }
} }
//更新维修详情单 //获取所有父业务id
repairDetailEntities.forEach(deviceRepairDetailEntity -> { List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
deviceRepairDetailEntity.setLocationUnit(repairBill.getReceiveUnit()); fathers.forEach(integer -> {
deviceRepairDetailService.update(deviceRepairDetailEntity); //筛选出父业务相同装备的维修详情
List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
.filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
.collect(Collectors.toList());
//添加维修详情
repairDetailEntities.addAll(repairDetails);
});
//改变维修详情装备所在单位为当前单位
repairDetailEntities.forEach(repairDetail -> {
repairDetail.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceRepairDetailService.update(repairDetail);
}); });
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("维修装备接收入库"); return ResultUtil.success("维修装备接收入库");
...@@ -394,9 +433,9 @@ public class RepairController { ...@@ -394,9 +433,9 @@ public class RepairController {
RepairBill repairBill= deviceRepairBillService.getOne(taskBto.getBillId()); RepairBill repairBill= deviceRepairBillService.getOne(taskBto.getBillId());
repairOutPutDeviceVo.setRepairBill(repairBill); repairOutPutDeviceVo.setRepairBill(repairBill);
List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>(); List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>();
//筛选所有修好装备的id //筛选所有修好装备或换新装备的id
List<Integer> idList = deviceRepairDetailService.findByBillId(taskBto.getBillId()).stream() List<Integer> idList = deviceRepairDetailService.findByBillId(taskBto.getBillId()).stream()
.filter(deviceRepairDetailEntity -> deviceRepairDetailEntity.getRepairStatus().equals(2)) .filter(deviceRepairDetailEntity -> deviceRepairDetailEntity.getRepairStatus().equals(2)||deviceRepairDetailEntity.getRepairStatus().equals(3))
.map(RepairDetail::getDeviceId) .map(RepairDetail::getDeviceId)
.collect(Collectors.toList()); .collect(Collectors.toList());
//根据id添加装备 //根据id添加装备
...@@ -669,11 +708,14 @@ public class RepairController { ...@@ -669,11 +708,14 @@ public class RepairController {
repairBackBill.setReceiveUserbId(repairReceiveVo.getReceiveUserbId()); repairBackBill.setReceiveUserbId(repairReceiveVo.getReceiveUserbId());
deviceRepairBackBillService.update(repairBackBill); deviceRepairBackBillService.update(repairBackBill);
String[] strings = deviceIdDetail.split("x"); String[] strings = deviceIdDetail.split("x");
//存放正常接收的装备id
List<Integer> idList = new ArrayList<>();
for (String s:strings) { for (String s:strings) {
if(s.length()>1) { if(s.length()>1) {
//接收无误的装备 //接收无误的装备
if ("1".equals(s.substring(s.length() - 1))) { if ("1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1)); Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
idList.add(id);
//更改装备状态 //更改装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(0); deviceLibraryEntity.setLifeStatus(0);
...@@ -696,6 +738,23 @@ public class RepairController { ...@@ -696,6 +738,23 @@ public class RepairController {
} }
} }
} }
//获取维修详情
List<RepairDetail> repairDetailList = deviceRepairDetailService.findByBillId(taskBto.getBillId());
//获取所有父业务id
List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
fathers.forEach(integer -> {
//筛选出父业务相同装备的维修详情
List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
.filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
.collect(Collectors.toList());
//添加维修详情
repairDetailList.addAll(repairDetails);
});
//改变维修详情装备所在单位为当前单位
repairDetailList.forEach(repairDetail -> {
repairDetail.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceRepairDetailService.update(repairDetail);
});
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("维修成功退回装备接收入库"); return ResultUtil.success("维修成功退回装备接收入库");
} }
...@@ -772,8 +831,17 @@ public class RepairController { ...@@ -772,8 +831,17 @@ public class RepairController {
TaskBto taskBto = taskService.get(repairStatusChangeVo.getTaskId()); TaskBto taskBto = taskService.get(repairStatusChangeVo.getTaskId());
//获取所有父任务id //获取所有父任务id
List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail()); List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
//获取维修详情单
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(repairStatusChangeVo.getId());
//获取旧状态
Integer oldStatus = repairDetail1.getRepairStatus();
//修改当前任务维修详情单该装备状态 //修改当前任务维修详情单该装备状态
deviceRepairDetailService.updateIdAndStatus(repairStatusChangeVo.getId(),repairStatusChangeVo.getNewStatus()); repairDetail1.setRepairStatus(repairStatusChangeVo.getNewStatus());
//如果修改为已报废,更改新装备详情id为0
if (repairStatusChangeVo.getNewStatus()==4){
repairDetail1.setNewDeviceDetailId(0);
}
deviceRepairDetailService.update(repairDetail1);
//修改父任务中所有维修详情单中的该装备的状态 //修改父任务中所有维修详情单中的该装备的状态
if (fathers.size()>0) { if (fathers.size()>0) {
fathers.forEach(integer -> { fathers.forEach(integer -> {
...@@ -785,6 +853,51 @@ public class RepairController { ...@@ -785,6 +853,51 @@ public class RepairController {
}); });
}); });
} }
//获取装备名称
String deviceName = deviceLibraryService.getOne(repairStatusChangeVo.getDeviceId()).getName();
//添加业务日志
String remark = "将装备"+deviceName+"状态由"+ GlobalMap.getRepairStatusMap().get(oldStatus).name+"改为"+GlobalMap.getRepairStatusMap().get(repairStatusChangeVo.getNewStatus()).name;
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),remark,null);
taskLogService.addLog(taskLogBto);
return ResultUtil.success("修改成功"); return ResultUtil.success("修改成功");
} }
@ApiOperation(value = "维修换新设备",notes = "可以通过这个接口维修换新设备")
@PostMapping(value = "/change/new")
public ResponseEntity<String> changeNewDevice(@RequestBody ChangeNewDeviceVo changeNewDeviceVo){
//获取当前任务
TaskBto taskBto = taskService.get(changeNewDeviceVo.getTaskId());
//获取当前单位
String unit = userUtils.getCurrentUserUnitName();
//获取所有父任务id
List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
//获取维修详情单
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(changeNewDeviceVo.getId());
//获取换新装备
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(changeNewDeviceVo.getDeviceId());
//判断当前装备是否已报废
if(repairDetail1.getNewDeviceDetailId()==0){
//添加新的维修装备详情
RepairDetail repairDetail = new RepairDetail();
BeanUtils.copyProperties(repairDetail1,repairDetail);
repairDetail.setRepairStatus(RepairStatusEnum.CHANGE_NEW.id);
repairDetail.setDeviceId(changeNewDeviceVo.getDeviceId());
repairDetail.setNewDeviceDetailId(null);
repairDetail.setRfidSurfaceId(deviceLibrary.getRfidSurfaceId());
repairDetail.setSeqNumber(deviceLibrary.getSeqNumber());
//当前业务和父任务添加该详情
deviceRepairDetailService.save(repairDetail);
fathers.forEach(integer -> {
RepairBill repairBill = deviceRepairBillService.getOne(taskService.get(integer).getBillId());
RepairDetail repairDetail2 = new RepairDetail();
BeanUtils.copyProperties(repairDetail,repairDetail2);
repairDetail2.setId(null);
repairDetail2.setDeviceRepairBillId(repairBill.getId());
});
//改变装备的所属
deviceLibrary.setOwnUnit(repairDetail.getOwnUnit());
deviceLibraryService.update(deviceLibrary);
}
return ResultUtil.success("换新成功");
}
} }
...@@ -8,4 +8,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; ...@@ -8,4 +8,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @author dengdiyi * @author dengdiyi
*/ */
public interface RepairBillDao extends JpaRepository<RepairBill,Integer>, JpaSpecificationExecutor<RepairBill> { public interface RepairBillDao extends JpaRepository<RepairBill,Integer>, JpaSpecificationExecutor<RepairBill> {
} }
...@@ -30,4 +30,10 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> { ...@@ -30,4 +30,10 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> {
*/ */
RepairDetail updateIdAndStatus(Integer id,Integer status); RepairDetail updateIdAndStatus(Integer id,Integer status);
/**
* @param id 主键id
* 根据主键Id查询
*/
RepairDetail getOne(Integer id);
} }
...@@ -61,4 +61,19 @@ public class RepairDetailServiceImpl implements RepairDetailService { ...@@ -61,4 +61,19 @@ public class RepairDetailServiceImpl implements RepairDetailService {
throw new ApiException(ResultUtil.failed("所查询ID不存在")); throw new ApiException(ResultUtil.failed("所查询ID不存在"));
} }
} }
/**
* @param id 主键id
* 根据主键Id查询
*/
@Override
public RepairDetail getOne(Integer id) {
Optional<RepairDetail> repairDetail = deviceRepairDetailDao.findById(id);
if (repairDetail.isPresent()){
return repairDetail.get();
}
else {
throw new ApiException(ResultUtil.failed("所查询ID不存在"));
}
}
} }
...@@ -92,6 +92,11 @@ public class RepairDetail { ...@@ -92,6 +92,11 @@ public class RepairDetail {
*/ */
@ApiModelProperty(value = "维修备注") @ApiModelProperty(value = "维修备注")
private String remark; private String remark;
/**
* 已报废换新装备详情主键Id(null代表没有报废,0代表已报废还没有换新)
*/
@ApiModelProperty(value = "已报废换新装备详情主键Id(null代表没有报废,0代表已报废还没有换新)")
private Integer newDeviceDetailId;
/** /**
* 创建用户id * 创建用户id
*/ */
......
package com.tykj.dev.device.repair.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("维修装备换新类")
public class ChangeNewDeviceVo {
@ApiModelProperty(name = "业务id",value = "1")
private Integer taskId;
@ApiModelProperty(name = "维修详情单主键Id",value = "1")
private Integer id;
@ApiModelProperty(name = "装备主键id",value = "1")
private Integer deviceId;
}
import com.tykj.dev.misc.config.AutoDocument;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* @author zjm
*/
@RestController
@RequestMapping(value = "/scrap")
@AutoDocument
@Api(tags = "报废模块",description = "报废模块")
public class DeviceScrapController {
@ApiOperation(value = "查询列表",notes = "可以通过这个接口查询销毁单")
@PostMapping(value = "/summary")
public ResponseEntity<com.tykj.dev.device.scrap.ScrapPage> selectRepairBill(@RequestBody ScrapConditions scrapConditions){
List<ScrapListVo> listVos=new ArrayList<>();
Long time=1598163550704L;
listVos.add(new ScrapListVo(1,"No2.2019号WX12","张馋","李思念","伸莎","MB-001,MC-001","密码机",new Date(time),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
listVos.add(new ScrapListVo(2,"No2.2019号WX13","李生成","许仁","詹彻","MA-001,MP-001","密码机",new Date(time),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
listVos.add(new ScrapListVo(3,"No2.2019号WX14","鲍若人","李奕","陈行","MC-001,M1-001","密码机",new Date(time),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
listVos.add(new ScrapListVo(4,"No2.2019号WX15","李力","石彻","陈镇","MK-001,MC-001","密码机",new Date(time),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
if (scrapConditions.getDimName()!=null) {
for (int i = 0; i < listVos.size(); i++) {
if (((ScrapListVo) (listVos.get(i))).getName().indexOf(scrapConditions.getDimName()) <= -1)
listVos.remove(i);
}
}
if (scrapConditions.getEndTime()!=null && scrapConditions.getStatusTime()!=null) {
listVos.forEach(
scrapListVo -> {
if (scrapConditions.getStatusTime().getTime() < time && scrapConditions.getEndTime().getTime() > time) {
} else {
listVos.remove(scrapListVo);
}
}
);
}
return ResponseEntity.ok(com.tykj.dev.device.scrap.ScrapPage.builder().data(listVos)
.page(scrapConditions.getPage()).size(scrapConditions.getSize()).total(listVos.size()).build());
}
@ApiOperation(value = "查询列表",notes = "可以通过这个接口查询销毁单")
@PostMapping(value = "/summary/{scrapId}")
public ResponseEntity<ScrapListVo> selectRepairBill1( @PathVariable Integer scrapId){
Map<Integer,ScrapListVo> map=new HashMap<>();
map.put(1,new ScrapListVo(1,"No2.2019号WX12","张馋","李思念","伸莎","MB-001,MC-001","密码机",new Date(),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
map.put(2,new ScrapListVo(2,"No2.2019号WX13","李生成","许仁","詹彻","MA-001,MP-001","密码机",new Date(),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
map.put(3,new ScrapListVo(3,"No2.2019号WX14","鲍若人","李奕","陈行","MC-001,M1-001","密码机",new Date(),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
map.put(4,new ScrapListVo(4,"No2.2019号WX15","李力","石彻","陈镇","MK-001,MC-001","密码机",new Date(),"国家密码局","192.168.102.211:8087/status/1.jpeg","陈龚",null));
List<DeviceVo> listVos=new ArrayList<>();
Random rand = new Random();
// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int randomNum = rand.nextInt((1000 - 1) + 1) + 1;
for (int i=0;i<3;i++){
DeviceVo deviceVo =DeviceVo.toDo();
deviceVo.setModel("M"+randomNum);
listVos.add(deviceVo);
}
ScrapListVo scrapListVo=map.get(scrapId);
scrapListVo.setList(listVos);
return ResponseEntity.ok(scrapListVo);
}
}
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceVo.java
* @Description TODO
* @createTime 2020年08月19日 16:39:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "报废装备对象", description = "报废装备对象")
public class DeviceVo {
@ApiModelProperty(value = "型号",example = "bmxx")
public String model;
@ApiModelProperty(value = "类别",example = "1")
public Integer type;
@ApiModelProperty(value = "部件",example = "1")
public Integer parts;
@ApiModelProperty(value = "密级",example = "1")
public String secretLevel;
@ApiModelProperty(value = "可见范围(应用领域)",example = "1")
public Integer invisibleRange;
@ApiModelProperty(value ="备注",example = "msg")
public String msg;
/**
* 装备序列号
*/
@ApiModelProperty(value = "装备序列号")
private String seqNumber;
/**
* 生产序列号
*/
@ApiModelProperty(value = "生产序列号")
private String prodNumber;
public static DeviceVo toDo(){
return new DeviceVo("MB-01",1,1,"机密",1,"---","MB0125576p101","MB012374123");
}
}
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author zjm
* @version 1.0.0
* @ClassName Conditions.java
* @Description TODO
* @createTime 2020年08月23日 13:56:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "报废装备查询条件", description = "报废装备查询条件")
public class ScrapConditions {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty(value = "开始时间",example = "bmxx",name = "statusTime")
private Date statusTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty(value = "结束时间",example = "bmxx",name = "endTime")
private Date endTime;
@ApiModelProperty(value = "模糊搜索",example = "bmxx",name = "dimName")
private String dimName;
@ApiModelProperty(value = "页数",example = "bmxx",name = "page")
private Integer page;
@ApiModelProperty(value = "条数",example = "bmxx",name = "size")
private Integer size;
}
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import java.util.Date;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName entity.java
* @Description TODO
* @createTime 2020年08月19日 16:07:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "专管员对象", description = "专管员记录")
public class ScrapListVo{
/**
* 主键id
*/
@ApiModelProperty(name = "主键id")
private Integer id ;
/**
* 文号
*/
@ApiModelProperty(value = "文号")
private String docNumber ;
/**
* 监销人
*/
@ApiModelProperty(value = "监销人")
private String supervisor ;
/**
* 主管领导
*/
@ApiModelProperty(value = "主管领导")
private String leader ;
/**
* 承办人
*/
@ApiModelProperty(value = "承办人")
private String undertaker ;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
/**
* 名称
*/
@ApiModelProperty(value = "名称")
private String name;
/**
* 报废时间
*/
@ApiModelProperty(value = "报废时间")
private Date scrap;
/**
* 报废单位
*/
private String unitsName;
private String url;
private String v1;
private List<DeviceVo> list;
}
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author LJJ cnljj1995@gmail.com
* on 2020-04-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "报废单分页", description = "报废单分页")
@Builder
public class ScrapPage {
@ApiModelProperty(value = "总数",example = "10")
private Integer total;
@ApiModelProperty(value = "页数,0开始",example = "0")
private Integer page;
@ApiModelProperty(value = "大小",example = "10")
private Integer size;
@ApiModelProperty(value = "数据内容",example = "略")
private List<ScrapListVo> data;
}
...@@ -10,14 +10,22 @@ import java.util.stream.Collectors; ...@@ -10,14 +10,22 @@ import java.util.stream.Collectors;
*/ */
public class GlobalMap { public class GlobalMap {
private static Map<Integer, StatusEnum> statusEnumMap; private static final Map<Integer, StatusEnum> statusEnumMap;
private static final Map<Integer,RepairStatusEnum> repairStatusMap;
static { static {
statusEnumMap = Arrays.stream(StatusEnum.values()) statusEnumMap = Arrays.stream(StatusEnum.values())
.collect(Collectors.toMap(statusEnum -> statusEnum.id, Function.identity())); .collect(Collectors.toMap(statusEnum -> statusEnum.id, Function.identity()));
repairStatusMap = Arrays.stream(RepairStatusEnum.values())
.collect(Collectors.toMap(repairStatusEnum -> repairStatusEnum.id,Function.identity()));
} }
public static Map<Integer, StatusEnum> getStatusEnumMap() { public static Map<Integer, StatusEnum> getStatusEnumMap() {
return statusEnumMap; return statusEnumMap;
} }
public static Map<Integer, RepairStatusEnum> getRepairStatusMap() {
return repairStatusMap;
}
} }
package com.tykj.dev.device.task.subject.common;
import lombok.AllArgsConstructor;
/**
* @author dengdiyi
* 维修状态枚举
*/
@AllArgsConstructor
public enum RepairStatusEnum {
/**
* 等待维修
*/
WAIT_REPAIR(0,"等待维修"),
/**
* 维修中
*/
REPAIRING(1,"维修中"),
/**
* 待领取
*/
WAIT_RECEIVE(2,"待领取"),
/**
* 换新
*/
CHANGE_NEW(3,"换新"),
/**
* 已报废
*/
SCRAPPED(4,"已报废"),
/**
* 已领取
*/
RECEIVED(5,"已领取")
;
public Integer id;
public String name;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论