提交 304b44f7 authored 作者: zjm's avatar zjm

合并分支 'dev' 到 'master'

Dev 合并正式版 查看合并请求 !69
......@@ -232,7 +232,14 @@ public class AllotBillController {
}
//生成发件方上传配发单的子任务
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id, "["+DeviceModelSort.unitNameToDisName(allotBillSaveVo.getReceiveUnit()) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id,
"["+DeviceModelSort.unitNameToDisName(allotBillSaveVo.getReceiveUnit()) + "]型号" +
StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos()
.stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) +
"的装备共" + allotBillSaveVo.getAllotCount() + "件", saveEntity.getId(),
saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(),
3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()),
0, null, Collections.singletonList(0));
taskService.start(taskBto2);
}
//横向配发
......@@ -336,7 +343,8 @@ public class AllotBillController {
// messageService.add(messageBto);
// }
//给同单位专管员和收件单位专管员推阅知
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "对" + userPublicService.getAreaNameByUnitName(allotBillEntity.getReceiveUnit()) + "发起配发", idList, 1);
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "发起配发业务:" + MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit()), idList, 1);
// MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "对" + userPublicService.getAreaNameByUnitName(allotBillEntity.getReceiveUnit()) + "发起配发", idList, 1);
messageService.add(messageBto);
log.info("[配发模块]:" + allotBillEntity.getSendUnit() + "对" + allotBillEntity.getReceiveUnit() + "发起配发");
myWebSocket.sendMessage1();
......@@ -470,8 +478,8 @@ public class AllotBillController {
messageService.add(messageBto);
}
//根据status判断是否业务完结,发送不同的阅知message
String message = allotReceiveVo.getStatus() == 0 ? "业务办结" : "接收配发装备";
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), message, ids, 1);
String message = allotReceiveVo.getStatus() == 0 ? "办结配发业务:" :"接收配发装备:";
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), message+MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit()), ids, 1);
messageService.add(messageBto);
log.info("[配发模块]:接收并发起入库");
myWebSocket.sendMessage1();
......@@ -683,7 +691,9 @@ public class AllotBillController {
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getSendUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "业务办结", ids, 1);
String content = "发起配发业务已办结";
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(),
content, ids, 1);
messageService.add(messageBto);
return ResponseEntity.ok("上传成功");
}
......@@ -762,7 +772,10 @@ public class AllotBillController {
userIds.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto.getParentTaskId(), taskBto.getBusinessType(), "业务办结", userIds, 1);
// String content = allotBill.getReceiveUnit()+"单位的配发业务已办结";
String content = "办结配发业务";
// MessageBto messageBto = new MessageBto(taskBto.getParentTaskId(), taskBto.getBusinessType(), "业务办结", userIds, 1);
MessageBto messageBto = new MessageBto(taskBto.getParentTaskId(), taskBto.getBusinessType(), content+MessageFormatUtil.spellTwoWicket(allotBill.getSendUnit(),allotBill.getReceiveUnit()), userIds, 1);
messageService.add(messageBto);
return ResponseEntity.ok("OK");
}
......@@ -793,8 +806,14 @@ public class AllotBillController {
//根据任务id查询子任务 发件方是子任务 收件方是主任务
TaskBto taskBto = taskService.get(taskId);
Integer parentTaskId = taskBto.getParentTaskId();
TaskBto parentTask = taskService.get(parentTaskId);
MessageBto messageBto1;
if (parentTaskId!=null){
TaskBto parentTask = taskService.get(parentTaskId);
taskService.moveToRevoke(parentTask);
messageBto1 = messageService.findByTaskId(parentTaskId).parse2Bto();
}else {
messageBto1 = messageService.findByTaskId(taskBto.getId()).parse2Bto();
}
//父任务未被完成 可以被撤回
Integer billId = taskBto.getBillId();
String title = taskBto.getTitle();
......@@ -803,7 +822,6 @@ public class AllotBillController {
Integer currentUserId = userUtils.getCurrentUserId();
List<Integer> idList = userPublicService.findOtherUser(currentUserId);
//找到收件方的阅知
MessageBto messageBto1 = messageService.findByTaskId(parentTaskId).parse2Bto();
//纵向配发阅知要发给收件单位的人
if (allotBill.getAllotType() == 1) {
idList.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getReceiveUnit())).stream()
......@@ -812,19 +830,21 @@ public class AllotBillController {
}
//给同单位专管员和收件单位专管员推阅知
// messageBto1.setContent(title.substring(0,4)+"撤回"+title.substring(4));
messageBto1.setContent("撤回任务:" + title);
MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1);
BeanUtils.copyProperties(messageBto1,messageBto);
messageBto.setTaskId(-1);
messageService.add(messageBto);
myWebSocket.sendMessage1();
//将任务都完结
taskService.moveToRevoke(taskBto);
taskService.moveToRevoke(parentTask);
// messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+"的任务");
// MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1);
// BeanUtils.copyProperties(messageBto1,messageBto);
// messageBto.setTaskId(-1);
// messageService.add(messageBto);
// myWebSocket.sendMessage1();
// //将任务都完结
// taskService.moveToRevoke(taskBto);
// taskService.moveToRevoke(parentTask);
List<DeviceLibrary> deviceLibraryList = null;
if (allotBill.getAllotCheckDetail() != null) {
List<Integer> ids = StringSplitUtil.split(allotBill.getAllotCheckDetail());
//所有的装备
List<DeviceLibrary> deviceLibraryList;
// List<DeviceLibrary> deviceLibraryList;
//所有的装备日志
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
......@@ -846,10 +866,25 @@ public class AllotBillController {
allotBillService.delete(allotBill.getId());
}
messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+deviceLibraryList.stream().map(DeviceLibrary::getModel)
.collect(Collectors.toList())+"的任务");
MessageBto messageBto = new MessageBto(-1, taskBto.getBusinessType(), messageBto1.getContent(), idList, 1);
BeanUtils.copyProperties(messageBto1,messageBto);
messageBto.setTaskId(-1);
messageService.add(messageBto);
myWebSocket.sendMessage1();
//将任务都完结
taskService.moveToRevoke(taskBto);
return ResponseEntity.ok(messageBto);
}
//递归取出最大目录
public PackingLibrary getPackingLibrary(PackingLibrary packingLibrary) {
Integer partParentId = packingLibrary.getPartParentId();
......
......@@ -48,9 +48,6 @@ public class AllotBillSelectController {
@Autowired
private AllotBackBillService allotBackBillService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@Autowired
private TaskService taskService;
......
......@@ -201,7 +201,9 @@ public class BackController {
messageService.add(messageBto);
}
//给同单位专管员和收件单位专管员推阅知
MessageBto messageBto = new MessageBto(saveEntity.getId(),saveEntity.getBusinessType(),"对" + userPublicService.getAreaNameByUnitName(allotBackBill.getReceiveUnit()) + "发起退回",idList,1);
// MessageBto messageBto = new MessageBto(saveEntity.getId(),saveEntity.getBusinessType(),"对" + userPublicService.getAreaNameByUnitName(allotBackBill.getReceiveUnit()) + "发起退回",idList,1);
MessageBto messageBto = new MessageBto(saveEntity.getId(),saveEntity.getBusinessType(),"发起退回业务:" + MessageFormatUtil.spellTwoWicket(allotBackBill1.getSendUnit(),allotBackBill1.getReceiveUnit()),idList,1);
messageService.add(messageBto);
log.info("[退回模块]:" + allotBackBill.getSendUnit() + "对" + allotBackBill.getReceiveUnit() + "发起退回");
//添加taskId
......@@ -319,8 +321,10 @@ public class BackController {
messageService.add(messageBto);
}
//根据status判断是否业务完结,发送不同的阅知message
String message = allotBackReceiveVo.getStatus()==0?"业务办结":"接收退回装备";
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),message,ids,1);
// String message = allotBackReceiveVo.getStatus()==0?"业务办结":"接收退回装备";
String message = allotBackReceiveVo.getStatus()==0?"办结退回:":"接收退回装备:";
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
message+MessageFormatUtil.spellTwoWicket(allotBackBill.getSendUnit(),allotBackBill.getReceiveUnit()),ids,1);
messageService.add(messageBto);
log.info("[退回模块]:接收并发起入库");
myWebSocket.sendMessage1();
......@@ -382,7 +386,9 @@ public class BackController {
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBackBill.getSendUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"业务办结",ids,1);
// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"业务办结",ids,1);
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
"办结退回业务:"+MessageFormatUtil.spellTwoWicket(allotBackBill.getSendUnit(),allotBackBill.getReceiveUnit()),ids,1);
messageService.add(messageBto);
return ResponseEntity.ok("上传成功");
}
......@@ -458,7 +464,8 @@ public class BackController {
userIds.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBackBill.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto.getParentTaskId(),taskBto.getBusinessType(),"业务办结",userIds,1);
MessageBto messageBto = new MessageBto(taskBto.getParentTaskId(),taskBto.getBusinessType(),
"办结退回业务"+MessageFormatUtil.spellTwoWicket(allotBackBill.getSendUnit(),allotBackBill.getReceiveUnit()),userIds,1);
messageService.add(messageBto);
return ResponseEntity.ok("OK");
}
......
......@@ -2,6 +2,9 @@ package com.tykj.dev.device.apply.service;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo;
import com.tykj.dev.device.apply.subject.vo.RemoveFromSeqListVo;
import com.tykj.dev.device.apply.subject.vo.RemoveSameSeqVo;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import java.util.List;
......@@ -28,4 +31,14 @@ public interface DeviceApplyBillService {
*/
void updateCompleteNum(Integer applyType , List<ScriptSaveVo> scriptSaveVos);
List<StringBuffer> checkNumAndSeqNumber(List<ApplyTaskDeviceCheckVo> applyTaskDeviceCheckVos);
/**
* 申请任务入库 当修改试用装备序列时,移除序列号区间中所在的序列号
*/
List<String> removeFromSeqList(RemoveFromSeqListVo removeFromSeqListVo);
List<String> removeSameSeq(RemoveSameSeqVo removeSameSeqVo);
}
......@@ -7,8 +7,13 @@ import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.device.apply.repository.DeviceApplyBillDao;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo;
import com.tykj.dev.device.apply.subject.vo.RemoveFromSeqListVo;
import com.tykj.dev.device.apply.subject.vo.RemoveSameSeqVo;
import com.tykj.dev.device.apply.subject.vo.ReplyVo;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.impl.CacheLibraryServiceImpl;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.task.repository.TaskDao;
......@@ -22,6 +27,8 @@ import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.DeviceSeqUtil;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.misc.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
......@@ -63,6 +70,9 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceLibraryCacheService deviceLibraryCacheService;
@Override
public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity);
......@@ -202,4 +212,80 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
}
}
}
@Override
public List<StringBuffer> checkNumAndSeqNumber(List<ApplyTaskDeviceCheckVo> applyTaskDeviceCheckVos) {
List<StringBuffer> stringBufferList = new ArrayList<>();
applyTaskDeviceCheckVos.forEach(applyTaskDeviceCheckVo -> {
StringBuffer stringBuffer = new StringBuffer();
//先判断数量是否一致
//入库数量
Integer storageCount = applyTaskDeviceCheckVo.getStorageCount();
//批复数量
Integer replyNum = applyTaskDeviceCheckVo.getReplyNum();
//试用装备数量
Integer tryOutNum = applyTaskDeviceCheckVo.getTryOutNum();
stringBuffer.append("序号为").append(applyTaskDeviceCheckVo.getI()+1).append(":");
if (replyNum<tryOutNum){
//提示 批复数量不能小于试用数量
stringBuffer.append("批复数量不能小于试用数量").append(",");
}
if (replyNum>storageCount){
//提示 批复数量不能大于申请数量
stringBuffer.append("批复数量不能大于申请数量").append(",");
}
//获取序列号区间
String seqNumInter = applyTaskDeviceCheckVo.getSeqNumInter();
if (seqNumInter != null){
//然后进行拆分
//输入序列号的区间
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seqNumInter);
if (!replyNum.equals(inputSeqs.size())){
//提示 批复数量跟输入区间不一致
stringBuffer.append("批复数量与序列号区间不一致");
}
//查询所有的序列号 检验是否重复
// List<String> allSeqList = deviceLibraryCacheService.getAllDeviceLibraryList().stream()
// .map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
// allSeqList.retainAll(inputSeqs);
// if (allSeqList.size()>0){
// //说明有重复的序列号
// stringBuffer.append("序列号").append(allSeqList).append("已存在");
// }
}
stringBufferList.add(stringBuffer);
});
return stringBufferList;
}
@Override
public List<String> removeFromSeqList(RemoveFromSeqListVo removeFromSeqListVo) {
//对区间进行拆分
String seqNumberList = removeFromSeqListVo.getSeqNumberList();
//对序列号区间进行拆分
List<String> seqs = DeviceSeqUtil.selectDeviceSeqs(seqNumberList);
List<String> seq1 = DeviceSeqUtil.selectDeviceSeqs(removeFromSeqListVo.getSeqNumber());
seqs.removeAll(seq1);
//对原来的集合先进行排序
seqs.sort(Comparator.comparing(String::toString));
return DeviceSeqUtil.getContinuousSeqs(seqs);
}
@Override
public List<String> removeSameSeq(RemoveSameSeqVo removeSameSeqVo) {
String seqNumberList = removeSameSeqVo.getSeqNumberList();
List<String> selectDeviceSeqs = DeviceSeqUtil.selectDeviceSeqs(seqNumberList);
if (selectDeviceSeqs.size()>0){
List<String> removeSameSeq = removeSameSeqVo.getRemoveSameSeq();
if (removeSameSeq.size()>0){
selectDeviceSeqs.removeAll(removeSameSeq);
}
}
List<String> continuousSeqs = DeviceSeqUtil.getContinuousSeqs(selectDeviceSeqs);
return continuousSeqs;
}
}
......@@ -88,7 +88,7 @@ public class DeviceApplyBill {
/**
* 申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:已批复待审核,4:批复审核失败,5:申请成功)
*/
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办批复,4:批复后待执行)")
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办批复,4:批复后待执行,6:业务待完结)")
private Integer applyStatus;
/**
* 列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件
......
......@@ -2,7 +2,9 @@ package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -11,6 +13,8 @@ import java.util.List;
*/
@Data
@ApiModel("申请详情类")
@AllArgsConstructor
@NoArgsConstructor
public class ApplyBillDetailVo {
// @NotNull(message = "packingId不能为空")
......@@ -23,12 +27,22 @@ public class ApplyBillDetailVo {
@ApiModelProperty(value = "申请数量")
private Integer storageCount;
@ApiModelProperty(value = "批复数量")
@ApiModelProperty(value = "可入库数量")
private Integer waitNum;
@ApiModelProperty(value = "已入库数量")
private Integer completeCount = 0;
@ApiModelProperty(value = "批复数量")
private Integer replyNum;
@ApiModelProperty(value = "已选中申请数量")
private Integer selectApplyNum;
@ApiModelProperty(value = "装备id")
private List<Integer> deviceIds;
@ApiModelProperty(value = "序列号区间", example = "1")
private String seqInterval;
......@@ -37,4 +51,5 @@ public class ApplyBillDetailVo {
public void setChildNull() {
childs=null;
}
}
package com.tykj.dev.device.apply.subject.vo;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("申请同意的校验vo")
public class ApplyTaskDeviceCheckVo {
@ApiModelProperty(value = "序列号")
private Integer i;
@ApiModelProperty(value = "申请数量")
private Integer storageCount;
@ApiModelProperty(value = "试用数量")
private Integer tryOutNum;
@ApiModelProperty(value = "批复数量")
private Integer replyNum;
@ApiModelProperty(value = "序列号区间")
private String seqNumInter;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("业务待办结vo")
@AllArgsConstructor
@NoArgsConstructor
public class ApplyTaskToEnd {
@ApiModelProperty(value = "任务id")
private Integer taskId;
@ApiModelProperty(value = "装备id的集合")
private List<Integer> deviceIds;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("选择试用装备详情类")
@AllArgsConstructor
@NoArgsConstructor
public class ApplyTryVo {
@ApiModelProperty(value = "列装id")
private Integer packingId;
@ApiModelProperty(value = "装备id的集合")
private List<Integer> deviceIds;
}
......@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.Valid;
import javax.validation.constraints.Min;
......@@ -25,7 +26,7 @@ import java.util.List;
@ApiModel("装备申请存储类")
public class DeviceApplySaveVo {
// @NotNull(message = "applyNumber不能为空")
// @NotNull(message = "applyNumber不能为空")
@ApiModelProperty(value = "申请文号")
private String applyNumber;
......@@ -70,6 +71,10 @@ public class DeviceApplySaveVo {
@ApiModelProperty(value = "申请类型(1:装备申请,2:退役申请,3:报废申请,4:销毁申请)")
private Integer applyType;
@ApiModelProperty(value = "选择试用装备详情类")
private List<ApplyTryVo> applyTryVos;
/**
* 转实体
*/
......@@ -86,12 +91,12 @@ public class DeviceApplySaveVo {
//拼接列装id和申请数量字符串
for (ApplyBillDetailVo s : applyBillDetailVos) {
stringBuffer.append(s.getPackingId()).append("x");
if (s.getStorageCount()!=null) {
stringBuffer.append(s.getStorageCount()).append("x");
}
else {
stringBuffer.append(0).append("x");
}
if (s.getStorageCount()!=null) {
stringBuffer.append(s.getStorageCount()).append("x");
}
else {
stringBuffer.append(0).append("x");
}
}
//转为json存储
deviceApplyBillEntity.setApplyStat(JacksonUtil.toJSon(applyBillDetailVos));
......
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
*/
@Data
@ApiModel("当修改试用装备序列时,移除序列号区间中所在的序列号vo")
public class RemoveFromSeqListVo {
@ApiModelProperty(value = "序列号区间")
private String seqNumberList;
@ApiModelProperty(value = "要移除的序列号")
private String seqNumber;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("移除重复的序列号,在序列号区间中所在的序列号vo")
public class RemoveSameSeqVo {
@ApiModelProperty(value = "序列号区间")
private String seqNumberList;
@ApiModelProperty(value = "重复的序列号")
private List<String> removeSameSeq;
}
package com.tykj.dev.device.apply.subject.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("查询已经入库的试用装备的vo")
public class SelectTryOutDeviceVo extends CustomPage {
@ApiModelProperty(value = "列装id的集合",example = "1,2,3")
private List<Integer> packingIds;
@ApiModelProperty(value = "型号", example = "bmxx")
public String model;
@ApiModelProperty(value = "类型", example = "1")
public Integer type;
@ApiModelProperty(value = "密级", example = "1")
public Integer secretLevel;
@ApiModelProperty(value = "可见范围(应用领域)", example = "1")
public Integer invisibleRange;
@ApiModelProperty(value = "名称", example = "BM-1")
public String name;
@ApiModelProperty(value = "配用范围", example = "1")
public Integer matchingRange;
}
......@@ -2,6 +2,7 @@ package com.tykj.dev.config.cache;
import com.tykj.dev.config.domin.SystemConfig;
import lombok.Data;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
......@@ -32,6 +33,8 @@ public class ConfigCache {
private Map<Integer, String> storageLocationMap;
private Map<Integer, String> matchingTypeMap;
public ConfigCache(List<SystemConfig> systemConfigs){
this.lifeStatusMap = systemConfigs.stream().filter(systemConfig -> "lifeStatus".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
......@@ -45,7 +48,7 @@ public class ConfigCache {
this.positionMap = systemConfigs.stream().filter(systemConfig -> "position".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.allotTypeMap = systemConfigs.stream().filter(systemConfig -> "allotType".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.storageLocationMap = systemConfigs.stream().filter(systemConfig -> "storageLocation".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.matchingTypeMap=systemConfigs.stream().filter(systemConfig -> "matchingType".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
}
public Map<Integer, String> getMatchingRangeMap() {
......@@ -92,6 +95,9 @@ public class ConfigCache {
return storageLocationMap;
}
public Map<Integer, String> getMatchingTypeMap() {
return matchingTypeMap;
}
public ConfigCache refresh(List<SystemConfig> systemConfigs){
this.lifeStatusMap = systemConfigs.stream().filter(systemConfig -> "lifeStatus".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
......@@ -105,6 +111,7 @@ public class ConfigCache {
this.positionMap = systemConfigs.stream().filter(systemConfig -> "position".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.allotTypeMap = systemConfigs.stream().filter(systemConfig -> "allotType".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.storageLocationMap = systemConfigs.stream().filter(systemConfig -> "storageLocation".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
this.matchingTypeMap=systemConfigs.stream().filter(systemConfig -> "matchingType".equals(systemConfig.getEnglishName())).collect(Collectors.toMap(SystemConfig::getValue, SystemConfig::getLabel));
return this;
}
}
......@@ -1288,6 +1288,12 @@ public class DeviceCheckController {
DeviceCheckStat dcs = statRepo.findById(fatherTask.getBillId()).get();
removeDetailFromDcs(currentDetail, dcs);
//撤销时恢复市统计任务;
if(END.id.equals(fatherTask.getBillStatus())) {
fatherTask.setBillStatus(StatusEnum.CHECK_EXAM_STAT_1.id);
taskService.update(fatherTask);
}
return ResponseEntity.ok("回退成功!回滚该任务到初始状态,id = " + currentTask.getId());
}
......@@ -1321,16 +1327,20 @@ public class DeviceCheckController {
Task checkTask = taskRepo.findByBillIdAndBusinessType(statId, CONFIRM_CHECK_STAT.id).get();
List<Task> l1Childs = taskRepo.findAllByParentTaskId(checkTask.getId());
List<String> unitNames = new ArrayList<>();
Set<String> unitNames = new HashSet<>();
for (Task c1 : l1Childs) {
if (predNodeType(c1).equals(CcNodeType.EXAM)) {
List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId());
List<String> notEndUnitNames = detailTaskList
.stream().filter(task -> !task.getBillStatus().equals(END.id))
.map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName())
.collect(toList());
unitNames.addAll(notEndUnitNames);
if(detailTaskList.isEmpty()) {
unitNames.add(unitsRepo.findById(c1.getOwnUnit()).get().getName());
} else {
List<String> notEndUnitNames = detailTaskList
.stream().filter(task -> !task.getBillStatus().equals(END.id))
.map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName())
.collect(toList());
unitNames.addAll(notEndUnitNames);
}
}else if (predNodeType(c1).equals(CcNodeType.MANUAL)&& !c1.getBillStatus().equals(END.id)){
String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName();
unitNames.add(unitName);
......
......@@ -45,4 +45,7 @@ public class CheckStatTableVo {
private Integer checkType;
private String queryField;
@ApiModelProperty("展示类型,0-统计,1-详情")
private Integer showType;
}
package com.tykj.dev.device.confirmcheck.service.impl;
import com.github.wenhao.jpa.Specifications;
import com.google.common.collect.Lists;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
......@@ -10,6 +11,7 @@ import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckPeriod;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckBillSelectVo;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckDetailVo;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckDeviceStatVo;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckBillDao;
......@@ -23,6 +25,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.user.cache.AreaCache;
import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
......@@ -34,6 +37,7 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.MapperUtils;
import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.TimestampUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
......@@ -41,6 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.support.CronTrigger;
......@@ -325,6 +330,34 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
.filter(v1->unitIdFilter(v1,checkBillSelectVo.getUnitId()))
.collect(Collectors.toList());
//市级需要添加详情账单信息
Units unit = unitsRepo.findById(checkBillSelectVo.getUnitId()).get();
if(unit.getLevel() == 2) {
Specification<DeviceCheckDetail> pred = Specifications.<DeviceCheckDetail>and()
.eq("checkUnit", unit.getName())
.build();
List<CheckDetailVo> detailVoList = detailRepo.findAll(pred).stream()
.map(transUtil::CheckDetailDo2Vo)
.collect(toList());
List<CheckStatTableVo> cityDetailToStatList = detailVoList.stream().map(checkDetailVo -> {
CheckStatTableVo checkStatTableVo = new CheckStatTableVo();
checkStatTableVo.setId(checkDetailVo.getId());
String[] titles = checkDetailVo.getTitle().split("\\%\\^\\&");
if(titles.length > 1) {
checkStatTableVo.setTitle(titles[1]);
}
checkStatTableVo.setShowType(1);
checkStatTableVo.setCreateTime(TimestampUtil.dateToLocalDateTime(checkDetailVo.getCheckTime()));
//设置完成情况
List<TaskUserVo> taskUserVos = taskService.findByBillIdAndBusinessType(checkDetailVo.getId(), 8).stream().map(Task::parse2Bto).map(TaskBto::toVo).collect(toList());
if (taskUserVos.size() == 1) {
checkStatTableVo.setCompletion(taskUserVos.get(0).getStatus());
}
return checkStatTableVo;
}).collect(toList());
tableVos.addAll(cityDetailToStatList);
}
return PageUtil.getPerPage(checkBillSelectVo.getPage(),checkBillSelectVo.getSize(),tableVos,checkBillSelectVo.getPageable());
}
......
......@@ -194,7 +194,8 @@ public class ObjTransUtil {
stat.getCreateTime(),
completion,
stat.getCheckType().getId(),
joiner.toString()
joiner.toString(),
0
);
}
......
......@@ -23,8 +23,8 @@ import java.util.List;
public class WorkHandoverDoc {
@ApiModelProperty(name = "时间")
private Date time;
private String unit;
@ApiModelProperty(name = "装备数据集合")
private List<WorkHandoverDevice> workHandoverDeviceList;
private List<DocumentDevice> workHandoverDeviceList;
}
......@@ -13,6 +13,7 @@ import com.tykj.dev.device.finalcheck.repisotry.FinalDetailDao;
import com.tykj.dev.device.finalcheck.repisotry.FinalReportDao;
import com.tykj.dev.device.finalcheck.service.FinalCheckService;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -52,8 +53,11 @@ public class FinalCheckServiceImpl implements FinalCheckService {
@Autowired
private FinalDetailDao detailDao;
// @Autowired
// private DeviceLibraryDao deviceDao;
@Autowired
private DeviceLibraryDao deviceDao;
private DeviceLibraryCacheService deviceLibraryCacheService;
@Autowired
private DeviceUseReportService dataService;
......@@ -93,7 +97,9 @@ public class FinalCheckServiceImpl implements FinalCheckService {
report = reportDao.save(report);
// 查询这段时间内该单位下的所有装备 并且计数
// List<DeviceLibrary> devices = deviceDao.findAllByUnitBetweenTime(unitName, localDateToDate(startTime), localDateToDate(endTime));
List<DeviceLibrary> devices = deviceDao.findAll();
// List<DeviceLibrary> devices = deviceDao.findAll();
List<DeviceLibrary> devices = deviceLibraryCacheService.getAllDeviceLibraryList();
// PredicateBuilder<DeviceLibrary> builder = Specifications.and();
// builder.eq("ownUnit",unitName);
// List<DeviceLibrary> devices = deviceDao.findAll(builder.build());
......
package com.tykj.dev.device.library.repository;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
......@@ -166,6 +167,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List<DeviceLibrary> findAllByPackingId(Integer packingIds);
List<DeviceLibrary> findAllByPackingIdIn(List<Integer> packingIds, Pageable pageable);
List<DeviceLibrary> findAllByPackingIdIn(List<Integer> packingIds);
......@@ -214,10 +217,10 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Param("packingId") Integer packingId,
@Param("deviceIds") List<Integer> deviceIds);
// @Transactional
// @Modifying
// @Query("update DeviceLibrary o set o.partParentId = null where o.id in :deviceIds")
// int updatePartParentId(
// @Param("deviceIds") List<Integer> deviceIds);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.partParentId = null where o.id in :deviceIds")
int updatePartParentId(
@Param("deviceIds") List<Integer> deviceIds);
}
package com.tykj.dev.device.library.service;
import com.tykj.dev.config.UpdateCache;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.BindingDeviceVo;
import com.tykj.dev.device.library.subject.vo.DeviceForApplyVo;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo;
import org.springframework.data.domain.Page;
......@@ -218,6 +220,18 @@ public interface DeviceLibraryService {
*/
List<DeviceLibrary> findAllByPackingId(Integer packingId);
/**
* 通过列装id查询所有装备
*/
List<DeviceLibrary> findAllByPackingIdsIn(List<Integer> packingIds,Pageable pageable);
List<DeviceLibrary> findAllByPackingIdsIn(List<Integer> packingIds);
/**
* 根据partParentId查询附件
* @param id 装备的id
*/
List<DeviceLibrary> findAllByPartParentId(Integer id);
/**
* 通过列装id查询所有装备
*/
......@@ -275,13 +289,13 @@ public interface DeviceLibraryService {
* 装备的解除
* @param deviceId 装备id
*/
void relieveDevice(int deviceId);
// void relieveDevice(int deviceId);
/**
* 装备的绑定
* @param
*/
void bindingDevice(BindingDeviceVo bindingDeviceVo);
// /**
// * 装备的绑定
// * @param
// */
// void bindingDevice(BindingDeviceVo bindingDeviceVo);
/**
* 以下接口都为缓存做铺垫
......@@ -435,10 +449,54 @@ public interface DeviceLibraryService {
*/
List<DeviceLibrary> findAllDevices();
// /**
// * 根据装备id的集合更新列装id
// * @param deviceIds 装备id的集合
// * @return 影响行数
// */
// int updatePartParentId(List<Integer> deviceIds);
/**
* 根据装备id的集合更新列装id
* @param deviceIds 装备id的集合
*/
void updatePartParentId(List<Integer> deviceIds);
/**
* 装备进行解绑
* @param deviceLibraries 装备附件的集合
*/
void unboundDevice(List<DeviceLibrary> deviceLibraries);
/**
* 装备绑定
* @param bindingDeviceVo 装备绑定的vo
*/
void boundDevice(BindingDeviceVo bindingDeviceVo);
/**
* 根据rfid查询装备
* @return 装备的集合
*/
List<DeviceLibrary> getAllBySeqNumber(String rfid);
/**
* 根据id集合查询装备
* @param ids 装备id的集合
*/
List<DeviceLibrary> findAllByIds(List<Integer> ids);
/**
* 更新装备的状态 正式和试用
*/
void updateTry(List<DeviceLibrary> deviceLibraries);
/**
* 获取所有装备的集合
* @param deviceLibrarySelectVo 查询装备的vo
* @return 所有装备
*/
List<DeviceLibrary> getAlldevList(DeviceLibrarySelectVo deviceLibrarySelectVo);
/**
* 根据装备id更新装备
* @param deviceForApplyVo 更新试用装备序列号的vo
*/
void updateSeqNumber(DeviceForApplyVo deviceForApplyVo);
}
......@@ -44,7 +44,7 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
public List<DeviceLibrary> getAllDeviceLibraryList() {
long start = System.currentTimeMillis();
List<DeviceLibrary> all = deviceLibraryDao.findAll();
log.info("缓存时间:{}", System.currentTimeMillis() - start);
log.info("创建缓存时间:{}", System.currentTimeMillis() - start);
return all;
}
......
......@@ -19,6 +19,7 @@ import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -33,7 +34,7 @@ import java.util.List;
@SQLDelete(sql = "update device_library set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("装备库")
public class DeviceLibrary {
public class DeviceLibrary implements Serializable {
/**
* 主键id
......@@ -192,6 +193,9 @@ public class DeviceLibrary {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0;
@ApiModelProperty(value = "入库操作人")
@Transient
private String storageProcessingUser;
......@@ -312,6 +316,8 @@ public class DeviceLibrary {
setTypeName(configCache.getStyleMap().get(this.type)==null?"-":configCache.getStyleMap().get(this.type));
setStorageTypeName(configCache.getStorageTypeMap().get(this.storageType)==null?"-":configCache.getStorageTypeMap().get(this.storageType));
setAllotTypeName(configCache.getAllotTypeMap().get(this.allotType)==null?"-":configCache.getAllotTypeMap().get(this.allotType));
childs.clear();
// setChilds(new ArrayList<>());
}
return this;
}
......
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("装备绑定的vo")
public class BindingDeviceVo {
@ApiModelProperty(value = "要绑定的装备id")
private Integer originDeviceId;
@ApiModelProperty(value = "需要绑定到的装备id")
private Integer toDeviceId;
@ApiModelProperty(value = "装备")
private DeviceLibrary orginDeviceLibrary;
@ApiModelProperty(value = "附件集合")
private List<DeviceLibrary> deviceLibraries;
}
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author zsp
*/
@Repository
@Data
@ApiModel("更新试用装备序列号的vo")
public class DeviceForApplyVo {
@NotNull(message = "deviceId不能为空")
@Min(value = 1,message = "deviceId不能小于1")
@ApiModelProperty(value = "装备id", example = "1")
private Integer deviceId;
@ApiModelProperty(value = "装备的序列号", example = "12344")
private String seqNumber;
}
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("装备查询类")
public class DeviceLibraryCacheSelectVo extends CustomPage {
@ApiModelProperty(value = "装备id", example = "1")
public Integer deviceId;
@ApiModelProperty(value = "操作人", example = "1")
public Integer UserAId;
@ApiModelProperty(value = "审核人", example = "1")
public Integer UserBId;
@ApiModelProperty(value = "型号", example = "bmxx")
public String model;
@ApiModelProperty(value = "类型", example = "1")
public Integer type;
@ApiModelProperty(value = "密级", example = "1")
public Integer secretLevel;
@ApiModelProperty(value = "可见范围(应用领域)", example = "1")
public Integer invisibleRange;
@ApiModelProperty(value = "名称", example = "BM-1")
public String name;
@ApiModelProperty(value = "配用范围", example = "1")
public Integer matchingRange;
@ApiModelProperty(value = "入库类型", example = "1")
public Integer storageType;
@ApiModelProperty(value = "管理状态", example = "1")
public Integer manageStatus;
@ApiModelProperty(value = "单位id", example = "1")
public Integer unitId;
@ApiModelProperty(value = "区域id", example = "1")
public Integer areaId;
@ApiModelProperty(value = "模糊查询内容", example = "测试")
public String content;
@ApiModelProperty(value = "发起时间", example = "2020-10-10 01:10:10")
public Date startTime;
@ApiModelProperty(value = "确认时间", example = "2020-10-10 01:10:10")
public Date endTime;
@ApiModelProperty(value = "列装id")
private Integer packingId;
@ApiModelProperty(value = "所在单位")
private String locationUnit;
@ApiModelProperty(value = "所属单位")
private String ownUnit;
@ApiModelProperty(value = "rfid卡号")
private String rfidCardId;
@ApiModelProperty(value = "是不是配件(0:不是,1:是)")
private Integer isPart;
@ApiModelProperty(value = "序列号区间")
private String seqInterval;
@ApiModelProperty(value = "型号模糊查询字段")
private String modelDim;
@ApiModelProperty(value = "名称模糊查询字段")
private String nameDim;
@ApiModelProperty(value = "序列号模糊查询字段")
private String seqDim;
@ApiModelProperty(value = "表面号模糊查询字段")
private String surfaceDim;
@ApiModelProperty(value = "标签编码模糊查询字段")
private String rfidCardDim;
@ApiModelProperty(value = "所在单位模糊查询字段")
private String locationUnitDim;
@ApiModelProperty(value = "所属单位模糊查询字段")
private String ownUnitDim;
@ApiModelProperty(value = "生命状态模糊查询字段")
private String lifeStatusDim;
@ApiModelProperty(value = "更新时间模糊查询字段")
private String updateTimeDim;
@ApiModelProperty(value = "创建时间模糊查询字段")
private String createTimeDim;
@ApiModelProperty(value = "更新时间年份")
private Integer year;
@ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备")
private Integer isPrint;
@ApiModelProperty(value = "存储位置")
private String storageLocation;
@ApiModelProperty(value = "存储位置的模糊查询字段")
private String storageLocationDim;
@ApiModelProperty(value = "装备形态模糊查询字段")
private String typeDim;
@ApiModelProperty(value = "作为已报废,已销毁,已退役的标志位",notes = "0 代表查询 1代表查询其他")
private Integer isScraped =1;
}
......@@ -60,4 +60,9 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0;
@ApiModelProperty(value = "试用装备数量")
private Integer tryOutDeviceNum ;
}
......@@ -15,6 +15,9 @@ import java.util.List;
@ApiModel("装备查询类")
public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "装备id", example = "1")
public Integer deviceId;
@ApiModelProperty(value = "操作人", example = "1")
public Integer UserAId;
......
......@@ -51,5 +51,8 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty("备注")
private String record;
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0;
}
package com.tykj.dev.device.library.task;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainTask.java
* @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
* @createTime 2020年08月17日 23:20:00
*/
@Service
@Slf4j
public class DevideTask {
@Autowired
DeviceLibraryCacheService deviceLibraryCacheService;
@Scheduled(cron = "30 * * * * ? ")
private void signUpDeadline() {
log.info("定时device更新缓存开始");
deviceLibraryCacheService.deletAllDeviceLibraryList();
deviceLibraryCacheService.getAllDeviceLibraryList();
log.info("定时device更新缓存结束");
}
}
//package com.tykj.dev.device.library.task;
//
//import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//
///**
// * @author zjm
// * @version 1.0.0
// * @ClassName TrainTask.java
// * @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
// * @createTime 2020年08月17日 23:20:00
// */
//@Service
//@Slf4j
//public class DevideTask {
// @Autowired
// DeviceLibraryCacheService deviceLibraryCacheService;
//
// @Scheduled(cron = "30 * * * * ? ")
// private void signUpDeadline() {
// log.info("定时device更新缓存开始");
// deviceLibraryCacheService.deletAllDeviceLibraryList();
// deviceLibraryCacheService.getAllDeviceLibraryList();
// log.info("定时device更新缓存结束");
// }
//}
......@@ -4,8 +4,13 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author dengdiyi
*/
public interface MatchingDeviceLibraryDao extends JpaRepository<MatchingDeviceLibrary, Integer>, JpaSpecificationExecutor<MatchingDeviceLibrary> {
List<MatchingDeviceLibrary> findAllByModel(String model);
}
package com.tykj.dev.device.matching.repository;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zsp
*/
public interface MatchingDeviceModelDao extends JpaRepository<MatchingDeviceModel, Integer>, JpaSpecificationExecutor<MatchingDeviceModel> {
MatchingDeviceModel findByModel(String model);
MatchingDeviceModel findByModelAndName(String model,String name);
}
package com.tykj.dev.device.matching.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo;
import com.tykj.dev.device.matching.subject.vo.RelationDeviceVo;
import com.tykj.dev.rfid.entity.vo.RfidPrintVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -43,6 +48,11 @@ public interface MatchingDeviceLibraryService {
*/
Page<MatchingDeviceLibrary> getPage(MatchingDeviceSelectVo matchingDeviceSelectVo, Pageable pageable);
/**
* @param matchingDeviceSelectVo 装备查询vo
*/
List<MatchingDeviceLibrary> getMatchingDevicePage(MatchingDeviceSelectVo matchingDeviceSelectVo);
/**
* @return 所有类型
*/
......@@ -52,4 +62,40 @@ public interface MatchingDeviceLibraryService {
* @return 所有名称
*/
List<String> getAllName();
/**
* 根据型号查询序列号是否是第一次生成
* @param model 型号
* @return 返回值是序列号列表
*/
List<String> findByModelForSeqNumber(String model);
/**
* 关联装备
* @param relationDeviceVo 关联装备的vo
*/
void relationDevice(RelationDeviceVo relationDeviceVo);
/**
* 获取配套设备的序列号
*/
Map<String,MatchingDeviceLibrary> getAllMatchingDeviceSeqNumber();
/**
* 打印标签
*/
void printRfid(List<RfidPrintVo> rfid);
/**
* 打印或者更新标签
* @param matchingDeviceId 配套设备的id
*/
MatchingDeviceLibrary printRfid(Integer matchingDeviceId);
/**
* 查询所有的序列号
* @return
*/
List<String> getAllMatchingDeviceLibraryListSeqNumberList();
}
package com.tykj.dev.device.matching.service;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
public interface MatchingDeviceModelService {
/**
* 新增
*/
MatchingDeviceModel addEntity(MatchingDeviceModel matchingDeviceModel);
/**
* 通过型号查询
*/
MatchingDeviceModel findByModel(String model);
/**
* 通过型号和名称查询
*/
MatchingDeviceModel findByModelAndName(String model,String name);
}
package com.tykj.dev.device.matching.service.impl;
import com.tykj.dev.device.matching.repository.MatchingDeviceModelDao;
import com.tykj.dev.device.matching.service.MatchingDeviceModelService;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MatchingDeviceModelServiceImpl implements MatchingDeviceModelService {
@Autowired
private MatchingDeviceModelDao matchingDeviceModelDao;
@Override
public MatchingDeviceModel addEntity(MatchingDeviceModel matchingDeviceModel) {
return matchingDeviceModelDao.save(matchingDeviceModel);
}
@Override
public MatchingDeviceModel findByModel(String model) {
return matchingDeviceModelDao.findByModel(model);
}
@Override
public MatchingDeviceModel findByModelAndName(String model, String name) {
return matchingDeviceModelDao.findByModelAndName(model,name);
}
}
......@@ -104,6 +104,8 @@ public class MatchingDeviceBill {
@Column(name = "file_rets",columnDefinition = "TEXT")
private String fileRets;
@Transient
@ApiModelProperty(value = "配发文件集合对象")
private List<FileRet> fileRetList ;
......
......@@ -125,10 +125,20 @@ public class MatchingDeviceLibrary {
@Transient
private String lifeStatusName;
@ApiModelProperty(value = "形态名称")
@Transient
private String typeName;
@ApiModelProperty(value = "关联装备的序列号")
@Transient
private String deviceSeqNumber;
public MatchingDeviceLibrary setConfigName(){
ConfigCache configCache = SpringUtils.getBean("initConfigCache");
if (configCache != null) {
setLifeStatusName(configCache.getLifeStatusMap().get(this.lifeStatus)==null?"-":configCache.getLifeStatusMap().get(this.lifeStatus));
setTypeName(configCache.getMatchingTypeMap().get(Integer.valueOf(this.type))==null?"-":configCache.getMatchingTypeMap().get(Integer.valueOf(this.type)));
}
return this;
}
......
package com.tykj.dev.device.matching.subject.domin;
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.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
/**
* zsp
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update matching_device_model set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("配套设备型号")
public class MatchingDeviceModel {
/**
* 主键id
*/
@Id
@GeneratedValue
@ApiModelProperty(name = "主键id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "名称")
private String name;
/**
* delete_tag
*/
@ApiModelProperty(value = "删除标志位")
private Integer delete_tag = 0;
}
......@@ -40,6 +40,12 @@ public class MatchingDeviceBillSaveVo {
private List<FileRet> fileRets;
@ApiModelProperty(value = "是否打印rfid标签(1:是,0:否)")
private Integer isPrint = 0;
@ApiModelProperty(value = "任务id")
private Integer taskId = 0;
@Valid
@NotEmpty(message = "matchingDeviceSaveVoList不能为空")
@ApiModelProperty(value = "配套设备列表")
......
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
*/
@Data
@ApiModel("配套设备的装备序列号")
public class MatchingDeviceCreateSeqVo {
@ApiModelProperty(name = "型号")
private String model;
@ApiModelProperty(name = "名称")
private String name;
@ApiModelProperty(name = "形态",example = "1")
private String style;
@ApiModelProperty(name = "数量")
private Integer num;
}
......@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author dengdiyi
......@@ -49,4 +50,10 @@ public class MatchingDeviceEditVo {
@ApiModelProperty(value = "生命状态", example = "1")
private Integer lifeStatus;
@ApiModelProperty(value = "新增装备信息列表")
private Integer addDeviceId;
@ApiModelProperty(value = "删除相关装备id")
private Integer deleteDeviceId;
}
......@@ -7,6 +7,7 @@ import lombok.Data;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author dengdiyi
......@@ -27,6 +28,10 @@ public class MatchingDeviceSaveVo {
@ApiModelProperty(value = "设备名称")
private String name;
@NotNull(message = "name不能为空")
@ApiModelProperty(value = "形态")
private String style;
@NotNull(message = "createUnit不能为空")
@ApiModelProperty(value = "创建单位")
private String createUnit;
......@@ -41,7 +46,13 @@ public class MatchingDeviceSaveVo {
// @NotNull(message = "rfidCardId不能为空")
@ApiModelProperty(value = "rfid卡号")
private String rfidCardId;
private String rfidCardId = "";
@ApiModelProperty(value = "入库的数量")
private Integer storageCount;
@ApiModelProperty(value = "序列号集合")
private List<String> seqList;
public MatchingDeviceLibrary toDo() {
MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary();
......
......@@ -30,6 +30,9 @@ public class MatchingDeviceSelectVo extends CustomPage {
@ApiModelProperty(value = "区域id")
private Integer areaId;
@ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备")
private Integer isPrint;
private String typeDim;
private String modelDim;
......
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* zsp
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("配套设备序列号vo")
public class MatchingDeviceSeqVo {
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(name = "名称")
private String name;
@ApiModelProperty(name = "形态",example = "1")
private String style;
@ApiModelProperty(value = "入库数量")
private Integer storageCount;
@ApiModelProperty(value = "序列号区间")
private String seqInterval;
@ApiModelProperty(value = "序列号集合")
private List<String> seqList;
}
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* zsp
*/
@Data
@ApiModel("新增配套详情返回类")
public class MatchingDeviceSplitVo {
@ApiModelProperty(value = "配套设备的vo")
private List<MatchingDeviceSaveVo> matchingDeviceSaveVos;
}
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("关联装备的vo")
public class RelationDeviceVo {
@ApiModelProperty(name = "关联装备的id")
private Integer deviceId;
@ApiModelProperty(name = "配套设备的id")
private Integer matchingDeviceId;
}
......@@ -252,6 +252,12 @@ public enum StatusEnum {
*/
WAIT_CONFIRM_APPLY_DEVICE(511, "批复完成待执行"),
/**
* 业务待办结
*/
WAITAPPLYTASKTOEND(512,"申请任务待办结"),
// /**
// * 等待上传申请回执单
// */
......
package com.tykj.dev.misc.utils;
/**
* @author zjm
* @version 1.0.0
* @ClassName MessageFormatUtil.java
* @Description TODO
* @createTime 2021年10月26日 15:41:00
*/
public class MessageFormatUtil {
/**
* 列装两个【】这个的内容使用接口
*/
private static String spellTwoWicketFielding(){
return "";
};
/**
* 两个【】填空内容的通用接口
*/
public static String spellTwoWicket(String one,String two){
return "【" +
one +
"】" +
"-->" +
"【" +
two +
"】";
};
/**
* 一个【】填空内容的通用接口
*/
private static String spellOneWicket(){
return "";
};
}
......@@ -4,6 +4,7 @@ import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;
......@@ -135,10 +136,14 @@ public class TimestampUtil {
.toLocalDate();
}
public static LocalDateTime dateToLocalDateTime(Date date) {
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
}
/**
* @return 当前时间的Date类型
*/
public static Date getNowDate() {
return Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant());
return Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
}
}
......@@ -65,12 +65,14 @@ public class PackingLibraryController {
packingLibraries.forEach(packingLibrary -> {
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(packingLibrary.getSeq());
List<String> outputSeqs = new ArrayList<>();
inputSeqs.forEach(s -> {
if (map.get(s)==null){
outputSeqs.add(s);
}
});
packingLibrary.setSeq(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(outputSeqs)));
// inputSeqs.forEach(s -> {
// if (map.get(s)==null){
// outputSeqs.add(s);
// }
// });
// packingLibrary.setSeq(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(outputSeqs)));
packingLibrary.setSeq(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(inputSeqs)));
});
//返回父子结构
Map<Integer, PackingLibrary> nodeCollect =
......
......@@ -7,6 +7,7 @@ import com.tykj.dev.device.packing.subject.vo.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
......@@ -235,5 +236,12 @@ public interface PackingLibraryService{
* 查询可以被绑定的列装
*/
List<PackingLibrary> getAllSelectPacking(List<Integer> packingIds);
List<PackingLibrary> getAllSelectPacking(SelectPackingVo selectPackingVo);
/**
* @param ids 列装库主键Id
* 根据ids获取列装
*/
List<PackingLibrary> findByIds(@RequestBody List<Integer> ids);
}
......@@ -949,15 +949,23 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
PackingLibrary originPacking = bindingPackingVo.getOriginPacking();
//选择要绑定的列装
PackingLibrary selectPacking = bindingPackingVo.getSelectPacking();
//0 是装备目录 1 附件目录
if (originPacking.getIsPart() == 0){
//列装是装备
// 要考虑要绑定的列装的是不是装备
//如果是附件 不允许绑定
if(selectPacking.getIsPart() == 1){
throw new ApiException("附件下不可以绑定列装");
//如果是装备目录 则只可以绑在列装目录下
if (selectPacking.getIsPart()!=null){
if(selectPacking.getIsPart() == 1){
throw new ApiException("附件下不可以绑定装备");
}
}
// 1 是列装目录 0不是
if (selectPacking.getIsRoot() == 0){
throw new ApiException("装备只能绑定在列装目录下面");
}
}
originPacking.setPartParentId(selectPacking.getId());
PackingLog packingLog = new PackingLog();
packingLog.setRemark("列装名称为"+originPacking.getName()+"与列装名称"+selectPacking.getName()+"绑定在一起");
packingLogService.add(packingLog);
update(originPacking);
}
......@@ -966,14 +974,28 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
//获取列装对象的装备
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingLibrary.getId());
List<Integer> deviceIds = deviceLibraries.stream().map(deviceLibrary -> deviceLibrary.getId()).collect(Collectors.toList());
List<Integer> deviceIds = deviceLibraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
//将装备的父id全部置空
Integer userId = userUtils.getCurrentUserId();
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
long l = System.currentTimeMillis();
deviceLibraryService.updatePartParentId(deviceIds);
log.info("更新父id时间为:{}",System.currentTimeMillis()-l);
deviceLibraries.forEach(deviceLibrary -> {
deviceLibrary.setPartParentId(null);
deviceLibraryService.update(deviceLibrary);
DeviceLogDto deviceLogDto = new DeviceLogDto();
deviceLogDto.setDeviceId(deviceLibrary.getId());
deviceLogDto.setRemark("由于列装进行了解绑,装备也需要进行解绑");
deviceLogDto.setCreateUserId(userId);
deviceLogDtos.add(deviceLogDto);
});
executor.execute(()->{
deviceLogService.addAllLog(deviceLogDtos);
});
//修改列装
packingLibrary.setPartParentId(null);
PackingLog packingLog = new PackingLog();
packingLog.setRemark("手动进行了列装解绑");
packingLogService.add(packingLog);
update(packingLibrary);
}
......@@ -983,8 +1005,10 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
packingLibraryDao.findAll(getSelectSpecification22(new PackingLibrarySelectVo()));
packingLibraryEntities.forEach(PackingLibrary::setConfigName);
//查询列装
List<PackingLibrary> libraries = packingLibraryDao.findAllByIdIn(packingIds);
packingLibraryEntities.removeAll(libraries);
// List<PackingLibrary> libraries = packingLibraryDao.findAllByIdIn(packingIds);
packingLibraryEntities = packingLibraryEntities.stream().filter(packingLibrary ->
!packingIds.contains(packingLibrary.getId())).collect(Collectors.toList());
// packingLibraryEntities.removeAll(libraries);
Map<Integer, PackingLibrary> nodeCollect =
packingLibraryEntities.stream().collect(Collectors.toMap(PackingLibrary::getId, packingLibraryEntity -> packingLibraryEntity));
return GetTreeUtils.parseTreeFromDown(
......@@ -995,6 +1019,43 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
).stream().sorted(Comparator.comparing(PackingLibrary::getModel)).collect(Collectors.toList());
}
@Override
public List<PackingLibrary> getAllSelectPacking(SelectPackingVo selectPackingVo) {
List<PackingLibrary> packingLibraryEntities =
packingLibraryDao.findAll(getSelectSpecification22(new PackingLibrarySelectVo()));
packingLibraryEntities.forEach(PackingLibrary::setConfigName);
//查询列装
List<Integer> packingIds = selectPackingVo.getPackingIds();
// List<PackingLibrary> libraries = packingLibraryDao.findAllByIdIn(packingIds);
packingLibraryEntities = packingLibraryEntities.stream().filter(packingLibrary ->
!packingIds.contains(packingLibrary.getId())).collect(Collectors.toList());
if(selectPackingVo.getIsPart() == 0){
//代表是装备 只显示目录
packingLibraryEntities = packingLibraryEntities.stream().filter(packingLibrary -> packingLibrary.getIsRoot() == 1).collect(Collectors.toList());
return packingLibraryEntities;
}else {
//附件 显示装备和目录
packingLibraryEntities = packingLibraryEntities.stream()
.filter(packingLibrary -> packingLibrary.getIsRoot() == 1 || packingLibrary.getIsPart() == 0)
.collect(Collectors.toList());
}
Map<Integer, PackingLibrary> nodeCollect =
packingLibraryEntities.stream().collect(Collectors.toMap(PackingLibrary::getId, packingLibraryEntity -> packingLibraryEntity));
return GetTreeUtils.parseTreeFromDown(
packingLibraryEntities,
PackingLibrary::getId,
packingLibraryEntity -> Optional.ofNullable(nodeCollect.get(packingLibraryEntity.getPartParentId())),
PackingLibrary::addChildNode
).stream().sorted(Comparator.comparing(PackingLibrary::getModel)).collect(Collectors.toList());
}
@Override
public List<PackingLibrary> findByIds(List<Integer> ids) {
return packingLibraryDao.findAllByIdIn(ids);
}
private Specification<PackingLibrary> getSelectSpecification(PackingLibrarySelectVo packingLibrarySelectVo) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
Integer level = userUtils.getCurrentUnitLevel();
......@@ -1247,4 +1308,16 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return packingLibraries;
}
//递归取出最大目录
public PackingLibrary getPackingLibrary(PackingLibrary packingLibrary) {
Integer partParentId = packingLibrary.getPartParentId();
PackingLibrary one = getOne(partParentId);
if (one.getIsRoot() == 0) {
return getPackingLibrary(one);
} else {
return packingLibrary;
}
}
}
......@@ -229,6 +229,11 @@ public class PackingLibrary {
@ApiModelProperty(value = "申请数量")
@Transient
private Integer applyNum;
@ApiModelProperty(value = "可批复数量(只做展示)")
@Transient
private Integer replyNum;
@ApiModelProperty(value = "待入库数量")
@Transient
private Integer waitNum;
......@@ -278,10 +283,22 @@ public class PackingLibrary {
@ApiModelProperty(value = "装备的数量")
private Integer deviceNum;
@Transient
@ApiModelProperty(value = "装备id的集合")
private List<Integer> deviceIds;
@Transient
@ApiModelProperty(value = "序号")
private Integer seqOrderNumber;
@Transient
@ApiModelProperty(value = "试用装备的序列号")
private List<String> deviceSeqNumberList;
@Transient
@ApiModelProperty(value = "等级")
private Integer level;
public void addChildNode(PackingLibrary packingLibraryEntity) {
childs.add(packingLibraryEntity);
......
......@@ -4,16 +4,22 @@ package com.tykj.dev.device.packing.subject.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("查询可进行绑定的列装")
public class SelectPackingVo extends CustomPage {
@ApiModelProperty(value = "列装id")
private List<Integer> packingIds;
@ApiModelProperty(value = "是不是附件",notes = "0:不是,1:是")
private Integer isPart;
}
......@@ -3,7 +3,6 @@ package com.tykj.dev.device.repair.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
......@@ -80,9 +79,6 @@ public class RepairBillSelectController {
@Autowired
private UserPublicService userPublicService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询工作台维修装备数量", notes = "可以通过这个接口查询工作台维修装备数量")
@GetMapping(value = "/repairNum")
public ResponseEntity getRepairNum(){
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论