|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.numberrule;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesCustomerSnTransformService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.INumberRulePackAttributeStrategyService;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesCustomerPart;
|
|
|
|
@ -8,6 +9,7 @@ import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
|
|
|
|
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.Calendar;
|
|
|
|
|
import java.util.Date;
|
|
|
|
@ -24,13 +26,16 @@ import java.util.Map;
|
|
|
|
|
public class MesNoSortCustSnNumberRuleStrategyService implements INumberRulePackAttributeStrategyService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesCustomerPartService mesCustomerPartService;
|
|
|
|
|
private IMesCustomerPartService customerPartService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesCustomerSnTransformService customerSnTransformService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) {
|
|
|
|
|
Map<String, Object> dataMap = genSerialNoModel.getDataMap();
|
|
|
|
|
MesCustomerPart customerPart = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesCustomerPart.class.getSimpleName())) ?
|
|
|
|
|
(MesCustomerPart)dataMap.get(MesCustomerPart.class.getSimpleName()) : mesCustomerPartService.getMesCustomerPart(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo());
|
|
|
|
|
(MesCustomerPart)dataMap.get(MesCustomerPart.class.getSimpleName()) : customerPartService.getMesCustomerPart(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo());
|
|
|
|
|
if (null != customerPart) {
|
|
|
|
|
genSerialNoModel.setCustPartNo(customerPart.getCustPartNo());
|
|
|
|
|
}else {
|
|
|
|
@ -47,4 +52,11 @@ public class MesNoSortCustSnNumberRuleStrategyService implements INumberRulePack
|
|
|
|
|
genSerialNoModel.setDay(String.format("%03d",custCalendar.get(Calendar.DAY_OF_YEAR)));
|
|
|
|
|
return genSerialNoModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String transform(String serialNo) {
|
|
|
|
|
if (StringUtils.isEmpty(serialNo)) return serialNo;
|
|
|
|
|
return customerSnTransformService.transformBarCodeGm(serialNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|