提交 3e73fc37 authored 作者: zhoushaopan's avatar zhoushaopan

提交代码

上级 5e1f4e54
......@@ -12,6 +12,7 @@ import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
......@@ -50,6 +51,9 @@ public class AllotBillSelectController {
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@Autowired
private TaskService taskService;
@ApiOperation(value = "查询配发单", notes = "可以通过这个接口查询配发单")
@PostMapping(value = "/archives/allot/summary")
public ResponseEntity selectAllotBill(@RequestBody AllotBillSelectVo allotBillSelectVo) {
......@@ -64,13 +68,14 @@ public class AllotBillSelectController {
return ResponseEntity.ok(page);
}
@ApiOperation(value = "查询配发单详情页", notes = "可以通过这个接口查询配发单")
@ApiOperation(value = "查询配发单详情页,通过billId查询", notes = "可以通过这个接口查询配发单")
@GetMapping(value = "/archives/allot/detail/{id}")
public ResponseEntity selectAllotBillDetail(@PathVariable("id") int id) {
//获取所有装备id map
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//返回的数组
List<Object> list = new ArrayList<>();
// Integer billId = taskService.get(id).getBillId();
//set账单用户名称并添加
AllotBill allotBillEntity = allotBillService.getOne(id);
allotBillEntity.setSenderUserA(userService.getOne(allotBillEntity.getSendUseraId()).getName());
......@@ -102,14 +107,15 @@ public class AllotBillSelectController {
return ResponseEntity.ok(list);
}
@ApiOperation(value = "查询退回单详情页", notes = "可以通过这个接口查询退回单")
@ApiOperation(value = "查询退回单详情页,通过billId查询", notes = "可以通过这个接口查询退回单")
@GetMapping(value = "/archives/back/detail/{id}")
public ResponseEntity selectBackBillDetail(@PathVariable("id") int id) {
//获取所有装备id map
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//返回的数组
List<Object> list = new ArrayList<>();
//set账单用户名称并添加
//set账单用户名称并添
// Integer billId = taskService.get(id).getBillId();
AllotBackBill allotBillEntity = allotBackBillService.getOne(id);
allotBillEntity.setSenderUserA(userService.getOne(allotBillEntity.getSendUseraId()).getName());
allotBillEntity.setSenderUserB(allotBillEntity.getAgent());
......@@ -139,4 +145,84 @@ public class AllotBillSelectController {
list.add(libraryEntities);
return ResponseEntity.ok(list);
}
@ApiOperation(value = "查询配发单详情页,通过taskId查询", notes = "可以通过这个接口查询配发单")
@GetMapping(value = "/archives/allot/detail1/{id}")
public ResponseEntity selectAllotBillDetail2(@PathVariable("id") int id) {
//获取所有装备id map
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//返回的数组
List<Object> list = new ArrayList<>();
Integer billId = taskService.get(id).getBillId();
//set账单用户名称并添加
AllotBill allotBillEntity = allotBillService.getOne(billId);
allotBillEntity.setSenderUserA(userService.getOne(allotBillEntity.getSendUseraId()).getName());
allotBillEntity.setSenderUserB(allotBillEntity.getAgent());
if (allotBillEntity.getReceiveUseraId() != null) {
allotBillEntity.setReceiveUserA(userService.getOne(allotBillEntity.getReceiveUseraId()).getName());
}
if (allotBillEntity.getReceiveUserbId() != null) {
allotBillEntity.setReceiveUserB(userService.getOne(allotBillEntity.getReceiveUserbId()).getName());
}
//转换文件
allotBillEntity.setSendFileList(FilesUtil.stringFileToList(allotBillEntity.getSendFiles()));
allotBillEntity.setReceiveFileList(FilesUtil.stringFileToList(allotBillEntity.getReceiveFiles()));
allotBillEntity.setReplyFileList(FilesUtil.stringFileToList(allotBillEntity.getReplyFiles()));
allotBillEntity.setApplyFileList(FilesUtil.stringFileToList(allotBillEntity.getApplyFiles()));
//转换单据
if (allotBillEntity.getScriptJson()!=null){
allotBillEntity.setScripts(JacksonUtil.readValue(allotBillEntity.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBillEntity);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
//如果接收装备详情不为空,分隔装备id并添加
if (allotBillEntity.getAllotCheckDetail() != null) {
for (Integer deviceId : StringSplitUtil.split(allotBillEntity.getAllotCheckDetail())) {
libraryEntities.add(deviceLibraryMap.get(deviceId));
}
}
list.add(libraryEntities);
return ResponseEntity.ok(list);
}
@ApiOperation(value = "查询退回单详情页,通过taskId查询", notes = "可以通过这个接口查询退回单")
@GetMapping(value = "/archives/back/detail1/{id}")
public ResponseEntity selectBackBillDetail2(@PathVariable("id") int id) {
//获取所有装备id map
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//返回的数组
List<Object> list = new ArrayList<>();
//set账单用户名称并添
Integer billId = taskService.get(id).getBillId();
AllotBackBill allotBillEntity = allotBackBillService.getOne(billId);
allotBillEntity.setSenderUserA(userService.getOne(allotBillEntity.getSendUseraId()).getName());
allotBillEntity.setSenderUserB(allotBillEntity.getAgent());
if (allotBillEntity.getReceiveUseraId() != null) {
allotBillEntity.setReceiveUserA(userService.getOne(allotBillEntity.getReceiveUseraId()).getName());
}
if (allotBillEntity.getReceiveUserbId() !=null){
allotBillEntity.setReceiveUserB(userService.getOne(allotBillEntity.getReceiveUserbId()).getName());
}
//转换文件
allotBillEntity.setSendFileList(FilesUtil.stringFileToList(allotBillEntity.getSendFiles()));
allotBillEntity.setReceiveFileList(FilesUtil.stringFileToList(allotBillEntity.getReceiveFiles()));
allotBillEntity.setReplyFileList(FilesUtil.stringFileToList(allotBillEntity.getReplyFiles()));
allotBillEntity.setApplyFileList(FilesUtil.stringFileToList(allotBillEntity.getApplyFiles()));
//转换单据
if (allotBillEntity.getScriptJson()!=null){
allotBillEntity.setScripts(JacksonUtil.readValue(allotBillEntity.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBillEntity);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
//如果接收装备详情不为空,分隔装备id并添加
if (allotBillEntity.getBackCheckDetail() != null) {
for (Integer deviceId : StringSplitUtil.split(allotBillEntity.getBackCheckDetail())) {
libraryEntities.add(deviceLibraryMap.get(deviceId));
}
}
list.add(libraryEntities);
return ResponseEntity.ok(list);
}
}
......@@ -51,4 +51,10 @@ public interface AllotBillService {
* 根据id删除配发单
*/
void delete(Integer id);
// /**
// * @param
// * *在配发存储的时候用到存储数据库
// */
// void updateAllot();
}
......@@ -608,6 +608,15 @@ public class DeviceLibraryController {
return ResultUtil.success(deviceLibraries.stream().filter(deviceLibrary1 -> !deviceLibrary1.getId().equals(id) && deviceLibrary1.getLifeStatus() == 2 && deviceLibrary1.getOwnUnit().equals(userUtils.getCurrentUserUnitName()) &&deviceLibrary1.getLocationUnit().equals(userUtils.getCurrentUserUnitName())).collect(Collectors.toList()));
}
@ApiOperation(value = "修改装备的存放位置")
@PostMapping("/updateDeviceLibraryLocation")
public void updateDeviceLibraryLocation(@RequestBody DeviceStorageLocation deviceStorageLocation){
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(deviceStorageLocation.getDevId());
//添加修改存放装备位置
deviceLibrary.setStorageLocation(deviceStorageLocation.getStorageLocation());
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceStorageLocation.getDevId(), "将存放位置改为"+deviceStorageLocation.getStorageLocation(), null,null,null);
deviceLogService.addLog(deviceLogDto);
deviceLibraryService.update(deviceLibrary);
}
}
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* DATE:2021-6-24
* Author:zsp
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel("装备位置")
public class DeviceStorageLocation {
@ApiModelProperty(value = "装备id")
private Integer devId;
@ApiModelProperty(value = "库存位置")
private String storageLocation;
}
......@@ -386,7 +386,7 @@ public class StorageBillController {
if (storageBillSaveVo.getTaskId()==null) {
storageBillEntity = storageBillService.addEntity(storageBillSaveVo.toDo());
//2.发起入库任务
TaskBto taskBto = new TaskBto(StatusEnum.END.id, storageBillSaveVo.getSendUnit()+"进行了入库业务", null, ".", storageBillEntity.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto = new TaskBto(StatusEnum.END.id, "入库了"+storageBillSaveVo.getStorageBillDetails().stream().map(storageBillDetail -> storageBillDetail.getModel()).collect(Collectors.toList())+"型号"+"入库业务", null, ".", storageBillEntity.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds);
taskEntity1 = taskService.start(taskBto);
}
else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论