|
|
@@ -21,9 +21,8 @@ import java.util.Date;
|
|
|
public class PriceBankClient implements IPriceBankClient{
|
|
|
|
|
|
private final PriceBankMapper priceBankMapper;
|
|
|
-
|
|
|
/**
|
|
|
- * 更新出口价格库价格
|
|
|
+ *
|
|
|
* @param itemId 商品id
|
|
|
* @param price 价格
|
|
|
* @param tenantId 租户id
|
|
|
@@ -31,17 +30,32 @@ public class PriceBankClient implements IPriceBankClient{
|
|
|
* @param specs 商品规格
|
|
|
* @param billType 价格类型 XS 销售价格 CG 采购价格
|
|
|
* @param tradeType 贸易类型 GN 国内 JK 进口 CK 出口
|
|
|
+ * @param exchangeRate 汇率
|
|
|
+ * @param greenback 美元价格
|
|
|
+ * @param currency 币别
|
|
|
+ * @param coefficient FOB系数
|
|
|
+ * @param taxRate 税率
|
|
|
+ * * @return
|
|
|
+ * * 1.先根据商品id,商品规格,价格类型,租户id,供应商,贸易类型 查未删除的价格库数据
|
|
|
+ * * 2.查到后先执行将历史价格依次更新操作 未查到暂不执行更新操作
|
|
|
+ * * 3.查到将价格赋值到最新价格字段上 最新价格日期为当前时间 未查到暂不执行更新操作
|
|
|
+ * * 4.修改价格库数据
|
|
|
* @return
|
|
|
- * 1.先根据商品id,商品规格,价格类型,租户id,供应商,贸易类型 查未删除的价格库数据
|
|
|
- * 2.查到后先执行将历史价格依次更新操作 未查到暂不执行更新操作
|
|
|
- * 3.查到将价格赋值到最新价格字段上 最新价格日期为当前时间 未查到暂不执行更新操作
|
|
|
- * 4.修改价格库数据
|
|
|
*/
|
|
|
@GetMapping(UPDATE_PRICE)
|
|
|
@Override
|
|
|
- public int updatePrice(Long itemId, BigDecimal price, String tenantId, Long corpId,String specs, String billType, String tradeType) {
|
|
|
+ public int updatePrice(Long itemId, BigDecimal price, String tenantId, Long corpId,String specs, String billType, String tradeType,BigDecimal exchangeRate,
|
|
|
+ BigDecimal greenback,
|
|
|
+ String currency,
|
|
|
+ BigDecimal coefficient,
|
|
|
+ BigDecimal taxRate) {
|
|
|
int flag = 0;
|
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getBillType,billType);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType,tradeType);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTenantId,tenantId);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getItemId,itemId);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getCorpId,corpId);
|
|
|
PriceBank priceBank = priceBankMapper.selectOne(lambdaQueryWrapper);
|
|
|
if (priceBank != null){
|
|
|
priceBankMapper.updatePrice(priceBank.getId());//更新历史价格
|
|
|
@@ -49,6 +63,11 @@ public class PriceBankClient implements IPriceBankClient{
|
|
|
bank.setId(priceBank.getId());
|
|
|
bank.setPrice(price);
|
|
|
bank.setPriceTime(new Date());
|
|
|
+ bank.setExchangeRate(exchangeRate);
|
|
|
+ bank.setGreenback(greenback);
|
|
|
+ bank.setCurrency(currency);
|
|
|
+ bank.setCoefficient(coefficient);
|
|
|
+ bank.setTaxRate(taxRate);
|
|
|
bank.setUpdateUser(SecureUtil.getUserId());
|
|
|
bank.setUpdateTime(new Date());
|
|
|
flag = priceBankMapper.updateById(bank);
|