Merge remote-tracking branch 'origin/dev' into dev

dev-temp-xw-202501150000-44852
xiangwei.zhang 4 months ago
commit 6d160bfc2e

@ -0,0 +1,7 @@
package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.mes.bean.MesPackingRuleDetail;
public interface IMesPackingRuleDetailService extends IBaseMesService<MesPackingRuleDetail> {
}

@ -0,0 +1,7 @@
package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.mes.bean.MesPackingRule;
public interface IMesPackingRuleService extends IBaseMesService<MesPackingRule> {
}

@ -0,0 +1,13 @@
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.MesPackingRule;
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 + "/mesPackingRule")
public class MesPackingRuleController extends BaseMesController<MesPackingRule>{
}

@ -0,0 +1,13 @@
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.MesPackingRuleDetail;
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 + "/mesPackingRuleDetail")
public class MesPackingRuleDetailController extends BaseMesController<MesPackingRuleDetail>{
}

@ -138,7 +138,7 @@ public class MesProductionRecordReportExtDao implements IMesProductionRecordRepo
" b.shift_code AS shiftCode, " +
" ' ' AS equipmentCode, " +
" ' ' AS equipmentName, " +
" 30 AS reportStatus, " +
" b.type AS reportStatus, " +
" 2 AS dataSource, " +
" SUM( modify_qty ) AS statisticsQty " +
" FROM ");
@ -149,8 +149,12 @@ public class MesProductionRecordReportExtDao implements IMesProductionRecordRepo
" AND b.is_deleted = :isDeleted " +
" AND b.is_valid = :isValid " +
" AND b.modify_date_time >= :completeDateTimeStart " +
" AND b.modify_date_time <= :completeDateTimeEnd " +
" AND b.type = :messageType ");
" AND b.modify_date_time <= :completeDateTimeEnd ");
if (reportStatusList2Wo.size() == 1) {
woQueryHql.append(" AND b.type = :messageType ");
} else {
woQueryHql.append(" AND b.type in (:messageType) ");
}
if (!StringUtils.isEmpty(model.getPartNo())) {
woQueryHql.append(" AND b.part_no = :partNo ");
}
@ -220,7 +224,9 @@ public class MesProductionRecordReportExtDao implements IMesProductionRecordRepo
if (result.getDataSource().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) {
if (result.getReportStatus().compareTo(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue()) == 0) result.setReportStatusName(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getDescription());
else result.setReportStatusName(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getDescription());
} else result.setReportStatusName(MesExtEnumUtil.WORK_ORDER_LOG_TYPE.REPORT.getDescription());
} else {
result.setReportStatusName(MesExtEnumUtil.WORK_ORDER_LOG_TYPE.valueOfDescription(result.getReportStatus()));
}
}
resultList.add(result);
@ -246,7 +252,7 @@ public class MesProductionRecordReportExtDao implements IMesProductionRecordRepo
}
}
if (!CollectionUtils.isEmpty(reportStatusList2Wo)) {
if (reportStatusList2Pr.size() == 1) {
if (reportStatusList2Wo.size() == 1) {
query.setParameter(MesExtConstWords.MESSAGE_TYPE, reportStatusList2Wo.get(0));
} else {
query.setParameter(MesExtConstWords.MESSAGE_TYPE, reportStatusList2Wo);

@ -230,7 +230,9 @@ public class MesBomService extends BaseMesService<MesBom> implements IMesBomServ
public MesBom findBom(String organizeCode, String bomVersion, String partNo) {
DdlPackBean bomPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(partNo, MesExtConstWords.PART_NO, bomPackBean);
DdlPreparedPack.getStringEqualPack(bomVersion, MesExtConstWords.BOM_VERSION, bomPackBean);
if (bomVersion != null){
DdlPreparedPack.getStringEqualPack(bomVersion, MesExtConstWords.BOM_VERSION, bomPackBean);
}
DdlPreparedPack.getOrderBy(MesExtConstWords.EFF_START_TIME, CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), bomPackBean);
List<MesBom> bomList = this.baseRDao.findByHqlTopWhere(bomPackBean,1);
return bomList.isEmpty() ? null : bomList.get(0);

@ -0,0 +1,22 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesPackingRuleDetailService;
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.MesPackingRuleDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class MesPackingRuleDetailService extends BaseMesService<MesPackingRuleDetail> implements IMesPackingRuleDetailService {
@Override
protected void setPackQueryBean(MesPackingRuleDetail bean, DdlPackBean packBean) {
DdlPreparedPack.getStringLikerPack(bean.getPackageCode(), MesExtConstWords.PACKAGE_CODE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPartNo(), MesExtConstWords.PART_NO, packBean);
DdlPreparedPack.getStringEqualPack(bean.getPartType(), MesExtConstWords.PART_TYPE, packBean);
}
}

@ -0,0 +1,26 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesPackingRuleService;
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.MesPackingRule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class MesPackingRuleService extends BaseMesService<MesPackingRule> implements IMesPackingRuleService {
@Override
protected void setPackQueryBean(MesPackingRule bean, DdlPackBean packBean) {
DdlPreparedPack.getStringLikerPack(bean.getPackageCode(), MesExtConstWords.PACKAGE_CODE, packBean);
DdlPreparedPack.getNumEqualPack(bean.getDefaultFlag(), MesExtConstWords.DEFAULT_FLAG, packBean);
DdlPreparedPack.getNumEqualPack(bean.getGenerateType(), MesExtConstWords.GENERATE_TYPE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPackCode(), MesExtConstWords.PACK_CODE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPackageBarcodeRule(), MesExtConstWords.PACKAGE_BARCODE_RULE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPackageTemplate(), MesExtConstWords.PACKAGE_TEMPLATE, packBean);
DdlPreparedPack.getStringLikerPack(bean.getPrinter(), MesExtConstWords.PRINTER, packBean);
}
}

@ -92,9 +92,15 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
if (count > 0){
return;
}
MesProductVersion mesProductVersion = getMesProductVersion(productPartNo, organizeCode);
MesProductVersion mesProductVersion= null;
if (mesPartProdGroup.getEnableBomVersion() == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()){
mesProductVersion = getMesProductVersion(productPartNo, organizeCode);
}
//4.总成零件号打散bom
String bomVersion = mesProductVersion.getAlternativePartList();
String bomVersion = null;
if (mesProductVersion != null){
bomVersion = mesProductVersion.getAlternativePartList();
}
MesBom bom = mesBomService.findBom(organizeCode, bomVersion, productPartNo);
if (bom == null) {
return;
@ -109,6 +115,9 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
}
//5.打散的bom 获取排序加工规则
List<MesWorkOrderPart> workOrderPartList = dismantleBom(productPartNo, 1, TimeTool.getNowTime(true), bom.getBomCode(), organizeCode, detail.getWorkCellCode());
if (workOrderPartList.isEmpty()){
return;
}
//6.装配件获取的三种条件
String custCode = mesCustomerPart.getCustCode();
MesCustomerCarModel mesCustomerCarModel = getMesCustomerCarModel(custPartNo, organizeCode, custCode);
@ -257,7 +266,7 @@ public class MesSortRuleCfgOfflineServiceImpl implements IMesSortRuleCfgOfflineS
ddlPackBean.setOrderByStr(" order by createDatetime desc ");
List<MesProductVersion> mesProductVersionList = mesProductVersionRDao.findByHqlTopWhere(ddlPackBean, 1);
if (Objects.isNull(mesProductVersionList) || mesProductVersionList.isEmpty()) {
MesException.throwMesBusiException("物料【%s】对应的生产版本信息不存在", partNo);
return null;
}
return mesProductVersionList.get(0);
}

@ -225,7 +225,20 @@ public class MesExtConstWords {
public static final String REWORK_ORDER = "reworkOrder";
//零件类别
public static final String PART_TYPE_CODE = "partTypeCode";
//包装代码
public static final String PACKAGE_CODE = "packageCode";
//统计方式
public static final String GENERATE_TYPE = "generateType";
//箱类别代号
public static final String PACK_CODE = "packCode";
//包装条码编码规则
public static final String PACKAGE_BARCODE_RULE = "packageBarcodeRule";
//包装条码模板
public static final String PACKAGE_TEMPLATE = "packageTemplate";
//是否默认
public static final String DEFAULT_FLAG = "defaultFlag";
//零件类型
public static final String PART_TYPE = "partType";
//时间[开始/结束]条件
public static final String START_TIME_START = "startTimeStart";

Loading…
Cancel
Save