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

提交维修更改

上级 88bba9df
...@@ -13,8 +13,12 @@ import com.tykj.dev.device.library.service.DeviceLogService; ...@@ -13,8 +13,12 @@ import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; 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.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.task.service.TaskService; 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.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.ResultObj; import com.tykj.dev.misc.base.ResultObj;
...@@ -38,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -38,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -79,6 +84,12 @@ public class AllotBackBillController { ...@@ -79,6 +84,12 @@ public class AllotBackBillController {
@Autowired @Autowired
private InputOutputDeviceService inputOutputDeviceService; private InputOutputDeviceService inputOutputDeviceService;
@Autowired
private UserDao userDao;
@Autowired
private MessageService messageService;
@ApiOperation(value = "发起配发退回业务", notes = "可以通过这个接口发起配发退回任务") @ApiOperation(value = "发起配发退回业务", notes = "可以通过这个接口发起配发退回任务")
@PostMapping(value = "/back") @PostMapping(value = "/back")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -155,12 +166,15 @@ public class AllotBackBillController { ...@@ -155,12 +166,15 @@ public class AllotBackBillController {
public ResponseEntity allotBackReceive(@RequestBody @Validated AllotBackReceiveVo allotBackReceiveVo) { public ResponseEntity allotBackReceive(@RequestBody @Validated AllotBackReceiveVo allotBackReceiveVo) {
//获取当前任务和账单 //获取当前任务和账单
TaskBto taskBto = taskService.get(allotBackReceiveVo.getTaskId()); TaskBto taskBto = taskService.get(allotBackReceiveVo.getTaskId());
taskService.addInvolveUser(taskBto, userUtils.getCurrentUserId());
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId()); AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
//更改账单状态 //更改账单状态
allotBackBill.setBackStatus(1); allotBackBill.setBackStatus(3);
allotBackBill.setReceiveUseraId(userUtils.getCurrentUserId());
BeanUtils.copyProperties(allotBackReceiveVo, allotBackBill); BeanUtils.copyProperties(allotBackReceiveVo, allotBackBill);
//任务推至下一阶段 //任务推至完结
taskService.moveToNext(taskBto, allotBackReceiveVo.getReceiveUserbId()); taskService.moveToEnd(taskBto);
// taskService.moveToNext(taskBto, allotBackReceiveVo.getReceiveUserbId());
//分隔装备id信息 //分隔装备id信息
List<FileVo> fileVoList = new ArrayList<>(); List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("退回单", allotBackReceiveVo.getBillFileName(), allotBackReceiveVo.getBillFileUrl())); fileVoList.add(new FileVo("退回单", allotBackReceiveVo.getBillFileName(), allotBackReceiveVo.getBillFileUrl()));
...@@ -175,10 +189,12 @@ public class AllotBackBillController { ...@@ -175,10 +189,12 @@ public class AllotBackBillController {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1)); Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
//改变装备状态 //改变装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(0); deviceLibraryEntity.setLifeStatus(2);
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setManageStatus(1);
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
//存装备日志 //存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收并发起入库", fileVoList); DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收配发退回装备", fileVoList);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
} }
...@@ -189,13 +205,20 @@ public class AllotBackBillController { ...@@ -189,13 +205,20 @@ public class AllotBackBillController {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(11); deviceLibraryEntity.setLifeStatus(11);
//存装备日志 //存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收入库丢失", fileVoList); DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收配发退回装备丢失", fileVoList);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
} }
} }
} }
} }
//发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBackBill.getSendUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),userUtils.getCurrentUserUnitName()+"接收配发退回装备",ids);
messageService.add(messageBto);
log.info("[配发模块]:配发退回接收入库"); log.info("[配发模块]:配发退回接收入库");
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResponseEntity.ok("配发退回接收入库"); return ResponseEntity.ok("配发退回接收入库");
......
...@@ -148,7 +148,9 @@ public class DeviceApplyController { ...@@ -148,7 +148,9 @@ public class DeviceApplyController {
public ResponseEntity addDeviceApplyBillReplay(@RequestBody @Validated DeviceApplyConfirmVo deviceApplyConfirmVo) { public ResponseEntity addDeviceApplyBillReplay(@RequestBody @Validated DeviceApplyConfirmVo deviceApplyConfirmVo) {
TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId()); TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId());
Integer userId = userUtils.getCurrentUserId(); Integer userId = userUtils.getCurrentUserId();
taskService.addInvolveUser(taskBto, userId);
DeviceApplyBill applyBillEntity = deviceApplyBillService.getOne(taskBto.getBillId()); DeviceApplyBill applyBillEntity = deviceApplyBillService.getOne(taskBto.getBillId());
applyBillEntity.setReplyUseraId(userId);
//阅知用户Id //阅知用户Id
List<Integer> ids = userPublicService.findOtherUser(userId); List<Integer> ids = userPublicService.findOtherUser(userId);
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(applyBillEntity.getApplyUnit())).stream() ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(applyBillEntity.getApplyUnit())).stream()
......
...@@ -81,7 +81,7 @@ public enum LogType { ...@@ -81,7 +81,7 @@ public enum LogType {
REPAIR_SEND_3(32, REPAIR_SEND_CONFIRM.id, ARCHIVE.id, "维修出库审核失败"), REPAIR_SEND_3(32, REPAIR_SEND_CONFIRM.id, ARCHIVE.id, "维修出库审核失败"),
REPAIR_SEND_4(33, WAIT_RECEIVE.id, END.id, "接收维修装备并发起入库"), REPAIR_SEND_4(33, WAIT_RECEIVE.id, REPAIRING.id, "接收维修装备并发起入库"),
DESTROY_4(100, WAIT_UPLOAD_BILL_FILE.id, END.id, "上传销毁单"), DESTROY_4(100, WAIT_UPLOAD_BILL_FILE.id, END.id, "上传销毁单"),
...@@ -91,7 +91,7 @@ public enum LogType { ...@@ -91,7 +91,7 @@ public enum LogType {
REPAIR_SEND_7(36, REPAIR_SEND_CONFIRM.id, COUNTRY_REPAIRING.id, "审核成功并出库"), REPAIR_SEND_7(36, REPAIR_SEND_CONFIRM.id, COUNTRY_REPAIRING.id, "审核成功并出库"),
REPAIR_BACK_1(37, ORIGIN_STATUS.id, REPAIR_BACK_CONFIRM.id, "向(%receiveUnit)退还维修装备"), REPAIR_BACK_1(37, ORIGIN_STATUS.id, WAIT_BACK_RECEIVE.id, "向(%receiveUnit)退还维修装备"),
REPAIR_BACK_2(38, REPAIR_BACK_CONFIRM.id, WAIT_BACK_RECEIVE.id, "维修退回审核成功并出库"), REPAIR_BACK_2(38, REPAIR_BACK_CONFIRM.id, WAIT_BACK_RECEIVE.id, "维修退回审核成功并出库"),
...@@ -166,12 +166,12 @@ public enum LogType { ...@@ -166,12 +166,12 @@ public enum LogType {
WORK_H1(79, ORIGIN_STATUS.id, WORKHANDOVER1011.id, "工作交接任务生成完成,等待上传交接单"), WORK_H1(79, ORIGIN_STATUS.id, WORKHANDOVER1011.id, "工作交接任务生成完成,等待上传交接单"),
WORK_H2(80, WORKHANDOVER1011.id, END.id, "工作交接完成"), WORK_H2(80, WORKHANDOVER1011.id, END.id, "工作交接完成"),
STORAGE_4(81, ORIGIN_STATUS.id, END.id, "进行装备入库"),
ALLOT_8(82, ORIGIN_STATUS.id, ALLOTING.id, "对(%receiveUnit)发起配发"), ALLOT_8(82, ORIGIN_STATUS.id, ALLOTING.id, "对(%receiveUnit)发起配发"),
ALLOT_9(83, ALLOTING.id, END.id, "接收配发装备"), ALLOT_9(83, ALLOTING.id, END.id, "接收配发装备"),
ALLOT_10(84, WAIT_ALLOT.id, ALLOTING.id, "对(%receiveUnit)发起配发"), ALLOT_10(84, WAIT_ALLOT.id, ALLOTING.id, "对(%receiveUnit)发起配发"),
ALLOT_11(85, ALLOTING.id, ARCHIVE.id, "拒绝接收配发装备"), ALLOT_11(85, ALLOTING.id, ARCHIVE.id, "拒绝接收配发装备"),
ALLOT_BACK_5(86, ALLOT_BACKING.id, END.id, "接收配发退回装备"), ALLOT_BACK_5(86, ALLOT_BACKING.id, END.id, "接收配发退回装备"),
REPAIR_SEND_10(87, ORIGIN_STATUS.id, COUNTRY_REPAIRING.id, "向(%receiveUnit)发起装备维修"),
; ;
public Integer id; public Integer id;
......
...@@ -27,8 +27,8 @@ public class RepairBackBillSaveVo { ...@@ -27,8 +27,8 @@ public class RepairBackBillSaveVo {
@ApiModelProperty(value = "退回发起人", example = "1") @ApiModelProperty(value = "退回发起人", example = "1")
private Integer startUseraId; private Integer startUseraId;
@NotNull(message = "startUserbId不能为空") // @NotNull(message = "startUserbId不能为空")
@Min(value = 1,message = "startUserbId不能小于1") // @Min(value = 1,message = "startUserbId不能小于1")
@ApiModelProperty(value = "退回确认人", example = "1") @ApiModelProperty(value = "退回确认人", example = "1")
private Integer startUserbId; private Integer startUserbId;
......
...@@ -22,8 +22,8 @@ public class RepairBillSaveVo { ...@@ -22,8 +22,8 @@ public class RepairBillSaveVo {
@ApiModelProperty(value = "发起申请人", example = "1") @ApiModelProperty(value = "发起申请人", example = "1")
private Integer startUseraId; private Integer startUseraId;
@NotNull(message = "startUserbId不能为空") // @NotNull(message = "startUserbId不能为空")
@Min(value = 1,message = "startUserbId不能小于1") // @Min(value = 1,message = "startUserbId不能小于1")
@ApiModelProperty(value = "发起确认人", example = "1") @ApiModelProperty(value = "发起确认人", example = "1")
private Integer startUserbId; private Integer startUserbId;
......
...@@ -14,8 +14,8 @@ import javax.validation.constraints.NotNull; ...@@ -14,8 +14,8 @@ import javax.validation.constraints.NotNull;
@ApiModel("配发接收类") @ApiModel("配发接收类")
public class RepairReceiveVo { public class RepairReceiveVo {
@NotNull(message = "receiveUserbId不能为空") // @NotNull(message = "receiveUserbId不能为空")
@Min(value = 1,message = "receiveUserbId不能小于1") // @Min(value = 1,message = "receiveUserbId不能小于1")
@ApiModelProperty(value = "接收单位B岗") @ApiModelProperty(value = "接收单位B岗")
private Integer receiveUserbId; private Integer receiveUserbId;
......
...@@ -9,6 +9,8 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo; ...@@ -9,6 +9,8 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo;
import com.tykj.dev.device.library.subject.vo.FileVo; import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.packing.service.PackingLibraryService; import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary; import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.storage.service.StorageBillService; import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill; import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo; import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo;
...@@ -18,6 +20,7 @@ import com.tykj.dev.device.storage.subject.vo.StorageDetailVo; ...@@ -18,6 +20,7 @@ import com.tykj.dev.device.storage.subject.vo.StorageDetailVo;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; 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.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
...@@ -34,8 +37,6 @@ import org.springframework.http.ResponseEntity; ...@@ -34,8 +37,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -143,6 +144,9 @@ public class StorageBillController { ...@@ -143,6 +144,9 @@ public class StorageBillController {
List<FileVo> fileVoList = new ArrayList<>(); List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("配发单", storageBillEntity.getFileName(), storageBillEntity.getFileUrl())); fileVoList.add(new FileVo("配发单", storageBillEntity.getFileName(), storageBillEntity.getFileUrl()));
fileVoList.add(new FileVo("入库确认单", storageBillEntity.getReceiveFileName(), storageBillEntity.getReceiveFileUrl())); fileVoList.add(new FileVo("入库确认单", storageBillEntity.getReceiveFileName(), storageBillEntity.getReceiveFileUrl()));
//添加业务日志
TaskLogBto taskLogBto2 = new TaskLogBto(taskEntity1.getId(), "发起装备入库", fileVoList);
taskLogService.addLog(taskLogBto2);
//3.存装备 //3.存装备
Integer parentId = null; Integer parentId = null;
for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) { for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论