|
@@ -33,6 +33,7 @@ import org.hibernate.engine.jdbc.Size;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.modules.documents.letterDeposit.entity.SyLetterDepositItem;
|
|
|
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
|
|
|
import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
|
|
|
import org.jeecg.modules.documents.shippingDetails.entity.VO.RespUpdateVO;
|
|
|
import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
|
|
@@ -2535,6 +2536,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
|
|
|
public RespUpdateVO srmAdd(@RequestBody SyPreAssembledPackingList syPreAssembledPackingList) {
|
|
|
RespUpdateVO respUpdateVO = new RespUpdateVO();
|
|
|
respUpdateVO.setSuccess(false);
|
|
|
+ log.info("SRM推送\t{}", syPreAssembledPackingList);
|
|
|
if (!srmAccessToken.equals(syPreAssembledPackingList.getAccessToken())){
|
|
|
respUpdateVO.setMessage("认证失败,请联系管理员");
|
|
|
return respUpdateVO;
|
|
@@ -2544,6 +2546,53 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
|
|
|
respUpdateVO.setMessage("请先填好信息再提交");
|
|
|
return respUpdateVO;
|
|
|
}
|
|
|
+ // 从size中获取出运明细id
|
|
|
+ List<String> shippingDetailsItemIdList = new ArrayList<>();
|
|
|
+ List<SyPreAssembledPackingListItem> itemList = syPreAssembledPackingList.getSyPreAssembledPackingListItemList();
|
|
|
+ itemList.forEach(item -> {
|
|
|
+ item.getSizeTables().forEach(s->{
|
|
|
+ shippingDetailsItemIdList.add(s.getItemId());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ List<SyPreAssembledPackingListItem> srmPushExtraList = syPreAssembledPackingListItemService.getSrmPushExtraList(shippingDetailsItemIdList);
|
|
|
+ if (srmPushExtraList.size() == 0){
|
|
|
+ log.error("查找出运明细失败");
|
|
|
+ respUpdateVO.setMessage("查找出运明细失败");
|
|
|
+ return respUpdateVO;
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ SyPreAssembledPackingListItem item = srmPushExtraList.get(0);
|
|
|
+ syPreAssembledPackingList.setOrderNumber(item.getOrderNumber());
|
|
|
+ syPreAssembledPackingList.setCustomer(item.getCustomerName());
|
|
|
+ syPreAssembledPackingList.setGarmentFactory(item.getGarmentFactory());
|
|
|
+ syPreAssembledPackingList.setCustomerAbbreviation(item.getCustomerAbbreviation());
|
|
|
+ syPreAssembledPackingList.setElementsId(item.getElementsId());
|
|
|
+ syPreAssembledPackingList.setOmpoId(item.getOmpoId());
|
|
|
+ syPreAssembledPackingList.setIsExcel(0);
|
|
|
+ syPreAssembledPackingList.setIsTc(item.getIsTc());
|
|
|
+ syPreAssembledPackingList.setTotalPrice(syPreAssembledPackingList.getTotal().multiply(item.getUnitPrice()));
|
|
|
+ for (SyPreAssembledPackingListItem syPreAssembledPackingListItem : itemList){
|
|
|
+ SizeTable sizeTable = syPreAssembledPackingListItem.getSizeTables().get(0);
|
|
|
+ SyPreAssembledPackingListItem findExtraInfo = srmPushExtraList.stream().filter(e->e.getSyDeclarationElementsItemId().equals(sizeTable.getItemId())).findFirst().orElse(null);
|
|
|
+ if (srmPushExtraList.size() == 0){
|
|
|
+ log.error("查找出运明细失败:\t{}",sizeTable);
|
|
|
+ respUpdateVO.setMessage("查找出运明细失败");
|
|
|
+ return respUpdateVO;
|
|
|
+ }
|
|
|
+ syPreAssembledPackingListItem.setAcSetNo(findExtraInfo.getAcSetNo());
|
|
|
+ syPreAssembledPackingListItem.setGarmentFactory(findExtraInfo.getGarmentFactory());
|
|
|
+ syPreAssembledPackingListItem.setUnitPrice(findExtraInfo.getUnitPrice());
|
|
|
+ syPreAssembledPackingListItem.setWithCode(findExtraInfo.getWithCode());
|
|
|
+ syPreAssembledPackingListItem.setSyOrderDataItemId(findExtraInfo.getSyOrderDataItemId());
|
|
|
+ syPreAssembledPackingListItem.setSyOrderDataId(findExtraInfo.getSyOrderDataId());
|
|
|
+ syPreAssembledPackingListItem.setOmpoIdItem(findExtraInfo.getOmpoIdItem());
|
|
|
+ syPreAssembledPackingListItem.setOmpoId(findExtraInfo.getOmpoId());
|
|
|
+ syPreAssembledPackingListItem.setOrderNumber(findExtraInfo.getOrderNumber());
|
|
|
+ syPreAssembledPackingListItem.setRemainingQuantity(findExtraInfo.getRemainingQuantity());
|
|
|
+ syPreAssembledPackingListItem.setSalesman(findExtraInfo.getSalesman());
|
|
|
+ syPreAssembledPackingListItem.setSalesDepartment(findExtraInfo.getSalesDepartment());
|
|
|
+ syPreAssembledPackingListItem.setCustomsDeclarationUnitPrice(findExtraInfo.getCustomsDeclarationUnitPrice());
|
|
|
+ }
|
|
|
syPreAssembledPackingList=syPreAssembledPackingListService.saveMain2(syPreAssembledPackingList);
|
|
|
respUpdateVO.setMessage(syPreAssembledPackingList.getId());
|
|
|
respUpdateVO.setSuccess(true);
|