Merge branch 'dev_temp_xw_20250305_45455' into dev

dev
xiangwei.zhang 2 months ago
commit 3d02c9b4a9

@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.ext.mes.pojo.model.board.MesWorkOrderBoardReqModel;
import cn.estsh.i3plus.ext.mes.pojo.model.board.MesWorkOrderBoardResModel;
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.mes.bean.*;
@ -80,4 +81,5 @@ public interface IMesWorkOrderService extends IBaseMesService<MesWorkOrder> {
@ApiOperation(value = "根据工单状态改变--关闭拉动但")
void doCloseKittingOrder(MesWorkOrder mesWorkOrder,String userName);
void setBean(MesWorkOrder bean, DdlPackBean packBean);
}

@ -1,11 +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.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesCutScheme;
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.Api;
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;
import java.util.List;
/**
*
*/

@ -8,6 +8,7 @@ import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.excel.MesExcelTool;
import cn.estsh.i3plus.ext.mes.apiservice.utils.MesException;
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
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.enumutil.ResourceEnumUtil;
@ -248,5 +249,29 @@ public class MesWorkOrderController extends BaseMesController<MesWorkOrder> {
}
}
/**
* +
*
* @param bean
* @param pager
* @return
*/
@GetMapping(value = "/order/query")
@ApiOperation(value = "查询信息带分页", notes = "组合查询,外带分页功能")
public ResultBean<MesWorkOrder> queryByPager(MesWorkOrder bean, Pager pager) {
try {
bean.setOrganizeCode(AuthUtilExt.getOrganizeCode());
//bean.setOrganizeCode("ck01");
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
mesWorkOrderService.setBean(bean, packBean);
ListPager<MesWorkOrder> listPager = getBaseService().queryPagerWhere(pager, packBean);
return ResultBean.success("操作成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setListPager(listPager);
} catch (ImppBusiException e) {
return ResultBean.fail(e);
}
}
}

@ -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 : pisces4
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces4Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces4
*/
@Value("${impp.pisces4.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces4.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces4.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces4.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces4.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces4.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces4DataSource")
@ConditionalOnExpression("'${impp.pisces4.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces4数据源加载...】");
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 : pisces5
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces5Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces5
*/
@Value("${impp.pisces5.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces5.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces5.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces5.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces5.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces5.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces5DataSource")
@ConditionalOnExpression("'${impp.pisces5.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces5数据源加载...】");
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 : pisces6
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces6Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces6
*/
@Value("${impp.pisces6.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces6.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces6.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces6.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces6.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces6.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces6DataSource")
@ConditionalOnExpression("'${impp.pisces6.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces6数据源加载...】");
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -59,6 +59,15 @@ public class MesSAPDbAdapter {
@Resource(name = "pisces3DataSource")
private DynamicDataSourceProxy pisces3DataSourceProxy;
@Resource(name = "pisces4DataSource")
private DynamicDataSourceProxy pisces4DataSourceProxy;
@Resource(name = "pisces5DataSource")
private DynamicDataSourceProxy pisces5DataSourceProxy;
@Resource(name = "pisces6DataSource")
private DynamicDataSourceProxy pisces6DataSourceProxy;
@Value("${sync.redis.time:1800}")
private Integer redisTime;
@ -89,7 +98,10 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy,
DynamicDataSourceProxy pisces3DataSourceProxy) throws Exception {
DynamicDataSourceProxy pisces3DataSourceProxy,
DynamicDataSourceProxy pisces4DataSourceProxy,
DynamicDataSourceProxy pisces5DataSourceProxy,
DynamicDataSourceProxy pisces6DataSourceProxy) throws Exception {
WmsSAPDbWriter wmsSAPDbWriter = null;
@ -133,6 +145,29 @@ public class MesSAPDbAdapter {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces3DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES42MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces4DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES4.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces4DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES52MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces5DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES5.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces5DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES62MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces6DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES6.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces6DataSourceProxy);
}
// new 的对象需要手工注入 bean
if (SpringContextsUtil.getApplicationContext() != null) {
@ -165,7 +200,10 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy,
DynamicDataSourceProxy pisces3DataSourceProxy) {
DynamicDataSourceProxy pisces3DataSourceProxy,
DynamicDataSourceProxy pisces4DataSourceProxy,
DynamicDataSourceProxy pisces5DataSourceProxy,
DynamicDataSourceProxy pisces6DataSourceProxy) {
WmsSAPDbReader wmsSAPDbReader = null;
@ -209,6 +247,30 @@ public class MesSAPDbAdapter {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES42MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces4DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES4.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES52MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces5DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES5.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES62MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces6DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES6.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
// if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.WMS2MES.getName())) {
// wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
// }
@ -261,11 +323,15 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
reader.setSrcConn(this.srcConn);
@ -422,11 +488,15 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
reader.setSrcConn(this.srcConn);

@ -6,13 +6,16 @@ import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.repository.MesCutSchemeMaterialRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCenterRepository;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
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 org.testng.util.Strings;
import java.util.List;
import java.util.Map;
@ -24,6 +27,8 @@ public class MesCutSchemeService extends BaseMesService<MesCutScheme> implements
@Autowired
private MesWorkCenterRepository workCenterRepository;
@Autowired
private MesCutSchemeMaterialRepository cutSchemeMaterialRepository;
protected void setPackQueryBean(MesCutScheme bean, DdlPackBean packBean) {
DdlPreparedPack.getStringLikerPack(bean.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean);
@ -91,4 +96,25 @@ public class MesCutSchemeService extends BaseMesService<MesCutScheme> implements
// }
//}
}
//查询后执行
public void afterList(List<MesCutScheme> mesCutSchemes) {
List<String> cutCodes = mesCutSchemes.stream().map(MesCutScheme::getCutCode).collect(Collectors.toList());
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode());
DdlPreparedPack.getInPackList(cutCodes, "cutCode", ddlPackBean);
List<MesCutSchemeMaterial> mesCutSchemeMaterials = cutSchemeMaterialRepository.findByHqlWhere(ddlPackBean);
if (CollectionUtils.isEmpty(mesCutSchemeMaterials)) {
return;
}
Map<String,List<MesCutSchemeMaterial>> materialMap = mesCutSchemeMaterials.stream().collect(Collectors.groupingBy(MesCutSchemeMaterial::getCutCode));
for (MesCutScheme mesCutScheme : mesCutSchemes) {
List<MesCutSchemeMaterial> list = materialMap.get(mesCutScheme.getCutCode());
mesCutScheme.setPartNos(list.stream().map(MesCutSchemeMaterial::getPartNo).map(String::valueOf).collect(Collectors.joining(",")));
}
}
}

@ -211,6 +211,14 @@ public class MesShippingOrderManagementDetailService extends BaseMesService<MesS
for (MesShippingOrderManagementDetail mesShippingOrderManagementDetail : detailList) {
MesShippingOrderManagement mesShippingOrderManagement = orderMap.get(mesShippingOrderManagementDetail.getPid());
final String detailBarCode = mesShippingOrderManagementDetail.getBarcode();
if (!StringUtils.isEmpty(detailBarCode)) {
if (detailBarCode.contains(",")) {
String workOrderNo = detailBarCode.substring(0, detailBarCode.lastIndexOf(","));
mesJisShippings = getJisShippingByWorkOrder(mesShippingOrderManagement, mesShippingOrderManagementDetail, workOrderNo, organizeCode, userName);
}
} else {
if (StringUtils.isEmpty(mesShippingOrderManagementDetail.getPartNo())) {
log.info("发运单明细对应零件号为空");
return ResultBean.fail(String.format("发运单明细对应零件号为空"));
@ -220,14 +228,12 @@ public class MesShippingOrderManagementDetailService extends BaseMesService<MesS
return ResultBean.fail(String.format("计划数量和实际数量不相等"));
}
MesPartShippingGroup mesPartShippingGroup = mesPartShippingGroupService.getMesPartShippingGroup(organizeCode, mesShippingOrderManagement.getShippingGroupCode());
mesJisShippings.add(getMesJisShippings(mesShippingOrderManagement, mesShippingOrderManagementDetail, userName, mesPartShippingGroup));
}
mesShippingOrderManagementDetail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
mesShippingOrderManagementDetail.setRemark("手工发运");
ConvertBean.serviceModelUpdate(mesShippingOrderManagementDetail, userName);
mesJisShippings.add(getMesJisShippings(mesShippingOrderManagement, mesShippingOrderManagementDetail, userName, mesPartShippingGroup));
}
if (!CollectionUtils.isEmpty(detailList)) {
shippingOrderDetailRepository.saveAll(detailList);
@ -370,36 +376,13 @@ public class MesShippingOrderManagementDetailService extends BaseMesService<MesS
return new ListPager<>(modelList, pager);
}
@Override
public void doHandleCockpitShippingError(MesShippingOrderManagementDetail detail, MesWorkOrder workOrder) {
if (StringUtils.isEmpty(detail.getPartNo())) {
MesException.throwFlowException("发运单明细对应零件号为空");
}
if (StringUtils.isEmpty(workOrder.getCustSn())) {
MesException.throwMesBusiException("工单【%s】不存在客户条码", workOrder.getWorkOrderNo());
}
String organizeCode = AuthUtil.getOrganizeCode();
String userName = AuthUtil.getSessionUser().getUserName();
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(detail.getPid(), "id", orderPackBean);
MesShippingOrderManagement orderManagement = shippingOrderRepository.getByProperty(orderPackBean);
if (orderManagement == null || StringUtils.isEmpty(orderManagement.getShippingGroupCode())) {
MesException.throwFlowException("发运单主表不存在");
}
DdlPackBean partShippingGroupPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringLikerPack(orderManagement.getShippingGroupCode(), "shippingGroupCode", partShippingGroupPackBean);
MesPartShippingGroup mesPartShippingGroup = mesPartShippingGroupRDao.getByProperty(partShippingGroupPackBean);
if (mesPartShippingGroup == null || StringUtils.isEmpty(mesPartShippingGroup.getConfirmPartType()) || Integer.parseInt(mesPartShippingGroup.getConfirmPartType()) != MesExtEnumUtil.SHIPPING_GROUP_CONFIRM_PART_TYPE.SHIPPING_GROUP_CONFIRM_PART_TYPE_30.getValue()) {
MesException.throwFlowException("零件发运组【%s】扫描确认零件方式应为【装配目视单和客户零件条码】", orderManagement.getShippingGroupCode());
}
private List<MesJisShipping> getJisShippingByWorkOrder(MesShippingOrderManagement orderManagement, MesShippingOrderManagementDetail detail, String workOrderNo, String organizeCode, String userName) {
List<MesJisShipping> shippingList = new ArrayList<>();
DdlPackBean workOrderPartPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(workOrder.getWorkOrderNo(), "workOrderNo", workOrderPartPackBean);
DdlPreparedPack.getStringEqualPack(workOrderNo, "workOrderNo", workOrderPartPackBean);
List<MesWorkOrderPart> workOrderParts = mesWorkOrderPartRepository.findByHqlWhere(workOrderPartPackBean);
if (!CollectionUtils.isEmpty(workOrderParts)) {
List<MesJisShipping> shippingList = new ArrayList<>();
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.MOVE_RULE_GROUP_TYPE.MOVE_RULE_GROUP_TYPE_10.getValue(), "groupType", ddlPackBean);
DdlPreparedPack.getStringEqualPack(orderManagement.getShippingGroupCode(), "code", ddlPackBean);
@ -418,13 +401,69 @@ public class MesShippingOrderManagementDetailService extends BaseMesService<MesS
if (moveRule != null && Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_20.getValue()) && MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.SHIPPING.getValue() == moveRule.getReportType()) {
shippingList.add(getMesJisShipping(orderManagement, detail, moveRule.getErpSrcLocateNo(), orderPart, userName));
} else {
log.info("客供品移库零件【{}】在零件发运组【{}】的移库规则中,汇报类型未维护或不为发运", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
log.info("客供品移库零件【{}】在零件发运组【{}】的移库规则中,汇报类型未维护或不为发运", orderPart.getPartNo(), orderManagement.getShippingGroupCode());
}
}
}
jisShippingRepository.saveAll(shippingList);
return shippingList;
}
@Override
public void doHandleCockpitShippingError(MesShippingOrderManagementDetail detail, MesWorkOrder workOrder) {
if (StringUtils.isEmpty(detail.getPartNo())) {
MesException.throwFlowException("发运单明细对应零件号为空");
}
if (StringUtils.isEmpty(workOrder.getCustSn())) {
MesException.throwMesBusiException("工单【%s】不存在客户条码", workOrder.getWorkOrderNo());
}
String organizeCode = AuthUtil.getOrganizeCode();
String userName = AuthUtil.getSessionUser().getUserName();
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(detail.getPid(), "id", orderPackBean);
MesShippingOrderManagement orderManagement = shippingOrderRepository.getByProperty(orderPackBean);
if (orderManagement == null || StringUtils.isEmpty(orderManagement.getShippingGroupCode())) {
MesException.throwFlowException("发运单主表不存在");
}
DdlPackBean partShippingGroupPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringLikerPack(orderManagement.getShippingGroupCode(), "shippingGroupCode", partShippingGroupPackBean);
MesPartShippingGroup mesPartShippingGroup = mesPartShippingGroupRDao.getByProperty(partShippingGroupPackBean);
if (mesPartShippingGroup == null || StringUtils.isEmpty(mesPartShippingGroup.getConfirmPartType()) || Integer.parseInt(mesPartShippingGroup.getConfirmPartType()) != MesExtEnumUtil.SHIPPING_GROUP_CONFIRM_PART_TYPE.SHIPPING_GROUP_CONFIRM_PART_TYPE_30.getValue()) {
MesException.throwFlowException("零件发运组【%s】扫描确认零件方式应为【装配目视单和客户零件条码】", orderManagement.getShippingGroupCode());
}
// DdlPackBean workOrderPartPackBean = DdlPackBean.getDdlPackBean(organizeCode);
// DdlPreparedPack.getStringEqualPack(workOrder.getWorkOrderNo(), "workOrderNo", workOrderPartPackBean);
// List<MesWorkOrderPart> workOrderParts = mesWorkOrderPartRepository.findByHqlWhere(workOrderPartPackBean);
// if (!CollectionUtils.isEmpty(workOrderParts)) {
// List<MesJisShipping> shippingList = new ArrayList<>();
//
// DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
// DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.MOVE_RULE_GROUP_TYPE.MOVE_RULE_GROUP_TYPE_10.getValue(), "groupType", ddlPackBean);
// DdlPreparedPack.getStringEqualPack(orderManagement.getShippingGroupCode(), "code", ddlPackBean);
// List<MesMoveRule> mesMoveRuleList = mesMoveRuleRepository.findByHqlWhere(ddlPackBean);
// if (CollectionUtils.isEmpty(mesMoveRuleList)) {
// MesException.throwFlowException(String.format("移库规则不存在:发运单编号:%s,发运组代码:%s,", orderManagement.getShippingCode(), orderManagement.getShippingGroupCode()));
// }
// Map<String, MesMoveRule> mesMoveRuleMap = mesMoveRuleList.stream().filter(t -> Objects.nonNull(t.getSrcType())).collect(Collectors.toMap(MesMoveRule::getSrcType, Function.identity(), (x, y) -> y));
//
// for (MesWorkOrderPart orderPart : workOrderParts) {
// MesPart itemPart = mesPartService.getPartByPartNo(orderPart.getPartNo(), organizeCode);
// if (itemPart == null) {
// continue;
// }
// MesMoveRule moveRule = mesMoveRuleMap.get(itemPart.getEsd());
// if (moveRule != null && Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_20.getValue()) && MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.SHIPPING.getValue() == moveRule.getReportType()) {
// shippingList.add(getMesJisShipping(orderManagement, detail, moveRule.getErpSrcLocateNo(), orderPart, userName));
// } else {
// log.info("客供品移库零件【{}】在零件发运组【{}】的移库规则中,汇报类型未维护或不为发运", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
// }
// }
//
// jisShippingRepository.saveAll(shippingList);
// }
MesProduceSn mesProduceSn = mesProduceSnService.getMesProduceSnByCustSn(organizeCode, workOrder.getCustSn());
if (mesProduceSn != null) {
//更新条码状态为完成
@ -440,9 +479,9 @@ public class MesShippingOrderManagementDetailService extends BaseMesService<MesS
mesWorkOrderRDao.update(workOrder);
detail.setBarcode(workOrder.getWorkOrderNo() + "," + workOrder.getCustSn());
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
detail.setSystemSyncStatus(CommonEnumUtil.FALSE);
detail.setRemark("cockpit发运处理");
// detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue());
// detail.setSystemSyncStatus(CommonEnumUtil.FALSE);
// detail.setRemark("cockpit发运处理");
ConvertBean.serviceModelUpdate(detail, userName);
shippingOrderDetailRepository.update(detail);
}

@ -265,7 +265,7 @@ public class MesWorkOrderCutService extends BaseMesService<MesWorkOrderCut> impl
if (order.getUnCompleteQty().compareTo(totalQty) >= 0) {
workOrderUnCompleteMap.put(order.getWorkOrderNo(), MathOperation.sub(order.getUnCompleteQty(), totalQty));
workOrderQtyMap.put(order.getWorkOrderNo(), totalQty);
workOrderQtyMap.put(order.getWorkOrderNo(), cutSchemeFg.getQty());
totalQty = 0.0;
} else {
workOrderUnCompleteMap.put(order.getWorkOrderNo(), 0.0);

@ -335,27 +335,37 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
if (!StringUtils.isEmpty(pullOrderCloseState)){
List<String> closeState = Arrays.asList(pullOrderCloseState.split(","));
if (closeState.contains(mesWorkOrder.getWorkOrderStatus().toString())){
mesPullingOrderInfoRao.updateByProperties(new String[]{"workOrderNo"}, new Object[]{mesWorkOrder.getWorkOrderNo()}, new String[]{"pullOrderStatus","modifyUser"}, new Object[]{ MesExtEnumUtil.PULL_ORDER_STATUS.PULL_ORDER_STATUS_50,userName});
mesPullingOrderInfoRao.updateByProperties(new String[]{"workOrderNo"}, new Object[]{mesWorkOrder.getWorkOrderNo()}, new String[]{"pullOrderStatus","modifyUser"}, new Object[]{ MesExtEnumUtil.PULL_ORDER_STATUS.PULL_ORDER_STATUS_50.getValue(),userName});
}
}
}
}
}
}
public void setBean(MesWorkOrder bean, DdlPackBean packBean) {
setPackQueryBean(bean, packBean);
}
@Override
protected void setPackQueryBean(MesWorkOrder bean, DdlPackBean packBean) {
DdlPreparedPack.getStringLikerPack(bean.getWorkOrderNo(), MesExtConstWords.WORK_ORDER_NO, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartName(), MesExtConstWords.PART_NAME, packBean);
DdlPreparedPack.getStringLikerPack(bean.getCreateUser(), MesExtConstWords.CREATE_USER, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartNo(), MesExtConstWords.PART_NO, packBean);
String partNo = bean.getPartNo();
if (!StringUtil.isEmpty(partNo)) {
List<String> partNoList = Arrays.asList(partNo.split(","));
DdlPreparedPack.getInPackList(partNoList, MesExtConstWords.PART_NO, packBean);
}
DdlPreparedPack.getStringEqualPack(bean.getCustPartNo(), MesExtConstWords.CUST_PART_NO, packBean);
DdlPreparedPack.getStringLikerPack(bean.getWorkCenterCode(), MesExtConstWords.WORK_CENTER_CODE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getVinCode(), MesExtConstWords.VIN_CODE, packBean);
DdlPreparedPack.getStringEqualPack(bean.getOrderFlag(), MesExtConstWords.ORDER_FLAG, packBean);
DdlPreparedPack.getStringLikerPack(bean.getCustSn(), "custSn", packBean);
if (!StringUtil.isEmpty(bean.getWorkOrderStatusQuery())) {
DdlPreparedPack.getInPackList(Arrays.stream(bean.getWorkOrderStatusQuery().split(MesExtConstWords.COMMA)).map(Integer::parseInt).collect(Collectors.toList()), MesExtConstWords.WORK_ORDER_STATUS, packBean);
} else DdlPreparedPack.getNumEqualPack(bean.getWorkOrderStatus(), MesExtConstWords.WORK_ORDER_STATUS, packBean);
DdlPreparedPack.getNumEqualPack(bean.getWorkOrderType(), MesExtConstWords.WORK_ORDER_TYPE, packBean);
DdlPreparedPack.getNumEqualPack(bean.getQcStatus(), MesExtConstWords.QC_STATUS, packBean);
if (!StringUtils.isEmpty(bean.getCreateDateTimeStart()) || !StringUtils.isEmpty(bean.getCreateDateTimeEnd())) {
DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), MesExtConstWords.CREATE_DATE_TIME, packBean, false);
@ -795,6 +805,10 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
}
private void doCreateKitting(List<MesWorkOrder> mesWorkOrderList,String organizeCode) {
mesWorkOrderList = mesWorkOrderList.stream().filter(item ->item.getPullingStatus()!=MesExtEnumUtil.WORK_ORDER_PULLING_STATUS.SUBMIT.getValue()).collect(Collectors.toList());
if (mesWorkOrderList.isEmpty()){
return;
}
//1.拉动组获取 -- 根据拉动组类型获取kitting,需要判断是否生成是否生成拉动单开关
DdlPackBean partPullPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_PULL_ORDER_TYPE.KITTING_PULL.getValue(),"pullOrderType", partPullPackBean);
@ -967,6 +981,7 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
for (int i = 1; i <= multiple; i++) {
insertPullOrderInfo( mesWorkOrder, bomPullList, mesPartPull, mesPartPullDetailList, organizeCode, i, packRoundQty);
}
workOrderRepository.updateByProperties("workOrderNo",mesWorkOrder.getWorkOrderNo(),"pullingStatus",MesExtEnumUtil.WORK_ORDER_PULLING_STATUS.SUBMIT.getValue());
}
// /**
@ -1005,12 +1020,12 @@ public class MesWorkOrderService extends BaseMesService<MesWorkOrder> implements
private void insertPullOrderInfo(MesWorkOrder mesWorkOrder,List<MesBom> bomPullList,MesPartPull mesPartPull,List<MesPartPullDetail> mesPartPullDetailList,String organizeCode,int i, int roundPackQty){
//校验当前工单是否已经生成过拉动单,如果已经生成过则不在生成
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkOrderNo(),"workOrderNo", ddlPackBean);
int count = mesPullingOrderInfoRao.findByHqlWhereCount(ddlPackBean);
if (count >0){
return;
}
// DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkOrderNo(),"workOrderNo", ddlPackBean);
// int count = mesPullingOrderInfoRao.findByHqlWhereCount(ddlPackBean);
// if (count >0){
// return;
// }
// 计算所有拉动单的数量,生成拉动单
Map<String, List<MesPartPullDetail>> pullDetailMap = mesPartPullDetailList.stream().filter(item->!StringUtils.isEmpty(item.getPullPartNo())).collect(Collectors.groupingBy(MesPartPullDetail::getPullPartNo));
List<String> pullDetailPartList = mesPartPullDetailList.stream().map(MesPartPullDetail::getPullPartNo).collect(Collectors.toList());

@ -717,6 +717,8 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder {
orderAssembly.setProductPartNo(sortCfg.getProductPartNo());
orderAssembly.setPid(sortCfg.getId());
orderAssembly.setWorkCenterCode(workCenterCode);
orderAssembly.setPrintTemplate(sortCfg.getPrintTemplate());
orderAssembly.setPrinter(sortCfg.getPrinter());
workOrderAssemblyList.add(orderAssembly);
}
@ -759,6 +761,8 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder {
orderAssembly.setMaxValue(ruleSortCfg.getMaxValue());
orderAssembly.setMinValue(ruleSortCfg.getMinValue());
orderAssembly.setProductPartNo(ruleSortCfg.getProductPartNo());
orderAssembly.setPrintTemplate(ruleSortCfg.getPrintTemplate());
orderAssembly.setPrinter(ruleSortCfg.getPrinter());
workOrderAssemblyList.add(orderAssembly);
}
//查询所有共用的零件 且没有零件号,多用于螺钉---查询排序加工规则
@ -797,6 +801,8 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder {
orderAssembly.setMaxValue(ruleSortCfg.getMaxValue());
orderAssembly.setMinValue(ruleSortCfg.getMinValue());
orderAssembly.setProductPartNo(ruleSortCfg.getProductPartNo());
orderAssembly.setPrintTemplate(ruleSortCfg.getPrintTemplate());
orderAssembly.setPrinter(ruleSortCfg.getPrinter());
workOrderAssemblyList.add(orderAssembly);
}
return workOrderAssemblyList;

@ -70,3 +70,27 @@ impp.pisces3.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServer
impp.pisces3.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces3.datasource.username=sa
impp.pisces3.datasource.password=sahasnopassword
#Pisces4\u6570\u636E\u6E90
impp.pisces4.datasource.isopen=true
impp.pisces4.datasource.alias=pisces4DataSource
impp.pisces4.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces4.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces4.datasource.username=sa
impp.pisces4.datasource.password=sahasnopassword
#Pisces5\u6570\u636E\u6E90
impp.pisces5.datasource.isopen=true
impp.pisces5.datasource.alias=pisces5DataSource
impp.pisces5.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces5.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces5.datasource.username=sa
impp.pisces5.datasource.password=sahasnopassword
#Pisces6\u6570\u636E\u6E90
impp.pisces6.datasource.isopen=true
impp.pisces6.datasource.alias=pisces6DataSource
impp.pisces6.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces6.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces6.datasource.username=sa
impp.pisces6.datasource.password=sahasnopassword

@ -1,64 +0,0 @@
#\u5B89\u9053\u62D3\u6570\u636E\u6E90
impp.yfas.datasource.isopen=true
#WMS\u6570\u636E\u6E90
impp.mes.datasource.isopen=true
#\u6570\u636E\u6E90\u7684\u522B\u540D
impp.mes.datasource.alias=mesDataSource
impp.mes.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.mes.datasource.jdbc-url=jdbc:mysql://10.195.88.71:3306/impp_i3_mes?autoReconnect=true&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
#impp.mes.datasource.jdbc-url=jdbc:sqlserver://139.224.200.147:20037;DatabaseName=impp_i3_mes;
impp.mes.datasource.username=root
#impp.mes.datasource.password=Test123!
impp.mes.datasource.password=estsh123
#Admin123!
#\u6570\u636E\u6E90\u7684\u522B\u540D
impp.yfas.datasource.alias=yfasDataSource
impp.yfas.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.yfas.datasource.jdbc-url=jdbc:mysql://10.195.88.71:3316/impp_i3_wms_sap_if?autoReconnect=true&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
#impp.yfas.datasource.jdbc-url=jdbc:sqlserver://139.224.200.147:20037;DatabaseName=impp_i3_mes;
impp.yfas.datasource.username=root
impp.yfas.datasource.password=estsh123
#\u6570\u636E\u6E90\u7684\u522B\u540D
#impp.wms.datasource.isopen=true
#impp.wms.datasource.alias=wmsDataSource
#impp.wms.datasource.driver-class-name=com.mysql.jdbc.Driver
#impp.wms.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_wms?autoReconnect=true&useSSL=false&characterEncoding=utf-8
#impp.wms.datasource.username=root
#impp.wms.datasource.password=estsh123
#
##SWEB??????????
#impp.sweb.datasource.isopen=true
#impp.sweb.datasource.alias=swebDataSource
#impp.sweb.datasource.driver-class-name=com.mysql.jdbc.Driver
#impp.sweb.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_wms?autoReconnect=true&useSSL=false&characterEncoding=utf-8
#impp.sweb.datasource.username=root
#impp.sweb.datasource.password=estsh123
#Pisces数据源
impp.pisces.datasource.isopen=true
impp.pisces.datasource.alias=piscesDataSource
impp.pisces.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces.datasource.username=sa
impp.pisces.datasource.password=sahasnopassword
#Pisces数据源
impp.pisces1.datasource.isopen=true
impp.pisces1.datasource.alias=piscesDataSource
impp.pisces1.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces1.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces1.datasource.username=sa
impp.pisces1.datasource.password=sahasnopassword
#Pisces中间表数据源
impp.pisces1.datasource.isopen=true
impp.pisces1.datasource.alias=pisces1DataSource
impp.pisces1.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces1.datasource.jdbc-url=jdbc:sqlserver://172.28.16.73:1433;SelectMethod=cursor;DatabaseName=YFMES_DATACENTER;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces1.datasource.username=sa
impp.pisces1.datasource.password=sahasnopassword

@ -1,7 +1,7 @@
#\u9879\u76EE\u540D\u79F0
spring.application.name=i3mes
#\u4F7F\u7528\u914D\u7F6E
spring.profiles.active=6,cus-71
spring.profiles.active=docker,cus-docker
######### \u81EA\u5B9A\u4E49\u53C2\u6570 #########
#\u9879\u76EE\u63CF\u8FF0\u4FE1\u606F\uFF08swagger\u4E2D\u663E\u5F0F\uFF09\uFF0C\u4E2D\u6587\u4F7F\u7528uncode\u8F6C
desc.application.name=\u751F\u4EA7\u6267\u884C\u7CFB\u7EDF

@ -34,7 +34,7 @@
<i3plus.pojo.version>1.0.0-yfai</i3plus.pojo.version>
<i3plus.platform.version>1.0.0.1-patch</i3plus.platform.version>
<i3plus.icloud.version>1.0.0.1-patch</i3plus.icloud.version>
<i3plus.mes.version>1.0.1-yfai</i3plus.mes.version>
<i3plus.mes.version>1.0.2-yfai</i3plus.mes.version>
<log4j2.version>2.17.1</log4j2.version>
</properties>

Loading…
Cancel
Save