|
|
@@ -115,12 +115,12 @@ public class KwcContractLogisticsService {
|
|
|
}
|
|
|
|
|
|
private void checkParam(LogisticsBaseInfoReqVo baseInfo, List<LogisticsGoodsInfoReqVo> goodsInfo) {
|
|
|
- if(Objects.nonNull(baseInfo)) {
|
|
|
- if(StringUtils.isNotBlank(baseInfo.getContractCode()) && baseInfo.getContractCode().length() > 20) {
|
|
|
+ if (Objects.nonNull(baseInfo)) {
|
|
|
+ if (StringUtils.isNotBlank(baseInfo.getContractCode()) && baseInfo.getContractCode().length() > 20) {
|
|
|
throw new SystemException("合同编号超长!");
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotBlank(baseInfo.getContractName()) && baseInfo.getContractName().length() > 20) {
|
|
|
+ if (StringUtils.isNotBlank(baseInfo.getContractName()) && baseInfo.getContractName().length() > 20) {
|
|
|
throw new SystemException("合同名称超长!");
|
|
|
}
|
|
|
}
|
|
|
@@ -131,11 +131,11 @@ public class KwcContractLogisticsService {
|
|
|
throw new SystemException("商品名称超长!");
|
|
|
}
|
|
|
|
|
|
- if(Objects.nonNull(logisticsGoodsInfoReqVo.getLoss()) && !RegularUtils.matchNumberWithFix(logisticsGoodsInfoReqVo.getLoss().toString(), 5, 2)) {
|
|
|
+ if (Objects.nonNull(logisticsGoodsInfoReqVo.getLoss()) && !RegularUtils.matchNumberWithFix(logisticsGoodsInfoReqVo.getLoss().toString(), 5, 2)) {
|
|
|
throw new SystemException("合理损耗超长!");
|
|
|
}
|
|
|
|
|
|
- if(Objects.nonNull(logisticsGoodsInfoReqVo.getDeficitPrice()) && !RegularUtils.matchNumberWithFix(logisticsGoodsInfoReqVo.getDeficitPrice().toString(), 5, 2)) {
|
|
|
+ if (Objects.nonNull(logisticsGoodsInfoReqVo.getDeficitPrice()) && !RegularUtils.matchNumberWithFix(logisticsGoodsInfoReqVo.getDeficitPrice().toString(), 5, 2)) {
|
|
|
throw new SystemException("扣亏货值超长!");
|
|
|
}
|
|
|
}
|
|
|
@@ -379,13 +379,13 @@ public class KwcContractLogisticsService {
|
|
|
String res = OkHttpUtils.doPostUploadFile("http://10.10.10.149:8840/v1/sign/getFlow", map);
|
|
|
}
|
|
|
|
|
|
- public static File getFileByHttpURL(String newUrl, String fileName){
|
|
|
+ public static File getFileByHttpURL(String newUrl, String fileName) {
|
|
|
String[] suffix = newUrl.split("/");
|
|
|
//得到最后一个分隔符后的名字
|
|
|
File file = null;
|
|
|
InputStream inputStream = null;
|
|
|
OutputStream outputStream = null;
|
|
|
- try{
|
|
|
+ try {
|
|
|
file = File.createTempFile("", fileName);
|
|
|
URL urlFile = new URL(newUrl);
|
|
|
inputStream = urlFile.openStream();
|
|
|
@@ -393,12 +393,12 @@ public class KwcContractLogisticsService {
|
|
|
|
|
|
int bytesRead = 0;
|
|
|
byte[] buffer = new byte[8192];
|
|
|
- while ((bytesRead=inputStream.read(buffer,0,8192))!=-1) {
|
|
|
+ while ((bytesRead = inputStream.read(buffer, 0, 8192)) != -1) {
|
|
|
outputStream.write(buffer, 0, bytesRead);
|
|
|
}
|
|
|
- }catch (Exception e) {
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
try {
|
|
|
if (null != outputStream) {
|
|
|
outputStream.close();
|
|
|
@@ -517,6 +517,9 @@ public class KwcContractLogisticsService {
|
|
|
@Transactional(rollbackFor = {})
|
|
|
public void complete(CompleteReqVo reqVo) {
|
|
|
KwcContractLogistics kwcContractLogistic = kwcContractLogisticsMapper.selectById(reqVo.getId());
|
|
|
+ if (Objects.isNull(kwcContractLogistic)) {
|
|
|
+ throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.CONTRACT_NOT_EXISTS);
|
|
|
+ }
|
|
|
if (!kwcContractLogistic.getStatus().equals(ContractStatusEnum.SIGNED.getCode())) {
|
|
|
throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_028);
|
|
|
}
|
|
|
@@ -573,6 +576,7 @@ public class KwcContractLogisticsService {
|
|
|
if (CollectionUtils.isEmpty(queryListResDtos)) {
|
|
|
return PageHelperUtil.getPageResult(new PageInfo<>());
|
|
|
}
|
|
|
+
|
|
|
List<QueryListResVo> list = getQueryListResVos(queryListResDtos);
|
|
|
return PageHelperUtil.getPageResult(new PageInfo<>(list), queryListResDtos, reqVo.getPageSize());
|
|
|
}
|
|
|
@@ -684,7 +688,10 @@ public class KwcContractLogisticsService {
|
|
|
|
|
|
QueryListReqDto queryListReqDto = new QueryListReqDto();
|
|
|
BeanUtils.copyProperties(reqVo, queryListReqDto);
|
|
|
- queryListReqDto.setEntId(LoginUserHolder.getEntId());
|
|
|
+ if (Objects.isNull(reqVo.getEntId())) {
|
|
|
+ queryListReqDto.setEntId(LoginUserHolder.getEntId());
|
|
|
+ }
|
|
|
+
|
|
|
List<QueryListResDto> queryListResDtoList = kwcContractLogisticsMapper.queryList(queryListReqDto);
|
|
|
if (CollectionUtils.isNotEmpty(queryListResDtoList)) {
|
|
|
Map<Integer, List<QueryListResDto>> collect = queryListResDtoList.stream().collect(Collectors.groupingBy(QueryListResDto::getStatus));
|