tags/yfai-mes-ext-v1.0
王杰 1 year ago
parent 79232c522f
commit 202fca78c0

@ -105,6 +105,8 @@ public class SxAssistOutAndEnterController extends MesBaseController {
public ResultBean insertAssistOutAndEnter(MesAssistOutAndEnter assistOutAndEnter) {
try {
ValidatorBean.beginValid(assistOutAndEnter)
.notNull(MesExtConstWords.WORK_TIME, assistOutAndEnter.getWorkTime())
.notNull(MesExtConstWords.SHIFT_CODE, assistOutAndEnter.getShiftCode())
.notNull(MesExtConstWords.WORK_CENTER_CODE, assistOutAndEnter.getWorkCenterCode())
.notNull(MesExtConstWords.ASSIST_OUT_AND_ENTER_DETAIL, assistOutAndEnter.getAssistOutAndEnterDetail())
.notNull(MesExtConstWords.OWNER_DEPARTMENT, assistOutAndEnter.getOwnerDepartment())
@ -137,6 +139,8 @@ public class SxAssistOutAndEnterController extends MesBaseController {
try {
ValidatorBean.beginValid(assistOutAndEnter)
.notNull(MesExtConstWords.ID, assistOutAndEnter.getIdStr())
.notNull(MesExtConstWords.WORK_TIME, assistOutAndEnter.getWorkTime())
.notNull(MesExtConstWords.SHIFT_CODE, assistOutAndEnter.getShiftCode())
.notNull(MesExtConstWords.WORK_CENTER_CODE, assistOutAndEnter.getWorkCenterCode())
.notNull(MesExtConstWords.ASSIST_OUT_AND_ENTER_DETAIL, assistOutAndEnter.getAssistOutAndEnterDetail())
.notNull(MesExtConstWords.OWNER_DEPARTMENT, assistOutAndEnter.getOwnerDepartment())

@ -248,6 +248,8 @@ public class SxAssistOutAndEnterService implements ISxAssistOutAndEnterService {
assistOutAndEnterDb.setPersonnelCost(personnelCost);
assistOutAndEnterDb.setIntervalTime(intervalTime);
assistOutAndEnterDb.setInfluenceTime(influenceTime);
assistOutAndEnterDb.setWorkTime(assistOutAndEnter.getWorkTime());
assistOutAndEnterDb.setShiftCode(assistOutAndEnter.getShiftCode());
assistOutAndEnterDb.setWorkCenterCode(assistOutAndEnter.getWorkCenterCode());
assistOutAndEnterDb.setWorkCenterName(assistOutAndEnter.getWorkCenterName());
assistOutAndEnterDb.setAssistOutAndEnterDetail(assistOutAndEnter.getAssistOutAndEnterDetail());

@ -83,7 +83,7 @@ public class JxCenterWorkingBoardCenterThreeService extends JxCenterWorkingBoard
List<MesWorkOrder> workOrderList = (List<MesWorkOrder>) dataMap.get(MesWorkOrder.class.getSimpleName());
List<MesOutPutStatistics> outPutStatisticsList = (List<MesOutPutStatistics>) dataMap.get(MesOutPutStatistics.class.getSimpleName());
List<MesOutPutStatistics> outPutStatisticsList = sortOutPutStatisticsList((List<MesOutPutStatistics>) dataMap.get(MesOutPutStatistics.class.getSimpleName()));
List<MesOutPutStatisticsTimeSegment> outPutStatisticsTimeSegmentList = (List<MesOutPutStatisticsTimeSegment>) dataMap.get(MesOutPutStatisticsTimeSegment.class.getSimpleName());

@ -34,17 +34,17 @@ public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCo
private IJxCenterWorkingBoardService proxyService1;
private IJxCenterWorkingBoardService proxyService;
private IJxCenterWorkingBoardService proxyService2;
private MesShiftRepository shiftRepository;
private IJxCenterWorkingBoardService proxyService;
private MesOrderJobRepository orderJobRepository;
public JxCenterWorkingBoardCenterTwoService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService1, IJxCenterWorkingBoardService proxyService) {
public JxCenterWorkingBoardCenterTwoService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService1, IJxCenterWorkingBoardService proxyService2, IJxCenterWorkingBoardService proxyService) {
this.proxyService0 = proxyService0;
this.proxyService1 = proxyService1;
this.proxyService2 = proxyService2;
this.proxyService = proxyService;
this.shiftRepository = (MesShiftRepository) SpringContextsUtil.getBean("mesShiftRepository");
this.orderJobRepository = (MesOrderJobRepository) SpringContextsUtil.getBean("mesOrderJobRepository");
}
@ -63,11 +63,13 @@ public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCo
List<MesWorkOrder> workOrderList = (List<MesWorkOrder>) dataMap.get(MesWorkOrder.class.getSimpleName());
List<MesOutPutStatistics> outPutStatisticsList = (List<MesOutPutStatistics>) dataMap.get(MesOutPutStatistics.class.getSimpleName());
List<MesOutPutStatistics> outPutStatisticsList = sortOutPutStatisticsList((List<MesOutPutStatistics>) dataMap.get(MesOutPutStatistics.class.getSimpleName()));
List<MesRepairTask> repairTaskList = (List<MesRepairTask>) dataMap.get(MesRepairTask.class.getSimpleName());
dataMap.put("当前班次", getShiftName(workCenterExtDb));
MesShift shift = (MesShift) proxyService2.queryCenterWorkingBoardData(dataMap).get(MesShift.class.getSimpleName());
dataMap.put("当前班次", null == shift ? MesExtConstWords.EMPTY : shift.getShiftName());
dataMap.put("出勤人数", workCenterExtDb.getWorkerQty());
@ -101,6 +103,7 @@ public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCo
dataMap.remove(MesWorkOrder.class.getSimpleName());
dataMap.remove(MesRepairTask.class.getSimpleName());
dataMap.remove(MesOutPutStatistics.class.getSimpleName());
dataMap.remove(MesShift.class.getSimpleName());
dataMap.remove(MesExtConstWords.QTY);
dataMap.remove(MesExtConstWords.COMPLET_QTY);
dataMap.remove(MesExtConstWords.START_TIME);
@ -127,21 +130,7 @@ public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCo
dataMap.put("curTime", TimeTool.getNowTime(true));
}
private String getShiftName(MesWorkCenterExt workCenterExtDb) {
if (StringUtils.isEmpty(workCenterExtDb.getShiftCode())) return MesExtConstWords.EMPTY;
String item = new StringJoiner(MesExtConstWords.AND).add("SHIFT").add(workCenterExtDb.getWorkCenterCode()).add(workCenterExtDb.getShiftCode()).toString();
String shift4Cached = (String) execCachedCenterWorkingBoardData(workCenterExtDb.getOrganizeCode(), MesExtConstWords.ZERO_STR, item, null);
MesShift shift = !StringUtils.isEmpty(shift4Cached) ? JSONObject.parseObject(shift4Cached, MesShift.class) : execShift(workCenterExtDb, item);
return null == shift ? MesExtConstWords.EMPTY : shift.getShiftName();
}
private MesShift execShift(MesWorkCenterExt workCenterExtDb, String item) {
MesShift shiftDb = shiftRepository.getByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.SHIFT_CODE},
new Object[]{workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterExtDb.getWorkCenterCode(), workCenterExtDb.getShiftCode()});
if (null != shiftDb) execCachedCenterWorkingBoardData(workCenterExtDb.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr(), item, JSONObject.toJSONString(shiftDb));
return shiftDb;
}
private String getOrderJobStatistics(MesWorkCenterExt workCenterExtDb) {
List<MesOrderJob> orderJobList = (StringUtils.isEmpty(workCenterExtDb.getWorkTime()) || StringUtils.isEmpty(workCenterExtDb.getShiftCode())) ? null :
@ -189,12 +178,14 @@ public class JxCenterWorkingBoardCenterTwoService extends JxCenterWorkingBoardCo
List<MesWorkOrder> workOrderList2Sort = getWorkOrderList2Sort(workOrderList, outPutStatisticsList, workCenterExtDb);
outPutStatisticsList = sortOutPutStatisticsList(outPutStatisticsList);
Set<String> partNoList = new TreeSet<>();
List<String> partNoList = new LinkedList<>();
if (!CollectionUtils.isEmpty(outPutStatisticsList)) partNoList.add(outPutStatisticsList.get(0).getPartNo());
if (!CollectionUtils.isEmpty(workOrderList2Sort)) workOrderList2Sort.stream().filter(o -> null != o).forEach(o -> partNoList.add(o.getPartNo()));
if (!CollectionUtils.isEmpty(outPutStatisticsList)) outPutStatisticsList.stream().filter(o -> null != o).forEach(o -> partNoList.add(o.getPartNo()));
if (!CollectionUtils.isEmpty(workOrderList2Sort)) workOrderList2Sort.stream().filter(o -> null != o).forEach(o -> {
if (!partNoList.contains(o.getPartNo())) partNoList.add(o.getPartNo());
});
if (!CollectionUtils.isEmpty(outPutStatisticsList)) outPutStatisticsList.stream().filter(o -> null != o).forEach(o -> {
if (!partNoList.contains(o.getPartNo())) partNoList.add(o.getPartNo());
});
if (CollectionUtils.isEmpty(partNoList)) return psData;
Map<String, List<MesWorkOrder>> orderMap = CollectionUtils.isEmpty(workOrderList2Sort) ? null : workOrderList2Sort.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrder::getPartNo));

@ -36,7 +36,7 @@ public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoar
case "center02":
return new JxCenterWorkingBoardWatchService(new JxCenterWorkingBoardCenterTwoService(
new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(),
new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyStandardWorkService(), new JxCenterWorkingBoardProxyShiftService(),
new JxCenterWorkingBoardProxyEnergyRateService(new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService()))))
)).queryCenterWorkingBoardData(dataMap);
@ -58,11 +58,11 @@ public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoar
new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxySpcPmService())))
)).queryCenterWorkingBoardData(dataMap);
// case "workDaily":
// return new JxCenterWorkingBoardWatchService(new JxCenterWorkingBoardWorkDailyService(
// new JxCenterWorkingBoardProxyCenterService(),
// new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxySpcPmService(new JxCenterWorkingBoardProxyAssistService())))
// )).queryCenterWorkingBoardData(dataMap);
case "workDaily":
return new JxCenterWorkingBoardWatchService(new JxCenterWorkingBoardWorkDailyService(
new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyShiftService(),
new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxySpcrService(new JxCenterWorkingBoardProxySpcPmService(new JxCenterWorkingBoardProxyAssistService())))
)).queryCenterWorkingBoardData(dataMap);
default:
return dataMap;

@ -2,13 +2,9 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesAssistOutAndEnter;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesShiftProdCenterPm;
import cn.estsh.i3plus.ext.mes.pojo.repository.MesAssistOutAndEnterRepository;
import cn.estsh.i3plus.ext.mes.pojo.repository.MesShiftProdCenterPmRepository;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
@ -36,12 +32,14 @@ public class JxCenterWorkingBoardProxyAssistService implements IJxCenterWorkingB
String organizeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE);
String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE);
String startTime = (String) dataMap.get(MesExtConstWords.START_TIME);
String endTime = (String) dataMap.get(MesExtConstWords.END_TIME);
String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME);
String shiftCode = (String) dataMap.get(MesExtConstWords.SHIFT_CODE);
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean);
List<MesAssistOutAndEnter> assistOutAndEnterList = assistOutAndEnterRepository.findByHqlWhere(packBean);
if (StringUtils.isEmpty(workTime) || StringUtils.isEmpty(shiftCode)) return dataMap;
List<MesAssistOutAndEnter> assistOutAndEnterList = assistOutAndEnterRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.SHIFT_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime, shiftCode});
if (CollectionUtils.isEmpty(assistOutAndEnterList)) return dataMap;

@ -43,18 +43,25 @@ public class JxCenterWorkingBoardProxyOutPutService implements IJxCenterWorkingB
String workTime = (String) dataMap.get(MesExtConstWords.WORK_TIME);
String startTime = (String) dataMap.get(MesExtConstWords.START_TIME);
String endTime = (String) dataMap.get(MesExtConstWords.END_TIME);
String shiftCode = (String) dataMap.get("hasShiftCode");
List<MesOutPutStatistics> outPutStatisticsList = null;
if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime))
outPutStatisticsList = outPutStatisticsRepository.findByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.WORK_TIME, MesExtConstWords.WORK_ORDER_TYPE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workTime, MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue()},
" order by modifyDatetime desc ");
else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
if (!StringUtils.isEmpty(workCenterCode) && !StringUtils.isEmpty(workTime)) {
DdlPreparedPack.getStringEqualPack(workCenterCode, MesExtConstWords.WORK_CENTER_CODE, packBean);
DdlPreparedPack.getStringEqualPack(workTime, MesExtConstWords.WORK_TIME, packBean);
DdlPreparedPack.getStringEqualPack(shiftCode, MesExtConstWords.SHIFT_CODE, packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean);
outPutStatisticsList = outPutStatisticsRepository.findByHqlWhere(packBean);
} else if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) {
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.WORK_ORDER_TYPE.STANDARD_ORDER.getValue(), MesExtConstWords.WORK_ORDER_TYPE, packBean);
DdlPreparedPack.timeBuilder(startTime, endTime, MesExtConstWords.WORK_TIME, true, true, packBean);
outPutStatisticsList = outPutStatisticsRepository.findByHqlWhere(packBean);
}
if (CollectionUtils.isEmpty(outPutStatisticsList)) return dataMap;

@ -0,0 +1,56 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
import cn.estsh.i3plus.pojo.mes.repository.MesShiftRepository;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.util.Map;
import java.util.StringJoiner;
/**
* @Author : wangjie
* @CreateDate : 2022-02-15
* @Modify:
**/
@Slf4j
public class JxCenterWorkingBoardProxyShiftService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService {
private MesShiftRepository shiftRepository;
public JxCenterWorkingBoardProxyShiftService() {
this.shiftRepository = (MesShiftRepository) SpringContextsUtil.getBean("mesShiftRepository");
}
@Override
public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {
String organizeCode = (String) dataMap.get(MesExtConstWords.ORGANIZE_CODE);
String workCenterCode = (String) dataMap.get(MesExtConstWords.WORK_CENTER_CODE);
String shiftCode = (String) dataMap.get(MesExtConstWords.SHIFT_CODE);
if (StringUtils.isEmpty(shiftCode)) return dataMap;
String item = new StringJoiner(MesExtConstWords.AND).add("SHIFT").add(workCenterCode).add(shiftCode).toString();
String shift4Cached = (String) execCachedCenterWorkingBoardData(organizeCode, MesExtConstWords.ZERO_STR, item, null);
MesShift shift = !StringUtils.isEmpty(shift4Cached) ? JSONObject.parseObject(shift4Cached, MesShift.class) : execShift(organizeCode, workCenterCode, shiftCode, item);
if (null == shift) return dataMap;
dataMap.put(MesShift.class.getSimpleName(), shift);
return dataMap;
}
private MesShift execShift(String organizeCode, String workCenterCode, String shiftCode, String item) {
MesShift shiftDb = shiftRepository.getByProperty(
new String[]{MesExtConstWords.ORGANIZE_CODE, MesExtConstWords.IS_DELETED, MesExtConstWords.IS_VALID, MesExtConstWords.WORK_CENTER_CODE, MesExtConstWords.SHIFT_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, shiftCode});
if (null != shiftDb) execCachedCenterWorkingBoardData(organizeCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr(), item, JSONObject.toJSONString(shiftDb));
return shiftDb;
}
}

@ -0,0 +1,78 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesShiftProdCenterPm;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesShiftProdCenterRecord;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesWorkCenterExt;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.util.Calendar;
import java.util.Map;
/**
* @Author : wangjie
* @CreateDate : 2022-02-15
* @Modify:
**/
@Slf4j
public class JxCenterWorkingBoardWorkDailyService extends JxCenterWorkingBoardCommonService implements IJxCenterWorkingBoardService {
private IJxCenterWorkingBoardService proxyService0;
private IJxCenterWorkingBoardService proxyService1;
private IJxCenterWorkingBoardService proxyService;
public JxCenterWorkingBoardWorkDailyService(IJxCenterWorkingBoardService proxyService0, IJxCenterWorkingBoardService proxyService1, IJxCenterWorkingBoardService proxyService) {
this.proxyService0 = proxyService0;
this.proxyService1 = proxyService1;
this.proxyService = proxyService;
}
@Override
public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {
proxyService0.queryCenterWorkingBoardData(dataMap);
proxyService1.queryCenterWorkingBoardData(dataMap);
proxyService.queryCenterWorkingBoardData(packProxyCondition(dataMap));
MesWorkCenterExt workCenterExtDb = (MesWorkCenterExt) dataMap.get(MesWorkCenterExt.class.getSimpleName());
MesShift shift = (MesShift) dataMap.get(MesShift.class.getSimpleName());
MesShiftProdCenterPm shiftProdCenterPm = (MesShiftProdCenterPm) dataMap.get(MesShiftProdCenterPm.class.getSimpleName());
dataMap.put("生产线名称", workCenterExtDb.getWorkCenterName());
dataMap.put("班次名称", null == shift ? MesExtConstWords.EMPTY : shift.getShiftName());
dataMap.put("日期", dataMap.get(MesExtConstWords.WORK_TIME));
dataMap.put("上班时间", null == shiftProdCenterPm ? MesExtConstWords.EMPTY : shiftProdCenterPm.getWorkStartTime());
dataMap.put("下班时间", null == shiftProdCenterPm ? MesExtConstWords.EMPTY : shiftProdCenterPm.getWorkEndTime());
dataMap.put("定时", "");
return clearUselessData(dataMap);
}
@Override
public Map<String, Object> clearUselessData(Map<String, Object> dataMap) {
dataMap.remove(MesWorkCenterExt.class.getSimpleName());
dataMap.remove(MesOutPutStatistics.class.getSimpleName());
dataMap.remove(MesShiftProdCenterRecord.class.getSimpleName());
dataMap.remove(MesShiftProdCenterPm.class.getSimpleName());
dataMap.remove(MesExtConstWords.SHIFT_NAME);
dataMap.remove("hasShiftCode");
return dataMap;
}
private Map<String, Object> packProxyCondition(Map<String, Object> dataMap) {
dataMap.put("hasShiftCode", dataMap.get(MesExtConstWords.SHIFT_CODE));
return dataMap;
}
}

@ -232,6 +232,22 @@ public class SxAssistOutAndEnterExcelService implements IExcelImportExtService {
} catch (Exception e) {
}
//作业时间
String workTime;
try {
workTime = new DataFormatter().formatCellValue(row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
} catch (Exception e) {
continue;
}
//班次代码
String shiftCode;
try {
shiftCode = new DataFormatter().formatCellValue(row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
} catch (Exception e) {
continue;
}
//验证生产线代码
if (CollectionUtils.isEmpty(workCenterCodeMap) || !workCenterCodeMap.containsKey(workCenterCode)) {
errorNum ++;
@ -405,9 +421,23 @@ public class SxAssistOutAndEnterExcelService implements IExcelImportExtService {
}
}
if (StringUtils.isEmpty(workTime)) {
errorNum ++;
cellNum += "K;";
errorInfo += "第K列数据必填;";
}
if (StringUtils.isEmpty(shiftCode)) {
errorNum ++;
cellNum += "L;";
errorInfo += "第L列数据必填;";
}
//没有错误的时候封装MesAssistOutAndEnter
if (errorNum == 0) {
MesAssistOutAndEnter assistOutAndEnter = new MesAssistOutAndEnter();
assistOutAndEnter.setWorkTime(workTime);
assistOutAndEnter.setShiftCode(shiftCode);
assistOutAndEnter.setWorkCenterCode(workCenterCode);
assistOutAndEnter.setWorkCenterName(workCenterCodeMap.get(workCenterCode).get(0).getWorkCenterName());
assistOutAndEnter.setAssistOutAndEnterDetail(MesExtEnumUtil.BU_ASSIST_OUT_AND_ENTER_DETAIL.descriptionOfValue(assistOutAndEnterDetail));

@ -27,6 +27,7 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_ASSIST_OUT_AND_ENTER", indexes = {
@Index(columnList = "SYSTEM_SYNC_STATUS"),
@Index(columnList = "WORK_CENTER_CODE, WORK_TIME, SHIFT_CODE"),
@Index(columnList = "WORK_CENTER_CODE"),
@Index(columnList = "ASSIST_OUT_AND_ENTER_DETAIL"),
@Index(columnList = "START_TIME"),
@ -44,6 +45,14 @@ public class MesAssistOutAndEnter extends BaseBean implements Serializable {
@ApiParam(value = "系统同步标志")
public Integer systemSyncStatus = 2;
@Column(name = "WORK_TIME")
@ApiParam("生产日期")
private String workTime;
@Column(name = "SHIFT_CODE")
@ApiParam("班次代码")
private String shiftCode;
@Column(name = "WORK_CENTER_CODE")
@ApiParam("生产线代码")
private String workCenterCode;

@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
/**
@ -20,6 +19,12 @@ public class SxAssistOutAndEnterModel implements Serializable {
private static final long serialVersionUID = -2447125001711483243L;
@ApiParam("生产日期")
private String workTime;
@ApiParam("班次代码")
private String shiftCode;
@ApiParam("生产线代码")
private String workCenterCode;

Loading…
Cancel
Save