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

修改bug

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