forked from I3-YF/i3plus-mes-yfai
Merge remote-tracking branch 'origin/dev' into dev
commit
e602b1a136
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesAssemblyPartNosortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author zxw
|
||||||
|
*/
|
||||||
|
public interface IMesAssemblyPartNosortCfgService extends IBaseMesService<MesAssemblyPartNosortCfg> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author zxw
|
||||||
|
*/
|
||||||
|
public interface IMesPartSapService extends IBaseMesService<MesPartSap> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author zxw
|
||||||
|
*/
|
||||||
|
public interface IMesProdRuleNosortCfgService extends IBaseMesService<MesProdRuleNosortCfg> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleSortCfg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author zxw
|
||||||
|
*/
|
||||||
|
public interface IMesProdRuleSortCfgService extends IBaseMesService<MesProdRuleSortCfg> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author zxw
|
||||||
|
*/
|
||||||
|
public interface IMesTimeEfficientCfgService extends IBaseMesService<MesTimeEfficientCfg> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.MesEquipmentModel;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : mes设备管理
|
||||||
|
* @Reference :
|
||||||
|
* @Author : wangjie
|
||||||
|
* @CreateDate : 2019-08-26
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IEquipmentExtService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按条件分页查询mes设备台账-组织模型
|
||||||
|
*
|
||||||
|
* @param equipment 设备台账
|
||||||
|
* @param pager 分页条件
|
||||||
|
* @return 数据集合
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "按条件分页查询mes设备台账-组织模型")
|
||||||
|
ListPager queryMesEquipmentByPagerOrg(MesEquipment equipment, Pager pager);
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesAssemblyPartNosortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非排序产品加工规则配置
|
||||||
|
*/
|
||||||
|
@Api("非排序装配件维护表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesAssemblyPartNosortCfg")
|
||||||
|
public class MesAssemblyPartNosortCfgController extends BaseMesController<MesAssemblyPartNosortCfg>{
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零件管理
|
||||||
|
*/
|
||||||
|
@Api("物料信息SAP")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartSap")
|
||||||
|
public class MesPartSapController extends BaseMesController<MesPartSap>{
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非排序产品加工规则配置
|
||||||
|
*/
|
||||||
|
@Api("非排序产品加工规则配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesProdRuleNosortCfg")
|
||||||
|
public class MesProdRuleNosortCfgController extends BaseMesController<MesProdRuleNosortCfg>{
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleSortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序产品加工规则配置
|
||||||
|
*/
|
||||||
|
@Api("排序产品加工规则配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesProdRuleSortCfg")
|
||||||
|
public class MesProdRuleSortCfgController extends BaseMesController<MesProdRuleSortCfg>{
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时效性维护
|
||||||
|
*/
|
||||||
|
@Api("时效性维护")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesTimeEfficientCfg")
|
||||||
|
public class MesTimeEfficientCfgController extends BaseMesController<MesTimeEfficientCfg>{
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.busi.IEquipmentExtService;
|
||||||
|
import cn.estsh.i3plus.mes.api.iservice.base.IEnumService;
|
||||||
|
import cn.estsh.i3plus.mes.apiservice.dao.IEquipmentDao;
|
||||||
|
import cn.estsh.i3plus.mes.apiservice.serviceimpl.busi.CommonService;
|
||||||
|
import cn.estsh.i3plus.mes.apiservice.serviceimpl.busi.EquipmentService;
|
||||||
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||||
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
||||||
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
||||||
|
import cn.estsh.i3plus.platform.common.util.MesConstWords;
|
||||||
|
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.enumutil.MesEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWcEquipment;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.MesEquipmentModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesEquipmentRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesWcEquipmentRepository;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.LocaleUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
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.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : mes设备管理方法调度类
|
||||||
|
* @Reference :
|
||||||
|
* @Author : wangjie
|
||||||
|
* @CreateDate : 2019-08-26
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class EquipmentExtService implements IEquipmentExtService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(EquipmentService.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEquipmentDao equipmentDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEnumService enumService;
|
||||||
|
/**
|
||||||
|
* 按条件分页查询mes设备台账-组织模型
|
||||||
|
*
|
||||||
|
* @param mesEquipment
|
||||||
|
* @param pager
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ListPager<MesEquipmentModel> queryMesEquipmentByPagerOrg(MesEquipment mesEquipment, Pager pager) {
|
||||||
|
Map<String, String> equStatusEnumMap = enumService.getEnumLangeuageKeyByClazzEnum(MesEnumUtil.MES_EQUIPMENT_STATUS.class);
|
||||||
|
pager = PagerHelper.getPager(pager, equipmentDao.queryMesEquipmentByPagerOrgCount(mesEquipment));
|
||||||
|
List<MesEquipmentModel> equipmentModels = equipmentDao.queryMesEquipmentByPagerOrg(mesEquipment, pager);
|
||||||
|
for (MesEquipmentModel equipmentModel : equipmentModels) {
|
||||||
|
if(equipmentModel.getStatus() != null){
|
||||||
|
equipmentModel.setStatusName(LocaleUtils.getLocaleRes(equStatusEnumMap.get(equipmentModel.getStatus().toString())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ListPager(equipmentModels, pager);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesAssemblyPartNosortCfgService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesTimeEfficientCfgService;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesAssemblyPartNosortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesAssemblyPartNosortCfgService extends BaseMesService<MesAssemblyPartNosortCfg> implements IMesAssemblyPartNosortCfgService {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartSapService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesPartSapService extends BaseMesService<MesPartSap> implements IMesPartSapService {
|
||||||
|
|
||||||
|
protected void setPackQueryBean(MesPartSap bean, DdlPackBean packBean) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getPartNo(), "partNo", packBean);
|
||||||
|
DdlPreparedPack.getStringLikeEqualPack(bean.getPartName(), "partName", packBean);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesProdRuleNosortCfgService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesTimeEfficientCfgService;
|
||||||
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
||||||
|
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.i3plus.pojo.mes.bean.MesPartShippingGroup;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesProdRuleNosortCfgService extends BaseMesService<MesProdRuleNosortCfg> implements IMesProdRuleNosortCfgService {
|
||||||
|
|
||||||
|
|
||||||
|
protected void setPackQueryBean(MesProdRuleNosortCfg bean, DdlPackBean packBean) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getInPartNo(), "inPartNo", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getOutPartNo(), "outPartNo", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getEquipmentCode(), "equipmentCode", packBean);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MesProdRuleNosortCfg insert(MesProdRuleNosortCfg bean) {
|
||||||
|
//插入前构造并校验数据
|
||||||
|
onInsertBean(bean);
|
||||||
|
|
||||||
|
bean = baseRDao.insert(bean);
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onInsertBean(MesProdRuleNosortCfg item) {
|
||||||
|
// 数据校验
|
||||||
|
//ValidatorBean.checkNotNull(item.getInPartNo(), "进件零件号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "产成零件号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "设备不能为空");
|
||||||
|
|
||||||
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||||
|
if (StringUtils.isEmpty(item.getInPartNo())) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getInPartNo(), "inPartNo", seriesPackBean);
|
||||||
|
}
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getOutPartNo(), "outPartNo", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", seriesPackBean);
|
||||||
|
|
||||||
|
|
||||||
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
||||||
|
if (flg) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("该非排序加工规则已存在,请检查数据")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onUpdateBean(MesProdRuleNosortCfg item) {
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "产成零件号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "设备不能为空");
|
||||||
|
|
||||||
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||||
|
if (StringUtils.isEmpty(item.getInPartNo())) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getInPartNo(), "inPartNo", seriesPackBean);
|
||||||
|
}
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getOutPartNo(), "outPartNo", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", seriesPackBean);
|
||||||
|
|
||||||
|
|
||||||
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
||||||
|
if (flg) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("该非排序加工规则已存在,请检查数据")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesProdRuleSortCfgService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesTimeEfficientCfgService;
|
||||||
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
||||||
|
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.i3plus.pojo.mes.bean.MesProdRuleSortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleSortCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesProdRuleSortCfgService extends BaseMesService<MesProdRuleSortCfg> implements IMesProdRuleSortCfgService {
|
||||||
|
|
||||||
|
protected void setPackQueryBean(MesProdRuleSortCfg bean, DdlPackBean packBean) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getPartNo(), "partNo", packBean);
|
||||||
|
DdlPreparedPack.getStringLikerPack(bean.getPartName(), "partName", packBean);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MesProdRuleSortCfg insert(MesProdRuleSortCfg bean) {
|
||||||
|
//插入前构造并校验数据
|
||||||
|
onInsertBean(bean);
|
||||||
|
|
||||||
|
bean = baseRDao.insert(bean);
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onInsertBean(MesProdRuleSortCfg item) {
|
||||||
|
// 数据校验
|
||||||
|
//ValidatorBean.checkNotNull(item.getInPartNo(), "进件零件号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getWorkCenterCode(), "产线不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getWorkCellCode(), "工位不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getPartNo(), "零件号不能为空");
|
||||||
|
|
||||||
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getWorkCellCode(), "workCellCode", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getWorkCenterCode(), "workCenterCode", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getPartNo(), "partNo", seriesPackBean);
|
||||||
|
|
||||||
|
|
||||||
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
||||||
|
if (flg) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("该排序加工规则已存在,请检查数据")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onUpdateBean(MesProdRuleSortCfg item) {
|
||||||
|
// 数据校验
|
||||||
|
//ValidatorBean.checkNotNull(item.getInPartNo(), "进件零件号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getWorkCenterCode(), "产线不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getWorkCellCode(), "工位不能为空");
|
||||||
|
ValidatorBean.checkNotNull(item.getPartNo(), "零件号不能为空");
|
||||||
|
|
||||||
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getWorkCellCode(), "workCellCode", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getWorkCenterCode(), "workCenterCode", seriesPackBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(item.getPartNo(), "partNo", seriesPackBean);
|
||||||
|
|
||||||
|
|
||||||
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
||||||
|
if (flg) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("该排序加工规则已存在,请检查数据")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartTypeService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesTimeEfficientCfgService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartType;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesTimeEfficientCfgService extends BaseMesService<MesTimeEfficientCfg> implements IMesTimeEfficientCfgService {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue