Compare commits
2 Commits
cf2ad10fd3
...
96620ba505
| Author | SHA1 | Date | |
|---|---|---|---|
| 96620ba505 | |||
| 696027f3e8 |
@ -57,6 +57,12 @@
|
|||||||
<version>${hutool.version}</version>
|
<version>${hutool.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.10.1</version> <!-- 使用最新版本 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<!-- 指定仓库为阿里云与阿帕奇 -->
|
<!-- 指定仓库为阿里云与阿帕奇 -->
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public class DynamicTaskScheduler {
|
|||||||
this.sxDataService = sxDataService;
|
this.sxDataService = sxDataService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
//@PostConstruct
|
||||||
public void initTasks() {
|
public void initTasks() {
|
||||||
refreshTasks();
|
refreshTasks();
|
||||||
// 每5分钟检查一次数据库更新
|
// 每5分钟检查一次数据库更新
|
||||||
|
|||||||
@ -12,7 +12,14 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.logging.log4j.util.Strings;
|
||||||
|
import org.apache.tomcat.util.codec.binary.Base64;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class CommonUtil {
|
public class CommonUtil {
|
||||||
|
|
||||||
private final static String apiUrl = "http://4ei8850868ux.vicp.fun";
|
private final static String apiUrl = "http://4ei8850868ux.vicp.fun";
|
||||||
@ -94,5 +101,44 @@ public class CommonUtil {
|
|||||||
return StrUtil.toUnderlineCase(jsonObject.getByPath(expression, String.class));
|
return StrUtil.toUnderlineCase(jsonObject.getByPath(expression, String.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成 md 摘要通用签名(参考了顺丰同城的做法)
|
||||||
|
* 参考:https://openic.sf-express.com/#/quickstart
|
||||||
|
*
|
||||||
|
* @param postData
|
||||||
|
* @param appId
|
||||||
|
* @param appKey
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String generateOpenSign(String postData, String appId, String appKey) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(postData) || StrUtil.isBlank(appId) || StrUtil.isBlank(appKey)) {
|
||||||
|
log.error("生成签名时缺少必要参数!");
|
||||||
|
return Strings.EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
String sb = postData + "&" + appId + "&" + appKey;
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] md5 = md.digest(sb.getBytes(StandardCharsets.UTF_8));
|
||||||
|
int i;
|
||||||
|
StringBuffer buf = new StringBuffer();
|
||||||
|
for (byte b : md5) {
|
||||||
|
i = b;
|
||||||
|
if (i < 0) {
|
||||||
|
i += 256;
|
||||||
|
}
|
||||||
|
if (i < 16) {
|
||||||
|
buf.append("0");
|
||||||
|
}
|
||||||
|
buf.append(Integer.toHexString(i));
|
||||||
|
}
|
||||||
|
return Base64.encodeBase64String(buf.toString().getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return Strings.EMPTY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class HttpUtils {
|
|||||||
|
|
||||||
public static final String URL_SYNC_GET_DOWNCLIENTJAR="/shop/sync/app/downClientJar";//文件下载
|
public static final String URL_SYNC_GET_DOWNCLIENTJAR="/shop/sync/app/downClientJar";//文件下载
|
||||||
|
|
||||||
public static final String URL_SYNC_GET_STOREdBCONFIG="/shop/sync/third/getStoreDbConfig";//文件下载
|
public static final String URL_SYNC_GET_STOREdBCONFIG="/shop/sync/third/getStoreDbConfig";//获取数据库配置
|
||||||
|
|
||||||
public static final String URL_SYNC_GET_STOR_DATA_RELEASE="/shop/sync/third/syncStoreDataRelease";//库存同步
|
public static final String URL_SYNC_GET_STOR_DATA_RELEASE="/shop/sync/third/syncStoreDataRelease";//库存同步
|
||||||
|
|
||||||
@ -56,7 +56,6 @@ public class HttpUtils {
|
|||||||
// 设置Content-Type为application/x-www-form-urlencoded
|
// 设置Content-Type为application/x-www-form-urlencoded
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
log.info(modelObject.toString());
|
|
||||||
HttpEntity<Object> request = new HttpEntity<>(modelObject, headers);
|
HttpEntity<Object> request = new HttpEntity<>(modelObject, headers);
|
||||||
|
|
||||||
// 发送POST请求
|
// 发送POST请求
|
||||||
|
|||||||
@ -178,6 +178,51 @@ public class BaseDao {
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getBaseGoodsJoinTotal(String ip, String username, String password,Integer portNumber, String dataBaseName,String where){
|
||||||
|
int total=0;
|
||||||
|
Connection connection=getConnection(ip,username,password,portNumber,dataBaseName);
|
||||||
|
try {
|
||||||
|
String sql="WITH LatestStock AS (" +
|
||||||
|
" SELECT " +
|
||||||
|
" tib.item_no, " +
|
||||||
|
" tib.stock_qty," +
|
||||||
|
" tib.oper_date," +
|
||||||
|
" ROW_NUMBER() OVER(PARTITION BY tib.item_no ORDER BY tib.oper_date DESC) AS rn " +
|
||||||
|
" FROM t_im_branch_stock tib\n" +
|
||||||
|
") " +
|
||||||
|
"SELECT " +
|
||||||
|
" b.*, " +
|
||||||
|
" ls.stock_qty, " +
|
||||||
|
" ls.oper_date " +
|
||||||
|
"FROM ( " +
|
||||||
|
" SELECT " +
|
||||||
|
" ROW_NUMBER() OVER(ORDER BY item_clsno) AS rowId, " +
|
||||||
|
" * " +
|
||||||
|
" FROM t_bd_item_info " +
|
||||||
|
") b " +
|
||||||
|
"LEFT JOIN LatestStock ls ON b.item_no = ls.item_no AND ls.rn = 1 " +
|
||||||
|
" %s";
|
||||||
|
sql=String.format(sql,where);
|
||||||
|
log.info(sql);
|
||||||
|
PreparedStatement ps= connection.prepareStatement(sql);
|
||||||
|
ResultSet rs=ps.executeQuery();
|
||||||
|
while (rs.next()){
|
||||||
|
total=rs.getInt(1);
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.info("数据库查询异常方法{},异常信息{}","com.suisung.mall.shop.sixun.dao.BaseDao.getBaseTotal",e.getMessage());
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
connection.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 带分页数据关联分页查询
|
* 带分页数据关联分页查询
|
||||||
@ -211,6 +256,46 @@ public class BaseDao {
|
|||||||
return resultDto;
|
return resultDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultDto baseFindGoodsListJoinPage(String ip, String username, String password,Integer portNumber, String dataBaseName, int pageNo, int pageSize,String where){
|
||||||
|
Connection connection=getConnection(ip,username,password,portNumber,dataBaseName);
|
||||||
|
int start=(pageNo-1)*pageSize+1;
|
||||||
|
int end=pageNo*pageSize;
|
||||||
|
String sql="WITH LatestStock AS (" +
|
||||||
|
" SELECT " +
|
||||||
|
" tib.item_no, " +
|
||||||
|
" tib.stock_qty," +
|
||||||
|
" tib.oper_date," +
|
||||||
|
" ROW_NUMBER() OVER(PARTITION BY tib.item_no ORDER BY tib.oper_date DESC) AS rn " +
|
||||||
|
" FROM t_im_branch_stock tib " +
|
||||||
|
") " +
|
||||||
|
"SELECT " +
|
||||||
|
" b.*, " +
|
||||||
|
" ls.stock_qty, " +
|
||||||
|
" ls.oper_date " +
|
||||||
|
"FROM ( " +
|
||||||
|
" SELECT " +
|
||||||
|
" ROW_NUMBER() OVER(ORDER BY item_clsno) AS rowId ," +
|
||||||
|
" * " +
|
||||||
|
" FROM t_bd_item_info\n" +
|
||||||
|
") b " +
|
||||||
|
"LEFT JOIN LatestStock ls ON b.item_no = ls.item_no AND ls.rn = 1 " +
|
||||||
|
" %s b.rowId BETWEEN %s AND %s ";
|
||||||
|
sql=String.format(sql,where,start,end);
|
||||||
|
log.info(sql);
|
||||||
|
ResultDto resultDto=new ResultDto();
|
||||||
|
ResultSet rs=null;
|
||||||
|
try {
|
||||||
|
PreparedStatement ps= connection.prepareStatement(sql);
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.info("数据库查询异常方法{},异常信息{}","com.suisung.mall.shop.sixun.dao.BaseDao.baseFindListJoinPage",e.getMessage());
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
resultDto.setResultSet(rs);
|
||||||
|
resultDto.setConnection(connection);
|
||||||
|
return resultDto;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param ip
|
* @param ip
|
||||||
|
|||||||
@ -36,7 +36,14 @@ public class SxDataDao extends BaseDao{
|
|||||||
private final static String T_BD_BASECODE_TYPE="t_bd_basecode_type";//品牌表
|
private final static String T_BD_BASECODE_TYPE="t_bd_basecode_type";//品牌表
|
||||||
private final static String TYPE_NO="type_no";//品牌排序字段
|
private final static String TYPE_NO="type_no";//品牌排序字段
|
||||||
|
|
||||||
private final static String T_IM_BRANCH_STOCK="t_im_branch_stock";//库存表
|
//private final static String T_IM_BRANCH_STOCK="t_im_branch_stock";//库存表
|
||||||
|
|
||||||
|
private final static String T_IM_BRANCH_STOCK="(" +
|
||||||
|
"select * from( " +
|
||||||
|
" select ROW_NUMBER() OVER( " +
|
||||||
|
" partition BY tib.item_no order by tib.oper_date desc) as rn, " +
|
||||||
|
" tib.* " +
|
||||||
|
" from t_im_branch_stock tib)tib where tib.rn=1) ";
|
||||||
|
|
||||||
private final static String T_RM_SPEC_PRICE="t_rm_spec_price";//活动表
|
private final static String T_RM_SPEC_PRICE="t_rm_spec_price";//活动表
|
||||||
|
|
||||||
@ -147,13 +154,7 @@ public class SxDataDao extends BaseDao{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int getTBditemInfoJoninTotal(DataBaseInfo dataBaseInfo){
|
public int getTBditemInfoJoninTotal(DataBaseInfo dataBaseInfo){
|
||||||
return getBaseJoinTotal(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
return getBaseGoodsJoinTotal(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
||||||
, T_BD_ITEM_INFO
|
|
||||||
,T_IM_BRANCH_STOCK
|
|
||||||
,"item_no"
|
|
||||||
,"item_no"
|
|
||||||
,ITEM_CLSNO
|
|
||||||
,"t.stock_qty,t.oper_date"
|
|
||||||
,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere());
|
,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,13 +176,7 @@ public class SxDataDao extends BaseDao{
|
|||||||
* @param pageSize
|
* @param pageSize
|
||||||
*/
|
*/
|
||||||
public List<SxSyncGoods> findBditemInfoListPage(DataBaseInfo dataBaseInfo,int pageNo,int pageSize){
|
public List<SxSyncGoods> findBditemInfoListPage(DataBaseInfo dataBaseInfo,int pageNo,int pageSize){
|
||||||
ResultDto resultDto=baseFindListJoinPage(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
ResultDto resultDto=baseFindGoodsListJoinPage(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
||||||
, T_BD_ITEM_INFO
|
|
||||||
,T_IM_BRANCH_STOCK
|
|
||||||
,"item_no"
|
|
||||||
,"item_no"
|
|
||||||
,ITEM_CLSNO
|
|
||||||
,"t.stock_qty,t.oper_date"
|
|
||||||
,pageNo,pageSize,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere());
|
,pageNo,pageSize,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere());
|
||||||
ResultSet rs= resultDto.getResultSet();
|
ResultSet rs= resultDto.getResultSet();
|
||||||
List<SxSyncGoods> sxSyncGoodses=new ArrayList<>();
|
List<SxSyncGoods> sxSyncGoodses=new ArrayList<>();
|
||||||
@ -204,23 +199,26 @@ public class SxDataDao extends BaseDao{
|
|||||||
sxSyncGoods.setGross_margin(new BigDecimal("0"));//毛利率
|
sxSyncGoods.setGross_margin(new BigDecimal("0"));//毛利率
|
||||||
}
|
}
|
||||||
sxSyncGoods.setItem_no(rs.getString("item_no"));//货号
|
sxSyncGoods.setItem_no(rs.getString("item_no"));//货号
|
||||||
sxSyncGoods.setItem_subname(rs.getString("item_subname"));//商品名称
|
sxSyncGoods.setItem_subname(rs.getString("item_name"));//商品名称
|
||||||
sxSyncGoods.setItem_subno(rs.getString("item_subno"));//商品条码
|
sxSyncGoods.setItem_subno(rs.getString("item_subno"));//商品条码
|
||||||
|
|
||||||
sxSyncGoods.setBig_cls_name("9999");//商品大类 todo 如何关联
|
sxSyncGoods.setBig_cls_name("9999");//商品大类 todo 如何关联
|
||||||
sxSyncGoods.setSmall_cls_name(rs.getString("item_clsno").trim());//商品小类 todo 如何关联
|
sxSyncGoods.setSmall_cls_name(rs.getString("item_clsno").trim());//商品小类 todo 如何关联
|
||||||
|
|
||||||
sxSyncGoods.setItem_size(rs.getString("item_size"));//规格
|
sxSyncGoods.setItem_size(rs.getString("item_size"));//规格
|
||||||
sxSyncGoods.setUnit_no(rs.getString("unit_no"));//单位 todo
|
sxSyncGoods.setUnit_no(rs.getString("unit_no"));//单位
|
||||||
sxSyncGoods.setStock(rs.getBigDecimal("stock_qty"));//库存数量 todo item_stock?
|
if(null==rs.getBigDecimal("stock_qty")){
|
||||||
|
sxSyncGoods.setStock(BigDecimal.ZERO);
|
||||||
|
}else {
|
||||||
|
sxSyncGoods.setStock(rs.getBigDecimal("stock_qty"));//库存数量
|
||||||
|
}
|
||||||
sxSyncGoods.setPrice(rs.getBigDecimal("price"));//进货价
|
sxSyncGoods.setPrice(rs.getBigDecimal("price"));//进货价
|
||||||
sxSyncGoods.setSale_price(rs.getBigDecimal("sale_price"));//零售价
|
sxSyncGoods.setSale_price(rs.getBigDecimal("sale_price"));//零售价
|
||||||
|
|
||||||
sxSyncGoods.setVip_price(rs.getBigDecimal("vip_price"));//会员价
|
sxSyncGoods.setVip_price(rs.getBigDecimal("vip_price"));//会员价
|
||||||
sxSyncGoods.setVip_acc_flag(rs.getBigDecimal("vip_acc_flag"));//允许积分
|
sxSyncGoods.setVip_acc_flag(rs.getBigDecimal("vip_acc_flag"));//允许积分
|
||||||
sxSyncGoods.setVip_acc_num(rs.getBigDecimal("vip_acc_num"));//积分值
|
sxSyncGoods.setVip_acc_num(rs.getBigDecimal("vip_acc_num"));//积分值
|
||||||
sxSyncGoods.setSale_flag(rs.getInt("main_Sale_flag"));//商品状态 todo 是main_Sale_flag?
|
//sxSyncGoods.setSale_flag(rs.getInt("main_Sale_flag"));//商品状态 todo 是main_Sale_flag?
|
||||||
sxSyncGoods.setItem_rem(rs.getString("item_rem"));//助记码
|
sxSyncGoods.setItem_rem(rs.getString("item_rem"));//助记码
|
||||||
sxSyncGoods.setBuild_date(rs.getString("build_date"));//生产日期 todo
|
sxSyncGoods.setBuild_date(rs.getString("build_date"));//生产日期 todo
|
||||||
sxSyncGoods.setValid_days(getStopDate(rs));//保质期 todo stop_date-build_date?
|
sxSyncGoods.setValid_days(getStopDate(rs));//保质期 todo stop_date-build_date?
|
||||||
@ -460,16 +458,24 @@ public class SxDataDao extends BaseDao{
|
|||||||
dataBaseInfo.getPassword(), dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName());
|
dataBaseInfo.getPassword(), dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName());
|
||||||
try {
|
try {
|
||||||
conn.setAutoCommit(false); // 关闭自动提交,开启事务
|
conn.setAutoCommit(false); // 关闭自动提交,开启事务
|
||||||
String sql = "update t_im_branch_stock set stock_qty= stock_qty+?,oper_date=? where item_no=?";
|
//String sql = "update t_im_branch_stock set stock_qty= stock_qty+(?),oper_date=? where item_no=?";
|
||||||
|
String sql = "WITH TopStock AS ( " +
|
||||||
|
" SELECT TOP(1) * " +
|
||||||
|
" FROM t_im_branch_stock " +
|
||||||
|
" WHERE item_no = ? " +
|
||||||
|
" ORDER BY oper_date DESC " +
|
||||||
|
") " +
|
||||||
|
" UPDATE TopStock " +
|
||||||
|
" SET stock_qty = stock_qty+(?),oper_date=?;";
|
||||||
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
||||||
try (PreparedStatement ps = conn.prepareStatement(sql)) {
|
try (PreparedStatement ps = conn.prepareStatement(sql)) {
|
||||||
int batchSize = 1000; // 每批处理1000条
|
int batchSize = 1000; // 每批处理1000条
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Set<Map.Entry> sme=map.entrySet();
|
Set<Map.Entry> sme=map.entrySet();
|
||||||
for (Map.Entry entry : sme) {
|
for (Map.Entry entry : sme) {
|
||||||
ps.setDouble(1, (double) entry.getValue());
|
ps.setString(1, (String) entry.getKey());
|
||||||
ps.setTimestamp(2, timestamp);
|
ps.setDouble(2, (double) entry.getValue());
|
||||||
ps.setString(3, (String) entry.getKey());
|
ps.setTimestamp(3, timestamp);
|
||||||
ps.addBatch(); // 添加至批处理
|
ps.addBatch(); // 添加至批处理
|
||||||
count++;
|
count++;
|
||||||
if (count % batchSize == 0) {
|
if (count % batchSize == 0) {
|
||||||
|
|||||||
@ -8,7 +8,12 @@ public class CommentModel {
|
|||||||
@ApiModelProperty("店铺的key")
|
@ApiModelProperty("店铺的key")
|
||||||
private String appKey;
|
private String appKey;
|
||||||
@ApiModelProperty("店铺的密钥")
|
@ApiModelProperty("店铺的密钥")
|
||||||
|
private String appId;
|
||||||
|
@ApiModelProperty("报文签名")
|
||||||
private String sign;
|
private String sign;
|
||||||
|
@ApiModelProperty("店铺的密钥")
|
||||||
|
private String signe;
|
||||||
|
|
||||||
@ApiModelProperty("店铺的id")
|
@ApiModelProperty("店铺的id")
|
||||||
private String storeId;
|
private String storeId;
|
||||||
|
|
||||||
|
|||||||
@ -11,5 +11,6 @@ public class UploadModel extends CommentModel{
|
|||||||
private String page;
|
private String page;
|
||||||
@ApiModelProperty("同步类型1商品,2分类,3品牌,4会员")
|
@ApiModelProperty("同步类型1商品,2分类,3品牌,4会员")
|
||||||
private String syncType;
|
private String syncType;
|
||||||
|
@ApiModelProperty("报文签名")
|
||||||
|
private String sign;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,7 +185,7 @@ public abstract class SxDataAbstService {
|
|||||||
// if(type.equals("2")){
|
// if(type.equals("2")){
|
||||||
// finalSxGoosModel.setPrice(finalSxGoosModel.getPrice().multiply(m.getDiscount()));
|
// finalSxGoosModel.setPrice(finalSxGoosModel.getPrice().multiply(m.getDiscount()));
|
||||||
// }
|
// }
|
||||||
finalSxGoosModel.setIsSpecial("1");
|
// finalSxGoosModel.setIsSpecial("1");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sxGoosModelList.add(sxGoosModel);
|
sxGoosModelList.add(sxGoosModel);
|
||||||
|
|||||||
@ -43,10 +43,10 @@ public class WebClientService {
|
|||||||
public String uploudSxData(String filePath, CommentModel commentModel,String page,String syncType){
|
public String uploudSxData(String filePath, CommentModel commentModel,String page,String syncType){
|
||||||
UploadModel uploadModel=new UploadModel();
|
UploadModel uploadModel=new UploadModel();
|
||||||
uploadModel.setAppKey(commentModel.getAppKey());
|
uploadModel.setAppKey(commentModel.getAppKey());
|
||||||
|
uploadModel.setAppId(commentModel.getAppId());
|
||||||
uploadModel.setSign(commentModel.getSign());
|
uploadModel.setSign(commentModel.getSign());
|
||||||
uploadModel.setPage(page);
|
uploadModel.setPage(page);
|
||||||
uploadModel.setSyncType(syncType);
|
uploadModel.setSyncType(syncType);
|
||||||
//"C:\\Users\\Administrator\\uploaded\\2025\\3\\25\\goods_1.txt"
|
|
||||||
return this.uploadFile(filePath, remoteIp+HttpUtils.URL_UPLOUP,uploadModel);
|
return this.uploadFile(filePath, remoteIp+HttpUtils.URL_UPLOUP,uploadModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.small.client.Cache.CommonCache;
|
import com.small.client.Cache.CommonCache;
|
||||||
import com.small.client.Utils.*;
|
import com.small.client.Utils.*;
|
||||||
import com.small.client.dao.SxDataDao;
|
import com.small.client.dao.SxDataDao;
|
||||||
@ -89,14 +90,17 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
String jsonString="";
|
String jsonString="";
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
jsonString = objectMapper.writeValueAsString(sxCategoryModelList);
|
Gson gson=new Gson();
|
||||||
|
jsonString=gson.toJson(sxCategoryModelList);
|
||||||
jsonArray = JSONUtil.parseArray(jsonString);
|
jsonArray = JSONUtil.parseArray(jsonString);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
String sign=CommonUtil.generateOpenSign(jsonString,commentModel.getAppId(),commentModel.getAppKey());
|
||||||
|
log.info("sign:{}",sign);
|
||||||
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_CATEGORY
|
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_CATEGORY
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign(),jsonArray);//todo 后期改为文件传输
|
+"&sign="+sign,jsonArray);//todo 后期改为文件传输
|
||||||
if (!HttpUtils.SUCCESSCODE.equals(code)) {
|
if (!HttpUtils.SUCCESSCODE.equals(code)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -147,16 +151,19 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
if(brandModels!=null&&brandModels.size()>0){
|
if(brandModels!=null&&brandModels.size()>0){
|
||||||
String jsonString ="";
|
String jsonString ="";
|
||||||
JSONArray jsonArray =new JSONArray();
|
JSONArray jsonArray =new JSONArray();
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
// ObjectMapper objectMapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
jsonString = objectMapper.writeValueAsString(brandModels);
|
Gson gson=new Gson();
|
||||||
|
jsonString=gson.toJson(brandModels);
|
||||||
jsonArray = JSONUtil.parseArray(jsonString);
|
jsonArray = JSONUtil.parseArray(jsonString);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
String sign=CommonUtil.generateOpenSign(jsonArray.toString(),commentModel.getAppId(),commentModel.getAppKey());
|
||||||
|
log.info("sign={}",sign);
|
||||||
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_BRAND
|
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_BRAND
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign(),jsonArray);//todo 后期改为文件传输
|
+"&sign="+sign,jsonArray);//todo 后期改为文件传输
|
||||||
if(code!=null){
|
if(code!=null){
|
||||||
log.info("品牌总共有{}条数据,同步完成{}条",brandModels.size(),brandModels.size());
|
log.info("品牌总共有{}条数据,同步完成{}条",brandModels.size(),brandModels.size());
|
||||||
}
|
}
|
||||||
@ -201,14 +208,16 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
String sign=CommonUtil.generateOpenSign(jsonString,commentModel.getAppId(),commentModel.getAppKey());
|
||||||
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_MEMBER
|
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_MEMBER
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign(),memberList);//todo 后期改为文件传输
|
+"&sign="+sign,memberList);//todo 后期改为文件传输
|
||||||
if (!HttpUtils.SUCCESSCODE.equals(code)) {
|
if (!HttpUtils.SUCCESSCODE.equals(code)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
syncCount+=memberList.size();
|
syncCount+=memberList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("vip会员总共有{}条数据,同步完成{}条",total,syncCount);
|
log.info("vip会员总共有{}条数据,同步完成{}条",total,syncCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +231,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
String parentId= sxSyncCategories.stream().filter(m->m.getItem_clsname().equals(parentName)).
|
String parentId= sxSyncCategories.stream().filter(m->m.getItem_clsname().equals(parentName)).
|
||||||
map(SxSyncCategory::getItem_clsno).collect(Collectors.joining());
|
map(SxSyncCategory::getItem_clsno).collect(Collectors.joining());
|
||||||
getBdBrandCacheList(dataBaseInfo);
|
getBdBrandCacheList(dataBaseInfo);
|
||||||
|
getCategoryCacheList(sxSyncCategories);
|
||||||
String childrens=commonCache.get(CommonCache.CACHE_CATEGROY+parentId);
|
String childrens=commonCache.get(CommonCache.CACHE_CATEGROY+parentId);
|
||||||
if(childrens==null){
|
if(childrens==null){
|
||||||
log.info(JSONUtil.toJsonStr(buildTree(sxSyncCategories,parentId)));
|
log.info(JSONUtil.toJsonStr(buildTree(sxSyncCategories,parentId)));
|
||||||
@ -300,7 +310,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
where+=" or b.build_date>'"+commentModel.getSyncTime()+"' ";
|
where+=" or b.build_date>'"+commentModel.getSyncTime()+"' ";
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotEmpty(dataBaseInfo.getOperDate())){
|
if(StringUtils.isNotEmpty(dataBaseInfo.getOperDate())){
|
||||||
where+=" and t.oper_date>'"+dataBaseInfo.getOperDate()+"' ";
|
where+=" and ls.oper_date>'"+dataBaseInfo.getOperDate()+"' ";
|
||||||
}
|
}
|
||||||
dataBaseInfo.setWhere(where);
|
dataBaseInfo.setWhere(where);
|
||||||
// 记录总数
|
// 记录总数
|
||||||
@ -313,6 +323,8 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
log.info("暂无商品同步");
|
log.info("暂无商品同步");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
where+=" and";
|
||||||
|
dataBaseInfo.setWhere(where);
|
||||||
|
|
||||||
// 总页数
|
// 总页数
|
||||||
int pages = CommonUtil.getPagesCount(total, SxDataDao.PAGESIZE);
|
int pages = CommonUtil.getPagesCount(total, SxDataDao.PAGESIZE);
|
||||||
@ -344,23 +356,20 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
//通知服务器上传cos
|
//通知服务器上传cos
|
||||||
HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_GOODS_NOTICE_UPLOAD_TO_OSS
|
HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_GOODS_NOTICE_UPLOAD_TO_OSS
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign()
|
+"&sign="+commentModel.getAppId()
|
||||||
+"&syncType="+DicEnum.MUAL_1.getCode()
|
+"&syncType="+DicEnum.MUAL_1.getCode()
|
||||||
+"&refreshDate="+refreshDate,
|
+"&refreshDateStr="+refreshDate,
|
||||||
JSONUtil.parseArray(folders));
|
JSONUtil.parseArray(folders));
|
||||||
|
|
||||||
//folders.add(String.valueOf(4));
|
|
||||||
//folders.add(String.valueOf(5));
|
|
||||||
log.info("商品分类总共有{}条数据,同步完成{}条",total,syncCount);
|
log.info("商品分类总共有{}条数据,同步完成{}条",total,syncCount);
|
||||||
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_GOODS_READ
|
String code= HttpUtils.postData(restTemplate,remoteIp+HttpUtils.URL_SYNC_GOODS_READ
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign()
|
+"&sign="+commentModel.getAppId()
|
||||||
+"&syncType="+DicEnum.MUAL_1.getCode(),
|
+"&syncType="+DicEnum.MUAL_1.getCode(),
|
||||||
JSONUtil.parseArray(folders));
|
JSONUtil.parseArray(folders));
|
||||||
if (HttpUtils.SUCCESSCODE.equals(code)) {
|
if (HttpUtils.SUCCESSCODE.equals(code)) {
|
||||||
log.info("思迅商品同步完成,通知服务器处理数据相应成功");
|
log.info("思迅商品同步完成,通知服务器处理数据相应成功");
|
||||||
//记录同步时间
|
//记录同步时间
|
||||||
createDateFile();
|
// createDateFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,6 +386,8 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
String fileName=fileUtils.getFileName(syncType,page,FileUtils.txtEnd);
|
String fileName=fileUtils.getFileName(syncType,page,FileUtils.txtEnd);
|
||||||
String filePath=file.getAbsolutePath();
|
String filePath=file.getAbsolutePath();
|
||||||
fileUtils.writeFile(filePath,fileName,content);
|
fileUtils.writeFile(filePath,fileName,content);
|
||||||
|
String sign=CommonUtil.generateOpenSign(content,commentModel.getAppId(),commentModel.getAppKey());
|
||||||
|
commentModel.setSign(sign);
|
||||||
return webClientService.uploudSxData(filePath+FileUtils.pathSeparator+fileName,commentModel,page.toString(),syncType);
|
return webClientService.uploudSxData(filePath+FileUtils.pathSeparator+fileName,commentModel,page.toString(),syncType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,10 +478,22 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
}
|
}
|
||||||
commonCache.setBrandCahce("brandCache",specPriceDtos);
|
commonCache.setBrandCahce("brandCache",specPriceDtos);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品分类据并加入到缓存
|
||||||
|
* @param sxSyncCategories
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void getCategoryCacheList(List<SxSyncCategory> sxSyncCategories){
|
||||||
|
if(CollectionUtil.isNotEmpty(sxSyncCategories)){
|
||||||
|
for (SxSyncCategory sxSyncCategory : sxSyncCategories) {
|
||||||
|
commonCache.put(sxSyncCategory.getItem_clsno(),sxSyncCategory.getItem_clsname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommentModel getCommentModel() {
|
public CommentModel getCommentModel() {
|
||||||
String path=JarPathUtil.getRuntimePath();
|
String path=JarPathUtil.getRuntimePath();
|
||||||
@ -481,7 +504,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
String encryptedData = getPrimaryKey();
|
String encryptedData = getPrimaryKey();
|
||||||
Map<String, String> result= CryptoUtils.decryptAndUnpack(encryptedData);
|
Map<String, String> result= CryptoUtils.decryptAndUnpack(encryptedData);
|
||||||
CommentModel commentModel=new CommentModel();
|
CommentModel commentModel=new CommentModel();
|
||||||
commentModel.setSign(result.get("sign"));
|
commentModel.setAppId(result.get("sign"));
|
||||||
commentModel.setAppKey(result.get("appKey"));
|
commentModel.setAppKey(result.get("appKey"));
|
||||||
commentModel.setStoreId(result.get("storeId"));
|
commentModel.setStoreId(result.get("storeId"));
|
||||||
//获取上次同步的最大时间
|
//获取上次同步的最大时间
|
||||||
@ -643,10 +666,11 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
public DataBaseInfo getDataBaseInfo(CommentModel commentModel) {
|
public DataBaseInfo getDataBaseInfo(CommentModel commentModel) {
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
jsonObject.putOnce("appKey",commentModel.getAppKey());
|
jsonObject.putOnce("appKey",commentModel.getAppKey());
|
||||||
jsonObject.putOnce("sign",commentModel.getSign());
|
jsonObject.putOnce("sign",commentModel.getAppId());
|
||||||
|
|
||||||
StoreDbConfig storeDbConfig= HttpUtils.postDataGetConfig(restTemplate,remoteIp+HttpUtils.URL_SYNC_GET_STOREdBCONFIG
|
StoreDbConfig storeDbConfig= HttpUtils.postDataGetConfig(restTemplate,remoteIp+HttpUtils.URL_SYNC_GET_STOREdBCONFIG
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign(), jsonObject);
|
+"&sign="+commentModel.getAppId(), jsonObject);
|
||||||
DataBaseInfo dataBaseInfo=new DataBaseInfo();
|
DataBaseInfo dataBaseInfo=new DataBaseInfo();
|
||||||
if(null!=storeDbConfig){
|
if(null!=storeDbConfig){
|
||||||
dataBaseInfo.setIp(storeDbConfig.getDbIp());
|
dataBaseInfo.setIp(storeDbConfig.getDbIp());
|
||||||
@ -671,8 +695,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
}
|
}
|
||||||
JSONObject jsonObject= restTemplate.getForObject(remoteIp+HttpUtils.URL_SYNC_GET_STOR_DATA_RELEASE
|
JSONObject jsonObject= restTemplate.getForObject(remoteIp+HttpUtils.URL_SYNC_GET_STOR_DATA_RELEASE
|
||||||
+"?appKey="+commentModel.getAppKey()
|
+"?appKey="+commentModel.getAppKey()
|
||||||
+"&sign="+commentModel.getSign(),JSONObject.class);
|
+"&sign="+commentModel.getAppId(),JSONObject.class);
|
||||||
|
|
||||||
if(null!=jsonObject.get("result")){
|
if(null!=jsonObject.get("result")){
|
||||||
Map map=(Map)jsonObject.get("result");
|
Map map=(Map)jsonObject.get("result");
|
||||||
sxDataDao.updateStoreData(dataBaseInfo,map);
|
sxDataDao.updateStoreData(dataBaseInfo,map);
|
||||||
|
|||||||
@ -343,6 +343,11 @@ public class AccountController {
|
|||||||
return accountUserBaseService.existByNickname(nickname, storeId);
|
return accountUserBaseService.existByNickname(nickname, storeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/existByMobile", method = RequestMethod.POST)
|
||||||
|
public Boolean existByMobile(@RequestParam(name = "moblie") String moblie, @RequestParam(name = "storeId") String storeId) {
|
||||||
|
return accountUserBaseService.existByMobile(moblie, storeId);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/editPassword", method = RequestMethod.POST)
|
@RequestMapping(value = "/editPassword", method = RequestMethod.POST)
|
||||||
public CommonResult editPassword(@RequestParam(name = "user_id") Integer user_id,
|
public CommonResult editPassword(@RequestParam(name = "user_id") Integer user_id,
|
||||||
@RequestParam(name = "user_password") String user_password) {
|
@RequestParam(name = "user_password") String user_password) {
|
||||||
|
|||||||
@ -205,6 +205,14 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
|
|||||||
*/
|
*/
|
||||||
Boolean existByNickname(String nickname, String storeId);
|
Boolean existByNickname(String nickname, String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 userAccount 也就是手机号判断是否存在会员
|
||||||
|
* @param userAccount
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean existByMobile(String userAccount, String storeId);
|
||||||
|
|
||||||
Pair<Boolean, AccountUserBase> saveOrUpdate2(AccountUserBase entity);
|
Pair<Boolean, AccountUserBase> saveOrUpdate2(AccountUserBase entity);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1634,7 +1634,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
*
|
*
|
||||||
* @return array 用户登录数据
|
* @return array 用户登录数据
|
||||||
*/
|
*/
|
||||||
@GlobalTransactional
|
// @GlobalTransactional
|
||||||
@Override
|
@Override
|
||||||
public AccountUserBase register(Map userInfo) {
|
public AccountUserBase register(Map userInfo) {
|
||||||
|
|
||||||
@ -3412,6 +3412,23 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
return count(queryWrapper) > 0;
|
return count(queryWrapper) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断店铺某个手机是否存在
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean existByMobile(String userAccount, String storeId) {
|
||||||
|
if (StrUtil.isBlank(userAccount)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<AccountUserBase> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(AccountUserBase::getUser_account, userAccount);
|
||||||
|
queryWrapper.eq(AccountUserBase::getStore_ids, storeId);
|
||||||
|
return count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pair<Boolean, AccountUserBase> saveOrUpdate2(AccountUserBase entity) {
|
public Pair<Boolean, AccountUserBase> saveOrUpdate2(AccountUserBase entity) {
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
|
|||||||
@ -27,6 +27,9 @@ public enum DicEnum {
|
|||||||
YESORNO_0("0", "否","yesOrno","是否","是否"),
|
YESORNO_0("0", "否","yesOrno","是否","是否"),
|
||||||
YESORNO_1("1", "是","yesOrno","是否","是否"),
|
YESORNO_1("1", "是","yesOrno","是否","是否"),
|
||||||
|
|
||||||
|
PRIORITY_MODE_1("1", "手动优先","priorityMode","优先方式","根据平台给的商品自动切分上架"),
|
||||||
|
PRIORITY_MODE_2("2", "自动优先","priorityMode","优先方式","更新时不做商品切割"),
|
||||||
|
|
||||||
GOODS_UN_SYNC_SX("1", "白条猪","unSyncGoodsSX","思迅非同步商品","白条猪"),
|
GOODS_UN_SYNC_SX("1", "白条猪","unSyncGoodsSX","思迅非同步商品","白条猪"),
|
||||||
;
|
;
|
||||||
;
|
;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import java.util.Map;
|
|||||||
* 认证服务远程调用
|
* 认证服务远程调用
|
||||||
* Created by Xinze on 2020/7/19.
|
* Created by Xinze on 2020/7/19.
|
||||||
*/
|
*/
|
||||||
@FeignClient("mall-account")
|
@FeignClient(value = "mall-account",url = "http://localhost:8088")
|
||||||
public interface AccountService {
|
public interface AccountService {
|
||||||
|
|
||||||
@GetMapping(value = "/admin/account/accountController/getUserBase")
|
@GetMapping(value = "/admin/account/accountController/getUserBase")
|
||||||
@ -146,6 +146,17 @@ public interface AccountService {
|
|||||||
@PostMapping(value = "/admin/account/accountController/existByNickname")
|
@PostMapping(value = "/admin/account/accountController/existByNickname")
|
||||||
boolean existByNickname(@RequestParam(name = "nickname") String nickname, @RequestParam(name = "storeId") String storeId);
|
boolean existByNickname(@RequestParam(name = "nickname") String nickname, @RequestParam(name = "storeId") String storeId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断一个店铺是否存在某个手机
|
||||||
|
*
|
||||||
|
* @param moblie
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/admin/account/accountController/existByMobile")
|
||||||
|
boolean existByMobile(@RequestParam(name = "moblie") String moblie, @RequestParam(name = "storeId") String storeId);
|
||||||
|
|
||||||
@PostMapping(value = "/admin/account/accountController/editPassword")
|
@PostMapping(value = "/admin/account/accountController/editPassword")
|
||||||
CommonResult editPassword(@RequestParam(name = "user_id") Integer user_id,
|
CommonResult editPassword(@RequestParam(name = "user_id") Integer user_id,
|
||||||
@RequestParam(name = "user_password") String user_password);
|
@RequestParam(name = "user_password") String user_password);
|
||||||
|
|||||||
@ -118,4 +118,8 @@ public class StoreDbConfig implements Serializable {
|
|||||||
@NotBlank(message = "是否允许负库存售卖不能为空")
|
@NotBlank(message = "是否允许负库存售卖不能为空")
|
||||||
private String isNegativeAllowed="1";
|
private String isNegativeAllowed="1";
|
||||||
|
|
||||||
|
@TableField(value = "priority_mode",updateStrategy = FieldStrategy.NOT_EMPTY)
|
||||||
|
@ApiModelProperty(value = "更新优先方式(1:手动优先,2:自动优先),自动优先时根据平台给的商品自动切分上架,更新是才发挥作用")
|
||||||
|
@NotBlank(message = "更新优先方式不能为空")
|
||||||
|
private String priorityMode="1";
|
||||||
}
|
}
|
||||||
@ -31,6 +31,9 @@ public class ProductCategoryListReq extends BaseListReq {
|
|||||||
@ApiModelProperty("是否启用(BOOL):0-不显示;1-显示")
|
@ApiModelProperty("是否启用(BOOL):0-不显示;1-显示")
|
||||||
private Boolean categoryIsEnable;
|
private Boolean categoryIsEnable;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺id")
|
||||||
|
private String store_id;
|
||||||
|
|
||||||
public ProductCategoryListReq() {
|
public ProductCategoryListReq() {
|
||||||
setSidx("category_order");
|
setSidx("category_order");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -976,6 +976,10 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
|||||||
if (CheckUtil.isNotEmpty(categoryName)) {
|
if (CheckUtil.isNotEmpty(categoryName)) {
|
||||||
objectQueryWrapper.like("category_name", categoryName);
|
objectQueryWrapper.like("category_name", categoryName);
|
||||||
}
|
}
|
||||||
|
String storeId=getParameter("store_id");
|
||||||
|
if(CheckUtil.isNotEmpty(storeId)){
|
||||||
|
objectQueryWrapper.eq("store_id", storeId);
|
||||||
|
}
|
||||||
|
|
||||||
List<ShopBaseProductCategory> dataList = find(objectQueryWrapper);
|
List<ShopBaseProductCategory> dataList = find(objectQueryWrapper);
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.date.StopWatch;
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@ -16,8 +15,6 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
@ -27,6 +24,7 @@ import com.suisung.mall.common.constant.CommonConstant;
|
|||||||
import com.suisung.mall.common.constant.ConfigConstant;
|
import com.suisung.mall.common.constant.ConfigConstant;
|
||||||
import com.suisung.mall.common.constant.MqConstant;
|
import com.suisung.mall.common.constant.MqConstant;
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
|
import com.suisung.mall.common.enums.DicEnum;
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
import com.suisung.mall.common.exception.ApiException;
|
||||||
import com.suisung.mall.common.feignService.EduService;
|
import com.suisung.mall.common.feignService.EduService;
|
||||||
import com.suisung.mall.common.feignService.SearchService;
|
import com.suisung.mall.common.feignService.SearchService;
|
||||||
@ -38,7 +36,6 @@ import com.suisung.mall.common.modules.sixun.SxSyncGoods;
|
|||||||
import com.suisung.mall.common.modules.store.ShopStoreActivityBase;
|
import com.suisung.mall.common.modules.store.ShopStoreActivityBase;
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreActivityItem;
|
import com.suisung.mall.common.modules.store.ShopStoreActivityItem;
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||||
import com.suisung.mall.common.modules.sync.ProductMapping;
|
|
||||||
import com.suisung.mall.common.modules.user.ShopUserCart;
|
import com.suisung.mall.common.modules.user.ShopUserCart;
|
||||||
import com.suisung.mall.common.modules.user.ShopUserFavoritesItem;
|
import com.suisung.mall.common.modules.user.ShopUserFavoritesItem;
|
||||||
import com.suisung.mall.common.modules.user.ShopUserProductBrowse;
|
import com.suisung.mall.common.modules.user.ShopUserProductBrowse;
|
||||||
@ -67,13 +64,11 @@ import com.suisung.mall.shop.product.pojo.vo.ProductVo;
|
|||||||
import com.suisung.mall.shop.product.service.*;
|
import com.suisung.mall.shop.product.service.*;
|
||||||
import com.suisung.mall.shop.sixun.service.SxSyncGoodsService;
|
import com.suisung.mall.shop.sixun.service.SxSyncGoodsService;
|
||||||
import com.suisung.mall.shop.store.service.*;
|
import com.suisung.mall.shop.store.service.*;
|
||||||
import com.suisung.mall.shop.sync.Utils.ProductPriceCalculator;
|
|
||||||
import com.suisung.mall.shop.sync.Utils.ShopJsonUtils;
|
|
||||||
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
||||||
import com.suisung.mall.shop.sync.service.ProductMappingService;
|
import com.suisung.mall.shop.sync.service.ProductMappingService;
|
||||||
|
import com.suisung.mall.shop.sync.service.StoreDbConfigService;
|
||||||
import com.suisung.mall.shop.user.service.*;
|
import com.suisung.mall.shop.user.service.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -92,9 +87,7 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||||
@ -213,8 +206,12 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProductMappingService productMappingService;
|
private ProductMappingService productMappingService;
|
||||||
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StoreDbConfigService storeDbConfigService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean trySaveProduct(String productObj, String productItems) {
|
public boolean trySaveProduct(String productObj, String productItems) {
|
||||||
@ -5579,8 +5576,12 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
|
|||||||
if(CollUtil.isNotEmpty(newProducts)){
|
if(CollUtil.isNotEmpty(newProducts)){
|
||||||
productMappingService.computeProductMapping(newProducts,newProducts.get(0).getStore_id(),false);
|
productMappingService.computeProductMapping(newProducts,newProducts.get(0).getStore_id(),false);
|
||||||
}
|
}
|
||||||
if(CollUtil.isNotEmpty(updateProducts)){
|
if(CollUtil.isNotEmpty(updateProducts)){//如果时自动优先,则按平台规则切割商品
|
||||||
productMappingService.computeProductMapping(updateProducts,updateProducts.get(0).getStore_id(),true);
|
Map map=storeDbConfigService.getPriorityModeCachByStoreId(newProducts.get(0).getStore_id());
|
||||||
|
String priorityMode= (String) map.get(String.valueOf(newProducts.get(0).getStore_id()));
|
||||||
|
if(DicEnum.PRIORITY_MODE_2.getCode().equals(priorityMode)){
|
||||||
|
productMappingService.computeProductMapping(updateProducts,updateProducts.get(0).getStore_id(),true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Pair.of(true, String.format("处理成功,新增%d条,更新%d条",
|
return Pair.of(true, String.format("处理成功,新增%d条,更新%d条",
|
||||||
newProducts.size(), updateProducts.size()));
|
newProducts.size(), updateProducts.size()));
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
package com.suisung.mall.shop.sync.controller;
|
package com.suisung.mall.shop.sync.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.pojo.req.SyncThirdMemberReq;
|
import com.suisung.mall.common.pojo.req.SyncThirdMemberReq;
|
||||||
@ -147,8 +148,9 @@ public class SyncThirdDataController {
|
|||||||
public ThirdApiRes uploudToCos(@RequestBody List<String> folders,
|
public ThirdApiRes uploudToCos(@RequestBody List<String> folders,
|
||||||
@RequestParam String appKey,
|
@RequestParam String appKey,
|
||||||
@RequestParam String sign,
|
@RequestParam String sign,
|
||||||
@RequestParam Date refreshDate,
|
@RequestParam String refreshDateStr,
|
||||||
@RequestParam String syncType) {
|
@RequestParam String syncType) {
|
||||||
|
Date refreshDate= DateUtil.parse(refreshDateStr,"yyyy-MM-dd HH:mm:ss");
|
||||||
return syncThirdDataService.fileUploadToOss(appKey,sign,syncType,refreshDate,folders);
|
return syncThirdDataService.fileUploadToOss(appKey,sign,syncType,refreshDate,folders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.suisung.mall.shop.sync.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BrandModel implements Serializable {
|
||||||
|
@ApiModelProperty("品牌名称")
|
||||||
|
private String brand_name;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌编号")
|
||||||
|
private String codeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌描述")
|
||||||
|
private String brand_desc;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌分类")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片")
|
||||||
|
private String brand_image;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否推荐")
|
||||||
|
private String brand_recommend;
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.suisung.mall.shop.sync.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型对应
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SxCategoryModel {
|
||||||
|
//模型对应ShopBaseProductCategory start
|
||||||
|
private String parent_name;//暂时不用
|
||||||
|
@ApiModelProperty(value = "商品分类名称")
|
||||||
|
private String category_name;
|
||||||
|
@ApiModelProperty(value = "分类图片")
|
||||||
|
private String category_image;
|
||||||
|
@ApiModelProperty(value = "是否允许虚拟商品(ENUM):1-是; 0-否")
|
||||||
|
private Integer category_virtual_enable;
|
||||||
|
@ApiModelProperty(value = "分佣比例-百分比")
|
||||||
|
private BigDecimal category_commission_rate;
|
||||||
|
// private String type_name;//todo 看代码没有用,使用的是product_type
|
||||||
|
//模型对应ShopBaseProductCategory end
|
||||||
|
@ApiModelProperty(value = "产品类型")
|
||||||
|
private String product_type;
|
||||||
|
@ApiModelProperty(value = "第一级父类")
|
||||||
|
private String first_category_name;
|
||||||
|
@ApiModelProperty(value = "第二级父类")
|
||||||
|
private String second_category_name;
|
||||||
|
|
||||||
|
}
|
||||||
@ -18,4 +18,6 @@ public class RedisKey {
|
|||||||
public static final String STORESHOPPRODUCTKEY="storedata:shopProductkey";
|
public static final String STORESHOPPRODUCTKEY="storedata:shopProductkey";
|
||||||
|
|
||||||
public static final String STORESHOPPRODUCITEMTKEY="storedata:shopProductItemKey";
|
public static final String STORESHOPPRODUCITEMTKEY="storedata:shopProductItemKey";
|
||||||
|
|
||||||
|
public static final String STOREDBDATAPRIORITYMODEKEY="storedbdata:priorityModeKey";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import com.suisung.mall.common.modules.sync.StoreDbConfig;
|
|||||||
import com.suisung.mall.common.modules.sync.SyncApp;
|
import com.suisung.mall.common.modules.sync.SyncApp;
|
||||||
import com.suisung.mall.core.web.service.IBaseService;
|
import com.suisung.mall.core.web.service.IBaseService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
public interface StoreDbConfigService extends IBaseService<StoreDbConfig> {
|
public interface StoreDbConfigService extends IBaseService<StoreDbConfig> {
|
||||||
|
|
||||||
@ -26,5 +28,9 @@ public interface StoreDbConfigService extends IBaseService<StoreDbConfig> {
|
|||||||
CommonResult updateStoreDbConfig(StoreDbConfig storeDbConfig);
|
CommonResult updateStoreDbConfig(StoreDbConfig storeDbConfig);
|
||||||
|
|
||||||
CommonResult delStoreDbConfig(StoreDbConfig storeDbConfig);
|
CommonResult delStoreDbConfig(StoreDbConfig storeDbConfig);
|
||||||
String getPrimaryKey(SyncApp syncApp);
|
String getPrimaryKey(SyncApp syncApp);
|
||||||
|
|
||||||
|
Map getPriorityModeCachByStoreId(Integer storeId);
|
||||||
|
|
||||||
|
void clearPriorityModeCachByStoreId(Integer storeId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,10 +19,12 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
|
import com.suisung.mall.common.enums.DicEnum;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseProductSpec;
|
import com.suisung.mall.common.modules.base.ShopBaseProductSpec;
|
||||||
import com.suisung.mall.common.modules.product.*;
|
import com.suisung.mall.common.modules.product.*;
|
||||||
import com.suisung.mall.common.modules.sync.ProductMapping;
|
import com.suisung.mall.common.modules.sync.ProductMapping;
|
||||||
|
|
||||||
|
import com.suisung.mall.common.modules.sync.StoreDbConfig;
|
||||||
import com.suisung.mall.common.utils.ContextUtil;
|
import com.suisung.mall.common.utils.ContextUtil;
|
||||||
import com.suisung.mall.common.utils.StringUtils;
|
import com.suisung.mall.common.utils.StringUtils;
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
@ -52,7 +54,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
|
||||||
import javax.validation.ValidationException;
|
import javax.validation.ValidationException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
@ -95,6 +96,9 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ProductMappingService productMappingService;
|
private ProductMappingService productMappingService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StoreDbConfigService storeDbConfigService;
|
||||||
|
|
||||||
@Value("${file.upload-dir}")
|
@Value("${file.upload-dir}")
|
||||||
private String uploadDir;
|
private String uploadDir;
|
||||||
|
|
||||||
@ -375,6 +379,16 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
@Override
|
@Override
|
||||||
public CommonResult syncAllProductMapping() {
|
public CommonResult syncAllProductMapping() {
|
||||||
Integer storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
Integer storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
||||||
|
QueryWrapper<StoreDbConfig> storeDbConfigQueryWrapper = new QueryWrapper<>();
|
||||||
|
storeDbConfigQueryWrapper.select("priority_mode");
|
||||||
|
storeDbConfigQueryWrapper.eq("store_id", storeId);
|
||||||
|
StoreDbConfig storeDbConfig= storeDbConfigService.getOne(storeDbConfigQueryWrapper);
|
||||||
|
if(null==storeDbConfig){
|
||||||
|
return CommonResult.failed("同步数据库配置不能为空");
|
||||||
|
}
|
||||||
|
if(DicEnum.PRIORITY_MODE_1.getCode().equals(storeDbConfig.getPriorityMode())){
|
||||||
|
return CommonResult.failed("请设置优先方式为自动更新");
|
||||||
|
}
|
||||||
//找出范围内的规格产品
|
//找出范围内的规格产品
|
||||||
QueryWrapper<ShopProductBase> queryWrapper= new QueryWrapper<>();
|
QueryWrapper<ShopProductBase> queryWrapper= new QueryWrapper<>();
|
||||||
queryWrapper.eq("product_state_id", StateCode.PRODUCT_STATE_OFF_THE_SHELF_UNCHECK);
|
queryWrapper.eq("product_state_id", StateCode.PRODUCT_STATE_OFF_THE_SHELF_UNCHECK);
|
||||||
|
|||||||
@ -12,16 +12,16 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.enums.DicEnum;
|
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||||
import com.suisung.mall.common.modules.sync.StoreDbConfig;
|
import com.suisung.mall.common.modules.sync.StoreDbConfig;
|
||||||
import com.suisung.mall.common.modules.sync.SyncApp;
|
import com.suisung.mall.common.modules.sync.SyncApp;
|
||||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
|
||||||
import com.suisung.mall.common.utils.ContextUtil;
|
import com.suisung.mall.common.utils.ContextUtil;
|
||||||
import com.suisung.mall.common.utils.StringUtils;
|
import com.suisung.mall.common.utils.StringUtils;
|
||||||
|
import com.suisung.mall.core.web.service.RedisService;
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import com.suisung.mall.shop.sync.Utils.CryptoUtils;
|
import com.suisung.mall.shop.sync.Utils.CryptoUtils;
|
||||||
|
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
||||||
import com.suisung.mall.shop.sync.mapper.StoreDbConfigMapper;
|
import com.suisung.mall.shop.sync.mapper.StoreDbConfigMapper;
|
||||||
import com.suisung.mall.shop.sync.service.StoreDbConfigService;
|
import com.suisung.mall.shop.sync.service.StoreDbConfigService;
|
||||||
|
|
||||||
@ -29,7 +29,8 @@ import com.suisung.mall.shop.sync.service.SyncAppService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.swing.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.suisung.mall.common.utils.ContextUtil.getStoreId;
|
import static com.suisung.mall.common.utils.ContextUtil.getStoreId;
|
||||||
@ -43,6 +44,9 @@ public class StoreDbConfigServiceImpl extends BaseServiceImpl<StoreDbConfigMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SyncAppService syncAppService;
|
private SyncAppService syncAppService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult findStoreDbConfigPageList(StoreDbConfig storeDbConfig,Integer pageNum,Integer pageSize) {
|
public CommonResult findStoreDbConfigPageList(StoreDbConfig storeDbConfig,Integer pageNum,Integer pageSize) {
|
||||||
|
|
||||||
@ -193,4 +197,28 @@ public class StoreDbConfigServiceImpl extends BaseServiceImpl<StoreDbConfigMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map getPriorityModeCachByStoreId(Integer storeId) {
|
||||||
|
String key= RedisKey.STOREDBDATAPRIORITYMODEKEY+":"+storeId;
|
||||||
|
if(redisService.get(key)!=null){
|
||||||
|
return (Map)redisService.get(key);
|
||||||
|
}
|
||||||
|
QueryWrapper<StoreDbConfig> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id", storeId);
|
||||||
|
queryWrapper.select("priority_mode");
|
||||||
|
StoreDbConfig dbConfig= this.getOne(queryWrapper);
|
||||||
|
Map map=new HashMap();
|
||||||
|
map.put(String.valueOf(storeId),dbConfig.getPriorityMode());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearPriorityModeCachByStoreId(Integer storeId) {
|
||||||
|
String key= RedisKey.STOREDBDATAPRIORITYMODEKEY+":"+storeId;
|
||||||
|
if(redisService.get(key)!=null){
|
||||||
|
redisService.del(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@ -36,24 +35,19 @@ import com.suisung.mall.common.pojo.dto.LibraryProductDTO;
|
|||||||
import com.suisung.mall.common.pojo.req.SyncThirdMemberReq;
|
import com.suisung.mall.common.pojo.req.SyncThirdMemberReq;
|
||||||
import com.suisung.mall.common.utils.DateTimeUtils;
|
import com.suisung.mall.common.utils.DateTimeUtils;
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.common.utils.JsonUtil;
|
|
||||||
import com.suisung.mall.common.utils.StringUtils;
|
import com.suisung.mall.common.utils.StringUtils;
|
||||||
|
import com.suisung.mall.common.utils.phone.PhoneNumberUtils;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductBrandService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductBrandService;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductSpecService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductSpecService;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductTypeService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductTypeService;
|
||||||
import com.suisung.mall.shop.library.service.LibraryProductImageService;
|
|
||||||
import com.suisung.mall.shop.library.service.LibraryProductService;
|
import com.suisung.mall.shop.library.service.LibraryProductService;
|
||||||
import com.suisung.mall.shop.number.service.ShopNumberSeqService;
|
import com.suisung.mall.shop.number.service.ShopNumberSeqService;
|
||||||
import com.suisung.mall.shop.number.service.impl.ShopNumberSeqServiceImpl;
|
|
||||||
import com.suisung.mall.shop.product.service.ShopProductBaseService;
|
import com.suisung.mall.shop.product.service.ShopProductBaseService;
|
||||||
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
||||||
import com.suisung.mall.shop.product.service.impl.ShopProductBaseServiceImpl;
|
|
||||||
import com.suisung.mall.shop.product.service.impl.ShopProductItemServiceImpl;
|
|
||||||
import com.suisung.mall.shop.sixun.dto.SxGoosModel;
|
import com.suisung.mall.shop.sixun.dto.SxGoosModel;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreActivityBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreActivityBaseService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import com.suisung.mall.shop.sync.service.ProductMappingService;
|
|
||||||
import org.apache.commons.lang3.math.NumberUtils;
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -67,7 +61,6 @@ import java.util.*;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.baomidou.mybatisplus.extension.toolkit.Db.list;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public abstract class SyncBaseThirdSxAbstract{
|
public abstract class SyncBaseThirdSxAbstract{
|
||||||
@ -391,6 +384,8 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
for (SyncThirdMemberReq member : memberList) {
|
for (SyncThirdMemberReq member : memberList) {
|
||||||
// account_user_base
|
// account_user_base
|
||||||
AccountUserBase accountUserBase = new AccountUserBase();
|
AccountUserBase accountUserBase = new AccountUserBase();
|
||||||
|
String user_mobile = PhoneNumberUtils.convWithIDDCodePhoneNumber(member.getUser_mobile(), CommonConstant.IDD_ZH_CN);//+86
|
||||||
|
accountUserBase.setUser_account(user_mobile);
|
||||||
accountUserBase.setUser_account(StringUtils.generateUniqueCode(8));
|
accountUserBase.setUser_account(StringUtils.generateUniqueCode(8));
|
||||||
accountUserBase.setUser_nickname(member.getUser_nickname());
|
accountUserBase.setUser_nickname(member.getUser_nickname());
|
||||||
accountUserBase.setUser_state(2);// 状态(ENUM):0-锁定;1-未激活;2-已激活;
|
accountUserBase.setUser_state(2);// 状态(ENUM):0-锁定;1-未激活;2-已激活;
|
||||||
@ -409,7 +404,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
accountUserBase.setUser_password(SecureUtil.md5(user_salt + SecureUtil.md5(IdUtil.simpleUUID())));
|
accountUserBase.setUser_password(SecureUtil.md5(user_salt + SecureUtil.md5(IdUtil.simpleUUID())));
|
||||||
|
|
||||||
// 判断店铺是不是存在该昵称的会员了?
|
// 判断店铺是不是存在该昵称的会员了?
|
||||||
Boolean exists = accountService.existByNickname(member.getUser_nickname(), storeId);
|
Boolean exists = accountService.existByMobile(user_mobile, storeId);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -426,7 +421,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
AccountUserInfo accountUserInfo = new AccountUserInfo();
|
AccountUserInfo accountUserInfo = new AccountUserInfo();
|
||||||
accountUserInfo.setUser_id(userId);
|
accountUserInfo.setUser_id(userId);
|
||||||
accountUserInfo.setUser_type_id(0);
|
accountUserInfo.setUser_type_id(0);
|
||||||
accountUserInfo.setUser_mobile(member.getUser_mobile());
|
accountUserInfo.setUser_mobile(user_mobile);
|
||||||
accountUserInfo.setUser_level_card(member.getUser_level_card());
|
accountUserInfo.setUser_level_card(member.getUser_level_card());
|
||||||
//user_level_id
|
//user_level_id
|
||||||
accountUserInfo.setUser_level_id(1); // todo select id
|
accountUserInfo.setUser_level_id(1); // todo select id
|
||||||
@ -439,9 +434,9 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
// pay_user_resource 用户支付资源,积分,余额
|
// pay_user_resource 用户支付资源,积分,余额
|
||||||
PayUserResource payUserResource = new PayUserResource();
|
PayUserResource payUserResource = new PayUserResource();
|
||||||
payUserResource.setUser_id(userId);
|
payUserResource.setUser_id(userId);
|
||||||
payUserResource.setUser_money(member.getUser_money());
|
payUserResource.setUser_money(BigDecimal.ZERO);
|
||||||
payUserResource.setUser_money_frozen(BigDecimal.ZERO);
|
payUserResource.setUser_money_frozen(BigDecimal.ZERO);
|
||||||
payUserResource.setUser_points(member.getUser_points());
|
payUserResource.setUser_points(BigDecimal.ZERO);
|
||||||
payUserResource.setUser_points_frozen(BigDecimal.ZERO);
|
payUserResource.setUser_points_frozen(BigDecimal.ZERO);
|
||||||
success = payService.saveOrUpdatePayUserResource(payUserResource);
|
success = payService.saveOrUpdatePayUserResource(payUserResource);
|
||||||
}
|
}
|
||||||
@ -693,13 +688,13 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
shopProductItem.setItem_market_price(BigDecimal.valueOf(jsonObj.getDouble("original_price")));
|
shopProductItem.setItem_market_price(BigDecimal.valueOf(jsonObj.getDouble("original_price")));
|
||||||
//积分价
|
//积分价
|
||||||
shopProductItem.setItem_unit_points(new BigDecimal(jsonObj.getInt("points")));
|
shopProductItem.setItem_unit_points(new BigDecimal(jsonObj.getInt("points")));
|
||||||
|
shopProductItem.setItem_quantity(stock.intValue());
|
||||||
//todo 特色商品切割
|
//todo 特色商品切割
|
||||||
//负数产品判断
|
//负数产品判断
|
||||||
if(jsonObj.getInt("stock",99)<0){
|
// if(jsonObj.getInt("stock",99)<0){
|
||||||
shopProductItem.setItem_quantity(99); // 库存
|
// shopProductItem.setItem_quantity(99); // 库存
|
||||||
shopProductItem.setItem_weight(new BigDecimal("0"));//切割重量
|
// shopProductItem.setItem_weight(new BigDecimal("0"));//切割重量
|
||||||
}
|
// }
|
||||||
shopProductItem.setItem_quantity_frozen(0);
|
shopProductItem.setItem_quantity_frozen(0);
|
||||||
shopProductItem.setItem_number(jsonObj.getStr("product_number"));// SKU商家编码
|
shopProductItem.setItem_number(jsonObj.getStr("product_number"));// SKU商家编码
|
||||||
shopProductItem.setItem_barcode(jsonObj.getStr("product_barcode")); // 条形码正常情况下就是货号
|
shopProductItem.setItem_barcode(jsonObj.getStr("product_barcode")); // 条形码正常情况下就是货号
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.qcloud.cos.model.COSObjectSummary;
|
import com.qcloud.cos.model.COSObjectSummary;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
@ -60,6 +61,7 @@ import com.suisung.mall.shop.store.service.ShopStoreActivityBaseService;
|
|||||||
import com.suisung.mall.shop.sync.Utils.ActiveShopJsonUtils;
|
import com.suisung.mall.shop.sync.Utils.ActiveShopJsonUtils;
|
||||||
import com.suisung.mall.shop.sync.Utils.BigDecimalFormatter;
|
import com.suisung.mall.shop.sync.Utils.BigDecimalFormatter;
|
||||||
import com.suisung.mall.shop.sync.Utils.ThreadFileUtils;
|
import com.suisung.mall.shop.sync.Utils.ThreadFileUtils;
|
||||||
|
import com.suisung.mall.shop.sync.dto.BrandModel;
|
||||||
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
||||||
import com.suisung.mall.shop.sync.service.*;
|
import com.suisung.mall.shop.sync.service.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -167,9 +169,12 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(categoryListJSON)) {
|
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(categoryListJSON)) {
|
||||||
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
||||||
}
|
}
|
||||||
|
//用gson保证与客户端的顺序一致
|
||||||
|
List<SxCategoryModel> sxCategoryModelList=categoryListJSON.toList(SxCategoryModel.class);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String jsonStr=gson.toJson(sxCategoryModelList);
|
||||||
// 验签、appid,必要参数判断
|
// 验签、appid,必要参数判断
|
||||||
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, categoryListJSON.toString());
|
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
|
||||||
if (syncApp == null) {
|
if (syncApp == null) {
|
||||||
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
||||||
}
|
}
|
||||||
@ -202,9 +207,12 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(brandListJSON)) {
|
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(brandListJSON)) {
|
||||||
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
||||||
}
|
}
|
||||||
|
//用gson保证与客户端的顺序一致
|
||||||
|
List<BrandModel> brandModels=brandListJSON.toList(BrandModel.class);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String jsonStr=gson.toJson(brandModels);
|
||||||
// 验签、appid,必要参数判断
|
// 验签、appid,必要参数判断
|
||||||
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, brandListJSON.toString());
|
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
|
||||||
if (syncApp == null) {
|
if (syncApp == null) {
|
||||||
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
||||||
}
|
}
|
||||||
@ -266,9 +274,11 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || CollUtil.isEmpty(memberList)) {
|
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || CollUtil.isEmpty(memberList)) {
|
||||||
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
|
||||||
}
|
}
|
||||||
|
//用gson保证与客户端的顺序一致
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String jsonStr=gson.toJson(memberList);
|
||||||
// 验签、appid,必要参数判断
|
// 验签、appid,必要参数判断
|
||||||
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, JSONUtil.toJsonStr(memberList));
|
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
|
||||||
if (syncApp == null) {
|
if (syncApp == null) {
|
||||||
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
||||||
}
|
}
|
||||||
@ -451,13 +461,11 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
}
|
}
|
||||||
// 验签、appid,必要参数判断
|
// 验签、appid,必要参数判断
|
||||||
SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
|
SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
|
||||||
.select(SyncApp::getApp_key, SyncApp::getApp_secret, SyncApp::getStore_id)
|
.select(SyncApp::getApp_key, SyncApp::getStore_id)
|
||||||
.eq(SyncApp::getApp_key, appKey)
|
.eq(SyncApp::getApp_key, appKey));
|
||||||
.eq(SyncApp::getApp_secret, sign));
|
|
||||||
if (syncAppO == null) {
|
if (syncAppO == null) {
|
||||||
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
String storeId = syncAppO.getStore_id();
|
String storeId = syncAppO.getStore_id();
|
||||||
try {
|
try {
|
||||||
if (multipartFile.isEmpty()) {
|
if (multipartFile.isEmpty()) {
|
||||||
@ -469,6 +477,13 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
String filePath = FileUtils.createFolderAndFileUsingFile(folder, filName);
|
String filePath = FileUtils.createFolderAndFileUsingFile(folder, filName);
|
||||||
Path path = Paths.get(filePath);
|
Path path = Paths.get(filePath);
|
||||||
Files.write(path, bytes);
|
Files.write(path, bytes);
|
||||||
|
String jsonStr = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
|
||||||
|
//验证签名,签名不正确删除文件
|
||||||
|
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
|
||||||
|
if(syncApp == null) {
|
||||||
|
Files.delete(path);//删除文件
|
||||||
|
return new ThirdApiRes().fail(500, "文件上传失败:签名验证失败");
|
||||||
|
}
|
||||||
logger.info("path-{},parent-{},filename-{},root-{}", path, path.getParent(), path.getFileName().toString(), path.getRoot());
|
logger.info("path-{},parent-{},filename-{},root-{}", path, path.getParent(), path.getFileName().toString(), path.getRoot());
|
||||||
// String filaPath=path.toString();
|
// String filaPath=path.toString();
|
||||||
// if(filePath.contains(":")){
|
// if(filePath.contains(":")){
|
||||||
@ -603,15 +618,15 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
logger.info("执行成功{}个文件,失败{}个文件", success, fails);
|
logger.info("执行成功{}个文件,失败{}个文件", success, fails);
|
||||||
logger.info("同步商品数据执行结束");
|
logger.info("同步商品数据执行结束");
|
||||||
//更新当前的获取时间,用户客户端获取
|
//更新当前的获取时间,用户客户端获取
|
||||||
try {
|
// try {
|
||||||
|
//
|
||||||
if (ObjectUtil.isNotEmpty(storeDbConfig)) {
|
// if (ObjectUtil.isNotEmpty(storeDbConfig)) {
|
||||||
storeDbConfig.setRefreshTime(date);
|
// storeDbConfig.setRefreshTime(date);
|
||||||
storeDbConfigService.saveOrUpdate(storeDbConfig);
|
// storeDbConfigService.saveOrUpdate(storeDbConfig);
|
||||||
}
|
// }
|
||||||
} catch (RuntimeException e) {
|
// } catch (RuntimeException e) {
|
||||||
logger.error("同步时间失败" + e.getMessage());
|
// logger.error("同步时间失败" + e.getMessage());
|
||||||
}
|
// }
|
||||||
|
|
||||||
syncShopImages(Integer.valueOf(storeId));//同时商品图库数据
|
syncShopImages(Integer.valueOf(storeId));//同时商品图库数据
|
||||||
}
|
}
|
||||||
|
|||||||
2
sql/shop/dev/20250630_ddl.sql
Normal file
2
sql/shop/dev/20250630_ddl.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
alter table store_db_config add priority_mode char(1) NOT NULL DEFAULT 1 COMMENT '更新优先方式(1:手动优先,2:自动优先),自动优先时根据平台给的商品自动切分上架,更新是才发挥作用';
|
||||||
|
alter table store_db_config add index `index_priority_mode` (`priority_mode`) USING BTREE;
|
||||||
Loading…
Reference in New Issue
Block a user