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

更新

上级 8eb84320
...@@ -39,4 +39,10 @@ public class DeviceInLibVo { ...@@ -39,4 +39,10 @@ public class DeviceInLibVo {
private int type; private int type;
private int secretLevel; private int secretLevel;
private String invisibleRangeName;
private String typeName;
private String secretLevelName;
} }
...@@ -41,4 +41,9 @@ public class DeviceNotInLibVo { ...@@ -41,4 +41,9 @@ public class DeviceNotInLibVo {
private int secretLevel; private int secretLevel;
private String invisibleRangeName;
private String typeName;
private String secretLevelName;
} }
...@@ -277,7 +277,7 @@ public class ObjTransUtil { ...@@ -277,7 +277,7 @@ public class ObjTransUtil {
Integer deviceId = Integer.valueOf(array[0]); Integer deviceId = Integer.valueOf(array[0]);
int proofResult = Integer.parseInt(array[1]); int proofResult = Integer.parseInt(array[1]);
DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow( DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow(
() -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))); () -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
//依据proofResult 判断是否是在库装备 //依据proofResult 判断是否是在库装备
if (proofResult == 3) { if (proofResult == 3) {
// 非在库装备 // 非在库装备
...@@ -323,7 +323,10 @@ public class ObjTransUtil { ...@@ -323,7 +323,10 @@ public class ObjTransUtil {
proofResult, proofResult,
device.getInvisibleRange(), device.getInvisibleRange(),
device.getType(), device.getType(),
device.getSecretLevel() device.getSecretLevel(),
device.getInvisibleRangeName(),
device.getTypeName(),
device.getSecretLevelName()
); );
} }
...@@ -341,7 +344,10 @@ public class ObjTransUtil { ...@@ -341,7 +344,10 @@ public class ObjTransUtil {
device.getLifeStatus(), device.getLifeStatus(),
device.getInvisibleRange(), device.getInvisibleRange(),
device.getType(), device.getType(),
device.getSecretLevel() device.getSecretLevel(),
device.getInvisibleRangeName(),
device.getTypeName(),
device.getSecretLevelName()
); );
} }
} }
......
...@@ -236,7 +236,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -236,7 +236,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
allotNum++; allotNum++;
allotIds.add(d2.getId()); allotIds.add(d2.getId());
break; break;
case 12: case 15:
retiredNum++; retiredNum++;
retiredIds.add(d2.getId()); retiredIds.add(d2.getId());
break; break;
......
...@@ -3,6 +3,7 @@ package com.tykj.dev.misc.utils; ...@@ -3,6 +3,7 @@ package com.tykj.dev.misc.utils;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
...@@ -140,7 +141,7 @@ public class DeviceSeqUtil { ...@@ -140,7 +141,7 @@ public class DeviceSeqUtil {
if (strings.length==1){ if (strings.length==1){
if (isSingle(strings[0])) { if (isSingle(strings[0])) {
String num1 = strings[0].replaceAll(".*[^\\d](?=(\\d+))", ""); String num1 = strings[0].replaceAll(".*[^\\d](?=(\\d+))", "");
Long minSeq = Long.parseLong(num1); BigInteger minSeq = new BigInteger(num1);
for (int i = 0; i < num; i++) { for (int i = 0; i < num; i++) {
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
//拼接数字之前的字符串 //拼接数字之前的字符串
...@@ -149,7 +150,7 @@ public class DeviceSeqUtil { ...@@ -149,7 +150,7 @@ public class DeviceSeqUtil {
String codeFormat = "%0" + num1.length() + "d"; String codeFormat = "%0" + num1.length() + "d";
stringBuffer.append(String.format(codeFormat, minSeq)); stringBuffer.append(String.format(codeFormat, minSeq));
seqs.add(stringBuffer.toString()); seqs.add(stringBuffer.toString());
minSeq++; minSeq = minSeq.add(new BigInteger("1"));
} }
} }
else { else {
...@@ -184,7 +185,7 @@ public class DeviceSeqUtil { ...@@ -184,7 +185,7 @@ public class DeviceSeqUtil {
if (strings.length==1){ if (strings.length==1){
if (isSingle(strings[0])) { if (isSingle(strings[0])) {
String num1 = strings[0].replaceAll(".*[^\\d](?=(\\d+))", ""); String num1 = strings[0].replaceAll(".*[^\\d](?=(\\d+))", "");
Long minSeq = Long.parseLong(num1); BigInteger minSeq = new BigInteger(num1);
for (int i = 0; i < 1; i++) { for (int i = 0; i < 1; i++) {
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
//拼接数字之前的字符串 //拼接数字之前的字符串
...@@ -193,7 +194,7 @@ public class DeviceSeqUtil { ...@@ -193,7 +194,7 @@ public class DeviceSeqUtil {
String codeFormat = "%0" + num1.length() + "d"; String codeFormat = "%0" + num1.length() + "d";
stringBuffer.append(String.format(codeFormat, minSeq)); stringBuffer.append(String.format(codeFormat, minSeq));
seqs.add(stringBuffer.toString()); seqs.add(stringBuffer.toString());
minSeq++; minSeq = minSeq.add(new BigInteger("1"));
} }
} }
else { else {
...@@ -247,17 +248,17 @@ public class DeviceSeqUtil { ...@@ -247,17 +248,17 @@ public class DeviceSeqUtil {
if (num1.length() != num2.length()){ if (num1.length() != num2.length()){
throw new ApiException("序列号区间后面数字位数不相同"); throw new ApiException("序列号区间后面数字位数不相同");
} }
else if(Long.parseLong(num1)>Long.parseLong(num2)){ else if(new BigInteger(num1).compareTo(new BigInteger(num2)) > 0){
throw new ApiException("序列号区间前数字大于后数字"); throw new ApiException("序列号区间前数字大于后数字");
} }
else { else {
Long minSeq = Long.parseLong(num1); BigInteger minSeq = new BigInteger(num1);
Long maxSeq = Long.parseLong(num2); BigInteger maxSeq = new BigInteger(num2);
if (maxSeq<minSeq){ if (maxSeq.compareTo(minSeq) < 0){
throw new ApiException("前区间数字大于后区间"); throw new ApiException("前区间数字大于后区间");
} }
else { else {
while (minSeq<=maxSeq){ while (minSeq.compareTo(maxSeq)<=0){
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
//拼接数字之前的字符串 //拼接数字之前的字符串
stringBuffer.append(s1, 0, s1.length()-num1.length()); stringBuffer.append(s1, 0, s1.length()-num1.length());
...@@ -265,7 +266,7 @@ public class DeviceSeqUtil { ...@@ -265,7 +266,7 @@ public class DeviceSeqUtil {
String codeFormat = "%0"+ num1.length() +"d"; String codeFormat = "%0"+ num1.length() +"d";
stringBuffer.append(String.format(codeFormat,minSeq)); stringBuffer.append(String.format(codeFormat,minSeq));
stringList.add(stringBuffer.toString()); stringList.add(stringBuffer.toString());
minSeq++; minSeq = minSeq.add(new BigInteger("1"));
} }
} }
} }
...@@ -298,17 +299,17 @@ public class DeviceSeqUtil { ...@@ -298,17 +299,17 @@ public class DeviceSeqUtil {
String num1 = s1.replaceAll(".*[^\\d](?=(\\d+))", ""); String num1 = s1.replaceAll(".*[^\\d](?=(\\d+))", "");
//获得右区间最后几位的数字 //获得右区间最后几位的数字
String num2 = s2.replaceAll(".*[^\\d](?=(\\d+))", ""); String num2 = s2.replaceAll(".*[^\\d](?=(\\d+))", "");
if (num1.length() != num2.length() || Long.parseLong(num1)>Long.parseLong(num2)){ if (num1.length() != num2.length() || new BigInteger(num1).compareTo(new BigInteger(num2))>0){
return stringList; return stringList;
} }
else { else {
Long minSeq = Long.parseLong(num1); BigInteger minSeq = new BigInteger(num1);
Long maxSeq = Long.parseLong(num2); BigInteger maxSeq = new BigInteger(num2);
if (maxSeq<minSeq){ if (maxSeq.compareTo(minSeq)<0){
return stringList; return stringList;
} }
else { else {
while (minSeq<=maxSeq){ while (minSeq.compareTo(maxSeq)<=0){
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
//拼接数字之前的字符串 //拼接数字之前的字符串
stringBuffer.append(s1, 0, s1.length()-num1.length()); stringBuffer.append(s1, 0, s1.length()-num1.length());
...@@ -316,7 +317,7 @@ public class DeviceSeqUtil { ...@@ -316,7 +317,7 @@ public class DeviceSeqUtil {
String codeFormat = "%0"+ num1.length() +"d"; String codeFormat = "%0"+ num1.length() +"d";
stringBuffer.append(String.format(codeFormat,minSeq)); stringBuffer.append(String.format(codeFormat,minSeq));
stringList.add(stringBuffer.toString()); stringList.add(stringBuffer.toString());
minSeq++; minSeq = minSeq.add(new BigInteger("1"));
} }
} }
} }
...@@ -360,9 +361,9 @@ public class DeviceSeqUtil { ...@@ -360,9 +361,9 @@ public class DeviceSeqUtil {
for (int i = 1; i < sortedString.size(); i++) { for (int i = 1; i < sortedString.size(); i++) {
String index = sortedString.get(i); String index = sortedString.get(i);
if (getFirstString(lastSeq).equals(getFirstString(index))) { if (getFirstString(lastSeq).equals(getFirstString(index))) {
Long num1 = getLastNum(lastSeq); BigInteger num1 = getLastNum(lastSeq);
Long num2 = getLastNum(index); BigInteger num2 = getLastNum(index);
if (num2 == num1 + 1) { if (num2.compareTo(num1.add(new BigInteger("1")))==0) {
if (first == null) { if (first == null) {
first = lastSeq; first = lastSeq;
} }
...@@ -412,8 +413,8 @@ public class DeviceSeqUtil { ...@@ -412,8 +413,8 @@ public class DeviceSeqUtil {
/** /**
* 获取字符串最后的数字 * 获取字符串最后的数字
*/ */
private static Long getLastNum(String s){ private static BigInteger getLastNum(String s){
return Long.parseLong(s.replaceAll(".*[^\\d](?=(\\d+))", "")); return new BigInteger(s.replaceAll(".*[^\\d](?=(\\d+))", ""));
} }
private static String getFirstString(String s){ private static String getFirstString(String s){
......
...@@ -313,6 +313,10 @@ public class PackingController { ...@@ -313,6 +313,10 @@ public class PackingController {
return ResponseEntity.ok(map); return ResponseEntity.ok(map);
} }
BeanUtils.copyProperties(packingModelEdit,packingLibrary); BeanUtils.copyProperties(packingModelEdit,packingLibrary);
if (packingModelEdit.getModel()!=null){
packingLibrary.setName(packingModelEdit.getModel());
packingLibraryService.changeAllModel(packingLibrary.getId(),packingModelEdit.getModel());
}
packingLibraryService.update(packingLibrary); packingLibraryService.update(packingLibrary);
} }
else { else {
......
...@@ -123,4 +123,10 @@ public interface PackingLibraryService { ...@@ -123,4 +123,10 @@ public interface PackingLibraryService {
List<DeviceLibrary> getAllDevSeqs(Integer packingId); List<DeviceLibrary> getAllDevSeqs(Integer packingId);
Boolean modelIsExist(String model); Boolean modelIsExist(String model);
/**
* @param id 列装主键id
* 通过id修改该列装所有子列装型号
*/
void changeAllModel(Integer id,String model);
} }
...@@ -211,7 +211,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -211,7 +211,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
final String name = selectPack.getName(); final String name = selectPack.getName();
final Integer status = selectPack.getStatus(); final Integer status = selectPack.getStatus();
final Integer secretLevel = selectPack.getSecretLevel(); final Integer secretLevel = selectPack.getSecretLevel();
List<PackingLibrary> packingLibraryEntities = packingLibraryDao.findAll(getSelectSpecification6()); List<PackingLibrary> packingLibraryEntities = packingLibraryDao.findAll(getSelectSpecification6()).stream().sorted(Comparator.comparing(PackingLibrary::getName)).collect(Collectors.toList());
// .stream().filter(packingLibrary -> { // .stream().filter(packingLibrary -> {
// boolean isSameModel = model == null || packingLibrary.getModel().equals(model); // boolean isSameModel = model == null || packingLibrary.getModel().equals(model);
// boolean isSameName = name == null || packingLibrary.getName().equals(name); // boolean isSameName = name == null || packingLibrary.getName().equals(name);
...@@ -402,6 +402,19 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -402,6 +402,19 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return packingLibraryDao.findAll(predicateBuilder.build()).size()>0; return packingLibraryDao.findAll(predicateBuilder.build()).size()>0;
} }
/**
* @param id 列装主键id
* 通过id修改该列装所有子列装型号
*/
@Override
public void changeAllModel(Integer id,String model) {
PackingLibrary packingLibrary = getOne(id);
packingLibrary.setModel(model);
update(packingLibrary);
List<Integer> ids = packingLibraryDao.findAllByPartParentId(id).stream().map(PackingLibrary::getId).collect(Collectors.toList());
ids.forEach(integer -> changeAllModel(integer,model));
}
private Specification<PackingLibrary> getSelectSpecification(PackingLibrarySelectVo packingLibrarySelectVo) { private Specification<PackingLibrary> getSelectSpecification(PackingLibrarySelectVo packingLibrarySelectVo) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and(); PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
Integer level = userUtils.getCurrentUnitLevel(); Integer level = userUtils.getCurrentUnitLevel();
......
...@@ -137,6 +137,9 @@ public class DeviceScrapController { ...@@ -137,6 +137,9 @@ public class DeviceScrapController {
ScrapBill scrapBill = scrapBillService.getOne(taskBto.getBillId()); ScrapBill scrapBill = scrapBillService.getOne(taskBto.getBillId());
scrapBill.setFileName(uploadVo.getFileName()); scrapBill.setFileName(uploadVo.getFileName());
scrapBill.setFileUrl(uploadVo.getFileUrl()); scrapBill.setFileUrl(uploadVo.getFileUrl());
scrapBill.setUndertaker(uploadVo.getUndertaker());
scrapBill.setLeader(uploadVo.getLeader());
scrapBill.setSupervisor(uploadVo.getSupervisor());
scrapBillService.update(scrapBill); scrapBillService.update(scrapBill);
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId()); taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToEnd(taskBto); taskService.moveToEnd(taskBto);
......
...@@ -29,4 +29,13 @@ public class UploadVo { ...@@ -29,4 +29,13 @@ public class UploadVo {
@NotNull(message = "fileUrl不能为空") @NotNull(message = "fileUrl不能为空")
@ApiModelProperty(value = "报废单路径") @ApiModelProperty(value = "报废单路径")
private String fileUrl; private String fileUrl;
@ApiModelProperty(value = "监销人")
private String supervisor;
@ApiModelProperty(value = "主管领导")
private String leader;
@ApiModelProperty(value = "承办人")
private String undertaker;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论