报工时候关闭子母工单

highway
zhaoxiaolin 12 months ago
parent 3c4934ce92
commit 34e131289b

@ -108,4 +108,6 @@ public interface MesReportWorkMapper {
List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO qo);
List<ProOrderWorkorder> getBatchList(ProOrderWorkorder proOrderWorkorder);
List<String> getSapWorkOrder(String workorderCode);
}

@ -336,8 +336,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
){
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭工单
R r2= remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
logger.info("工单"+work.getWorkorderCodeSap()+"sap关闭"+r2.getCode()+",返回信息:"+r2.getMsg());
List<String> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){
R r2= remoteSapService.sapCloseOrder(sapWorkOrder);
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg());
}
work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w3报工--belong_work_order

@ -443,6 +443,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{workorderCode}
</select>
<select id="getSapWorkOrder" resultType="java.lang.String">
select workorder_code_sap from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -41,5 +41,7 @@ public interface OpenMapper {
ProOrderWorkorderDTO getOrderByCode(String workorderCode);
List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
List<String> getSapWorkOrder(String workorderCode);
}

@ -204,9 +204,13 @@ public class OpenServiceImpl implements OpenService {
"1".equals(work.getEndReport())//最终报工标识
){
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭工单
R rclose = remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
logger.info("工单"+work.getWorkorderCodeSap()+"sap关闭"+r.getCode()+",返回信息:"+r.getMsg());
List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){
R rclose = remoteSapService.sapCloseOrder(sapWorkOrder);
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg());
}
work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w3报工--belong_work_order
@ -222,19 +226,6 @@ public class OpenServiceImpl implements OpenService {
return openMapper.getLGInfo(wcsDTO);
}
// //根据工单子单编码获取最顶级订单的母单
// private ProOrderWorkorderDTO getTopOrder(String workorderCode) {
// //pro_order_workorder
// ProOrderWorkorderDTO topOrder = openMapper.getOrderByCode(workorderCode);
// while (!"0".equals(topOrder.getParentOrder()) && StringUtils.isNotEmpty(topOrder.getParentOrder())) {
// //pro_order_workorder
// topOrder = openMapper.getOrderByCode(topOrder.getParentOrder());
// }
// return topOrder;
// }
public static void main(String args[]){
DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate today = LocalDate.now();

@ -122,5 +122,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder pow on pw.workorder_id = pow.workorder_id
where CONVERT(varchar(10),plan_time, 120) = #{reqTime}
</select>
<select id="getSapWorkOrder" resultType="java.lang.String">
select workorder_code_sap from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save