|
|
|
@ -241,6 +241,19 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
MesProductOffLine newMesProductOffLine;
|
|
|
|
|
for (MesProductionRecord mesProductionRecord : mesProductionRecordList) {
|
|
|
|
|
for (MesBom mesBom : mesBoms) {
|
|
|
|
|
|
|
|
|
|
DdlPackBean productPackBean = DdlPackBean.getDdlPackBean(mesProductionRecord.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesBom.getItemPartNo(),"itemPartNo", productPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesWorkOrderDb.getPartNo(),"reportPartNo", productPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesProductionRecord.getProductSn(),"reportSn", productPackBean);
|
|
|
|
|
int count = mesProductOffLineRDao.findByHqlWhereCount(productPackBean);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
String msg = String.format("子零件【%s】产成零件【%s】条码【%s】对应报工信息已存在",
|
|
|
|
|
mesBom.getItemPartNo(),mesWorkOrderDb.getPartNo(), mesProductionRecord.getProductSn());
|
|
|
|
|
LOGGER.info(msg);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newMesProductOffLine = new MesProductOffLine();
|
|
|
|
|
newMesProductOffLine.setReportPartNo(mesWorkOrderDb.getPartNo());
|
|
|
|
|
newMesProductOffLine.setReportPartNameRdd(mesWorkOrderDb.getPartName());
|
|
|
|
@ -578,6 +591,23 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
return bom;
|
|
|
|
|
}));
|
|
|
|
|
if (MesExtEnumUtil.NOSORT_REPORT_TYPE.REPORT.getValue() == productionRecord.getReportType()) {
|
|
|
|
|
|
|
|
|
|
DdlPackBean productPackBean = DdlPackBean.getDdlPackBean(productionRecord.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(oldMesWorkOrder.getPartNo(),"reportPartNo", productPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(productionRecord.getProductSn(),"reportSn", productPackBean);
|
|
|
|
|
int count = mesProductOffLineRDao.findByHqlWhereCount(productPackBean);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
String msg = String.format("产成零件【%s】条码【%s】对应报工信息已存在",
|
|
|
|
|
oldMesWorkOrder.getPartNo(), productionRecord.getProductSn());
|
|
|
|
|
LOGGER.error(msg);
|
|
|
|
|
LOGGER.info("条码【{}】重复报工更新成已报工", productionRecord.getProductSn());
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean);
|
|
|
|
|
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo", "reportStatus","description"},
|
|
|
|
|
new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue(), "重复报工更新成已报工"}, packBean);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<MesBom, List<MesBom>> entry : map.entrySet()) {
|
|
|
|
|
mesProductOffLineList.add(getMesProductOffLine(productionRecord, userName, oldMesWorkOrder, mesProductVersion, entry.getValue().get(0), productionRecord.getProductSn(), false,false,map.size()));
|
|
|
|
|
}
|
|
|
|
@ -823,6 +853,10 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(productionRecord.getPartNo(), "partNo", ddlPackBean);
|
|
|
|
|
|
|
|
|
|
// 获取5分钟之前的时间
|
|
|
|
|
String startTime = TimeTool.timeCalc(new Date(), Calendar.MINUTE, -2, "yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringSmallerNotEqualPack(startTime, "createDatetime", ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(productionRecord.getWorkCenterCode(), "workCenterCode", ddlPackBean);
|
|
|
|
|
if (!StringUtils.isEmpty(productionRecord.getWorkOrderNo())) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(productionRecord.getWorkOrderNo(), "workOrderNo", ddlPackBean);
|
|
|
|
|