加入belong_work_order概念

highway
zhaoxiaolin 1 year ago
parent c1b6bfd2bb
commit 709af8c4a0

@ -57,15 +57,15 @@ public class MesReportWorkController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(MesReportWork mesReportWork) { public TableDataInfo list(MesReportWork mesReportWork) {
startPage(); startPage();
//默认时间范围T 00:00:00~T+1 00:00:00 // //默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ // if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){
mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start // mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now(); // LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1); // LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; // String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
mesReportWork.setCreateTimeEnd(dateEndStr);//end // mesReportWork.setCreateTimeEnd(dateEndStr);//end
} // }
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork); List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
return getDataTable(list); return getDataTable(list);
} }
@ -77,15 +77,15 @@ public class MesReportWorkController extends BaseController {
//@Log(title = "报工报表", businessType = BusinessType.EXPORT) //@Log(title = "报工报表", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, MesReportWork mesReportWork) { public void export(HttpServletResponse response, MesReportWork mesReportWork) {
//默认时间范围T 00:00:00~T+1 00:00:00 // //默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ // if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){
mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start // mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now(); // LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1); // LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; // String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
mesReportWork.setCreateTimeEnd(dateEndStr);//end // mesReportWork.setCreateTimeEnd(dateEndStr);//end
} // }
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork); List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
ExcelUtil<MesReportWork> util = new ExcelUtil<MesReportWork>(MesReportWork.class); ExcelUtil<MesReportWork> util = new ExcelUtil<MesReportWork>(MesReportWork.class);
util.exportExcel(response, list, "报工报表数据"); util.exportExcel(response, list, "报工报表数据");

@ -334,12 +334,15 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|| ||
"1".equals(work.getEndReport())//最终报工标识 "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.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w4报工 //pro_work_order status->w3报工--belong_work_order
mesReportWorkMapper.updateWorkOrderStatus(work); mesReportWorkMapper.updateWorkOrderStatus(work);
logger.info("工单"+work.getWorkorderCodeSap()+"关闭成功");
} }
return R.ok(); return R.ok();
} }

@ -203,12 +203,15 @@ public class OpenServiceImpl implements OpenService {
|| ||
"1".equals(work.getEndReport())//最终报工标识 "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.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w3报工 //pro_work_order status->w3报工--belong_work_order
openMapper.updateWorkOrderStatus(work); openMapper.updateWorkOrderStatus(work);
logger.info("工单"+work.getWorkorderCodeSap()+"关闭成功");
} }
return R.ok(); return R.ok();
} }

@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</update> </update>
<update id="updateWorkOrderStatus"> <update id="updateWorkOrderStatus">
update pro_order_workorder set status = #{status} where workorder_code = #{workorderCode} update pro_order_workorder set status = #{status} where belong_work_order = #{workorderCode}
</update> </update>
<!--获取在邦rfid 工单的信息--> <!--获取在邦rfid 工单的信息-->

@ -85,6 +85,15 @@ public class ProOrderWorkorder extends TreeEntity {
// TODO 暂时存放线体编码 // TODO 暂时存放线体编码
private String prodLineName; private String prodLineName;
private String belongWorkOrder;
public String getBelongWorkOrder() {
return belongWorkOrder;
}
public void setBelongWorkOrder(String belongWorkOrder) {
this.belongWorkOrder = belongWorkOrder;
}
public String getProdLineName() { public String getProdLineName() {
return prodLineName; return prodLineName;

@ -265,6 +265,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 获取单位换算值 // 获取单位换算值
Long conver = 1L; Long conver = 1L;
String belongWorkOrder = "0";
while (run) { while (run) {
// 先进行当前订单拆分操作 // 先进行当前订单拆分操作
// 1.设置工单信息,并更新订单信息至数据库 // 1.设置工单信息,并更新订单信息至数据库
@ -275,6 +276,11 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setParentOrder(parentOrder.toString()); workOrder.setParentOrder(parentOrder.toString());
workOrder.setSortNo(splitOrderDTO.getSortNo()); workOrder.setSortNo(splitOrderDTO.getSortNo());
if("0".equals(workOrder.getParentOrder())){
//20231127,加入belongWorkOrder概念
belongWorkOrder = workOrder.getWorkorderCode();
}
workOrder.setBelongWorkOrder(belongWorkOrder);
// 将工单信息更新至数据库 // 将工单信息更新至数据库
proOrderWorkorderMapper.insertProOrderWorkorder(workOrder); proOrderWorkorderMapper.insertProOrderWorkorder(workOrder);

@ -203,6 +203,7 @@
<if test="endFlag != null">end_flag,</if> <if test="endFlag != null">end_flag,</if>
<if test="carNum != null">car_num,</if> <if test="carNum != null">car_num,</if>
<if test="sortNo != null">sort_no,</if> <if test="sortNo != null">sort_no,</if>
<if test="belongWorkOrder != null">belong_work_order,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workorderId != null">#{workorderId},</if> <if test="workorderId != null">#{workorderId},</if>
@ -238,6 +239,7 @@
<if test="endFlag != null">#{endFlag},</if> <if test="endFlag != null">#{endFlag},</if>
<if test="carNum != null">#{carNum},</if> <if test="carNum != null">#{carNum},</if>
<if test="sortNo != null">#{sortNo},</if> <if test="sortNo != null">#{sortNo},</if>
<if test="belongWorkOrder != null">#{belongWorkOrder},</if>
</trim> </trim>
</insert> </insert>
<insert id="createPrepare"> <insert id="createPrepare">

Loading…
Cancel
Save