|
|
|
@ -4,22 +4,20 @@ import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateSt
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
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.bean.shipping.MesCustSortInfo;
|
|
|
|
|
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.MesCustSoftInfoRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -33,9 +31,6 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustSoftInfoRepository mesCustSoftInfoRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel model, MesNumberRule numberRule , StepResult stepResult, StationRequestBean reqBean, Boolean isStep) {
|
|
|
|
|
|
|
|
|
@ -61,20 +56,10 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.WORK_CENTER_NAME, workOrder.getWorkCenterName());
|
|
|
|
|
// 车型名称
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.CAR_MODEL_NAME, customerCarModel == null ? "" : customerCarModel.getCarModelName());
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(workOrder.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(workOrder.getVinCode(), "vinCode", ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(workOrder.getCustPartNo(), "custPartNo", ddlPackBean);
|
|
|
|
|
MesCustSortInfo mesCustSortInfo = mesCustSoftInfoRepository.getByProperty(ddlPackBean);
|
|
|
|
|
if (!Objects.isNull(mesCustSortInfo)) {
|
|
|
|
|
// vinCode(取值修改-45623 PCN-龙兴装配目视单模板取值调整:mes_cust_sort_info 表的 info_point_code + cust_info_seq)
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.VIN_CODE, (mesCustSortInfo.getInfoPointCode() + mesCustSortInfo.getCustInfoSeq()));
|
|
|
|
|
// vinCode 后四位(取值修改-45623 PCN-龙兴装配目视单模板取值调整:mes_cust_sort_info 的 cust_info_seq 的后四位,即工单表中的 workOrderSeq 字段)
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.VIN_CODE_AFTER_FOUR,
|
|
|
|
|
!StringUtils.isEmpty(mesCustSortInfo.getCustInfoSeq()) &&
|
|
|
|
|
mesCustSortInfo.getCustInfoSeq().toString().length() > MesPcnExtConstWords.FOUR ?
|
|
|
|
|
mesCustSortInfo.getCustInfoSeq().toString().substring(mesCustSortInfo.getCustInfoSeq().toString().length() - MesPcnExtConstWords.FOUR) :
|
|
|
|
|
mesCustSortInfo.getCustInfoSeq());
|
|
|
|
|
}
|
|
|
|
|
// vinCode
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.VIN_CODE, workOrder.getVinCode());
|
|
|
|
|
// vinCode 后四位
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.VIN_CODE_AFTER_FOUR, !StringUtils.isEmpty(workOrder.getVinCode()) && workOrder.getVinCode().length() > MesPcnExtConstWords.FOUR ? workOrder.getVinCode().substring(workOrder.getVinCode().length() - MesPcnExtConstWords.FOUR) : workOrder.getVinCode());
|
|
|
|
|
// 总成零件号
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.PART_NO, workOrder.getPartNo());
|
|
|
|
|
// 工单标识
|
|
|
|
@ -85,8 +70,8 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.CUST_PART_NO, workOrder.getCustPartNo());
|
|
|
|
|
// 客户条码
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.SN, workOrder.getCustSn());
|
|
|
|
|
// 工单备注(取值修改-45623 PCN-龙兴装配目视单模板取值调整:取工单表中的 remark)
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.REMARK, workOrder.getRemark());
|
|
|
|
|
// 工单备注
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.REMARK, workOrder.getDescription());
|
|
|
|
|
// 重打印
|
|
|
|
|
resultMap.put(MesPcnExtConstWords.REPRINT, "");
|
|
|
|
|
// EDI接口时间 取工单plan_start_time
|
|
|
|
|