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

更新

上级 20689ec3
...@@ -178,6 +178,10 @@ public class AllotBillController { ...@@ -178,6 +178,10 @@ public class AllotBillController {
allotBillEntity.setLeftSignatureId(allotBillSaveVo.getLeftSignatureId()); allotBillEntity.setLeftSignatureId(allotBillSaveVo.getLeftSignatureId());
} }
allotBillEntity.setRightSignatureId(signId2.toString()); allotBillEntity.setRightSignatureId(signId2.toString());
if (allotBillSaveVo.getSendUserbId()!=null){
allotBillEntity.setSendUserbId(allotBillSaveVo.getSendUserbId());
allotBillEntity.setAgent(userPublicService.getOne(allotBillSaveVo.getSendUserbId()).getName());
}
AllotBill allotBill = allotBillService.update(allotBillEntity); AllotBill allotBill = allotBillService.update(allotBillEntity);
Integer billId = allotBillEntity.getId(); Integer billId = allotBillEntity.getId();
Integer userId = userUtils.getCurrentUserId(); Integer userId = userUtils.getCurrentUserId();
...@@ -577,6 +581,9 @@ public class AllotBillController { ...@@ -577,6 +581,9 @@ public class AllotBillController {
@PostMapping(value = "/saveAllotBill") @PostMapping(value = "/saveAllotBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity saveAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) { public ResponseEntity saveAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
if (allotBillSaveVo.getAllotCheckDetail()!=null&&allotBillSaveVo.getAllotCheckDetail().length()>0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//第一次保存 //第一次保存
if (allotBillSaveVo.getTaskId()==null){ if (allotBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId(); Integer userId = userUtils.getCurrentUserId();
...@@ -648,6 +655,11 @@ public class AllotBillController { ...@@ -648,6 +655,11 @@ public class AllotBillController {
public ResponseEntity applySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) { public ResponseEntity applySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) {
//推动任务 //推动任务
TaskBto taskBto = taskService.get(taskId); TaskBto taskBto = taskService.get(taskId);
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
if (allotBill.getAllotStatus()!=0){
allotBill.setReceiveUseraId(userUtils.getCurrentUserId());
allotBillService.update(allotBill);
}
taskService.moveToSpecial(taskBto,StatusEnum.SIGN_WAIT_CONFIRM,userId); taskService.moveToSpecial(taskBto,StatusEnum.SIGN_WAIT_CONFIRM,userId);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功"); return ResponseEntity.ok("申请成功");
......
...@@ -379,6 +379,9 @@ public class BackController { ...@@ -379,6 +379,9 @@ public class BackController {
@PostMapping(value = "/saveBackBill") @PostMapping(value = "/saveBackBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity saveBackBill(@RequestBody AllotBillSaveVo allotBillSaveVo) { public ResponseEntity saveBackBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
if (allotBillSaveVo.getAllotCheckDetail()!=null&&allotBillSaveVo.getAllotCheckDetail().length()>0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//第一次保存 //第一次保存
if (allotBillSaveVo.getTaskId()==null){ if (allotBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId(); Integer userId = userUtils.getCurrentUserId();
...@@ -449,6 +452,11 @@ public class BackController { ...@@ -449,6 +452,11 @@ public class BackController {
public ResponseEntity applySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) { public ResponseEntity applySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) {
//推动任务 //推动任务
TaskBto taskBto = taskService.get(taskId); TaskBto taskBto = taskService.get(taskId);
AllotBackBill allotBill = allotBackBillService.getOne(taskBto.getBillId());
if (allotBill.getBackStatus()!=1){
allotBill.setReceiveUseraId(userUtils.getCurrentUserId());
allotBackBillService.update(allotBill);
}
taskService.moveToSpecial(taskBto,StatusEnum.BACK_SIGN_WAIT_CONFIRM,userId); taskService.moveToSpecial(taskBto,StatusEnum.BACK_SIGN_WAIT_CONFIRM,userId);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功"); return ResponseEntity.ok("申请成功");
......
...@@ -416,7 +416,7 @@ public class DeviceApplyController { ...@@ -416,7 +416,7 @@ public class DeviceApplyController {
} }
if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0) { if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0) {
for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) { for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) {
ResponseEntity responseEntity = packingController.seqsExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval()); ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) { if (!"ok".equals(responseEntity.getBody())) {
return responseEntity; return responseEntity;
} }
......
...@@ -293,6 +293,21 @@ public enum LogType { ...@@ -293,6 +293,21 @@ public enum LogType {
ALLOT_21(121,ALLOT.id, WAIT_SIGN.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, "盖电子签章并入库"), ALLOT_21(121,ALLOT.id, WAIT_SIGN.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, "盖电子签章并入库"),
ALLOT_22(122,ALLOT.id, SIGN_WAIT_CONFIRM.id, ALLOTING.id, "拒绝电子签章申请"), ALLOT_22(122,ALLOT.id, SIGN_WAIT_CONFIRM.id, ALLOTING.id, "拒绝电子签章申请"),
ALLOT_BACK_15(123,ALLOT_BACK.id, BACK_SIGN_WAIT_CONFIRM.id, ALLOT_BACKING.id, "拒绝电子签章申请"), ALLOT_BACK_15(123,ALLOT_BACK.id, BACK_SIGN_WAIT_CONFIRM.id, ALLOT_BACKING.id, "拒绝电子签章申请"),
REPAIR_SEND_14(124, REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, "申请电子签章"),
REPAIR_SEND_15(125,REPAIR.id, REPAIR_SEND_DRAFT.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, "申请电子签章"),
REPAIR_SEND_16(126,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_DRAFT.id, "拒绝电子签章申请"),
REPAIR_SEND_17(127,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_WAIT_SIGN.id, "同意电子签章申请"),
REPAIR_SEND_18(128,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_RECEIVE.id, "盖电子签章并出库"),
REPAIR_SEND_19(129,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, END.id, "盖电子签章并入库"),
REPAIR_SEND_20(130,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_UPLOAD_FILE.id, "盖电子签章并入库"),
REPAIR_SEND_21(131,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, WAIT_RECEIVE.id, "拒绝电子签章申请"),
REPAIR_BACK_14(132, REPAIR.id, ORIGIN_STATUS.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, "申请电子签章"),
REPAIR_BACK_16(134,REPAIR.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, REPAIR_BACK_DRAFT.id, "拒绝电子签章申请"),
REPAIR_BACK_17(135,REPAIR.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, REPAIR_BACK_WAIT_SIGN.id, "同意电子签章申请"),
REPAIR_BACK_18(136,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, WAIT_BACK_RECEIVE.id, "盖电子签章并出库"),
REPAIR_BACK_19(137,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, END.id, "盖电子签章并入库"),
REPAIR_BACK_20(138,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, WAIT_UPLOAD_BACK_FILE.id, "盖电子签章并入库"),
REPAIR_BACK_21(139,REPAIR.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, WAIT_BACK_RECEIVE.id, "拒绝电子签章申请"),
; ;
public Integer id; public Integer id;
......
...@@ -100,6 +100,7 @@ public class DeviceLibraryController { ...@@ -100,6 +100,7 @@ public class DeviceLibraryController {
ids.forEach(detail -> { ids.forEach(detail -> {
DeviceLibrary d = deviceLibraryService.getOne(detail.getDeviceId()); DeviceLibrary d = deviceLibraryService.getOne(detail.getDeviceId());
d.setDetailId(detail.getId()); d.setDetailId(detail.getId());
d.setRemark(detail.getRemark());
d.setConfigName(); d.setConfigName();
deviceLibraries.add(d); deviceLibraries.add(d);
}); });
......
...@@ -2,7 +2,6 @@ package com.tykj.dev.device.library.subject.domin; ...@@ -2,7 +2,6 @@ package com.tykj.dev.device.library.subject.domin;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.device.library.subject.vo.DeviceVo; import com.tykj.dev.device.library.subject.vo.DeviceVo;
import com.tykj.dev.device.library.subject.vo.LifeStatusVo;
import com.tykj.dev.misc.base.BeanHelper; import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.SpringUtils; import com.tykj.dev.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -287,9 +286,9 @@ public class DeviceLibrary { ...@@ -287,9 +286,9 @@ public class DeviceLibrary {
return this; return this;
} }
public LifeStatusVo getLifeStatusVo(){ // public LifeStatusVo getLifeStatusVo(){
return new LifeStatusVo(this.lifeStatus,this.lifeStatusName); // return new LifeStatusVo(this.lifeStatus,this.lifeStatusName);
} // }
// public String getKeyWords(){ // public String getKeyWords(){
// StringBuffer stringBuffer = new StringBuffer(); // StringBuffer stringBuffer = new StringBuffer();
// stringBuffer.append(this.model); // stringBuffer.append(this.model);
......
...@@ -15,4 +15,6 @@ public class Detail { ...@@ -15,4 +15,6 @@ public class Detail {
private Integer id; private Integer id;
private Integer deviceId; private Integer deviceId;
private String remark;
} }
...@@ -241,6 +241,8 @@ public enum StatusEnum { ...@@ -241,6 +241,8 @@ public enum StatusEnum {
WAIT_UPLOAD_SEND_FILE(722, "等待上传送修单"), WAIT_UPLOAD_SEND_FILE(722, "等待上传送修单"),
COUNTRY_REPAIRING(777, "等待接收维修退回装备"), COUNTRY_REPAIRING(777, "等待接收维修退回装备"),
REPAIR_SEND_DRAFT(788,"草稿"), REPAIR_SEND_DRAFT(788,"草稿"),
REPAIR_SEND_SIGN_WAIT_CONFIRM(790,"申请签章待审核"),
REPAIR_SEND_WAIT_SIGN(791,"待盖章出库"),
/** /**
* 维修完成退回状态 * 维修完成退回状态
*/ */
...@@ -249,6 +251,9 @@ public enum StatusEnum { ...@@ -249,6 +251,9 @@ public enum StatusEnum {
REPAIR_BACK_RECEIVE_CONFIRM(802, "接收维修退回装备待审核"), REPAIR_BACK_RECEIVE_CONFIRM(802, "接收维修退回装备待审核"),
WAIT_UPLOAD_BACK_FILE(804, "等待上传回执单"), WAIT_UPLOAD_BACK_FILE(804, "等待上传回执单"),
WAIT_UPLOAD_BACK_SEND_FILE(810, "等待上传领取单"), WAIT_UPLOAD_BACK_SEND_FILE(810, "等待上传领取单"),
REPAIR_BACK_SIGN_WAIT_CONFIRM(820,"申请签章待审核"),
REPAIR_BACK_WAIT_SIGN(821,"待盖章出库"),
REPAIR_BACK_DRAFT(888,"草稿"),
/** /**
* 配发退回状态 * 配发退回状态
......
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.packing.controller; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.packing.controller;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLogUserVo; import com.tykj.dev.device.library.subject.vo.DeviceLogUserVo;
...@@ -31,6 +32,7 @@ import io.swagger.annotations.Api; ...@@ -31,6 +32,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -82,6 +84,9 @@ public class PackingController { ...@@ -82,6 +84,9 @@ public class PackingController {
@Autowired @Autowired
ConfigCache configCache; ConfigCache configCache;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询列装详情", notes = "可以通过这个接口查询列装详情") @ApiOperation(value = "查询列装详情", notes = "可以通过这个接口查询列装详情")
@GetMapping(value = "/detail/{billId}") @GetMapping(value = "/detail/{billId}")
public ResponseEntity selectDetail(@PathVariable("billId") @Min(value = 1,message = "billId不能小于1") int billId) { public ResponseEntity selectDetail(@PathVariable("billId") @Min(value = 1,message = "billId不能小于1") int billId) {
...@@ -150,7 +155,8 @@ public class PackingController { ...@@ -150,7 +155,8 @@ public class PackingController {
MessageBto messageBto = new MessageBto(0,1,message,userIds,0); MessageBto messageBto = new MessageBto(0,1,message,userIds,0);
messageBto.setRecord(packingLibrary1.getId().toString()); messageBto.setRecord(packingLibrary1.getId().toString());
messageService.add(messageBto); messageService.add(messageBto);
return ResponseEntity.ok(packingLibrary1); packingLibraryService.setOrder(packingLibraryService.getInsertList(new SelectPack()));
return ResponseEntity.ok(packingLibraryService.getOne(packingLibrary1.getId()));
} }
@ApiOperation(value = "添加列装装备") @ApiOperation(value = "添加列装装备")
...@@ -210,7 +216,7 @@ public class PackingController { ...@@ -210,7 +216,7 @@ public class PackingController {
packingLog.setRemark("添加列装"); packingLog.setRemark("添加列装");
packingLog.setPackingId(packingLibrary2.getId()); packingLog.setPackingId(packingLibrary2.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
return ResponseEntity.ok("添加成功"); return ResponseEntity.ok(packingLibrary2);
} }
@ApiOperation(value = "删除列装") @ApiOperation(value = "删除列装")
...@@ -237,12 +243,19 @@ public class PackingController { ...@@ -237,12 +243,19 @@ public class PackingController {
@ApiOperation(value = "查询父子结构列装") @ApiOperation(value = "查询父子结构列装")
@PostMapping("/select") @PostMapping("/select")
public ResponseEntity selectPack(@RequestBody SelectPack selectPack){ public ResponseEntity selectPack(@RequestBody SelectPack selectPack){
List<PackingLibrary> resultList;
if (selectPack.getContent()==null&&selectPack.getModel()==null&&selectPack.getName()==null&&selectPack.getSecretLevel()==null&&selectPack.getStatus()==null){ if (selectPack.getContent()==null&&selectPack.getModel()==null&&selectPack.getName()==null&&selectPack.getSecretLevel()==null&&selectPack.getStatus()==null){
return ResultUtil.success(PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), packingLibraryService.setOrder(packingLibraryService.getInsertList(selectPack)), selectPack.getPageable())); resultList = packingLibraryService.setOrder(packingLibraryService.getInsertList(selectPack));
} }
else { else {
return ResultUtil.success(PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), packingLibraryService.getInsertList(selectPack), selectPack.getPageable())); resultList = packingLibraryService.getInsertList(selectPack);
} }
Page<PackingLibrary> packingLibraries = PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), resultList, selectPack.getPageable());
Map<String,Object> map = new HashMap<>();
map.put("pages",packingLibraries);
map.put("models",resultList.stream().map(PackingLibrary::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(PackingLibrary::getName).collect(Collectors.toSet()));
return ResultUtil.success(map);
} }
@ApiOperation(value = "根据型号查询所有装备附件") @ApiOperation(value = "根据型号查询所有装备附件")
...@@ -324,14 +337,14 @@ public class PackingController { ...@@ -324,14 +337,14 @@ public class PackingController {
@ApiOperation(value = "判断序列号区间不存在") @ApiOperation(value = "判断序列号区间不存在")
@PostMapping("/seqsNotExist/{id}/{num}/{seq}") @PostMapping("/seqsNotExist/{id}/{num}/{seq}")
public ResponseEntity seqsNotExist(@PathVariable("id") int id,@PathVariable("num") int num,@PathVariable("seq") String seq){ public ResponseEntity seqsNotExist(@PathVariable("id") int id,@PathVariable("num") int num,@PathVariable("seq") String seq){
List<DeviceLibrary> deviceLibraries = packingLibraryService.getAllDevSeqs(id); List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
List<String> existSeqs = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()); List<String> existSeqs = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seq); List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seq);
if (inputSeqs.size()!=num){ if (inputSeqs.size()>0&&inputSeqs.size()!=num){
return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配"); return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
} }
else { else {
if (!existSeqs.containsAll(inputSeqs)){ if (inputSeqs.isEmpty()||!existSeqs.containsAll(inputSeqs)){
return ResponseEntity.ok("ok"); return ResponseEntity.ok("ok");
} }
else { else {
...@@ -386,7 +399,8 @@ public class PackingController { ...@@ -386,7 +399,8 @@ public class PackingController {
return ResponseEntity.ok(map); return ResponseEntity.ok(map);
} }
BeanUtils.copyProperties(packingModelEdit,packingLibrary); BeanUtils.copyProperties(packingModelEdit,packingLibrary);
if (packingModelEdit.getModel()!=null){ if (packingModelEdit.getModel()!=null&&!packingModelEdit.getModel().equals(packingLibrary.getModel())){
packingLibrary.setModel(packingModelEdit.getModel());
packingLibrary.setName(packingModelEdit.getModel()); packingLibrary.setName(packingModelEdit.getModel());
packingLibraryService.changeAllModel(packingLibrary.getId(),packingModelEdit.getModel()); packingLibraryService.changeAllModel(packingLibrary.getId(),packingModelEdit.getModel());
} }
...@@ -455,6 +469,14 @@ public class PackingController { ...@@ -455,6 +469,14 @@ public class PackingController {
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setType(packingLibraryUpdateVo.getType()); packingLibrary.setType(packingLibraryUpdateVo.getType());
} }
if (packingLibraryUpdateVo.getNature()!=null&&!packingLibraryUpdateVo.getNature().equals(packingLibrary.getNature())){
//添加列装日志
PackingLog packingLog = new PackingLog();
packingLog.setRemark("将列装性质从"+configCache.getNatureMap().get(packingLibrary.getNature())+"改为"+configCache.getNatureMap().get(packingLibraryUpdateVo.getNature()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
packingLibrary.setNature(packingLibraryUpdateVo.getNature());
}
if (packingLibraryUpdateVo.getStyle()!=null&&!packingLibraryUpdateVo.getStyle().equals(packingLibrary.getStyle())){ if (packingLibraryUpdateVo.getStyle()!=null&&!packingLibraryUpdateVo.getStyle().equals(packingLibrary.getStyle())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
......
...@@ -22,7 +22,10 @@ import org.springframework.web.bind.annotation.*; ...@@ -22,7 +22,10 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -70,8 +73,13 @@ public class PackingLibraryController { ...@@ -70,8 +73,13 @@ public class PackingLibraryController {
@ApiOperation(value = "列装库退装分页查询", notes = "可以通过这个接口进行列装查询") @ApiOperation(value = "列装库退装分页查询", notes = "可以通过这个接口进行列装查询")
@PostMapping("/retired/summary") @PostMapping("/retired/summary")
public ResponseEntity getInvalidPage(@RequestBody PackingLibrarySelectVo packingLibrarySelectVo) { public ResponseEntity getInvalidPage(@RequestBody PackingLibrarySelectVo packingLibrarySelectVo) {
Page<PackingLibrary> packingLibraryEntityPage = PageUtil.getPerPage(packingLibrarySelectVo.getPage(),packingLibrarySelectVo.getSize(),packingLibraryService.getInvalidPage(packingLibrarySelectVo, packingLibrarySelectVo.getPageable()),packingLibrarySelectVo.getPageable()); List<PackingLibrary> resultList = packingLibraryService.getInvalidPage(packingLibrarySelectVo, packingLibrarySelectVo.getPageable());
return ResultUtil.success(packingLibraryEntityPage); Page<PackingLibrary> packingLibraries = PageUtil.getPerPage(packingLibrarySelectVo.getPage(),packingLibrarySelectVo.getSize(),resultList,packingLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
map.put("pages",packingLibraries);
map.put("models",resultList.stream().map(PackingLibrary::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(PackingLibrary::getName).collect(Collectors.toSet()));
return ResultUtil.success(map);
} }
@ApiOperation(value = "列装库列表查询", notes = "可以通过这个接口进行列装查询") @ApiOperation(value = "列装库列表查询", notes = "可以通过这个接口进行列装查询")
......
...@@ -133,7 +133,7 @@ public class RepairBillSelectController { ...@@ -133,7 +133,7 @@ public class RepairBillSelectController {
@ApiOperation(value = "查询领取单", notes = "可以通过这个接口查询领取单") @ApiOperation(value = "查询领取单", notes = "可以通过这个接口查询领取单")
@PostMapping(value = "/archives/repairBack/summary") @PostMapping(value = "/archives/repairBack/summary")
public ResponseEntity selectRepairBackBill(@RequestBody RepairBillSelectVo repairBillSelectVo) { public ResponseEntity selectRepairBackBill(@RequestBody RepairBillSelectVo repairBillSelectVo) {
Page<RepairBackBill> page = repairBackBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable()); // Page<RepairBackBill> page = repairBackBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable());
return ResultUtil.success(repairBackBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable())); return ResultUtil.success(repairBackBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable()));
} }
......
...@@ -129,10 +129,29 @@ public class RepairController { ...@@ -129,10 +129,29 @@ public class RepairController {
@Autowired @Autowired
private DeviceLibraryDao deviceLibraryDao; private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "判断维修装备是否同一个送修单位", notes = "可以通过这个接口判断维修装备是否同一个送修单位")
@PostMapping(value = "/judge")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity judge(@RequestBody List<Integer> ids) {
Set<String> sendUnits = new HashSet<>();
ids.forEach(integer -> {
RepairDetail repairDetail = deviceRepairDetailService.getOne(integer);
RepairBill repairBill = deviceRepairBillService.getOne(repairDetail.getDeviceRepairBillId());
sendUnits.add(repairBill.getSendUnit());
});
if (sendUnits.size()==1){
return ResponseEntity.ok(sendUnits.iterator().next());
}
else {
return ResponseEntity.ok("error");
}
}
@ApiOperation(value = "保存维修操作", notes = "可以通过这个接口保存维修操作") @ApiOperation(value = "保存维修操作", notes = "可以通过这个接口保存维修操作")
@PostMapping(value = "/saveRepairBill") @PostMapping(value = "/saveRepairBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity saveRepairBill(@RequestBody RepairBillSaveVo repairBillSaveVo) { public ResponseEntity saveRepairBill(@RequestBody RepairBillSaveVo repairBillSaveVo) {
deviceLibraryService.isInStockOrRepairing(StringSplitUtil.split(repairBillSaveVo.getRepairDeviceCheckDetail()));
//第一次保存 //第一次保存
if (repairBillSaveVo.getTaskId()==null){ if (repairBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId(); Integer userId = userUtils.getCurrentUserId();
...@@ -244,23 +263,35 @@ public class RepairController { ...@@ -244,23 +263,35 @@ public class RepairController {
} }
}); });
} }
Integer userId = userUtils.getCurrentUserId();
Integer level = userUtils.getCurrentUnitLevel(); Integer level = userUtils.getCurrentUnitLevel();
//添加维修单和送修单 //添加维修单和送修单
RepairBill repairBill = new RepairBill(); RepairBill repairBill;
RepairSendBill deviceRepairSendBillEntity = new RepairSendBill(); RepairSendBill deviceRepairSendBillEntity;
Integer userId = userUtils.getCurrentUserId(); if (repairBillSaveVo.getTaskId()!=null){
BeanUtils.copyProperties(repairBillSaveVo, repairBill); repairBill = deviceRepairBillService.getOne(taskService.get(repairBillSaveVo.getTaskId()).getBillId());
BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity); deviceRepairSendBillEntity = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill.getId());
if (repairBillSaveVo.getScriptSaveVos()!=null){ MapperUtils.copyNoNullProperties(repairBillSaveVo,repairBill);
deviceRepairSendBillEntity.setScriptJson(JacksonUtil.toJSon(repairBillSaveVo.getScriptSaveVos())); MapperUtils.copyNoNullProperties(repairBillSaveVo,deviceRepairSendBillEntity);
}
else {
RepairBill repairBill1 = new RepairBill();
RepairSendBill deviceRepairSendBillEntity1 = new RepairSendBill();
BeanUtils.copyProperties(repairBillSaveVo, repairBill1);
BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity1);
if (repairBillSaveVo.getScriptSaveVos() != null) {
deviceRepairSendBillEntity1.setScriptJson(JacksonUtil.toJSon(repairBillSaveVo.getScriptSaveVos()));
} }
//如果当前为省向国家发起的 //如果当前为省向国家发起的
if (level == 1) { if (level == 1) {
repairBill.setRepairStatus(4); repairBill1.setRepairStatus(4);
deviceRepairSendBillEntity.setRepairStatus(5); deviceRepairSendBillEntity1.setRepairStatus(5);
} else { } else {
repairBill.setRepairStatus(2); repairBill1.setRepairStatus(2);
deviceRepairSendBillEntity.setRepairStatus(2); deviceRepairSendBillEntity1.setRepairStatus(2);
}
repairBill = deviceRepairBillService.addEntity(repairBill1);
deviceRepairSendBillEntity = deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity1);
} }
if (repairBillSaveVo.getRepairUseraId() != null) { if (repairBillSaveVo.getRepairUseraId() != null) {
repairBill.setRepairUserA(userPublicService.getOne(repairBillSaveVo.getRepairUseraId()).getName()); repairBill.setRepairUserA(userPublicService.getOne(repairBillSaveVo.getRepairUseraId()).getName());
...@@ -273,7 +304,7 @@ public class RepairController { ...@@ -273,7 +304,7 @@ public class RepairController {
repairBill.setLeftSignatureId(repairBillSaveVo.getLeftSignatureId()); repairBill.setLeftSignatureId(repairBillSaveVo.getLeftSignatureId());
} }
repairBill.setRightSignatureId(signId2.toString()); repairBill.setRightSignatureId(signId2.toString());
RepairBill repairBill1 = deviceRepairBillService.addEntity(repairBill); RepairBill repairBill1 = deviceRepairBillService.update(repairBill);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
String s1 = "NO:第" + calendar.get(Calendar.YEAR) + "WX" + repairBill1.getId() + "号"; String s1 = "NO:第" + calendar.get(Calendar.YEAR) + "WX" + repairBill1.getId() + "号";
repairBill1.setDocNum(s1); repairBill1.setDocNum(s1);
...@@ -283,14 +314,8 @@ public class RepairController { ...@@ -283,14 +314,8 @@ public class RepairController {
userIds.add(userId); userIds.add(userId);
userIds.add(0); userIds.add(0);
//存业务日志 //存业务日志
deviceRepairSendBillEntity.setRepairStatus(0);
deviceRepairSendBillEntity.setSendTime(new Date()); deviceRepairSendBillEntity.setSendTime(new Date());
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
List<RepairDetail> repairDetails = new ArrayList<>();
if (repairBillSaveVo.getTaskId()!=null) {
TaskBto parentTask = taskService.get(repairBillSaveVo.getTaskId());
repairDetails = repairDetailDao.findByDeviceRepairBillId(parentTask.getBillId());
}
//存维修详情单 //存维修详情单
for (DeviceDetailVo d : repairBillSaveVo.getDeviceList()) { for (DeviceDetailVo d : repairBillSaveVo.getDeviceList()) {
RepairDetail oldRepairDetail = deviceRepairDetailService.getOne(d.getId()); RepairDetail oldRepairDetail = deviceRepairDetailService.getOne(d.getId());
...@@ -318,16 +343,7 @@ public class RepairController { ...@@ -318,16 +343,7 @@ public class RepairController {
repairDetail.setModel(deviceLibraryEntity.getModel()); repairDetail.setModel(deviceLibraryEntity.getModel());
repairDetail.setName(deviceLibraryEntity.getName()); repairDetail.setName(deviceLibraryEntity.getName());
repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit()); repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit());
if (d.getRemark() == null) {
for (RepairDetail r : repairDetails) {
if (r.getDeviceId().equals(d.getDeviceId())) {
repairDetail.setRemark(r.getRemark());
break;
}
}
} else {
repairDetail.setRemark(d.getRemark()); repairDetail.setRemark(d.getRemark());
}
repairDetail.setRepairStatus(0); repairDetail.setRepairStatus(0);
repairDetail.setRfidSurfaceId(deviceLibraryEntity.getRfidSurfaceId()); repairDetail.setRfidSurfaceId(deviceLibraryEntity.getRfidSurfaceId());
repairDetail.setSeqNumber(deviceLibraryEntity.getSeqNumber()); repairDetail.setSeqNumber(deviceLibraryEntity.getSeqNumber());
...@@ -353,7 +369,7 @@ public class RepairController { ...@@ -353,7 +369,7 @@ public class RepairController {
deviceRepairSendBillEntity.setDeviceRepairBillId(repairBill1.getId()); deviceRepairSendBillEntity.setDeviceRepairBillId(repairBill1.getId());
deviceRepairSendBillEntity.setAgent(repairBillSaveVo.getAgent()); deviceRepairSendBillEntity.setAgent(repairBillSaveVo.getAgent());
deviceRepairSendBillEntity.setTitle("维修业务"); deviceRepairSendBillEntity.setTitle("维修业务");
RepairSendBill repairSendBill = deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity); RepairSendBill repairSendBill = deviceRepairSendBillService.update(deviceRepairSendBillEntity);
Integer ownUnit; Integer ownUnit;
TaskBto saveEntity; TaskBto saveEntity;
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId()); List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
...@@ -371,31 +387,12 @@ public class RepairController { ...@@ -371,31 +387,12 @@ public class RepairController {
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_SEND_FILE.id, "维修业务", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 5, userPublicService.findUnitIdByName(repairSendBill.getSendUnit()), 0, null, Collections.singletonList(0)); TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_SEND_FILE.id, "维修业务", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 5, userPublicService.findUnitIdByName(repairSendBill.getSendUnit()), 0, null, Collections.singletonList(0));
taskService.start(taskBto2); taskService.start(taskBto2);
} }
if (repairBillSaveVo.getTaskId()!=null) {
TaskBto parentTask = taskService.get(repairBillSaveVo.getTaskId());
saveEntity.setParentTaskId(parentTask.getId());
saveEntity.setNodeIdDetail(parentTask.getNodeIdDetail() + repairBillSaveVo.getTaskId() + ".");
taskService.update(saveEntity);
}
String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail(); String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail();
List<Integer> idList = StringSplitUtil.split(deviceIdDetail); List<Integer> idList = StringSplitUtil.split(deviceIdDetail);
//如果当前为省,改变装备的所在为中办 //如果当前为省,改变装备的所在为中办
if (level == 1) { if (level == 1) {
//获取当前业务维修详情 //获取当前业务维修详情
List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId()); List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId());
if (repairBillSaveVo.getTaskId()!=null) {
TaskBto parentTask = taskService.get(repairBillSaveVo.getTaskId());
//获取所有父业务id
List<Integer> fathers = StringSplitUtil.taskIdSplit(parentTask.getNodeIdDetail()+ repairBillSaveVo.getTaskId() + ".");
fathers.forEach(integer -> {
//筛选出父业务相同装备的维修详情
List<RepairDetail> repairDetails2 = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
.filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
.collect(Collectors.toList());
//添加维修详情
repairDetailEntities.addAll(repairDetails2);
});
}
//改变维修详情装备所在单位为中办,状态为维修中 //改变维修详情装备所在单位为中办,状态为维修中
repairDetailEntities.forEach(repairDetail -> { repairDetailEntities.forEach(repairDetail -> {
repairDetail.setLocationUnit(repairBillSaveVo.getReceiveUnit()); repairDetail.setLocationUnit(repairBillSaveVo.getReceiveUnit());
...@@ -544,6 +541,59 @@ public class RepairController { ...@@ -544,6 +541,59 @@ public class RepairController {
return ResultUtil.success("维修装备接收入库"); return ResultUtil.success("维修装备接收入库");
} }
@ApiOperation(value = "送修申请电子签章", notes = "可以通过这个接口申请电子签章")
@PostMapping(value = "/applySign/{taskId}/{userId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity applySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) {
//推动任务
TaskBto taskBto = taskService.get(taskId);
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
if (repairBill.getRepairStatus()!=0){
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill.getId());
repairSendBill.setRepairUseraId(userUtils.getCurrentUserId());
repairBill.setRepairUserA(userUtils.getCurrentName());
deviceRepairBillService.update(repairBill);
deviceRepairSendBillService.update(repairSendBill);
}
taskService.moveToSpecial(taskBto,StatusEnum.REPAIR_SEND_SIGN_WAIT_CONFIRM,userId);
myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功");
}
@ApiOperation(value = "送修申请电子签章审核", notes = "可以通过这个接口申请电子签章审核")
@PostMapping(value = "/applySignConfirm/{taskId}/{status}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity applySignConfirm(@PathVariable("taskId") int taskId,@PathVariable("status") int status) {
//推动任务
TaskBto taskBto = taskService.get(taskId);
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill.getId());
if (status==1){
taskService.moveToSpecial(taskBto,StatusEnum.REPAIR_SEND_WAIT_SIGN);
if (repairBill.getRepairStatus()==0) {
repairSendBill.setStartUserbId(userUtils.getCurrentUserId());
repairSendBill.setAgent(userUtils.getCurrentName());
repairBill.setStartUserB(repairSendBill.getAgent());
}
else {
repairSendBill.setRepairUserbId(userUtils.getCurrentUserId());
repairBill.setRepairUserB(userUtils.getCurrentName());
}
deviceRepairBillService.update(repairBill);
deviceRepairSendBillService.update(repairSendBill);
}
else {
if (repairBill.getRepairStatus()==0) {
taskService.moveToSpecial(taskBto, StatusEnum.REPAIR_SEND_DRAFT, taskBto.getCreateUserId());
}
else {
taskService.moveToSpecial(taskBto, StatusEnum.WAIT_RECEIVE, repairSendBill.getRepairUseraId());
}
}
myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功");
}
@ApiOperation(value = "上传送修单", notes = "可以通过这个接口上传送修单") @ApiOperation(value = "上传送修单", notes = "可以通过这个接口上传送修单")
@PostMapping(value = "/uploadRepairBill") @PostMapping(value = "/uploadRepairBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -610,6 +660,41 @@ public class RepairController { ...@@ -610,6 +660,41 @@ public class RepairController {
return ResponseEntity.ok("上传成功"); return ResponseEntity.ok("上传成功");
} }
@ApiOperation(value = "保存维修退回操作", notes = "可以通过这个接口保存维修退回操作")
@PostMapping(value = "/saveRepairBackBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity saveRepairBackBill(@RequestBody RepairBackBillSaveVo repairBackBillSaveVo) {
//第一次保存
if (repairBackBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId();
//保存入库单
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
//添加维修单和送修单
RepairBackBill repairBackBill = new RepairBackBill();
BeanUtils.copyProperties(repairBackBillSaveVo, repairBackBill);
repairBackBill.setBackStatus(0);
if (repairBackBillSaveVo.getScriptSaveVos()!=null){
repairBackBill.setScriptJson(JacksonUtil.toJSon(repairBackBillSaveVo.getScriptSaveVos()));
}
RepairBackBill repairBackBill1 = deviceRepairBackBillService.save(repairBackBill);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_BACK_DRAFT.id, "维修退回", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id,userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto);
Integer id = taskBto1.getId();
myWebSocket.sendMessage1();
return ResponseEntity.ok("保存成功"+id);
}
else {
//更新账单
TaskBto taskBto = taskService.get(repairBackBillSaveVo.getTaskId());
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
MapperUtils.copyNoNullProperties(repairBackBillSaveVo,repairBackBill);
deviceRepairBackBillService.update(repairBackBill);
return ResponseEntity.ok("更新成功"+taskBto.getId());
}
}
@ApiOperation(value = "修好装备出库", notes = "可以通过这个接口修好装备出库") @ApiOperation(value = "修好装备出库", notes = "可以通过这个接口修好装备出库")
@PostMapping(value = "/back") @PostMapping(value = "/back")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -877,6 +962,52 @@ public class RepairController { ...@@ -877,6 +962,52 @@ public class RepairController {
return ResultUtil.success("维修成功退回装备接收入库"); return ResultUtil.success("维修成功退回装备接收入库");
} }
@ApiOperation(value = "维修退回申请电子签章", notes = "可以通过这个接口申请电子签章")
@PostMapping(value = "/backApplySign/{taskId}/{userId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity backApplySign(@PathVariable("taskId") int taskId,@PathVariable("userId") int userId) {
//推动任务
TaskBto taskBto = taskService.get(taskId);
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
if (repairBackBill.getBackStatus()!=0){
repairBackBill.setReceiveUseraId(userUtils.getCurrentUserId());
deviceRepairBackBillService.update(repairBackBill);
}
taskService.moveToSpecial(taskBto,StatusEnum.REPAIR_BACK_SIGN_WAIT_CONFIRM,userId);
myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功");
}
@ApiOperation(value = "维修退回申请电子签章审核", notes = "可以通过这个接口申请电子签章审核")
@PostMapping(value = "/backApplySignConfirm/{taskId}/{status}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity backApplySignConfirm(@PathVariable("taskId") int taskId,@PathVariable("status") int status) {
//推动任务
TaskBto taskBto = taskService.get(taskId);
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
if (status==1){
taskService.moveToSpecial(taskBto,StatusEnum.REPAIR_BACK_WAIT_SIGN);
if (repairBackBill.getBackStatus()==0) {
repairBackBill.setStartUserbId(userUtils.getCurrentUserId());
repairBackBill.setAgent(userUtils.getCurrentName());
}
else {
repairBackBill.setReceiveUserbId(userUtils.getCurrentUserId());
}
deviceRepairBackBillService.update(repairBackBill);
}
else {
if (repairBackBill.getBackStatus()==0) {
taskService.moveToSpecial(taskBto, StatusEnum.REPAIR_BACK_DRAFT, taskBto.getCreateUserId());
}
else {
taskService.moveToSpecial(taskBto, StatusEnum.WAIT_BACK_RECEIVE, repairBackBill.getReceiveUseraId());
}
}
myWebSocket.sendMessage1();
return ResponseEntity.ok("申请成功");
}
@ApiOperation(value = "上传回执单", notes = "可以通过这个接口上传回执单") @ApiOperation(value = "上传回执单", notes = "可以通过这个接口上传回执单")
@PostMapping(value = "/uploadRepairBackBill") @PostMapping(value = "/uploadRepairBackBill")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
......
...@@ -149,7 +149,7 @@ public class RepairBackBill { ...@@ -149,7 +149,7 @@ public class RepairBackBill {
/** /**
* 退回状态(1:维修成功出库待审核,2:维修成功出库审核失败,3:重新配发出库待审核,4:重新配发出库审核失败,5:退回中,5:送修方接收待审核,6:送修方接收审核失败,7:维修退回完成) * 退回状态(1:维修成功出库待审核,2:维修成功出库审核失败,3:重新配发出库待审核,4:重新配发出库审核失败,5:退回中,5:送修方接收待审核,6:送修方接收审核失败,7:维修退回完成)
*/ */
@ApiModelProperty(value = "退回状态(1:维修成功出库待审核,2:维修成功出库审核失败,3:重新配发出库待审核,4:重新配发出库审核失败,5:退回中,5:送修方接收待审核,6:送修方接收审核失败,7:维修退回完成)") @ApiModelProperty(value = "退回状态(0:草稿,2:维修成功出库审核失败,3:重新配发出库待审核,4:重新配发出库审核失败,5:退回中,5:送修方接收待审核,6:送修方接收审核失败,7:维修退回完成)")
private Integer backStatus; private Integer backStatus;
/** /**
* 维修完成出库详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的不匹配 * 维修完成出库详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的不匹配
......
package com.tykj.dev.device.selfcheck.controller; package com.tykj.dev.device.selfcheck.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.service.SystemVariableService; import com.tykj.dev.config.service.SystemVariableService;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
...@@ -23,6 +24,7 @@ import com.tykj.dev.device.user.util.UserUtils; ...@@ -23,6 +24,7 @@ import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum; import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.TaskDisposeUtil; import com.tykj.dev.misc.utils.TaskDisposeUtil;
import com.tykj.dev.socket.MyWebSocket; import com.tykj.dev.socket.MyWebSocket;
...@@ -301,6 +303,9 @@ public class SelfCheckController { ...@@ -301,6 +303,9 @@ public class SelfCheckController {
selfExaminationBillEntity.setCheckedCount(selfCheckSaveVo.getCheckedCount()); selfExaminationBillEntity.setCheckedCount(selfCheckSaveVo.getCheckedCount());
selfExaminationBillEntity.setCheckingCount(selfCheckSaveVo.getCheckingCount()); selfExaminationBillEntity.setCheckingCount(selfCheckSaveVo.getCheckingCount());
selfExaminationBillEntity.setUserbId(selfCheckSaveVo.getUserbId()); selfExaminationBillEntity.setUserbId(selfCheckSaveVo.getUserbId());
if (selfCheckSaveVo.getUnStockDevices()!=null&&selfCheckSaveVo.getUnStockDevices().size()>0){
selfExaminationBillEntity.setUnStockDetail(JacksonUtil.toJSon(selfCheckSaveVo.getUnStockDevices()));
}
} }
else { else {
selfExaminationBillEntity = selfCheckSaveVo.toDo(); selfExaminationBillEntity = selfCheckSaveVo.toDo();
...@@ -548,6 +553,10 @@ public class SelfCheckController { ...@@ -548,6 +553,10 @@ public class SelfCheckController {
list.add(libraryEntities1); list.add(libraryEntities1);
//添加业务日志 //添加业务日志
list.add(taskLogService.getByTaskId(taskBto.getId())); list.add(taskLogService.getByTaskId(taskBto.getId()));
if (selfExaminationBillEntity.getUnStockDetail()!=null){
list.add(JacksonUtil.readValue(selfExaminationBillEntity.getUnStockDetail(), new TypeReference<List<DeviceLibrary>>() {
}));
}
return ResultUtil.success(list); return ResultUtil.success(list);
} }
} }
...@@ -88,6 +88,9 @@ public class SelfCheckBill { ...@@ -88,6 +88,9 @@ public class SelfCheckBill {
@Column(name = "check_detail",columnDefinition = "TEXT") @Column(name = "check_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增") @ApiModelProperty(value = "自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增")
private String checkDetail; private String checkDetail;
@Column(name = "un_stock_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "非在库装备转JSon")
private String unStockDetail;
/** /**
* 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检) * 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)
*/ */
......
...@@ -2,7 +2,9 @@ package com.tykj.dev.device.selfcheck.subject.vo; ...@@ -2,7 +2,9 @@ package com.tykj.dev.device.selfcheck.subject.vo;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.misc.utils.JacksonUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -59,6 +61,9 @@ public class SelfCheckSaveVo { ...@@ -59,6 +61,9 @@ public class SelfCheckSaveVo {
@ApiModelProperty(value = "检查附件名") @ApiModelProperty(value = "检查附件名")
private List<FileRet> checkFiles; private List<FileRet> checkFiles;
@ApiModelProperty(value = "非在库装备集合")
private List<DeviceLibrary> unStockDevices;
public SelfCheckBill toDo() { public SelfCheckBill toDo() {
SelfCheckBill selfExaminationBillEntity = new SelfCheckBill(); SelfCheckBill selfExaminationBillEntity = new SelfCheckBill();
BeanUtils.copyProperties(this, selfExaminationBillEntity); BeanUtils.copyProperties(this, selfExaminationBillEntity);
...@@ -67,6 +72,9 @@ public class SelfCheckSaveVo { ...@@ -67,6 +72,9 @@ public class SelfCheckSaveVo {
if(this.checkFiles!=null&&this.checkFiles.size()>0){ if(this.checkFiles!=null&&this.checkFiles.size()>0){
selfExaminationBillEntity.setCheckFiles(FilesUtil.stringFileToList(this.checkFiles)); selfExaminationBillEntity.setCheckFiles(FilesUtil.stringFileToList(this.checkFiles));
} }
if (this.unStockDevices!=null&&this.unStockDevices.size()>0){
selfExaminationBillEntity.setUnStockDetail(JacksonUtil.toJSon(this.unStockDevices));
}
return selfExaminationBillEntity; return selfExaminationBillEntity;
} }
} }
...@@ -154,8 +154,10 @@ public class BigScreenServiceImpl implements BigScreenService { ...@@ -154,8 +154,10 @@ public class BigScreenServiceImpl implements BigScreenService {
.map(repairBill -> repairSendBillDao.findByDeviceRepairBillId(repairBill.getId())) .map(repairBill -> repairSendBillDao.findByDeviceRepairBillId(repairBill.getId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
for (RepairSendBill r:repairSendBills) { for (RepairSendBill r:repairSendBills) {
if (r.getRepairDeviceCheckDetail()!=null&&r.getRepairStatus()>0) {
repairDeviceIds.addAll(StringSplitUtil.split(r.getRepairDeviceCheckDetail())); repairDeviceIds.addAll(StringSplitUtil.split(r.getRepairDeviceCheckDetail()));
} }
}
double num = repairDeviceIds.size(); double num = repairDeviceIds.size();
double faultPercent = num/centerNum.getDeviceCount()*100; double faultPercent = num/centerNum.getDeviceCount()*100;
centerNum.setFaultPercent(faultPercent); centerNum.setFaultPercent(faultPercent);
......
...@@ -324,6 +324,10 @@ public class TaskSelectController { ...@@ -324,6 +324,10 @@ public class TaskSelectController {
} }
} }
list.add(libraryEntities1); list.add(libraryEntities1);
if (selfExaminationBillEntity.getUnStockDetail()!=null){
list.add(JacksonUtil.readValue(selfExaminationBillEntity.getUnStockDetail(), new TypeReference<List<DeviceLibrary>>() {
}));
}
return ResponseEntity.ok(new ResultObj(list, "查询成功")); return ResponseEntity.ok(new ResultObj(list, "查询成功"));
case 19: case 19:
MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillService.getOne(billId); MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillService.getOne(billId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论