客户端代码提交

This commit is contained in:
liyj 2025-07-25 15:51:41 +08:00
parent ee31d1f75d
commit d2cdc097f8
4 changed files with 14 additions and 12 deletions

View File

@ -2,6 +2,7 @@ package com.small.client.Schedule;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.small.client.Utils.CommonUtil;
import com.small.client.dto.CommentModel;
import com.small.client.dto.DataBaseInfo;
import com.small.client.service.SxDataService;
@ -93,11 +94,23 @@ public class DynamicTaskScheduler {
if(ObjectUtil.isNotEmpty(dataBaseInfo.getRefreshTime())){
commentModel.setSyncTime(DateUtil.formatDateTime(dataBaseInfo.getRefreshTime()));
}
sxDataService.syncStoreData(dataBaseInfo,commentModel);
sxDataService.SyncBranchList(dataBaseInfo,commentModel);
sxDataService.SyncCategory(dataBaseInfo,commentModel);
sxDataService.SyncGoods(dataBaseInfo,commentModel);//todo 暂时同步全部的商品如果后期修改需要增加服务器的字段
try {
if(ObjectUtil.isNotEmpty(dataBaseInfo.getShopGapTime())){
long sleepTime= CommonUtil.convertExpressionToLong(dataBaseInfo.getShopGapTime());
Thread.sleep(sleepTime);//两分钟之后执行
}else {
Thread.sleep(1000*30);
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
sxDataService.SyncVipList(dataBaseInfo,commentModel);
sxDataService.syncAtive(dataBaseInfo,commentModel);
sxDataService.syncAtiveShops(dataBaseInfo,commentModel);
isRuning=false;
}

View File

@ -41,13 +41,4 @@ public class DataBaseInfo {
@ApiModelProperty(value = "间隔时间")
private String shopGapTime;
@ApiModelProperty(value = "调价时间")
private String priceOperatiem;
@ApiModelProperty(value = "库存条件")
private String stockOperateWhere;
@ApiModelProperty(value = "营业员账号")
private String saleAccount;
}

View File

@ -71,7 +71,4 @@ public class StoreDbConfig implements Serializable {
@ApiModelProperty("商品同步间隔时间")
private String shopGapTime;
@ApiModelProperty(value = "营业员账号")
private String saleAccount;
}

View File

@ -682,6 +682,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
dataBaseInfo.setCategoryName(storeDbConfig.getCategoryName());
dataBaseInfo.setRefreshTime(storeDbConfig.getRefreshTime());
dataBaseInfo.setIsTowSync(storeDbConfig.getIsTowSync());
dataBaseInfo.setShopGapTime(storeDbConfig.getShopGapTime());
return dataBaseInfo;
}
return new DataBaseInfo();