43661 排序发运扫描条码时,同序号的零件也需要校验扫描顺序

tags/yfai-mes-ext-v2.3
jun 6 months ago
parent d59c8cd91e
commit 6ca8142abb

@ -0,0 +1,13 @@
package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.mes.bean.MesCustomerPartType;
/**
* @Description :
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 17:27
* @Modify:
**/
public interface IMesCustomerPartTypeService extends IBaseMesService<MesCustomerPartType> {
}

@ -0,0 +1,20 @@
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.MesCustomerPartType;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description :
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 17:35
* @Modify:
**/
@Api(description = "客户零件类型")
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesCustomerPartType")
public class MesCustomerPartTypeController extends BaseMesController<MesCustomerPartType> {
}

@ -224,7 +224,6 @@ public class MesWorkOrderController extends BaseMesController<MesWorkOrder> {
ValidatorBean.checkNotNull(partNo, "零件号不能为空");
ValidatorBean.checkNotNull(workCenterCode, "产线不能为空");
ValidatorBean.checkNotNull(partProdGroupCode, "生产组代码不能为空");
ValidatorBean.checkNotNull(carModelCode, "车型代码不能为空");
ValidatorBean.checkNotNull(organizeCode, "工厂代码不能为空");
ValidatorBean.checkNotNull(userName, "操作人不能为空");

@ -60,9 +60,8 @@ public class Pisces1Properties {
*
*/
LOGGER.info("【客户定制化pisces1数据源加载...】");
DynamicDataSourceProxy piscesDataSource = DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(),this.getPiscesDsUsername(),this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
return piscesDataSource;
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -0,0 +1,67 @@
package cn.estsh.i3plus.ext.mes.apiservice.cus_suit;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.plugin.datasource.DynamicDataSourceProxy;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Description : pisces2
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces2Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces2
*/
@Value("${impp.pisces2.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces2.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces2.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces2.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces2.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces2.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces2DataSource")
@ConditionalOnExpression("'${impp.pisces2.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces2数据源加载...】");
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -60,9 +60,8 @@ public class PiscesProperties {
*
*/
LOGGER.info("【客户定制化pisces数据源加载...】");
DynamicDataSourceProxy piscesDataSource = DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(),this.getPiscesDsUsername(),this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
return piscesDataSource;
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -84,6 +84,7 @@ public class ShipmentDetailReportDaoImpl implements IShipmentDetailReportDao {
dataQueryHql.append("ms.status AS status,");
dataQueryHql.append("ms.shippingGroupCode AS shippingGroupCode,");
dataQueryHql.append("ms.orderCode AS orderCode,");
dataQueryHql.append("ms.planArriveEndTime AS planArriveEndTime,");
dataQueryHql.append("ms.scanSeqWay AS scanSeqWay");
dataQueryHql.append(")");

@ -53,6 +53,8 @@ public class MesSAPDbAdapter {
@Resource(name = "pisces1DataSource")
private DynamicDataSourceProxy pisces1DataSourceProxy;
@Resource(name = "pisces2DataSource")
private DynamicDataSourceProxy pisces2DataSourceProxy;
@Value("${sync.redis.time:1800}")
private Integer redisTime;
@ -82,7 +84,8 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy sapDataSourceProxy,
DynamicDataSourceProxy mesDataSourceProxy,
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy) throws Exception {
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy) throws Exception {
WmsSAPDbWriter wmsSAPDbWriter = null;
@ -110,6 +113,14 @@ public class MesSAPDbAdapter {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces1DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES22MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces2DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES2.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces2DataSourceProxy);
}
// new 的对象需要手工注入 bean
if (SpringContextsUtil.getApplicationContext() != null) {
@ -140,7 +151,8 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy sapDataSourceProxy,
DynamicDataSourceProxy mesDataSourceProxy,
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy) {
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy) {
WmsSAPDbReader wmsSAPDbReader = null;
@ -168,6 +180,14 @@ public class MesSAPDbAdapter {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES22MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces2DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES2.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
// if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.WMS2MES.getName())) {
// wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
// }
@ -220,11 +240,11 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy);
reader.setSrcConn(this.srcConn);
@ -381,11 +401,11 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy);
reader.setSrcConn(this.srcConn);

@ -0,0 +1,60 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesCustomerPartTypeService;
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.MesCustomerPartType;
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;
/**
* @Description :
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 17:25
* @Modify:
**/
@Service
@Slf4j
public class MesCustomerPartTypeServiceImpl extends BaseMesService<MesCustomerPartType> implements IMesCustomerPartTypeService {
@Override
protected void onInsertBean(MesCustomerPartType item) {
checkData(item);
}
@Override
protected void onUpdateBean(MesCustomerPartType item) {
checkData(item);
}
@Override
protected void setPackQueryBean(MesCustomerPartType bean, DdlPackBean packBean) {
DdlPreparedPack.getStringLikerPack(bean.getPartTypeCode(), "partTypeCode", packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartTypeName(), "partTypeName", packBean);
DdlPreparedPack.getStringLikerPack(bean.getCustPartNo(), "custPartNo", packBean);
DdlPreparedPack.getStringLikerPack(bean.getCustPartName(), "custPartName", packBean);
}
private void checkData(MesCustomerPartType item) {
// 数据校验
ValidatorBean.checkNotNull(item.getPartTypeCode(), "零件类型代码不能为空");
ValidatorBean.checkNotNull(item.getCustPartNo(), "客户物料号不能为空");
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(item.getPartTypeCode(), "partTypeCode", seriesPackBean);
DdlPreparedPack.getStringEqualPack(item.getCustPartNo(), "custPartNo", seriesPackBean);
DdlPreparedPack.getNumNOEqualPack(item.getId(), "id", seriesPackBean);
boolean flg = baseRDao.isExitByHql(seriesPackBean);
if (flg) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("类型【%s】客户零件【%s】数据已存在请检查数据", item.getPartTypeCode(), item.getCustPartNo())
.build();
}
}
}

@ -74,6 +74,8 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
DdlPreparedPack.getStringLikerPack(bean.getRemark(), "remark", packBean);
DdlPreparedPack.getNumEqualPack(bean.getStatus(), "status", packBean);
DdlPreparedPack.getInPackArray(bean.getStatusArray(), "status", packBean);
DdlPreparedPack.getStringBiggerPack(bean.getPlanArriveEndTimeStart(), "planArriveEndTime", packBean);
DdlPreparedPack.getStringSmallerPack(bean.getPlanArriveEndTimeEnd(), "planArriveEndTime", packBean);
if (!StringUtils.isEmpty(bean.getReleaseTimeStart()) || !StringUtils.isEmpty(bean.getReleaseTimeEnd())) {
DdlPreparedPack.timeBuilder(bean.getReleaseTimeStart(), bean.getReleaseTimeEnd(), "releaseTime", packBean, false);
}

Loading…
Cancel
Save