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

更新

上级 b0e821ca
...@@ -149,7 +149,9 @@ public class AllotBillController { ...@@ -149,7 +149,9 @@ public class AllotBillController {
@PostMapping(value = "/addAllotBill") @PostMapping(value = "/addAllotBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity addAllotBill(@RequestBody @Validated AllotBillSaveVo allotBillSaveVo) { public ResponseEntity addAllotBill(@RequestBody @Validated AllotBillSaveVo allotBillSaveVo) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail())); if (allotBillSaveVo.getAllotCheckDetail()!=null&&allotBillSaveVo.getAllotCheckDetail().length()>0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//1.添加配发单 //1.添加配发单
AllotBill a = allotBillSaveVo.toDo(); AllotBill a = allotBillSaveVo.toDo();
a.setSendUseraId(userUtils.getCurrentUserId()); a.setSendUseraId(userUtils.getCurrentUserId());
......
...@@ -88,7 +88,9 @@ public class BackController { ...@@ -88,7 +88,9 @@ public class BackController {
@PostMapping(value = "/addBackBill") @PostMapping(value = "/addBackBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity addBackBill(@RequestBody @Validated AllotBillSaveVo allotBillSaveVo) { public ResponseEntity addBackBill(@RequestBody @Validated AllotBillSaveVo allotBillSaveVo) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail())); if (allotBillSaveVo.getAllotCheckDetail()!=null&&allotBillSaveVo.getAllotCheckDetail().length()>0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//1.添加配发单 //1.添加配发单
AllotBackBill a = allotBillSaveVo.toBackDo(); AllotBackBill a = allotBillSaveVo.toBackDo();
a.setSendUseraId(userUtils.getCurrentUserId()); a.setSendUseraId(userUtils.getCurrentUserId());
......
...@@ -17,17 +17,19 @@ public class StringSplitUtil { ...@@ -17,17 +17,19 @@ public class StringSplitUtil {
*/ */
public static List<Integer> split(String s) { public static List<Integer> split(String s) {
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
//分隔开始的s标识符 if (s!=null&&s.length()>0) {
if (s.charAt(0) == 's') { //分隔开始的s标识符
s = s.substring(1); if (s.charAt(0) == 's') {
} s = s.substring(1);
//按分隔符x分隔 }
String[] strings = s.split("x"); //按分隔符x分隔
//遍历获取id\ String[] strings = s.split("x");
if (strings.length > 0) { //遍历获取id\
for (String str : strings) { if (strings.length > 0) {
if (str.length() >= 2 && "1".equals(str.substring(str.length() - 1))) { for (String str : strings) {
list.add(Integer.parseInt(str.substring(0, str.length() - 1))); if (str.length() >= 2 && "1".equals(str.substring(str.length() - 1))) {
list.add(Integer.parseInt(str.substring(0, str.length() - 1)));
}
} }
} }
} }
......
...@@ -491,7 +491,9 @@ public class RepairController { ...@@ -491,7 +491,9 @@ public class RepairController {
List<FileVo> fileVoList = new ArrayList<>(); List<FileVo> fileVoList = new ArrayList<>();
//更新维修单和送修单 //更新维修单和送修单
repairBill.setRepairStatus(4); repairBill.setRepairStatus(4);
repairBill.setRepairUserB(userPublicService.getOne(repairReceiveVo.getReceiveUserbId()).getName()); if (repairReceiveVo.getReceiveUserbId()!=null) {
repairBill.setRepairUserB(userPublicService.getOne(repairReceiveVo.getReceiveUserbId()).getName());
}
if (repairReceiveVo.getStartUserbId()!=null){ if (repairReceiveVo.getStartUserbId()!=null){
repairSendBill.setStartUserbId(repairReceiveVo.getStartUserbId()); repairSendBill.setStartUserbId(repairReceiveVo.getStartUserbId());
repairSendBill.setAgent(userPublicService.getOne(repairReceiveVo.getStartUserbId()).getName()); repairSendBill.setAgent(userPublicService.getOne(repairReceiveVo.getStartUserbId()).getName());
...@@ -595,6 +597,7 @@ public class RepairController { ...@@ -595,6 +597,7 @@ public class RepairController {
taskService.moveToArchive(taskBto); taskService.moveToArchive(taskBto);
} }
else { else {
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(taskBto.getBillId()); RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(taskBto.getBillId());
List<Integer> ids = userPublicService.findOtherUser(userId); List<Integer> ids = userPublicService.findOtherUser(userId);
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(repairSendBill.getSendUnit())).stream() ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(repairSendBill.getSendUnit())).stream()
...@@ -614,6 +617,21 @@ public class RepairController { ...@@ -614,6 +617,21 @@ public class RepairController {
}); });
repairSendBill.setReceiveFiles(FilesUtil.stringFileToList(fileUploadVo.getReceiveFiles())); repairSendBill.setReceiveFiles(FilesUtil.stringFileToList(fileUploadVo.getReceiveFiles()));
} }
if (fileUploadVo.getStartUserbId()!=null){
String s = userPublicService.getOne(fileUploadVo.getStartUserbId()).getName();
repairBill.setStartUserB(s);
repairSendBill.setStartUserbId(fileUploadVo.getStartUserbId());
repairSendBill.setAgent(s);
MessageBto messageBto1 = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", Collections.singletonList(fileUploadVo.getStartUserbId()), 1);
messageService.add(messageBto1);
}
if (fileUploadVo.getRepairUserbId()!=null){
repairSendBill.setRepairUserbId(fileUploadVo.getRepairUserbId());
repairBill.setRepairUserB(userPublicService.getOne(fileUploadVo.getRepairUserbId()).getName());
MessageBto messageBto2 = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为经办人", Collections.singletonList(fileUploadVo.getRepairUserbId()), 1);
messageService.add(messageBto2);
}
deviceRepairBillService.update(repairBill);
deviceRepairSendBillService.update(repairSendBill); deviceRepairSendBillService.update(repairSendBill);
//添加装备日志 //添加装备日志
List<Integer> deviceIds = StringSplitUtil.split(repairSendBill.getRepairDeviceCheckDetail()); List<Integer> deviceIds = StringSplitUtil.split(repairSendBill.getRepairDeviceCheckDetail());
...@@ -1670,6 +1688,14 @@ public class RepairController { ...@@ -1670,6 +1688,14 @@ public class RepairController {
//保存账单 //保存账单
repairSendBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getSendFiles())); repairSendBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getSendFiles()));
List<Integer> idList = new ArrayList<>(); List<Integer> idList = new ArrayList<>();
if (fileVo.getStartUserbId()!=null){
String startUserB = userPublicService.getOne(fileVo.getStartUserbId()).getName();
repairBill.setStartUserB(startUserB);
repairSendBill.setStartUserbId(fileVo.getStartUserbId());
repairSendBill.setAgent(startUserB);
MessageBto messageBto1 = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", Collections.singletonList(fileVo.getStartUserbId()), 1);
messageService.add(messageBto1);
}
if (fileVo.getReceiveUseraId()!=null) { if (fileVo.getReceiveUseraId()!=null) {
repairBill.setRepairUserA(userPublicService.getOne(fileVo.getReceiveUseraId()).getName()); repairBill.setRepairUserA(userPublicService.getOne(fileVo.getReceiveUseraId()).getName());
repairSendBill.setRepairUseraId(fileVo.getReceiveUseraId()); repairSendBill.setRepairUseraId(fileVo.getReceiveUseraId());
......
...@@ -35,4 +35,10 @@ public class FileUploadVo { ...@@ -35,4 +35,10 @@ public class FileUploadVo {
@ApiModelProperty(value = "接收方配发单") @ApiModelProperty(value = "接收方配发单")
private List<FileRet> receiveFiles; private List<FileRet> receiveFiles;
@ApiModelProperty(value = "接收单位B岗")
private Integer startUserbId;
@ApiModelProperty(value = "接收单位B岗")
private Integer repairUserbId;
} }
...@@ -33,4 +33,7 @@ public class FileVo { ...@@ -33,4 +33,7 @@ public class FileVo {
@ApiModelProperty(value = "接收单位B岗") @ApiModelProperty(value = "接收单位B岗")
private Integer receiveUserbId; private Integer receiveUserbId;
@ApiModelProperty(value = "发件单位B岗")
private Integer startUserbId;
} }
package com.tykj.dev.device.task.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@ApiModel("业务类型返回类")
public class BusinessTypeVo {
private Integer businessType;
@ApiModelProperty(value = "业务类型名称")
private String businessTypeName;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论