Merge branch 'cc_20250428_dateHandler' into 'master'

Cc 20250428 date handler

See merge request hangzhou/java/custom_zxjp!67
This commit is contained in:
王晓鹏
2025-04-29 12:15:58 +00:00
52 changed files with 1591 additions and 251 deletions

View File

@@ -31,6 +31,7 @@ public class CommonConstants {
public static final int TEN_SECONDS = 10000;
public static final int ONE_SECONDS = 1000;
public static final int TOW_SECONDS = 2000;
public static final int MAX_EXPORT_SIZE = 10000;
/**

View File

@@ -0,0 +1,48 @@
package com.cool.store.enums;
import org.apache.commons.lang3.StringUtils;
/**
* @Author: WangShuo
* @Date: 2025/04/28/19:52
* @Version 1.0
* @注释:
*/
public enum DeclareGoodsTypeEnum {
// 0-按1周/次报货 1-按月报货 2-自提 3-按2周/次投货 4-按3周/次投货”
WEEK_ONCE("0", "按1周/次报货"),
MONTH("1", "按月报货"),
SELF_PICKUP("2", "自提"),
TWO_WEEK_ONCE("3", "按2周/次投货"),
THREE_WEEK_ONCE("4", "按3周/次投货");
private String code;
private String name;
DeclareGoodsTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public static String getNameByCode(String code) {
if (StringUtils.isBlank(code)){
return null;
}
for (DeclareGoodsTypeEnum declareGoodsTypeEnum : DeclareGoodsTypeEnum.values()) {
if (declareGoodsTypeEnum.getCode().equals(code)) {
return declareGoodsTypeEnum.getName();
}
}
return null;
}
}

View File

@@ -255,6 +255,7 @@ public enum ErrorCodeEnum {
GET_YLS_CODE_FAIL(151006,"系统无云流水编码无法获取TOKEN请先维护该编码",null),
BANK_EXIST(151007,"当前银行已存在,请直接选择!",null),
EXPORT_LIMIT_1000(151008,"导出数据不能超过1000条请增加筛选条件减少导出数量",null),
;

View File

@@ -14,7 +14,10 @@ public enum FileTypeEnum {
MY_FRANCHISEES("my_franchisees","我的加盟商"),
TEAM_FRANCHISEES("team_franchisees","团队加盟商"),
PREPARATION("preparation","进度管理"),
BRANCH_SHOP_LIST("branchShopList","开店管理")
BRANCH_SHOP_LIST("branchShopList","开店管理"),
EXPORT_FINANCE("exportFinance","财务导出"),
EXPORT_JOIN_SHOP("exportJoinShop","加盟开店申请"),
EXPORT_PROGRESS("exportProgress","进度确认"),
;
private String fileType;
private String desc;

View File

@@ -51,4 +51,16 @@ public enum OpenStatusEnum {
public void setName(String name) {
this.name = name;
}
public static String getByCode(Integer code){
if (code == null){
return null;
}
for (OpenStatusEnum openStatusEnum : OpenStatusEnum.values()) {
if(openStatusEnum.getCode().equals(code)){
return openStatusEnum.getName();
}
}
return null;
}
}

View File

@@ -8,23 +8,25 @@ import java.util.function.Function;
import java.util.stream.Collectors;
public enum SignTypeEnum {
TRANSFER(0,"转让","A104"),
NEW_SIGNING(1,"新签","A101"),
RENEWAL(2,"续签","A102"),
RELOCATION (3,"迁址","A103"),
NEW_SIGNING_INDUSTRIES(5,"新签同异业转化","A105"),
TRANSFER(0,"转让"),
NEW_SIGNING(1,"新签"),
RENEWAL(2,"续签"),
RELOCATION (3,"迁址"),
NEW_SIGNING_INDUSTRIES(5,"新签同异业转化"),
OLD_NEW_OPEN(6,"老店新开"),
DIRECT_SALES_TO_JOINING(7,"直营转加盟"),
;
private Integer code;
private String desc;
private String sap;
SignTypeEnum(Integer code, String desc,String sap) {
SignTypeEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
this.sap =sap;
}
public Integer getCode() {
@@ -43,14 +45,6 @@ public enum SignTypeEnum {
this.desc = desc;
}
public String getSap() {
return sap;
}
public void setSap(String sap) {
this.sap = sap;
}
protected static final Map<Integer, SignTypeEnum> map = Arrays.stream(values()).collect(
Collectors.toMap(SignTypeEnum::getCode, Function.identity()));
@@ -60,4 +54,15 @@ public enum SignTypeEnum {
}
return map.get(code);
}
public static String getDescByCode(Integer code) {
if(code == null) {
return null;
}
SignTypeEnum signTypeEnum = map.get(code);
if(signTypeEnum == null) {
return null;
}
return signTypeEnum.getDesc();
}
}

View File

@@ -0,0 +1,37 @@
package com.cool.store.enums;
/**
* @Author: WangShuo
* @Date: 2025/04/28/19:27
* @Version 1.0
* @注释:
*/
public enum StoreTypeEnum {
//0-无展示门店、1-餐厅店、2-普通门店
NO_SHOW_STORE(0, "无展示门店"),
RESTAURANT_STORE(1, "餐厅店"),
ORDINARY_STORE(2, "普通门店");
private Integer code;
private String message;
StoreTypeEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
public static String getMessage(Integer code) {
if (code == null){
return null;
}
for (StoreTypeEnum c : StoreTypeEnum.values()) {
if (c.getCode().equals(code)) {
return c.message;
}
}
return null;
}
}

View File

@@ -194,6 +194,6 @@ public enum ShopSubStageStatusEnum {
return stageStatusEnum;
}
}
return null;
return SHOP_SUB_STAGE_STATUS_00;
}
}

View File

@@ -1,5 +1,7 @@
package com.cool.store.utils;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import javax.crypto.Mac;
@@ -47,7 +49,7 @@ public class SignatureUtils {
// 拼接排序后的参数
sortedParams.forEach((key, value) ->{
if (Objects.isNull(value)||(value instanceof Double &&((Double) value).intValue()==0)){
if (Objects.isNull(value)|| (value instanceof String && StringUtil.isBlank(value.toString())) || (value instanceof Double &&((Double) value).intValue()==0)){
log.info("0或者空值不参与签名");
}else {
if (value instanceof Double){

View File

@@ -2,10 +2,14 @@ package com.cool.store.dao;
import com.cool.store.entity.BuildInformationDO;
import com.cool.store.mapper.BuildInformationMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @Author: WangShuo
@@ -39,5 +43,17 @@ public class BuildInformationDAO {
return buildInformationMapper.selectOneByExample(example);
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 获取小程序店铺名称 导出用
*/
public List<BuildInformationDO> getSpecificByShopIdList(List<Long> shopIdList) {
if (CollectionUtils.isEmpty(shopIdList)) {
return Collections.emptyList();
}
return buildInformationMapper.getSpecificByShopIdList(shopIdList);
}
}

View File

@@ -95,4 +95,15 @@ public class HyPartnerUserInfoDAO {
return hyPartnerUserInfoMapper.selectLastCrmCreateTime();
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 数据处理专用只处理,盐值 密码 第二密码
*/
public Integer dataHandle(List<HyPartnerUserInfoDO> hyPartnerUserInfoDOList){
if (CollectionUtils.isEmpty(hyPartnerUserInfoDOList)){
return 0;
}
return hyPartnerUserInfoMapper.dataHandle(hyPartnerUserInfoDOList);
}
}

View File

@@ -1,11 +1,15 @@
package com.cool.store.dao;
import com.cool.store.entity.BuildInformationDO;
import com.cool.store.entity.OrderSysInfoDO;
import com.cool.store.mapper.OrderSysInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: WangShuo
@@ -34,4 +38,12 @@ public class OrderSysInfoDAO {
example.createCriteria().andEqualTo("shopId",orderSysInfoDO.getShopId());
return orderSysInfoMapper.updateByExampleSelective(orderSysInfoDO,example);
}
//只获取特定几个字段值
public List<OrderSysInfoDO> getSpecificByShopIdList(List<Long> shopIdList){
if (CollectionUtils.isEmpty(shopIdList)){
return new ArrayList<>();
}
return orderSysInfoMapper.getSpecificByShopIdList(shopIdList);
}
}

View File

@@ -4,6 +4,7 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.MiniShopDTO;
import com.cool.store.dto.PCPointListDTO;
import com.cool.store.dto.PointInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.mapper.PointInfoMapper;
@@ -97,6 +98,13 @@ public class PointInfoDAO {
return pointInfoMapper.getPointListByIds(pointIds);
}
public List<PointInfoDTO> getPointAndDetailByIds(List<Long> pointIds){
if(CollectionUtils.isEmpty(pointIds)){
return Lists.newArrayList();
}
return pointInfoMapper.getPointAndDetailByIds(pointIds);
}
public Page<PCPointListDTO> getRecommendPointList(RecommendPointPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return pointInfoMapper.getRecommendPointList(request);

View File

@@ -45,7 +45,7 @@ public class QualificationsInfoDAO {
return qualificationsInfoMapper.getByLineId(lineId);
}
public List<QualificationsInfoDO> getByLineIds(@Param("lineIds") List<Long> lineIds){
if (lineIds==null||lineIds.size()==0){
if (lineIds==null|| lineIds.isEmpty()){
return new java.util.ArrayList<>();
}
Example example = new Example(QualificationsInfoDO.class);

View File

@@ -11,6 +11,7 @@ import com.cool.store.utils.StringUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
@@ -133,6 +134,28 @@ public class ShopAccountDAO {
return shopAccountMapper.getALlFail();
}
public List<ShopAccountDO> getByShopIds(List<Long> shopIds){
Example example = new Example(ShopAccountDO.class);
example.createCriteria().andIn("shopId", shopIds);
return shopAccountMapper.selectByExample(example);
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 数据处理专用只处理,盐值 密码 第二密码
*/
public Integer dateHandle(List<ShopAccountDO> list){
return shopAccountMapper.dateHandle(list);
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 获取特定字段 导出用
*/
public List<ShopAccountDO> getSpecificByShopIds(List<Long> shopIds){
return shopAccountMapper.getSpecificByShopIds(shopIds);
}
}

View File

@@ -263,4 +263,13 @@ public class ShopInfoDAO {
}
return shopInfoMapper.currentShopWhetherOpen(shopId,eid);
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 数据处理专用获取2025年4月19号之后,并且没有生成密码的门店
*/
public List<ShopInfoDO> getListByTime(){
return shopInfoMapper.getListByTime();
}
}

View File

@@ -418,5 +418,15 @@ public class ShopStageInfoDAO {
}
return shopStageInfos;
}
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 获取特定阶段 用作导出
*/
public List<ShopStageInfoDO> getShopSubStages(List<Long> shopIds) {
if (CollectionUtils.isEmpty(shopIds)){
return new ArrayList<>();
}
return shopStageInfoMapper.getShopSubStages(shopIds);
}
}

View File

@@ -1,8 +1,11 @@
package com.cool.store.mapper;
import com.cool.store.entity.BuildInformationDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @author EDY
@@ -12,6 +15,8 @@ import tk.mybatis.mapper.common.Mapper;
*/
public interface BuildInformationMapper extends Mapper<BuildInformationDO> {
List<BuildInformationDO> getSpecificByShopIdList(@Param("list") List<Long> shopIdList);
}

View File

@@ -51,4 +51,6 @@ public interface HyPartnerUserInfoMapper {
int updatePasswordByPartnerId(@Param("record") HyPartnerUserInfoDO record);
Integer dataHandle(@Param("list") List<HyPartnerUserInfoDO> hyPartnerUserInfoDOList);
}

View File

@@ -1,8 +1,11 @@
package com.cool.store.mapper;
import com.cool.store.entity.OrderSysInfoDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @Author: WangShuo
@@ -11,4 +14,6 @@ import tk.mybatis.mapper.common.Mapper;
* @注释:
*/
public interface OrderSysInfoMapper extends Mapper<OrderSysInfoDO> {
List<OrderSysInfoDO> getSpecificByShopIdList(@Param("list") List<Long> shopIdList);
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.dto.MiniShopDTO;
import com.cool.store.dto.PCPointListDTO;
import com.cool.store.dto.PointInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.request.*;
@@ -116,4 +117,6 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
* @description:获取全部可推荐铺位
*/
List<MiniPointPageVO> getRecommendOrMyList(@Param("request") MiniPointRequest request);
List<PointInfoDTO> getPointAndDetailByIds(@Param("pointIds") List<Long> pointIds);
}

View File

@@ -87,5 +87,15 @@ public interface ShopAccountMapper extends Mapper<ShopAccountDO> {
List<ShopAccountDO> getALlFail();
Integer dateHandle(@Param("list") List<ShopAccountDO> list);
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 获取特定字段
*/
List<ShopAccountDO> getSpecificByShopIds(@Param("shopIds") List<Long> shopIds);
}

View File

@@ -137,4 +137,6 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
MiniShopsResponse currentShopWhetherOpen(@Param("shopId")Long shopId,@Param("eid")String eid);
List<ShopInfoDO> getListByTime();
}

View File

@@ -169,4 +169,6 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
List<PlatformBuildStageDTO> getPlatformBuildStage( @Param("shopIds") List<Long> shopIds);
Integer getAllNumber(@Param("shopId") Long shopId,@Param("flag")Integer flag);
List<ShopStageInfoDO> getShopSubStages(@Param("shopIds") List<Long> shopIds);
}

View File

@@ -17,4 +17,6 @@ public interface WarehouseInfoMapper extends Mapper<WarehouseInfoDO> {
List<WarehouseInfoDO> getAllAndActive(@Param("keyword") String keyword);
WarehouseInfoDO getByCode(@Param("code") String code);
List<WarehouseInfoDO> getAll();
}

View File

@@ -53,4 +53,12 @@
create_time,update_time,create_user,
update_user,c_shop_name,settler_bank_back_photo_url,settler_is_same_partner,juridical_is_same_partner
</sql>
<select id="getSpecificByShopIdList" resultType="com.cool.store.entity.BuildInformationDO">
select shop_id as shopId, c_shop_name as cShopName
from xfsg_build_information
where shop_id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@@ -1,173 +1,193 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyPartnerUserInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerUserInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="user_channel_id" jdbcType="BIGINT" property="userChannelId" />
<result column="crm_create_time" jdbcType="TIMESTAMP" property="crmCreateTime" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="downstream_system_salting" jdbcType="VARCHAR" property="downstreamSystemSalting" />
<result column="downstream_system_password" jdbcType="VARCHAR" property="downstreamSystemPassword" />
<result column="downstream_system_secondary_password" jdbcType="VARCHAR" property="downstreamSystemSecondaryPassword" />
</resultMap>
<sql id="Base_Column_List">
id, partner_id, mobile, create_time, update_time, user_channel_id, crm_create_time, openid, downstream_system_salting, downstream_system_password,downstream_system_secondary_password
</sql>
<select id="selectByPartnerId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where partner_id = #{partnerId}
</select>
<select id="selectByMobile" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where mobile = #{mobile}
</select>
<select id="selectByOpenid" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where openid = #{openid}
</select>
<select id="selectByPartnerIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
<where>
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
</where>
</select>
<select id="selectLastCrmCreateTime" resultType="java.lang.String">
SELECT crm_create_time as crmCreateTime FROM xfsg_partner_user_info ORDER BY crm_create_time desc limit 1
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerUserInfoDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="partner_id" jdbcType="VARCHAR" property="partnerId"/>
<result column="mobile" jdbcType="VARCHAR" property="mobile"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="user_channel_id" jdbcType="BIGINT" property="userChannelId"/>
<result column="crm_create_time" jdbcType="TIMESTAMP" property="crmCreateTime"/>
<result column="openid" jdbcType="VARCHAR" property="openid"/>
<result column="downstream_system_salting" jdbcType="VARCHAR" property="downstreamSystemSalting"/>
<result column="downstream_system_password" jdbcType="VARCHAR" property="downstreamSystemPassword"/>
<result column="downstream_system_secondary_password" jdbcType="VARCHAR"
property="downstreamSystemSecondaryPassword"/>
</resultMap>
<sql id="Base_Column_List">
id, partner_id, mobile, create_time, update_time, user_channel_id, crm_create_time, openid,
downstream_system_salting, downstream_system_password,downstream_system_secondary_password
</sql>
<select id="selectByPartnerId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where partner_id = #{partnerId}
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into xfsg_partner_user_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
partner_id,
</if>
<if test="record.mobile != null">
mobile,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.userChannelId!=null">
user_channel_id,
</if>
<if test="record.ecWantShopArea!=null">
ec_want_shop_area,
</if>
<if test="record.crmCreateTime!=null">
crm_create_time,
</if>
<if test="record.openid!=null">
openid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
#{record.partnerId},
</if>
<if test="record.mobile != null">
#{record.mobile},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.userChannelId != null">
#{record.userChannelId},
</if>
<if test="record.ecWantShopArea != null">
#{record.ecWantShopArea},
</if>
<if test="record.crmCreateTime != null">
#{record.crmCreateTime},
</if>
<if test="record.openid != null">
#{record.openid},
</if>
</trim>
</insert>
<select id="selectByMobile" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where mobile = #{mobile}
</select>
<update id="updateByPrimaryKeySelective">
update xfsg_partner_user_info
<set>
<if test="record.partnerId != null">
partner_id = #{record.partnerId},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.ecWantShopArea != null">
ec_want_shop_area = #{record.ecWantShopArea},
</if>
<if test="record.openid != null">
openid = #{record.openid},
</if>
</set>
where id = #{record.id}
</update>
<select id="selectByOpenid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
where openid = #{openid}
</select>
<update id="updateByPartnerId">
update xfsg_partner_user_info
<set>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where partner_id = #{record.partnerId}
</update>
<update id="updatePasswordByPartnerId">
update xfsg_partner_user_info
<set>
<if test="record.downstreamSystemSalting != null">
downstream_system_salting = #{record.downstreamSystemSalting},
</if>
<if test="record.downstreamSystemPassword != null">
downstream_system_password = #{record.downstreamSystemPassword},
</if>
<if test="record.downstreamSystemSecondaryPassword != null">
downstream_system_secondary_password = #{record.downstreamSystemSecondaryPassword},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where partner_id = #{record.partnerId}
</update>
<select id="selectByPartnerIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from xfsg_partner_user_info
<where>
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
</where>
</select>
<select id="selectLastCrmCreateTime" resultType="java.lang.String">
SELECT crm_create_time as crmCreateTime FROM xfsg_partner_user_info ORDER BY crm_create_time desc limit 1
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into xfsg_partner_user_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
partner_id,
</if>
<if test="record.mobile != null">
mobile,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.userChannelId!=null">
user_channel_id,
</if>
<if test="record.ecWantShopArea!=null">
ec_want_shop_area,
</if>
<if test="record.crmCreateTime!=null">
crm_create_time,
</if>
<if test="record.openid!=null">
openid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
#{record.partnerId},
</if>
<if test="record.mobile != null">
#{record.mobile},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.userChannelId != null">
#{record.userChannelId},
</if>
<if test="record.ecWantShopArea != null">
#{record.ecWantShopArea},
</if>
<if test="record.crmCreateTime != null">
#{record.crmCreateTime},
</if>
<if test="record.openid != null">
#{record.openid},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update xfsg_partner_user_info
<set>
<if test="record.partnerId != null">
partner_id = #{record.partnerId},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.ecWantShopArea != null">
ec_want_shop_area = #{record.ecWantShopArea},
</if>
<if test="record.openid != null">
openid = #{record.openid},
</if>
</set>
where id = #{record.id}
</update>
<update id="updateByPartnerId">
update xfsg_partner_user_info
<set>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where partner_id = #{record.partnerId}
</update>
<update id="updatePasswordByPartnerId">
update xfsg_partner_user_info
<set>
<if test="record.downstreamSystemSalting != null">
downstream_system_salting = #{record.downstreamSystemSalting},
</if>
<if test="record.downstreamSystemPassword != null">
downstream_system_password = #{record.downstreamSystemPassword},
</if>
<if test="record.downstreamSystemSecondaryPassword != null">
downstream_system_secondary_password = #{record.downstreamSystemSecondaryPassword},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where partner_id = #{record.partnerId}
</update>
<update id="dataHandle">
<foreach collection="list" item="item" separator=";">
update xfsg_partner_user_info
<set>
<if test="item.downstreamSystemSalting != null">
downstream_system_salting = #{item.downstreamSystemSalting},
</if>
<if test="item.downstreamSystemPassword != null">
downstream_system_password = #{item.downstreamSystemPassword},
</if>
<if test="item.downstreamSystemSecondaryPassword != null">
downstream_system_secondary_password = #{item.downstreamSystemSecondaryPassword},
</if>
</set>
where id = #{item.id}
</foreach>
</update>
</mapper>

View File

@@ -41,4 +41,18 @@
receiving_create_time, receiving_update_time, receiving_create_user, receiving_update_user,
declare_goods_type
</sql>
<select id="getSpecificByShopIdList" resultType="com.cool.store.entity.OrderSysInfoDO">
select
shop_id as shopId,
declare_goods_logistics_warehouse as declareGoodsLogisticsWarehouse,
declare_goods_type as declareGoodsType,
declare_goods_date as declareGoodsDate,
receiving_firm_name as receivingFirmName,
receiving_ms_bank_account as receivingMsBankAccount
from xfsg_order_sys_info
where shop_id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@@ -311,6 +311,20 @@
#{request.areaCode})
</if>
</select>
<select id="getPointAndDetailByIds" resultType="com.cool.store.dto.PointInfoDTO">
select a.id as pointId,
a.province as province,
a.city as city,
a.district as district,
a.point_area as pointArea,
b.month_rent as monthRent
from xfsg_point_info a
left join xfsg_point_detail_info b on a.id = b.point_id
where a.id in
<foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
#{pointId}
</foreach>
</select>
<update id="recyclePoint">
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status

View File

@@ -158,11 +158,36 @@
#{shopId}
</foreach>
</update>
<update id="dateHandle">
<foreach collection="list" item="item" separator=";">
update xfsg_shop_account
<set>
<if test="item.passwordSalt != null">
password_salt = #{item.passwordSalt},
</if>
<if test="item.password != null">
password = #{item.password},
</if>
<if test="item.secondaryPassword != null">
secondary_password = #{item.secondaryPassword},
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<select id="getALlFail">
<select id="getALlFail">
select * from xfsg_shop_account WHERE
system_name in ('火码POS')
and status = 6
</select>
<select id="getSpecificByShopIds" resultType="com.cool.store.entity.ShopAccountDO">
select shop_id as shopId,system_name as systemName,status from xfsg_shop_account
where shop_id in
<foreach collection="shopIds" item="shopId" open="(" close=")" separator=",">
#{shopId}
</foreach>
</select>
</mapper>

View File

@@ -276,6 +276,8 @@
select
a.id as id,
a.line_id as lineId,
a.point_id as pointId,
a.store_type as storeType,
a.shop_name as shopName,
a.want_shop_area_id as wantShopAreaId,
a.shop_code as shopCode,
@@ -455,6 +457,17 @@
from xfsg_shop_info
where deleted = 0 and line_id = #{lineId} and shop_code is not null
</select>
<select id="getListByTime" resultType="com.cool.store.entity.ShopInfoDO">
select a.id as id ,
a.create_time,
a.partner_id as partnerId,
a.line_id as lineId
from xfsg_shop_info a
LEFT JOIN xfsg_partner_user_info b ON a.partner_id = b.partner_id
where
a.create_time >= '2025-04-19 00:00:00'
and b.downstream_system_salting is null;
</select>
<update id="batchUpdate" parameterType="list">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">

View File

@@ -417,4 +417,18 @@
where
shop_id = #{shopId} and deleted = 0 and is_terminated = 1 and shop_stage in (1,2)
</select>
<select id="getShopSubStages" resultType="com.cool.store.entity.ShopStageInfoDO">
select shop_id as shopId,
shop_sub_stage as shopSubStage,
shop_sub_stage_status as shopSubStageStatus,
is_terminated as isTerminated,
actual_complete_time as actualCompleteTime
from xfsg_shop_stage_info where shop_stage = 2 or shop_stage = 1 or shop_sub_stage = 230 or shop_sub_stage = 240
<if test="shopIds !=null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
</mapper>

View File

@@ -18,7 +18,7 @@
limit 1
</select>
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
select contract_code,shop_id,contract_start_time,contract_end_time,contract_amount,create_time,partnership_signatory_first,partnership_signatory_second
select contract_code,shop_id,sign_type,contract_start_time,contract_end_time,contract_amount,create_time,partnership_signatory_first,partnership_signatory_second
from xfsg_sign_franchise
where 1=1
<if test="list !=null and list.size >0">

View File

@@ -20,4 +20,7 @@
<select id="getByCode" resultType="com.cool.store.entity.WarehouseInfoDO">
select * from xfsg_warehouse_info where warehouse_code = #{code}
</select>
<select id="getAll" resultType="com.cool.store.entity.WarehouseInfoDO">
select * from xfsg_warehouse_info
</select>
</mapper>

View File

@@ -15,6 +15,6 @@ public class DeclareGoodsDateDTO {
@ApiModelProperty(value = "报货日期,例如:星期一(星期六,星期天)/每月1号")
private String declareGoods;
@ApiModelProperty(value = "货日期,例如:星期一(星期六,星期天)/每月1号")
@ApiModelProperty(value = "货日期,例如:星期一(星期六,星期天)/每月1号")
private String deliverGoods;
}

View File

@@ -0,0 +1,167 @@
package com.cool.store.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/04/28/17:29
* @Version 1.0
* @注释:
*/
@Data
public class ExportFinanceDTO {
@ExcelProperty(value = "门店编码", order = 1)
@ColumnWidth(20)
private String shopCode;
@ExcelProperty(value = "签约门店名称", order = 2)
@ColumnWidth(25)
private String shopName;
@ExcelProperty(value = "所属品牌", order = 3)
@ColumnWidth(20)
private String franchiseBrand;
@ExcelProperty(value = "签约类型", order = 4)
@ColumnWidth(20)
private String signType;
@ExcelProperty(value = "加盟模式", order = 5) // 调整了 order 值
@ColumnWidth(20)
private String joinMode;
@ExcelProperty(value = "加盟商姓名", order = 6) // 原先是 5现在调整为 6
@ColumnWidth(20)
private String username;
@ExcelProperty(value = "加盟商手机号", order = 7) // 原先是 6现在调整为 7
@ColumnWidth(20)
private String mobile;
@ExcelProperty(value = "所属大区", order = 8) // 原先是 7现在调整为 8
@ColumnWidth(20)
private String regionName;
@ExcelProperty(value = "督导", order = 9) // 原先是 8现在调整为 9
@ColumnWidth(20)
private String investmentManagerName;
@ExcelProperty(value = "签约人1姓名", order = 10) // 原先是 9现在调整为 10
@ColumnWidth(20)
private String partnershipSignatoryFirst;
@ExcelProperty(value = "签约人1手机号", order = 11) // 原先是 10现在调整为 11
@ColumnWidth(20)
private String partnershipSignatoryFirstMobile;
@ExcelProperty(value = "签约人1身份证号码", order = 12) // 原先是 11现在调整为 12
@ColumnWidth(30)
private String partnershipSignatoryFirstIdCard;
@ExcelProperty(value = "签约人2姓名", order = 13) // 原先是 12现在调整为 13
@ColumnWidth(20)
private String partnershipSignatorySecond;
@ExcelProperty(value = "签约人2手机号", order = 14) // 原先是 13现在调整为 14
@ColumnWidth(20)
private String partnershipSignatorySecondMobile;
@ExcelProperty(value = "签约人2身份证号码", order = 15) // 原先是 14现在调整为 15
@ColumnWidth(30)
private String partnershipSignatorySecondIdCard;
@ExcelProperty(value = "合同编号", order = 16) // 原先是 15现在调整为 16
@ColumnWidth(20)
private String contractCode;
@ExcelProperty(value = "签约时间", order = 17) // 原先是 16现在调整为 17
@ColumnWidth(20)
private String signTime;
@ExcelProperty(value = "第一年加盟开始日期", order = 18) // 原先是 17现在调整为 18
@ColumnWidth(30)
private String firstYearStartTime;
@ExcelProperty(value = "第一年管理费到期日期", order = 19) // 原先是 18现在调整为 19
@ColumnWidth(30)
private String firstYearEndTime;
@ExcelProperty(value = "加盟费(含税)", order = 20) // 原先是 19现在调整为 20
@ColumnWidth(20)
private String franchiseFee;
@ExcelProperty(value = "第一年度管理费(含税)", order = 21) // 原先是 20现在调整为 21
@ColumnWidth(40)
private String firstYearManagementFee;
@ExcelProperty(value = "设计费(含税)", order = 22) // 原先是 21现在调整为 22
@ColumnWidth(20)
private String performanceBond;
@ExcelProperty(value = "保证金(含税)", order = 23) // 原先是 22现在调整为 23
@ColumnWidth(20)
private String loanMargin;
@ExcelProperty(value = "第一年度品牌使用费(含税)", order = 24) // 原先是 23现在调整为 24
@ColumnWidth(40)
private String firstYearFee;
@ExcelProperty(value = "合计缴费金额(含税)", order = 25) // 原先是 24现在调整为 25
@ColumnWidth(30)
private String totalAmountContributions;
@ExcelProperty(value = "加盟费优惠原因", order = 26) // 原先是 25现在调整为 26
@ColumnWidth(30)
private String discountReason;
@ExcelProperty(value = "合同金额", order = 27) // 原先是 26现在调整为 27
@ColumnWidth(20)
private String contractAmount;
@ExcelProperty(value = "缴款人", order = 28) // 原先是 27现在调整为 28
@ColumnWidth(20)
private String payUserName;
@ExcelProperty(value = "第1次缴纳时间", order = 29) // 原先是 28现在调整为 29
@ColumnWidth(20)
private String firstPayTime;
@ExcelProperty(value = "第2次缴纳时间", order = 30)
@ColumnWidth(30)
private String secondPayTime;
@ExcelProperty(value = "第3次缴纳时间", order = 31)
@ColumnWidth(30)
private String thirdPayTime;
@ExcelProperty(value = "第4次缴纳时间", order = 32)
@ColumnWidth(30)
private String fourthPayTime;
@ExcelProperty(value = "店铺地址", order = 33)
@ColumnWidth(40)
private String shopAddress;
@ExcelProperty(value = "阶段状态-缴纳加盟费/保证金", order = 34)
@ColumnWidth(40)
private String franchiseFeeStageStatus;
@ExcelProperty(value = "阶段状态-加盟合同签约", order = 35)
@ColumnWidth(30)
private String signFranchiseStageStatus;
@ExcelProperty(value = "阶段状态-建店资料收集", order = 36)
@ColumnWidth(30)
private String buildInformationStatus;
@ExcelProperty(value = "当前进度", order = 37)
@ColumnWidth(20)
private String currentProgress;
@ExcelProperty(value = "状态", order = 38)
@ColumnWidth(15)
private String shopStatus;
}

View File

@@ -0,0 +1,170 @@
package com.cool.store.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/04/28/18:41
* @Version 1.0
* @注释:
*/
@Data
public class ExportJoinShopDTO {
@ExcelProperty(value = "门店编码", order = 1)
@ColumnWidth(20)
private String shopCode;
@ExcelProperty(value = "签约门店名称", order = 2)
@ColumnWidth(25)
private String shopName;
@ExcelProperty(value = "门店类型", order = 3)
@ColumnWidth(20)
private String storeType;
@ExcelProperty(value = "签约类型", order = 4)
@ColumnWidth(20)
private String signType;
@ExcelProperty(value = "加盟模式", order = 5)
@ColumnWidth(20)
private String joinMode;
@ExcelProperty(value = "加盟商姓名", order = 6)
@ColumnWidth(20)
private String username;
@ExcelProperty(value = "加盟商手机号", order = 7)
@ColumnWidth(20)
private String mobile;
@ExcelProperty(value = "所属大区", order = 8)
@ColumnWidth(20)
private String regionName;
@ExcelProperty(value = "督导", order = 9)
@ColumnWidth(20)
private String investmentManagerName;
@ExcelProperty(value = "签约人1姓名", order = 10)
@ColumnWidth(20)
private String partnershipSignatoryFirst;
@ExcelProperty(value = "签约人1手机号", order = 11)
@ColumnWidth(20)
private String partnershipSignatoryFirstMobile;
@ExcelProperty(value = "签约人1身份证号码", order = 12)
@ColumnWidth(30)
private String partnershipSignatoryFirstIdCard;
@ExcelProperty(value = "签约人2姓名", order = 13)
@ColumnWidth(20)
private String partnershipSignatorySecond;
@ExcelProperty(value = "签约人2手机号", order = 14)
@ColumnWidth(20)
private String partnershipSignatorySecondMobile;
@ExcelProperty(value = "签约人2身份证号码", order = 15)
@ColumnWidth(30)
private String partnershipSignatorySecondIdCard;
@ExcelProperty(value = "合同编号", order = 16)
@ColumnWidth(20)
private String contractCode;
@ExcelProperty(value = "第一年加盟开始日期", order = 17)
@ColumnWidth(30)
private String firstYearStartTime;
@ExcelProperty(value = "第一年管理费到期日期", order = 18)
@ColumnWidth(30)
private String firstYearEndTime;
@ExcelProperty(value = "加盟费(含税)", order = 19)
@ColumnWidth(20)
private String franchiseFee;
@ExcelProperty(value = "第一年度管理费(含税)", order = 20)
@ColumnWidth(40)
private String firstYearManagementFee;
@ExcelProperty(value = "设计费(含税)", order = 21)
@ColumnWidth(20)
private String performanceBond;
@ExcelProperty(value = "保证金(含税)", order = 22)
@ColumnWidth(20)
private String loanMargin;
@ExcelProperty(value = "第一年度品牌使用费(含税)", order = 23)
@ColumnWidth(40)
private String firstYearFee;
@ExcelProperty(value = "合计缴费金额(含税)", order = 24)
@ColumnWidth(30)
private String totalAmountContributions;
@ExcelProperty(value = "加盟费优惠原因", order = 25)
@ColumnWidth(30)
private String discountReason;
@ExcelProperty(value = "店面租金", order = 26)
@ColumnWidth(20)
private String monthRent;
@ExcelProperty(value = "", order = 27)
@ColumnWidth(15)
private String province;
@ExcelProperty(value = "", order = 28)
@ColumnWidth(15)
private String city;
@ExcelProperty(value = "", order = 29)
@ColumnWidth(15)
private String district;
@ExcelProperty(value = "场地实际面积", order = 30)
@ColumnWidth(15)
private String area;
@ExcelProperty(value = "报货物流仓库", order = 31)
@ColumnWidth(25)
private String declareGoodsLogisticsWarehouseName;
@ExcelProperty(value = "报货类型", order = 32)
@ColumnWidth(20)
private String declareGoodsType;
@ExcelProperty(value = "云流水报货时间", order = 33)
@ColumnWidth(35)
private String ylsDeclareGoodsTime;
@ExcelProperty(value = "仓库配送时间", order = 34)
@ColumnWidth(35)
private String warehouseDeliveryTime;
@ExcelProperty(value = "收款公司", order = 35)
@ColumnWidth(35)
private String receivingFirmName;
@ExcelProperty(value = "收款公司民生银行账号", order = 36)
@ColumnWidth(35)
private String receivingMsBankAccount;
@ExcelProperty(value = "店铺地址", order = 37)
@ColumnWidth(40)
private String shopAddress;
@ExcelProperty(value = "阶段状态-建店资料收集", order = 38)
@ColumnWidth(30)
private String buildInformationStatus;
@ExcelProperty(value = "建店资料完成时间", order = 39)
@ColumnWidth(30)
private String buildInformationEndTime;
}

View File

@@ -0,0 +1,162 @@
package com.cool.store.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/04/28/20:11
* @Version 1.0
* @注释:
*/
@Data
public class ExportProgressDTO {
@ExcelProperty(value = "门店编码", order = 1)
@ColumnWidth(20)
private String shopCode;
@ExcelProperty(value = "签约门店名称", order = 2)
@ColumnWidth(25)
private String shopName;
@ExcelProperty(value = "点餐小程序门店名称", order = 3)
@ColumnWidth(30)
private String miniProgramsShopName;
@ExcelProperty(value = "门店类型", order = 4)
@ColumnWidth(20)
private String storeType;
@ExcelProperty(value = "签约类型", order = 5)
@ColumnWidth(20)
private String signType;
@ExcelProperty(value = "所属品牌", order = 6)
@ColumnWidth(20)
private String franchiseBrand;
@ExcelProperty(value = "加盟模式", order = 7)
@ColumnWidth(20)
private String joinMode;
@ExcelProperty(value = "加盟商姓名", order = 8)
@ColumnWidth(20)
private String username;
@ExcelProperty(value = "加盟商手机号", order = 9)
@ColumnWidth(20)
private String mobile;
@ExcelProperty(value = "所属大区", order = 10)
@ColumnWidth(20)
private String regionName;
@ExcelProperty(value = "督导", order = 11)
@ColumnWidth(20)
private String investmentManagerName;
@ExcelProperty(value = "火码POS账号状态", order = 12)
@ColumnWidth(25)
private String posStatus;
@ExcelProperty(value = "云流水账号状态", order = 13)
@ColumnWidth(25)
private String ylsStatus;
@ExcelProperty(value = "营帐通开通状态", order = 14)
@ColumnWidth(25)
private String yztStatus;
@ExcelProperty(value = "信发系统开通状态", order = 15)
@ColumnWidth(25)
private String xfStatus;
@ExcelProperty(value = "新掌柜账号状态", order = 16)
@ColumnWidth(25)
private String xzgStatus;
@ExcelProperty(value = "美团团购账号状态", order = 17)
@ColumnWidth(25)
private String mtgStatus;
@ExcelProperty(value = "抖音团购账号", order = 18)
@ColumnWidth(25)
private String dygStatus;
@ExcelProperty(value = "快手团购账号状态", order = 19)
@ColumnWidth(25)
private String ksgStatus;
@ExcelProperty(value = "饿了么外卖账号状态", order = 20)
@ColumnWidth(25)
private String elmStatus;
@ExcelProperty(value = "美团外卖账号状态", order = 21)
@ColumnWidth(25)
private String mtwStatus;
@ExcelProperty(value = "京东外卖账号状态", order = 22)
@ColumnWidth(25)
private String jdwStatus;
@ExcelProperty(value = "选址", order = 23)
@ColumnWidth(20)
private String addressStatus;
@ExcelProperty(value = "租赁合同", order = 24)
@ColumnWidth(20)
private String leaseStatus;
@ExcelProperty(value = "缴纳加盟费/保证金", order = 25)
@ColumnWidth(25)
private String joinFeeStatus;
@ExcelProperty(value = "加盟合同签约", order = 26)
@ColumnWidth(20)
private String joinContractStatus;
@ExcelProperty(value = "营业执照", order = 27)
@ColumnWidth(20)
private String businessLicenseStatus;
@ExcelProperty(value = "食品经营许可证", order = 28)
@ColumnWidth(20)
private String foodLicenseStatus;
@ExcelProperty(value = "建店资料收集", order = 29)
@ColumnWidth(20)
private String buildStatus;
@ExcelProperty(value = "建店资料完成时间", order = 30)
@ColumnWidth(25)
private String buildEndTime;
@ExcelProperty(value = "设计阶段", order = 31)
@ColumnWidth(20)
private String designStatus;
@ExcelProperty(value = "施工阶段", order = 32)
@ColumnWidth(20)
private String constructionStatus;
@ExcelProperty(value = "装修验收", order = 33)
@ColumnWidth(20)
private String decorationStatus;
@ExcelProperty(value = "培训登记", order = 34)
@ColumnWidth(15)
private String trainStatus;
@ExcelProperty(value = "开业运营方案", order = 35)
@ColumnWidth(20)
private String openPlanStatus;
@ExcelProperty(value = "当前进度", order = 36)
@ColumnWidth(30)
private String currentProgress;
@ExcelProperty(value = "状态", order = 37)
@ColumnWidth(20)
private String shopStatus;
}

View File

@@ -32,7 +32,7 @@ public class FranchiseFeeDTO {
private String firstYearManagementFee;
//第一年度品牌使用费
private String firstYearFee;
//履约保证金
//设计费
private String performanceBond;
//组合字段
private String combinedField;

View File

@@ -0,0 +1,24 @@
package com.cool.store.dto;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/04/28/19:35
* @Version 1.0
* @注释:
*/
@Data
public class PointInfoDTO {
private Long pointId;
private String province;
private String city;
private String pointArea;
private String district;
private String monthRent;
}

View File

@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Table(name = "xfsg_shop_accounts")
@Table(name = "xfsg_shop_account")
@Data
public class ShopAccountDO {
/**

View File

@@ -19,6 +19,9 @@ import java.util.List;
public class BranchShopResponse {
private Long shopId;
private Long lineId;
private Long pointId;
@ApiModelProperty("门店类型")
private Integer storeType;
@ApiModelProperty("加盟商姓名")
private String username;
@ApiModelProperty("加盟商手机号")

View File

@@ -39,7 +39,7 @@ public class FranchiseFeeResponse {
private Date thirdYearEndTime;
@ApiModelProperty("第仨年度加盟费")
private String thirdYearFee;
@ApiModelProperty("履约保证金")
@ApiModelProperty("设计费")
private String performanceBond;
private Date createTime;
private Date updateTime;

View File

@@ -18,4 +18,10 @@ public interface ExportRealizeService {
void branchShopList(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
void exportFinance(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
void exportJoinShop(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
void exportProgress(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.enums.FileTypeEnum;
import com.cool.store.request.*;
/**
@@ -12,4 +13,10 @@ import com.cool.store.request.*;
public interface ExportService {
Long branchShopList(BranchShopRequest request,LoginUserInfo user);
//进度管理页面通用导出入口
//财务导出 //加盟开店申请 //进度确认
Long exportProgressBase(BranchShopRequest request, LoginUserInfo user, FileTypeEnum fileTypeEnum);
}

View File

@@ -79,8 +79,11 @@ public interface ShopAccountService {
String shopCodeToYlsCode(String shopCode);
/**
* @Auther: wangshuo
* @Date: 2025/4/28
* @description: 4月19号之后的门店对老数据密码第二密码盐值处理
*/
Boolean handleOldData();
}

View File

@@ -35,6 +35,8 @@ import java.util.stream.Collectors;
@Service
public class BuildInformationServiceImpl implements BuildInformationService {
@Resource
private WarehouseInfoMapper warehouseInfoMapper;
@Resource
private UserAuthMappingService userAuthMappingService;
@Resource
@@ -55,8 +57,7 @@ public class BuildInformationServiceImpl implements BuildInformationService {
private CommonService commonService;
@Autowired
private OrderSysInfoDAO orderSysInfoDAO;
@Resource
private WarehouseInfoMapper warehouseInfoMapper;
@Override
public BuildInformationResponse getBuildInformation(Long shopId) {

View File

@@ -5,11 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.dto.ExportBranchShopDTO;
import com.cool.store.dto.FranchiseFeeDTO;
import com.cool.store.dto.*;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.Preparation.ScheduleDTO;
import com.cool.store.dto.PreparationScheduleDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
@@ -19,6 +17,7 @@ import com.cool.store.mapper.*;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.response.BranchShopResponse;
import com.cool.store.service.*;
import com.cool.store.utils.JSONUtils;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.easyExcel.EasyExcelUtil;
@@ -26,6 +25,7 @@ import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.StringUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
@@ -59,6 +59,17 @@ import static com.cool.store.utils.poi.DateUtils.*;
@Service
@Slf4j
public class ExportRealizeServiceImpl implements ExportRealizeService {
@Resource
private ShopAccountDAO shopaccountDAO;
@Resource
private WarehouseInfoMapper warehouseInfoMapper;
@Resource
private OrderSysInfoDAO orderSysInfoDAO;
@Resource
private BuildInformationDAO buildInformationDAO;
@Resource
private PointInfoDAO pointInfoDAO;
@Resource
private FranchiseFeeMapper franchiseFeeMapper;
@Resource
@@ -224,7 +235,8 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
case 740:
dto.setFranchiseFeeStageStatus("审核未通过");
break;
default: dto.setFranchiseFeeStageStatus("");
default:
dto.setFranchiseFeeStageStatus("");
}
Integer signFranchisesStageStatus = signFranchisesStageMap.getOrDefault(response.getShopId(), 0);
switch (signFranchisesStageStatus) {
@@ -237,7 +249,8 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
case 840:
dto.setSignFranchiseStageStatus("已签约");
break;
default: dto.setSignFranchiseStageStatus("");
default:
dto.setSignFranchiseStageStatus("");
}
dto.setCurrentProgress(response.getCompletionColumn() + "/" + response.getTotalColumn());
dto.setShopStatus(response.getShopStatus());
@@ -263,6 +276,342 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
}
@Override
@Async
public void exportFinance(List<BranchShopResponse> list, ImportTaskDO importTaskDO) {
Boolean flag = Boolean.TRUE;
String url = "";
List<ExportFinanceDTO> exportList = new ArrayList<>();
try {
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
List<FranchiseFeeDTO> franchiseFees = franchiseFeeMapper.getPayTimeByShopIds(shopIds);
List<ShopStageInfoDO> franchiseFeeStages = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage());
Map<Long, Integer> franchiseFeeStageMap = franchiseFeeStages.stream().filter(o -> o.getShopId() != null).collect(Collectors.toMap(ShopStageInfoDO::getShopId, ShopStageInfoDO::getShopSubStageStatus));
List<ShopStageInfoDO> signFranchisesStages = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
Map<Long, Integer> signFranchisesStageMap = signFranchisesStages.stream().filter(o -> o.getShopId() != null).collect(Collectors.toMap(ShopStageInfoDO::getShopId, ShopStageInfoDO::getShopSubStageStatus));
List<ShopStageInfoDO> buildStages = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
Map<Long, Integer> buildStageMap = buildStages.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, ShopStageInfoDO::getShopSubStageStatus));
Map<Long, List<Date>> payTimeMap = new HashMap<>();
for (FranchiseFeeDTO dto : franchiseFees) {
List<Date> payTimeList = JsonToDate(dto.getCombinedField());
if (dto.getPayTime() != null) {
payTimeList.add(dto.getPayTime());
}
Collections.sort(payTimeList);
payTimeMap.put(dto.getShopId(), payTimeList);
}
Map<Long, FranchiseFeeDTO> franchiseFeeDTOMap = franchiseFees.stream().filter(o -> o.getShopId() != null)
.collect(Collectors.toMap(FranchiseFeeDTO::getShopId, Function.identity()));
Map<Long, SignFranchiseDO> signFranchiseMap = new HashMap<>();
if (signFranchises != null) {
signFranchiseMap = signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, Function.identity()));
}
for (BranchShopResponse response : list) {
ExportFinanceDTO dto = new ExportFinanceDTO();
dto.setShopAddress(response.getShopAddress());
dto.setUsername(response.getUsername());
dto.setMobile(response.getMobile());
FranchiseFeeDTO franchiseFeeDTO = franchiseFeeDTOMap.get(response.getShopId());
if (ObjectUtils.isNotEmpty(franchiseFeeDTO)) {
dto.setFirstYearStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearStartTime()));
dto.setFirstYearEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearEndTime()));
String total = (new BigInteger(franchiseFeeDTO.getPerformanceBond()).add(new BigInteger(franchiseFeeDTO.getFirstYearFee()))
.add(new BigInteger(franchiseFeeDTO.getFirstYearManagementFee()))
.add(new BigInteger(franchiseFeeDTO.getYearFranchiseFee()))
.add(new BigInteger(franchiseFeeDTO.getLoanMargin())).toString());
dto.setTotalAmountContributions(total);
dto.setFranchiseFee(franchiseFeeDTO.getYearFranchiseFee());
dto.setLoanMargin(franchiseFeeDTO.getLoanMargin());
dto.setPerformanceBond(franchiseFeeDTO.getPerformanceBond());
dto.setFirstYearManagementFee(franchiseFeeDTO.getFirstYearManagementFee());
dto.setFirstYearFee(franchiseFeeDTO.getFirstYearFee());
dto.setPayUserName(franchiseFeeDTO.getPayUserName());
dto.setDiscountReason(franchiseFeeDTO.getDiscountReason());
}
dto.setShopName(response.getShopName());
dto.setShopCode(response.getShopCode());
dto.setRegionName(response.getRegionName());
dto.setJoinMode(JoinModeEnum.getByCode(response.getJoinMode()));
dto.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(response.getFranchiseBrand()));
dto.setInvestmentManagerName(response.getInvestmentManagerName());
SignFranchiseDO signFranchiseDO = signFranchiseMap.get(response.getShopId());
if (signFranchiseDO != null) {
dto.setContractAmount(signFranchiseDO.getContractAmount());
dto.setContractCode(signFranchiseDO.getContractCode());
dto.setSignTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getCreateTime()));
dto.setPartnershipSignatoryFirst(signFranchiseDO.getPartnershipSignatoryFirst());
dto.setPartnershipSignatorySecond(signFranchiseDO.getPartnershipSignatorySecond());
dto.setSignType(SignTypeEnum.getDescByCode(signFranchiseDO.getSignType()));
}
List<Date> payTime = payTimeMap.getOrDefault(response.getShopId(), new ArrayList<>());
for (int i = 0; i < payTime.size() && i <= 3; i++) {
switch (i) {
case 0:
dto.setFirstPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTime.get(i)));
break;
case 1:
dto.setSecondPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTime.get(i)));
break;
case 2:
dto.setThirdPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTime.get(i)));
break;
case 3:
dto.setFourthPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTime.get(i)));
break;
}
}
Integer franchiseFeeStageStatus = franchiseFeeStageMap.getOrDefault(response.getShopId(), 0);
ShopSubStageStatusEnum franchiseFeeStageStatusEnum = ShopSubStageStatusEnum.getShopSubStageStatusEnum(franchiseFeeStageStatus);
dto.setFranchiseFeeStageStatus(franchiseFeeStageStatusEnum.getShopSubStageStatusName());
Integer signFranchisesStageStatus = signFranchisesStageMap.getOrDefault(response.getShopId(), 0);
ShopSubStageStatusEnum signFranchisesStageStatusEnum = ShopSubStageStatusEnum.getShopSubStageStatusEnum(signFranchisesStageStatus);
dto.setSignFranchiseStageStatus(signFranchisesStageStatusEnum.getShopSubStageStatusName());
Integer buildStage = buildStageMap.get(response.getShopId());
dto.setBuildInformationStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(buildStage).getShopSubStageStatusName());
dto.setCurrentProgress(response.getCompletionColumn() + "/" + response.getTotalColumn());
dto.setShopStatus(response.getShopStatus());
exportList.add(dto);
}
url = easyExcelUtil.exportExcel(ExportFinanceDTO.class, exportList, null,
FileTypeEnum.EXPORT_FINANCE.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
FileTypeEnum.EXPORT_FINANCE.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
} catch (Throwable e) {
flag = Boolean.FALSE;
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.EXPORT_FINANCE.getDesc(), e);
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
} finally {
if (flag) {
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
importTaskDO.setFileUrl(url);
} else {
importTaskDO.setStatus(ImportStatusEnum.fail.getCode());
}
importTaskMapper.update(eid, importTaskDO);
}
}
@Override
@Async
public void exportJoinShop(List<BranchShopResponse> list, ImportTaskDO importTaskDO) {
Boolean flag = Boolean.TRUE;
String url = "";
List<ExportJoinShopDTO> exportList = new ArrayList<>();
try {
List<WarehouseInfoDO> warehouseInfoMapperAll = warehouseInfoMapper.getAll();
Map<String, String> warehouseInfoMap = warehouseInfoMapperAll.stream().collect(Collectors.toMap(WarehouseInfoDO::getWarehouseCode, WarehouseInfoDO::getWarehouseName));
Set<Long> pointIds = list.stream().map(BranchShopResponse::getPointId).collect(Collectors.toSet());
List<PointInfoDTO> pointInfoDOS = pointInfoDAO.getPointAndDetailByIds(new ArrayList<>(pointIds));
Map<Long, PointInfoDTO> pointInfoDOMap = pointInfoDOS.stream().collect(Collectors.toMap(PointInfoDTO::getPointId, dto -> dto));
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
List<FranchiseFeeDTO> franchiseFees = franchiseFeeMapper.getPayTimeByShopIds(shopIds);
List<ShopStageInfoDO> buildStages = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
Map<Long, ShopStageInfoDO> buildStageMap = buildStages.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity()));
Map<Long, FranchiseFeeDTO> franchiseFeeDTOMap = franchiseFees.stream().filter(o -> o.getShopId() != null)
.collect(Collectors.toMap(FranchiseFeeDTO::getShopId, Function.identity()));
Map<Long, SignFranchiseDO> signFranchiseMap = new HashMap<>();
if (signFranchises != null) {
signFranchiseMap = signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, Function.identity()));
}
List<OrderSysInfoDO> orderSysInfoDOList = orderSysInfoDAO.getSpecificByShopIdList(shopIds);
Map<Long, OrderSysInfoDO> orderSysInfoDOMap = orderSysInfoDOList.stream().collect(Collectors.toMap(OrderSysInfoDO::getShopId, Function.identity()));
for (BranchShopResponse response : list) {
ExportJoinShopDTO dto = new ExportJoinShopDTO();
OrderSysInfoDO orderSysInfoDO = orderSysInfoDOMap.get(response.getShopId());
if (orderSysInfoDO != null) {
dto.setDeclareGoodsType(DeclareGoodsTypeEnum.getNameByCode(orderSysInfoDO.getDeclareGoodsType()));
dto.setDeclareGoodsLogisticsWarehouseName(warehouseInfoMap.getOrDefault(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse(), ""));
if (StringUtils.isNotBlank(orderSysInfoDO.getDeclareGoodsDate())
&& !DeclareGoodsTypeEnum.SELF_PICKUP.getCode().equals(orderSysInfoDO.getDeclareGoodsType())) {
List<DeclareGoodsDateDTO> declareGoodsDates = JSONUtils.parseToListOrMap(orderSysInfoDO.getDeclareGoodsDate(), new TypeReference<List<DeclareGoodsDateDTO>>() {
});
if (CollectionUtils.isNotEmpty(declareGoodsDates)) {
StringBuilder declareGoodsTime = new StringBuilder();
StringBuilder deliverGoodsTime = new StringBuilder();
for (DeclareGoodsDateDTO declareGoodsDateDTO : declareGoodsDates) {
declareGoodsTime.append("报货日期:").append(declareGoodsDateDTO.getDeclareGoods()).append(",");
deliverGoodsTime.append("送货日期:").append(declareGoodsDateDTO.getDeliverGoods()).append(",");
}
dto.setYlsDeclareGoodsTime(declareGoodsTime.toString());
dto.setWarehouseDeliveryTime(deliverGoodsTime.toString());
}
}
dto.setReceivingFirmName(orderSysInfoDO.getReceivingFirmName());
dto.setReceivingMsBankAccount(orderSysInfoDO.getReceivingMsBankAccount());
}
PointInfoDTO pointInfoDTO = pointInfoDOMap.get(response.getPointId());
if (pointInfoDTO != null) {
dto.setProvince(pointInfoDTO.getProvince());
dto.setCity(pointInfoDTO.getCity());
dto.setDistrict(pointInfoDTO.getDistrict());
dto.setArea(pointInfoDTO.getPointArea());
dto.setMonthRent(pointInfoDTO.getMonthRent());
}
dto.setUsername(response.getUsername());
dto.setMobile(response.getMobile());
dto.setShopAddress(response.getShopAddress());
FranchiseFeeDTO franchiseFeeDTO = franchiseFeeDTOMap.get(response.getShopId());
dto.setStoreType(StoreTypeEnum.getMessage(response.getStoreType()));
if (ObjectUtils.isNotEmpty(franchiseFeeDTO)) {
dto.setFirstYearStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearStartTime()));
dto.setFirstYearEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearEndTime()));
String total = (new BigInteger(franchiseFeeDTO.getPerformanceBond()).add(new BigInteger(franchiseFeeDTO.getFirstYearFee()))
.add(new BigInteger(franchiseFeeDTO.getFirstYearManagementFee()))
.add(new BigInteger(franchiseFeeDTO.getYearFranchiseFee()))
.add(new BigInteger(franchiseFeeDTO.getLoanMargin())).toString());
dto.setTotalAmountContributions(total);
dto.setFranchiseFee(franchiseFeeDTO.getYearFranchiseFee());
dto.setLoanMargin(franchiseFeeDTO.getLoanMargin());
dto.setPerformanceBond(franchiseFeeDTO.getPerformanceBond());
dto.setFirstYearManagementFee(franchiseFeeDTO.getFirstYearManagementFee());
dto.setFirstYearFee(franchiseFeeDTO.getFirstYearFee());
dto.setDiscountReason(franchiseFeeDTO.getDiscountReason());
}
dto.setShopName(response.getShopName());
dto.setShopCode(response.getShopCode());
dto.setRegionName(response.getRegionName());
dto.setJoinMode(JoinModeEnum.getByCode(response.getJoinMode()));
dto.setInvestmentManagerName(response.getInvestmentManagerName());
SignFranchiseDO signFranchiseDO = signFranchiseMap.get(response.getShopId());
if (signFranchiseDO != null) {
dto.setContractCode(signFranchiseDO.getContractCode());
dto.setPartnershipSignatoryFirst(signFranchiseDO.getPartnershipSignatoryFirst());
dto.setPartnershipSignatorySecond(signFranchiseDO.getPartnershipSignatorySecond());
dto.setSignType(SignTypeEnum.getDescByCode(signFranchiseDO.getSignType()));
}
ShopStageInfoDO buildStageInfoDO = buildStageMap.get(response.getShopId());
if (buildStageInfoDO != null) {
Integer buildStage = buildStageInfoDO.getShopSubStageStatus();
dto.setBuildInformationStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(buildStage).getShopSubStageStatusName());
if (buildStageInfoDO.getIsTerminated()) {
dto.setBuildInformationEndTime(buildStageInfoDO.getActualCompleteTime());
}
}
exportList.add(dto);
}
url = easyExcelUtil.exportExcel(ExportJoinShopDTO.class, exportList, null,
FileTypeEnum.EXPORT_JOIN_SHOP.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
FileTypeEnum.EXPORT_JOIN_SHOP.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
} catch (Throwable e) {
flag = Boolean.FALSE;
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.EXPORT_JOIN_SHOP.getDesc(), e);
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
} finally {
if (flag) {
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
importTaskDO.setFileUrl(url);
} else {
importTaskDO.setStatus(ImportStatusEnum.fail.getCode());
}
importTaskMapper.update(eid, importTaskDO);
}
}
@Override
@Async
public void exportProgress(List<BranchShopResponse> list, ImportTaskDO importTaskDO) {
Boolean flag = Boolean.TRUE;
String url = "";
List<ExportProgressDTO> exportList = new ArrayList<>();
try {
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
List<BuildInformationDO> buildInformationDOList = buildInformationDAO.getSpecificByShopIdList(shopIds);
Map<Long, String> cShopNameMap = new HashMap<>();
for (BuildInformationDO buildInformationDO : buildInformationDOList) {
String cShopName = buildInformationDO.getCShopName();
if (StringUtils.isBlank(cShopName)) {
cShopName = "";
}
cShopNameMap.put(buildInformationDO.getShopId(), cShopName);
}
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
Map<Long, SignFranchiseDO> signFranchiseMap = new HashMap<>();
if (signFranchises != null) {
signFranchiseMap = signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, Function.identity()));
}
List<ShopAccountDO> shopAccountList = shopaccountDAO.getSpecificByShopIds(shopIds);
Map<Long, List<ShopAccountDO>> shopAccountMap = shopAccountList.stream().collect(Collectors.groupingBy(ShopAccountDO::getShopId, Collectors.toList()));
List<ShopStageInfoDO> shopSubStages = shopStageInfoDAO.getShopSubStages(shopIds);
Map<Long, List<ShopStageInfoDO>> shopSubStageMap = shopSubStages.stream().collect(Collectors.groupingBy(ShopStageInfoDO::getShopId, Collectors.toList()));
for (BranchShopResponse response : list) {
ExportProgressDTO dto = new ExportProgressDTO();
SignFranchiseDO signFranchiseDO = signFranchiseMap.get(response.getShopId());
if (signFranchiseDO != null) {
dto.setSignType(SignTypeEnum.getDescByCode(signFranchiseDO.getSignType()));
}
dto.setStoreType(StoreTypeEnum.getMessage(response.getStoreType()));
dto.setUsername(response.getUsername());
dto.setMobile(response.getMobile());
dto.setShopName(response.getShopName());
dto.setShopCode(response.getShopCode());
dto.setRegionName(response.getRegionName());
dto.setJoinMode(JoinModeEnum.getByCode(response.getJoinMode()));
dto.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(response.getFranchiseBrand()));
dto.setInvestmentManagerName(response.getInvestmentManagerName());
dto.setShopStatus(response.getShopStatus());
List<ShopStageInfoDO> shopStageInfos = shopSubStageMap.get(response.getShopId());
if (CollectionUtils.isNotEmpty(shopStageInfos)) {
Map<Integer, ShopStageInfoDO> map = shopStageInfos.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, Function.identity()));
dto.setAddressStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setLeaseStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_2.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setJoinFeeStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setJoinContractStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setBusinessLicenseStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setFoodLicenseStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_4.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
ShopStageInfoDO buildStage = map.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
if (buildStage != null) {
dto.setBuildStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(buildStage.getShopSubStageStatus()).getShopSubStageStatusName());
if (buildStage.getIsTerminated()) {
dto.setBuildEndTime(buildStage.getActualCompleteTime());
}
}
dto.setDesignStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_9.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setConstructionStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_11.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setDecorationStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setTrainStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_5.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setOpenPlanStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_14.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setYztStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_24.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
dto.setXfStatus(ShopSubStageStatusEnum.getShopSubStageStatusEnum(map.getOrDefault(ShopSubStageEnum.SHOP_STAGE_23.getShopSubStage(), new ShopStageInfoDO()).getShopSubStageStatus()).getShopSubStageStatusName());
}
List<ShopAccountDO> shopAccountDOS = shopAccountMap.getOrDefault(response.getShopId(), new ArrayList<>());
if (CollectionUtils.isNotEmpty(shopAccountDOS)) {
Map<String, ShopAccountDO> accountDOMap = shopAccountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, Function.identity()));
dto.setPosStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.HUOMA.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setYlsStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.YLS.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setXzgStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.XZG.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setMtgStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.MTTG.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setDygStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.DY.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setKsgStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.KS.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setElmStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.ELM.getSystemName(), new ShopAccountDO()).getStatus()));
dto.setMtwStatus(OpenStatusEnum.getByCode(accountDOMap.getOrDefault(ShopAccountEnum.MT.getSystemName(), new ShopAccountDO()).getStatus()));
}
dto.setMiniProgramsShopName(cShopNameMap.getOrDefault(response.getShopId(), ""));
dto.setCurrentProgress(response.getCompletionColumn() + "/" + response.getTotalColumn());
exportList.add(dto);
}
url = easyExcelUtil.exportExcel(ExportProgressDTO.class, exportList, null,
FileTypeEnum.EXPORT_PROGRESS.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
FileTypeEnum.EXPORT_PROGRESS.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
} catch (Throwable e) {
flag = Boolean.FALSE;
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.EXPORT_PROGRESS.getDesc(), e);
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
} finally {
if (flag) {
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
importTaskDO.setFileUrl(url);
} else {
importTaskDO.setStatus(ImportStatusEnum.fail.getCode());
}
importTaskMapper.update(eid, importTaskDO);
}
}
private String toString(Object o) {
if (o == null) {
return "";
@@ -271,7 +620,7 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
}
private List<Date> JsonToDate(String json) {
if (StringUtils.isBlank(json)){
if (StringUtils.isBlank(json)) {
return new ArrayList<>();
}
ObjectMapper mapper = new ObjectMapper();

View File

@@ -73,8 +73,6 @@ public class ExportServiceImpl implements ExportService {
private ShopService shopService;
@Override
public Long branchShopList(BranchShopRequest request, LoginUserInfo user) {
request.setPageSize(CommonConstants.MAX_EXPORT_SIZE + 100);
@@ -86,7 +84,7 @@ public class ExportServiceImpl implements ExportService {
return CommonConstants.ZERO_LONG;
} else if (total > CommonConstants.MAX_EXPORT_SIZE) {
exportList.addAll(branchShopList.getList().subList(0, CommonConstants.MAX_EXPORT_SIZE));
}else {
} else {
exportList.addAll(branchShopList.getList());
}
ImportTaskDO importTaskDO = new ImportTaskDO();
@@ -102,5 +100,42 @@ public class ExportServiceImpl implements ExportService {
return total;
}
@Override
public Long exportProgressBase(BranchShopRequest request, LoginUserInfo user, FileTypeEnum fileTypeEnum) {
request.setPageSize(CommonConstants.ONE_SECONDS+10);
request.setPageNum(CommonConstants.ONE);
PageInfo<BranchShopResponse> branchShopList = shopService.getBranchShopList(request, user.getUserId());
long total = branchShopList.getTotal();
if (total == CommonConstants.ZERO) {
return CommonConstants.ZERO_LONG;
} else if (total > CommonConstants.ONE_SECONDS) {
throw new ServiceException(ErrorCodeEnum.EXPORT_LIMIT_1000);
}
ImportTaskDO importTaskDO = new ImportTaskDO();
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
importTaskDO.setFileName(fileTypeEnum.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
importTaskDO.setIsImport(Boolean.FALSE);
importTaskDO.setFileType(fileTypeEnum.getFileType());
importTaskDO.setCreateUserId(user.getUserId());
importTaskDO.setCreateTime(new Date().getTime());
importTaskDO.setCreateName(user.getName());
importTaskMapper.insert(eid, importTaskDO);
switch (fileTypeEnum) {
case EXPORT_FINANCE:
exportRealizeService.exportFinance(branchShopList.getList(), importTaskDO);
break;
case EXPORT_JOIN_SHOP:
exportRealizeService.exportJoinShop(branchShopList.getList(), importTaskDO);
break;
case EXPORT_PROGRESS:
exportRealizeService.exportProgress(branchShopList.getList(), importTaskDO);
break;
default:
log.error("导出类型错误");
break;
}
return total;
}
}

View File

@@ -6,17 +6,16 @@ import com.cool.store.dto.AccountEntryStatusAuditDTO;
import com.cool.store.dto.ModifyPasswordDTO;
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
import com.cool.store.dto.AccountEntryStatusChangeDTO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.entity.OldShopDO;
import com.cool.store.entity.ShopAccountDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.GetPasswordDTO;
import com.cool.store.request.PostAndOrderRequest;
import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.service.*;
import com.cool.store.utils.PasswordUtil;
import com.cool.store.utils.StringUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
@@ -24,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -33,7 +33,8 @@ import java.util.stream.Collectors;
*/
@Service
public class ShopAccountServiceImpl implements ShopAccountService {
@Resource
QualificationsInfoDAO qualificationsInfoDAO;
@Resource
ShopAccountDAO shopAccountDAO;
@Resource
@@ -52,29 +53,31 @@ public class ShopAccountServiceImpl implements ShopAccountService {
PosAndOrderInfoService posAndOrderInfoService;
@Resource
OldShopDAO oldShopDAO;
@Resource
ThirdXinGuanJiaService thirdXinGuanJiaService;
@Override
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
if (Objects.isNull(shopId)){
if (Objects.isNull(shopId)) {
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE);
}
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)){
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
List<ShopAccountDO> shopAccountDOS = shopAccountDAO.selectByShopId(shopId);
List<ShopAccountDTO> result= new ArrayList<>();
if (CollectionUtils.isEmpty(shopAccountDOS)){
List<ShopAccountDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(shopAccountDOS)) {
return result;
}
shopAccountDOS.forEach(x->{
shopAccountDOS.forEach(x -> {
ShopAccountDTO shopAccountDTO = new ShopAccountDTO();
shopAccountDTO.setBoundPhone(x.getBoundPhone());
shopAccountDTO.setShopId(x.getShopId());
shopAccountDTO.setSystemName(x.getSystemName());
shopAccountDTO.setAccount(x.getAccount());
if (ShopAccountEnum.getSpecialList().contains(x.getSystemName())){
if (ShopAccountEnum.getSpecialList().contains(x.getSystemName())) {
shopAccountDTO.setAccount(shopInfo.getShopCode());
}
shopAccountDTO.setPassword(x.getPassword());
@@ -90,10 +93,10 @@ public class ShopAccountServiceImpl implements ShopAccountService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean modifyPassword(ModifyPasswordDTO modifyPasswordDTO){
public Boolean modifyPassword(ModifyPasswordDTO modifyPasswordDTO) {
//查询
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(modifyPasswordDTO.getShopId());
if (Objects.isNull(shopInfo)){
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(shopInfo.getPartnerId());
@@ -106,7 +109,7 @@ public class ShopAccountServiceImpl implements ShopAccountService {
List<Long> shopIdList = shopInfoDAO.getShopIdList(shopInfo.getLineId());
//批量修改密码 密码盐
shopAccountDAO.batchUpdatePasswordByShopIds(shopIdList,modifyPasswordDTO.getPassword(),modifyPasswordDTO.getSecondaryPassword(),modifyPasswordDTO.getPasswordSalt(),new Date());
shopAccountDAO.batchUpdatePasswordByShopIds(shopIdList, modifyPasswordDTO.getPassword(), modifyPasswordDTO.getSecondaryPassword(), modifyPasswordDTO.getPasswordSalt(), new Date());
//当前加盟商所有开店成功的CODE
List<String> shopCodeList = shopInfoDAO.getShopCodeList(shopInfo.getLineId());
@@ -121,100 +124,100 @@ public class ShopAccountServiceImpl implements ShopAccountService {
}
@Override
public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType){
return syncDataService.getData(shopId,systemType);
public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType) {
return syncDataService.getData(shopId, systemType);
}
@Override
public Boolean auditAccount(AccountAuditDTO accountAuditDTO) {
if (accountAuditDTO.getShopId()==null||accountAuditDTO.getAuditFlag()==null||accountAuditDTO.getShopAccountEnum()==null){
if (accountAuditDTO.getShopId() == null || accountAuditDTO.getAuditFlag() == null || accountAuditDTO.getShopAccountEnum() == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(accountAuditDTO.getShopId());
if (CollectionUtils.isEmpty(accountDOS)){
if (CollectionUtils.isEmpty(accountDOS)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
ShopAccountDO shopAccountDO = map.get(accountAuditDTO.getShopAccountEnum().getSystemName());
if (Objects.isNull(shopAccountDO)){
if (Objects.isNull(shopAccountDO)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getStatus())){
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getStatus())) {
throw new ServiceException(ErrorCodeEnum.CURRENT_STATUS_NOT_OPERATION);
}
//同一份数据到新管家
List<String> list = new ArrayList<>(Arrays.asList(shopAccountDO.getSystemName()));
if (ShopAccountEnum.YLS.equals(accountAuditDTO.getShopAccountEnum())){
List<String> list = new ArrayList<>(Arrays.asList(shopAccountDO.getSystemName()));
if (ShopAccountEnum.YLS.equals(accountAuditDTO.getShopAccountEnum())) {
list.add(ShopAccountEnum.XZG.getSystemName());
}
if (ShopAccountEnum.XZG.equals(accountAuditDTO.getShopAccountEnum())){
if (ShopAccountEnum.XZG.equals(accountAuditDTO.getShopAccountEnum())) {
list.add(ShopAccountEnum.YLS.getSystemName());
}
OpenStatusEnum openStatusEnum = accountAuditDTO.getAuditFlag() == 1 ? OpenStatusEnum.OPENSTATUSENUM_4 : OpenStatusEnum.OPENSTATUSENUM_3;
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(),list,openStatusEnum.getCode(),null,null);
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(), list, openStatusEnum.getCode(), null, null);
return Boolean.TRUE;
}
@Override
public Boolean accountEntryStatusAudit(AccountEntryStatusAuditDTO dto) {
if (dto.getShopId()==null||dto.getAuditFlag()==null){
if (dto.getShopId() == null || dto.getAuditFlag() == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(dto.getShopId());
if (CollectionUtils.isEmpty(accountDOS)){
if (CollectionUtils.isEmpty(accountDOS)) {
return Boolean.FALSE;
}
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.HUOMA.getSystemName());
if (Objects.isNull(shopAccountDO)){
if (Objects.isNull(shopAccountDO)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getEntryStatus())){
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getEntryStatus())) {
throw new ServiceException(ErrorCodeEnum.CURRENT_STATUS_NOT_OPERATION);
}
OpenStatusEnum openStatusEnum = dto.getAuditFlag() == 1 ? OpenStatusEnum.OPENSTATUSENUM_4 : OpenStatusEnum.OPENSTATUSENUM_3;
//修改进件状态
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(),Arrays.asList(shopAccountDO.getSystemName()),openStatusEnum.getCode());
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(), Arrays.asList(shopAccountDO.getSystemName()), openStatusEnum.getCode());
return Boolean.TRUE;
}
@Override
public Boolean accountEntryStatusChange(AccountEntryStatusChangeDTO dto) {
if (dto.getShopId()==null||dto.getEntryStatus()==null){
if (dto.getShopId() == null || dto.getEntryStatus() == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(dto.getShopId());
if (CollectionUtils.isEmpty(accountDOS)){
if (CollectionUtils.isEmpty(accountDOS)) {
return Boolean.FALSE;
}
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.HUOMA.getSystemName());
if (Objects.isNull(shopAccountDO)){
if (Objects.isNull(shopAccountDO)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
//不是审核中 已进件 进件失败状态不支持修改
if (!OpenStatusEnum.getSpecialList().contains(shopAccountDO.getEntryStatus())){
if (!OpenStatusEnum.getSpecialList().contains(shopAccountDO.getEntryStatus())) {
throw new ServiceException(ErrorCodeEnum.CURRENT_ENTRY_STATUS_NOT_OPERATION);
}
//修改进件状态
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(),Arrays.asList(shopAccountDO.getSystemName()),dto.getEntryStatus());
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(), Arrays.asList(shopAccountDO.getSystemName()), dto.getEntryStatus());
return Boolean.TRUE;
}
@Override
public Boolean pushData(AccountAuditDTO accountAuditDTO) {
if (accountAuditDTO.getShopId()==null||accountAuditDTO.getShopAccountEnum()==null){
if (accountAuditDTO.getShopId() == null || accountAuditDTO.getShopAccountEnum() == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
DownSystemTypeEnum downSystemTypeEnum = DownSystemTypeEnum.XGJ;
if ( ShopAccountEnum.HUOMA.equals(accountAuditDTO.getShopAccountEnum())){
if (ShopAccountEnum.HUOMA.equals(accountAuditDTO.getShopAccountEnum())) {
downSystemTypeEnum = DownSystemTypeEnum.POS;
}
ZxjpApiRequest data = this.getData(accountAuditDTO.getShopId(), downSystemTypeEnum);
if (DownSystemTypeEnum.POS.equals(downSystemTypeEnum)){
if (DownSystemTypeEnum.POS.equals(downSystemTypeEnum)) {
Boolean successFlag = pushService.pushDataToPOS(data);
OpenStatusEnum openStatusEnum = successFlag ? OpenStatusEnum.OPENSTATUSENUM_5 : OpenStatusEnum.OPENSTATUSENUM_6;
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(),Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()),openStatusEnum.getCode(),new Date(),null);
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(), Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), openStatusEnum.getCode(), new Date(), null);
//阶段完成
PostAndOrderRequest postAndOrderRequest = new PostAndOrderRequest();
postAndOrderRequest.setShopId(accountAuditDTO.getShopId());
@@ -222,8 +225,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
postAndOrderRequest.setRemark("已为您开通系统账号和密码密码已加密初始密码为身份证后6位可通过加盟小程序修改密码后续由运营经理服务请您联系您督导或者经理添加我们运营经理微信感谢您的配合");
postAndOrderRequest.setAccount(data.getPartnerMobile());
postAndOrderRequest.setPassword(data.getDownstreamSystemPassword());
posAndOrderInfoService.submitOrUpdate(postAndOrderRequest,null);
}else {
posAndOrderInfoService.submitOrUpdate(postAndOrderRequest, null);
} else {
pushService.pushDataToXGJ(data);
}
return Boolean.TRUE;
@@ -232,34 +235,82 @@ public class ShopAccountServiceImpl implements ShopAccountService {
@Override
public String shopIdToYlsCode(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)){
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(shopId);
if (CollectionUtils.isEmpty(accountDOS)){
if (CollectionUtils.isEmpty(accountDOS)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.YLS.getSystemName());
if (Objects.isNull(shopAccountDO)){
if (Objects.isNull(shopAccountDO)) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
return StringUtil.isEmpty(shopAccountDO.getAccount())?shopInfo.getShopCode():shopAccountDO.getAccount();
return StringUtil.isEmpty(shopAccountDO.getAccount()) ? shopInfo.getShopCode() : shopAccountDO.getAccount();
}
@Override
public String shopCodeToYlsCode(String shopCode) {
ShopInfoDO shopInfoDO = shopInfoDAO.selectByStoreCode(shopCode);
if (!Objects.isNull(shopInfoDO)){
if (!Objects.isNull(shopInfoDO)) {
return this.shopIdToYlsCode(shopInfoDO.getId());
}
//查询老店关联表数据
OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode);
if (Objects.isNull(oldShopDO)){
if (Objects.isNull(oldShopDO)) {
throw new ServiceException(ErrorCodeEnum.GET_YLS_CODE_FAIL);
}
return oldShopDO.getYlsShopCode();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean handleOldData() {
List<ShopInfoDO> shopList = shopInfoDAO.getListByTime();
if (CollectionUtils.isEmpty(shopList)) {
return false;
}
Map<String, List<ShopInfoDO>> shopMap = shopList.stream().collect(Collectors.groupingBy(ShopInfoDO::getPartnerId));
Set<String> partnerIds = shopList.stream().map(ShopInfoDO::getPartnerId).collect(Collectors.toSet());
Set<Long> lineIdSet = shopList.stream().map(ShopInfoDO::getLineId).collect(Collectors.toSet());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(new ArrayList<>(partnerIds));
List<QualificationsInfoDO> qualificationsInfoDOList = qualificationsInfoDAO.getByLineIds(new ArrayList<>(lineIdSet));
Map<String, QualificationsInfoDO> qualificationsInfoDOMap = qualificationsInfoDOList.stream().collect(Collectors.toMap(QualificationsInfoDO::getPartnerId, Function.identity()));
List<ShopAccountDO> updateList = new ArrayList<>();
for (HyPartnerUserInfoDO hyPartnerUserInfoDO : hyPartnerUserInfoDOS) {
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDOMap.get(hyPartnerUserInfoDO.getPartnerId());
List<ShopInfoDO> shopInfos = shopMap.get(hyPartnerUserInfoDO.getPartnerId());
List<Long> shopIds = shopInfos.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
List<ShopAccountDO> accountDOList = shopAccountDAO.getByShopIds(shopIds);
String substring = qualificationsInfoDO.getIdCardNo().substring(qualificationsInfoDO.getIdCardNo().length() - 6);
//生成密码和盐值
byte[] saltBytes = PasswordUtil.generateSalt();
String salt = PasswordUtil.bytesToHex(saltBytes);
String password = PasswordUtil.encryptPassword(substring, salt);
GetPasswordDTO getPasswordDTO = new GetPasswordDTO();
getPasswordDTO.setPassword(substring);
String downstreamSystemSecondaryPassword = thirdXinGuanJiaService.getPassword(getPasswordDTO);
// 修改用户表
hyPartnerUserInfoDO.setDownstreamSystemPassword(password);
hyPartnerUserInfoDO.setDownstreamSystemSalting(salt);
hyPartnerUserInfoDO.setDownstreamSystemSecondaryPassword(downstreamSystemSecondaryPassword);
//循环修改 门店账户表
for (ShopAccountDO shopAccountDO : accountDOList) {
if (shopAccountDO.getSystemName().equals(ShopAccountEnum.YLS.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.XZG.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.HUOMA.getSystemName())) {
shopAccountDO.setPassword(password);
shopAccountDO.setPasswordSalt(salt);
shopAccountDO.setSecondaryPassword(downstreamSystemSecondaryPassword);
updateList.add(shopAccountDO);
}
}
}
shopAccountDAO.dateHandle(updateList);
hyPartnerUserInfoDAO.dataHandle(hyPartnerUserInfoDOS);
return true;
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.enums.FileTypeEnum;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ExportService;
@@ -40,4 +41,19 @@ public class ExportController {
public ResponseResult preparationList(@RequestBody BranchShopRequest request) {
return ResponseResult.success(exportService.branchShopList(request, CurrentUserHolder.getUser()));
}
@PostMapping("/exportFinance")
@ApiOperation("财务导出")
public ResponseResult exportFinance(@RequestBody BranchShopRequest request) {
return ResponseResult.success(exportService.exportProgressBase(request, CurrentUserHolder.getUser(), FileTypeEnum.EXPORT_FINANCE));
}
@PostMapping("/exportJoinShop")
@ApiOperation("加盟开店申请导出")
public ResponseResult exportJoinShop(@RequestBody BranchShopRequest request) {
return ResponseResult.success(exportService.exportProgressBase(request, CurrentUserHolder.getUser(), FileTypeEnum.EXPORT_JOIN_SHOP));
}
@PostMapping("/exportProgress")
@ApiOperation("进度确认导出")
public ResponseResult exportProgress(@RequestBody BranchShopRequest request) {
return ResponseResult.success(exportService.exportProgressBase(request, CurrentUserHolder.getUser(), FileTypeEnum.EXPORT_PROGRESS));
}
}

View File

@@ -73,6 +73,12 @@ public class ShopAccountController {
return ResponseResult.success(accountService.accountEntryStatusChange(dto));
}
@ApiOperation("密码数据处理")
@GetMapping("/handleOldData")
public ResponseResult<Boolean> handleOldData() {
return ResponseResult.success(accountService.handleOldData());
}
}