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

更新

上级 42cc6430
......@@ -53,4 +53,5 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "货架位置")
private String position;
}
......@@ -285,11 +285,12 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
@Transient
public void deleteAll(Integer id) {
PackingLibrary packingLibrary = getOne(id);
if (deviceLibraryDao.getAllByPackingId(id).size()>0){
if (packingLibrary.getPackingStatus()==2) {
if (deviceLibraryDao.getAllByPackingId(id).size() > 0) {
throw new ApiException(ResponseEntity.status(20000).body("该列装型号已有装备,请进行退装操作"));
}
if (packingLibrary.getIsRoot()==1) {
if (packingLibraryDao.findAllByPartParentIdAndPackingStatus(id,2).size()>0){
if (packingLibrary.getIsRoot() == 1) {
if (packingLibraryDao.findAllByPartParentIdAndPackingStatus(id, 2).size() > 0) {
throw new ApiException(ResponseEntity.status(20000).body("该列装型号目录下存在列装装备"));
}
Integer order = packingLibrary.getShowOrder();
......@@ -302,9 +303,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
}
List<Integer> ids = packingLibraryDao.findAllByPartParentId(id).stream().map(PackingLibrary::getId).collect(Collectors.toList());
delete(id);
if (ids.size()>0){
if (ids.size() > 0) {
ids.forEach(integer -> {
if (deviceLibraryDao.getAllByPackingId(integer).size()>0){
if (deviceLibraryDao.getAllByPackingId(integer).size() > 0) {
throw new ApiException(ResponseEntity.status(20000).body("该列装型号已有装备,请进行退装操作"));
}
deleteAll(integer);
......@@ -312,10 +313,11 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
}
//发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(0,1,"手动删除列装",userIds,0);
MessageBto messageBto = new MessageBto(0, 1, "手动删除列装", userIds, 0);
messageBto.setRecord(id.toString());
messageService.add(messageBto);
}
}
/**
* @param ids 列装主键id列表
......
......@@ -6,6 +6,7 @@ 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.ApplyBillDetailVo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
......@@ -24,6 +25,7 @@ import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskLogService;
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.TaskLogBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.user.read.service.MessageService;
......@@ -333,6 +335,21 @@ public class StorageBillController {
return ResultUtil.success(libraryEntities);
}
@ApiOperation(value = "办结后添加其他单据", notes = "办结后添加其他单据")
@PostMapping(value = "/addOtherFiles/{taskId}")
public ResponseEntity addOtherFiles(@PathVariable("taskId") int taskId, @RequestBody List<FileRet> fileRets){
//获取业务
TaskBto taskBto = taskService.get(taskId);
//获取单据
StorageBill storageBill = storageBillService.getOne(taskBto.getBillId());
//set 其他单据
storageBill.setOtherFiles(FilesUtil.stringFileToList(fileRets));
storageBillService.update(storageBill);
//添加业务日志
taskLogService.addLog(new TaskLogBto(taskId,"上传补充单据",null));
return ResponseEntity.ok("ok");
}
@ApiOperation(value = "添加入库单", notes = "可以通过这个接口发起入库业务")
@PostMapping(value = "/addStorageBill")
@Transactional(rollbackFor = Exception.class)
......@@ -385,7 +402,8 @@ public class StorageBillController {
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("配发单", storageBillEntity.getFileName(), storageBillEntity.getFileUrl()));
//3.存装备
Integer parentId = null;
// Integer parentId = null;
Integer parentPackingId = null;
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
List<DeviceLibrary> saveEntities = new ArrayList<>();
String logMessage;
......@@ -395,6 +413,8 @@ public class StorageBillController {
else {
logMessage = "发起装备入库(未打印标签)";
}
//存放所有save的装备
List<DeviceLibrary> saveDevices = new ArrayList<>();
for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) {
if (d.getRfidCardId()==null|| "".equals(d.getRfidCardId()) ||deviceLibraryDao.getAllByRfidCardId(d.getRfidCardId()).size()==0) {
DeviceLibrary saveEntity = new DeviceLibrary();
......@@ -412,19 +432,25 @@ public class StorageBillController {
if (d.getIsSinglePart() == 0) {
if (deviceLibraryEntity.getIsPart() == 0) {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
parentId = saveEntity.getId();
}
if (deviceLibraryEntity.getIsPart() == 1) {
deviceLibraryEntity.setPartParentId(parentId);
if (parentPackingId!=null) {
for (int i = saveDevices.size()-1;i>=0;i--){
if (packingLibraryEntity.getPartParentId().equals(saveDevices.get(i).getPackingId())){
deviceLibraryEntity.setPartParentId(saveDevices.get(i).getId());
}
}
}
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
parentId = saveEntity.getId();
}
}
//如果是单独的配件,不用设置父装备id
else {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
parentId = saveEntity.getId();
}
saveDevices.add(saveEntity);
// parentId = saveEntity.getId();
parentPackingId = packingLibraryEntity.getId();
saveEntities.add(saveEntity);
stringBuffer.append(saveEntity.getId());
//存装备日志
......
......@@ -181,6 +181,9 @@ public class StorageBill {
@Column(name = "allot_files",columnDefinition = "TEXT")
private String allotFiles;
@Column(name = "other_files",columnDefinition = "TEXT")
private String otherFiles;
@Transient
private List<FileRet> replyFileList = new ArrayList<>();
......@@ -189,4 +192,7 @@ public class StorageBill {
@Transient
private List<FileRet> allotFileList = new ArrayList<>();
@Transient
private List<FileRet> otherFileList = new ArrayList<>();
}
......@@ -138,6 +138,7 @@ public class TaskSelectController {
storageBillEntity.setReplyFileList(FilesUtil.stringFileToList(storageBillEntity.getReplyFiles()));
storageBillEntity.setApplyFileList(FilesUtil.stringFileToList(storageBillEntity.getApplyFiles()));
storageBillEntity.setAllotFileList(FilesUtil.stringFileToList(storageBillEntity.getAllotFiles()));
storageBillEntity.setOtherFileList(FilesUtil.stringFileToList(storageBillEntity.getOtherFiles()));
list.add(storageBillEntity);
String str = storageBillEntity.getStorageDetail();
List<Integer> list1 = StringSplitUtil.userIdSplit(str);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论