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

修改bug

上级 fa41e69e
......@@ -42,12 +42,6 @@ public class AllotBillSelectController {
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private TaskLogService taskLogService;
@Autowired
private TaskService taskService;
@ApiOperation(value = "查询配发单", notes = "可以通过这个接口查询配发单")
@PostMapping(value = "/archives/allot/summary")
public ResponseEntity selectAllotBill(@RequestBody AllotBillSelectVo allotBillSelectVo) {
......@@ -58,9 +52,7 @@ public class AllotBillSelectController {
@ApiOperation(value = "查询配发单详情页", notes = "可以通过这个接口查询配发单")
@GetMapping(value = "/archives/allot/detail/{id}")
public ResponseEntity selectAllotBillDetail(@PathVariable("id") int id) {
AllotBillDetailVo allotBillDetailVo = new AllotBillDetailVo();
//获取taskBto
TaskBto taskBto = taskService.get(id, BusinessEnum.ALLOT.id);
List<Object> list = new ArrayList<>();
//set账单用户名称并添加
AllotBill allotBillEntity = allotBillService.getOne(id);
allotBillEntity.setSenderUserA(userService.getOne(allotBillEntity.getSendUseraId()).getName());
......@@ -71,7 +63,7 @@ public class AllotBillSelectController {
if (allotBillEntity.getReceiveUserbId()!=null) {
allotBillEntity.setReceiveUserB(userService.getOne(allotBillEntity.getReceiveUserbId()).getName());
}
allotBillDetailVo.setAllotBill(allotBillEntity);
list.add(allotBillEntity);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
//如果接收装备详情不为空,分隔装备id并添加
if (allotBillEntity.getAllotCheckDetail()!=null){
......@@ -79,10 +71,7 @@ public class AllotBillSelectController {
libraryEntities.add(deviceLibraryService.getOne(deviceId));
}
}
allotBillDetailVo.setDeviceLibraries(libraryEntities);
//获取业务日志
List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId(taskBto.getId());
allotBillDetailVo.setTaskLogUserVos(taskLogUserVos);
return ResponseEntity.ok(allotBillDetailVo);
list.add(libraryEntities);
return ResponseEntity.ok(list);
}
}
......@@ -39,10 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -143,12 +140,10 @@ public class DeviceApplyController {
taskService.update(taskService.moveToEnd(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复通过",null);
taskLogService.addLog(taskLogBto);
//添加空的配发账单
AllotBill allotBill = allotBillService.addEntity(new AllotBill());
//生成配发子任务
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_ALLOT.id, "配发业务", taskBto.getId(), "."+taskBto.getId()+".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_ALLOT.id, "配发业务", taskBto.getId(), "."+taskBto.getId()+".", 0, 3, userUtils.getCurrentUnitId(), 0, null, userIds);
Task task = taskService.start(taskBto1);
deviceApplyBillService.update(applyBillEntity);
myWebSocket.sendMessage1();
......@@ -170,7 +165,7 @@ public class DeviceApplyController {
//获取申请账单
DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.getOne(applyTask.getBillId());
//添加配发单
AllotBill allotBillEntity = allotBillService.getOne(taskBto.getBillId());
AllotBill allotBillEntity = new AllotBill();
BeanUtils.copyProperties(deviceApplyAllotSaveVo, allotBillEntity);
allotBillEntity.setTitle("申请后配发");
allotBillEntity.setSendUseraId(userId);
......@@ -182,7 +177,14 @@ public class DeviceApplyController {
allotBillEntity.setSendTime(new Date());
allotBillEntity.setAllotType(2);
allotBillEntity.setAllotStatus(0);
allotBillService.update(allotBillEntity);
AllotBill allotBill = allotBillService.addEntity(allotBillEntity);
Calendar calendar = Calendar.getInstance();
calendar.setTime(allotBillEntity.getCreateTime());
int year = calendar.get(Calendar.YEAR);
String num = "NO:第" + year + "PF" + allotBill.getId() + "号";
allotBill.setNum(num);
allotBillService.update(allotBill);
taskBto.setBillId(allotBill.getId());
//配发业务移动到下一阶段
taskService.update(taskService.moveToNext(taskBto,deviceApplyAllotSaveVo.getSendUserbId()));
//添加业务日志
......
......@@ -240,7 +240,7 @@ public class DeviceDestroyController {
//生成Task
TaskBto taskBto = new TaskBto(
StatusEnum.DESTROY_BUSINESS_NEED_CONFIRM.id,
"标签修改业务",
"销毁业务",
0,
".",
destroyBill.getId(),
......
......@@ -474,7 +474,6 @@ public class RepairController {
// RepairBill repairbill= new RepairBill();
// RepairSendBill repairSendBill = new RepairSendBill();
// Integer userId = userUtils.getCurrentUserId();
//
// BeanUtils.copyProperties(repairBillSaveVo,repairbill);
// BeanUtils.copyProperties(repairBillSaveVo,repairSendBill);
// repairbill.setRepairStatus(0);
......
......@@ -215,7 +215,7 @@ public class DeviceRetiredController {
//生成Task
TaskBto taskBto = new TaskBto(
StatusEnum.RETIRED_BUSINESS_NEED_CONFIRM.id,
"标签修改业务",
"退装业务",
0,
".",
retiredBill.getId(),
......
......@@ -250,7 +250,7 @@ public class SelfCheckController {
@ApiOperation(value = "查询自查任务详情", notes = "可以通过这个接口查询自查任务详情")
@GetMapping(value = "/detail/{billId}")
public ResponseEntity selectDetail(@PathVariable("billId") int billId) {
SelfCheckDetailVo selfCheckDetailVo = new SelfCheckDetailVo();
List<Object> list = new ArrayList<>();
//获取业务
TaskBto taskBto = taskService.get(billId, BusinessEnum.SELF_CHECK.id);
//获取账单
......@@ -261,7 +261,7 @@ public class SelfCheckController {
if (selfExaminationBillEntity.getUserbId() != 0) {
selfExaminationBillEntity.setConfirmUser(userPublicService.getOne(selfExaminationBillEntity.getUserbId()).getName());
}
selfCheckDetailVo.setSelfCheckBill(selfExaminationBillEntity);
list.add(selfExaminationBillEntity);
//获取自查详情
String str3 = selfExaminationBillEntity.getCheckDetail();
String str4 = selfExaminationBillEntity.getNewDeviceDetail();
......@@ -284,7 +284,7 @@ public class SelfCheckController {
newDeviceList.add(d);
}
}
selfCheckDetailVo.setNewDeviceList(newDeviceList);
list.add(newDeviceList);
}
List<DeviceLibrary> libraryEntities1 = new ArrayList<>();
//添加自查装备
......@@ -297,10 +297,10 @@ public class SelfCheckController {
libraryEntities1.add(deviceLibraryEntity);
}
}
selfCheckDetailVo.setCheckDeviceList(libraryEntities1);
list.add(libraryEntities1);
//添加业务日志
selfCheckDetailVo.setTaskLogUserVos(taskLogService.getByTaskId(taskBto.getId()));
return ResultUtil.success(selfCheckDetailVo);
list.add(taskLogService.getByTaskId(taskBto.getId()));
return ResultUtil.success(list);
}
}
......@@ -140,23 +140,31 @@ public class TaskSelectController {
return ResponseEntity.ok(new ResultObj(list,"查询成功"));
}
AllotBill allotBillEntity = allotBillService.getOne(billId);
allotBillEntity.setSenderUserA(userPublicService.getOne(allotBillEntity.getSendUseraId()).getName());
allotBillEntity.setSenderUserB(userPublicService.getOne(allotBillEntity.getSendUserbId()).getName());
allotBillEntity.setReceiveUserA(userPublicService.getOne(allotBillEntity.getReceiveUseraId()).getName());
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());
}
list.add(allotBillEntity);
String str2 = allotBillEntity.getAllotCheckDetail();
String[] strings1 = str2.split("x");
List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>();
for (String s:strings1) {
if (s.length()>=2&& "1".equals(s.substring(s.length()-1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length()-1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraryEntities.add(deviceLibraryEntity);
if (str2!=null) {
String[] strings1 = str2.split("x");
for (String s : strings1) {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraryEntities.add(deviceLibraryEntity);
}
}
}
list.add(deviceLibraryEntities);
......
......@@ -63,4 +63,11 @@ public class DeviceUseReportController {
}
return ResultUtil.success(deviceUseReportDetailVo);
}
@ApiOperation(value = "装备使用报告下载", notes = "装备使用报告下载")
@GetMapping("/download/{id}")
public ResponseEntity getDownloadUrl(@PathVariable("id") int id){
DeviceUseReport d = deviceUseReportService.getOne(id);
return null;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论