提交 02f56769 authored 作者: zhoushaopan's avatar zhoushaopan

feat(维修模块,退回模块,装备模块,日志模块,任务模块): 维修新增省直属发起维修,维修草稿,维修撤回,退回模块新增省直属发起退回,草稿,以及撤回

维修新增省直属发起维修,维修草稿,维修撤回,退回模块新增省直属发起退回,草稿,以及撤回 ,修改装备的所属所在,新增状态
上级 5b77f4e9
......@@ -51,14 +51,20 @@ public class AllotBillSaveVo {
@ApiModelProperty(value = "发件方(B岗位)")
private Integer sendUserbId;
@ApiModelProperty(value = "发件经办人id(A岗位)")
private Integer sendUseraId;
// @ApiModelProperty(value = "签章审核方")
// private Integer confirmUserId;
// @NotNull(message = "receiveUseraId不能为空")
@Min(value = 1,message = "receiveUseraId不能小于1")
// @Min(value = 1,message = "receiveUseraId不能小于1")
@ApiModelProperty(value = "收件方(A岗位)")
private Integer receiveUseraId;
@ApiModelProperty(value = "收件方审核人id(B岗位)")
private Integer receiveUserbId;
// @NotNull(message = "fileName不能为空")
@ApiModelProperty(value = "账单文件名")
private String fileName;
......
......@@ -328,6 +328,7 @@ public enum LogType {
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_SEND_22(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, "拒绝电子签章申请"),
......@@ -337,7 +338,6 @@ public enum LogType {
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_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, "拒绝电子签章申请"),
APPLY_7(140,APPLY.id, WAIT_APPLY_FILE.id, END.id, "申请不同意,业务办结"),
// ALLOT_BACK_16(141,ALLOT_BACK.id, BACK_DRAFT.id, ALLOT_BACKING.id, "从草稿发起退回"),
......@@ -372,7 +372,8 @@ public enum LogType {
SELF_CHECK_7(169, SELF_CHECK.id,ORIGIN_STATUS.id,WAIT_SELF_CHECK.id,"待自查任务"),
//[业务操作日志]存储失败:找不到业务类型为+4,旧状态为400,新状态为8888的日志模板
SELF_CHECK_8(170,SELF_CHECK.id,WAIT_SELF_CHECK.id,ARCHIVE.id,"核查结束,系统发起的自查自动结束"),
;
REPAIR_BACK_21(171,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_UNDER_DRAFT.id, "省直属等待出库"),
ALLOT_BACK_21(172,ALLOT_BACK.id,ORIGIN_STATUS.id,BACK_UNDER_DRAFT.id,"省直属等待出库");
public Integer id;
......
......@@ -174,5 +174,10 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Modifying
@Query("update DeviceLibrary d set d.ownUnit = d.locationUnit ,d.lifeStatus = 2 where d.id in :deviceIds")
int updateDevicesOwnUnit(@Param("deviceIds") List<Integer> deviceIds);
@Transactional
@Modifying
@Query("update DeviceLibrary d set d.ownUnit = :ownUnit,d.locationUnit = :ownUnit,d.lifeStatus = 2 where d.id in :deviceIds")
int updateDevicesOwnUnit(@Param("ownUnit") String ownUnit,@Param("deviceIds") List<Integer> deviceIds);
}
......@@ -241,4 +241,9 @@ public interface DeviceLibraryService {
* @param deviceIds 装备id
*/
void updateDevicesOwnUnit(List<Integer> deviceIds);
/**
* @param
*/
void updateLocalAndOwn(String localUnit,List<Integer> deviceIds);
}
......@@ -735,6 +735,11 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao.updateDevicesOwnUnit(deviceIds);
}
@Override
public void updateLocalAndOwn(String localUnit,List<Integer> deviceIds) {
deviceLibraryDao.updateDevicesOwnUnit(localUnit,deviceIds);
}
@Override
public DeviceLibrary update(DeviceLibrary deviceLibraryEntity) {
......
......@@ -272,6 +272,7 @@ public enum StatusEnum {
REPAIR_SEND_DRAFT(788,"等待出库"),
REPAIR_SEND_SIGN_WAIT_CONFIRM(790,"申请签章待审核"),
REPAIR_SEND_WAIT_SIGN(791,"等待盖章"),
REPAIR_SEND_UNDER_DRAFT(799,"省直属等待出库"),
/**
* 维修完成退回状态
*/
......@@ -283,6 +284,7 @@ public enum StatusEnum {
REPAIR_BACK_SIGN_WAIT_CONFIRM(820,"申请签章待审核"),
REPAIR_BACK_WAIT_SIGN(821,"等待盖章"),
REPAIR_BACK_DRAFT(888,"等待出库"),
REPAIR_BACK_UNDER_DRAFT(889,"省直属等待出库"),
/**
* 配发退回状态
......@@ -294,7 +296,7 @@ public enum StatusEnum {
BACK_DRAFT(922,"草稿"),
BACK_SIGN_WAIT_CONFIRM(930,"申请签章待审核"),
BACK_WAIT_SIGN(931,"等待盖章"),
BACK_UNDER_DRAFT(932,"等待省直属退回"),
/**
* 报废状态
*/
......
......@@ -3,6 +3,7 @@ package com.tykj.dev.device.repair.service;
import com.tykj.dev.device.repair.subject.domin.RepairDetail;
import com.tykj.dev.device.repair.subject.vo.BillVo;
import com.tykj.dev.device.repair.subject.vo.ClearRepairVo;
import com.tykj.dev.device.repair.subject.vo.ClearTaskVo;
import com.tykj.dev.device.repair.subject.vo.SetDevicesOwnUnit;
......@@ -57,4 +58,9 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> {
*/
void setDevicesOwnUnit(List<BillVo> billVos);
/**
* @param deviceIds 装备id
*/
ClearRepairVo underRepair(List<Integer> deviceIds);
}
......@@ -14,6 +14,7 @@ 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.RepairSendBill;
import com.tykj.dev.device.repair.subject.vo.BillVo;
import com.tykj.dev.device.repair.subject.vo.ClearRepairVo;
import com.tykj.dev.device.repair.subject.vo.ClearTaskVo;
import com.tykj.dev.device.repair.subject.vo.SetDevicesOwnUnit;
import com.tykj.dev.device.task.service.TaskService;
......@@ -22,6 +23,7 @@ import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.RepairStatusEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
......@@ -30,6 +32,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.concurrent.CompletableFuture;
......@@ -137,25 +140,80 @@ public class RepairDetailServiceImpl implements RepairDetailService {
});
}
// @Override
// public Map<Integer, ClearTaskVo> getClearTaskVo(List<Integer> deviceIds) {
// List<ClearTaskVo> clearTaskVos = new ArrayList<>();
// Map<Integer,ClearTaskVo> map1 = new HashMap<>();
// //通过装备id查询出账单id (送修单repairBill)
// List<RepairDetail> repairDetails = deviceRepairDetailDao.findAllByDeviceIdIn(deviceIds);
// //取出装备id相同的最新时间
// Map<Integer,RepairDetail> map =new HashMap<>();
// repairDetails.sort(Comparator.comparing(RepairDetail::getCreateTime));
// repairDetails.forEach(
// repairDetail -> {
// if (!map.containsKey(repairDetail.getDeviceId())){
// map.put(repairDetail.getDeviceId(),repairDetail);
// }
// }
// );
// List<BillVo> billVos = new ArrayList<>();
// map.forEach(
// (k,v)->{
// BillVo billVo = new BillVo();
// billVo.setRepairBillId(v.getDeviceRepairBillId());
// billVo.setDevicesId(v.getDeviceId());
// billVo.setRepairDetailId(v.getId());
// billVos.add(billVo);
// //根据装备id查询装备
// DeviceLibrary library = deviceLibraryService.getOne(v.getDeviceId());
// DeviceLibrary deviceLibrary = library.setConfigName();
// BeanUtils.copyProperties(deviceLibrary,billVo);
// //通过账单id和businessType查询task对象
// //过滤出状态是 StatusEnum.REVOKEALLOTTASK.id
// List<Task> taskList = taskService.findByBillIdAndBusinessType(v.getDeviceRepairBillId(), BusinessEnum.REPAIR.id);
// List<Task> tasks = taskList.stream().filter(task -> task.getParentTaskId() == null).collect(Collectors.toList());
// ClearTaskVo clearTaskVo = new ClearTaskVo();
// clearTaskVo.setTaskId(tasks.get(0).getId());
// clearTaskVo.setBusinessType(BusinessEnum.REPAIR.id);
// clearTaskVo.setBillVos(billVos);
// clearTaskVos.add(clearTaskVo);
// }
// );
// clearTaskVos.forEach(
// clearTaskVo -> {
// if (!map1.containsKey(clearTaskVo.getTaskId())){
// map1.put(clearTaskVo.getTaskId(),clearTaskVo);
// }else {
// ClearTaskVo clearTaskVo1 = map1.get(clearTaskVo.getTaskId());
// List<BillVo> billVos1 = clearTaskVo1.getBillVos();
// billVos1.addAll(clearTaskVo.getBillVos());
// clearTaskVo1.setBillVos(billVos1);
// map1.put(clearTaskVo.getTaskId(),clearTaskVo1);
// }
// }
// );
// return map1;
// }
@Override
public Map<Integer, ClearTaskVo> getClearTaskVo(List<Integer> deviceIds) {
List<ClearTaskVo> clearTaskVos = new ArrayList<>();
Map<Integer,ClearTaskVo> map1 = new HashMap<>();
//通过装备id查询出账单id (送修单repairBill)
List<RepairDetail> repairDetails = deviceRepairDetailDao.findAllByDeviceIdIn(deviceIds);
ClearRepairVo clearRepairVo = underRepair(deviceIds);
List<RepairDetail> endRepairList = clearRepairVo.getEndRepairList();
//取出装备id相同的最新时间
Map<Integer,RepairDetail> map =new HashMap<>();
repairDetails.sort(Comparator.comparing(RepairDetail::getCreateTime));
repairDetails.forEach(
Map<Integer, RepairDetail> map = new HashMap<>();
endRepairList.forEach(
repairDetail -> {
if (!map.containsKey(repairDetail.getDeviceId())){
map.put(repairDetail.getDeviceId(),repairDetail);
if (!map.containsKey(repairDetail.getDeviceId())) {
map.put(repairDetail.getDeviceId(), repairDetail);
}
}
);
List<BillVo> billVos = new ArrayList<>();
map.forEach(
(k,v)->{
(k, v) -> {
BillVo billVo = new BillVo();
billVo.setRepairBillId(v.getDeviceRepairBillId());
billVo.setDevicesId(v.getDeviceId());
......@@ -164,7 +222,7 @@ public class RepairDetailServiceImpl implements RepairDetailService {
//根据装备id查询装备
DeviceLibrary library = deviceLibraryService.getOne(v.getDeviceId());
DeviceLibrary deviceLibrary = library.setConfigName();
BeanUtils.copyProperties(deviceLibrary,billVo);
BeanUtils.copyProperties(deviceLibrary, billVo);
//通过账单id和businessType查询task对象
//过滤出状态是 StatusEnum.REVOKEALLOTTASK.id
List<Task> taskList = taskService.findByBillIdAndBusinessType(v.getDeviceRepairBillId(), BusinessEnum.REPAIR.id);
......@@ -178,22 +236,26 @@ public class RepairDetailServiceImpl implements RepairDetailService {
);
clearTaskVos.forEach(
clearTaskVo -> {
if (!map1.containsKey(clearTaskVo.getTaskId())){
map1.put(clearTaskVo.getTaskId(),clearTaskVo);
}else {
if (!map1.containsKey(clearTaskVo.getTaskId())) {
map1.put(clearTaskVo.getTaskId(), clearTaskVo);
} else {
ClearTaskVo clearTaskVo1 = map1.get(clearTaskVo.getTaskId());
List<BillVo> billVos1 = clearTaskVo1.getBillVos();
billVos1.addAll(clearTaskVo.getBillVos());
clearTaskVo1.setBillVos(billVos1);
map1.put(clearTaskVo.getTaskId(),clearTaskVo1);
map1.put(clearTaskVo.getTaskId(), clearTaskVo1);
}
}
);
return map1;
}
@Override
public void setDevicesOwnUnit(List<BillVo> billVos) {
//待维修:
//1.下级送修,本级未入库,则需要先将入库任务完成则变成待维修 入库任务完成后则可以将装备的所属改为自己的 装备状态为在库
//2.本级的待维修 直接修改装备为在库
//修改装备的所属以及备注
//1 通过装备id修改装备的所属
//1.2 获取装备的id
......@@ -222,4 +284,22 @@ public class RepairDetailServiceImpl implements RepairDetailService {
});
}
/**
* 查询哪些装备正在运输中(出库方已发起,但是入库方未入库)
*/
@Override
public ClearRepairVo underRepair(List<Integer> deviceIds){
ClearRepairVo clearRepairVo = new ClearRepairVo();
//通过装备id查询出账单id (送修单repairBill)
List<RepairDetail> repairDetails = deviceRepairDetailDao.findAllByDeviceIdIn(deviceIds);
//维修未入库
List<RepairDetail> repairIngList = repairDetails.stream().filter(repairDetail -> repairDetail.getRepairStatus() == RepairStatusEnum.WAIT_REPAIR.id).sorted(Comparator.comparing(RepairDetail::getCreateTime)).collect(Collectors.toList());
//维修已入库
List<Integer> repairStatus = new ArrayList<>(Arrays.asList(RepairStatusEnum.REPAIRING.id, RepairStatusEnum.WAIT_SEND.id));
List<RepairDetail> endRepairList = repairDetails.stream().filter(repairDetail -> repairStatus.contains(repairDetail.getRepairStatus())).sorted(Comparator.comparing(RepairDetail::getCreateTime)).collect(Collectors.toList());
clearRepairVo.setRepairingList(repairIngList);
clearRepairVo.setEndRepairList(endRepairList);
return clearRepairVo;
}
}
package com.tykj.dev.device.repair.subject.vo;
import com.tykj.dev.device.repair.subject.domin.RepairDetail;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@ApiModel("返回清退任务")
@AllArgsConstructor
@NoArgsConstructor
public class ClearRepairVo {
@ApiModelProperty(value = "正在维修中维修详情列表")
private List<RepairDetail> repairingList;
@ApiModelProperty(value = "已入库的维修详情列表")
private List<RepairDetail> endRepairList;
}
......@@ -72,11 +72,11 @@ public class RepairBillSaveVo {
@ApiModelProperty(value = "已出库装备数量")
private Integer sendedCount;
@NotNull(message = "repairDeviceCheckDetail不能为空")
// @NotNull(message = "repairDeviceCheckDetail不能为空")
@ApiModelProperty(value = "送修装备出库详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增")
private String repairDeviceCheckDetail;
@NotNull(message = "repairDeviceCheckResult不能为空")
// @NotNull(message = "repairDeviceCheckResult不能为空")
@ApiModelProperty(value = "送修装备出库检查结果")
private String repairDeviceCheckResult;
......@@ -95,6 +95,9 @@ public class RepairBillSaveVo {
@ApiModelProperty(value = "发送方附件")
private List<FileRet> sendFileList;
@ApiModelProperty(value = "收件方附件")
private List<FileRet> receiveFileList;
@ApiModelProperty(value = "单据保存vo")
private List<ScriptSaveVo> scriptSaveVos;
}
package com.tykj.dev.device.repair.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.repair.subject.domin.RepairDetail;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@ApiModel("省直属任务撤回")
@AllArgsConstructor
@NoArgsConstructor
public class RevokeUnderTask {
@ApiModelProperty(value = "维修的装备")
private List<DeviceDetailVo> deviceDetailVos;
@ApiModelProperty(value = "任务id")
private Integer taskId;
}
......@@ -257,4 +257,11 @@ public interface TaskService {
* 根据billId和businessType获得Task
*/
List<Task> findByBillIdAndBusinessType(Integer billId, Integer businessType);
/**
* 根据taskId删除task
* @param taskId 任务id
*/
void deleteById(Integer taskId);
}
......@@ -1181,6 +1181,11 @@ public class TaskServiceImpl implements TaskService {
.collect(Collectors.toList());
}
@Override
public void deleteById(Integer taskId) {
taskDao.deleteById(taskId);
}
@Override
public void moveAllSonNodeToEnd(Integer taaskId) {
List<Task> tasks = taskDao.findAllByParentTaskId(taaskId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论