|
|
@ -1,6 +1,7 @@
|
|
|
|
package com.op.open.service.impl;
|
|
|
|
package com.op.open.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
|
import com.op.common.core.domain.R;
|
|
|
|
import com.op.common.core.domain.R;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
@ -190,11 +191,11 @@ public class OpenServiceImpl implements OpenService {
|
|
|
|
lt_hwList.add(lthw);
|
|
|
|
lt_hwList.add(lthw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
logger.info(work.getWorkorderCodeSap()+"母sap工单报工:工单"+work.getWorkorderCode()+"mes_report_work_consume没有数据");
|
|
|
|
logger.info(work.getWorkorderCodeSap()+"母sap工单报工:工单"+work.getWorkorderCode()+"==mes_report_work_consume没有数据");
|
|
|
|
return R.fail("mes_report_work_consume没有数据");
|
|
|
|
//return R.fail("mes_report_work_consume没有数据");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sapRFW.setLt_hwList(lt_hwList);
|
|
|
|
sapRFW.setLt_hwList(lt_hwList);
|
|
|
|
|
|
|
|
logger.info(work.getWorkorderCodeSap()+"母sap工单报工请求:"+ JSONObject.toJSONString(sapRFW));
|
|
|
|
R r = remoteSapService.sapRFWOrder(sapRFW);
|
|
|
|
R r = remoteSapService.sapRFWOrder(sapRFW);
|
|
|
|
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果:"+r.getCode()+","+r.getData()+","+r.getMsg());
|
|
|
|
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果:"+r.getCode()+","+r.getData()+","+r.getMsg());
|
|
|
|
//上传成功,更改mes_report_work状态
|
|
|
|
//上传成功,更改mes_report_work状态
|
|
|
@ -209,9 +210,7 @@ public class OpenServiceImpl implements OpenService {
|
|
|
|
//工单完成数量>工单数量:关闭订单
|
|
|
|
//工单完成数量>工单数量:关闭订单
|
|
|
|
MesReportWorkDTO proResult = openMapper.getProdResult(work);
|
|
|
|
MesReportWorkDTO proResult = openMapper.getProdResult(work);
|
|
|
|
//ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
|
|
|
|
//ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
|
|
|
|
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0
|
|
|
|
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0||"1".equals(work.getEndReport())//最终报工标识
|
|
|
|
||
|
|
|
|
|
|
|
|
"1".equals(work.getEndReport())//最终报工标识
|
|
|
|
|
|
|
|
){
|
|
|
|
){
|
|
|
|
logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
|
|
|
|
logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
|
|
|
|
|
|
|
|
|
|
|
|