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

更新task接口

上级 91b2b287
...@@ -20,6 +20,7 @@ import com.tykj.dev.device.task.subject.domin.Task; ...@@ -20,6 +20,7 @@ import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.library.subject.vo.FileVo; import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.ResultObj;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.TimestampUtil; import com.tykj.dev.misc.utils.TimestampUtil;
import com.tykj.dev.socket.MyWebSocket; import com.tykj.dev.socket.MyWebSocket;
...@@ -73,7 +74,7 @@ public class AllotBillController { ...@@ -73,7 +74,7 @@ public class AllotBillController {
@ApiOperation(value = "发起配发业务",notes = "可以通过这个接口发起配发任务") @ApiOperation(value = "发起配发业务",notes = "可以通过这个接口发起配发任务")
@PostMapping(value = "/addAllotBill") @PostMapping(value = "/addAllotBill")
public ResponseEntity<AllotBill> addAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) { public ResponseEntity<ResultObj> addAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
//1.添加配发单 //1.添加配发单
AllotBill a = allotBillSaveVo.toDo(); AllotBill a = allotBillSaveVo.toDo();
a.setSendUseraId(userUtils.getCurrentUserId()); a.setSendUseraId(userUtils.getCurrentUserId());
...@@ -108,7 +109,7 @@ public class AllotBillController { ...@@ -108,7 +109,7 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success(allotBillEntity); return ResponseEntity.ok(new ResultObj(allotBillEntity,"发起成功"));
} }
@ApiOperation(value = "配发审核",notes = "可以通过这个接口对配发审核") @ApiOperation(value = "配发审核",notes = "可以通过这个接口对配发审核")
...@@ -146,7 +147,7 @@ public class AllotBillController { ...@@ -146,7 +147,7 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("配发审核通过"); return ResponseEntity.ok("配发审核通过");
} }
//2.审核失败 //2.审核失败
if (allotBillConfirmVo.getStatus()==1){ if (allotBillConfirmVo.getStatus()==1){
...@@ -170,10 +171,10 @@ public class AllotBillController { ...@@ -170,10 +171,10 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("配发审核失败"); return ResponseEntity.ok("配发审核失败");
} }
else { else {
return ResultUtil.failed("status只能为0或1"); return ResponseEntity.ok("status只能为0或1");
} }
} }
...@@ -226,7 +227,7 @@ public class AllotBillController { ...@@ -226,7 +227,7 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("配发接收入库"); return ResponseEntity.ok("配发接收入库");
} }
@ApiOperation(value = "接收配发装备审核",notes = "可以通过这个接口对接收配发装备审核") @ApiOperation(value = "接收配发装备审核",notes = "可以通过这个接口对接收配发装备审核")
...@@ -260,7 +261,7 @@ public class AllotBillController { ...@@ -260,7 +261,7 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("入库审核通过配发接收成功"); return ResponseEntity.ok("入库审核通过配发接收成功");
} }
//审核失败 //审核失败
if (allotReceiveConfirmVo.getStatus()==1){ if (allotReceiveConfirmVo.getStatus()==1){
...@@ -284,10 +285,10 @@ public class AllotBillController { ...@@ -284,10 +285,10 @@ public class AllotBillController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("配发接收入库审核失败"); return ResponseEntity.ok("配发接收入库审核失败");
} }
else { else {
return ResultUtil.failed("status只能为0或1"); return ResponseEntity.ok("status只能为0或1");
} }
} }
} }
...@@ -53,7 +53,7 @@ public class AllotBillSelectController { ...@@ -53,7 +53,7 @@ public class AllotBillSelectController {
@PostMapping(value = "/archives/allot/summary") @PostMapping(value = "/archives/allot/summary")
public ResponseEntity<Page<AllotBill>> selectAllotBill(@RequestBody AllotBillSelectVo allotBillSelectVo){ public ResponseEntity<Page<AllotBill>> selectAllotBill(@RequestBody AllotBillSelectVo allotBillSelectVo){
Page<AllotBill> page = allotBillService.getPage(allotBillSelectVo,allotBillSelectVo.getPageable()); Page<AllotBill> page = allotBillService.getPage(allotBillSelectVo,allotBillSelectVo.getPageable());
return ResultUtil.success(page); return ResponseEntity.ok(page);
} }
@ApiOperation(value = "查询配发单详情页",notes = "可以通过这个接口查询配发单") @ApiOperation(value = "查询配发单详情页",notes = "可以通过这个接口查询配发单")
...@@ -84,6 +84,6 @@ public class AllotBillSelectController { ...@@ -84,6 +84,6 @@ public class AllotBillSelectController {
//获取业务日志 //获取业务日志
List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId(taskBto.getId()); List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId(taskBto.getId());
allotBillDetailVo.setTaskLogUserVos(taskLogUserVos); allotBillDetailVo.setTaskLogUserVos(taskLogUserVos);
return ResultUtil.success(allotBillDetailVo); return ResponseEntity.ok(allotBillDetailVo);
} }
} }
...@@ -28,6 +28,7 @@ import com.tykj.dev.device.library.subject.vo.FileVo; ...@@ -28,6 +28,7 @@ import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo; import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil; import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.socket.MyWebSocket; import com.tykj.dev.socket.MyWebSocket;
...@@ -113,7 +114,7 @@ public class DeviceApplyController { ...@@ -113,7 +114,7 @@ public class DeviceApplyController {
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起装备申请",null); TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起装备申请",null);
taskLogService.addLog(taskLogBto); taskLogService.addLog(taskLogBto);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success(deviceApplyBillEntity); return ResponseEntity.ok(deviceApplyBillEntity);
} }
@ApiOperation(value = "装备申请批复",notes = "可以通过这个接口批复") @ApiOperation(value = "装备申请批复",notes = "可以通过这个接口批复")
...@@ -134,7 +135,7 @@ public class DeviceApplyController { ...@@ -134,7 +135,7 @@ public class DeviceApplyController {
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复驳回",null); TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复驳回",null);
taskLogService.addLog(taskLogBto); taskLogService.addLog(taskLogBto);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success(taskBto); return ResponseEntity.ok(taskBto);
} }
//批复成功 //批复成功
if (deviceApplyConfirmVo.getStatus()==0){ if (deviceApplyConfirmVo.getStatus()==0){
...@@ -151,10 +152,10 @@ public class DeviceApplyController { ...@@ -151,10 +152,10 @@ public class DeviceApplyController {
Task task = taskService.start(taskBto1); Task task = taskService.start(taskBto1);
deviceApplyBillService.update(applyBillEntity); deviceApplyBillService.update(applyBillEntity);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success(task.parse2Bto()); return ResponseEntity.ok(task.parse2Bto());
} }
else { else {
return ResultUtil.failed(); throw new ApiException(ResultUtil.failed("status只能为0或1"));
} }
} }
...@@ -200,7 +201,7 @@ public class DeviceApplyController { ...@@ -200,7 +201,7 @@ public class DeviceApplyController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("发起配发成功"); return ResponseEntity.ok("发起配发成功");
} }
@ApiOperation(value = "查询申请任务详情",notes = "可以通过这个接口查询申请任务详情") @ApiOperation(value = "查询申请任务详情",notes = "可以通过这个接口查询申请任务详情")
...@@ -258,6 +259,6 @@ public class DeviceApplyController { ...@@ -258,6 +259,6 @@ public class DeviceApplyController {
.sorted(Comparator.comparing(TaskLogUserVo::getCreateTime)) .sorted(Comparator.comparing(TaskLogUserVo::getCreateTime))
.collect(Collectors.toList()); .collect(Collectors.toList());
applyDetailVo.setTaskLogUserVos(allLogUserVos); applyDetailVo.setTaskLogUserVos(allLogUserVos);
return ResultUtil.success(applyDetailVo); return ResponseEntity.ok(applyDetailVo);
} }
} }
...@@ -231,4 +231,12 @@ public class DeviceLibraryController { ...@@ -231,4 +231,12 @@ public class DeviceLibraryController {
List<DeviceLibrary> deviceLibraryEntityList = libraryEntities.stream().filter(deviceLibraryEntity -> deviceLibraryEntity.getIsPart() == 0).collect(Collectors.toList()); List<DeviceLibrary> deviceLibraryEntityList = libraryEntities.stream().filter(deviceLibraryEntity -> deviceLibraryEntity.getIsPart() == 0).collect(Collectors.toList());
return ResultUtil.success(deviceLibraryEntityList); return ResultUtil.success(deviceLibraryEntityList);
} }
@ApiOperation(value = "查询维修报废换新装备",notes = "查询装备")
@GetMapping("/select/newChange/{id}")
public ResponseEntity<List<DeviceLibrary>> selectNewChangeDevice(@PathVariable("id") int id){
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(id);
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.getAllByTypeAndNameAndModel(deviceLibrary.getType(),deviceLibrary.getName(),deviceLibrary.getModel());
return ResultUtil.success(deviceLibraries);
}
} }
...@@ -18,6 +18,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary,Integer>, ...@@ -18,6 +18,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary,Integer>,
List<DeviceLibrary> getAllByOwnUnit(String unit); List<DeviceLibrary> getAllByOwnUnit(String unit);
List<DeviceLibrary> getAllByTypeAndNameAndModel(Integer type,String name,String model);
/** /**
* 根据装备型号与装备所在地(多个地区)查询装备数量 * 根据装备型号与装备所在地(多个地区)查询装备数量
......
...@@ -126,7 +126,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -126,7 +126,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override @Override
public Page<DeviceStatisticsVo> getDeviceStatisticsPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable) { public Page<DeviceStatisticsVo> getDeviceStatisticsPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable) {
//获取存在的所有装备型号 //获取存在的所有装备型号
List<String> list = getAllModel(); List<String> list = new ArrayList<>();
if (deviceLibrarySelectVo.getModel()!=null){
list.add(deviceLibrarySelectVo.getModel());
}
else {
list = getAllModel();
}
//设置最大size的装备查询vo //设置最大size的装备查询vo
List<DeviceStatisticsVo> deviceStatisticsVos = new ArrayList<>(); List<DeviceStatisticsVo> deviceStatisticsVos = new ArrayList<>();
DeviceLibrarySelectVo d = new DeviceLibrarySelectVo(); DeviceLibrarySelectVo d = new DeviceLibrarySelectVo();
...@@ -201,6 +207,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -201,6 +207,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceStatisticsVos.add(deviceStatisticsVo); deviceStatisticsVos.add(deviceStatisticsVo);
} }
} }
if (deviceLibrarySelectVo.getName()!=null){
deviceStatisticsVos = selectByName(deviceLibrarySelectVo.getName(),deviceStatisticsVos);
}
return PageUtil.getPerPage(deviceLibrarySelectVo.getPage(),deviceLibrarySelectVo.getSize(),deviceStatisticsVos,pageable); return PageUtil.getPerPage(deviceLibrarySelectVo.getPage(),deviceLibrarySelectVo.getSize(),deviceStatisticsVos,pageable);
} }
return new PageImpl<>(deviceStatisticsVos, pageable, deviceStatisticsVos.size()); return new PageImpl<>(deviceStatisticsVos, pageable, deviceStatisticsVos.size());
...@@ -443,4 +452,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -443,4 +452,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
} }
return new ArrayList<>(s); return new ArrayList<>(s);
} }
private List<DeviceStatisticsVo> selectByName(String name,List<DeviceStatisticsVo> deviceStatisticsVos){
return deviceStatisticsVos.stream().filter(deviceStatisticsVo -> deviceStatisticsVo.getName().equals(name)).collect(Collectors.toList());
}
} }
...@@ -193,6 +193,10 @@ public class DeviceLibrary { ...@@ -193,6 +193,10 @@ public class DeviceLibrary {
@Transient @Transient
private Integer checkResult; private Integer checkResult;
@ApiModelProperty(value = "备注")
@Transient
private String remark;
@Transient @Transient
private List<DeviceLibrary> childs = new ArrayList<>(); private List<DeviceLibrary> childs = new ArrayList<>();
......
...@@ -107,7 +107,7 @@ public class MatchingDeviceController { ...@@ -107,7 +107,7 @@ public class MatchingDeviceController {
m.setDeviceDetail(stringBuffer.toString()); m.setDeviceDetail(stringBuffer.toString());
matchingDeviceBillService.update(m); matchingDeviceBillService.update(m);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("添加成功"); return ResponseEntity.ok("添加成功");
} }
@ApiOperation(value = "添加配套设备审核",notes = "可以通过这个接口添加配套设备审核") @ApiOperation(value = "添加配套设备审核",notes = "可以通过这个接口添加配套设备审核")
...@@ -136,7 +136,7 @@ public class MatchingDeviceController { ...@@ -136,7 +136,7 @@ public class MatchingDeviceController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("审核通过新增成功"); return ResponseEntity.ok("审核通过新增成功");
} }
//2.审核失败 //2.审核失败
if (matchingDeviceBillConfirmVo.getStatus()==1){ if (matchingDeviceBillConfirmVo.getStatus()==1){
...@@ -160,10 +160,10 @@ public class MatchingDeviceController { ...@@ -160,10 +160,10 @@ public class MatchingDeviceController {
} }
} }
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("入库审核失败"); return ResponseEntity.ok("入库审核失败");
} }
else { else {
return ResultUtil.success("status只能为0或1"); return ResponseEntity.ok("status只能为0或1");
} }
} }
...@@ -177,7 +177,7 @@ public class MatchingDeviceController { ...@@ -177,7 +177,7 @@ public class MatchingDeviceController {
m.setRelateDevice(deviceLibraryService.getOne(m.getDeviceId()).getRfidSurfaceId()); m.setRelateDevice(deviceLibraryService.getOne(m.getDeviceId()).getRfidSurfaceId());
} }
} }
return ResultUtil.success(page); return ResponseEntity.ok(page);
} }
@ApiOperation(value = "查询配套装备详情",notes = "可以通过这个接口查询配套装备详情") @ApiOperation(value = "查询配套装备详情",notes = "可以通过这个接口查询配套装备详情")
...@@ -198,7 +198,7 @@ public class MatchingDeviceController { ...@@ -198,7 +198,7 @@ public class MatchingDeviceController {
.sorted(Comparator.comparing(DeviceLogUserVo::getCreateTime)) .sorted(Comparator.comparing(DeviceLogUserVo::getCreateTime))
.collect(Collectors.toList()); .collect(Collectors.toList());
macthingDeviceDetailVo.setDeviceLogUserVos(deviceLogs); macthingDeviceDetailVo.setDeviceLogUserVos(deviceLogs);
return ResultUtil.success(macthingDeviceDetailVo); return ResponseEntity.ok(macthingDeviceDetailVo);
} }
@ApiOperation(value = "更新配套设备",notes = "可以通过这个接口更新配套设备") @ApiOperation(value = "更新配套设备",notes = "可以通过这个接口更新配套设备")
...@@ -227,7 +227,7 @@ public class MatchingDeviceController { ...@@ -227,7 +227,7 @@ public class MatchingDeviceController {
m.setType(matchingDeviceEditVo.getType()); m.setType(matchingDeviceEditVo.getType());
} }
matchingDeviceLibraryService.update(m); matchingDeviceLibraryService.update(m);
return ResultUtil.success("修改成功"); return ResponseEntity.ok("修改成功");
} }
@ApiOperation(value = "查询新增配套任务详情",notes = "可以通过这个接口查询新增配套任务详情") @ApiOperation(value = "查询新增配套任务详情",notes = "可以通过这个接口查询新增配套任务详情")
...@@ -252,6 +252,6 @@ public class MatchingDeviceController { ...@@ -252,6 +252,6 @@ public class MatchingDeviceController {
macthingDetailVo.setMatchingDeviceLibraries(matchingDeviceLibraryEntities); macthingDetailVo.setMatchingDeviceLibraries(matchingDeviceLibraryEntities);
//获取业务日志 //获取业务日志
macthingDetailVo.setTaskLogUserVos(taskLogService.getByTaskId(taskBto.getId())); macthingDetailVo.setTaskLogUserVos(taskLogService.getByTaskId(taskBto.getId()));
return ResultUtil.success(macthingDetailVo); return ResponseEntity.ok(macthingDetailVo);
} }
} }
...@@ -90,6 +90,9 @@ public class RepairController { ...@@ -90,6 +90,9 @@ public class RepairController {
@Autowired @Autowired
private RepairDetailDao repairDetailDao; private RepairDetailDao repairDetailDao;
@Autowired
private RepairBackBillDao repairBackBillDao;
@ApiOperation(value = "发起维修",notes = "可以通过这个接口发起维修") @ApiOperation(value = "发起维修",notes = "可以通过这个接口发起维修")
@PostMapping(value = "/form") @PostMapping(value = "/form")
public ResponseEntity<Task> createRepair(@RequestBody RepairBillSaveVo repairBillSaveVo){ public ResponseEntity<Task> createRepair(@RequestBody RepairBillSaveVo repairBillSaveVo){
...@@ -107,7 +110,7 @@ public class RepairController { ...@@ -107,7 +110,7 @@ public class RepairController {
repairBill.setStartUserB(userPublicService.getOne(repairBillSaveVo.getStartUserbId()).getName()); repairBill.setStartUserB(userPublicService.getOne(repairBillSaveVo.getStartUserbId()).getName());
RepairBill repairBill1 = deviceRepairBillService.addEntity(repairBill); RepairBill repairBill1 = deviceRepairBillService.addEntity(repairBill);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
String s1 ="NO:第"+calendar.get(Calendar.YEAR)+"PF"+repairBill1.getId()+"号"; String s1 ="NO:第"+calendar.get(Calendar.YEAR)+"WX"+repairBill1.getId()+"号";
repairBill1.setDocNum(s1); repairBill1.setDocNum(s1);
deviceRepairBillService.update(repairBill1); deviceRepairBillService.update(repairBill1);
//发起维修业务 //发起维修业务
...@@ -445,7 +448,7 @@ public class RepairController { ...@@ -445,7 +448,7 @@ public class RepairController {
} }
@ApiOperation(value = "往上维修出库装备查询",notes = "可以通过这个接口往上维修出库装备查询") @ApiOperation(value = "往上维修出库装备查询",notes = "可以通过这个接口往上维修出库装备查询")
@PostMapping(value = "/sendDeviceSelect/{id}") @GetMapping(value = "/sendDeviceSelect/{id}")
public ResponseEntity<RepairOutPutDeviceVo> sendDeviceSelect(@PathVariable("id") int id){ public ResponseEntity<RepairOutPutDeviceVo> sendDeviceSelect(@PathVariable("id") int id){
RepairOutPutDeviceVo repairOutPutDeviceVo = new RepairOutPutDeviceVo(); RepairOutPutDeviceVo repairOutPutDeviceVo = new RepairOutPutDeviceVo();
//获取业务和账单 //获取业务和账单
...@@ -569,6 +572,9 @@ public class RepairController { ...@@ -569,6 +572,9 @@ public class RepairController {
repairBackBill.setSendTime(new Date()); repairBackBill.setSendTime(new Date());
repairBackBill.setTitle("维修退回业务"); repairBackBill.setTitle("维修退回业务");
repairBackBill.setAgent(repairBackBillSaveVo.getAgent()); repairBackBill.setAgent(repairBackBillSaveVo.getAgent());
Calendar calendar = Calendar.getInstance();
String s1 ="NO:第"+calendar.get(Calendar.YEAR)+"HZ"+repairBackBill.getId()+"号";
repairBackBill.setDocNum(s1);
RepairBackBill deviceRepairBackBillEntity1 = deviceRepairBackBillService.save(repairBackBill); RepairBackBill deviceRepairBackBillEntity1 = deviceRepairBackBillService.save(repairBackBill);
//发起维修退回子业务 //发起维修退回子业务
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
...@@ -900,21 +906,96 @@ public class RepairController { ...@@ -900,21 +906,96 @@ public class RepairController {
} }
return ResultUtil.success("换新成功"); return ResultUtil.success("换新成功");
} }
//
// @ApiOperation(value = "查询维修详情",notes = "可以通过这个接口查询维修详情")
// @PostMapping(value = "/detail/{id}")
// public ResponseEntity<RepairBillDetailVo> getDetail(@PathVariable("billId") int id){
// //获取task
// TaskBto taskBto = taskService.get(id);
// //判断维修业务类型
// switch (taskBto.getBusinessType()){
// case BusinessEnum.REPAIR_SEND.id:
// default:break;
// }
// return null;
// }
// @ApiOperation(value = "查询维修装备状态",notes = "可以通过这个接口查询维修装备状态") @ApiOperation(value = "查询维修详情",notes = "可以通过这个接口查询维修详情")
// @PostMapping(value = "/select/status/") @GetMapping(value = "/detail/{id}")
// public ResponseEntity<List<RepairDetail>> getRepairDeatail() public ResponseEntity<RepairBillDetailVo> getDetail(@PathVariable("id") int id){
//获取task
TaskBto taskBto = taskService.get(id);
RepairBillDetailVo repairBillDetailVo = new RepairBillDetailVo();
//判断维修业务类型
switch (taskBto.getBusinessType()){
//送修业务
case 5:
//获取维修单
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
repairBillDetailVo.setRepairBill(repairBill);
//获取装备列表
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill.getId());
repairBillDetailVo.setRepairSendBill(repairSendBill);
List<Integer> ids = StringSplitUtil.split(repairSendBill.getRepairDeviceCheckDetail());
List<DeviceLibrary> deviceLibraries = ids.stream()
.map(integer -> deviceLibraryService.getOne(integer))
.collect(Collectors.toList());
//获取维修详情
List<RepairDetail> repairDetails = getRepairDetail(repairBill.getId());
repairBillDetailVo.setRepairDetails(repairDetails);
//设置装备备注
deviceLibraries.forEach(deviceLibrary -> {
for (RepairDetail r:repairDetails) {
if (r.getDeviceId().equals(deviceLibrary.getId())){
deviceLibrary.setRemark(r.getRemark());
}
}
});
repairBillDetailVo.setDeviceLibraries(deviceLibraries);
break;
case 10:
//获取维修退回单
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
if (repairBackBill.getStartUseraId()!=null){
repairBackBill.setStartUserA(userPublicService.getOne(repairBackBill.getStartUseraId()).getName());
}
if (repairBackBill.getStartUserbId()!=null){
repairBackBill.setStartUserB(userPublicService.getOne(repairBackBill.getStartUserbId()).getName());
}
if (repairBackBill.getReceiveUseraId()!=null){
repairBackBill.setReceiveUserA(userPublicService.getOne(repairBackBill.getReceiveUseraId()).getName());
}
if (repairBackBill.getReceiveUserbId()!=null){
repairBackBill.setReceiveUserB(userPublicService.getOne(repairBackBill.getReceiveUserbId()).getName());
}
//获取装备列表
List<Integer> integers = StringSplitUtil.split(repairBackBill.getBackCheckDetail());
List<DeviceLibrary> deviceLibraryList = integers.stream()
.map(integer -> deviceLibraryService.getOne(integer))
.collect(Collectors.toList());
//获取维修详情
List<RepairDetail> repairDetailList = getRepairDetail(repairBackBill.getDeviceRepairBillId());
repairBillDetailVo.setRepairDetails(repairDetailList);
//设置装备备注
deviceLibraryList.forEach(deviceLibrary -> {
for (RepairDetail r:repairDetailList) {
if (r.getDeviceId().equals(deviceLibrary.getId())){
deviceLibrary.setRemark(r.getRemark());
}
}
});
repairBillDetailVo.setDeviceLibraries(deviceLibraryList);
break;
default:break;
}
return ResultUtil.success(repairBillDetailVo);
}
/**
* @param repairBillId 维修单id
* @return 维修详情列表
* 根据维修单Id查询维修详情,排序返回
*/
private List<RepairDetail> getRepairDetail(int repairBillId){
List<RepairDetail> repairDetails = deviceRepairDetailService.findByBillId(repairBillId);
List<RepairDetail> orderList = new ArrayList<>();
repairDetails.forEach(repairDetail -> {
if (!repairDetail.getRepairStatus().equals(RepairStatusEnum.CHANGE_NEW.id)) {
orderList.add(repairDetail);
if (repairDetail.getRepairStatus().equals(RepairStatusEnum.SCRAPPED.id)) {
if (repairDetail.getNewDeviceDetailId() > 0) {
orderList.add(deviceRepairDetailService.getOne(repairDetail.getNewDeviceDetailId()));
}
}
}
});
return orderList;
}
} }
...@@ -12,4 +12,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; ...@@ -12,4 +12,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @createTime 2020年08月25日 10:29:00 * @createTime 2020年08月25日 10:29:00
*/ */
public interface RepairBackBillDao extends JpaRepository<RepairBackBill,Integer>, JpaSpecificationExecutor<RepairBackBill> { public interface RepairBackBillDao extends JpaRepository<RepairBackBill,Integer>, JpaSpecificationExecutor<RepairBackBill> {
RepairBackBill findByDeviceRepairBillId(Integer repairBillId);
} }
...@@ -197,5 +197,25 @@ public class RepairBackBill { ...@@ -197,5 +197,25 @@ public class RepairBackBill {
*/ */
@ApiModelProperty(value = "签发人") @ApiModelProperty(value = "签发人")
private String agent; private String agent;
/**
* 维修回执单档案号
*/
@ApiModelProperty(value = "维修单档案号")
private String docNum;
@ApiModelProperty(value = "发起人")
@Transient
private String startUserA;
@ApiModelProperty(value = "发起确认人")
@Transient
private String startUserB;
@ApiModelProperty(value = "接收人")
@Transient
private String receiveUserA;
@ApiModelProperty(value = "接收确认人")
@Transient
private String receiveUserB;
} }
package com.tykj.dev.device.repair.subject.vo; package com.tykj.dev.device.repair.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.repair.subject.domin.RepairBackBill;
import com.tykj.dev.device.repair.subject.domin.RepairBill; import com.tykj.dev.device.repair.subject.domin.RepairBill;
import com.tykj.dev.device.repair.subject.domin.RepairDetail; import com.tykj.dev.device.repair.subject.domin.RepairDetail;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo; import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -20,12 +22,16 @@ public class RepairBillDetailVo { ...@@ -20,12 +22,16 @@ public class RepairBillDetailVo {
@ApiModelProperty(name = "维修单") @ApiModelProperty(name = "维修单")
private RepairBill repairBill; private RepairBill repairBill;
@ApiModelProperty(name = "送修单")
private RepairSendBill repairSendBill;
@ApiModelProperty(name = "退回单")
private RepairBackBill repairBackBill;
@ApiModelProperty(name = "装备信息") @ApiModelProperty(name = "装备信息")
private List<DeviceLibrary> deviceLibraries; private List<DeviceLibrary> deviceLibraries;
@ApiModelProperty(name = "装备维修状态列表") @ApiModelProperty(name = "装备维修状态列表")
private List<RepairDetail> repairDetails; private List<RepairDetail> repairDetails;
@ApiModelProperty(name = "业务日志")
private List<TaskLogUserVo> taskLogUserVos;
} }
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>device</artifactId>
<groupId>com.tykj.dev</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>device-taskselect</artifactId>
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-user</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-matching</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-apply</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-selfcheck</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-allot</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-storage</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-packing</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-library</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-task</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.taskselect;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages={
"com.tykj.dev.*",
}
)
public class taskSelectApp {
public static void main(String[] args) {
SpringApplication.run(taskSelectApp.class, args);
}
}
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<module>device-storage</module> <module>device-storage</module>
<module>device-usereport</module> <module>device-usereport</module>
<module>device-file</module> <module>device-file</module>
<module>device-taskselect</module>
</modules> </modules>
<name>device</name> <name>device</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
......
package com.tykj.dev.misc.base; package com.tykj.dev.misc.base;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -11,6 +12,7 @@ import lombok.NoArgsConstructor; ...@@ -11,6 +12,7 @@ import lombok.NoArgsConstructor;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@JsonPropertyOrder(value = {"message","data"})
public class ResultObj { public class ResultObj {
private Object data; private Object data;
...@@ -21,6 +23,7 @@ public class ResultObj { ...@@ -21,6 +23,7 @@ public class ResultObj {
this.data = o; this.data = o;
this.message = "no message"; this.message = "no message";
} }
public ResultObj(String m) { public ResultObj(String m) {
this.message = m; this.message = m;
this.data = new Object(); this.data = new Object();
......
...@@ -62,6 +62,18 @@ ...@@ -62,6 +62,18 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-taskselect</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.tykj.dev</groupId>
<artifactId>union</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>device-usereport</artifactId> <artifactId>device-usereport</artifactId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论