委托加工订单

This commit is contained in:
潘荣晟
2026-01-23 11:02:50 +08:00
parent b84faed0cc
commit 9a82f22ce7
2 changed files with 21 additions and 5 deletions

View File

@@ -67,9 +67,17 @@ public class PrchOrdDtlServiceImpl implements PrchOrdDtlService {
} }
private void setElemInfo(PrchOrdDtlDO prchOrdDtl) { private void setElemInfo(PrchOrdDtlDO prchOrdDtl) {
if (prchOrdDtl.getElemAbbr() == null){
return;
}
ElementDO elementBySymbol = elementService.getElementBySymbol(prchOrdDtl.getElemAbbr()); ElementDO elementBySymbol = elementService.getElementBySymbol(prchOrdDtl.getElemAbbr());
prchOrdDtl.setElemName(elementBySymbol.getName()); if (elementBySymbol != null){
prchOrdDtl.setElemCdg(elementBySymbol.getCoding()); prchOrdDtl.setElemName(elementBySymbol.getName());
prchOrdDtl.setElemCdg(elementBySymbol.getCoding());
}else {
log.warn("元素【{}】不存在,订单ID【{}】", prchOrdDtl.getElemAbbr(), prchOrdDtl.getOrdId());
}
} }
@Override @Override

View File

@@ -14,6 +14,7 @@ import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlD
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO; import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderDetailMapper; import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderDetailMapper;
import com.zt.plat.module.receivedeliver.api.bill.BillMainApi; import com.zt.plat.module.receivedeliver.api.bill.BillMainApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -38,6 +39,7 @@ import static com.zt.plat.module.contractorder.enums.salesorder.ErrorCodeConstan
*/ */
@Service @Service
@Validated @Validated
@Slf4j
public class SalesOrderDetailServiceImpl implements SalesOrderDetailService { public class SalesOrderDetailServiceImpl implements SalesOrderDetailService {
@Resource @Resource
@@ -61,10 +63,16 @@ public class SalesOrderDetailServiceImpl implements SalesOrderDetailService {
} }
private void setElemInfo(SalesOrderDetailDO salesOrderDetail) { private void setElemInfo(SalesOrderDetailDO salesOrderDetail) {
if (salesOrderDetail.getElementAbbreviation() == null) {
return;
}
ElementDO elementBySymbol = elementService.getElementBySymbol(salesOrderDetail.getElementAbbreviation()); ElementDO elementBySymbol = elementService.getElementBySymbol(salesOrderDetail.getElementAbbreviation());
salesOrderDetail.setElementName(elementBySymbol.getName()); if (elementBySymbol!=null){
salesOrderDetail.setElementNumber(elementBySymbol.getCoding()); salesOrderDetail.setElementName(elementBySymbol.getName());
salesOrderDetail.setElementNumber(elementBySymbol.getCoding());
}else {
log.warn("元素编号【{}】不存在,订单号【{}】", salesOrderDetail.getElementAbbreviation(), salesOrderDetail.getOrderId());
}
} }