From 2160c3d6227c9c1d8f56bcbfa3e95e6c262526ae Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 3 Jan 2024 10:54:27 +0800 Subject: [PATCH] add table sxworkcelllineoffrecord --- .../busi/jx/JxProdBusiStrategyCommonService.java | 21 ++++++ .../mes/pcn/pojo/bean/SxWorkCellLineOffRecord.java | 75 ++++++++++++++++++++++ .../SxWorkCellLineOffRecordRepository.java | 14 ++++ 3 files changed, 110 insertions(+) create mode 100644 modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/bean/SxWorkCellLineOffRecord.java create mode 100644 modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/repository/SxWorkCellLineOffRecordRepository.java diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/jx/JxProdBusiStrategyCommonService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/jx/JxProdBusiStrategyCommonService.java index 1846ca6..ddfb53f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/jx/JxProdBusiStrategyCommonService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/jx/JxProdBusiStrategyCommonService.java @@ -115,6 +115,9 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi private SxProductOffLineRepository productOffLineRepository; @Autowired + private SxWorkCellLineOffRecordRepository workCellLineOffRecordRepository; + + @Autowired private IPartExtService partExtService; @Autowired @@ -752,6 +755,8 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi doProductOffLine(params); + saveLineOffRecord(params); + return stepResult; } @@ -971,6 +976,22 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi } } + private void saveLineOffRecord(JxProdBusiStrategyParamsBuilder params) { + SxWorkCellLineOffRecord record = new SxWorkCellLineOffRecord(); + record.setWorkCenterCode(params.getWorkCenterCode()); + record.setWorkCellCode(params.getWorkCellCode()); + record.setWorkTime(params.getWorkCenterExtDb().getWorkTime()); + record.setShiftCode(params.getWorkCenterExtDb().getShiftCode()); + record.setProductSn(params.getProductSn()); + record.setWorkOrderNo(params.getOrderModel().getOrderNo()); + record.setPartNo(params.getOrderModel().getPartNo()); + record.setWorkOrderType(params.getOrderModel().getWorkOrderType()); + record.setSystemSyncStatus(MesPcnExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue()); + record.setOrganizeCode(params.getOrganizeCode()); + ConvertBean.serviceModelInitialize(record, params.getUserInfo()); + workCellLineOffRecordRepository.insert(record); + } + @Override public void execProcessing(JxProdBusiStrategyParamsBuilder params) { diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/bean/SxWorkCellLineOffRecord.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/bean/SxWorkCellLineOffRecord.java new file mode 100644 index 0000000..0b8210b --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/bean/SxWorkCellLineOffRecord.java @@ -0,0 +1,75 @@ +package cn.estsh.i3plus.ext.mes.pcn.pojo.bean; + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Index; +import javax.persistence.Table; +import java.io.Serializable; + +/** + * @DESCRIPTION: 松下工位节拍采集记录 + * @USER: wangjie + * @DATE: 2023-02-03 16:11 + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "SX_WORK_CELL_LINE_OFF_RECORD", indexes = { + @Index(columnList = "SYSTEM_SYNC_STATUS"), + @Index(columnList = "WORK_CENTER_CODE") +}) +@Api("松下工位下线记录") +public class SxWorkCellLineOffRecord extends BaseBean implements Serializable { + + private static final long serialVersionUID = -6422908784847731386L; + + @Column(name = "WORK_CENTER_CODE") + @ApiParam("生产线代码") + private String workCenterCode; + + @Column(name = "WORK_CELL_CODE") + @ApiParam("工位代码") + private String workCellCode; + + @Column(name = "SHIFT_CODE") + @ApiParam("班次代码") + private String shiftCode; + + @Column(name = "WORK_TIME") + @ApiParam("作业时间") + private String workTime; + + @Column(name = "PRODUCT_SN") + @ApiParam("产品条码") + private String productSn; + + @Column(name = "WORK_ORDER_NO") + @ApiParam("生产工单号") + private String workOrderNo; + + @Column(name = "PART_NO") + @ApiParam("物料号") + private String partNo; + + @Column(name = "WORK_ORDER_TYPE") + @ApiParam("工单类型") + private Integer workOrderType; + + @Column(name = "SYSTEM_SYNC_STATUS") + @ColumnDefault("2") + @ApiParam(value = "系统同步标志") + public Integer systemSyncStatus = 2; + +} + diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/repository/SxWorkCellLineOffRecordRepository.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/repository/SxWorkCellLineOffRecordRepository.java new file mode 100644 index 0000000..522e838 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/repository/SxWorkCellLineOffRecordRepository.java @@ -0,0 +1,14 @@ +package cn.estsh.i3plus.ext.mes.pcn.pojo.repository; + +import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.SxWorkCellLineOffRecord; +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import org.springframework.stereotype.Repository; + +/** + * @author wangjie + * @version 1.0 + * @date 2021/1/29 15:02 + **/ +@Repository +public interface SxWorkCellLineOffRecordRepository extends BaseRepository { +}