|
|
|
@ -23,6 +23,7 @@ import com.op.system.api.domain.dto.MesPrepareDTO;
|
|
|
|
|
import com.op.system.api.domain.dto.MesPrepareDetailDTO;
|
|
|
|
|
import com.op.system.api.domain.sap.SapCreateOrder;
|
|
|
|
|
import com.op.system.api.domain.sap.SapMaterialPreparation;
|
|
|
|
|
import com.op.system.api.domain.sap.SapShopOrderQuery;
|
|
|
|
|
import net.bytebuddy.matcher.FilterableList;
|
|
|
|
|
import org.apache.commons.collections4.ListUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
@ -36,6 +37,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -759,6 +761,23 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
|
|
|
|
|
Long conver = 1L;
|
|
|
|
|
int index = workOrderList.size();
|
|
|
|
|
while (run) {
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(proOrder.getParentOrder())){
|
|
|
|
|
//推送sap订单更新信息
|
|
|
|
|
SapShopOrderQuery sapChange = new SapShopOrderQuery();
|
|
|
|
|
sapChange.setAufnr(proOrder.getOrderCode());//母订单号
|
|
|
|
|
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
|
|
|
|
|
.subtract(new BigDecimal(proOrder.getAtrr1()));
|
|
|
|
|
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
|
|
|
|
|
logger.info("母订单"+proOrder.getOrderCode()+
|
|
|
|
|
"订单数量变更:修改前"+proOrder.getQuantity()+","+
|
|
|
|
|
"已拆数量"+proOrder.getAtrr1()+","+
|
|
|
|
|
"给sap汇报数量"+newSapQuantityNum.toString());
|
|
|
|
|
R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
|
|
|
|
|
logger.info("母订单"+proOrder.getOrderCode()+
|
|
|
|
|
"订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获得对应工单
|
|
|
|
|
ProOrderWorkorder proOrderWorkorder = workOrderList.get(--index);
|
|
|
|
|
// 更新订单
|
|
|
|
|