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

更新

上级 6d21eef9
......@@ -41,10 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -176,7 +173,7 @@ public class AllotBillController {
taskBto.setOwnUnit(userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()));
saveEntity = taskService.moveToSpecial(taskBto, StatusEnum.ALLOTING, 0);
}
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id, "配发业务", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 0, null, userIds);
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id, "配发业务", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 0, null, Collections.singletonList(0));
taskService.start(taskBto2);
}
else {
......@@ -310,7 +307,12 @@ public class AllotBillController {
taskService.addInvolveUser(taskBto, userId);
// //推至下一阶段
// taskService.update(taskService.moveToNext(taskBto, allotReceiveVo.getReceiveUserbId()));
taskService.moveToEnd(taskBto);
if (allotReceiveVo.getStatus()==0) {
taskService.moveToEnd(taskBto);
}
else {
taskService.moveToNext(taskBto);
}
//生成上级上传单据任务
List<Integer> userIds = new ArrayList();
userIds.add(0);
......@@ -526,12 +528,38 @@ public class AllotBillController {
return ResponseEntity.ok(allotBillEntity);
}
@ApiOperation(value = "上传配发单", notes = "上传配发单")
@ApiOperation(value = "上传接收方配发单", notes = "可以通过这个接口上传送修单")
@PostMapping(value = "/uploadAllotBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadAllotBill(@RequestBody @Validated FileUploadVo fileUploadVo){
TaskBto taskBto = taskService.get(fileUploadVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.WAIT_UPLOAD_ALLOT_RECEIVE_FILE);
Integer userId = userUtils.getCurrentUserId();
taskService.addInvolveUser(taskBto,userId);
taskService.moveToEnd(taskBto);
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
allotBill.setBillFileName(fileUploadVo.getBillFileName());
allotBill.setBillFileUrl(fileUploadVo.getBillFileUrl());
allotBillService.update(allotBill);
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("配发单", allotBill.getBillFileName(), allotBill.getBillFileUrl()));
//添加装备日志
List<Integer> deviceIds = StringSplitUtil.split(allotBill.getAllotCheckDetail());
deviceIds.forEach(integer -> {
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传配发单据", fileVoList);
deviceLogService.addLog(deviceLogDto);
});
return ResponseEntity.ok("上传成功");
}
@ApiOperation(value = "上传发送方配发单", notes = "上传配发单")
@PostMapping(value = "/uploadFile")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadFile(@RequestBody @Validated com.tykj.dev.device.allot.subject.vo.FileVo fileVo){
//获取task
TaskBto taskBto = taskService.get(fileVo.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
List<StatusEnum> statusEnums = new ArrayList<>();
statusEnums.add(StatusEnum.WAIT_UPLOAD_CROSS_FILE);
statusEnums.add(StatusEnum.WAIT_UPLOAD_ALLOT_FILE);
......
......@@ -5,6 +5,8 @@ import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.vo.AllotBackReceiveVo;
import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo;
import com.tykj.dev.device.allot.subject.vo.FileUploadVo;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
......@@ -39,10 +41,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -118,6 +117,8 @@ public class BackController {
TaskBto saveEntity;
TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_BACKING.id, "退回业务", null, ".", billId, 22, userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()), 1, null, userIds);
saveEntity = taskService.start(taskBto);
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE_2.id, "退回业务", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 22, userPublicService.findUnitIdByName(allotBackBill1.getSendUnit()), 0, null, Collections.singletonList(0));
taskService.start(taskBto2);
List<FileVo> fileVoList = new ArrayList<>();
// fileVoList.add(new FileVo("出库确认单", allotBillEntity.getFileName(), allotBillEntity.getFileUrl()));
//存装备日志
......@@ -171,7 +172,12 @@ public class BackController {
taskService.addInvolveUser(taskBto, userId);
// //推至下一阶段
// taskService.update(taskService.moveToNext(taskBto, allotReceiveVo.getReceiveUserbId()));
taskService.moveToEnd(taskBto);
if (allotBackReceiveVo.getStatus()==0) {
taskService.moveToEnd(taskBto);
}
else {
taskService.moveToNext(taskBto);
}
//分隔装备id信息
String deviceIdDetail = allotBackReceiveVo.getReceiveCheckDetail();
String[] strings = deviceIdDetail.split("x");
......@@ -216,4 +222,62 @@ public class BackController {
myWebSocket.sendMessage1();
return ResponseEntity.ok("退回接收入库");
}
@ApiOperation(value = "上传接收方退回单", notes = "可以通过这个接口上传送修单")
@PostMapping(value = "/uploadAllotBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadAllotBill(@RequestBody @Validated FileUploadVo fileUploadVo){
TaskBto taskBto = taskService.get(fileUploadVo.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.WAIT_UPLOAD_ALLOT_BACK_FILE);
Integer userId = userUtils.getCurrentUserId();
taskService.addInvolveUser(taskBto,userId);
taskService.moveToEnd(taskBto);
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
allotBackBill.setBillFileName(fileUploadVo.getBillFileName());
allotBackBill.setBillFileUrl(fileUploadVo.getBillFileUrl());
allotBackBillService.update(allotBackBill);
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("退回单", allotBackBill.getBillFileName(), allotBackBill.getBillFileUrl()));
//添加装备日志
List<Integer> deviceIds = StringSplitUtil.split(allotBackBill.getBackCheckDetail());
deviceIds.forEach(integer -> {
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传退回单据", fileVoList);
deviceLogService.addLog(deviceLogDto);
});
return ResponseEntity.ok("上传成功");
}
@ApiOperation(value = "上传发送方退回单", notes = "上传退回单")
@PostMapping(value = "/uploadFile")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadFile(@RequestBody @Validated com.tykj.dev.device.allot.subject.vo.FileVo fileVo){
//获取task
TaskBto taskBto = taskService.get(fileVo.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
List<StatusEnum> statusEnums = new ArrayList<>();
statusEnums.add(StatusEnum.WAIT_UPLOAD_BACK_FILE_2);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),statusEnums);
//不上传单据
if (fileVo.getStatus()==0){
taskService.moveToArchive(taskBto);
}
else {
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
//保存账单
allotBackBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getAllotFiles()));
allotBackBillService.update(allotBackBill);
List<Integer> ids = StringSplitUtil.split(allotBackBill.getBackCheckDetail());
//业务完结
taskService.moveToEnd(taskBto);
//装备日志
List<FileVo> fileVoList = new ArrayList<>();
fileVo.getAllotFiles().forEach(fileRet -> fileVoList.add(new FileVo("退回单", fileRet.getName(), fileRet.getPreviewPath())));
ids.forEach(integer -> {
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传退回单", fileVoList);
deviceLogService.addLog(deviceLogDto);
});
}
return ResponseEntity.ok("OK");
}
}
......@@ -161,4 +161,7 @@ public class AllotBackBill {
@Column(name = "reply_files",columnDefinition = "TEXT")
private String replyFiles;
@Column(name = "send_files",columnDefinition = "TEXT")
private String sendFiles;
}
......@@ -52,5 +52,7 @@ public class AllotBackReceiveVo {
@ApiModelProperty(value = "接收入库检查结果")
private String receiveCheckResult;
@NotNull(message = "status不能为空")
@ApiModelProperty(value = "是否缺失单据(0:否,1:是)")
private Integer status = 0;
}
......@@ -26,11 +26,11 @@ public class AllotReceiveVo {
@ApiModelProperty(value = "任务Id")
private Integer taskId;
@NotNull(message = "billFileName不能为空")
// @NotNull(message = "billFileName不能为空")
@ApiModelProperty(value = "配发单附件名字")
private String billFileName;
@NotNull(message = "billFileUrl不能为空")
// @NotNull(message = "billFileUrl不能为空")
@ApiModelProperty(value = "配发单附件URL")
private String billFileUrl;
......@@ -56,4 +56,8 @@ public class AllotReceiveVo {
@ApiModelProperty(value = "填写生产序列号map")
private Map<Integer,String> map = new HashMap<>();
@NotNull(message = "status不能为空")
@ApiModelProperty(value = "是否缺失单据(0:否,1:是)")
private Integer status = 0;
}
......@@ -96,7 +96,7 @@ public enum LogType {
REPAIR_BACK_2(38,REPAIR_BACK.id, WAIT_BACK_RECEIVE.id, WAIT_UPLOAD_BACK_FILE.id, "维修退回装备接收并发起入库(缺失单据)"),
REPAIR_BACK_3(39,REPAIR_BACK.id, WAIT_UPLOAD_BACK_FILE.id, END.id, "上传回执单据"),
REPAIR_BACK_3(39,REPAIR_BACK.id, WAIT_UPLOAD_BACK_FILE.id, END.id, "上传领取单据"),
REPAIR_BACK_4(40,REPAIR_BACK.id, WAIT_BACK_RECEIVE.id, END.id, "维修退回装备接收并发起入库"),
......@@ -150,13 +150,13 @@ public enum LogType {
CONFIRM_CHECK_EXAM_DETAIL_3(419, CONFIRM_CHECK_DETAIL.id, CHECK_EXAM_DETAIL_1.id, CHECK_EXAM_DETAIL_0.id, "B岗审核失败,跳回A岗人员操作"),
ALLOT_BACK_1(57, ALLOT_BACK.id, ORIGIN_STATUS.id, ALLOT_BACKING.id, "发起配发装备退回"),
ALLOT_BACK_1(57, ALLOT_BACK.id, ORIGIN_STATUS.id, ALLOT_BACKING.id, "发起装备退回"),
ALLOT_BACK_2(58,ALLOT_BACK.id, ALLOT_BACKING.id, END.id, "配发退回装备接收成功"),
ALLOT_BACK_2(58,ALLOT_BACK.id, ALLOT_BACKING.id, END.id, "退回装备接收成功"),
ALLOT_BACK_3(59,ALLOT_BACK.id, ALLOT_BACK_CONFIRM.id, END.id, "配发退回装备接收审核成功"),
ALLOT_BACK_3(59,ALLOT_BACK.id, WAIT_UPLOAD_ALLOT_BACK_FILE.id, END.id, "上传退回单"),
ALLOT_BACK_4(60,ALLOT_BACK.id, ALLOT_BACK_CONFIRM.id, ARCHIVE.id, "配发退回装备接收审核失败"),
ALLOT_BACK_4(60,ALLOT_BACK.id, ALLOT_BACKING.id, WAIT_UPLOAD_ALLOT_BACK_FILE.id, "退回装备接收成功(缺失单据)"),
TRAIN1(61, TRAIN.id, ORIGIN_STATUS.id, TRAIN1000.id, "创建培训成功,等待报名"),
TRAIN2(62, TRAIN.id, TRAIN1000.id, TRAIN1010.id, "报名结束,待培训"),
......@@ -216,7 +216,7 @@ public enum LogType {
ALLOT_9(83, ALLOT.id, ALLOTING.id, END.id, "接收配发装备"),
ALLOT_10(84, ALLOT.id, WAIT_ALLOT.id, ALLOTING.id, "对(%receiveUnit)发起配发"),
ALLOT_11(85, ALLOT.id, ALLOTING.id, ARCHIVE.id, "拒绝接收配发装备"),
ALLOT_BACK_5(86, ALLOT_BACK.id, ALLOT_BACKING.id, END.id, "接收配发退回装备"),
ALLOT_BACK_5(86, ALLOT_BACK.id, WAIT_UPLOAD_BACK_FILE_2.id, END.id, "上传退回单"),
REPAIR_SEND_10(87, REPAIR.id, ORIGIN_STATUS.id, WAIT_UPLOAD_FILE.id, "向(%receiveUnit)发起装备维修"),
REPAIR_BACK_7(88, REPAIR_BACK.id, ORIGIN_STATUS.id, END.id, "维修退回装备接收并发起入库"),
STORAGE_4(89, STORAGE.id, WAIT_STORAGE.id, ARCHIVE.id, "删除入库草稿"),
......@@ -226,6 +226,11 @@ public enum LogType {
SELF_CHECK_6(93,SELF_CHECK.id, WAIT_SELF_CHECK.id, END.id, "周期自查"),
APPLY_4(94,APPLY.id, ORIGIN_STATUS.id, END.id, "发起装备申请"),
REPAIR_BACK_8(95,REPAIR_BACK.id, WAIT_UPLOAD_BACK_SEND_FILE.id, END.id, "上传领取单"),
REPAIR_SEND_11(96, REPAIR.id, WAIT_UPLOAD_SEND_FILE.id, END.id, "上传送修单"),
REPAIR_SEND_12(97, REPAIR.id, WAIT_UPLOAD_SEND_FILE.id, ARCHIVE.id, "取消上传送修单"),
ALLOT_BACK_6(98, ALLOT_BACK.id, WAIT_UPLOAD_BACK_FILE_2.id, ARCHIVE.id, "取消上传退回单"),
ALLOT_12(99, ALLOT.id, ALLOTING.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, "接收配发装备(缺失单据)"),
ALLOT_13(101, ALLOT.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, END.id, "上传配发单"),
;
public Integer id;
......
......@@ -113,7 +113,7 @@ public class DeviceDestroyController {
//生成上传销毁单任务
TaskBto task = taskService.start(initTaskBto(deviceDestroyBillEntitySaved));
myWebSocket.sendMessage1();
return ResponseEntity.ok(deviceDestroyBillEntitySaved.getId());
return ResponseEntity.ok(selectDestroyDetail(deviceDestroyBillEntitySaved.getId()));
}
@ApiOperation(value = "查询可销毁装备列表", notes = "通过这个接口查询可销毁装备接口")
......
......@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
......@@ -24,11 +23,11 @@ public class DeviceDestroyFormVo {
@ApiModelProperty(value = "装备列表")
private List<Integer> devices;
@NotNull(message = "fileName不能为空")
// @NotNull(message = "fileName不能为空")
@ApiModelProperty(value = "文件名称", example = "文件X")
private String fileName;
@NotNull(message = "fileUrl不能为空")
// @NotNull(message = "fileUrl不能为空")
@ApiModelProperty(value = "文件URL", example = "/images/xxxxx")
private String fileUrl;
......
......@@ -144,4 +144,6 @@ public interface DeviceLibraryService {
* 判断装备状态是否在库或维修中
*/
void isInStockOrRepairing(List<Integer> ids);
int getDeviceCount();
}
......@@ -444,6 +444,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
});
}
@Override
public int getDeviceCount() {
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.notIn("lifeStatus", 0,1,5,6,10,11,12,13);
return deviceLibraryDao.findAll(predicateBuilder.build()).size();
}
@Override
public void isNotLoss(List<Integer> ids) {
ids.forEach(integer -> {
......
......@@ -166,9 +166,9 @@ public enum StatusEnum {
ALLOTING(302, "配发中"),
/**
* 配发入库待审核
* 待上传配发单
*/
ALLOT_RECEIVE_CONFIRM(303, "配发入库待审核"),
WAIT_UPLOAD_ALLOT_RECEIVE_FILE(303, "待上传配发单"),
/**
* 待上传横向配发单
......@@ -227,8 +227,9 @@ public enum StatusEnum {
* 配发退回状态
*/
WAIT_BACK(899, "待配发退回"),
ALLOT_BACKING(900, "配发退回中"),
ALLOT_BACK_CONFIRM(901, "配发退回入库待审核"),
ALLOT_BACKING(900, "装备退回中"),
WAIT_UPLOAD_ALLOT_BACK_FILE(901, "待上传退回单"),
WAIT_UPLOAD_BACK_FILE_2(911, "待上传退回单"),
/**
* 报废状态
......
......@@ -217,6 +217,9 @@ public class PackingController {
packingLibrary1.setShowOrder(i+1);
packingLibraries.add(packingLibrary1);
}
else {
break;
}
}
}
else if(packingLibrary.getShowOrder()<packingModelEdit.getShowOrder()){
......@@ -226,6 +229,9 @@ public class PackingController {
packingLibrary1.setShowOrder(i-1);
packingLibraries.add(packingLibrary1);
}
else {
break;
}
}
}
else{
......
......@@ -247,7 +247,8 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
for (int i =1;i<=packingLibraries.size();i++){
PackingLibrary packingLibrary = packingLibraries.get(i-1);
packingLibrary.setShowOrder(i);
packingLibraryList.add(update(packingLibrary));
packingLibraryList.add(packingLibrary);
update(packingLibrary);
}
return packingLibraryList;
}
......
......@@ -250,7 +250,7 @@ public class RepairController {
deviceRepairSendBillEntity.setDeviceRepairBillId(repairBill1.getId());
deviceRepairSendBillEntity.setAgent(repairBillSaveVo.getAgent());
deviceRepairSendBillEntity.setTitle("维修业务");
deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity);
RepairSendBill repairSendBill = deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity);
Integer ownUnit;
TaskBto saveEntity;
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
......@@ -265,6 +265,8 @@ public class RepairController {
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(repairBill.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
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);
}
if (repairBillSaveVo.getTaskId()!=null) {
TaskBto parentTask = taskService.get(repairBillSaveVo.getTaskId());
......@@ -677,7 +679,7 @@ public class RepairController {
if (detailIds.size()>0){
detailIds.forEach(integer -> {
RepairDetail repairDetail = deviceRepairDetailService.getOne(integer);
if (repairDetail.getRepairStatus()!=1){
if (repairDetail.getRepairStatus()!=2){
throw new ApiException(ResponseEntity.status(303).body("序列号"+repairDetail.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
......@@ -710,7 +712,7 @@ public class RepairController {
userIds.add(0);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_BACK_RECEIVE.id, "维修退回", null, ".", deviceRepairBackBillEntity1.getId(), BusinessEnum.REPAIR_BACK.id,userPublicService.findUnitIdByName(repairBackBill.getReceiveUnit()), 1, null, userIds);
TaskBto task = taskService.start(taskBto1);
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_SEND_FILE.id, "维修退回", task.getId(), task.getNodeIdDetail() + task.getId() + ".", task.getBillId(), BusinessEnum.REPAIR_BACK.id, userPublicService.findUnitIdByName(repairBackBill.getSendUnit()), 0, null, userIds);
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_SEND_FILE.id, "维修退回", task.getId(), task.getNodeIdDetail() + task.getId() + ".", task.getBillId(), BusinessEnum.REPAIR_BACK.id, userPublicService.findUnitIdByName(repairBackBill.getSendUnit()), 0, null, Collections.singletonList(0));
taskService.start(taskBto2);
//添加业务日志
List<FileVo> fileVoList = new ArrayList<>();
......@@ -932,7 +934,12 @@ public class RepairController {
// if (repairReceiveVo.getStatus()==0) {
//任务推至下一阶段
// taskService.update(taskService.moveToNext(taskBto, repairReceiveVo.getReceiveUserbId()));
taskBto2 = taskService.moveToEnd(taskBto);
if (repairReceiveVo.getStatus()==0) {
taskBto2 = taskService.moveToEnd(taskBto);
}
else {
taskBto2 = taskService.moveToSpecial(taskBto,StatusEnum.WAIT_UPLOAD_BACK_FILE);
}
// }
// else {
// taskBto2 = taskService.moveToSpecial(taskBto,StatusEnum.WAIT_UPLOAD_BACK_FILE);
......@@ -1155,6 +1162,12 @@ public class RepairController {
@PostMapping(value = "/change")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity changeRepairDeviceStatus(@RequestBody @Validated RepairStatusChangeVo repairStatusChangeVo) {
repairStatusChangeVo.getId().forEach(integer -> {
RepairDetail repairDetail = deviceRepairDetailService.getOne(integer);
if (repairDetail.getRepairStatus()!=1){
throw new ApiException(ResponseEntity.status(303).body("序列号"+repairDetail.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
//获取当前任务
// TaskBto taskBto = taskService.get(repairStatusChangeVo.getTaskId());
//获取所有父任务id
......@@ -1593,6 +1606,7 @@ public class RepairController {
public ResponseEntity uploadFile(@RequestBody @Validated com.tykj.dev.device.repair.subject.vo.FileVo fileVo){
//获取task
TaskBto taskBto = taskService.get(fileVo.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
List<StatusEnum> statusEnums = new ArrayList<>();
statusEnums.add(StatusEnum.WAIT_UPLOAD_BACK_SEND_FILE);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),statusEnums);
......@@ -1619,6 +1633,40 @@ public class RepairController {
return ResponseEntity.ok("OK");
}
@ApiOperation(value = "市县上传维修单", notes = "市县上传维修单")
@PostMapping(value = "/uploadRepairFile")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadRepairFile(@RequestBody @Validated com.tykj.dev.device.repair.subject.vo.FileVo fileVo){
//获取task
TaskBto taskBto = taskService.get(fileVo.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
List<StatusEnum> statusEnums = new ArrayList<>();
statusEnums.add(StatusEnum.WAIT_UPLOAD_SEND_FILE);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),statusEnums);
//不上传单据
if (fileVo.getStatus()==0){
taskService.moveToArchive(taskBto);
}
else {
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(repairBill.getId());
//保存账单
repairSendBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getSendFiles()));
deviceRepairSendBillService.update(repairSendBill);
List<Integer> ids = StringSplitUtil.split(repairSendBill.getRepairDeviceCheckDetail());
//业务完结
taskService.moveToEnd(taskBto);
//装备日志
List<FileVo> fileVoList = new ArrayList<>();
fileVo.getSendFiles().forEach(fileRet -> fileVoList.add(new FileVo("维修单", fileRet.getName(), fileRet.getPreviewPath())));
ids.forEach(integer -> {
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传维修单", fileVoList);
deviceLogService.addLog(deviceLogDto);
});
}
return ResponseEntity.ok("OK");
}
/**
* @param repairBillId 维修单id
* @return 维修详情列表
......
......@@ -226,4 +226,6 @@ public class RepairSendBill {
@ApiModelProperty(value = "区块链记录id")
private String recordId;
@Column(name = "send_files",columnDefinition = "TEXT")
private String sendFiles;
}
......@@ -322,6 +322,9 @@ public class SelfCheckController {
if (selfExaminationBillEntity1.getUserbId()!=null){
userIds.add(selfExaminationBillEntity1.getUserbId());
}
else {
throw new ApiException("审核人不能为空");
}
TaskBto taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, "自查业务", null, ".", selfExaminationBillEntity1.getId(), 4, userUtils.getCurrentUnitId(), 1, null, userIds);
if (selfCheckSaveVo.getType()==0){
taskBto.setCustomInfo("手动");
......
......@@ -3,6 +3,7 @@ package com.tykj.dev.statistical.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.repair.repository.RepairDetailDao;
import com.tykj.dev.device.repair.repository.RepairSendBillDao;
......@@ -72,6 +73,9 @@ public class BigScreenServiceImpl implements BigScreenService {
@Autowired
private SelfCheckBillDao selfCheckBillDao;
@Autowired
private DeviceLibraryService deviceLibraryService;
/**
* 获取省及各市装备统计信息
*/
......@@ -137,14 +141,13 @@ public class BigScreenServiceImpl implements BigScreenService {
public CenterNum getCenterNum() {
CenterNum centerNum = new CenterNum();
//装备总数
centerNum.setDeviceCount(deviceLibraryDao.findAll().size());
centerNum.setDeviceCount(deviceLibraryService.getDeviceCount());
//本年度业务总数
centerNum.setBusinessCount((int) taskDao.findAll().stream().filter(task -> isPresentYear(task.getCreateTime())).count());
//新增设备数
centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> deviceLibrary.getCreateTime()!=null&&isPresentYear(deviceLibrary.getCreateTime())).count());
//故障率
Set<Integer> repairDeviceIds = new HashSet<>();
double num = 0;
List<Task> tasks = taskDao.findAllByBusinessType(BusinessEnum.REPAIR.id).stream().filter(task -> task.getParentTaskId()==null).collect(Collectors.toList());
List<RepairSendBill> repairSendBills = tasks.stream()
.map(task -> repairBillService.getOne(task.getBillId()))
......@@ -153,7 +156,7 @@ public class BigScreenServiceImpl implements BigScreenService {
for (RepairSendBill r:repairSendBills) {
repairDeviceIds.addAll(StringSplitUtil.split(r.getRepairDeviceCheckDetail()));
}
num = repairDeviceIds.size();
double num = repairDeviceIds.size();
double faultPercent = num/centerNum.getDeviceCount()*100;
centerNum.setFaultPercent(faultPercent);
return centerNum;
......
......@@ -639,7 +639,7 @@ public class TaskServiceImpl implements TaskService {
boolean userConfirm2 = taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == -1;
boolean pointExists = taskBto.getCurrentPoint() < taskBto.getInvolveUserIdList().size();
boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()));
boolean isDraft = taskBto.getBillStatus()==201||taskBto.getBillStatus()==333;
boolean isDraft = taskBto.getBillStatus()==201||taskBto.getBillStatus()==333||taskBto.getBillStatus()==810||taskBto.getBillStatus()==322||taskBto.getBillStatus()==722;
boolean isCreateUser = userId.equals(taskBto.getCreateUserId());
return unitExists && pointExists && !userConfirm && !userConfirm2 && !isDraft && isCreateUser;
})
......
......@@ -306,10 +306,16 @@ public class LogAspect {
// if ((this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.ALLOT_BACKING.id))) {
// this.fileVos.add(new FileVo("出库确认单", allotBackBill.getFileName(), allotBackBill.getFileUrl()));
// }
if ((this.oldStatus.equals(StatusEnum.ALLOT_BACKING.id) && this.newStatus.equals(StatusEnum.END.id))) {
if ((this.oldStatus.equals(StatusEnum.ALLOT_BACKING.id) && this.newStatus.equals(StatusEnum.END.id))
||this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_ALLOT_BACK_FILE.id) && this.newStatus.equals(StatusEnum.END.id)) {
this.fileVos.add(new FileVo("退回单", allotBackBill.getBillFileName(), allotBackBill.getBillFileUrl()));
// this.fileVos.add(new FileVo("入库确认单", allotBackBill.getReceiveFileName(), allotBackBill.getReceiveFileUrl()));
}
if ((this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_BACK_FILE_2.id) && this.newStatus.equals(StatusEnum.END.id))) {
FilesUtil.stringFileToList(allotBackBill.getSendFiles()).forEach(fileRet -> {
this.fileVos.add(new FileVo("维修单", fileRet.getName(), fileRet.getPreviewPath()));
});
}
}
break;
case 4:
......@@ -339,6 +345,11 @@ public class LogAspect {
if ((this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_FILE.id) && this.newStatus.equals(StatusEnum.END.id))) {
this.fileVos.add(new FileVo("维修单", repairSendBill.getBillFileName(), repairSendBill.getBillFileUrl()));
}
if ((this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_SEND_FILE.id) && this.newStatus.equals(StatusEnum.END.id))) {
FilesUtil.stringFileToList(repairSendBill.getSendFiles()).forEach(fileRet -> {
this.fileVos.add(new FileVo("维修单", fileRet.getName(), fileRet.getPreviewPath()));
});
}
}
break;
case 6:
......@@ -389,7 +400,7 @@ public class LogAspect {
// this.fileVos.add(new FileVo("出库确认单", repairBackBill.getFileName(), repairBackBill.getFileUrl()));
// }
if ((this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_BACK_FILE.id) && this.newStatus.equals(StatusEnum.END.id))) {
this.fileVos.add(new FileVo("回执单", repairBackBill.getBillFileName(), repairBackBill.getBillFileUrl()));
this.fileVos.add(new FileVo("领取单", repairBackBill.getBillFileName(), repairBackBill.getBillFileUrl()));
}
if ((this.oldStatus.equals(StatusEnum.WAIT_UPLOAD_BACK_SEND_FILE.id) && this.newStatus.equals(StatusEnum.END.id))) {
FilesUtil.stringFileToList(repairBackBill.getSendFiles()).forEach(fileRet -> {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论