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

修改配发

上级 87cfc741
......@@ -27,6 +27,7 @@ import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.ResultObj;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.Snowflake;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.misc.utils.TimestampUtil;
import com.tykj.dev.rfid.service.InputOutputDeviceService;
import com.tykj.dev.socket.MyWebSocket;
......@@ -381,13 +382,26 @@ public class AllotBillController {
//第一次保存
if (allotBillSaveVo.getTaskId()==null){
//保存入库单
Integer userId = userUtils.getCurrentUserId();
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
AllotBill allotBill1 = allotBillSaveVo.toDo();
allotBill1.setAllotStatus(0);
AllotBill allotBill = allotBillService.addEntity(allotBill1);
//发起任务
return null;
TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "配发业务", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 1, null, userIds);
taskService.start(taskBto);
return ResponseEntity.ok("保存成功");
}
else {
//更新账单
return null;
TaskBto taskBto = taskService.get(allotBillSaveVo.getTaskId());
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
AllotBill allotBill1 = allotBillSaveVo.toDo();
allotBill1.setAllotStatus(0);
allotBill1.setId(allotBill.getId());
allotBillService.update(allotBill1);
return ResponseEntity.ok("更新成功");
}
}
......@@ -405,6 +419,26 @@ public class AllotBillController {
@PostMapping(value = "/selectAllotDetail/{taskId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity selectAllotDetail(@PathVariable("taskId") int taskId) {
return null;
TaskBto taskBto = taskService.get(taskId);
AllotBill allotBillEntity = allotBillService.getOne(taskBto.getBillId());
if (allotBillEntity.getSendUseraId() != null) {
allotBillEntity.setSenderUserA(userPublicService.getOne(allotBillEntity.getSendUseraId()).getName());
}
if (allotBillEntity.getSendUserbId() != null) {
allotBillEntity.setSenderUserB(userPublicService.getOne(allotBillEntity.getSendUserbId()).getName());
}
if (allotBillEntity.getReceiveUseraId() != null) {
allotBillEntity.setReceiveUserA(userPublicService.getOne(allotBillEntity.getReceiveUseraId()).getName());
}
if (allotBillEntity.getReceiveUserbId() != null) {
allotBillEntity.setReceiveUserB(userPublicService.getOne(allotBillEntity.getReceiveUserbId()).getName());
}
if (allotBillEntity.getAllotCheckDetail()!=null){
List<Integer> ids = StringSplitUtil.split(allotBillEntity.getAllotCheckDetail());
List<DeviceLibrary> deviceLibraryList = new ArrayList<>();
ids.forEach(integer -> deviceLibraryList.add(deviceLibraryService.getOne(integer)));
allotBillEntity.setDeviceLibraries(deviceLibraryList);
}
return ResponseEntity.ok(allotBillEntity);
}
}
package com.tykj.dev.device.allot.subject.domin;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -13,6 +14,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
/**
* entity class for allot_bill
......@@ -131,7 +133,7 @@ public class AllotBill {
/**
* 配发状态(0:配发待审核,1:配发审核失败,2:配发中,3:配发接收待审核,4:配发接收审核失败,5:配发完成)
*/
@ApiModelProperty(value = "配发状态(0:配发待审核,1:配发审核失败,2:配发中,3:配发接收待审核,4:配发接收审核失败,5:配发完成)")
@ApiModelProperty(value = "配发状态(0:草稿,1:配发审核失败,2:配发中,3:配发接收待审核,4:配发接收审核失败,5:配发完成)")
private Integer allotStatus;
/**
* 创建用户id
......@@ -229,4 +231,7 @@ public class AllotBill {
@ApiModelProperty(value = "区块链记录id")
private String recordId;
@Transient
private List<DeviceLibrary> deviceLibraries;
}
......@@ -360,6 +360,7 @@ public class StorageBillController {
storageBillEntity.setReceiveUserA(userPublicService.getOne(storageBillEntity.getReceiveUseraId()).getName());
storageBillEntity.setReceiveUserB(userPublicService.getOne(storageBillEntity.getReceiveUserbId()).getName());
storageBillEntity.setStorageBillDetailVos(JacksonUtil.readValueToList(storageBillEntity.getPackingDetail(),StorageBillDetailVo.class));
storageBillEntity.getStorageBillDetailVos().forEach(storageBillDetailVo -> storageBillDetailVo.setPackingLibrary(packingLibraryService.getOne(storageBillDetailVo.getPackingId())));
return ResponseEntity.ok(storageBillEntity);
}
}
package com.tykj.dev.device.storage.subject.vo;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -21,4 +22,6 @@ public class StorageBillDetailVo {
private Integer storageCount;
@ApiModelProperty(value = "序列号区间")
private String seqInterval;
@ApiModelProperty(value = "列装装备")
private PackingLibrary packingLibrary;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论