|
@@ -213,13 +213,13 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
public void returnOfMaterial(long parseLong) {
|
|
|
ProcessMaterialVo pm = processService.getMaterialNodeById(parseLong);
|
|
|
if(pm==null||pm.getWarehouse()==null){
|
|
|
- log.error("出库流程:"+parseLong+" 未获取到出库流程或未获取到用友仓库id");
|
|
|
+ log.error("退库流程:"+parseLong+" 未获取到出库流程或未获取到用友仓库id");
|
|
|
return;
|
|
|
}
|
|
|
YyOrgUnit yyOrg = orgUnitService.getOne(new QueryWrapper<YyOrgUnit>().lambda().eq(YyOrgUnit::getTenantId, pm.getTenantId())
|
|
|
.eq(YyOrgUnit::getIsDel, FlowConstant.SHORT_ZERO));
|
|
|
if(yyOrg==null){
|
|
|
- log.error("出库流程:"+parseLong+" 未获取到用友对应组织信息请先维护");
|
|
|
+ log.error("退库流程:"+parseLong+" 未获取到用友对应组织信息请先维护");
|
|
|
return;
|
|
|
}
|
|
|
Date date = new Date();
|
|
@@ -254,7 +254,7 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
|
|
|
List<MaterialItemVo> pms = pmaterialService.getMaterialOutIn(pm.getProcessId(),pm.getNodeId(),FlowConstant.SHORT_FIVE);
|
|
|
if(CollUtil.isEmpty(pms)){
|
|
|
- log.error("出库流程:"+parseLong+"未查询到出库物料!");
|
|
|
+ log.error("退库流程:"+parseLong+"未查询到退库物料!");
|
|
|
return;
|
|
|
}
|
|
|
List<MaterialItemRetDto> itemOutDtos = new ArrayList<>();
|
|
@@ -363,7 +363,7 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
private void pushMaterialRetToYy(MaterialRetDto retDto, List<MaterialItemOutIn> itemios, MaterialOutIn outIn,int i) {
|
|
|
String accessToken = accessTokenService.getAccessToken();
|
|
|
if (accessToken == null || "".equals(accessToken)) {
|
|
|
- log.error("出库流程:"+ outIn.getProcessId() +"获取accessToken失败,请稍后在试 ");
|
|
|
+ log.error("退库流程:"+ outIn.getProcessId() +"获取accessToken失败,请稍后在试 ");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -373,17 +373,25 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
outDto.setBustype(FlowConstant.OUT_BUSTYPE);
|
|
|
Map<String,Object> remap = new HashMap<>();
|
|
|
remap.put("data", outDto);
|
|
|
- log.info("退料请求参数:"+JSON.toJSONString(remap));
|
|
|
+ log.info("退库请求参数:"+JSON.toJSONString(remap));
|
|
|
String parentJson = HttpClientUtil.doPost(url, remap);
|
|
|
- log.info("信息查询结果:{}",parentJson);
|
|
|
+ log.info("退库信息查询结果:{}",parentJson);
|
|
|
|
|
|
RespMaterialRetDto dto = JSON.parseObject(parentJson,RespMaterialRetDto.class);
|
|
|
- if(dto!=null&&FlowConstant.STRING_TWO_HUNDRED.equals(dto.getCode())) {
|
|
|
- outIn.setYyRes(FlowConstant.SHORT_ONE);
|
|
|
- outIn.setCode("TL");
|
|
|
+ log.info("退库转换后的{}",JSON.toJSONString(dto));
|
|
|
+ if(dto!=null&&FlowConstant.STRING_TWO_HUNDRED.equals(dto.getCode())) { outIn.setYyRes(FlowConstant.SHORT_ONE);
|
|
|
if(dto.getData()!=null) {
|
|
|
- InOutInfoDto infoDto = dto.getData();
|
|
|
- fillOutMaterialId(itemios, outIn, infoDto, infoDto.getOthInRecords());
|
|
|
+ outIn.setSucessCount(dto.getData().getSucessCount());
|
|
|
+ outIn.setFailCount(dto.getData().getFailCount());
|
|
|
+ outIn.setMessages(dto.getData().getMessages());
|
|
|
+
|
|
|
+ if(CollUtil.isNotEmpty(dto.getData().getInfos())) {
|
|
|
+ for (InOutInfoDto infoDto:dto.getData().getInfos()) {
|
|
|
+
|
|
|
+ fillInMaterialId(itemios, outIn, infoDto, infoDto.getMaterOuts());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
this.updateById(outIn);
|
|
|
mItemOutInService.updateBatchById(itemios);
|
|
@@ -449,6 +457,7 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
outIn.setSucessCount(dto.getData().getSucessCount());
|
|
|
outIn.setFailCount(dto.getData().getFailCount());
|
|
|
outIn.setMessages(dto.getData().getMessages());
|
|
|
+
|
|
|
if(CollUtil.isNotEmpty(dto.getData().getInfos())) {
|
|
|
for (InOutInfoDto infoDto:dto.getData().getInfos()) {
|
|
|
if(1==type) {
|
|
@@ -527,6 +536,26 @@ public class MaterialOutInServiceImpl extends ServiceImpl<MaterialOutInMapper, M
|
|
|
* @param materOuts2 用友接口返回物料详情信息
|
|
|
*/
|
|
|
private void fillOutMaterialId(List<MaterialItemOutIn> itemios, MaterialOutIn outIn, InOutInfoDto infoDto, List<YyMaterOutDto> materOuts2) {
|
|
|
+
|
|
|
+
|
|
|
+ if (outIn.getWarehouse().equals(infoDto.getWarehouse())||infoDto.getWarehouse().equals(outIn.getOutWarehouse())) {
|
|
|
+ outIn.setYyId(infoDto.getId());
|
|
|
+ outIn.setCode(infoDto.getCode());
|
|
|
+ List<YyMaterOutDto> materOuts = materOuts2;
|
|
|
+ fillItems(itemios, materOuts);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 退料返回参数填充
|
|
|
+ * @param itemios 用友出入库物料信息详情
|
|
|
+ * @param outIn 用友出入库记录
|
|
|
+ * @param infoDto 用友接口返回信息
|
|
|
+ * @param materOuts2 用友接口返回物料详情信息
|
|
|
+ */
|
|
|
+ private void fillInMaterialId(List<MaterialItemOutIn> itemios, MaterialOutIn outIn, InOutInfoDto infoDto, List<YyMaterOutDto> materOuts2) {
|
|
|
+
|
|
|
+
|
|
|
if (outIn.getWarehouse().equals(infoDto.getWarehouse())||infoDto.getWarehouse().equals(outIn.getOutWarehouse())) {
|
|
|
outIn.setYyId(infoDto.getId());
|
|
|
outIn.setCode(infoDto.getCode());
|