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

更新

上级 39ff888c
......@@ -613,12 +613,12 @@ public class AllotBillController {
}
@ApiOperation(value = "上传发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateAgent/{id}/{name}")
@PostMapping(value = "/updateAgent")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
public ResponseEntity updateAgent(@RequestBody AgentVo agentVo){
TaskBto taskBto = taskService.get(agentVo.getId());
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
allotBill.setAgent(name);
allotBill.setAgent(agentVo.getName());
return ResponseEntity.ok(allotBillService.update(allotBill));
}
}
package com.tykj.dev.device.allot.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.service.AllotBillService;
......@@ -10,7 +11,9 @@ import com.tykj.dev.device.file.service.FilesUtil;
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.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -78,6 +81,9 @@ public class AllotBillSelectController {
}
allotBillEntity.setSendFileList(FilesUtil.stringFileToList(allotBillEntity.getSendFiles()));
allotBillEntity.setReplyFileList(FilesUtil.stringFileToList(allotBillEntity.getReplyFiles()));
if (allotBillEntity.getScriptJson()!=null){
allotBillEntity.setScripts(JacksonUtil.readValue(allotBillEntity.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBillEntity);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
//如果接收装备详情不为空,分隔装备id并添加
......@@ -104,6 +110,9 @@ public class AllotBillSelectController {
}
allotBillEntity.setSendFileList(FilesUtil.stringFileToList(allotBillEntity.getSendFiles()));
allotBillEntity.setReplyFileList(FilesUtil.stringFileToList(allotBillEntity.getReplyFiles()));
if (allotBillEntity.getScriptJson()!=null){
allotBillEntity.setScripts(JacksonUtil.readValue(allotBillEntity.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBillEntity);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
//如果接收装备详情不为空,分隔装备id并添加
......
......@@ -3,6 +3,7 @@ package com.tykj.dev.device.allot.controller;
import com.tykj.dev.config.swagger.AutoDocument;
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.AgentVo;
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;
......@@ -287,12 +288,12 @@ public class BackController {
}
@ApiOperation(value = "上传发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateAgent/{id}/{name}")
@PostMapping(value = "/updateAgent")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateAgent(@PathVariable("id") int taskId, @PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
public ResponseEntity updateAgent(@RequestBody AgentVo agentVo){
TaskBto taskBto = taskService.get(agentVo.getId());
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
allotBackBill.setAgent(name);
allotBackBill.setAgent(agentVo.getName());
return ResponseEntity.ok(allotBackBillService.update(allotBackBill));
}
}
package com.tykj.dev.device.allot.subject.domin;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -175,6 +176,12 @@ public class AllotBackBill {
@Column(name = "apply_files",columnDefinition = "TEXT")
private String applyFiles;
@Column(name = "script_json",columnDefinition = "TEXT")
private String scriptJson;
@Transient
private List<ScriptSaveVo> scripts = new ArrayList<>();
@Transient
private List<FileRet> replyFileList = new ArrayList<>();
......
......@@ -2,6 +2,7 @@ package com.tykj.dev.device.allot.subject.domin;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -252,6 +253,13 @@ public class AllotBill {
@Column(name = "send_files",columnDefinition = "TEXT")
private String sendFiles;
@Column(name = "script_json",columnDefinition = "TEXT")
private String scriptJson;
@Transient
private List<ScriptSaveVo> scripts = new ArrayList<>();
@Transient
private List<FileRet> replyFileList = new ArrayList<>();
......
package com.tykj.dev.device.allot.subject.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("配发审核类")
public class AgentVo {
private Integer id;
private String name;
}
package com.tykj.dev.device.allot.subject.vo;
import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.misc.utils.JacksonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -9,6 +11,7 @@ import org.springframework.beans.BeanUtils;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author dengdiyi
......@@ -70,10 +73,15 @@ public class AllotBackBillSaveVo {
@ApiModelProperty(value = "签发人")
private String agent;
private List<ScriptSaveVo> scriptSaveVos;
public AllotBackBill toDo() {
AllotBackBill allotBackBill = new AllotBackBill();
BeanUtils.copyProperties(this, allotBackBill);
allotBackBill.setBackStatus(0);
if (this.scriptSaveVos!=null){
allotBackBill.setScriptJson(JacksonUtil.toJSon(scriptSaveVos));
}
return allotBackBill;
}
}
......@@ -4,6 +4,8 @@ import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.TimestampUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -94,6 +96,8 @@ public class AllotBillSaveVo {
@ApiModelProperty(value = "左签章Id")
private String leftSignatureId;
private List<ScriptSaveVo> scriptSaveVos;
public AllotBill toDo() {
AllotBill allotBillEntity = new AllotBill();
BeanUtils.copyProperties(this, allotBillEntity);
......@@ -105,6 +109,9 @@ public class AllotBillSaveVo {
}
allotBillEntity.setAllotStatus(2);
allotBillEntity.setSendTime(TimestampUtil.getCurrentTimestamp());
if (this.scriptSaveVos!=null){
allotBillEntity.setScriptJson(JacksonUtil.toJSon(scriptSaveVos));
}
return allotBillEntity;
}
......
......@@ -5,10 +5,8 @@ import com.tykj.dev.device.allot.service.AllotBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.ApplyDetailVo;
import com.tykj.dev.device.apply.subject.vo.DeviceApplyAllotSaveVo;
import com.tykj.dev.device.apply.subject.vo.DeviceApplyConfirmVo;
import com.tykj.dev.device.apply.subject.vo.DeviceApplySaveVo;
import com.tykj.dev.device.apply.subject.vo.*;
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;
......@@ -118,9 +116,12 @@ public class DeviceApplyController {
//发起任务
TaskBto taskBto;
if (userUtils.getCurrentUnitLevel()==1){
deviceApplyBillEntity.setApplyStatus(3);
deviceApplyBillService.update(deviceApplyBillEntity);
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
taskBto = new TaskBto(StatusEnum.END.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9,userUtils.getCurrentUnitId(), 0, null, userIds);
userIds.add(0);
taskBto = new TaskBto(StatusEnum.WAIT_APPLY_FILE.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9,userUtils.getCurrentUnitId(), 1, null, userIds);
}
else {
//指定批复人
......@@ -250,7 +251,7 @@ public class DeviceApplyController {
allotBill.setLeftSignatureId(deviceApplyAllotSaveVo.getLeftSignatureId());
}
allotBill.setRightSignatureId(signId2.toString());
allotBillService.update(allotBill);
AllotBill allotBill1 = allotBillService.update(allotBill);
taskBto.setBillId(allotBill.getId());
//配发业务移动到下一阶段
TaskBto taskBto1 = taskService.moveToSpecial(taskBto,StatusEnum.ALLOTING);
......@@ -291,7 +292,7 @@ public class DeviceApplyController {
messageService.add(messageBto);
log.info("[申请模块]:装备申请后发起配发");
myWebSocket.sendMessage1();
return ResponseEntity.ok(new ResultObj(saveEntity, "发起配发成功"));
return ResponseEntity.ok(new ResultObj(allotBill1, "发起成功"));
}
@ApiOperation(value = "查询申请任务详情", notes = "可以通过这个接口查询申请任务详情")
......@@ -350,4 +351,31 @@ public class DeviceApplyController {
applyDetailVo.setTaskLogUserVos(allLogUserVos);
return ResponseEntity.ok(applyDetailVo);
}
@ApiOperation(value = "上传回执单", notes = "上传回执单")
@PostMapping("/uploadFile")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadFile(@RequestBody @Validated UploadApplyFile uploadApplyFile) {
TaskBto taskBto = taskService.get(uploadApplyFile.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToNext(taskBto);
DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
deviceApplyBill.setApplyStatus(4);
deviceApplyBill.setBackFiles(FilesUtil.stringFileToList(uploadApplyFile.getBackFiles()));
deviceApplyBillService.update(deviceApplyBill);
return ResponseEntity.ok("上传成功");
}
@ApiOperation(value = "确认接收申请装备", notes = "确认接收申请装备")
@PostMapping("/confirm/{id}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity confirm(@PathVariable("id") int taskId) {
TaskBto taskBto = taskService.get(taskId);
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToEnd(taskBto);
DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
deviceApplyBill.setApplyStatus(2);
deviceApplyBillService.update(deviceApplyBill);
return ResponseEntity.ok("确认成功");
}
}
......@@ -80,7 +80,7 @@ public class DeviceApplyBill {
/**
* 申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:已批复待审核,4:批复审核失败,5:申请成功)
*/
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:驳回,4:申请成功)")
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办回执单,4:等待确认接收中办装备)")
private Integer applyStatus;
/**
* 列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件
......@@ -128,6 +128,10 @@ public class DeviceApplyBill {
@Column(name = "apply_files",columnDefinition = "TEXT")
private String applyFiles;
@Column(name = "back_files",columnDefinition = "TEXT")
private String backFiles;
@Column(name = "apply_num_files",columnDefinition = "TEXT")
private String applyNumFiles;
......@@ -140,6 +144,9 @@ public class DeviceApplyBill {
@Transient
private List<FileRet> applyFileList = new ArrayList<>();
@Transient
private List<FileRet> backFileList = new ArrayList<>();
@Transient
private List<FileRet> applyNumFileList = new ArrayList<>();
}
package com.tykj.dev.device.apply.subject.vo;
import com.tykj.dev.device.file.entity.FileRet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("申请上传回执单类")
public class UploadApplyFile {
@NotNull(message = "taskId不能为空")
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(value = "对应任务ID", example = "1")
private Integer taskId;
@ApiModelProperty(value = "申请回执单附件")
private List<FileRet> backFiles;
}
......@@ -229,7 +229,7 @@ public enum LogType {
SCRAP_2(91,SCRAP.id, WAIT_UPLOAD_SCRAP_FILE.id, END.id, "上传报废单据"),
SELF_CHECK_5(92,SELF_CHECK.id, ORIGIN_STATUS.id, END.id, "终端自查"),
SELF_CHECK_6(93,SELF_CHECK.id, WAIT_SELF_CHECK.id, END.id, "周期自查"),
APPLY_4(94,APPLY.id, ORIGIN_STATUS.id, END.id, "发起装备申请"),
APPLY_4(94,APPLY.id, ORIGIN_STATUS.id, WAIT_APPLY_FILE.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, "取消上传送修单"),
......@@ -240,6 +240,8 @@ public enum LogType {
ALLOT_BACK_7(103, ALLOT_BACK.id, WAIT_UPLOAD_ALLOT_BACK_FILE.id, ARCHIVE.id, "取消上传退回单"),
REPAIR_SEND_13(104, REPAIR.id, WAIT_UPLOAD_FILE.id, ARCHIVE.id, "取消上传送修单"),
REPAIR_BACK_9(105,REPAIR_BACK.id, WAIT_UPLOAD_BACK_FILE.id, ARCHIVE.id, "取消上传领取单"),
APPLY_5(106,APPLY.id, WAIT_APPLY_FILE.id, WAIT_CONFIRM_APPLY_DEVICE.id, "上传申请回执单"),
APPLY_6(107,APPLY.id, WAIT_CONFIRM_APPLY_DEVICE.id, END.id, "确认接收申请装备"),
;
public Integer id;
......
......@@ -223,6 +223,15 @@ public class DeviceDestroyController {
if (uploadDestroyFileVo.getDestroyFileName() != null) {
deviceDestroyBill.setDestroyFileName(uploadDestroyFileVo.getDestroyFileName());
}
if (uploadDestroyFileVo.getUndertaker() != null) {
deviceDestroyBill.setUndertaker(uploadDestroyFileVo.getUndertaker());
}
if (uploadDestroyFileVo.getLeader() != null) {
deviceDestroyBill.setLeader(uploadDestroyFileVo.getLeader());
}
if (uploadDestroyFileVo.getSupervisor() != null) {
deviceDestroyBill.setSupervisor(uploadDestroyFileVo.getSupervisor());
}
deviceDestroyBillService.updateEntity(deviceDestroyBill);
//任务完结
taskService.moveToEnd(taskBto);
......
......@@ -26,4 +26,13 @@ public class UploadDestroyFileVo {
@NotNull(message = "destroyFileUrl不能为空")
@ApiModelProperty(value = "销毁附件文件地址URL")
private String destroyFileUrl;
@ApiModelProperty(value = "承办人")
private String undertaker;
@ApiModelProperty(value = "主管领导")
private String leader;
@ApiModelProperty(value = "监销人")
private String supervisor;
}
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @author dengdiyi
*/
......@@ -15,7 +18,7 @@ public class Script {
private String model;
@ApiModelProperty(value = "类型")
private Integer type;
private String type;
@ApiModelProperty(value = "装备名称")
private String name;
......@@ -24,12 +27,26 @@ public class Script {
private String seqNumber;
@ApiModelProperty(value = "密级")
private Integer secretLevel;
private String secretLevel;
@ApiModelProperty(value = "可见范围")
private Integer invisibleRange;
private String invisibleRange;
@ApiModelProperty(value = "数量")
private Integer num;
@ApiModelProperty(value = "列装Id")
private Integer id;
@ApiModelProperty(value = "父列装Id")
private Integer partParentId;
@ApiModelProperty(value = "备注")
private String remark;
List<Script> childs = new ArrayList<>();
public void addChildNode(Script script) {
childs.add(script);
}
}
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.misc.utils.JacksonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("单据存储类")
public class ScriptSaveVo {
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "装备名称")
private String name;
@ApiModelProperty(value = "装备序列号")
private String seqNumber;
@ApiModelProperty(value = "密级")
private String secretLevel;
@ApiModelProperty(value = "可见范围")
private String invisibleRange;
@ApiModelProperty(value = "数量")
private Integer num;
@ApiModelProperty(value = "列装Id")
private Integer id;
@ApiModelProperty(value = "备注")
private String remark;
public String toJson(){
return JacksonUtil.toJSon(this);
}
}
......@@ -44,7 +44,11 @@ public enum RepairStatusEnum {
/**
* 等待上级维修装备送回
*/
WAIT_BACK(8, "等待上级维修装备送回");
WAIT_BACK(8, "等待上级维修装备送回"),
/**
* 等待送修
*/
WAIT_SEND(9, "等待送修");
public Integer id;
......
......@@ -199,6 +199,15 @@ public enum StatusEnum {
* 装备申请待批复
*/
DEVICE_APPLY_CONFIRM(500, "装备申请待批复"),
/**
* 等待上传申请回执单
*/
WAIT_APPLY_FILE(510, "待上传申请回执单"),
/**
* 等待上传申请回执单
*/
WAIT_CONFIRM_APPLY_DEVICE(511, "待确认接收申请装备"),
/**
* 新增配套设备待审核
*/
......
......@@ -18,15 +18,15 @@ public class DeviceSeqUtil {
public static void main(String[] args) {
List<String> list=new ArrayList<>();
list.add(null);
// list.add(null);
list.add("30338343767");
list.add("30338343768");
list.add("30338343769");
list.add("30338343770");
list.add("30338343771");
list.add("30338343772");
list.add("30338343773");
list.add("30338343775");
list.add("生成1");
list.add("");
System.out.println(getContinuousSeqs(list));
}
......@@ -330,17 +330,31 @@ public class DeviceSeqUtil {
/**
* 将连续的序列号组合成一个字符串
* 将连续的序列号组合成一个字符串 为空的没有做判断
* @param strings 序列号区间
* @return 序列号连续组合的区间
*/
public static List<String> getContinuousSeqs(List<String> strings){
List<String> results = new ArrayList<>();
if (strings.size()==1){
if (strings.size()==1) {
if (strings.get(0) != null && !"".equals(strings.get(0))){
results.add(strings.get(0));
}
}
else {
List<String> sortedString = strings.stream().sorted().collect(Collectors.toList());
List<String> numSeqs = new ArrayList<>();
List<String> strSeqs = new ArrayList<>();
strings.forEach(s -> {
if (s!=null&&!"".equals(s)) {
if (Character.isDigit(s.charAt(s.length() - 1))) {
numSeqs.add(s);
} else {
strSeqs.add(s);
}
}
});
if (numSeqs.size()>0) {
List<String> sortedString = numSeqs.stream().sorted(Comparator.nullsLast(String::compareTo)).collect(Collectors.toList());
String lastSeq = sortedString.get(0);
String first = null;
for (int i = 1; i < sortedString.size(); i++) {
......@@ -352,7 +366,7 @@ public class DeviceSeqUtil {
if (first == null) {
first = lastSeq;
}
if (i == sortedString.size()-1) {
if (i == sortedString.size() - 1) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(first).append("-").append(index);
results.add(stringBuffer.toString());
......@@ -387,6 +401,10 @@ public class DeviceSeqUtil {
lastSeq = index;
}
}
if (strSeqs.size()>0){
results.addAll(strSeqs);
}
}
return results;
}
......
......@@ -293,24 +293,46 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
@Override
public List<Script> getDevcieScript(List<Integer> ids) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Script> scripts = new ArrayList<>();
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
ids.forEach(integer -> deviceLibraries.add(deviceLibraryService.getOne(integer)));
ids.forEach(integer -> deviceLibraries.add(deviceLibraryMap.get(integer)));
Map<Integer, List<DeviceLibrary>> map = deviceLibraries.stream().collect(groupingBy(DeviceLibrary::getPackingId));
for (Integer packingId:map.keySet()){
List<DeviceLibrary> deviceLibraryList = map.get(packingId);
PackingLibrary packingLibrary = getOne(packingId);
Script script = new Script();
script.setInvisibleRange(packingLibrary.getInvisibleRange());
script.setId(packingId);
script.setPartParentId(packingLibrary.getPartParentId());
script.setInvisibleRange(packingLibrary.getInvisibleRangeName());
script.setModel(packingLibrary.getModel());
script.setName(packingLibrary.getName());
script.setSecretLevel(packingLibrary.getSecretLevel());
script.setType(packingLibrary.getType());
script.setSecretLevel(packingLibrary.getSecretLevelName());
script.setType(packingLibrary.getTypeName());
script.setNum(deviceLibraryList.size());
script.setSeqNumber(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(deviceLibraryList.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()))));
scripts.add(script);
}
return scripts;
Map<Integer, Script> nodeCollect =
scripts.stream().collect(Collectors.toMap(Script::getId, script -> script));
List<Script> scriptList = new ArrayList<>();
List<Script> conList = GetTreeUtils.parseTreeFromDown(
scripts,
Script::getId,
script -> Optional.ofNullable(nodeCollect.get(script.getPartParentId())),
Script::addChildNode
);
for (Script s:conList) {
addScript(scriptList,s);
}
return scriptList;
}
private void addScript(List<Script> scripts,Script script){
scripts.add(script);
if (script.getChilds()!=null&&script.getChilds().size()>0){
script.getChilds().forEach(s -> addScript(scripts,s));
}
}
/**
......
......@@ -145,7 +145,7 @@ public class RepairController {
repairDetail.setModel(deviceLibraryEntity.getModel());
repairDetail.setName(deviceLibraryEntity.getName());
repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit());
repairDetail.setRepairStatus(1);
repairDetail.setRepairStatus(9);
repairDetail.setRfidSurfaceId(deviceLibraryEntity.getRfidSurfaceId());
repairDetail.setSeqNumber(deviceLibraryEntity.getSeqNumber());
repairDetail.setType(deviceLibraryEntity.getType());
......@@ -1223,7 +1223,7 @@ public class RepairController {
public ResponseEntity changeRepairDeviceStatus(@RequestBody @Validated RepairStatusChangeVo repairStatusChangeVo) {
repairStatusChangeVo.getId().forEach(integer -> {
RepairDetail repairDetail = deviceRepairDetailService.getOne(integer);
if (repairDetail.getRepairStatus()!=1){
if (repairDetail.getRepairStatus()!=1&&repairDetail.getRepairStatus()!=9){
throw new ApiException(ResponseEntity.status(303).body("序列号"+repairDetail.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
......@@ -1572,6 +1572,7 @@ public class RepairController {
//待维修装备
if (type==1){
List<RepairDetail> repairDetails = repairDetailDao.findAllByRepairStatus(1);
repairDetails.addAll(repairDetailDao.findAllByRepairStatus(9));
repairDetails.forEach(repairDetail -> {
repairDetail.setLocationUnit(deviceLibraryService.getOne(repairDetail.getDeviceId()).getLocationUnit());
repairDetail.setConfigName();
......@@ -1581,6 +1582,7 @@ public class RepairController {
//送修装备
else if(type==2){
List<RepairDetail> repairDetails = repairDetailDao.findAllByRepairStatus(5);
repairDetails.addAll(repairDetailDao.findAllByRepairStatus(9));
// repairDetails.addAll(repairDetailDao.findAllByRepairStatus(5));
List<RepairDetail> repairDetails1 = repairDetailDao.findAll();
repairDetails1.removeAll(repairDetails);
......@@ -1765,22 +1767,22 @@ public class RepairController {
}
@ApiOperation(value = "上传送修发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateSendAgent/{id}/{name}")
@PostMapping(value = "/updateSendAgent")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateSendAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
public ResponseEntity updateSendAgent(@RequestBody AgentBackVo agentBackVo){
TaskBto taskBto = taskService.get(agentBackVo.getId());
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
repairBill.setStartUserB(name);
repairBill.setStartUserB(agentBackVo.getName());
return ResponseEntity.ok(deviceRepairBillService.update(repairBill));
}
@ApiOperation(value = "上传领取发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateBackAgent/{id}/{name}")
@PostMapping(value = "/updateBackAgent")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateBackAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
public ResponseEntity updateBackAgent(@RequestBody AgentBackVo agentBackVo){
TaskBto taskBto = taskService.get(agentBackVo.getId());
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
repairBackBill.setAgent(name);
repairBackBill.setAgent(agentBackVo.getName());
return ResponseEntity.ok(deviceRepairBackBillService.update(repairBackBill));
}
}
package com.tykj.dev.device.repair.subject.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("配发审核类")
public class AgentBackVo {
private Integer id;
private String name;
}
......@@ -170,6 +170,7 @@ public class SelfCheckController {
@ApiOperation(value = "装备比较", notes = "可以通过这个接口发起比较装备")
@PostMapping(value = "/compare")
public ResponseEntity compare(@RequestBody CompareVo compareVo) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
CompareResultVo compareResultVo = new CompareResultVo();
List<Integer> list = compareVo.getDeivceIdList();
List<String> list1 = new ArrayList<>();
......@@ -178,7 +179,7 @@ public class SelfCheckController {
List<DeviceLibrary> resultList = new ArrayList<>();
List<Integer> detailIds = compareVo.getDetailIdList();
for (int i = 0;i<list.size();i++) {
DeviceLibrary d = deviceLibraryService.getOne(list.get(i));
DeviceLibrary d = deviceLibraryMap.get(list.get(i));
if (detailIds.size()>i){
d.setDetailId(detailIds.get(i));
}
......
package com.tykj.dev.device.taskselect.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.service.AllotBillService;
......@@ -12,6 +13,7 @@ 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.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.matching.service.MatchingDeviceBillService;
import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill;
......@@ -38,6 +40,7 @@ import com.tykj.dev.device.taskselect.vo.SignatureSaveVo;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.base.ResultObj;
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.Snowflake;
import com.tykj.dev.misc.utils.StringSplitUtil;
......@@ -203,6 +206,9 @@ public class TaskSelectController {
if (allotBillEntity.getReceiveUserbId() != null) {
allotBillEntity.setReceiveUserB(userPublicService.getOne(allotBillEntity.getReceiveUserbId()).getName());
}
if (allotBillEntity.getScriptJson()!=null){
allotBillEntity.setScripts(JacksonUtil.readValue(allotBillEntity.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBillEntity);
String str2 = allotBillEntity.getAllotCheckDetail();
List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>();
......@@ -256,6 +262,9 @@ public class TaskSelectController {
allotBackBill.setSendFileList(FilesUtil.stringFileToList(allotBackBill.getSendFiles()));
allotBackBill.setReplyFileList(FilesUtil.stringFileToList(allotBackBill.getReplyFiles()));
allotBackBill.setApplyFileList(FilesUtil.stringFileToList(allotBackBill.getApplyFiles()));
if (allotBackBill.getScriptJson()!=null){
allotBackBill.setScripts(JacksonUtil.readValue(allotBackBill.getScriptJson(),new TypeReference<List<ScriptSaveVo>>() {}));
}
list.add(allotBackBill);
String detail = allotBackBill.getBackCheckDetail();
List<DeviceLibrary> libraryArrayList = new ArrayList<>();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论