diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index 5571d018..bdd116a7 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -57,15 +57,15 @@ public class MesReportWorkController extends BaseController { @GetMapping("/list") public TableDataInfo list(MesReportWork mesReportWork) { startPage(); - //默认时间范围T 00:00:00~T+1 00:00:00 - if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ - mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start - LocalDate date = LocalDate.now(); - LocalDate dateEnd = date.plusDays(1); - DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; - mesReportWork.setCreateTimeEnd(dateEndStr);//end - } +// //默认时间范围T 00:00:00~T+1 00:00:00 +// if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ +// mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start +// LocalDate date = LocalDate.now(); +// LocalDate dateEnd = date.plusDays(1); +// DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); +// String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; +// mesReportWork.setCreateTimeEnd(dateEndStr);//end +// } List list = mesReportWorkService.selectMesReportWorkList(mesReportWork); return getDataTable(list); } @@ -77,15 +77,15 @@ public class MesReportWorkController extends BaseController { //@Log(title = "报工报表", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MesReportWork mesReportWork) { - //默认时间范围T 00:00:00~T+1 00:00:00 - if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ - mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start - LocalDate date = LocalDate.now(); - LocalDate dateEnd = date.plusDays(1); - DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; - mesReportWork.setCreateTimeEnd(dateEndStr);//end - } +// //默认时间范围T 00:00:00~T+1 00:00:00 +// if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ +// mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start +// LocalDate date = LocalDate.now(); +// LocalDate dateEnd = date.plusDays(1); +// DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); +// String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; +// mesReportWork.setCreateTimeEnd(dateEndStr);//end +// } List list = mesReportWorkService.selectMesReportWorkList(mesReportWork); ExcelUtil util = new ExcelUtil(MesReportWork.class); util.exportExcel(response, list, "报工报表数据"); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 116f6026..6ef93e07 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -334,12 +334,15 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { || "1".equals(work.getEndReport())//最终报工标识 ){ + logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); //工单完成,关闭工单 - remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); + R r2= remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); + logger.info("工单"+work.getWorkorderCodeSap()+"sap关闭"+r2.getCode()+",返回信息:"+r2.getMsg()); work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); - //pro_work_order status->w4报工 + //pro_work_order status->w3报工--belong_work_order mesReportWorkMapper.updateWorkOrderStatus(work); + logger.info("工单"+work.getWorkorderCodeSap()+"关闭成功"); } return R.ok(); } diff --git a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java index 6cc06aee..f0e10cb3 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java @@ -203,12 +203,15 @@ public class OpenServiceImpl implements OpenService { || "1".equals(work.getEndReport())//最终报工标识 ){ + logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); //工单完成,关闭工单 - remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); + R rclose = remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); + logger.info("工单"+work.getWorkorderCodeSap()+"sap关闭"+r.getCode()+",返回信息:"+r.getMsg()); work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); - //pro_work_order status->w3报工 + //pro_work_order status->w3报工--belong_work_order openMapper.updateWorkOrderStatus(work); + logger.info("工单"+work.getWorkorderCodeSap()+"关闭成功"); } return R.ok(); } diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index 2ca18af7..4dd3944d 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update pro_order_workorder set status = #{status} where workorder_code = #{workorderCode} + update pro_order_workorder set status = #{status} where belong_work_order = #{workorderCode} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java index 2f7acc72..01c5dba5 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java @@ -85,6 +85,15 @@ public class ProOrderWorkorder extends TreeEntity { // TODO 暂时存放线体编码 private String prodLineName; + private String belongWorkOrder; + + public String getBelongWorkOrder() { + return belongWorkOrder; + } + + public void setBelongWorkOrder(String belongWorkOrder) { + this.belongWorkOrder = belongWorkOrder; + } public String getProdLineName() { return prodLineName; diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 3d0b6137..6b1a9733 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -265,6 +265,7 @@ public class ProOrderServiceImpl implements IProOrderService { // 获取单位换算值 Long conver = 1L; + String belongWorkOrder = "0"; while (run) { // 先进行当前订单拆分操作 // 1.设置工单信息,并更新订单信息至数据库 @@ -275,6 +276,11 @@ public class ProOrderServiceImpl implements IProOrderService { workOrder.setParentOrder(parentOrder.toString()); workOrder.setSortNo(splitOrderDTO.getSortNo()); + if("0".equals(workOrder.getParentOrder())){ + //20231127,加入belongWorkOrder概念 + belongWorkOrder = workOrder.getWorkorderCode(); + } + workOrder.setBelongWorkOrder(belongWorkOrder); // 将工单信息更新至数据库 proOrderWorkorderMapper.insertProOrderWorkorder(workOrder); diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 3528ec14..e49372ef 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -203,6 +203,7 @@ end_flag, car_num, sort_no, + belong_work_order, #{workorderId}, @@ -238,6 +239,7 @@ #{endFlag}, #{carNum}, #{sortNo}, + #{belongWorkOrder},