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

更新

上级 6d3bfdc8
......@@ -378,7 +378,8 @@ public class AllotBillController {
Integer userId = userUtils.getCurrentUserId();
//获取当前任务
TaskBto taskBto = taskService.get(allotReceiveVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.ALLOTING);
List<StatusEnum> statusEnums = Arrays.asList(StatusEnum.ALLOTING,StatusEnum.WAIT_SIGN);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),statusEnums);
AllotBill allotBillEntity = allotBillService.getOne(taskBto.getBillId());
boolean sendbIsExist = allotBillEntity.getSendUserbId()!=null;
List<FileVo> fileVoList = new ArrayList<>();
......
......@@ -167,7 +167,8 @@ public class BackController {
Integer userId = userUtils.getCurrentUserId();
//获取当前任务
TaskBto taskBto = taskService.get(allotBackReceiveVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.ALLOT_BACKING);
List<StatusEnum> statusEnums = Arrays.asList(StatusEnum.ALLOT_BACKING,StatusEnum.BACK_WAIT_SIGN);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),statusEnums);
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
List<FileVo> fileVoList = new ArrayList<>();
if (allotBackReceiveVo.getReceiveFiles()!=null&&allotBackReceiveVo.getReceiveFiles().size()>0){
......
......@@ -39,11 +39,11 @@ public class AllotReceiveVo {
@ApiModelProperty(value = "配发单附件URL")
private String billFileUrl;
@NotNull(message = "receiveFileName不能为空")
// @NotNull(message = "receiveFileName不能为空")
@ApiModelProperty(value = "入库附件名字")
private String receiveFileName;
@NotNull(message = "receiveFileUrl不能为空")
// @NotNull(message = "receiveFileUrl不能为空")
@ApiModelProperty(value = "入库附件URL")
private String receiveFileUrl;
......
......@@ -414,6 +414,14 @@ public class DeviceApplyController {
}
}
}
if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0) {
for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) {
ResponseEntity responseEntity = packingController.seqsExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
}
}
}
TaskBto taskBto = taskService.get(uploadApplyFile.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToNext(taskBto);
......@@ -429,6 +437,9 @@ public class DeviceApplyController {
if(uploadApplyFile.getReplyFiles()!=null&&uploadApplyFile.getReplyFiles().size()>0){
deviceApplyBill.setReplyFiles(FilesUtil.stringFileToList(uploadApplyFile.getReplyFiles()));
}
if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0){
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(uploadApplyFile.getApplyBillDetailVos()));
}
deviceApplyBillService.update(deviceApplyBill);
return ResponseEntity.ok("ok");
}
......
......@@ -32,4 +32,7 @@ public class UploadApplyFile {
@ApiModelProperty(value = "批复文号附件名")
private List<FileRet> replyFiles;
@ApiModelProperty(value = "申请批复详情")
private List<ApplyBillDetailVo> applyBillDetailVos;
}
......@@ -135,7 +135,12 @@ public class DeviceLibraryController {
public ResponseEntity selectDeviceList() {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getCheckList();
deviceLibraryEntities.forEach(DeviceLibrary::setConfigName);
return ResultUtil.success(deviceLibraryEntities);
List<DeviceLibrary> deviceLibraries = deviceLibraryService.getNotInStockList();
deviceLibraries.forEach(DeviceLibrary::setConfigName);
Map<String,Object> map = new HashMap<>();
map.put("stockDevices",deviceLibraryEntities);
map.put("notInStockDevices",deviceLibraries);
return ResultUtil.success(map);
}
@ApiOperation(value = "模糊查询可配发的在库装备列表", notes = "可以通过这个接口查询可配发装备")
......
......@@ -65,10 +65,15 @@ public interface DeviceLibraryService {
List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo);
/**
* 获取单位自查装备列表
* 获取单位自查装备在库列表
*/
List<DeviceLibrary> getCheckList();
/**
* 获取单位自查未在库装备列表
*/
List<DeviceLibrary> getNotInStockList();
/**
* @param deviceLibrarySelectVo 装备查询vo
* 获取可配发装备列表
......
......@@ -507,6 +507,17 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return deviceLibraryDao.findAll(predicateBuilder.build());
}
/**
* 获取单位自查未在库装备列表
*/
@Override
public List<DeviceLibrary> getNotInStockList() {
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.eq("ownUnit", userUtils.getCurrentUserUnitName());
predicateBuilder.notIn("lifeStatus", 2);
return deviceLibraryDao.findAll(predicateBuilder.build());
}
@Override
public List<DeviceLibrary> getAllotList(DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryDao.findAll(getAllotSelectSpecification(deviceLibrarySelectVo));
......
......@@ -220,6 +220,13 @@ public class PackingController {
return ResponseEntity.ok("删除成功");
}
@ApiOperation(value = "清空列装回收站")
@PostMapping("/clean")
public ResponseEntity clean(@RequestBody List<Integer> ids){
packingLibraryService.cleanAll(ids);
return ResponseEntity.ok("删除成功");
}
@ApiOperation(value = "退装恢复列装")
@PostMapping("/remove")
public ResponseEntity remove(@RequestBody List<Integer> ids){
......@@ -314,6 +321,29 @@ public class PackingController {
}
}
@ApiOperation(value = "判断序列号区间不存在")
@PostMapping("/seqsNotExist/{id}/{num}/{seq}")
public ResponseEntity seqsNotExist(@PathVariable("id") int id,@PathVariable("num") int num,@PathVariable("seq") String seq){
List<DeviceLibrary> deviceLibraries = packingLibraryService.getAllDevSeqs(id);
List<String> existSeqs = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seq);
if (inputSeqs.size()!=num){
return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
}
else {
if (!existSeqs.containsAll(inputSeqs)){
return ResponseEntity.ok("ok");
}
else {
existSeqs.retainAll(inputSeqs);
StringBuffer stringBuffer = new StringBuffer();
existSeqs.forEach(s -> stringBuffer.append(s).append(","));
stringBuffer.deleteCharAt(stringBuffer.length()-1);
return ResponseEntity.ok("该型号序列号为"+stringBuffer.toString()+"的装备已存在");
}
}
}
@ApiOperation(value = "编辑列装型号")
@PostMapping("/update/model")
public ResponseEntity updateModel(@RequestBody @Validated PackingModelEdit packingModelEdit){
......@@ -463,7 +493,12 @@ public class PackingController {
if (packingLibraryUpdateVo.getFileUrl()!=null&&!packingLibraryUpdateVo.getFileUrl().equals(packingLibrary.getFileUrl())){
//添加列装日志
PackingLog packingLog = new PackingLog();
packingLog.setRemark("更新列装文件");
if ("".equals(packingLibraryUpdateVo.getFileUrl())){
packingLog.setRemark("删除列装文件");
}
else {
packingLog.setRemark("更新列装文件");
}
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
packingLibrary.setFileUrl(packingLibraryUpdateVo.getFileUrl());
......
......@@ -107,6 +107,12 @@ public interface PackingLibraryService {
*/
void removeAll(List<Integer> ids);
/**
* @param ids 列装主键id列表
* 通过id将回收站装备清空删除
*/
void cleanAll(List<Integer> ids);
/**
* 设置顺序的排序
*/
......
......@@ -343,6 +343,29 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
messageService.add(messageBto);
}
/**
* @param ids 列装主键id列表
* 通过id将回收站装备清空删除
*/
@Override
public void cleanAll(List<Integer> ids) {
for (Integer id:ids){
PackingLibrary packingLibrary = getOne(id);
packingLibrary.setDeleteTag(1);
update(packingLibrary);
//添加列装日志
PackingLog packingLog = new PackingLog();
packingLog.setRemark("回收站清空列装");
packingLog.setPackingId(id);
packingLogService.add(packingLog);
}
//发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(0,1,"回收站清空列装",userIds,0);
messageBto.setRecord(StringSplitUtil.idListToString(ids));
messageService.add(messageBto);
}
/**
* 设置顺序的排序
*/
......@@ -665,8 +688,13 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
if (packingLibrarySelectVo.getInvisibleRange() != null) {
predicateBuilder.eq("invisibleRange", packingLibrarySelectVo.getInvisibleRange());
}
if (packingLibrarySelectVo.getPackingStatus()!=null){
predicateBuilder.eq("packingStatus", packingLibrarySelectVo.getPackingStatus());
}
else {
predicateBuilder.eq("packingStatus", 3);
}
}
predicateBuilder.eq("packingStatus", 3);
// predicateBuilder.eq("isPart", 0);
return predicateBuilder.build();
}
......
......@@ -41,4 +41,6 @@ public class PackingLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "应用领域", example = "1")
private Integer invisibleRange;
private Integer packingStatus;
}
......@@ -129,39 +129,66 @@ public class RepairController {
@Autowired
private DeviceLibraryDao deviceLibraryDao;
// @ApiOperation(value = "保存维修操作", notes = "可以通过这个接口保存维修操作")
// @PostMapping(value = "/saveRepairBill")
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity saveAllotBill(@RequestBody RepairBillSaveVo repairBillSaveVo) {
// //第一次保存
// if (repairBillSaveVo.getTaskId()==null){
// Integer userId = userUtils.getCurrentUserId();
// //保存入库单
// List<Integer> userIds = new ArrayList<>();
// userIds.add(userId);
// AllotBill allotBill1 = allotBillSaveVo.toDo();
// allotBill1.setAllotStatus(0);
// allotBill1.setSendUseraId(userId);
// AllotBill allotBill = allotBillService.addEntity(allotBill1);
// //发起任务
// TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "配发业务", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 0, null, userIds);
// TaskBto taskBto1 = taskService.start(taskBto);
// Integer id = taskBto1.getId();
// myWebSocket.sendMessage1();
// return ResponseEntity.ok("保存成功"+id);
// }
// else {
// //更新账单
// TaskBto taskBto = taskService.get(allotBillSaveVo.getTaskId());
// AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
// AllotBill allotBill1 = allotBillSaveVo.toDo();
// allotBill1.setAllotStatus(0);
// MapperUtils.copyNoNullProperties(allotBill1,allotBill);
// allotBillService.update(allotBill);
// //改变装备状态为待配发
// return ResponseEntity.ok("更新成功"+taskBto.getId());
// }
// }
@ApiOperation(value = "保存维修操作", notes = "可以通过这个接口保存维修操作")
@PostMapping(value = "/saveRepairBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity saveRepairBill(@RequestBody RepairBillSaveVo repairBillSaveVo) {
//第一次保存
if (repairBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId();
//保存入库单
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
//添加维修单和送修单
RepairBill repairBill = new RepairBill();
RepairSendBill deviceRepairSendBillEntity = new RepairSendBill();
BeanUtils.copyProperties(repairBillSaveVo, repairBill);
BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity);
repairBill.setRepairStatus(0);
deviceRepairSendBillEntity.setRepairStatus(0);
if (repairBillSaveVo.getScriptSaveVos()!=null){
deviceRepairSendBillEntity.setScriptJson(JacksonUtil.toJSon(repairBillSaveVo.getScriptSaveVos()));
}
if (repairBillSaveVo.getRepairUseraId() != null) {
repairBill.setRepairUserA(userPublicService.getOne(repairBillSaveVo.getRepairUseraId()).getName());
}
repairBill.setStartUserB(repairBillSaveVo.getAgent());
repairBill.setStartUserA(userPublicService.getOne(repairBillSaveVo.getStartUseraId()).getName());
RepairBill repairBill1 = deviceRepairBillService.addEntity(repairBill);
deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_DRAFT.id, "维修业务", null, ".", repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto);
Integer id = taskBto1.getId();
myWebSocket.sendMessage1();
return ResponseEntity.ok("保存成功"+id);
}
else {
//更新账单
TaskBto taskBto = taskService.get(repairBillSaveVo.getTaskId());
RepairBill repairBill1 = deviceRepairBillService.getOne(taskBto.getBillId());
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill1.getId());
RepairBill repairBill = new RepairBill();
RepairSendBill deviceRepairSendBillEntity = new RepairSendBill();
BeanUtils.copyProperties(repairBillSaveVo, repairBill);
BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity);
repairBill.setRepairStatus(0);
deviceRepairSendBillEntity.setRepairStatus(0);
if (repairBillSaveVo.getScriptSaveVos()!=null){
deviceRepairSendBillEntity.setScriptJson(JacksonUtil.toJSon(repairBillSaveVo.getScriptSaveVos()));
}
if (repairBillSaveVo.getRepairUseraId() != null) {
repairBill.setRepairUserA(userPublicService.getOne(repairBillSaveVo.getRepairUseraId()).getName());
}
repairBill.setStartUserB(repairBillSaveVo.getAgent());
repairBill.setStartUserA(userPublicService.getOne(repairBillSaveVo.getStartUseraId()).getName());
MapperUtils.copyNoNullProperties(repairBill,repairBill1);
MapperUtils.copyNoNullProperties(deviceRepairSendBillEntity,repairSendBill);
deviceRepairBillService.update(repairBill1);
deviceRepairSendBillService.update(repairSendBill);
return ResponseEntity.ok("更新成功"+taskBto.getId());
}
}
@ApiOperation(value = "添加维修装备", notes = "可以通过这个接口发起维修")
@PostMapping(value = "/add")
......
......@@ -99,9 +99,9 @@ public class RepairSendBill {
@ApiModelProperty(value = "维修接收单位审核人id(省B岗)")
private Integer repairUserbId;
/**
* 维修状态(0:维修任务待审核,1:维修任务审核失败,2:维修装备送到上级中,3:上级接收维修装备待审核,4:上级接收维修装备审核失败,5:维修中,6:维修完成退回中,7:维修完成)
* 维修状态(0:草稿,1:维修任务审核失败,2:维修装备送到上级中,3:上级接收维修装备待审核,4:上级接收维修装备审核失败,5:维修中,6:维修完成退回中,7:维修完成)
*/
@ApiModelProperty(value = "维修状态(0:维修任务待审核,1:维修任务审核失败,2:维修装备送到上级中,3:上级接收维修装备待审核,4:上级接收维修装备审核失败,5:维修中,6:维修完成退回中,7:维修完成)")
@ApiModelProperty(value = "维修状态(0:草稿,1:维修任务审核失败,2:维修装备送到上级中,3:上级接收维修装备待审核,4:上级接收维修装备审核失败,5:维修中,6:维修完成退回中,7:维修完成)")
private Integer repairStatus;
@Column(name = "repair_device_detail",columnDefinition = "TEXT")
......
......@@ -17,6 +17,8 @@ import com.tykj.dev.device.task.subject.vo.TaskSelectVo;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.task.utils.TaskUtils;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -70,6 +72,9 @@ public class TaskServiceImpl implements TaskService {
@Autowired
private MyWebSocket myWebSocket;
@Autowired
private MessageService messageService;
/**
* <p>业务进行到下一个状态</p>
* <li>不指定待办用户</li>
......@@ -767,6 +772,26 @@ public class TaskServiceImpl implements TaskService {
taskBto.setInvolveUserIdList(ids);
update(taskBto);
});
//查询阅知
List<MessageBto> messageBtos = messageService.getBtoList();
//替换用户id
messageBtos.forEach(messageBto -> {
List<Integer> ids = messageBto.getInvolveUserIdList();
List<Integer> ids2 = messageBto.getCompleteUserIdList();
for (int i = 0; i < ids.size(); i++) {
if (ids.get(i).equals(oldUserId)) {
ids.set(i, newUserId);
}
}
for (int i = 0; i < ids2.size(); i++) {
if (ids2.get(i).equals(oldUserId)) {
ids2.set(i, newUserId);
}
}
messageBto.setInvolveUserIdList(ids);
messageBto.setCompleteUserIdList(ids2);
messageService.update(messageBto.toDo());
});
myWebSocket.sendMessage1();
}
......
......@@ -378,6 +378,7 @@ public class TaskSelectController {
if (statMap.size()>0){
p.setCompleteNum(statMap.get(p.getId()).getCompleteCount());
p.setWaitNum(p.getApplyNum()-p.getCompleteNum());
p.setSeq(statMap.get(p.getId()).getSeqInterval());
}
}
else {
......
......@@ -23,6 +23,8 @@ public interface MessageService {
List<MessageUserVo> getList();
List<MessageBto> getBtoList();
/**
* @param messageId 阅知信息id
* 阅读该信息
......
......@@ -90,6 +90,15 @@ public class MessageServiceImpl implements MessageService {
.collect(Collectors.toList());
}
@Override
public List<MessageBto> getBtoList() {
Integer userId = userUtils.getCurrentUserId();
return messageDao.findAll().stream()
.map(Message::parse2Bto)
.filter(messageBto -> messageBto.getInvolveUserIdList().contains(userId)&&!messageBto.getCompleteUserIdList().contains(userId))
.collect(Collectors.toList());
}
/**
* @param messageId 阅知信息id
*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论