节拍 变更

tags/yfai-mes-ext-v1.0
王杰 1 year ago
parent a02b6c3f80
commit 09f7451661

@ -41,8 +41,9 @@ public class SxWorkCellTaktCollectPlcCfgController {
try { try {
//条件验证 //条件验证
ValidatorBean.beginValid(workCellTaktCollectPlcCfg) ValidatorBean.beginValid(workCellTaktCollectPlcCfg)
.notNull(MesExtConstWords.WORK_CENTER_CODE,workCellTaktCollectPlcCfg.getWorkCenterCode()) .notNull(MesExtConstWords.WORK_CENTER_CODE, workCellTaktCollectPlcCfg.getWorkCenterCode())
.notNull(MesExtConstWords.WORK_CELL_CODE,workCellTaktCollectPlcCfg.getWorkCellCode()) .notNull(MesExtConstWords.WORK_CELL_CODE, workCellTaktCollectPlcCfg.getWorkCellCode())
.notNull("scanCellCode", workCellTaktCollectPlcCfg.getScanCellCode())
.notNull(MesExtConstWords.PLC_CODE, workCellTaktCollectPlcCfg.getPlcCode()) .notNull(MesExtConstWords.PLC_CODE, workCellTaktCollectPlcCfg.getPlcCode())
.notNull(MesExtConstWords.STATUS, workCellTaktCollectPlcCfg.getStatus()); .notNull(MesExtConstWords.STATUS, workCellTaktCollectPlcCfg.getStatus());
workCellTaktCollectPlcCfg.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode()); workCellTaktCollectPlcCfg.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
@ -64,6 +65,7 @@ public class SxWorkCellTaktCollectPlcCfgController {
ValidatorBean.beginValid(workCellTaktCollectPlcCfg) ValidatorBean.beginValid(workCellTaktCollectPlcCfg)
.notNull(MesExtConstWords.WORK_CENTER_CODE,workCellTaktCollectPlcCfg.getWorkCenterCode()) .notNull(MesExtConstWords.WORK_CENTER_CODE,workCellTaktCollectPlcCfg.getWorkCenterCode())
.notNull(MesExtConstWords.WORK_CELL_CODE,workCellTaktCollectPlcCfg.getWorkCellCode()) .notNull(MesExtConstWords.WORK_CELL_CODE,workCellTaktCollectPlcCfg.getWorkCellCode())
.notNull("scanCellCode", workCellTaktCollectPlcCfg.getScanCellCode())
.notNull(MesExtConstWords.PLC_CODE, workCellTaktCollectPlcCfg.getPlcCode()) .notNull(MesExtConstWords.PLC_CODE, workCellTaktCollectPlcCfg.getPlcCode())
.notNull(MesExtConstWords.STATUS, workCellTaktCollectPlcCfg.getStatus()); .notNull(MesExtConstWords.STATUS, workCellTaktCollectPlcCfg.getStatus());

@ -1,6 +1,5 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.jx; package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.jx;
import cn.estsh.i3plus.ext.mes.api.base.jx.IManageCodeService;
import cn.estsh.i3plus.ext.mes.api.base.jx.ISxWorkCellTaktCollectPlcCfgService; import cn.estsh.i3plus.ext.mes.api.base.jx.ISxWorkCellTaktCollectPlcCfgService;
import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectPlcCfg; import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectPlcCfg;
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectPlcCfgRepository; import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectPlcCfgRepository;
@ -88,6 +87,7 @@ public class SxWorkCellTaktCollectPlcCfgService implements ISxWorkCellTaktCollec
sxWorkCellTaktCollectPlcCfgDb.setWorkCenterCode(sxWorkCellTaktCollectPlcCfg.getWorkCenterCode()); sxWorkCellTaktCollectPlcCfgDb.setWorkCenterCode(sxWorkCellTaktCollectPlcCfg.getWorkCenterCode());
sxWorkCellTaktCollectPlcCfgDb.setWorkCellCode(sxWorkCellTaktCollectPlcCfg.getWorkCellCode()); sxWorkCellTaktCollectPlcCfgDb.setWorkCellCode(sxWorkCellTaktCollectPlcCfg.getWorkCellCode());
sxWorkCellTaktCollectPlcCfgDb.setScanCellCode(sxWorkCellTaktCollectPlcCfg.getScanCellCode());
sxWorkCellTaktCollectPlcCfgDb.setPlcCode(sxWorkCellTaktCollectPlcCfg.getPlcCode()); sxWorkCellTaktCollectPlcCfgDb.setPlcCode(sxWorkCellTaktCollectPlcCfg.getPlcCode());
sxWorkCellTaktCollectPlcCfgDb.setStatus(sxWorkCellTaktCollectPlcCfg.getStatus()); sxWorkCellTaktCollectPlcCfgDb.setStatus(sxWorkCellTaktCollectPlcCfg.getStatus());
sxWorkCellTaktCollectPlcCfgDb.setSystemSyncStatus(MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue()); sxWorkCellTaktCollectPlcCfgDb.setSystemSyncStatus(MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue());

@ -3,11 +3,9 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.excel.jx;
import cn.estsh.i3plus.ext.mes.api.base.IExcelImportExtService; import cn.estsh.i3plus.ext.mes.api.base.IExcelImportExtService;
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.CommonExtService; import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.CommonExtService;
import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectPlcCfg; import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectPlcCfg;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt;
import cn.estsh.i3plus.ext.mes.pojo.model.ExcelImportErrorExtModel; import cn.estsh.i3plus.ext.mes.pojo.model.ExcelImportErrorExtModel;
import cn.estsh.i3plus.ext.mes.pojo.model.ExcelImportResultExtModel; import cn.estsh.i3plus.ext.mes.pojo.model.ExcelImportResultExtModel;
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectPlcCfgRepository; import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectPlcCfgRepository;
import cn.estsh.i3plus.ext.mes.pojo.repository.MesWorkCenterExtRepository;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil; import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.convert.ConvertBean;
@ -15,7 +13,7 @@ import cn.estsh.i3plus.platform.common.util.MesConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellRepository; import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellRepository;
import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
@ -128,36 +126,34 @@ public class SxWorkCellTaktCollectPlcCfgExcelService implements IExcelImportExtS
String cellNum = ""; //错误列号 String cellNum = ""; //错误列号
String errorInfo = ""; //错误信息 String errorInfo = ""; //错误信息
//松下工位节拍PLC配置 String workCenterCode;
try { try {
//第一列必须有值,否则跳过 workCenterCode = new DataFormatter().formatCellValue(row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
row.getCell(0).setCellType(CellType.STRING);
} catch (Exception e) { } catch (Exception e) {
continue; continue;
} }
String workCenterCode = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim();
//产线代码
String workCellCode = null; String workCellCode = null;
try { try {
row.getCell(1).setCellType(CellType.STRING); workCellCode = new DataFormatter().formatCellValue(row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
workCellCode = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); } catch (Exception e) {
}
String scanCellCode = null;
try {
scanCellCode = new DataFormatter().formatCellValue(row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
} catch (Exception e) { } catch (Exception e) {
} }
//PLC代码
String plcCode = null; String plcCode = null;
try { try {
row.getCell(2).setCellType(CellType.STRING); plcCode = new DataFormatter().formatCellValue(row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
plcCode = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim();
} catch (Exception e) { } catch (Exception e) {
} }
//产线代码
String status = null; String status = null;
try { try {
row.getCell(3).setCellType(CellType.STRING); status = new DataFormatter().formatCellValue(row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
status = row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim();
} catch (Exception e) { } catch (Exception e) {
} }
@ -179,16 +175,27 @@ public class SxWorkCellTaktCollectPlcCfgExcelService implements IExcelImportExtS
errorInfo += "第B列数据无效;"; errorInfo += "第B列数据无效;";
} }
if (StringUtils.isEmpty(plcCode)) { //产线代码
if (StringUtils.isEmpty(scanCellCode)) {
errorNum++; errorNum++;
cellNum += "C;"; cellNum += "C;";
errorInfo += "第C列数据必填;"; errorInfo += "第C列数据必填;";
} else if (StringUtils.isEmpty(scanCellCode) || (CollectionUtils.isEmpty(workCellMap)) || (!workCellMap.containsKey(new StringJoiner(MesExtConstWords.AND).add(workCenterCode).add(scanCellCode).toString()))){
errorNum++;
cellNum += "C;";
errorInfo += "第C列数据无效;";
} }
if (!StringUtils.isEmpty(status) && MesExtEnumUtil.IS_ENABLE.descriptionOfValue(status) == null) { if (StringUtils.isEmpty(plcCode)) {
errorNum++; errorNum++;
cellNum += "D;"; cellNum += "D;";
errorInfo += "第D列数据无效;"; errorInfo += "第D列数据必填;";
}
if (!StringUtils.isEmpty(status) && MesExtEnumUtil.IS_ENABLE.descriptionOfValue(status) == null) {
errorNum++;
cellNum += "E;";
errorInfo += "第E列数据无效;";
} }
String key = new StringJoiner(MesExtConstWords.AND).add(workCenterCode).add(workCellCode).toString(); String key = new StringJoiner(MesExtConstWords.AND).add(workCenterCode).add(workCellCode).toString();
@ -231,6 +238,7 @@ public class SxWorkCellTaktCollectPlcCfgExcelService implements IExcelImportExtS
sxWorkCellTaktCollectPlcCfg.setWorkCellCode(workCellCode); sxWorkCellTaktCollectPlcCfg.setWorkCellCode(workCellCode);
} }
sxWorkCellTaktCollectPlcCfg.setScanCellCode(scanCellCode);
sxWorkCellTaktCollectPlcCfg.setPlcCode(plcCode); sxWorkCellTaktCollectPlcCfg.setPlcCode(plcCode);
sxWorkCellTaktCollectPlcCfg.setStatus(StringUtils.isEmpty(status) ? MesExtEnumUtil.IS_ENABLE.ENABLE.getValue() : MesExtEnumUtil.IS_ENABLE.descriptionOfValue(status)); sxWorkCellTaktCollectPlcCfg.setStatus(StringUtils.isEmpty(status) ? MesExtEnumUtil.IS_ENABLE.ENABLE.getValue() : MesExtEnumUtil.IS_ENABLE.descriptionOfValue(status));
sxWorkCellTaktCollectPlcCfg.setSystemSyncStatus(MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue()); sxWorkCellTaktCollectPlcCfg.setSystemSyncStatus(MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue());

@ -29,7 +29,9 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Table(name = "SX_WORK_CELL_TAKT_COLLECT_PLC_CFG", indexes = { @Table(name = "SX_WORK_CELL_TAKT_COLLECT_PLC_CFG", indexes = {
@Index(columnList = "SYSTEM_SYNC_STATUS"), @Index(columnList = "SYSTEM_SYNC_STATUS"),
@Index(columnList = "WORK_CENTER_CODE") @Index(columnList = "WORK_CENTER_CODE"),
@Index(columnList = "WORK_CELL_CODE"),
@Index(columnList = "SCAN_CELL_CODE")
}) })
@Api("松下工位节拍PLC配置表") @Api("松下工位节拍PLC配置表")
public class SxWorkCellTaktCollectPlcCfg extends BaseBean implements Serializable { public class SxWorkCellTaktCollectPlcCfg extends BaseBean implements Serializable {
@ -44,6 +46,10 @@ public class SxWorkCellTaktCollectPlcCfg extends BaseBean implements Serializabl
@ApiParam("工位代码") @ApiParam("工位代码")
private String workCellCode; private String workCellCode;
@Column(name = "SCAN_CELL_CODE")
@ApiParam("扫码工位代码")
private String scanCellCode;
@Column(name = "PLC_CODE") @Column(name = "PLC_CODE")
@ApiParam("PLC代码") @ApiParam("PLC代码")
private String plcCode; private String plcCode;

@ -47,6 +47,36 @@ public class SxWorkCellTaktCollectRecord extends BaseBean implements Serializabl
@ApiParam("生产节拍") @ApiParam("生产节拍")
private String workTakt; private String workTakt;
@Column(name = "SCAN_CELL_CODE")
@ApiParam("扫码工位代码")
private String scanCellCode;
@Column(name = "SHIFT_CODE")
@ApiParam("班次代码")
private String shiftCode;
@Column(name = "WORK_TIME")
@ApiParam("作业时间")
private String workTime;
@Column(name = "PART_NO")
@ApiParam("物料编码")
private String partNo;
@Column(name = "PART_NAME_RDD")
@ApiParam("物料名称")
private String partNameRdd;
@Column(name = "STANDARD_WORK", columnDefinition = "decimal(18,8)")
@ColumnDefault("0")
@ApiParam("标准工数")
private Double standardWork;
@Column(name = "WORKER_QTY", columnDefinition = "decimal(18,8)")
@ColumnDefault("0")
@ApiParam("作业人数")
private Double workerQty;
@Column(name = "SYSTEM_SYNC_STATUS") @Column(name = "SYSTEM_SYNC_STATUS")
@ColumnDefault("2") @ColumnDefault("2")
@ApiParam(value = "系统同步标志") @ApiParam(value = "系统同步标志")

@ -945,6 +945,7 @@ public class MesExtHqlPack {
DdlPackBean packBean = getAllBaseDataByNormalPro(workCellTaktCollectPlcCfg, workCellTaktCollectPlcCfg.getOrganizeCode()); DdlPackBean packBean = getAllBaseDataByNormalPro(workCellTaktCollectPlcCfg, workCellTaktCollectPlcCfg.getOrganizeCode());
DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean); DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean);
DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getWorkCellCode(), MesExtConstWords.WORK_CELL_CODE, packBean); DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getWorkCellCode(), MesExtConstWords.WORK_CELL_CODE, packBean);
DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getScanCellCode(), "scanCellCode", packBean);
DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getPlcCode(), MesExtConstWords.PLC_CODE, packBean); DdlPreparedPack.getStringLikerPack(workCellTaktCollectPlcCfg.getPlcCode(), MesExtConstWords.PLC_CODE, packBean);
DdlPreparedPack.getNumEqualPack(workCellTaktCollectPlcCfg.getStatus(), MesExtConstWords.STATUS, packBean); DdlPreparedPack.getNumEqualPack(workCellTaktCollectPlcCfg.getStatus(), MesExtConstWords.STATUS, packBean);
if (!StringUtils.isEmpty(workCellTaktCollectPlcCfg.getModifyDateTimeStart()) || !StringUtils.isEmpty(workCellTaktCollectPlcCfg.getModifyDateTimeEnd())) { if (!StringUtils.isEmpty(workCellTaktCollectPlcCfg.getModifyDateTimeStart()) || !StringUtils.isEmpty(workCellTaktCollectPlcCfg.getModifyDateTimeEnd())) {

Loading…
Cancel
Save