|
|
|
@ -810,10 +810,13 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
BaseResponse<PageSimpleResponse<InvCodeResultEntity>> baseResponse =
|
|
|
|
|
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<InvCodeResultEntity>>>() {
|
|
|
|
|
});
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
Map<String, ThrInvResultResponse> mapArry = new HashMap<>();
|
|
|
|
|
List<ThrInvResultResponse> newArry = new ArrayList<>();
|
|
|
|
|
List<InvCodeResultEntity> ptxhInvResponses = baseResponse.getData().getList();
|
|
|
|
|
List<ThrInvResultResponse> thrInvResultResponses = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(ptxhInvResponses)) {
|
|
|
|
@ -845,13 +848,30 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
|
if (codeEntity == null) {
|
|
|
|
|
codeEntity = codeDao.selectOne(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getErrUdiCode, ptxhInvResponse.getBarcode()).last("limit 1"));
|
|
|
|
|
}
|
|
|
|
|
if (codeEntity != null)
|
|
|
|
|
thrInvResultResponse.setUdiCode(codeEntity.getCode());
|
|
|
|
|
else
|
|
|
|
|
thrInvResultResponse.setUdiCode(ptxhInvResponse.getBarcode());
|
|
|
|
|
thrInvResultResponses.add(thrInvResultResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (ThrInvResultResponse thrInvResultResponse : thrInvResultResponses) {
|
|
|
|
|
mapArry.merge(thrInvResultResponse.getUdiCode(), thrInvResultResponse, (existingValue, newValue) -> {
|
|
|
|
|
// Assuming reCount can be directly handled as an integer to avoid String to Integer conversions
|
|
|
|
|
int updatedReCount = Integer.parseInt(existingValue.getReCount()) + Integer.parseInt(newValue.getReCount());
|
|
|
|
|
existingValue.setReCount(String.valueOf(updatedReCount));
|
|
|
|
|
existingValue.setOutCount(existingValue.getReCount());
|
|
|
|
|
return existingValue;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
for (String key : mapArry.keySet()) {
|
|
|
|
|
newArry.add(mapArry.get(key));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
PageSimpleResponse<ThrInvResultResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l);
|
|
|
|
|
pageSimpleResponse.setList(thrInvResultResponses);
|
|
|
|
|
pageSimpleResponse.setTotal(newArry.size() + 0l);
|
|
|
|
|
pageSimpleResponse.setList(newArry);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
return baseResponse;
|
|
|
|
|