|
|
@ -17,16 +17,20 @@ import com.qs.serve.modules.goods.entity.*; |
|
|
|
import com.qs.serve.modules.goods.entity.bo.GoodsImminentBatchBo; |
|
|
|
import com.qs.serve.modules.goods.entity.dto.GoodsAccrIdsDto; |
|
|
|
import com.qs.serve.modules.goods.entity.dto.GoodsRuleItemDTO; |
|
|
|
import com.qs.serve.modules.goods.entity.dto.InventoryCusPrice; |
|
|
|
import com.qs.serve.modules.goods.entity.so.GoodsImminentBatchQuery; |
|
|
|
import com.qs.serve.modules.goods.entity.so.InventoryCusPriceQuery; |
|
|
|
import com.qs.serve.modules.goods.entity.vo.GoodsImminentBatchVo; |
|
|
|
import com.qs.serve.modules.goods.mapper.GoodsSkuMapper; |
|
|
|
import com.qs.serve.modules.goods.mapper.GoodsSpuMapper; |
|
|
|
import com.qs.serve.modules.goods.service.*; |
|
|
|
import com.qs.serve.modules.seeyon.service.impl.SeeYonRequestBaseService; |
|
|
|
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
|
|
|
import com.qs.serve.modules.tbs.service.TbsActivityGoodsService; |
|
|
|
import com.qs.serve.modules.tbs.service.TbsBudgetConditionService; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -51,6 +55,7 @@ public class GoodsImminentBatchApi { |
|
|
|
private GoodsCategoryService goodsCategoryService; |
|
|
|
private GoodsAccreditService goodsAccreditService; |
|
|
|
private GoodsImminentBatchService goodsImminentBatchService; |
|
|
|
private SeeYonRequestBaseService seeYonRequestBaseService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -86,9 +91,50 @@ public class GoodsImminentBatchApi { |
|
|
|
return R.byEmptyList(); |
|
|
|
} |
|
|
|
List<GoodsImminentBatchVo> list = goodsImminentBatchService.selectVoList(param); |
|
|
|
List<String> skuCodes = list.stream().map(GoodsImminentBatchVo::getSkuCode).collect(Collectors.toList()); |
|
|
|
if(CollUtil.isNotEmpty(skuCodes)){ |
|
|
|
List<InventoryCusPrice> cusPriceList = this.getInventoryCusPrices(param.getSupplierCode(), skuCodes); |
|
|
|
for (GoodsImminentBatchVo batchVo : list) { |
|
|
|
if(cusPriceList!=null){ |
|
|
|
for (InventoryCusPrice cusPrice : cusPriceList) { |
|
|
|
if(cusPrice.getInvCode().equals(batchVo.getSkuCode())){ |
|
|
|
batchVo.setSalesPrice(cusPrice.getPrice()); |
|
|
|
batchVo.setCostPrice(cusPrice.getPrice()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return R.byPageList(total,list); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取客户特殊价格 |
|
|
|
* @param supplierCode |
|
|
|
* @param skuCodes |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Nullable |
|
|
|
private List<InventoryCusPrice> getInventoryCusPrices(String supplierCode, List<String> skuCodes) { |
|
|
|
List<InventoryCusPrice> inventoryCusPrices = null; |
|
|
|
try { |
|
|
|
if(skuCodes.size()>0){ |
|
|
|
InventoryCusPriceQuery query = new InventoryCusPriceQuery(); |
|
|
|
query.setCusCode(supplierCode); |
|
|
|
query.setInvCodes(skuCodes); |
|
|
|
R<String> res = seeYonRequestBaseService.postBase(TbsSeeYonConst.ERP_CUS_INV_PRICE,query,"查询客户特殊价"); |
|
|
|
if(res.getStatus().equals(200)){ |
|
|
|
inventoryCusPrices = JsonUtil.jsonToList(res.getData(), InventoryCusPrice.class); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("客户特殊价异常:{}",e.getMessage()); |
|
|
|
} |
|
|
|
return inventoryCusPrices; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* ID查询 |
|
|
|
* @param id |
|
|
|