forked from I3-YF/i3plus-mes-pcn-yfai
Merge remote-tracking branch 'origin/dev' into dev
commit
38b05bcb99
@ -0,0 +1,24 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description :设备停机类型
|
||||
* @Reference :
|
||||
* @Author : gsz
|
||||
* @CreateDate 2024/5/17 14:06
|
||||
* @Modify:
|
||||
**/
|
||||
public interface IMesBasDowntimeReasonTypeService {
|
||||
|
||||
/**
|
||||
* 查询设备停机类型和原因
|
||||
* @param downtimeReasonType
|
||||
* @param pager
|
||||
* @return
|
||||
*/
|
||||
List<MesDowntimeReasonType> findMesDowntimeTypeReason(MesDowntimeReasonType downtimeReasonType, Pager pager);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 开关班记录
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
public interface IMesProdShiftRecordService {
|
||||
|
||||
@ApiOperation(value = "查询开关班记录")
|
||||
public ListPager<MesProdShiftRecord> queryMesProdShiftRecordByPager(MesProdShiftRecord partInspection, Pager pager);
|
||||
|
||||
void insertMesProdShiftRecord(MesProdShiftRecord item, String organizeCode);
|
||||
|
||||
void saveMesProdShiftRecord(MesProdShiftRecord item, String organizeCode);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 产线与班组的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
public interface IMesShiftGroupCenterCfgService {
|
||||
|
||||
@ApiOperation(value = "查询产线与班组的对应关系")
|
||||
public ListPager<MesShiftGroupCenterCfg> queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg mesShiftGroupCenterCfg, Pager pager);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 产线与班次的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
public interface IMesShiftService {
|
||||
|
||||
|
||||
@ApiOperation(value = "查询产线与班次的对应关系")
|
||||
public ListPager<MesShift> queryMesShiftByPager(MesShift mesShift, Pager pager);
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesBasDowntimeReasonTypeService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType;
|
||||
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description :设备停机类型
|
||||
* @Reference :
|
||||
* @Author : gsz
|
||||
* @CreateDate : 2024-05-17 14:16
|
||||
* @Modify:
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesDowntimeReasonType")
|
||||
public class MesDowntimeReasonTypeController {
|
||||
|
||||
@Autowired
|
||||
private IMesBasDowntimeReasonTypeService downtimeReasonTypeService;
|
||||
|
||||
@GetMapping(value = "/find-downtime-type-reason")
|
||||
@ApiOperation(value = "查询设备停机类型和原因")
|
||||
public ResultBean findMesDowntimeTypeReason(MesDowntimeReasonType mesDowntimeReasontype, Pager pager) {
|
||||
try {
|
||||
mesDowntimeReasontype.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
//查询汇总工单数量
|
||||
List<MesDowntimeReasonType> mesDowntimeReasonTypes = downtimeReasonTypeService.findMesDowntimeTypeReason(mesDowntimeReasontype, pager);
|
||||
|
||||
return ResultBean.success("查询成功")
|
||||
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
|
||||
.setListPager(new ListPager<>(mesDowntimeReasonTypes, pager));
|
||||
} catch (ImppBusiException e) {
|
||||
return ResultBean.fail(e).build();
|
||||
} catch (Exception e) {
|
||||
return ResultBean.fail(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdShiftRecordService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord;
|
||||
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description: 开关班记录
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesProdShiftRecord")
|
||||
public class MesProdShiftRecordController {
|
||||
|
||||
private IMesProdShiftRecordService mesProdShiftRecordService;
|
||||
|
||||
@GetMapping("/query-pager")
|
||||
@ApiOperation(value = "查询开关班记录")
|
||||
public ResultBean queryMesProdShiftRecordByPager(MesProdShiftRecord mesProdShiftRecord, Pager pager) {
|
||||
try {
|
||||
mesProdShiftRecord.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
ListPager<MesProdShiftRecord> partInspectionListPager = mesProdShiftRecordService.queryMesProdShiftRecordByPager(mesProdShiftRecord, pager);
|
||||
return ResultBean.success("查询成功").setListPager(partInspectionListPager);
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/insert")
|
||||
@ApiOperation(value = "保存开关班记录")
|
||||
public ResultBean insertMesProdShiftRecord(@RequestBody MesProdShiftRecord item) {
|
||||
|
||||
try {
|
||||
// 数据校验
|
||||
ValidatorBean.checkNotNull(item.getOrganizeCode(), "工厂号不能为空");
|
||||
ValidatorBean.checkNotNull(item.getWorkCenterCode(), "workCenterCode不能为空" );
|
||||
ValidatorBean.checkNotNull(item.getShiftGroup(), "shiftGroup不能为空");
|
||||
ValidatorBean.checkNotNull(item.getShiftCode(), "shiftCode不能为空");
|
||||
|
||||
|
||||
mesProdShiftRecordService.insertMesProdShiftRecord(item, AuthUtil.getOrganizeCode());
|
||||
return ResultBean.success("NC处理成功");
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation(value = "保存开关班记录")
|
||||
public ResultBean updateMesProdShiftRecord(@RequestBody MesProdShiftRecord item) {
|
||||
|
||||
try {
|
||||
// 数据校验
|
||||
ValidatorBean.checkNotNull(item.getOrganizeCode(), "工厂号不能为空");
|
||||
ValidatorBean.checkNotNull(item.getWorkCenterCode(), "workCenterCode不能为空" );
|
||||
ValidatorBean.checkNotNull(item.getShiftGroup(), "shiftGroup不能为空");
|
||||
ValidatorBean.checkNotNull(item.getShiftCode(), "shiftCode不能为空");
|
||||
|
||||
mesProdShiftRecordService.saveMesProdShiftRecord(item, AuthUtil.getOrganizeCode());
|
||||
return ResultBean.success("NC处理成功");
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
|
||||
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description: 产线与班次的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShift")
|
||||
public class MesShiftController {
|
||||
|
||||
private IMesShiftService mesShiftService;
|
||||
|
||||
@GetMapping("/query-pager")
|
||||
@ApiOperation(value = "产线与班次的对应关系")
|
||||
public ResultBean queryMesShiftByPager(MesShift mesShift, Pager pager) {
|
||||
try {
|
||||
mesShift.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
ListPager<MesShift> partInspectionListPager = mesShiftService.queryMesShiftByPager(mesShift, pager);
|
||||
return ResultBean.success("查询成功").setListPager(partInspectionListPager);
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftGroupCenterCfgService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg;
|
||||
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description: 产线与班组的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/25 18:16
|
||||
* @Modify:
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShiftGroupCenterCfg")
|
||||
public class MesShiftGroupCenterCfgController {
|
||||
|
||||
private IMesShiftGroupCenterCfgService mesShiftGroupCenterCfgService;
|
||||
|
||||
@GetMapping("/query-pager")
|
||||
@ApiOperation(value = "产线与班组的对应关系")
|
||||
public ResultBean queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg mesShiftGroupCenterCfg, Pager pager) {
|
||||
try {
|
||||
mesShiftGroupCenterCfg.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||
ListPager<MesShiftGroupCenterCfg> partInspectionListPager = mesShiftGroupCenterCfgService.queryMesShiftGroupCenterCfgByPager(mesShiftGroupCenterCfg, pager);
|
||||
return ResultBean.success("查询成功").setListPager(partInspectionListPager);
|
||||
} catch (ImppBusiException imppException) {
|
||||
return ResultBean.fail(imppException);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesBasDowntimeReasonTypeService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.base.util.StringUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReason;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesDowntimeReasonType;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.IMesBasDowntimeReasonRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.IMesBasDowntimeReasonTypeRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description : 设备停机类型
|
||||
* @Reference :
|
||||
* @Author : gsz
|
||||
* @CreateDate 2024/5/17 14:06
|
||||
* @Modify:
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MesBasDowntimeReasonTypeServiceImpl implements IMesBasDowntimeReasonTypeService {
|
||||
|
||||
@Autowired
|
||||
private IMesBasDowntimeReasonRepository downtimeReasonRDao;
|
||||
@Autowired
|
||||
private IMesBasDowntimeReasonTypeRepository downtimeReasonTypeRDao;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备停机类型和原因
|
||||
*
|
||||
* @param downtimeReasonType
|
||||
* @param pager
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MesDowntimeReasonType> findMesDowntimeTypeReason(MesDowntimeReasonType downtimeReasonType, Pager pager) {
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(downtimeReasonType.getOrganizeCode());
|
||||
DdlPreparedPack.getStringEqualPack(downtimeReasonType.getReasonTypeCode(), "reasonTypeCode", packBean);
|
||||
List<MesDowntimeReasonType> downtimeReasonTypeList = downtimeReasonTypeRDao.findByHqlPage(packBean, pager);
|
||||
|
||||
if (!CollectionUtils.isEmpty(downtimeReasonTypeList)) {
|
||||
//查对应原因
|
||||
List<MesDowntimeReason> mesDowntimeReasonList = downtimeReasonRDao.findByProperty(
|
||||
new String[]{"organizeCode", "isDeleted", "isValid"},
|
||||
new Object[]{downtimeReasonType.getOrganizeCode(),
|
||||
CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
||||
|
||||
Map<String, List<MesDowntimeReason>> reasonMap = mesDowntimeReasonList.stream().collect(Collectors.groupingBy(MesDowntimeReason::getReasonTypeCode));
|
||||
|
||||
for (MesDowntimeReasonType mesDowntimeReasonType : downtimeReasonTypeList) {
|
||||
if (!StringUtil.isEmpty(reasonMap.get(mesDowntimeReasonType.getReasonTypeCode()))) {
|
||||
mesDowntimeReasonType.setDowntimeReasonList(reasonMap.get(mesDowntimeReasonType.getReasonTypeCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return downtimeReasonTypeList;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftGroupCenterCfgService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShiftGroupCenterCfg;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesShiftGroupCenterCfgRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 产线与班组的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/21 14:16
|
||||
* @Modify:
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MesShiftGroupCenterCfgServiceImpl implements IMesShiftGroupCenterCfgService {
|
||||
|
||||
@Autowired
|
||||
private MesShiftGroupCenterCfgRepository mesShiftGroupCenterCfgRDao;
|
||||
|
||||
@Override
|
||||
public ListPager<MesShiftGroupCenterCfg> queryMesShiftGroupCenterCfgByPager(MesShiftGroupCenterCfg bean, Pager pager) {
|
||||
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
||||
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
||||
DdlPreparedPack.getStringEqualPack(bean.getShiftGroup(), "shiftGroup", packBean);
|
||||
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
||||
pager = PagerHelper.getPager(pager, mesShiftGroupCenterCfgRDao.findByHqlWhereCount(packBean));
|
||||
|
||||
List<MesShiftGroupCenterCfg> resultList = mesShiftGroupCenterCfgRDao.findByHqlWherePage(packBean, pager);
|
||||
|
||||
return new ListPager<>(resultList, pager);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesShiftService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesShiftRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 产线与班次的对应关系
|
||||
* @Author: gsz
|
||||
* @Date: 2024/5/21 14:16
|
||||
* @Modify:
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MesShiftServiceImpl implements IMesShiftService {
|
||||
|
||||
@Autowired
|
||||
private MesShiftRepository mesShiftRepository;
|
||||
|
||||
@Override
|
||||
public ListPager<MesShift> queryMesShiftByPager(MesShift bean, Pager pager) {
|
||||
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
||||
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
||||
DdlPreparedPack.getStringEqualPack(bean.getShiftCode(), "shiftCode", packBean);
|
||||
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
||||
pager = PagerHelper.getPager(pager, mesShiftRepository.findByHqlWhereCount(packBean));
|
||||
|
||||
List<MesShift> resultList = mesShiftRepository.findByHqlWherePage(packBean, pager);
|
||||
|
||||
return new ListPager<>(resultList, pager);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.equiplog;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesMouldMultiCavityService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipVariableCfgRuleMatchDispatchService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCfgCollectContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.*;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Description : 发送初始化指令工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("MesSendInitializationCmdStepSeryice")
|
||||
public class MesSendInitializationCmdStepSeryice extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Autowired
|
||||
private IMesEquipmentLogExtService equipmentLogExtService;
|
||||
|
||||
@Autowired
|
||||
private IMesEquipVariableCfgRuleMatchDispatchService equipVariableCfgRuleMatchService;
|
||||
|
||||
@Autowired
|
||||
private IMesMouldMultiCavityService mouldMultiCavityService;
|
||||
|
||||
@Autowired
|
||||
private IPartService partService;
|
||||
|
||||
@Override
|
||||
public StepResult init(StationRequestBean reqBean) {
|
||||
|
||||
productionProcessContextStepService.doSendStepContextMessage(reqBean);
|
||||
|
||||
return super.init(reqBean);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
Optional<Map<String, MesProdRouteOptParam>> stepParamMap = getStepParams(reqBean);
|
||||
|
||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean, stepParamMap);
|
||||
|
||||
//当前工序已存在头道模具号跟一模多腔信息
|
||||
if (!StringUtils.isEmpty(productionProcessContext.getFirstMouldNo()) && !StringUtils.isEmpty(productionProcessContext.getMouldCavityJson())) return stepResult;
|
||||
|
||||
//获取生产过程上下文对象有异常信息 抛出异常
|
||||
if (!productionProcessContextStepService.getEquipmentVariableCfgList(productionProcessContext).getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean, productionProcessContext.getMessage());
|
||||
|
||||
List<MesEquipmentVariableCfg> equipmentVariableCfgList = productionProcessContext.getEquipVariableCfgListByVct();
|
||||
|
||||
equipmentVariableCfgList = productionProcessContextStepService.collectEquipmentVariableCfgList(equipmentVariableCfgList, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.INIT_INSTRUCTION_STEP.getValue());
|
||||
|
||||
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||
|
||||
//配置错误 抛出异常
|
||||
if (CollectionUtils.isEmpty(equipmentVariableCfgList)) execExpSendMsgAndThrowEx(reqBean, resultBean,
|
||||
String.format("请检查设备数据变量接口逻辑信息,设备[%s]未配置变量配置类型[%s]头道模具号相关变量类别的数据变量接口逻辑信息!", cellEquipContext.getEquipmentCode(), cellEquipContext.getVariableCfgType()));
|
||||
|
||||
List<String> categoryLevelTwoList = productionProcessContextStepService.collectCategoryLevelTwoList(equipmentVariableCfgList);
|
||||
|
||||
List<MesEquipmentVariable> equipmentVariableList = productionProcessContextStepService.findEquipmentVariableList(productionProcessContext, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue(), categoryLevelTwoList);
|
||||
|
||||
//配置错误 抛出异常
|
||||
if (CollectionUtils.isEmpty(equipmentVariableList)) execExpSendMsgAndThrowEx(reqBean, resultBean,
|
||||
String.format("请检查设备数据变量信息,根据设备[%s]对应的数据变量接口逻辑信息,未配置变量类型[%s]二级变量%s相关的数据变量信息!", cellEquipContext.getEquipmentCode(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getDescription(), categoryLevelTwoList.toString()));
|
||||
|
||||
List<MesEquipVariableCfgCollectContext> collectContextList = equipmentLogExtService.doHandleEquipmentLogList(cellEquipContext, equipmentVariableList, equipmentVariableCfgList);
|
||||
this.sendMessage(reqBean, resultBean, JSONObject.toJSONString(collectContextList), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
||||
|
||||
//todo
|
||||
|
||||
return stepResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.equiplog;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesMouldMultiCavityService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipVariableCfgRuleMatchDispatchService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCfgCollectContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
|
||||
import cn.estsh.i3plus.platform.common.util.MesPcnConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.*;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import javassist.tools.web.Webserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description : 发送允许加工指令工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("MesSendProcessCmdStepService")
|
||||
public class MesSendProcessCmdStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Autowired
|
||||
private IMesEquipmentLogExtService equipmentLogExtService;
|
||||
|
||||
@Autowired
|
||||
private IMesEquipVariableCfgRuleMatchDispatchService equipVariableCfgRuleMatchService;
|
||||
|
||||
@Autowired
|
||||
private IMesMouldMultiCavityService mouldMultiCavityService;
|
||||
|
||||
@Autowired
|
||||
private IPartService partService;
|
||||
|
||||
@Override
|
||||
public StepResult init(StationRequestBean reqBean) {
|
||||
|
||||
productionProcessContextStepService.doSendStepContextMessage(reqBean);
|
||||
|
||||
return super.init(reqBean);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
Optional<Map<String, MesProdRouteOptParam>> stepParamMap = getStepParams(reqBean);
|
||||
|
||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean, stepParamMap);
|
||||
|
||||
//当前工序已存在头道模具号跟一模多腔信息
|
||||
if (!StringUtils.isEmpty(productionProcessContext.getFirstMouldNo()) && !StringUtils.isEmpty(productionProcessContext.getMouldCavityJson())) return stepResult;
|
||||
|
||||
//获取生产过程上下文对象有异常信息 抛出异常
|
||||
if (!productionProcessContextStepService.getEquipmentVariableCfgList(productionProcessContext).getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean, productionProcessContext.getMessage());
|
||||
|
||||
List<MesEquipmentVariableCfg> equipmentVariableCfgList = productionProcessContext.getEquipVariableCfgListByVct();
|
||||
|
||||
equipmentVariableCfgList = productionProcessContextStepService.collectEquipmentVariableCfgList(equipmentVariableCfgList, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PROCESS_INSTRUCTION_STEP.getValue());
|
||||
|
||||
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
|
||||
|
||||
//配置错误 抛出异常
|
||||
if (CollectionUtils.isEmpty(equipmentVariableCfgList)) execExpSendMsgAndThrowEx(reqBean, resultBean,
|
||||
String.format("请检查设备数据变量接口逻辑信息,设备[%s]未配置变量配置类型[%s]允许加工指令工步 相关变量类别的数据变量接口逻辑信息!", cellEquipContext.getEquipmentCode(), cellEquipContext.getVariableCfgType()));
|
||||
|
||||
List<String> categoryLevelTwoList = productionProcessContextStepService.collectCategoryLevelTwoList(equipmentVariableCfgList);
|
||||
|
||||
List<MesEquipmentVariable> equipmentVariableList = productionProcessContextStepService.findEquipmentVariableList(productionProcessContext, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue(), categoryLevelTwoList);
|
||||
|
||||
//配置错误 抛出异常
|
||||
if (CollectionUtils.isEmpty(equipmentVariableList)) execExpSendMsgAndThrowEx(reqBean, resultBean,
|
||||
String.format("请检查设备数据变量信息,根据设备[%s]对应的数据变量接口逻辑信息,未配置变量类型[%s]二级变量%s相关的数据变量信息!", cellEquipContext.getEquipmentCode(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getDescription(), categoryLevelTwoList.toString()));
|
||||
|
||||
List<MesEquipVariableCfgCollectContext> collectContextList = equipmentLogExtService.doHandleEquipmentLogList(cellEquipContext, equipmentVariableList, equipmentVariableCfgList);
|
||||
this.sendMessage(reqBean, resultBean, JSONObject.toJSONString(collectContextList), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
||||
|
||||
//发送 todo
|
||||
|
||||
|
||||
if (!stepResult.isCompleted()) threadSleep(stepParamMap, MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
||||
|
||||
return stepResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesSnProductionProcessContext;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesMouldMultiCavity;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 保存零件条码信息工步
|
||||
* @Author : zxw
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MesProductSnSaveStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Autowired
|
||||
private MesProduceSnRepository mesProduceSnRepository;
|
||||
|
||||
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
||||
List<MesProduceSn> mesProduceSns = productionProcessContext.getProduceSnDataList();
|
||||
|
||||
mesProduceSns.forEach(mesProduceSn -> {
|
||||
mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue());
|
||||
});
|
||||
mesProduceSnRepository.saveAll(mesProduceSns);
|
||||
|
||||
return StepResult.getSuccessComplete();
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesProductionRecordRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 生成加工记录工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MesProductionReocrdGenerateStepService extends BaseStepService {
|
||||
@Autowired
|
||||
private SnowflakeIdMaker snowflakeIdMaker;
|
||||
|
||||
@Autowired
|
||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||
|
||||
@Autowired
|
||||
private MesProduceSnRepository mesProduceSnRepository;
|
||||
|
||||
@Autowired
|
||||
private MesProductionRecordRepository mesProductionRecordRepository;
|
||||
|
||||
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
|
||||
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
||||
List<MesProduceSn> mesProduceSns = productionProcessContext.getProduceSnDataList();
|
||||
|
||||
List<MesProductionRecord> mesProductionRecords = new ArrayList<>();
|
||||
mesProduceSns.forEach(mesProduceSn -> {
|
||||
|
||||
MesProductionRecord mesProductionRecord = getMesProductionRecord(productionProcessContext, mesProduceSn);
|
||||
mesProductionRecords.add(mesProductionRecord);
|
||||
});
|
||||
|
||||
mesProductionRecordRepository.saveAll(mesProductionRecords);
|
||||
|
||||
return StepResult.getSuccessComplete();
|
||||
}
|
||||
|
||||
private MesProductionRecord getMesProductionRecord(MesProductionProcessContext productionProcessContext, MesProduceSn mesProduceSn) {
|
||||
MesProductionRecord mesProductionRecord = new MesProductionRecord();
|
||||
|
||||
mesProductionRecord.setSerialNumber(mesProduceSn.getSerialNumber());
|
||||
mesProductionRecord.setAreaCode(mesProduceSn.getAreaCode());
|
||||
mesProductionRecord.setCraftCode(mesProduceSn.getCraftCode());
|
||||
mesProductionRecord.setCustSn(mesProduceSn.getCustSn());
|
||||
mesProductionRecord.setEquipmentCode(mesProduceSn.getEquipmentCode());
|
||||
mesProductionRecord.setIsComplete(MesEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
||||
mesProductionRecord.setCompleteDateTime(DateUtil.formatDateTime(new Date()));
|
||||
mesProductionRecord.setLotNo(mesProduceSn.getLotNo());
|
||||
mesProductionRecord.setEquipmentName(mesProduceSn.getEquipmentName());
|
||||
|
||||
String mouldNo = "";
|
||||
if (productionProcessContext.getFirstMouldNo() != null) {
|
||||
mouldNo = productionProcessContext.getFirstMouldNo().getEquipVariableValue();
|
||||
}else if (productionProcessContext.getFirstMouldNo() == null && productionProcessContext.getMouldNo() != null){
|
||||
mouldNo = productionProcessContext.getMouldNo().getEquipVariableValue();
|
||||
}
|
||||
mesProductionRecord.setMouldNo(mouldNo);
|
||||
// todo
|
||||
// mesProductionRecord.setMouldRecordId();
|
||||
mesProductionRecord.setProcessCode(mesProduceSn.getProcessCode());
|
||||
mesProductionRecord.setReportPartNo(mesProduceSn.getPartNo());
|
||||
mesProductionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue());
|
||||
mesProductionRecord.setReportType(mesProduceSn.getReportType() + "");
|
||||
mesProductionRecord.setShiftCode(mesProduceSn.getShiftCode());
|
||||
mesProductionRecord.setShiftGroup(mesProduceSn.getShiftGroup());
|
||||
mesProductionRecord.setWorkOrderNo(mesProduceSn.getWorkOrderNo());
|
||||
mesProductionRecord.setWorkCellCode(mesProduceSn.getWorkCellCode());
|
||||
mesProductionRecord.setWorkCenterCode(mesProduceSn.getWorkCenterCode());
|
||||
return mesProductionRecord;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue