Merge branch 'refs/heads/master' into cc_20250529_franchise_fee
This commit is contained in:
@@ -259,6 +259,10 @@ public enum ErrorCodeEnum {
|
||||
EXPORT_LIMIT_5000(151008,"导出数据不能超过5000条,请增加筛选条件,减少导出数量",null),
|
||||
REGION_INTERSECTION_IS_NULL(151011,"所选所属大区/分公司,不在所选集团下",null),
|
||||
CHECK_PAYER_ERROR(151012,"缴费人必须是签约人,请重新填写!",null),
|
||||
STORE_INFO_INSUFFICIENT(151013,"门店信息不全,无法前往猎聘注册门店!",null),
|
||||
USER_ACCOUNT_WAIT_AUDIT(151015, "账号信息等待审核",null),
|
||||
SHOP_HAVE_NOT_OVER_ACCORDING(1511014,"该加盟商下有未结束跟进的门店,请先结束门店",null),
|
||||
MOBILE_NOT_EXIST(151016,"手机号不存在,请先维护手机号!",null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ public enum FileTypeEnum {
|
||||
ZXJP_OPEN_SHOP_REPORT("zxjpOpenShopReport","正新鸡排开店"),
|
||||
IMPORT_OA_OLD_SHOP_STAGE_DATA("importOaOldShopStageData", "导入OA旧阶段数据"),
|
||||
IMPORT_OA_OLD_SHOP_STAGE_DATA_ERROR("OaOldShopStageDataError", "导入OA旧数据阶段错误列表"),
|
||||
IMPORT_FITMENT_SHOP_STAGE("importFitmentShopStage", "导入装修阶段完成数据"),
|
||||
IMPORT_FITMENT_SHOP_STAGE_DATA_ERROR_LIST("OaOldShopStageDataErrorList", "导入装修阶段完成数据错误列表 "),
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -297,4 +297,14 @@ public class ShopInfoDAO {
|
||||
example.createCriteria().andIn("partnerId", partnerIds).andEqualTo("deleted", false);
|
||||
return shopInfoMapper.selectByExample(example);
|
||||
}
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/5/29
|
||||
* @description: 获取门店列表,根据门店状态
|
||||
*/
|
||||
public List<ShopInfoDO> selectByShopStatus(Long lineId,List<Integer> shopStatus){
|
||||
Example example = new Example(ShopInfoDO.class);
|
||||
example.createCriteria().andEqualTo("lineId", lineId).andIn("shopStatus", shopStatus).andEqualTo("deleted", false);
|
||||
return shopInfoMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="third_oa_unique_flag" jdbcType="VARCHAR" property="thirdOaUniqueFlag"/>
|
||||
<result column="departments" jdbcType="VARCHAR" property="departments"/>
|
||||
<result column="roles" jdbcType="VARCHAR" property="roles"/>
|
||||
<result column="language" jdbcType="VARCHAR" property="language"/>
|
||||
<result column="position" jdbcType="VARCHAR" property="position"/>
|
||||
<result column="active" jdbcType="BIT" property="active"/>
|
||||
<result column="userType" jdbcType="BIT" property="userType"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
|
||||
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
||||
@@ -134,7 +140,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectByMobile" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/> FROM enterprise_user_${enterpriseId} WHERE mobile =#{mobile} and active = true LIMIT 1
|
||||
SELECT * FROM enterprise_user_${enterpriseId} WHERE mobile =#{mobile} and active = true LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByInvestmentManager" resultMap="BaseResultMap">
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getSignType" resultType="com.cool.store.entity.SignFranchiseDO">
|
||||
select shop_id as shopId, sign_type as signType from xfsg_sign_franchise
|
||||
select shop_id as shopId, sign_type as signType,partnership_signatory_second as partnershipSignatorySecond from xfsg_sign_franchise
|
||||
where
|
||||
shop_id in
|
||||
<foreach collection="list" separator="," item="item" index="index" open="(" close=")">
|
||||
|
||||
@@ -19,4 +19,13 @@ public class ImportOaOldShopDataErrorDTO {
|
||||
@ExcelProperty(value = "错误原因", order = 2)
|
||||
@ColumnWidth(40)
|
||||
private String errorReason;
|
||||
|
||||
public ImportOaOldShopDataErrorDTO() {
|
||||
|
||||
}
|
||||
|
||||
public ImportOaOldShopDataErrorDTO(String shopCode, String errorReason) {
|
||||
this.shopCode = shopCode;
|
||||
this.errorReason = errorReason;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,4 +72,19 @@ public class EnterpriseUserDO implements Serializable {
|
||||
* 第三方OA系统唯一标识
|
||||
*/
|
||||
private String thirdOaUniqueFlag;
|
||||
|
||||
/**
|
||||
* 部门全路径
|
||||
*/
|
||||
private String departments;
|
||||
|
||||
private String roles;
|
||||
|
||||
private String language;
|
||||
|
||||
private Boolean active;
|
||||
|
||||
private String position;
|
||||
|
||||
private Integer userType;
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.cool.store.userholder;
|
||||
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/5/29 16:34
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CurrentUser {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
* 当type为以下值的时候
|
||||
* 0.account
|
||||
* 1.account
|
||||
* 2.userId
|
||||
* 3.userId
|
||||
* 4.account
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
private String typeStr;
|
||||
|
||||
/**
|
||||
* 培训机构id
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
private String enterpriseId;
|
||||
|
||||
private String enterpriseName;
|
||||
|
||||
private String logoName;
|
||||
|
||||
private String enterpriseLogo;
|
||||
|
||||
private String dingCorpId;
|
||||
/**
|
||||
* 企业类型(1:普通用户 2:付费用户 3:试用用户 4:共创用户)
|
||||
*/
|
||||
private Integer isVip;
|
||||
|
||||
/**
|
||||
* 开通时间
|
||||
*/
|
||||
private Date openTime;
|
||||
|
||||
/**
|
||||
* app类型('micro_app','e_app')
|
||||
*/
|
||||
private String appType;
|
||||
|
||||
/**
|
||||
* 需要配置的类型
|
||||
*/
|
||||
private List<String> configTypes;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 职位信息
|
||||
*/
|
||||
private String position;
|
||||
|
||||
/**
|
||||
* 成员所属部门id列表
|
||||
*/
|
||||
private String departmentIds;
|
||||
|
||||
/**
|
||||
* 是否持久化
|
||||
*/
|
||||
private Boolean persistent = false;
|
||||
|
||||
/**
|
||||
* 员工工号
|
||||
*/
|
||||
private String jobnumber;
|
||||
|
||||
private Boolean active;
|
||||
/**
|
||||
* 员工角色
|
||||
*/
|
||||
private String roles;
|
||||
|
||||
private String unionid;
|
||||
|
||||
/**
|
||||
* 用户语言环境
|
||||
* 用户语言环境:en_us/英语_美国,zh_cn/中文_简体,zh_hk/中文_繁体_HK
|
||||
*/
|
||||
private String language;
|
||||
|
||||
private String dbName;
|
||||
|
||||
/**
|
||||
* 钉钉管理员和数智门店无关
|
||||
*/
|
||||
private Boolean isAdmin;
|
||||
|
||||
private String agentId;
|
||||
|
||||
private String groupCorpId;
|
||||
|
||||
/**
|
||||
* 角色权限
|
||||
*/
|
||||
private String roleAuth;
|
||||
|
||||
private String mainCorpId;
|
||||
|
||||
/**
|
||||
* 用户最高优先级角色
|
||||
*/
|
||||
private SysRoleDO sysRoleDO;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
private Integer licenseType;
|
||||
|
||||
private Integer userType;
|
||||
|
||||
}
|
||||
@@ -53,4 +53,7 @@ public class PreparationCommonPendingVO {
|
||||
private Integer signType;
|
||||
@ApiModelProperty("业务备注")
|
||||
private String businessRemark;
|
||||
|
||||
@ApiModelProperty("签约人2姓名")
|
||||
private String partnershipSignatorySecond;
|
||||
}
|
||||
|
||||
@@ -32,4 +32,8 @@ public interface DataHandlerServer {
|
||||
Boolean dataHandlerV20241012(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
|
||||
ImportTaskDO task);
|
||||
Integer JingDongStageHandler();
|
||||
|
||||
//处理测量 设计 施工 验收 完成
|
||||
Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
|
||||
ImportTaskDO task);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/5/29 16:34
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface EnterpriseService {
|
||||
|
||||
|
||||
/**
|
||||
* 通过手机号获取登录token
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
String getAccessToken(String mobile);
|
||||
|
||||
|
||||
}
|
||||
@@ -954,6 +954,95 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, ImportTaskDO task) {
|
||||
|
||||
List<ImportOaOldShopDataDTO> list = new ArrayList<>();
|
||||
List<ImportOaOldShopDataErrorDTO> errorList = new ArrayList<>();
|
||||
ListUtils.emptyIfNull(dataMapList)
|
||||
.forEach(data -> {
|
||||
try {
|
||||
ImportOaOldShopDataDTO importOaOldShopDataDTO = new ImportOaOldShopDataDTO();
|
||||
importOaOldShopDataDTO.setShopCode(String.valueOf(data.get("门店编码")));
|
||||
list.add(importOaOldShopDataDTO);
|
||||
} catch (Exception e) {
|
||||
log.info("dataHandlerV2025029 转化dto error:{}", JSONObject.toJSONString(data));
|
||||
}
|
||||
});
|
||||
log.info("导入数据条数:{}", list.size());
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
log.info("导入数据转化为空");
|
||||
return false;
|
||||
}
|
||||
List<String> shopCodeList = list.stream().map(ImportOaOldShopDataDTO::getShopCode).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopInfoList = shopInfoDAO.selectByShopCodeList(shopCodeList);
|
||||
if (CollectionUtils.isEmpty(shopInfoList)) {
|
||||
log.info("导入数据根据shopCode 未找到数据");
|
||||
}
|
||||
List<Long> shopIds = shopInfoList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
Map<String, List<ShopInfoDO>> shopMapByCode = shopInfoList.stream().collect(Collectors.groupingBy(ShopInfoDO::getShopCode));
|
||||
//装修验收数据
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
Map<Long, AcceptanceInfoDO> acceptanceInfoMap = acceptanceInfoDOList.stream().collect(Collectors.toMap(AcceptanceInfoDO::getShopId, item -> item));
|
||||
//合同阶段
|
||||
List<ShopStageInfoDO> signFranchiseStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
Map<Long, ShopStageInfoDO> signFranchiseStageMap = signFranchiseStageList.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity()));
|
||||
//装修阶段需要变更的shopId
|
||||
List<Long> fitmentFhopIdList = new ArrayList<>();
|
||||
//装修验收表需要初始化的门店
|
||||
List<Long> initFitmentShopIdList = new ArrayList<>();
|
||||
for (ImportOaOldShopDataDTO dto : list) {
|
||||
String shopCode = dto.getShopCode();
|
||||
List<ShopInfoDO> shopInfoDOS = shopMapByCode.get(shopCode);
|
||||
if (CollectionUtils.isEmpty(shopInfoDOS)){
|
||||
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码未找到"));
|
||||
continue;
|
||||
}
|
||||
if (shopInfoDOS.size() > 1){
|
||||
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码重复"));
|
||||
continue;
|
||||
}
|
||||
ShopInfoDO shopInfoDO = shopInfoDOS.get(0);
|
||||
Long shopId = shopInfoDO.getId();
|
||||
ShopStageInfoDO signFranchiseStage = signFranchiseStageMap.get(shopId);
|
||||
if (!signFranchiseStage.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_84.getShopSubStageStatus())){
|
||||
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "合同阶段未完成"));
|
||||
continue;
|
||||
}
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoMap.get(shopId);
|
||||
if (Objects.isNull(acceptanceInfoDO)){
|
||||
initFitmentShopIdList.add(shopId);
|
||||
}
|
||||
fitmentFhopIdList.add(shopId);
|
||||
}
|
||||
//装修stage
|
||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_863);
|
||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91);
|
||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
|
||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
||||
//装修表初始化
|
||||
acceptanceInfoDAO.initAcceptanceInfo(initFitmentShopIdList);
|
||||
if (!errorList.isEmpty()) {
|
||||
task.setStatus(ImportTaskStatusEnum.ERROR.getCode());
|
||||
String url = null;
|
||||
try {
|
||||
url = easyExcelUtil.exportExcel(ImportOaOldShopDataErrorDTO.class, errorList, null,
|
||||
FileTypeEnum.IMPORT_FITMENT_SHOP_STAGE_DATA_ERROR_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
|
||||
FileTypeEnum.IMPORT_FITMENT_SHOP_STAGE_DATA_ERROR_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
|
||||
} catch (Exception e) {
|
||||
log.info("导出失败列表失败 errorList:{}", JSONObject.toJSONString(errorList));
|
||||
}
|
||||
task.setFileUrl(url);
|
||||
} else {
|
||||
task.setStatus(ImportTaskStatusEnum.SUCCESS.getCode());
|
||||
}
|
||||
task.setTotalNum(dataMapList.size());
|
||||
task.setSuccessNum(dataMapList.size() - errorList.size());
|
||||
importTaskMapper.update(eid, task);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static @NotNull ShopStageInfoDO getShopStageInfoDO(ShopSubStageEnum shopSubStageEnum, ShopStageInfoDO shopStageInfoDO, ShopSubStageStatusEnum shopSubStageStatus) {
|
||||
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
|
||||
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||
|
||||
@@ -698,6 +698,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
SignFranchiseDO signFranchiseDO = signTypeMap.get(x.getShopId());
|
||||
if (signFranchiseDO != null) {
|
||||
preparationCommonPendingVO.setSignType(signFranchiseDO.getSignType());
|
||||
preparationCommonPendingVO.setPartnershipSignatorySecond(signFranchiseDO.getPartnershipSignatorySecond());
|
||||
}
|
||||
preparationCommonPendingVO.setShopCode(shopInfoDO.getShopCode());
|
||||
preparationCommonPendingVO.setJoinMode(shopInfoDO.getJoinMode());
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.Role;
|
||||
import com.cool.store.enums.UserStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.SysRoleMapper;
|
||||
import com.cool.store.service.EnterpriseService;
|
||||
import com.cool.store.userholder.CurrentUser;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.crypto.RandomNumberGenerator;
|
||||
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/5/29 16:34
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class EnterpriseServiceImpl implements EnterpriseService {
|
||||
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Resource
|
||||
SysRoleMapper sysRoleMapper;
|
||||
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String eid;
|
||||
|
||||
@Override
|
||||
public String getAccessToken(String mobile) {
|
||||
CurrentUser currentUser = new CurrentUser();
|
||||
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.selectByMobile(mobile);
|
||||
if (Objects.isNull(enterpriseUser)){
|
||||
throw new ServiceException(ErrorCodeEnum.MOBILE_NOT_EXIST);
|
||||
}
|
||||
if(UserStatusEnum.WAIT_AUDIT.getCode().equals(enterpriseUser.getUserStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.USER_ACCOUNT_WAIT_AUDIT);
|
||||
}
|
||||
//账号冻结
|
||||
if(UserStatusEnum.FREEZE.getCode().equals(enterpriseUser.getUserStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.USER_FREEZE);
|
||||
}
|
||||
SysRoleDO sysRoleDoByUserId = sysRoleMapper.getHighestPrioritySysRoleDoByUserId(enterpriseUser.getUserId());
|
||||
if(sysRoleDoByUserId==null){
|
||||
// 如果没有最高优先级的,给未分配的角色
|
||||
sysRoleDoByUserId = sysRoleMapper.getRoleByRoleEnum(Role.EMPLOYEE.getRoleEnum());
|
||||
}
|
||||
currentUser.setId(enterpriseUser.getId());
|
||||
currentUser.setUserId(enterpriseUser.getUserId());
|
||||
currentUser.setAccount(enterpriseUser.getUserId());
|
||||
currentUser.setDbName("coolcollege_intelligent_10027");
|
||||
currentUser.setDepartmentIds(enterpriseUser.getDepartments());
|
||||
currentUser.setRoles(enterpriseUser.getRoles());
|
||||
currentUser.setLanguage(enterpriseUser.getLanguage());
|
||||
currentUser.setIsAdmin(enterpriseUser.getIsAdmin());
|
||||
|
||||
//设置当前登录人使用的企业相关信息
|
||||
currentUser.setRoleAuth(sysRoleDoByUserId.getRoleAuth());
|
||||
currentUser.setSysRoleDO(sysRoleDoByUserId);
|
||||
currentUser.setEnterpriseId(eid);
|
||||
currentUser.setEnterpriseName("正新集团");
|
||||
currentUser.setEnterpriseLogo("https://oss-store.coolcollege.cn/eid/214ac5a3a517472a87268e02a2e6410a/2405/79049713395952825.jpg");
|
||||
currentUser.setActive(enterpriseUser.getActive());
|
||||
// 企业开通时间
|
||||
try {
|
||||
currentUser.setOpenTime(DateUtils.parseDate("2024-05-09 18:54:28",DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
} catch (ParseException e) {
|
||||
log.error("时间转换异常");
|
||||
}
|
||||
currentUser.setAvatar(enterpriseUser.getAvatar());
|
||||
currentUser.setEmail(enterpriseUser.getEmail());
|
||||
// 水印增加员工工号
|
||||
if (StringUtils.isNotEmpty(enterpriseUser.getJobnumber())) {
|
||||
currentUser.setJobnumber(enterpriseUser.getJobnumber());
|
||||
}
|
||||
// 水印增加员工职位
|
||||
if (StringUtils.isNotEmpty(enterpriseUser.getPosition())) {
|
||||
currentUser.setPosition(enterpriseUser.getPosition());
|
||||
}
|
||||
currentUser.setMobile(enterpriseUser.getMobile());
|
||||
currentUser.setName(enterpriseUser.getName());
|
||||
|
||||
currentUser.setDingCorpId("wpayJeDAAAklx_q1jGhyGUd4yEh8vV_g");
|
||||
|
||||
currentUser.setAccessToken(getToken());
|
||||
currentUser.setAppType("qw_self_dkf");
|
||||
currentUser.setUnionid(enterpriseUser.getUnionid());
|
||||
currentUser.setUserType(enterpriseUser.getUserType());
|
||||
redisUtilPool.setString(RedisConstant.ACCESS_TOKEN_PREFIX + currentUser.getAccessToken(), JSON.toJSONString(currentUser), 24 * 60 * 60);
|
||||
return currentUser.getAccessToken();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println(DateUtils.parseDate("2024-05-09 18:54:28",DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
|
||||
return randomNumberGenerator.nextBytes().toHex();
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,28 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.LineAuditInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.entity.LineAuditInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.AuditResultTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.LineStatusEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AuditCloseRequest;
|
||||
import com.cool.store.request.AuditPassRequest;
|
||||
import com.cool.store.request.AuditRejectRequest;
|
||||
import com.cool.store.request.LineFollowLogRequest;
|
||||
import com.cool.store.service.LineFollowService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -36,6 +42,8 @@ public abstract class LineFlowService {
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
private LineFollowService lineFollowService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
@@ -89,6 +97,11 @@ public abstract class LineFlowService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditClose(AuditCloseRequest request, LoginUserInfo user){
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectByShopStatus(request.getLineId(), Arrays.asList(ShopStatusEnum.DONE.getCode(), ShopStatusEnum.ING.getCode()));
|
||||
if (CollectionUtils.isNotEmpty(shopInfoDOS)){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_HAVE_NOT_OVER_ACCORDING);
|
||||
}
|
||||
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
String partnerId = lineInfo.getPartnerId();
|
||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||
|
||||
@@ -883,7 +883,7 @@ public class PointServiceImpl implements PointService {
|
||||
pointInfoDAO.updatePointInfo(updatePoint);
|
||||
ShopInfoDO updateShop = new ShopInfoDO();
|
||||
updateShop.setId(shopId);
|
||||
updateShop.setShopName(pointInfo.getPointName());
|
||||
// updateShop.setShopName(pointInfo.getPointName());
|
||||
updateShop.setPointId(pointId);
|
||||
updateShop.setRegionId(pointInfo.getRegionId());
|
||||
shopInfoDAO.updateShopInfo(updateShop);
|
||||
@@ -971,7 +971,7 @@ public class PointServiceImpl implements PointService {
|
||||
Long pointId = pointInfoDAO.addPointInfo(pointInfo);
|
||||
pointDetailInfo.setPointId(pointId);
|
||||
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);
|
||||
shopInfo.setShopName(pointInfo.getPointName());
|
||||
// shopInfo.setShopName(pointInfo.getPointName());
|
||||
shopInfo.setPointId(pointId);
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
PointRecommendDO pointRecommendDO = new PointRecommendDO();
|
||||
|
||||
@@ -279,6 +279,10 @@ public class SyncDataServiceImpl implements SyncDataService {
|
||||
return null;
|
||||
}
|
||||
String shopCode = shopInfoDO.getShopCode().trim();
|
||||
if (Objects.isNull(signFranchiseDO)){
|
||||
log.info("合同阶段暂未完成");
|
||||
return "";
|
||||
}
|
||||
Boolean partnershipSignatorySecondIsNull = StringUtils.isBlank(signFranchiseDO.getPartnershipSignatorySecond());
|
||||
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
|
||||
//M10001
|
||||
|
||||
@@ -128,4 +128,28 @@ public class DataHandlerController {
|
||||
public ResponseResult<Integer> JingDongStageHandler() {
|
||||
return ResponseResult.success(dataHandlerServer.JingDongStageHandler());
|
||||
}
|
||||
|
||||
@PostMapping("/dataHandlerV2025029")
|
||||
@ApiOperation("/处理测量 设计 施工 验收 完成")
|
||||
public ResponseResult<Boolean> dataHandlerV2025029(MultipartFile file) {
|
||||
ExcelReader reader = null;
|
||||
try {
|
||||
reader = ExcelUtil.getReader(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
log.error("read file error:", e);
|
||||
}
|
||||
assert reader != null;
|
||||
List<Map<String, Object>> dataMapList = reader.read(0, 1, Integer.MAX_VALUE);
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setFileName(file.getOriginalFilename());
|
||||
importTaskDO.setFileType(FileTypeEnum.IMPORT_FITMENT_SHOP_STAGE.getFileType());
|
||||
importTaskDO.setIsImport(true);
|
||||
importTaskDO.setStatus(ImportTaskStatusEnum.PROGRESS.getCode());
|
||||
importTaskDO.setCreateUserId(CurrentUserHolder.getUserId());
|
||||
importTaskDO.setCreateName(CurrentUserHolder.getUser().getName());
|
||||
importTaskDO.setCreateTime(System.currentTimeMillis());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
dataHandlerServer.dataHandlerV2025029(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO);
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ public class LineAuditController {
|
||||
return ResponseResult.success(bankService.repayment(request));
|
||||
}
|
||||
|
||||
// @ApiOperation("结束跟进")
|
||||
// @PostMapping("/close")
|
||||
// public ResponseResult<Boolean> auditClose(@RequestBody AuditCloseRequest request){
|
||||
// return ResponseResult.success(lineFlowService.auditClose(request, CurrentUserHolder.getUser()));
|
||||
// }
|
||||
@ApiOperation("结束跟进")
|
||||
@PostMapping("/close")
|
||||
public ResponseResult<Boolean> auditClose(@RequestBody AuditCloseRequest request){
|
||||
return ResponseResult.success(lineFlowService.auditClose(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.dto.FoodTokenDTO;
|
||||
import com.cool.store.dto.GetAccessTokenDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||
import com.cool.store.request.GetPasswordDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PushService;
|
||||
import com.cool.store.service.ShopAccountService;
|
||||
import com.cool.store.service.ThirdFoodService;
|
||||
import com.cool.store.service.ThirdXinGuanJiaService;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -40,6 +39,8 @@ public class MiniShopAccountController {
|
||||
|
||||
@Resource
|
||||
ThirdFoodService thirdFoodService;
|
||||
@Resource
|
||||
EnterpriseService enterpriseService;
|
||||
|
||||
|
||||
@ApiOperation("根据门店shopId查询平台账号")
|
||||
@@ -91,4 +92,10 @@ public class MiniShopAccountController {
|
||||
return ResponseResult.success(accountService.shopIdToYlsCode(shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取标品登录token")
|
||||
@GetMapping("/getAccessToken")
|
||||
public ResponseResult<String> getAccessToken() {
|
||||
return ResponseResult.success(enterpriseService.getAccessToken(PartnerUserHolder.getUser().getMobile()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user