Merge branch 'master' into cc_20251010_wxnotice
# Conflicts: # coolstore-partner-service/src/main/java/com/cool/store/service/impl/MessageTemplateServiceImpl.java
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
package com.cool.store.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台库数据源
|
||||||
|
*/
|
||||||
|
@Target({ElementType.METHOD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface PlatformDB {
|
||||||
|
}
|
||||||
@@ -211,5 +211,25 @@ public class CommonConstants {
|
|||||||
|
|
||||||
public static final String WX_SELF_AUTH_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
|
public static final String WX_SELF_AUTH_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码最大错误次数
|
||||||
|
*/
|
||||||
|
public static final int MAX_ERROR_PASSWORD_COUNT = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户密码
|
||||||
|
*/
|
||||||
|
public static final String USER_AUTH_KEY = "user_auth_key";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* accessToken有效期,单位秒
|
||||||
|
*/
|
||||||
|
public static final int ACTION_TOKEN_EXPIRE = 24 * 60 * 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* refreshToken有效期,单位秒
|
||||||
|
*/
|
||||||
|
public static final int REFRESH_TOKEN_EXPIRE = 30 * 24 * 60 * 60;
|
||||||
|
|
||||||
|
public static final int BATCH_SIZE = 200;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.cool.store.datasource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源上下文
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
public class DataSourceContextHolder {
|
||||||
|
private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();
|
||||||
|
|
||||||
|
public static void setDataSourceType(String dataSourceType) {
|
||||||
|
contextHolder.set(dataSourceType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDataSourceType() {
|
||||||
|
return contextHolder.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearDataSourceType() {
|
||||||
|
contextHolder.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.cool.store.datasource;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.jdbc.datasource.AbstractDataSource;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 动态数据源
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Primary
|
||||||
|
public class DynamicDataSource extends AbstractDataSource {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource defaultDataSource;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource platformDataSource;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Connection getConnection() throws SQLException {
|
||||||
|
DataSource currentDB = getCurrentDB();
|
||||||
|
return currentDB.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Connection getConnection(String username, String password) throws SQLException {
|
||||||
|
DataSource currentDB = getCurrentDB();
|
||||||
|
Connection connection = currentDB.getConnection(username, password);
|
||||||
|
connection.setCatalog(DataSourceContextHolder.getDataSourceType());
|
||||||
|
return connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DataSource getCurrentDB() {
|
||||||
|
String dbName = DataSourceContextHolder.getDataSourceType();
|
||||||
|
if (StringUtils.isBlank(dbName)) {
|
||||||
|
return defaultDataSource;
|
||||||
|
}
|
||||||
|
return platformDataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ public enum ErrorCodeEnum {
|
|||||||
LOGIN_ERROR(400004, "登录失败", null),
|
LOGIN_ERROR(400004, "登录失败", null),
|
||||||
ENTERPRISE_INIT(400006, "企业正在初始化,请稍后访问!",null),
|
ENTERPRISE_INIT(400006, "企业正在初始化,请稍后访问!",null),
|
||||||
NOT_AUTH(400007, "暂无权限,请联系管理员!", null),
|
NOT_AUTH(400007, "暂无权限,请联系管理员!", null),
|
||||||
|
REFRESH_TOKEN_INVALID(400008, "refresh token invalid", null),
|
||||||
USER_FREEZE(1021019,"账号被冻结,请联系管理员",null),
|
USER_FREEZE(1021019,"账号被冻结,请联系管理员",null),
|
||||||
ENTERPRISE_NOT_EXIST(1021020,"企业不存在",null),
|
ENTERPRISE_NOT_EXIST(1021020,"企业不存在",null),
|
||||||
USER_NOT_EXIST(1021021,"用户不存在",null),
|
USER_NOT_EXIST(1021021,"用户不存在",null),
|
||||||
@@ -62,6 +63,11 @@ public enum ErrorCodeEnum {
|
|||||||
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
||||||
PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
|
PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
|
||||||
LOGIN_ERROR_MOBILE_ERROR(418, "登录失败 获取手机号失败!!", null),
|
LOGIN_ERROR_MOBILE_ERROR(418, "登录失败 获取手机号失败!!", null),
|
||||||
|
PASSWORD_ERROR_MAX_COUNT(1021084, "密码错误{0}次,今日账号已锁定",null),
|
||||||
|
PASSWORD_MISSING(1021085, "密码不能为空!",null),
|
||||||
|
IMPROVE_USER_INFO(1021086,"请联系管理员,完善用户信息!",null),
|
||||||
|
PASSWORD_ERROR(1021087, "密码输入错误",null),
|
||||||
|
PASSWORD_ERROR_MULTI(1021088, "密码错误{0}次,请使用验证码登录",null),
|
||||||
//红圈通
|
//红圈通
|
||||||
HQT_SHOP_DECORATION_ATTRIBUTES(1022000, "获取红圈通装修属性错误", null),
|
HQT_SHOP_DECORATION_ATTRIBUTES(1022000, "获取红圈通装修属性错误", null),
|
||||||
HQT_PARAMS_ERROR(1022001, "构建红圈通请求参数错误", null),
|
HQT_PARAMS_ERROR(1022001, "构建红圈通请求参数错误", null),
|
||||||
@@ -306,6 +312,7 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
NOT_FLAGSHIP_STORE(16100005,"非直营店,无法跳过缴费阶段!",null),
|
NOT_FLAGSHIP_STORE(16100005,"非直营店,无法跳过缴费阶段!",null),
|
||||||
NOT_FLAGSHIP_STORE_NOT_EXIST(16100006,"当前阶段加盟类型不能变更!",null),
|
NOT_FLAGSHIP_STORE_NOT_EXIST(16100006,"当前阶段加盟类型不能变更!",null),
|
||||||
|
JOIN_MODE_NOT_ALLOW_OPERATE(16100007,"加盟部人员只能新建加盟店或联营店,请确认!",null),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,4 +38,10 @@ public enum JoinModeEnum {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 是否是加盟部加盟店或者联营店 如果不是 返回false
|
||||||
|
*/
|
||||||
|
public static boolean isFranchise(Integer code) {
|
||||||
|
return code == FRANCHISE_DEPARTMENT.code || code == AFFILIATES.code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录类型 枚举类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum LoginTypeEnum {
|
||||||
|
|
||||||
|
PASSWORD("账号密码", "passwordLoginServiceImpl"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
private final String clazzName;
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ public enum MatterTypeEnum {
|
|||||||
SERVICE_PACKAGE(4,"服务包"),
|
SERVICE_PACKAGE(4,"服务包"),
|
||||||
RESTOCK(5,"补货"),
|
RESTOCK(5,"补货"),
|
||||||
INVENTORY(6,"盘点"),
|
INVENTORY(6,"盘点"),
|
||||||
|
REALTIME(7, "即时消息"),
|
||||||
;
|
;
|
||||||
|
|
||||||
MatterTypeEnum(Integer code, String message) {
|
MatterTypeEnum(Integer code, String message) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public enum ModuleCodeEnum {
|
|||||||
DISH(3,"菜品",Arrays.asList(MatterTypeEnum.NOTICE)),
|
DISH(3,"菜品",Arrays.asList(MatterTypeEnum.NOTICE)),
|
||||||
FRANCHISE(4,"加盟",Arrays.asList(MatterTypeEnum.NOTICE)),
|
FRANCHISE(4,"加盟",Arrays.asList(MatterTypeEnum.NOTICE)),
|
||||||
//其他(投诉与客户服务、临时通知)
|
//其他(投诉与客户服务、临时通知)
|
||||||
OTHER(5,"其他",Arrays.asList(MatterTypeEnum.NOTICE)),
|
OTHER(5,"其他",Arrays.asList(MatterTypeEnum.NOTICE, MatterTypeEnum.REALTIME)),
|
||||||
;
|
;
|
||||||
|
|
||||||
ModuleCodeEnum(Integer code, String message,List<MatterTypeEnum> matterTypeEnums) {
|
ModuleCodeEnum(Integer code, String message,List<MatterTypeEnum> matterTypeEnums) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public enum SceneEnum {
|
|||||||
RESTOCK(35, "补货", "", MatterTypeEnum.LOGISTICS),
|
RESTOCK(35, "补货", "", MatterTypeEnum.LOGISTICS),
|
||||||
INVENTORY(40, "盘点", "", MatterTypeEnum.LOGISTICS),
|
INVENTORY(40, "盘点", "", MatterTypeEnum.LOGISTICS),
|
||||||
|
|
||||||
|
REALTIME(45, "即时消息", "", MatterTypeEnum.REALTIME),
|
||||||
;
|
;
|
||||||
|
|
||||||
private Integer sceneCode;
|
private Integer sceneCode;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.cool.store.executor;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.task.TaskExecutor;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 线程池配置类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/5
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class ThreadPoolTaskConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用线程池
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public TaskExecutor generalThreadPool() {
|
||||||
|
int cores = Runtime.getRuntime().availableProcessors();
|
||||||
|
|
||||||
|
ThreadPoolTaskExecutor executor = new MdcTaskExecutor();
|
||||||
|
// 核心线程数目
|
||||||
|
executor.setCorePoolSize(cores*2);
|
||||||
|
// 指定最大线程数
|
||||||
|
executor.setMaxPoolSize(200);
|
||||||
|
// 队列中最大的数目
|
||||||
|
executor.setQueueCapacity(5000);
|
||||||
|
// 线程名称前缀
|
||||||
|
executor.setThreadNamePrefix("generalThreadPool_");
|
||||||
|
// 对拒绝task的处理策略
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
// 线程空闲后的最大存活时间
|
||||||
|
executor.setKeepAliveSeconds(60);
|
||||||
|
// 加载
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.utils;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* bean转换工具
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/3/6
|
||||||
|
*/
|
||||||
|
public class BeanUtil extends cn.hutool.core.bean.BeanUtil {
|
||||||
|
|
||||||
|
public static <T, R> List<R> toList(List<T> list, Class<R> clazz) {
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<R> result = new ArrayList<>(list.size());
|
||||||
|
for (T t : list) {
|
||||||
|
R r = toBean(t, clazz);
|
||||||
|
result.add(r);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T, R> PageInfo<R> toPage(PageInfo<T> page, Class<R> clazz) {
|
||||||
|
PageInfo<R> newPage = new PageInfo<>();
|
||||||
|
newPage.setPages(page.getPages());
|
||||||
|
newPage.setTotal(page.getTotal());
|
||||||
|
newPage.setPageNum(page.getPageNum());
|
||||||
|
newPage.setPageSize(page.getPageSize());
|
||||||
|
List<R> list = toList(page.getList(), clazz);
|
||||||
|
newPage.setList(list);
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.cool.store.utils;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Spring上下文工具
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SpringContextUtil implements ApplicationContextAware {
|
||||||
|
private static ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
SpringContextUtil.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取bean
|
||||||
|
* @param name beanName
|
||||||
|
* @param clazz bean类型
|
||||||
|
* @return bean
|
||||||
|
*/
|
||||||
|
public static <T> T getBean(String name, Class<T> clazz) {
|
||||||
|
return applicationContext.getBean(name, clazz);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,8 +4,8 @@ import com.cool.store.constants.CommonConstants;
|
|||||||
import com.cool.store.dto.UserDTO;
|
import com.cool.store.dto.UserDTO;
|
||||||
import com.cool.store.dto.openPreparation.UserNameDTO;
|
import com.cool.store.dto.openPreparation.UserNameDTO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
|
import com.cool.store.entity.login.UserLoginDO;
|
||||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||||
import com.cool.store.response.oppty.UserResponse;
|
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -175,4 +175,13 @@ public class EnterpriseUserDAO {
|
|||||||
}
|
}
|
||||||
return enterpriseUserMapper.searchUserByUserIdsAndKeyword(userIdList, keyword);
|
return enterpriseUserMapper.searchUserByUserIdsAndKeyword(userIdList, keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从平台库根据唯一id获取用户登录信息
|
||||||
|
* @param unionid 唯一id
|
||||||
|
* @return 用户登录信息
|
||||||
|
*/
|
||||||
|
public UserLoginDO getUserLoginByUnionid(String unionid) {
|
||||||
|
return enterpriseUserMapper.getUserLoginByUnionid(unionid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||||
import com.cool.store.entity.StoreDO;
|
import com.cool.store.entity.StoreDO;
|
||||||
import com.cool.store.mapper.StoreMapper;
|
import com.cool.store.mapper.StoreMapper;
|
||||||
import com.cool.store.response.MiniShopsResponse;
|
import com.cool.store.response.MiniShopsResponse;
|
||||||
@@ -83,4 +84,22 @@ public class StoreDao {
|
|||||||
return storeMapper.getStoreNumByStoreCodes(storeCodeIds);
|
return storeMapper.getStoreNumByStoreCodes(storeCodeIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或编辑最新订货时间
|
||||||
|
* @param dtoList 门店最新订货时间DTO列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public void batchInsertOrUpdateOrderTime(List<StoreOrderTimeDTO> dtoList) {
|
||||||
|
if (CollectionUtils.isEmpty(dtoList)) {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
storeMapper.batchInsertOrUpdateOrderTime(dtoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有门店id和门店编码
|
||||||
|
*/
|
||||||
|
public List<StoreDO> getAllStoreIdAndNum(List<String> storeStatus) {
|
||||||
|
return storeMapper.getAllStoreIdAndNum(storeStatus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.PlatformDB;
|
||||||
import com.cool.store.dto.UserDTO;
|
import com.cool.store.dto.UserDTO;
|
||||||
import com.cool.store.dto.openPreparation.UserNameDTO;
|
import com.cool.store.dto.openPreparation.UserNameDTO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
|
import com.cool.store.entity.login.UserLoginDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -103,4 +105,12 @@ public interface EnterpriseUserMapper {
|
|||||||
List<EnterpriseUserDO> searchUserByUserIdsAndKeyword( @Param("userIdList") List<String> userIdList, @Param("keyword") String keyword);
|
List<EnterpriseUserDO> searchUserByUserIdsAndKeyword( @Param("userIdList") List<String> userIdList, @Param("keyword") String keyword);
|
||||||
|
|
||||||
List<String> getUserIdsByRegionIdList( @Param("regionIdList") List<String> regionIdList);
|
List<String> getUserIdsByRegionIdList( @Param("regionIdList") List<String> regionIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从平台库根据唯一id获取用户登录信息
|
||||||
|
* @param unionid 唯一id
|
||||||
|
* @return 用户登录信息
|
||||||
|
*/
|
||||||
|
@PlatformDB
|
||||||
|
UserLoginDO getUserLoginByUnionid(@Param("unionid") String unionid);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.dto.store.StoreAreaDTO;
|
import com.cool.store.dto.store.StoreAreaDTO;
|
||||||
|
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||||
import com.cool.store.entity.StoreDO;
|
import com.cool.store.entity.StoreDO;
|
||||||
import com.cool.store.response.MiniShopsResponse;
|
import com.cool.store.response.MiniShopsResponse;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -47,4 +48,15 @@ public interface StoreMapper {
|
|||||||
|
|
||||||
List<StoreAreaDTO> listStoreByRegionPathList(@Param("regionPathList") List<String> regionPathList);
|
List<StoreAreaDTO> listStoreByRegionPathList(@Param("regionPathList") List<String> regionPathList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增或编辑最新订货时间
|
||||||
|
* @param dtoList 门店最新订货时间DTO列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int batchInsertOrUpdateOrderTime(@Param("dtoList") List<StoreOrderTimeDTO> dtoList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有门店id和门店编码
|
||||||
|
*/
|
||||||
|
List<StoreDO> getAllStoreIdAndNum(@Param("storeStatus") List<String> storeStatus);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, user_id, name, remark, mobile, email, main_admin, is_admin, unionid,
|
id, user_id, name, remark, mobile, email, main_admin, is_admin, unionid,departments,
|
||||||
avatar, jobnumber, is_leader, is_leader_in_depts, face_url, user_status, create_time,
|
avatar, jobnumber, is_leader, is_leader_in_depts, face_url, user_status, create_time,
|
||||||
third_oa_unique_flag
|
third_oa_unique_flag
|
||||||
</sql>
|
</sql>
|
||||||
@@ -235,4 +235,10 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserLoginByUnionid" resultType="com.cool.store.entity.login.UserLoginDO">
|
||||||
|
SELECT user_id, mobile, password
|
||||||
|
FROM enterprise_user
|
||||||
|
WHERE unionid = #{unionid} AND active = true
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -222,4 +222,37 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="batchInsertOrUpdateOrderTime">
|
||||||
|
INSERT INTO store_extend_info_${enterpriseId}
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
store_id,
|
||||||
|
latest_order_time
|
||||||
|
</trim>
|
||||||
|
VALUES
|
||||||
|
<foreach collection="dtoList" item="dto" separator=",">
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{dto.storeId},
|
||||||
|
#{dto.latestOrderTime}
|
||||||
|
</trim>
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
store_id = VALUES(store_id),
|
||||||
|
latest_order_time = VALUES(latest_order_time),
|
||||||
|
update_time = now(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="getAllStoreIdAndNum" resultType="com.cool.store.entity.StoreDO">
|
||||||
|
SELECT store_id, store_num
|
||||||
|
FROM store_${enterpriseId}
|
||||||
|
WHERE is_delete = 'effective'
|
||||||
|
<if test="storeStatus != null and !storeStatus.isEmpty()">
|
||||||
|
AND store_status IN
|
||||||
|
<foreach item="item" collection="storeStatus" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<result column="operator_list" property="operatorList" />
|
<result column="operator_list" property="operatorList" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insertBatch" parameterType="java.util.List">
|
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO zxjp_store_message (
|
INSERT INTO zxjp_store_message (
|
||||||
store_id,
|
store_id,
|
||||||
store_code,
|
store_code,
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.cool.store.dto.login;
|
||||||
|
|
||||||
|
import com.cool.store.enums.LoginTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserLoginDTO {
|
||||||
|
@ApiModelProperty("手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@NotNull(message = "登录类型不能为空")
|
||||||
|
private LoginTypeEnum loginType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.cool.store.dto.login;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* RefreshToken登录DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserRefreshLoginDTO {
|
||||||
|
@ApiModelProperty("RefreshToken")
|
||||||
|
private String refreshToken;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.cool.store.dto.store;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 门店最新订货时间DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/10/23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class StoreOrderTimeDTO {
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("最新订货时间")
|
||||||
|
private Date latestOrderTime;
|
||||||
|
}
|
||||||
@@ -5,7 +5,10 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
@@ -18,6 +21,9 @@ import javax.validation.constraints.NotBlank;
|
|||||||
*/
|
*/
|
||||||
@Table(name = "xfsg_build_information")
|
@Table(name = "xfsg_build_information")
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class BuildInformationDO {
|
public class BuildInformationDO {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.entity.login;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户登录信息
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserLoginDO {
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@@ -49,6 +49,12 @@ public class StoreMasterDTO {
|
|||||||
|
|
||||||
@ApiModelProperty("省市区")
|
@ApiModelProperty("省市区")
|
||||||
private String area;
|
private String area;
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
@ApiModelProperty("区/县")
|
||||||
|
private String district;
|
||||||
@ApiModelProperty("乡镇")
|
@ApiModelProperty("乡镇")
|
||||||
private String town;
|
private String town;
|
||||||
@ApiModelProperty("门店地址")
|
@ApiModelProperty("门店地址")
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.request.bigdata;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 最新订货日期Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/10/23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LatestOrderDateRequest {
|
||||||
|
/**
|
||||||
|
* 页码
|
||||||
|
*/
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页数量
|
||||||
|
*/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店编码列表
|
||||||
|
*/
|
||||||
|
private String store_code;
|
||||||
|
}
|
||||||
@@ -22,4 +22,6 @@ public class BatchPublishRequest {
|
|||||||
@ApiModelProperty( "默认处理人信息 type[person position userGroup organization]")
|
@ApiModelProperty( "默认处理人信息 type[person position userGroup organization]")
|
||||||
List<CommonDTO> userInfoList;
|
List<CommonDTO> userInfoList;
|
||||||
|
|
||||||
|
@ApiModelProperty("事项类型")
|
||||||
|
private Integer matterType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cool.store.response.bigdata;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页对象
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/10/27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ApiPageResponse<T> {
|
||||||
|
private Integer total;
|
||||||
|
private List<T> list;
|
||||||
|
private Integer pageNum;
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.cool.store.response.bigdata;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 最新订货日期Response
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/10/23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class LatestOrderDateResponse {
|
||||||
|
/**
|
||||||
|
* 门店编码
|
||||||
|
*/
|
||||||
|
private String store_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最新订货日期,yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
private String latest_buy_date;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.userholder;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* RefreshToken用户信息
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class RefreshUser {
|
||||||
|
/**
|
||||||
|
* 用户Id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RefreshToken
|
||||||
|
*/
|
||||||
|
private String refreshToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.cool.store.vo.login;
|
||||||
|
|
||||||
|
import com.cool.store.entity.SysRoleDO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录用户基本信息VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserBaseInfoVO {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Boolean isAdmin;
|
||||||
|
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
private String roles;
|
||||||
|
|
||||||
|
private String language;
|
||||||
|
|
||||||
|
private SysRoleDO sysRoleDO;
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.cool.store.vo.login;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户登录VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserLoginVO {
|
||||||
|
/**
|
||||||
|
* 登录token
|
||||||
|
*/
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新token
|
||||||
|
*/
|
||||||
|
private String refreshToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* accessToken过期时间
|
||||||
|
*/
|
||||||
|
private Integer expire;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*/
|
||||||
|
private UserBaseInfoVO user;
|
||||||
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.userholder.CurrentUser;
|
||||||
|
import com.cool.store.userholder.RefreshUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
* @Date 2025/5/29 16:34
|
* @Date 2025/5/29 16:34
|
||||||
@@ -13,7 +16,17 @@ public interface EnterpriseService {
|
|||||||
* @param mobile
|
* @param mobile
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getAccessToken(String mobile);
|
CurrentUser getLoginInfo(String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取并缓存refreshToken
|
||||||
|
*/
|
||||||
|
RefreshUser getRefreshUser(String userId, String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验用户新建分店/新建线索 可以选择加盟类型类型
|
||||||
|
* @param userId
|
||||||
|
* @param joinMode
|
||||||
|
*/
|
||||||
|
void checkUser(String userId,Integer joinMode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,15 +91,15 @@ public interface MessageTemplateService {
|
|||||||
*/
|
*/
|
||||||
Boolean revokeById(Long id, LoginUserInfo user);
|
Boolean revokeById(Long id, LoginUserInfo user);
|
||||||
|
|
||||||
List<ModuleAndMatterVO> getModuleList(String storeId,PartnerUserInfoVO userInfoVO);
|
List<ModuleAndMatterVO> getModuleList(String storeId,String mobile);
|
||||||
|
|
||||||
PageInfo<StoreMessageVO> getStorePendingList(StoreMessagePendingRequest request);
|
PageInfo<StoreMessageVO> getStorePendingList(StoreMessagePendingRequest request);
|
||||||
|
|
||||||
MessageDetailVO getMessageDetail(Long id);
|
MessageDetailVO getMessageDetail(Long id);
|
||||||
|
|
||||||
Boolean readMessage(Long id, PartnerUserInfoVO userInfoVO);
|
Boolean readMessage(Long id, String mobile);
|
||||||
|
|
||||||
Boolean handleMessage(Long id, PartnerUserInfoVO userInfoVO);
|
Boolean handleMessage(Long id, String userName,String mobile);
|
||||||
|
|
||||||
|
|
||||||
ApiResponse<Boolean> thirdHandleMessage(ThirdHandleMessageRequest request);
|
ApiResponse<Boolean> thirdHandleMessage(ThirdHandleMessageRequest request);
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ public interface PreparationService {
|
|||||||
* @param shopId
|
* @param shopId
|
||||||
*/
|
*/
|
||||||
void sysStoreCompleted(Long shopId);
|
void sysStoreCompleted(Long shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照和建店资料收集阶段完成后推进POS和营帐通开通
|
||||||
|
* @param shopId 店铺id
|
||||||
|
*/
|
||||||
|
void businessLicenseAndBuildStoreCompleted(Long shopId);
|
||||||
/**
|
/**
|
||||||
* 证照办理+建店资料 都完成 初始化平台建店数据
|
* 证照办理+建店资料 都完成 初始化平台建店数据
|
||||||
* @param shopId
|
* @param shopId
|
||||||
@@ -89,6 +95,7 @@ public interface PreparationService {
|
|||||||
/**
|
/**
|
||||||
* POS 建店昨天完成
|
* POS 建店昨天完成
|
||||||
* 选址与建店资料完成(加盟合同完成)
|
* 选址与建店资料完成(加盟合同完成)
|
||||||
|
* v20251024 选址与建店资料完成与营业执照完成
|
||||||
* @param shopId
|
* @param shopId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||||
import com.cool.store.request.bigdata.ProfitDataRequest;
|
import com.cool.store.request.bigdata.ProfitDataRequest;
|
||||||
import com.cool.store.request.oppty.CityRequest;
|
import com.cool.store.request.oppty.CityRequest;
|
||||||
import com.cool.store.response.bigdata.ActDataResponse;
|
import com.cool.store.response.bigdata.ActDataResponse;
|
||||||
|
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
||||||
import com.cool.store.response.bigdata.ProfitDataResponse;
|
import com.cool.store.response.bigdata.ProfitDataResponse;
|
||||||
import com.cool.store.response.bigdata.ProfitRateResponse;
|
import com.cool.store.response.bigdata.ProfitRateResponse;
|
||||||
import com.cool.store.response.oppty.CityResponse;
|
import com.cool.store.response.oppty.CityResponse;
|
||||||
@@ -53,5 +55,11 @@ public interface ThirdBigDataService {
|
|||||||
*/
|
*/
|
||||||
ActDataResponse getActData(ProfitDataRequest requestBody);
|
ActDataResponse getActData(ProfitDataRequest requestBody);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取门店最新订货日期
|
||||||
|
* @param requestBody 最新订货日期Request
|
||||||
|
* @return 最新订货日期Response列表
|
||||||
|
*/
|
||||||
|
List<LatestOrderDateResponse> getLatestOrderDate(LatestOrderDateRequest requestBody);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,9 +138,11 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_3);
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_3);
|
||||||
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus())) {
|
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus())) {
|
||||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33, null);
|
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33, null);
|
||||||
|
preparationService.businessLicenseAndBuildStoreCompleted(request.getShopId());
|
||||||
preparationService.licenseCompleted(request.getShopId());
|
preparationService.licenseCompleted(request.getShopId());
|
||||||
preparationService.updateShopStatus(request.getShopId());
|
preparationService.updateShopStatus(request.getShopId());
|
||||||
preparationService.buildStoreAndDecorationComplete(request.getShopId());
|
preparationService.buildStoreAndDecorationComplete(request.getShopId());
|
||||||
|
preparationService.selectSiteAndBuildStoreComplete(request.getShopId());
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public class BuildInformationServiceImpl implements BuildInformationService {
|
|||||||
private OrderSysInfoDAO orderSysInfoDAO;
|
private OrderSysInfoDAO orderSysInfoDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BigRegionDAO bigRegionDAO;
|
private BigRegionDAO bigRegionDAO;
|
||||||
|
@Resource
|
||||||
|
private AcceptanceInfoDAO acceptanceInfoDAO;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -252,7 +254,14 @@ public class BuildInformationServiceImpl implements BuildInformationService {
|
|||||||
if (StringUtils.isBlank(response.getAddresseeAddress())) {
|
if (StringUtils.isBlank(response.getAddresseeAddress())) {
|
||||||
response.setAddresseeAddress(shopInfo.getDetailAddress());
|
response.setAddresseeAddress(shopInfo.getDetailAddress());
|
||||||
}
|
}
|
||||||
|
// 不存在的情况下从装修验收中获取
|
||||||
|
if (StringUtils.isBlank(response.getDoorPhoto()) || StringUtils.isBlank(response.getInStorePhoto())) {
|
||||||
|
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||||
|
if (Objects.nonNull(acceptanceInfoDO)) {
|
||||||
|
response.setDoorPhoto(StringUtils.isNotBlank(response.getDoorPhoto()) ? response.getDoorPhoto() : acceptanceInfoDO.getShopDoorwayPhoto());
|
||||||
|
response.setInStorePhoto(StringUtils.isNotBlank(response.getInStorePhoto()) ? response.getInStorePhoto() : acceptanceInfoDO.getShopInteriorPhoto());
|
||||||
|
}
|
||||||
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
@@ -10,14 +12,12 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.service.DecorationDesignInfoService;
|
import com.cool.store.service.DecorationDesignInfoService;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,6 +40,8 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|||||||
private ShopStageInfoDAO shopStageInfoDAO;
|
private ShopStageInfoDAO shopStageInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
private LineInfoDAO lineInfoDAO;
|
private LineInfoDAO lineInfoDAO;
|
||||||
|
@Resource
|
||||||
|
private BuildInformationDAO buildInformationDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -277,8 +279,28 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|||||||
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())) {
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())) {
|
||||||
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
||||||
}
|
}
|
||||||
|
// 覆盖建店资料中的门头照和内景照
|
||||||
|
BuildInformationDO buildInformation = BuildInformationDO.builder().shopId(request.getShopId()).doorPhoto(buildJson(request.getShopDoorwayPhotoUrl()))
|
||||||
|
.inStorePhoto(buildJson(request.getShopInteriorPhotoUrl())).build();
|
||||||
|
buildInformationDAO.updateByShopIdSelective(buildInformation);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String buildJson(List<String> urls) {
|
||||||
|
if (CollectionUtils.isEmpty(urls)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
for (String url : urls) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("url", url);
|
||||||
|
jsonObject.put("type", extractImageSuffix(url));
|
||||||
|
jsonArray.add(jsonObject);
|
||||||
|
}
|
||||||
|
return jsonArray.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String extractImageSuffix(String url) {
|
||||||
|
return url.substring(url.lastIndexOf(".") + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.constants.RedisConstant;
|
import com.cool.store.constants.RedisConstant;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.entity.SysRoleDO;
|
import com.cool.store.entity.SysRoleDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.JoinModeEnum;
|
||||||
import com.cool.store.enums.Role;
|
import com.cool.store.enums.Role;
|
||||||
import com.cool.store.enums.UserStatusEnum;
|
import com.cool.store.enums.UserStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.SysRoleMapper;
|
import com.cool.store.mapper.SysRoleMapper;
|
||||||
import com.cool.store.service.EnterpriseService;
|
import com.cool.store.service.EnterpriseService;
|
||||||
import com.cool.store.userholder.CurrentUser;
|
import com.cool.store.userholder.CurrentUser;
|
||||||
|
import com.cool.store.userholder.RefreshUser;
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.utils.poi.DateUtils;
|
import com.cool.store.utils.poi.DateUtils;
|
||||||
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.crypto.RandomNumberGenerator;
|
import org.apache.shiro.crypto.RandomNumberGenerator;
|
||||||
@@ -48,7 +52,7 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|||||||
private String eid;
|
private String eid;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAccessToken(String mobile) {
|
public CurrentUser getLoginInfo(String mobile) {
|
||||||
CurrentUser currentUser = new CurrentUser();
|
CurrentUser currentUser = new CurrentUser();
|
||||||
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.selectByMobile(mobile);
|
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.selectByMobile(mobile);
|
||||||
if (Objects.isNull(enterpriseUser)){
|
if (Objects.isNull(enterpriseUser)){
|
||||||
@@ -107,8 +111,36 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|||||||
currentUser.setAppType("qw_self_dkf");
|
currentUser.setAppType("qw_self_dkf");
|
||||||
currentUser.setUnionid(enterpriseUser.getUnionid());
|
currentUser.setUnionid(enterpriseUser.getUnionid());
|
||||||
currentUser.setUserType(enterpriseUser.getUserType());
|
currentUser.setUserType(enterpriseUser.getUserType());
|
||||||
redisUtilPool.setString(RedisConstant.ACCESS_TOKEN_PREFIX + currentUser.getAccessToken(), JSON.toJSONString(currentUser), 24 * 60 * 60);
|
redisUtilPool.setString(RedisConstant.ACCESS_TOKEN_PREFIX + currentUser.getAccessToken(), JSON.toJSONString(currentUser), CommonConstants.ACTION_TOKEN_EXPIRE);
|
||||||
return currentUser.getAccessToken();
|
return currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RefreshUser getRefreshUser(String userId, String mobile) {
|
||||||
|
if (StringUtils.isBlank(mobile)) {
|
||||||
|
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(userId);
|
||||||
|
mobile = userInfo.getMobile();
|
||||||
|
}
|
||||||
|
String refreshToken = getToken();
|
||||||
|
RefreshUser refreshUser = new RefreshUser(userId, refreshToken, mobile);
|
||||||
|
redisUtilPool.setString(RedisConstant.REFRESH_TOKEN_PREFIX + refreshToken, JSON.toJSONString(refreshUser), CommonConstants.REFRESH_TOKEN_EXPIRE);
|
||||||
|
return refreshUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkUser(String userId,Integer joinMode) {
|
||||||
|
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(userId);
|
||||||
|
if (userInfo !=null){
|
||||||
|
//校验当前人员是否是加盟部 581
|
||||||
|
String departments = userInfo.getDepartments();
|
||||||
|
//如果departments包含/581/ 加盟部
|
||||||
|
if (com.cool.store.utils.poi.StringUtils.isNotBlank(departments) && departments.contains("/581/")) {
|
||||||
|
//加盟部 FRANCHISE_COMPANIES
|
||||||
|
if (!JoinModeEnum.isFranchise(joinMode)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.JOIN_MODE_NOT_ALLOW_OPERATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ public class LineServiceImpl implements LineService {
|
|||||||
private RegionQrcodeConfigDao regionQrcodeConfigDao;
|
private RegionQrcodeConfigDao regionQrcodeConfigDao;
|
||||||
@Resource
|
@Resource
|
||||||
QualificationsInfoDAO qualificationsInfoDAO;
|
QualificationsInfoDAO qualificationsInfoDAO;
|
||||||
|
@Resource
|
||||||
|
EnterpriseService enterpriseService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -514,6 +516,7 @@ public class LineServiceImpl implements LineService {
|
|||||||
public Boolean addLine(AddLineRequest addLineRequest, LoginUserInfo userInfo) {
|
public Boolean addLine(AddLineRequest addLineRequest, LoginUserInfo userInfo) {
|
||||||
//必填参数
|
//必填参数
|
||||||
log.info("addLine:{}", JSONObject.toJSONString(addLineRequest));
|
log.info("addLine:{}", JSONObject.toJSONString(addLineRequest));
|
||||||
|
enterpriseService.checkUser(userInfo.getUserId(), addLineRequest.getJoinMode());
|
||||||
if (!StringUtil.isNoneBlank(addLineRequest.getMobile(), addLineRequest.getUserName())) {
|
if (!StringUtil.isNoneBlank(addLineRequest.getMobile(), addLineRequest.getUserName())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.dao.MessageTemplateDAO;
|
||||||
|
import com.cool.store.entity.MessageTemplateDO;
|
||||||
|
import com.cool.store.entity.StoreMessageDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.vo.notice.StoreMessageVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.messaging.MessagingException;
|
||||||
|
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 消息下发 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/5
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class MessageIssueService {
|
||||||
|
private final MessageTemplateDAO messageTemplateDAO;
|
||||||
|
private final SimpMessagingTemplate simpMessagingTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发即时通知消息
|
||||||
|
*
|
||||||
|
* @param list 门店消息列表
|
||||||
|
*/
|
||||||
|
@Async("generalThreadPool")
|
||||||
|
public void issueMessage(List<StoreMessageDO> list) {
|
||||||
|
if (CollectionUtils.isEmpty(list)) return;
|
||||||
|
log.info("下发即时通知, messageList:{}", JSONObject.toJSONString(list));
|
||||||
|
try {
|
||||||
|
Set<Long> messageTemplateIds = CollStreamUtil.toSet(list, StoreMessageDO::getMessageTemplateId);
|
||||||
|
List<MessageTemplateDO> messageTemplateList = messageTemplateDAO.getByIds(new ArrayList<>(messageTemplateIds));
|
||||||
|
Map<Long, MessageTemplateDO> messageTemplateMap = CollStreamUtil.toMap(messageTemplateList, MessageTemplateDO::getId, v -> v);
|
||||||
|
|
||||||
|
for (StoreMessageDO storeMessageDO : list) {
|
||||||
|
if (StringUtils.isNotBlank(storeMessageDO.getOperatorList())) {
|
||||||
|
String[] userIds = storeMessageDO.getOperatorList().split(",");
|
||||||
|
if (ArrayUtil.isNotEmpty(userIds)) {
|
||||||
|
MessageTemplateDO messageTemplateDO = messageTemplateMap.get(storeMessageDO.getMessageTemplateId());
|
||||||
|
if (Objects.isNull(messageTemplateDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.MESSAGE_NOT_EXIST);
|
||||||
|
}
|
||||||
|
StoreMessageVO storeMessageVO = BeanUtil.toBean(storeMessageDO, StoreMessageVO.class);
|
||||||
|
BeanUtil.copyProperties(messageTemplateDO, storeMessageVO, "id");
|
||||||
|
String message = JSONObject.toJSONString(storeMessageVO);
|
||||||
|
for (String userId : userIds) {
|
||||||
|
try {
|
||||||
|
simpMessagingTemplate.convertAndSend("/queue/message/" + userId, message);
|
||||||
|
} catch (MessagingException e) {
|
||||||
|
log.info("即时通知下发异常, userId:{}, error:{}", userId, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("即时通知下发异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ package com.cool.store.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.dto.notice.CommonDTO;
|
import com.cool.store.dto.notice.CommonDTO;
|
||||||
import com.cool.store.dto.notice.MessageTemplateCountDTO;
|
import com.cool.store.dto.notice.MessageTemplateCountDTO;
|
||||||
@@ -36,7 +35,6 @@ import com.google.gson.JsonObject;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
import org.springframework.core.task.TaskExecutor;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
@@ -83,6 +81,8 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
TaskExecutor noticeThreadPool;
|
TaskExecutor noticeThreadPool;
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||||
|
@Resource
|
||||||
|
MessageIssueService messageIssueService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -188,6 +188,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
List<StoreAreaDTO> storeAreaDTOS = getStoreRange(request.getStoreInfoList());
|
List<StoreAreaDTO> storeAreaDTOS = getStoreRange(request.getStoreInfoList());
|
||||||
List<String> storeIds = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toList());
|
List<String> storeIds = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toList());
|
||||||
Map<String, List<String>> authUser = getAuthUser(request.getUserInfoList(), storeIds);
|
Map<String, List<String>> authUser = getAuthUser(request.getUserInfoList(), storeIds);
|
||||||
|
List<StoreMessageDO> realtimeMessageList = new ArrayList<>();
|
||||||
list.stream().forEach(x -> {
|
list.stream().forEach(x -> {
|
||||||
List<StoreMessageDO> result = new ArrayList<>();
|
List<StoreMessageDO> result = new ArrayList<>();
|
||||||
storeAreaDTOS.forEach(y->{
|
storeAreaDTOS.forEach(y->{
|
||||||
@@ -209,6 +210,9 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
result.add(storeMessageDO);
|
result.add(storeMessageDO);
|
||||||
});
|
});
|
||||||
storeMessageDAO.batchInsert(result);
|
storeMessageDAO.batchInsert(result);
|
||||||
|
if (MatterTypeEnum.REALTIME.getCode().equals(request.getMatterType())) {
|
||||||
|
realtimeMessageList.addAll(result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//存在第一个成功 第二个失败 会有问题 todo
|
//存在第一个成功 第二个失败 会有问题 todo
|
||||||
@@ -245,6 +249,8 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
openIdList.forEach(x->{
|
openIdList.forEach(x->{
|
||||||
wechatTemplateService.sendMiniAppTemplate(x, WechatTemplateEnum.NEW_QUESTION_NOTICE,data,"pages/notification/index");
|
wechatTemplateService.sendMiniAppTemplate(x, WechatTemplateEnum.NEW_QUESTION_NOTICE,data,"pages/notification/index");
|
||||||
});
|
});
|
||||||
|
// 即时消息下发
|
||||||
|
messageIssueService.issueMessage(realtimeMessageList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("发布流程异常 e:{}",e.getMessage());
|
log.info("发布流程异常 e:{}",e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
@@ -395,6 +401,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
batchPublishRequest.setIds(Arrays.asList(messageTemplateDO.getId()));
|
batchPublishRequest.setIds(Arrays.asList(messageTemplateDO.getId()));
|
||||||
batchPublishRequest.setStoreInfoList(JSONObject.parseArray(storeInfo, CommonDTO.class));
|
batchPublishRequest.setStoreInfoList(JSONObject.parseArray(storeInfo, CommonDTO.class));
|
||||||
batchPublishRequest.setUserInfoList(JSONObject.parseArray(userInfo, CommonDTO.class));
|
batchPublishRequest.setUserInfoList(JSONObject.parseArray(userInfo, CommonDTO.class));
|
||||||
|
batchPublishRequest.setMatterType(matterConfig.getMatterType());
|
||||||
try {
|
try {
|
||||||
batchPublishMessageTemplate(batchPublishRequest,"");
|
batchPublishMessageTemplate(batchPublishRequest,"");
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
@@ -495,9 +502,9 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ModuleAndMatterVO> getModuleList(String storeId,PartnerUserInfoVO userInfoVO) {
|
public List<ModuleAndMatterVO> getModuleList(String storeId,String mobile) {
|
||||||
List<ModuleAndMatterVO> moduleAndMatterList = ModuleAndMatterVO.getModuleAndMatterList();
|
List<ModuleAndMatterVO> moduleAndMatterList = ModuleAndMatterVO.getModuleAndMatterList();
|
||||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(userInfoVO.getMobile());
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(mobile);
|
||||||
if (enterpriseUserDO == null){
|
if (enterpriseUserDO == null){
|
||||||
enterpriseUserDO = new EnterpriseUserDO();
|
enterpriseUserDO = new EnterpriseUserDO();
|
||||||
}
|
}
|
||||||
@@ -540,7 +547,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean readMessage(Long id, PartnerUserInfoVO userInfoVO) {
|
public Boolean readMessage(Long id, String mobile) {
|
||||||
StoreMessageDO message = storeMessageDAO.getById(id);
|
StoreMessageDO message = storeMessageDAO.getById(id);
|
||||||
if (ProcessStatusEnum.PROCESSED.getCode().equals(message.getProcessStatus())){
|
if (ProcessStatusEnum.PROCESSED.getCode().equals(message.getProcessStatus())){
|
||||||
log.info("当前消息已读已处理:{}",JSONObject.toJSONString( message));
|
log.info("当前消息已读已处理:{}",JSONObject.toJSONString( message));
|
||||||
@@ -552,7 +559,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
if (ProcessTypeEnum.READ.getCode().equals(template.getProcessType())){
|
if (ProcessTypeEnum.READ.getCode().equals(template.getProcessType())){
|
||||||
message.setProcessStatus(ProcessStatusEnum.PROCESSED.getCode());
|
message.setProcessStatus(ProcessStatusEnum.PROCESSED.getCode());
|
||||||
message.setProcessTime(new Date());
|
message.setProcessTime(new Date());
|
||||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(userInfoVO.getMobile());
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(mobile);
|
||||||
if (enterpriseUserDO != null){
|
if (enterpriseUserDO != null){
|
||||||
message.setActualOperatorId(enterpriseUserDO.getId());
|
message.setActualOperatorId(enterpriseUserDO.getId());
|
||||||
message.setActualOperatorName(enterpriseUserDO.getName());
|
message.setActualOperatorName(enterpriseUserDO.getName());
|
||||||
@@ -563,15 +570,15 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean handleMessage(Long id, PartnerUserInfoVO userInfoVO) {
|
public Boolean handleMessage(Long id, String userName,String mobile) {
|
||||||
log.info("handleMessage request:{},处理人:{}", JSONObject.toJSONString(id), userInfoVO.getUsername());
|
log.info("handleMessage request:{},处理人:{}", JSONObject.toJSONString(id), userName);
|
||||||
StoreMessageDO message = storeMessageDAO.getById(id);
|
StoreMessageDO message = storeMessageDAO.getById(id);
|
||||||
if (message==null){
|
if (message==null){
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
}
|
}
|
||||||
message.setProcessStatus(ProcessStatusEnum.PROCESSED.getCode());
|
message.setProcessStatus(ProcessStatusEnum.PROCESSED.getCode());
|
||||||
message.setProcessTime(new Date());
|
message.setProcessTime(new Date());
|
||||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(userInfoVO.getMobile());
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(mobile);
|
||||||
if (enterpriseUserDO != null){
|
if (enterpriseUserDO != null){
|
||||||
message.setActualOperatorId(enterpriseUserDO.getId());
|
message.setActualOperatorId(enterpriseUserDO.getId());
|
||||||
message.setActualOperatorName(enterpriseUserDO.getName());
|
message.setActualOperatorName(enterpriseUserDO.getName());
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
|||||||
//初始化数据
|
//初始化数据
|
||||||
preparationService.licenseCompleted(shopId);
|
preparationService.licenseCompleted(shopId);
|
||||||
preparationService.sysStoreCompleted(shopId);
|
preparationService.sysStoreCompleted(shopId);
|
||||||
|
preparationService.businessLicenseAndBuildStoreCompleted(shopId);
|
||||||
preparationService.buildStoreAndDecorationComplete(shopId);
|
preparationService.buildStoreAndDecorationComplete(shopId);
|
||||||
preparationService.selectSiteAndBuildStoreComplete(shopId);
|
preparationService.selectSiteAndBuildStoreComplete(shopId);
|
||||||
preparationService.buildStoreComplete(shopId);
|
preparationService.buildStoreComplete(shopId);
|
||||||
|
|||||||
@@ -220,9 +220,25 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
||||||
if (flag3) {
|
if (flag3) {
|
||||||
List<ShopSubStageStatusEnum> list = new ArrayList<>();
|
List<ShopSubStageStatusEnum> list = new ArrayList<>();
|
||||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
|
|
||||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170);
|
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170);
|
||||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
|
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
|
||||||
|
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void businessLicenseAndBuildStoreCompleted(Long shopId) {
|
||||||
|
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, null);
|
||||||
|
if (CollectionUtils.isNotEmpty(shopStageInfo)) {
|
||||||
|
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
|
||||||
|
boolean flag1 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_156.getShopSubStageStatus().
|
||||||
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
||||||
|
boolean flag2 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().
|
||||||
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
|
||||||
|
if (flag1 && flag2) {
|
||||||
|
List<ShopSubStageStatusEnum> list = new ArrayList<>();
|
||||||
|
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
|
||||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240);
|
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240);
|
||||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||||
}
|
}
|
||||||
@@ -345,10 +361,12 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage()).getShopSubStageStatus());
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage()).getShopSubStageStatus());
|
||||||
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_156.getShopSubStageStatus().
|
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_156.getShopSubStageStatus().
|
||||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
||||||
|
Boolean flag4 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().
|
||||||
|
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
|
||||||
|
|
||||||
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{}",flag2,flag3);
|
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{} flag4->{}",flag2,flag3, flag4);
|
||||||
//都完成了 状态修改
|
//都完成了 状态修改
|
||||||
if (flag2 && flag3) {
|
if (flag2 && flag3 && flag4) {
|
||||||
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null,null);
|
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
DecorationDesignInfoDAO decorationDesignInfoDAO;
|
DecorationDesignInfoDAO decorationDesignInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
StoreService storeService;
|
StoreService storeService;
|
||||||
|
@Resource
|
||||||
|
EnterpriseService enterpriseService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -330,6 +332,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
if (StringUtils.isBlank(request.getInvestmentManagerUserId())) {
|
if (StringUtils.isBlank(request.getInvestmentManagerUserId())) {
|
||||||
request.setInvestmentManagerUserId(userId);
|
request.setInvestmentManagerUserId(userId);
|
||||||
}
|
}
|
||||||
|
enterpriseService.checkUser(userId, request.getJoinMode());
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
if (lineInfo.getWorkflowSubStageStatus() < WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode()) {
|
if (lineInfo.getWorkflowSubStageStatus() < WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode()) {
|
||||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||||
|
|||||||
@@ -273,6 +273,18 @@ public class SyncDataServiceImpl implements SyncDataService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("getUrl error:{},JSON:{}", e.getMessage(), json);
|
log.info("getUrl error:{},JSON:{}", e.getMessage(), json);
|
||||||
}
|
}
|
||||||
|
return getUrlListByComma(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<String> getUrlListByComma(String str) {
|
||||||
|
if (StringUtils.isBlank(str)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Arrays.asList(str.split(","));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("getUrlListByComma error:{},str:{}", e.getMessage(), str);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,43 +301,31 @@ public class SyncDataServiceImpl implements SyncDataService {
|
|||||||
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
||||||
//M10001
|
//M10001
|
||||||
if (shopCode.matches("M\\d*")) {
|
if (shopCode.matches("M\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "MX" + shopInfoDO.getShopName();
|
||||||
? "MX" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "MX" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
//FS10001
|
//FS10001
|
||||||
if (shopCode.matches("FS\\d*")) {
|
if (shopCode.matches("FS\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "FS" + shopInfoDO.getShopName();
|
||||||
? "FS" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "FS" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
// MS10001
|
// MS10001
|
||||||
if (shopCode.matches("MS\\d*")) {
|
if (shopCode.matches("MS\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "MS" + shopInfoDO.getShopName();
|
||||||
? "MS" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "MS" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
// S10001
|
// S10001
|
||||||
if (shopCode.matches("S\\d*")) {
|
if (shopCode.matches("S\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "S" + shopInfoDO.getShopName();
|
||||||
? "S" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "S" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
// ZX0001
|
// ZX0001
|
||||||
if (shopCode.matches("ZX\\d*")) {
|
if (shopCode.matches("ZX\\d*")) {
|
||||||
return "ZX" + shopInfoDO.getShopName();
|
return "ZX" + shopInfoDO.getShopName();
|
||||||
}
|
}
|
||||||
if(shopCode.matches("HL\\d*")){
|
if(shopCode.matches("HL\\d*")){
|
||||||
return partnershipSignatorySecondIsNull
|
return "HL" + shopInfoDO.getShopName();
|
||||||
? "HL" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "HL" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (String.valueOf(FranchiseBrandEnum.MZG.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
if (String.valueOf(FranchiseBrandEnum.MZG.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
||||||
if (shopCode.matches("MZGM\\d*")) {
|
if (shopCode.matches("MZGM\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "MZGM" + shopInfoDO.getShopName();
|
||||||
? "MZGM" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "MZGM" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
if (shopCode.matches("MZGS\\d*")) {
|
if (shopCode.matches("MZGS\\d*")) {
|
||||||
return FranchiseBrandEnum.MZG.getDesc() + shopInfoDO.getShopName();
|
return FranchiseBrandEnum.MZG.getDesc() + shopInfoDO.getShopName();
|
||||||
@@ -333,19 +333,13 @@ public class SyncDataServiceImpl implements SyncDataService {
|
|||||||
}
|
}
|
||||||
if (String.valueOf(FranchiseBrandEnum.ZJS.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
if (String.valueOf(FranchiseBrandEnum.ZJS.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
||||||
if (shopCode.matches("LX\\d*")) {
|
if (shopCode.matches("LX\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "LX" + shopInfoDO.getShopName();
|
||||||
? "LX" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "LX" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
if (shopCode.matches("X\\d*")) {
|
if (shopCode.matches("X\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "X" + shopInfoDO.getShopName();
|
||||||
? "X" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "X" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
if (shopCode.matches("Q\\d*")) {
|
if (shopCode.matches("Q\\d*")) {
|
||||||
return partnershipSignatorySecondIsNull
|
return "Q" + shopInfoDO.getShopName();
|
||||||
? "Q" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + ")"
|
|
||||||
: "Q" + shopInfoDO.getShopName() + "(" + signFranchiseDO.getPartnershipSignatoryFirst() + "/"+signFranchiseDO.getPartnershipSignatorySecond()+")";
|
|
||||||
}
|
}
|
||||||
if (shopCode.matches("Z\\d*")) {
|
if (shopCode.matches("Z\\d*")) {
|
||||||
return FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName();
|
return FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName();
|
||||||
|
|||||||
@@ -160,6 +160,9 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
|||||||
PointDetailInfoDO pointDetail = pointDetailDAO.getPointDetailInfoByPointId(shopInfo.getPointId());
|
PointDetailInfoDO pointDetail = pointDetailDAO.getPointDetailInfoByPointId(shopInfo.getPointId());
|
||||||
if (info != null){
|
if (info != null){
|
||||||
storeMasterDTO.setArea(info.getProvince()+info.getCity()+info.getDistrict());
|
storeMasterDTO.setArea(info.getProvince()+info.getCity()+info.getDistrict());
|
||||||
|
storeMasterDTO.setProvince(info.getProvince());
|
||||||
|
storeMasterDTO.setCity(info.getCity());
|
||||||
|
storeMasterDTO.setDistrict(info.getDistrict());
|
||||||
storeMasterDTO.setTown(info.getTownship());
|
storeMasterDTO.setTown(info.getTownship());
|
||||||
storeMasterDTO.setStoreAddress(info.getAddress());
|
storeMasterDTO.setStoreAddress(info.getAddress());
|
||||||
storeMasterDTO.setLocationAddress(info.getAddress());
|
storeMasterDTO.setLocationAddress(info.getAddress());
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ package com.cool.store.service.impl;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||||
import com.cool.store.request.bigdata.ProfitDataRequest;
|
import com.cool.store.request.bigdata.ProfitDataRequest;
|
||||||
import com.cool.store.request.oppty.CityRequest;
|
import com.cool.store.request.oppty.CityRequest;
|
||||||
import com.cool.store.response.bigdata.ActDataResponse;
|
import com.cool.store.response.bigdata.*;
|
||||||
import com.cool.store.response.bigdata.ApiResponse;
|
|
||||||
import com.cool.store.response.bigdata.ProfitDataResponse;
|
|
||||||
import com.cool.store.response.bigdata.ProfitRateResponse;
|
|
||||||
import com.cool.store.response.oppty.CityResponse;
|
import com.cool.store.response.oppty.CityResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityApiResponse;
|
import com.cool.store.response.oppty.OpportunityApiResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
||||||
@@ -96,6 +94,15 @@ public class ThirdBigDataServiceImpl implements ThirdBigDataService {
|
|||||||
return executeApiCall(url, requestBody, ActDataResponse.class);
|
return executeApiCall(url, requestBody, ActDataResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LatestOrderDateResponse> getLatestOrderDate(LatestOrderDateRequest requestBody) {
|
||||||
|
String url = apiUrl + "api/web/v1/buy/latest_buy_date";
|
||||||
|
JavaType javaType = objectMapper.getTypeFactory()
|
||||||
|
.constructParametricType(ApiPageResponse.class, LatestOrderDateResponse.class);
|
||||||
|
ApiPageResponse<LatestOrderDateResponse> response = executeApiCallWithGenericType(url, requestBody, javaType);
|
||||||
|
return response.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
||||||
// 1. 打印请求前日志
|
// 1. 打印请求前日志
|
||||||
@@ -136,6 +143,44 @@ public class ThirdBigDataServiceImpl implements ThirdBigDataService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private <T> T executeApiCallWithGenericType(String url, Object requestBody, JavaType responseType) {
|
||||||
|
// 1. 打印请求前日志
|
||||||
|
logRequest(url, requestBody);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Request request = buildRequest(requestBody, url);
|
||||||
|
|
||||||
|
try (Response response = okHttpClient.newCall(request).execute()) {
|
||||||
|
// 2. 获取原始响应内容
|
||||||
|
String responseBody = response.body().string();
|
||||||
|
|
||||||
|
// 3. 打印响应日志
|
||||||
|
logResponse(url, response.code(), responseBody);
|
||||||
|
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
|
||||||
|
"HTTP请求失败,状态码: " + response.code());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 解析响应
|
||||||
|
JavaType javaType = objectMapper.getTypeFactory()
|
||||||
|
.constructParametricType(OpportunityApiResponse.class, responseType);
|
||||||
|
|
||||||
|
OpportunityApiResponse<T> apiResponse = objectMapper.readValue(responseBody, javaType);
|
||||||
|
|
||||||
|
if (apiResponse.getCode() != 0) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, apiResponse.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
return apiResponse.getData();
|
||||||
|
}
|
||||||
|
} catch (ServiceException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("API调用异常 - URL: {}, 错误: {}", url, e.getMessage(), e);
|
||||||
|
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Request buildRequest(Object requestBody, String url) {
|
private Request buildRequest(Object requestBody, String url) {
|
||||||
Map<String, Object> params = JsonUtils.parseJsonToMap(JSONObject.toJSONString(requestBody));
|
Map<String, Object> params = JsonUtils.parseJsonToMap(JSONObject.toJSONString(requestBody));
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.cool.store.service.login;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.context.LoginUserInfo;
|
||||||
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
|
import com.cool.store.dto.login.UserLoginDTO;
|
||||||
|
import com.cool.store.dto.login.UserRefreshLoginDTO;
|
||||||
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
|
import com.cool.store.entity.login.UserLoginDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.EnterpriseService;
|
||||||
|
import com.cool.store.userholder.CurrentUser;
|
||||||
|
import com.cool.store.userholder.RefreshUser;
|
||||||
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
|
import com.cool.store.vo.login.UserBaseInfoVO;
|
||||||
|
import com.cool.store.vo.login.UserLoginVO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录基础服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/3
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public abstract class LoginBaseService implements LoginStrategy {
|
||||||
|
@Resource
|
||||||
|
private RedisUtilPool redisUtilPool;
|
||||||
|
@Resource
|
||||||
|
private EnterpriseUserDAO enterpriseUserDAO;
|
||||||
|
@Resource
|
||||||
|
private EnterpriseService enterpriseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略登录实现方法
|
||||||
|
*/
|
||||||
|
public abstract ResponseResult userLogin(UserLoginDTO param, UserLoginDO userLoginDO);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult login(UserLoginDTO param) {
|
||||||
|
log.info("login:{}", JSONObject.toJSONString(param));
|
||||||
|
String errorPasswordCountKey = MessageFormat.format(RedisConstant.ERROR_PASSWORD_COUNT_KEY, LocalDate.now(), param.getMobile());
|
||||||
|
String errorCount = redisUtilPool.getString(errorPasswordCountKey);
|
||||||
|
//判断密码错误次数
|
||||||
|
if (StringUtils.isNotBlank(errorCount)) {
|
||||||
|
if (Integer.parseInt(errorCount) >= CommonConstants.MAX_ERROR_PASSWORD_COUNT) {
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.PASSWORD_ERROR_MAX_COUNT, errorCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(param.getMobile());
|
||||||
|
UserLoginDO userLoginDO = enterpriseUserDAO.getUserLoginByUnionid(enterpriseUserDO.getUnionid());
|
||||||
|
return userLogin(param, userLoginDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult refreshLogin(UserRefreshLoginDTO param) {
|
||||||
|
String refreshTokenKey = RedisConstant.REFRESH_TOKEN_PREFIX + param.getRefreshToken();
|
||||||
|
String refreshUserStr = redisUtilPool.getString(refreshTokenKey);
|
||||||
|
if (StringUtils.isBlank(refreshUserStr)) {
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.REFRESH_TOKEN_INVALID);
|
||||||
|
}
|
||||||
|
RefreshUser refreshUser = JSONObject.parseObject(refreshUserStr, RefreshUser.class);
|
||||||
|
if (StringUtils.isBlank(refreshUser.getMobile())) {
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.REFRESH_TOKEN_INVALID);
|
||||||
|
}
|
||||||
|
UserLoginDO userLoginDO = new UserLoginDO(refreshUser.getUserId(), refreshUser.getMobile(), null);
|
||||||
|
return ResponseResult.success(getUserLoginInfo(userLoginDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult logout() {
|
||||||
|
LoginUserInfo currentUser = CurrentUserHolder.getUser();
|
||||||
|
String accessToken = currentUser.getAccessToken();
|
||||||
|
String key = RedisConstant.ACCESS_TOKEN_PREFIX + accessToken;
|
||||||
|
redisUtilPool.delKey(key);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取登录accessToken
|
||||||
|
*
|
||||||
|
* @param userLoginDO 用户登录信息
|
||||||
|
* @return accessToken
|
||||||
|
*/
|
||||||
|
public UserLoginVO getUserLoginInfo(UserLoginDO userLoginDO) {
|
||||||
|
CurrentUser currentUser = enterpriseService.getLoginInfo(userLoginDO.getMobile());
|
||||||
|
UserBaseInfoVO userBAseInfoVO = BeanUtil.toBean(currentUser, UserBaseInfoVO.class);
|
||||||
|
RefreshUser refreshUser = enterpriseService.getRefreshUser(userLoginDO.getUserId(), userLoginDO.getMobile());
|
||||||
|
return new UserLoginVO(currentUser.getAccessToken(), refreshUser.getRefreshToken(), CommonConstants.ACTION_TOKEN_EXPIRE, userBAseInfoVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.cool.store.service.login;
|
||||||
|
|
||||||
|
import com.cool.store.dto.login.UserLoginDTO;
|
||||||
|
import com.cool.store.dto.login.UserRefreshLoginDTO;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录策略
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/3
|
||||||
|
*/
|
||||||
|
public interface LoginStrategy {
|
||||||
|
/**
|
||||||
|
* 登录基础方法
|
||||||
|
*/
|
||||||
|
ResponseResult login(UserLoginDTO param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* refreshToken登录
|
||||||
|
*/
|
||||||
|
ResponseResult refreshLogin(UserRefreshLoginDTO param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登出
|
||||||
|
*/
|
||||||
|
ResponseResult logout();
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.cool.store.service.login.impl;
|
||||||
|
|
||||||
|
import com.aliyun.core.utils.StringUtils;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
|
import com.cool.store.dto.login.UserLoginDTO;
|
||||||
|
import com.cool.store.entity.login.UserLoginDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.login.LoginBaseService;
|
||||||
|
import com.cool.store.utils.Md5Utils;
|
||||||
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 密码登录服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PasswordLoginServiceImpl extends LoginBaseService {
|
||||||
|
private final RedisUtilPool redisUtilPool;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult userLogin(UserLoginDTO param, UserLoginDO userLoginDO) {
|
||||||
|
if (StringUtils.isBlank(param.getPassword())) {
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.PASSWORD_MISSING);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(userLoginDO.getPassword())) {
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.IMPROVE_USER_INFO);
|
||||||
|
}
|
||||||
|
String password = Md5Utils.md5(param.getPassword() + CommonConstants.USER_AUTH_KEY);
|
||||||
|
if (!password.equals(userLoginDO.getPassword())) {
|
||||||
|
String errorPasswordCountKey = MessageFormat.format(RedisConstant.ERROR_PASSWORD_COUNT_KEY, LocalDate.now(), param.getMobile());
|
||||||
|
Long errorNum = redisUtilPool.incrby(errorPasswordCountKey, 1);
|
||||||
|
redisUtilPool.expire(errorPasswordCountKey, 24 * 60 * 60);
|
||||||
|
if(errorNum == 1){
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.PASSWORD_ERROR);
|
||||||
|
}
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.PASSWORD_ERROR_MULTI, errorNum.toString());
|
||||||
|
}
|
||||||
|
return ResponseResult.success(getUserLoginInfo(userLoginDO));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -220,6 +220,4 @@ public class Constants
|
|||||||
|
|
||||||
public static final String WANG_LEI_JOB_NUMBER = "19060164";
|
public static final String WANG_LEI_JOB_NUMBER = "19060164";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,65 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>dev</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>dev2</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>dev2</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>local</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<profileActive>local</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>test</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>test</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>test3</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>test3</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>ab</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>ab</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>online</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>online</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>hd</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>hd</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>zcb</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>zcb</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|||||||
@@ -40,4 +40,16 @@ public class PartnerWebApplication {
|
|||||||
return defaultDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
return defaultDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConfigurationProperties("platform.datasource")
|
||||||
|
public DataSourceProperties platformDataSourceProperties() {
|
||||||
|
return new DataSourceProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConfigurationProperties("spring.datasource.hikari")
|
||||||
|
public DataSource platformDataSource() {
|
||||||
|
return platformDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.cool.store.aspect;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.PlatformDB;
|
||||||
|
import com.cool.store.datasource.DataSourceContextHolder;
|
||||||
|
import org.aspectj.lang.annotation.After;
|
||||||
|
import org.aspectj.lang.annotation.AfterThrowing;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Before;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源切换 切面
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
public class DataSourceAspect {
|
||||||
|
|
||||||
|
@Before("@annotation(platformDB)")
|
||||||
|
public void before(PlatformDB platformDB) {
|
||||||
|
DataSourceContextHolder.setDataSourceType("platform");
|
||||||
|
}
|
||||||
|
|
||||||
|
@After("@annotation(platformDB)")
|
||||||
|
public void after(PlatformDB platformDB) {
|
||||||
|
DataSourceContextHolder.clearDataSourceType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterThrowing("@annotation(platformDB)")
|
||||||
|
public void afterThrowing(PlatformDB platformDB) {
|
||||||
|
DataSourceContextHolder.clearDataSourceType();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,7 +60,8 @@ public class SignValidateFilter implements Filter {
|
|||||||
"/zxjp/**/api/audit/result",
|
"/zxjp/**/api/audit/result",
|
||||||
"/zxjp/**/api/license",
|
"/zxjp/**/api/license",
|
||||||
"/zxjp/mini/line/getRegionPayPic",
|
"/zxjp/mini/line/getRegionPayPic",
|
||||||
"/zxjp/mini/miniProgram/getUserInfoByToken"
|
"/zxjp/mini/miniProgram/getUserInfoByToken",
|
||||||
|
"/zxjp/ws/**"
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,10 @@ public class TokenValidateFilter implements Filter {
|
|||||||
"/zxjp/pc/sysRole/**",
|
"/zxjp/pc/sysRole/**",
|
||||||
"/zxjp/**/api/audit/result",
|
"/zxjp/**/api/audit/result",
|
||||||
"/zxjp/pc/video/**",
|
"/zxjp/pc/video/**",
|
||||||
"/zxjp/**/api/license"
|
"/zxjp/**/api/license",
|
||||||
|
"/zxjp/pc/v3/login/accountLogin",
|
||||||
|
"/zxjp/pc/v3/login/refreshLogin",
|
||||||
|
"/zxjp/ws/**"
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.cool.store.config.websocket;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||||
|
import org.springframework.scheduling.TaskScheduler;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||||
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||||
|
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||||
|
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* WebSocket配置类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/2
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableWebSocketMessageBroker
|
||||||
|
@Slf4j
|
||||||
|
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||||
|
registry.addEndpoint("/ws/zxzs")
|
||||||
|
.setAllowedOrigins("*")
|
||||||
|
.withSockJS(); // 启用SockJS支持
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configureMessageBroker(MessageBrokerRegistry registry) {
|
||||||
|
// 配置消息代理
|
||||||
|
registry.enableSimpleBroker("/topic", "/queue") // 启用简单代理,用于广播和点对点消息
|
||||||
|
.setHeartbeatValue(new long[]{0, 10000})
|
||||||
|
.setTaskScheduler(webSocketTaskScheduler());
|
||||||
|
registry.setApplicationDestinationPrefixes("/app"); // 设置应用程序端点前缀
|
||||||
|
// registry.setUserDestinationPrefix("/user");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public TaskScheduler webSocketTaskScheduler() {
|
||||||
|
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
|
||||||
|
taskScheduler.setPoolSize(1);
|
||||||
|
taskScheduler.setThreadNamePrefix("websocket-heartbeat-");
|
||||||
|
taskScheduler.initialize();
|
||||||
|
return taskScheduler;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void configureClientInboundChannel(ChannelRegistration registration) {
|
||||||
|
// registration.interceptors(new ChannelInterceptor() {
|
||||||
|
// @Override
|
||||||
|
// public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||||
|
// StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
|
||||||
|
//
|
||||||
|
// if (StompCommand.CONNECT.equals(accessor.getCommand())) {
|
||||||
|
// // 从STOMP头部获取login字段作为用户标识
|
||||||
|
// String login = accessor.getLogin();
|
||||||
|
// log.info("用户login:{}", login);
|
||||||
|
// if (login != null && !login.isEmpty()) {
|
||||||
|
// // 设置用户身份
|
||||||
|
// accessor.setUser(() -> login);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.dto.login.UserLoginDTO;
|
||||||
|
import com.cool.store.dto.login.UserRefreshLoginDTO;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.login.LoginBaseService;
|
||||||
|
import com.cool.store.service.login.LoginStrategy;
|
||||||
|
import com.cool.store.utils.SpringContextUtil;
|
||||||
|
import com.cool.store.vo.login.UserLoginVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 登录 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/4
|
||||||
|
*/
|
||||||
|
@Api(tags = "登录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/v3/login")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LoginController {
|
||||||
|
private final LoginBaseService loginBaseService;
|
||||||
|
|
||||||
|
@ApiOperation("账号密码登录")
|
||||||
|
@PostMapping("/accountLogin")
|
||||||
|
public ResponseResult<UserLoginVO> accountLogin(@RequestBody UserLoginDTO param) {
|
||||||
|
return SpringContextUtil.getBean(param.getLoginType().getClazzName(), LoginStrategy.class).login(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("refresh登录")
|
||||||
|
@PostMapping("/refreshLogin")
|
||||||
|
public ResponseResult<UserLoginVO> refreshLogin(@RequestBody UserRefreshLoginDTO param) {
|
||||||
|
return loginBaseService.refreshLogin(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("登出")
|
||||||
|
@PostMapping("/logout")
|
||||||
|
public ResponseResult logout() {
|
||||||
|
return loginBaseService.logout();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.cool.store.controller.webb;
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
import com.cool.store.context.CurrentUserHolder;
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.dto.notice.NoticeDTO;
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.request.notice.*;
|
import com.cool.store.request.notice.*;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.MessageTemplateService;
|
import com.cool.store.service.MessageTemplateService;
|
||||||
import com.cool.store.vo.notice.MessageTemplateDetailVO;
|
import com.cool.store.vo.notice.*;
|
||||||
import com.cool.store.vo.notice.StoreMessageDetailVO;
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -87,5 +87,34 @@ public class MessageTemplateController {
|
|||||||
return ResponseResult.success(messageTemplateService.revokeById(id,CurrentUserHolder.getUser()));
|
return ResponseResult.success(messageTemplateService.revokeById(id,CurrentUserHolder.getUser()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取每个门店需要展示的模块")
|
||||||
|
@GetMapping("/getModuleListByStoreId")
|
||||||
|
public ResponseResult<List<ModuleAndMatterVO>> getModuleListByStoreId(@RequestParam("id")String storeId) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getModuleList(storeId, CurrentUserHolder.getUser().getMobile()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取消息详情")
|
||||||
|
@GetMapping("/getMessageDetail")
|
||||||
|
public ResponseResult<MessageDetailVO> getMessageDetail(@RequestParam("id")Long id) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getMessageDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("待办列表/模块列表")
|
||||||
|
@PostMapping("/getStorePendingList")
|
||||||
|
public ResponseResult<PageInfo<StoreMessageVO>> getStorePendingList(@RequestBody StoreMessagePendingRequest request) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getStorePendingList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("确认已读")
|
||||||
|
@GetMapping("/readMessage")
|
||||||
|
public ResponseResult<Boolean> readMessage(@RequestParam("id")Long id) {
|
||||||
|
return ResponseResult.success(messageTemplateService.readMessage(id, CurrentUserHolder.getUser().getMobile()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("确认已处理")
|
||||||
|
@GetMapping("/handleMessage")
|
||||||
|
public ResponseResult<Boolean> handleMessage(@RequestParam("id")Long id) {
|
||||||
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
|
return ResponseResult.success(messageTemplateService.handleMessage(id, user.getName(), user.getMobile()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.response.MiniShopsResponse;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.StoreService;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* PC门店 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/9
|
||||||
|
*/
|
||||||
|
@Api(tags = "PC门店")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/stores")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PCStoreController {
|
||||||
|
private final StoreService storeService;
|
||||||
|
|
||||||
|
@ApiOperation("当前用户门店列表")
|
||||||
|
@PostMapping("/userStoreList")
|
||||||
|
public ResponseResult<PageInfo<MiniShopsResponse>> getCurrentUserStoreList(@RequestBody PageBasicInfo request) {
|
||||||
|
return ResponseResult.success(storeService.getStoreListByMobile(CurrentUserHolder.getUser().getMobile(), request.getPageNum(), request.getPageSize(), null, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.cool.store.context.PartnerUserHolder;
|
|||||||
import com.cool.store.request.notice.StoreMessagePendingRequest;
|
import com.cool.store.request.notice.StoreMessagePendingRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.MessageTemplateService;
|
import com.cool.store.service.MessageTemplateService;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
import com.cool.store.vo.notice.MessageDetailVO;
|
import com.cool.store.vo.notice.MessageDetailVO;
|
||||||
import com.cool.store.vo.notice.ModuleAndMatterVO;
|
import com.cool.store.vo.notice.ModuleAndMatterVO;
|
||||||
import com.cool.store.vo.notice.StoreMessageVO;
|
import com.cool.store.vo.notice.StoreMessageVO;
|
||||||
@@ -34,7 +35,7 @@ public class MiniMessageTemplateController {
|
|||||||
@ApiOperation("获取每个门店需要展示的模块")
|
@ApiOperation("获取每个门店需要展示的模块")
|
||||||
@GetMapping("/getModuleListByStoreId")
|
@GetMapping("/getModuleListByStoreId")
|
||||||
public ResponseResult<List<ModuleAndMatterVO>> getModuleListByStoreId(@RequestParam("id")String storeId) {
|
public ResponseResult<List<ModuleAndMatterVO>> getModuleListByStoreId(@RequestParam("id")String storeId) {
|
||||||
return ResponseResult.success(messageTemplateService.getModuleList(storeId, PartnerUserHolder.getUser()));
|
return ResponseResult.success(messageTemplateService.getModuleList(storeId, PartnerUserHolder.getUser().getMobile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取消息详情")
|
@ApiOperation("获取消息详情")
|
||||||
@@ -52,13 +53,14 @@ public class MiniMessageTemplateController {
|
|||||||
@ApiOperation("确认已读")
|
@ApiOperation("确认已读")
|
||||||
@GetMapping("/readMessage")
|
@GetMapping("/readMessage")
|
||||||
public ResponseResult<Boolean> readMessage(@RequestParam("id")Long id) {
|
public ResponseResult<Boolean> readMessage(@RequestParam("id")Long id) {
|
||||||
return ResponseResult.success(messageTemplateService.readMessage(id, PartnerUserHolder.getUser()));
|
return ResponseResult.success(messageTemplateService.readMessage(id, PartnerUserHolder.getUser().getMobile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("确认已处理")
|
@ApiOperation("确认已处理")
|
||||||
@GetMapping("/handleMessage")
|
@GetMapping("/handleMessage")
|
||||||
public ResponseResult<Boolean> handleMessage(@RequestParam("id")Long id) {
|
public ResponseResult<Boolean> handleMessage(@RequestParam("id")Long id) {
|
||||||
return ResponseResult.success(messageTemplateService.handleMessage(id, PartnerUserHolder.getUser()));
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
return ResponseResult.success(messageTemplateService.handleMessage(id, user.getUsername(), user.getMobile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
|||||||
import com.cool.store.request.GetPasswordDTO;
|
import com.cool.store.request.GetPasswordDTO;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.*;
|
import com.cool.store.service.*;
|
||||||
import com.cool.store.vo.PartnerUserInfoVO;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -95,7 +94,7 @@ public class MiniShopAccountController {
|
|||||||
@ApiOperation("获取标品登录token")
|
@ApiOperation("获取标品登录token")
|
||||||
@GetMapping("/getAccessToken")
|
@GetMapping("/getAccessToken")
|
||||||
public ResponseResult<String> getAccessToken() {
|
public ResponseResult<String> getAccessToken() {
|
||||||
return ResponseResult.success(enterpriseService.getAccessToken(PartnerUserHolder.getUser().getMobile()));
|
return ResponseResult.success(enterpriseService.getLoginInfo(PartnerUserHolder.getUser().getMobile()).getAccessToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.job;
|
package com.cool.store.job;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
@@ -7,6 +8,7 @@ import com.cool.store.dao.*;
|
|||||||
import com.cool.store.dto.*;
|
import com.cool.store.dto.*;
|
||||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||||
|
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.*;
|
import com.cool.store.enums.*;
|
||||||
import com.cool.store.enums.point.ShopStatusEnum;
|
import com.cool.store.enums.point.ShopStatusEnum;
|
||||||
@@ -19,11 +21,14 @@ import com.cool.store.mapper.TrainingExperienceMapper;
|
|||||||
import com.cool.store.mq.producer.SimpleMessageService;
|
import com.cool.store.mq.producer.SimpleMessageService;
|
||||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||||
import com.cool.store.request.ZxjpApiRequest;
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
|
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||||
import com.cool.store.request.xfsgFirstOrderListRequest;
|
import com.cool.store.request.xfsgFirstOrderListRequest;
|
||||||
|
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
||||||
import com.cool.store.response.xfsgFirstOderListResponse;
|
import com.cool.store.response.xfsgFirstOderListResponse;
|
||||||
import com.cool.store.service.*;
|
import com.cool.store.service.*;
|
||||||
import com.cool.store.service.impl.CommonService;
|
import com.cool.store.service.impl.CommonService;
|
||||||
import com.cool.store.utils.CoolDateUtils;
|
import com.cool.store.utils.CoolDateUtils;
|
||||||
|
import com.cool.store.utils.MDCUtils;
|
||||||
import com.cool.store.utils.NumberConverter;
|
import com.cool.store.utils.NumberConverter;
|
||||||
import com.cool.store.utils.poi.DateUtils;
|
import com.cool.store.utils.poi.DateUtils;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
@@ -40,6 +45,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -111,6 +117,10 @@ public class XxlJobHandler {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
PushService pushService;
|
PushService pushService;
|
||||||
|
@Resource
|
||||||
|
StoreDao storeDao;
|
||||||
|
@Resource
|
||||||
|
ThirdBigDataService thirdBigDataService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,4 +405,56 @@ public class XxlJobHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XxlJob("latestOrderDate")
|
||||||
|
public void latestOrderDate() {
|
||||||
|
log.info("------start latestOrderDate------");
|
||||||
|
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||||
|
String param = XxlJobHelper.getJobParam();
|
||||||
|
List<String> storeStatus = null;
|
||||||
|
if (StringUtils.isNotBlank(param)) {
|
||||||
|
storeStatus = Arrays.asList(param.split(","));
|
||||||
|
}
|
||||||
|
boolean hasNext = true;
|
||||||
|
int pageNum = 1;
|
||||||
|
int pageSize = CommonConstants.BATCH_SIZE;
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
while (hasNext) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<StoreDO> storeList = storeDao.getAllStoreIdAndNum(storeStatus);
|
||||||
|
if (CollectionUtils.isEmpty(storeList)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
hasNext = storeList.size() >= pageSize;
|
||||||
|
List<String> storeNums = CollStreamUtil.toList(storeList, StoreDO::getStoreNum);
|
||||||
|
Map<String, String> storeIdMap = CollStreamUtil.toMap(storeList, StoreDO::getStoreNum, StoreDO::getStoreId);
|
||||||
|
LatestOrderDateRequest request = new LatestOrderDateRequest(1, pageSize, String.join(",", storeNums));
|
||||||
|
List<LatestOrderDateResponse> resList = thirdBigDataService.getLatestOrderDate(request);
|
||||||
|
log.info("接口请求门店数量:{},返回门店数:{}", storeList.size(), resList.size());
|
||||||
|
if (CollectionUtils.isNotEmpty(resList)) {
|
||||||
|
try {
|
||||||
|
List<StoreOrderTimeDTO> updateList = resList.stream()
|
||||||
|
.map(v -> {
|
||||||
|
Date date = parseDate(v, dateFormat);
|
||||||
|
return Objects.nonNull(date) ? new StoreOrderTimeDTO(storeIdMap.get(v.getStore_code()), date) : null;
|
||||||
|
})
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
storeDao.batchInsertOrUpdateOrderTime(updateList);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取最新订货时间失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pageNum++;
|
||||||
|
}
|
||||||
|
log.info("------end latestOrderDate------");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date parseDate(LatestOrderDateResponse v, DateFormat format) {
|
||||||
|
try {
|
||||||
|
return format.parse(v.getLatest_buy_date());
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error("日期转化失败,storeCode:{},latestBuyDate:{}", v.getStore_code(), v.getLatest_buy_date());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3
|
|||||||
default.datasource.username=coolstore
|
default.datasource.username=coolstore
|
||||||
default.datasource.password=CSCErYcXniNYm7bT
|
default.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
|
platform.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||||
|
platform.datasource.username=coolstore
|
||||||
|
platform.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
|
||||||
#mysql config
|
#mysql config
|
||||||
default.datasource.url=jdbc:mysql://store10-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_10027?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
default.datasource.url=jdbc:mysql://zx-coolstore.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_10027?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
default.datasource.username=coolstore
|
default.datasource.username=coolstore
|
||||||
default.datasource.password=CSCErYcXniNYm7bT
|
default.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
|
platform.datasource.url=jdbc:mysql://zx-coolstore.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
|
platform.datasource.username=coolstore
|
||||||
|
platform.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3
|
|||||||
default.datasource.username=coolstore
|
default.datasource.username=coolstore
|
||||||
default.datasource.password=CSCErYcXniNYm7bT
|
default.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
|
platform.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||||
|
platform.datasource.username=coolstore
|
||||||
|
platform.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege-open.redis.rds.aliyuncs.com:6379/0
|
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege-open.redis.rds.aliyuncs.com:6379/0
|
||||||
|
|
||||||
@@ -133,3 +137,8 @@ special.user.id=wpayJeDAAAhGIFgUJpJN-zg39JuNbYhg_woayJeDAAA0TC8mkCJeXouw94hYA-D3
|
|||||||
|
|
||||||
ask.bot.url=https://test.auth.wx.askbot.cn
|
ask.bot.url=https://test.auth.wx.askbot.cn
|
||||||
|
|
||||||
|
hqt.token.url=https://tc.cloud.hecom.cn
|
||||||
|
hqt.token.username=18161486722
|
||||||
|
hqt.token.grant_type=client_credentials
|
||||||
|
hqt.token.client.id=WrPffdGpcWkcPsbN
|
||||||
|
hqt.token.client.secret=rYe9Cwug5LwQNIBJAiW0a7weF9CAhYCD
|
||||||
@@ -3,6 +3,10 @@ default.datasource.url=jdbc:mysql://zx-coolstore.mysql.rds.aliyuncs.com:3306/coo
|
|||||||
default.datasource.username=coolstore
|
default.datasource.username=coolstore
|
||||||
default.datasource.password=CSCErYcXniNYm7bT
|
default.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
|
platform.datasource.url=jdbc:mysql://zx-coolstore.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
|
platform.datasource.username=coolstore
|
||||||
|
platform.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3
|
|||||||
default.datasource.username=coolstore
|
default.datasource.username=coolstore
|
||||||
default.datasource.password=CSCErYcXniNYm7bT
|
default.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
|
platform.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||||
|
platform.datasource.username=coolstore
|
||||||
|
platform.datasource.password=CSCErYcXniNYm7bT
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege-open.redis.rds.aliyuncs.com:6379/0
|
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege-open.redis.rds.aliyuncs.com:6379/0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user