|
|
|
@ -630,6 +630,7 @@ public class NjxyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse queryUdiInvOutScanCode(ForInvOutScanCodeFilter forInvOutScanCodeFilter) {
|
|
|
|
|
log.error(forInvOutScanCodeFilter.toString());
|
|
|
|
|
ForInvOutScanCodeRequest forInvOutScanCodeRequest = new ForInvOutScanCodeRequest();
|
|
|
|
|
IoOrderRequest ioOrderRequest = new IoOrderRequest();
|
|
|
|
|
ioOrderRequest.setCreateTime(new Date());
|
|
|
|
@ -655,7 +656,9 @@ public class NjxyyClient extends CommonHttpClient {
|
|
|
|
|
List<ForInvOutScanCodeFilter.Highvalue> highvalues = forInvOutScanCodeFilter.getHighvaluelist();
|
|
|
|
|
if (CollUtil.isEmpty(highvalues))
|
|
|
|
|
return ResultVOUtils.error(500, "耗材使用信息不能为空!");
|
|
|
|
|
List<IoOrderCodeRequest> codeRequestList = new ArrayList<>();
|
|
|
|
|
List<IoOrderCodeRequest> codeRequestListYb = new ArrayList<>();
|
|
|
|
|
List<IoOrderCodeRequest> codeRequestListJs = new ArrayList<>();
|
|
|
|
|
List<IoOrderCodeRequest> codeRequestListYys = new ArrayList<>();
|
|
|
|
|
for (ForInvOutScanCodeFilter.Highvalue highvalue : highvalues) {
|
|
|
|
|
IoOrderCodeRequest codeRequest = new IoOrderCodeRequest();
|
|
|
|
|
codeRequest.setCode(highvalue.getUdicode());
|
|
|
|
@ -681,28 +684,99 @@ public class NjxyyClient extends CommonHttpClient {
|
|
|
|
|
if (IntUtil.value(udirelEntity.getPurType()) == 2) {
|
|
|
|
|
return ResultVOUtils.success("YAS" + CustomUtil.getUnitId());
|
|
|
|
|
}
|
|
|
|
|
if (codeRequest.getCount() > 0) {
|
|
|
|
|
if (codeRequest.getCount() == 0) {
|
|
|
|
|
return ResultVOUtils.error(500, "扫码数量不能为零!");
|
|
|
|
|
} else if (codeRequest.getCount() > 0) {
|
|
|
|
|
//收费入库
|
|
|
|
|
ioOrderRequest.setAction("SC20250702001");
|
|
|
|
|
} else {
|
|
|
|
|
//收费退库
|
|
|
|
|
ioOrderRequest.setAction("SC20250702002");
|
|
|
|
|
//判断库存
|
|
|
|
|
List<IoCodeEntity> codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC20250702002"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getErrUdiCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC20250702002"));
|
|
|
|
|
|
|
|
|
|
if (IntUtil.value(udirelEntity.getPurType()) == 1) {
|
|
|
|
|
//收费退库 入账
|
|
|
|
|
ioOrderRequest.setAction("SC20250702002");
|
|
|
|
|
//判断库存
|
|
|
|
|
List<IoCodeEntity> codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC20250702002"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getErrUdiCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC20250702002"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "该UDI码未出库!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
codeRequestListYb.add(codeRequest);
|
|
|
|
|
|
|
|
|
|
} else if (IntUtil.value(udirelEntity.getPurType()) == 2) {
|
|
|
|
|
//收费退库 预验收
|
|
|
|
|
ioOrderRequest.setAction("SC70927695263969");
|
|
|
|
|
//判断库存
|
|
|
|
|
List<IoCodeEntity> codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC70927695263969"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getErrUdiCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC70927695263969"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "该UDI码未出库!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
codeRequestListYys.add(codeRequest);
|
|
|
|
|
|
|
|
|
|
} else if (IntUtil.value(udirelEntity.getPurType()) == 3) {
|
|
|
|
|
//收费退库 寄售
|
|
|
|
|
ioOrderRequest.setAction("SC70927877557094");
|
|
|
|
|
//判断库存
|
|
|
|
|
List<IoCodeEntity> codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC70927877557094"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "该UDI码未出库!");
|
|
|
|
|
codeEntities = codeDao.selectList(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getErrUdiCode, codeRequest.getCode()).eq(IoCodeEntity::getAction, "SC70927877557094"));
|
|
|
|
|
if (CollUtil.isEmpty(codeEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "该UDI码未出库!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
codeRequestListJs.add(codeRequest);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
codeRequestList.add(codeRequest);
|
|
|
|
|
}
|
|
|
|
|
forInvOutScanCodeRequest.setCodeRequestList(codeRequestList);
|
|
|
|
|
forInvOutScanCodeRequest.setIoOrderRequest(ioOrderRequest);
|
|
|
|
|
String response = httpClient.postUDIWMSJson(thirdSysConfig.getPostInvOutScanCode(), forInvOutScanCodeRequest);
|
|
|
|
|
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
|
|
|
|
|
String billNo = "";
|
|
|
|
|
if (CollUtil.isNotEmpty(codeRequestListYb)){
|
|
|
|
|
forInvOutScanCodeRequest.setCodeRequestList(codeRequestListYb);
|
|
|
|
|
forInvOutScanCodeRequest.setIoOrderRequest(ioOrderRequest);
|
|
|
|
|
String response = httpClient.postUDIWMSJson(thirdSysConfig.getPostInvOutScanCode(), forInvOutScanCodeRequest);
|
|
|
|
|
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
|
|
|
|
|
if (baseResponse.getCode() == 20000){
|
|
|
|
|
ForInvOutScanCodeResponse forInvOutScanCodeResponse = JSONObject.parseObject(String.valueOf(baseResponse.getData()), ForInvOutScanCodeResponse.class);
|
|
|
|
|
billNo = billNo + forInvOutScanCodeResponse.getBillNo() + ";";
|
|
|
|
|
}else {
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(codeRequestListYys)){
|
|
|
|
|
ioOrderRequest.setInvCode("1000001");
|
|
|
|
|
forInvOutScanCodeRequest.setCodeRequestList(codeRequestListYys);
|
|
|
|
|
forInvOutScanCodeRequest.setIoOrderRequest(ioOrderRequest);
|
|
|
|
|
String response = httpClient.postUDIWMSJson(thirdSysConfig.getPostInvOutScanCode(), forInvOutScanCodeRequest);
|
|
|
|
|
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
|
|
|
|
|
if (baseResponse.getCode() == 20000){
|
|
|
|
|
ForInvOutScanCodeResponse forInvOutScanCodeResponse = JSONObject.parseObject(String.valueOf(baseResponse.getData()), ForInvOutScanCodeResponse.class);
|
|
|
|
|
billNo = billNo + forInvOutScanCodeResponse.getBillNo() + ";";
|
|
|
|
|
}else {
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(codeRequestListJs)){
|
|
|
|
|
ioOrderRequest.setInvCode("1000002");
|
|
|
|
|
forInvOutScanCodeRequest.setCodeRequestList(codeRequestListJs);
|
|
|
|
|
forInvOutScanCodeRequest.setIoOrderRequest(ioOrderRequest);
|
|
|
|
|
String response = httpClient.postUDIWMSJson(thirdSysConfig.getPostInvOutScanCode(), forInvOutScanCodeRequest);
|
|
|
|
|
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
|
|
|
|
|
if (baseResponse.getCode() == 20000){
|
|
|
|
|
ForInvOutScanCodeResponse forInvOutScanCodeResponse = JSONObject.parseObject(String.valueOf(baseResponse.getData()), ForInvOutScanCodeResponse.class);
|
|
|
|
|
billNo = billNo + forInvOutScanCodeResponse.getBillNo() + ";";
|
|
|
|
|
}else {
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success(billNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|