|
|
|
@ -17,7 +17,9 @@ import com.aucma.base.utils.MaterialConstants;
|
|
|
|
|
import com.aucma.common.utils.DateUtils;
|
|
|
|
|
import com.aucma.common.utils.StringUtils;
|
|
|
|
|
import com.aucma.production.domain.CalendarInfo;
|
|
|
|
|
import com.aucma.production.domain.ProductPlanInfo;
|
|
|
|
|
import com.aucma.production.service.ICalendarInfoService;
|
|
|
|
|
import com.aucma.production.service.IProductPlanInfoService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -52,6 +54,9 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ICalendarInfoService calendarInfoService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IProductPlanInfoService productPlanInfoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 转物料实体类 保存数据
|
|
|
|
|
*
|
|
|
|
@ -202,15 +207,29 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
baseOrderInfoList.add(baseOrderInfo);
|
|
|
|
|
} else {
|
|
|
|
|
//更新SAP计划
|
|
|
|
|
BaseOrderInfo baseOrderInfo = baseOrderInfos.get(0);
|
|
|
|
|
baseOrderInfo.setOrderStatus(map.get("STTXT"));
|
|
|
|
|
BaseOrderInfo baseOrderInfoOld = baseOrderInfos.get(0);
|
|
|
|
|
BaseOrderInfo baseOrderInfo = new BaseOrderInfo();
|
|
|
|
|
baseOrderInfo.setObjId(baseOrderInfoOld.getObjId());
|
|
|
|
|
baseOrderInfo.setMaterialCode(baseOrderInfoOld.getMaterialCode());
|
|
|
|
|
baseOrderInfo.setOrderCode(baseOrderInfoOld.getOrderCode());
|
|
|
|
|
baseOrderInfo.setSaleOrderCode(map.get("KDAUF"));
|
|
|
|
|
baseOrderInfo.setMaterialName(map.get("MAKTX"));
|
|
|
|
|
baseOrderInfo.setOrderStatus(map.get("STTXT"));
|
|
|
|
|
baseOrderInfo.setOrderType(map.get("AUART"));
|
|
|
|
|
if (baseOrderInfo.getIsRelease() == 1) {
|
|
|
|
|
//SAP计划已下达到生产计划工位不更新数量
|
|
|
|
|
if (!map.get("GAMNG").equals(null)) {
|
|
|
|
|
baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG")));
|
|
|
|
|
BigDecimal newOrderAmount = new BigDecimal(map.get("GAMNG"));
|
|
|
|
|
if (!newOrderAmount.equals(baseOrderInfo.getOrderAmount())){
|
|
|
|
|
baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG")));
|
|
|
|
|
baseOrderInfo.setUpdatedBy("SAP");
|
|
|
|
|
//同步生产计划数量
|
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
|
planInfo.setOrderCode(baseOrderInfo.getOrderCode());
|
|
|
|
|
List<ProductPlanInfo> productPlanInfos = productPlanInfoService.selectProductPlanInfoList(planInfo);
|
|
|
|
|
for (ProductPlanInfo info : productPlanInfos) {
|
|
|
|
|
ProductPlanInfo planInfoIn = new ProductPlanInfo();
|
|
|
|
|
planInfoIn.setObjId(info.getObjId());
|
|
|
|
|
planInfoIn.setUpdatedBy("SAP");
|
|
|
|
|
planInfoIn.setPlanAmount(baseOrderInfo.getOrderAmount().longValue());
|
|
|
|
|
productPlanInfoService.updateProductPlanInfo(planInfoIn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//产线变动 重新生成生成计划
|
|
|
|
|