提交 9610ac96 authored 作者: zhoushaopan's avatar zhoushaopan

feat(装备申请模块,装备列装模块): 修改申请,新增校验接口,新增备注字段

修改申请,新增校验接口,新增备注字段
上级 b789aafa
...@@ -492,6 +492,10 @@ public class DeviceApplyController { ...@@ -492,6 +492,10 @@ public class DeviceApplyController {
taskService.moveToNext(taskBto); taskService.moveToNext(taskBto);
deviceApplyBill.setApplyStatus(4); deviceApplyBill.setApplyStatus(4);
} }
}else {
//除了装备申请任务的推进 其他申请任务的推进
taskService.moveToNext(taskBto);
deviceApplyBill.setApplyStatus(4);
} }
// taskService.moveToNext(taskBto); // taskService.moveToNext(taskBto);
// DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId()); // DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
...@@ -723,6 +727,14 @@ public class DeviceApplyController { ...@@ -723,6 +727,14 @@ public class DeviceApplyController {
return ResponseEntity.ok(stringBufferList); return ResponseEntity.ok(stringBufferList);
} }
@ApiOperation(value = "其他申请任务进行校验", notes = "其他申请任务进行校验")
@PostMapping("/checkNumAndSeqNumberForOtherApply")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity checkNumAndSeqNumberForOtherApply(@RequestBody List<OtherApplyTaskDeviceCheckVo> otherApplyTaskDeviceCheckVos) {
List<StringBuffer> stringBufferList = deviceApplyBillService.checkNumAndSeqNumberForOtherApply(otherApplyTaskDeviceCheckVos);
return ResponseEntity.ok(stringBufferList);
}
@ApiOperation(value = "当修改试用装备序列时,移除序列号区间中所在的序列号", notes = "当修改试用装备序列时,移除序列号区间中所在的序列号") @ApiOperation(value = "当修改试用装备序列时,移除序列号区间中所在的序列号", notes = "当修改试用装备序列时,移除序列号区间中所在的序列号")
@PostMapping("/removeFromSeqList") @PostMapping("/removeFromSeqList")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
......
...@@ -2,10 +2,7 @@ package com.tykj.dev.device.apply.service; ...@@ -2,10 +2,7 @@ package com.tykj.dev.device.apply.service;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill; import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.ApplyRemoveSeqVo; import com.tykj.dev.device.apply.subject.vo.*;
import com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo;
import com.tykj.dev.device.apply.subject.vo.RemoveFromSeqListVo;
import com.tykj.dev.device.apply.subject.vo.RemoveSameSeqVo;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo; import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import java.util.List; import java.util.List;
...@@ -34,6 +31,13 @@ public interface DeviceApplyBillService { ...@@ -34,6 +31,13 @@ public interface DeviceApplyBillService {
List<StringBuffer> checkNumAndSeqNumber(List<ApplyTaskDeviceCheckVo> applyTaskDeviceCheckVos); List<StringBuffer> checkNumAndSeqNumber(List<ApplyTaskDeviceCheckVo> applyTaskDeviceCheckVos);
/**
* 其他申请做检验
* @param otherApplyTaskDeviceCheckVos
* @return
*/
List<StringBuffer> checkNumAndSeqNumberForOtherApply(List<OtherApplyTaskDeviceCheckVo> otherApplyTaskDeviceCheckVos);
/** /**
* 申请任务入库 当修改试用装备序列时,移除序列号区间中所在的序列号 * 申请任务入库 当修改试用装备序列时,移除序列号区间中所在的序列号
*/ */
......
...@@ -258,6 +258,38 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService { ...@@ -258,6 +258,38 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
return stringBufferList; return stringBufferList;
} }
@Override
public List<StringBuffer> checkNumAndSeqNumberForOtherApply(List<OtherApplyTaskDeviceCheckVo> otherApplyTaskDeviceCheckVos) {
List<StringBuffer> stringBufferList = new ArrayList<>();
//在库序列号
List<String> seqList = deviceLibraryCacheService.getAllDeviceLibraryList().stream()
.map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
otherApplyTaskDeviceCheckVos.forEach(otherApplyTaskDeviceCheckVo -> {
StringBuffer stringBuffer = new StringBuffer();
//获取申请数量
Integer applyNum = otherApplyTaskDeviceCheckVo.getApplyNum();
//获取序列号区间
String seqNumInter = otherApplyTaskDeviceCheckVo.getSeqNumInter();
//输入序列号的区间
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seqNumInter);
stringBuffer.append("序号为").append(otherApplyTaskDeviceCheckVo.getI()+1).append(":");
if (applyNum != inputSeqs.size()){
stringBuffer.append("申请数量和序列号不一致").append(",");
}
//取交集
inputSeqs.forEach(s -> {
if (!seqList.contains(s)){
//不在库 需要提示
stringBuffer.append("该").append(s).append("序列号不在库,请更换序列号");
}
});
stringBufferList.add(stringBuffer);
});
return stringBufferList;
}
@Override @Override
public List<String> removeFromSeqList(RemoveFromSeqListVo removeFromSeqListVo) { public List<String> removeFromSeqList(RemoveFromSeqListVo removeFromSeqListVo) {
//对区间进行拆分 //对区间进行拆分
......
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
*/
@Data
@ApiModel("其他申请校验的vo")
public class OtherApplyTaskDeviceCheckVo {
@ApiModelProperty(value = "序列号")
private Integer i;
@ApiModelProperty(value = "申请数量")
private Integer applyNum;
@ApiModelProperty(value = "序列号区间")
private String seqNumInter;
}
...@@ -812,6 +812,20 @@ public class PackingController { ...@@ -812,6 +812,20 @@ public class PackingController {
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setApplyType(packingLibraryUpdateVo.getApplyType()); packingLibrary.setApplyType(packingLibraryUpdateVo.getApplyType());
} }
if (packingLibraryUpdateVo.getDescription()!=null&&!packingLibraryUpdateVo.getDescription().equals(packingLibrary.getDescription())){
//添加描述列装应用类型日志
PackingLog packingLog = new PackingLog();
if (packingLibrary.getDescription() == null){
packingLog.setRemark("新增了对列装的描述:"+packingLibraryUpdateVo.getDescription());
}else {
packingLog.setRemark("将列装描述从"+packingLibrary.getDescription()+"改为"+packingLibraryUpdateVo.getDescription());
}
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
packingLibrary.setDescription(packingLibraryUpdateVo.getDescription());
}
if (packingLibraryUpdateVo.getSecretLevel()!=null&&!packingLibraryUpdateVo.getSecretLevel().equals(packingLibrary.getSecretLevel())){ if (packingLibraryUpdateVo.getSecretLevel()!=null&&!packingLibraryUpdateVo.getSecretLevel().equals(packingLibrary.getSecretLevel())){
//添加列装密级日志 //添加列装密级日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
......
...@@ -214,6 +214,10 @@ public class PackingLibrary { ...@@ -214,6 +214,10 @@ public class PackingLibrary {
*/ */
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
@ApiModelProperty(value = "列装描述")
@Lob
private String description;
/** /**
* 装备和配件对应关系 相同的是一套设备 * 装备和配件对应关系 相同的是一套设备
*/ */
......
...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.persistence.Lob;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
...@@ -89,5 +90,9 @@ public class PackingLibraryUpdateVo { ...@@ -89,5 +90,9 @@ public class PackingLibraryUpdateVo {
@ApiModelProperty(value = "附件名称") @ApiModelProperty(value = "附件名称")
private List<FileRet> fileList; private List<FileRet> fileList;
@ApiModelProperty(value = "列装描述")
@Lob
private String description;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论