Browse Source

feat: 补充客户特殊价删除数据时更新数据

checkBack
Yen 1 year ago
parent
commit
0dda087810
  1. 8
      src/main/java/com/qs/serve/modules/goods/service/GoodsCustomerPriceService.java
  2. 24
      src/main/java/com/qs/serve/modules/goods/service/impl/GoodsCustomerPriceServiceImpl.java
  3. 1
      src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java

8
src/main/java/com/qs/serve/modules/goods/service/GoodsCustomerPriceService.java

@ -29,10 +29,16 @@ public interface GoodsCustomerPriceService extends IService<GoodsCustomerPrice>
List<GoodsCustomerPrice> getBySupplierCodeAndCode(String supplierCode, List<String> skuCode); List<GoodsCustomerPrice> getBySupplierCodeAndCode(String supplierCode, List<String> skuCode);
/** /**
* 同步客户特殊价 * 同步客户特殊价()
*/ */
void syncCustomerPrice(); void syncCustomerPrice();
void syncCustomerPrice(String dictKey,String dictTitle,String url);
/**
* 刷新客户所有的商品特殊价
* @param cusCode
*/
void syncCustomerPrice(String cusCode); void syncCustomerPrice(String cusCode);
} }

24
src/main/java/com/qs/serve/modules/goods/service/impl/GoodsCustomerPriceServiceImpl.java

@ -157,8 +157,8 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
} }
@Override @Override
public void syncCustomerPrice() { public void syncCustomerPrice(String dictKey,String dictTitle,String url) {
final String DICT_KEY = "sync-customer-price-max-id"; final String DICT_KEY = dictKey;
SysDictData dictData = sysDictDataMapper SysDictData dictData = sysDictDataMapper
.selectOne(new LambdaQueryWrapper<SysDictData>() .selectOne(new LambdaQueryWrapper<SysDictData>()
.eq(SysDictData::getGroupKey,DICT_KEY)); .eq(SysDictData::getGroupKey,DICT_KEY));
@ -168,7 +168,7 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
} }
List<InventoryCusPrice> allCusPriceList = new ArrayList<>(); List<InventoryCusPrice> allCusPriceList = new ArrayList<>();
R<String> res = seeYonRequestBaseService.postBase(TbsSeeYonConst.ERP_CUS_INV_LAST_UPD+"/"+maxId,null,"查询最近更新的客户特殊价"); R<String> res = seeYonRequestBaseService.postBase(url+"/"+maxId,null,"查询最近更新的客户特殊价");
if(res.getStatus().equals(200)){ if(res.getStatus().equals(200)){
allCusPriceList = JsonUtil.jsonToList(res.getData(), InventoryCusPrice.class); allCusPriceList = JsonUtil.jsonToList(res.getData(), InventoryCusPrice.class);
} }
@ -195,9 +195,9 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
dictData.setDictId(0L); dictData.setDictId(0L);
dictData.setGroupKey(DICT_KEY); dictData.setGroupKey(DICT_KEY);
dictData.setKeyVal(maxId+""); dictData.setKeyVal(maxId+"");
dictData.setLabel("同步客户特殊价最大值ID"); dictData.setLabel(dictTitle);
dictData.setSort(0); dictData.setSort(0);
dictData.setRemark("同步客户特殊价最大值ID"); dictData.setRemark(dictTitle);
sysDictDataMapper.insert(dictData); sysDictDataMapper.insert(dictData);
}else { }else {
dictData.setKeyVal(maxId+""); dictData.setKeyVal(maxId+"");
@ -206,6 +206,20 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
} }
} }
@Override
public void syncCustomerPrice() {
// 客户特殊价,新增和更新的触发器
String dictKey = "sync-customer-price-max-id";
String url = TbsSeeYonConst.ERP_CUS_INV_LAST_UPD;
String title = "同步客户特殊价最大值ID";
this.syncCustomerPrice(dictKey,title,url);
// 客户特殊价,删除的触发器
String dictKey2 = "sync-customer-price-del-max-id";
String url2 = TbsSeeYonConst.ERP_CUS_INV_LAST_DEL;
String title2 = "同步客户特殊价最大值ID(PriceJustify_DeleteLog)";
this.syncCustomerPrice(dictKey2,title2,url2);
}
@Override @Override
public void syncCustomerPrice(String cusCode) { public void syncCustomerPrice(String cusCode) {
this.flushSupplierSkuPrices(cusCode); this.flushSupplierSkuPrices(cusCode);

1
src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java

@ -109,6 +109,7 @@ public interface TbsSeeYonConst {
String ERP_CUS_INV_PRICE = "/erp/inventory/invPrices"; String ERP_CUS_INV_PRICE = "/erp/inventory/invPrices";
String ERP_CUS_INV_PRICE_CUS = "/erp/inventory/invPricesByCusCode?cusCode="; String ERP_CUS_INV_PRICE_CUS = "/erp/inventory/invPricesByCusCode?cusCode=";
String ERP_CUS_INV_LAST_UPD = "/erp/inventory/lastUpdateCusInvPrices"; String ERP_CUS_INV_LAST_UPD = "/erp/inventory/lastUpdateCusInvPrices";
String ERP_CUS_INV_LAST_DEL = "/erp/inventory/lastDeleteCusInvPrices";
String ERP_CUS_INV_STAND = "/erp/inventory/standList"; String ERP_CUS_INV_STAND = "/erp/inventory/standList";
String ERP_CUS_INV_SYNC_PRICE = "/erp/inventory/syncPrice"; String ERP_CUS_INV_SYNC_PRICE = "/erp/inventory/syncPrice";
String ERP_CUS_INV_SPECIAL = "/erp/inventory/specialSyncCrm"; String ERP_CUS_INV_SPECIAL = "/erp/inventory/specialSyncCrm";

Loading…
Cancel
Save