思迅同步活动问题修复

This commit is contained in:
liyj 2025-07-08 18:17:04 +08:00
parent e0430f3624
commit 9a94d9addd
5 changed files with 24 additions and 10 deletions

View File

@ -31,7 +31,6 @@ public class WebController {
public void synBrand(){
log.info("synBrand");
// sxDataService.getAppSign();
sxDataService.SyncBranchList(new DataBaseInfo(),sxDataService.getCommentModel());
}

View File

@ -415,9 +415,7 @@ public class BaseDao {
" from \n" +
" ( \n" +
" select \n" +
" ROW_NUMBER() OVER(partition by b.start_date, \n" +
" b.end_date, \n" +
" b.special_type,b.discount \n" +
" ROW_NUMBER() OVER(partition by b.other3 " +
" ORDER BY \n" +
" b.start_date) as rowId, \n" +
" b.* \n" +
@ -453,9 +451,7 @@ public class BaseDao {
"from\n" +
" (\n" +
" select\n" +
" ROW_NUMBER() OVER(partition by b.start_date,\n" +
" b.end_date,\n" +
" b.special_type\n" +
" ROW_NUMBER() OVER(partition by b.other3 " +
" ORDER BY\n" +
" b.start_date) as rowId,\n" +
" b.*\n" +

View File

@ -567,7 +567,7 @@ public class SxDataDao extends BaseDao{
activeDto.setActivityTypeId(3);
activeDto.setActiveMaxDesList(activeMaxDesList);
}
activeDto.setFlowNo(rs.getString("flow_no"));
activeDto.setFlowNo(rs.getString("other3"));
activeDto.setActivityReleasetime(rs.getDate("oper_date"));
activeDto.setActivityStarttime(rs.getDate("start_date"));
activeDto.setActivityEndtime(rs.getDate("end_date"));
@ -657,9 +657,10 @@ public class SxDataDao extends BaseDao{
activeShopInfo.setActivityName(""+total1+""+max1+",满"+total2+""+max2);
activeShopInfo.setActivityTypeId(3);
}
activeShopInfo.setActivityItemMinQuantity(rs.getBigDecimal("sale_qty"));
activeShopInfo.setActivityStarttime(rs.getDate("start_date"));
activeShopInfo.setActivityEndtime(rs.getDate("end_date"));
activeShopInfo.setFlowNo(rs.getString("flow_no"));
activeShopInfo.setFlowNo(rs.getString("other3"));
if(DateUtil.compare(activeShopInfo.getActivityEndtime(),DateUtil.date())>0){
activeShopInfo.setActivityState(1);//正常进行中
}else {

View File

@ -44,4 +44,7 @@ public class ActiveShopInfo {
@ApiModelProperty(value = "活动id")
private String flowNo;
@ApiModelProperty(value = "购买下限")
private BigDecimal activityItemMinQuantity;
}

View File

@ -85,10 +85,12 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
// 总页数
int pages = CommonUtil.getPagesCount(total, SxDataDao.PAGESIZE);
List<SxSyncCategory> allSxSyncCategories= sxDataDao.findTBdItemClsList(dataBaseInfo);
List<ClsBrandDto> clsBrandDtoList=sxDataDao.getclsMapBrand(dataBaseInfo);
Map<String,String> clsBrandMap=getClsMapBrand(clsBrandDtoList);
int syncCount =0;
for (int i = 1; i <=pages; i++) {
List<SxSyncCategory> sxSyncCategories= sxDataDao.findTBdItemClsListPage(dataBaseInfo,i,SxDataDao.PAGESIZE);
List<SxCategoryModel> sxCategoryModelList= ConVToSxCategoryModel(sxSyncCategories,allSxSyncCategories);
List<SxCategoryModel> sxCategoryModelList= ConVToSxCategoryModel(sxSyncCategories,allSxSyncCategories,clsBrandMap);
JSONArray jsonArray =null;
String jsonString="";
try {
@ -778,8 +780,21 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
syncCount+=activeDtos.size();
}
log.info("成功同步活动商品数据:"+syncCount);
HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_REFRESH
+"?appKey="+commentModel.getAppKey()
+"&sign="+commentModel.getAppId(), new JSONArray());
}
private Map<String,String> getClsMapBrand(List<ClsBrandDto> clsBrandDtos){
Map<String,String> map=new HashMap();
if(!clsBrandDtos.isEmpty()){
clsBrandDtos.forEach(clsBrandDto->{
map.put(clsBrandDto.getItemClsname(),clsBrandDto.getCodeName());
});
}
return map;
}
}