Merge branch 'master' into cc_20250605_shopReport

This commit is contained in:
shuo.wang
2025-06-10 15:42:39 +08:00
57 changed files with 1603 additions and 161 deletions

View File

@@ -194,6 +194,8 @@ public class RedisConstant {
*/ */
public static final String COOLINGPERIOD_FIRSTLOGIN_KEY = "coolingPeriodFirstLoginCache:{0}"; public static final String COOLINGPERIOD_FIRSTLOGIN_KEY = "coolingPeriodFirstLoginCache:{0}";
public static final String REDIS_KEY_PREFIX = "daily_id:{0}";
/** /**
* 七天 * 七天
*/ */

View File

@@ -0,0 +1,25 @@
package com.cool.store.enums;
/**
* @Author: WangShuo
* @Date: 2025/05/30/15:52
* @Version 1.0
* @注释:
*/
public enum ClaimStatusEnum {
TO_BE_CLAIMED(0,"待认领"),
CLAIMED(1,"已认领");
private Integer code;
private String message;
ClaimStatusEnum(Integer code,String message){
this.code = code;
this.message =message;
}
public Integer getCode(){
return code;
}
public String getMessage(){
return message;
}
}

View File

@@ -263,6 +263,17 @@ public enum ErrorCodeEnum {
USER_ACCOUNT_WAIT_AUDIT(151015, "账号信息等待审核",null), USER_ACCOUNT_WAIT_AUDIT(151015, "账号信息等待审核",null),
SHOP_HAVE_NOT_OVER_ACCORDING(1511014,"该加盟商下有未结束跟进的门店,请先结束门店",null), SHOP_HAVE_NOT_OVER_ACCORDING(1511014,"该加盟商下有未结束跟进的门店,请先结束门店",null),
MOBILE_NOT_EXIST(151016,"手机号不存在,请先维护手机号!",null), MOBILE_NOT_EXIST(151016,"手机号不存在,请先维护手机号!",null),
API_CALL_ERROR(1511020,"接口调用错误",null),
ADD_PAY_INFO_FAIL(1511021,"添加缴费信息失败",null),
UPDATE_ERROR(1511022,"修改信息失败",null),
CLAIM_STATUS_ERROR(1511023,"当前状态为已认领,不能进行操作",null),
PAY_USER_NAME_ERROR(1511024,"付款人最多为2人",null),
DELETE_ERROR(1511025,"删除信息失败",null),
RECEIPT_NOT_EXIST(1511026,"收款单不存在或已被删除",null),
XGJ_COLLECTION_STATUS_COMPLETE(1511027,"新管家收费状态已完成,请确认!",null),
PAY_AMOUNT_ERROR(1511028,"缴费金额不能大于未缴金额",null),
; ;

View File

@@ -17,12 +17,18 @@ public enum ExtendFieldTypeEnum {
TEST_SIGNATORY_NAME_2("extend_field_1746670671614","签约人2名称"), TEST_SIGNATORY_NAME_2("extend_field_1746670671614","签约人2名称"),
TEST_SIGNATORY_MOBILE_2("extend_field_1746670686307","签约人2手机号"), TEST_SIGNATORY_MOBILE_2("extend_field_1746670686307","签约人2手机号"),
TEST_ORDER_NAME("extend_field_1747103227333","订单小程序名称"), TEST_ORDER_NAME("extend_field_1747103227333","订单小程序名称"),
TEST_JOIN_MODE("extend_field_1749175173890","加盟模式"),
TEST_STORE_TYPE("extend_field_1749175177455","门店类型"),
TEST_BRAND("extend_field_1749177175079","品牌"),
ONLINE_STORE_MANAGER_MOBILE("extend_field_1746598536903","店长手机号"), ONLINE_STORE_MANAGER_MOBILE("extend_field_1746598536903","店长手机号"),
ONLINE_SIGNATORY_NAME_1("extend_field_1746598562255","签约人1名称"), ONLINE_SIGNATORY_NAME_1("extend_field_1746598562255","签约人1名称"),
ONLINE_SIGNATORY_MOBILE_1("extend_field_1746598570479","签约人2手机号"), ONLINE_SIGNATORY_MOBILE_1("extend_field_1746598570479","签约人2手机号"),
ONLINE_SIGNATORY_NAME_2("extend_field_1746598584139","签约人2名称"), ONLINE_SIGNATORY_NAME_2("extend_field_1746598584139","签约人2名称"),
ONLINE_SIGNATORY_MOBILE_2("extend_field_1746598594140","签约人2手机号"), ONLINE_SIGNATORY_MOBILE_2("extend_field_1746598594140","签约人2手机号"),
ONLINE_ORDER_NAME("extend_field_1746599049206","订单小程序名称"),; ONLINE_ORDER_NAME("extend_field_1746599049206","订单小程序名称"),
ONLINE_JOIN_MODE("extend_field_1748315801670","加盟模式"),
ONLINE_STORE_TYPE("extend_field_1748315809671","门店类型"),
ONLINE_BRAND("extend_field_1749176993442","品牌"),;
private String key; private String key;

View File

@@ -0,0 +1,25 @@
package com.cool.store.enums;
/**
* @Author: WangShuo
* @Date: 2025/06/04/11:16
* @Version 1.0
* @注释:
*/
public enum XGJCollectionStatusEnum {
WAIT_PAY(0, "待缴费"),
PARTIAL_PAYMENT(1, "部分缴款"),
COMPLETED(2, "已完成");
private Integer code;
private String message;
XGJCollectionStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -8,7 +8,9 @@ package com.cool.store.enums.point;
*/ */
public enum PayTypeEnum { public enum PayTypeEnum {
WX_PAY(1,"微信支付"), WX_PAY(1,"微信支付"),
BANK_PAY(2,"银行转账"); BANK_PAY(2,"银行转账"),
ONLINE_PAY(3,"线上支付"),
OFFLINE_PAY(4,"线下支付");
private Integer code; private Integer code;
private String desc; private String desc;

View File

@@ -39,7 +39,7 @@ public enum ShopSubStageStatusEnum {
//缴纳加盟费/保证金 //缴纳加盟费/保证金
SHOP_SUB_STAGE_STATUS_70(ShopSubStageEnum.SHOP_STAGE_7, 700, "待内勤发布账单", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_70(ShopSubStageEnum.SHOP_STAGE_7, 700, "待内勤发布账单", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_71(ShopSubStageEnum.SHOP_STAGE_7, 710, "待加盟商缴费", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_71(ShopSubStageEnum.SHOP_STAGE_7, 710, "待加盟商缴费", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_72(ShopSubStageEnum.SHOP_STAGE_7, 720, "待内勤审核", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_72(ShopSubStageEnum.SHOP_STAGE_7, 720, "对账确认中", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_73(ShopSubStageEnum.SHOP_STAGE_7, 730, "已缴费", Boolean.TRUE), SHOP_SUB_STAGE_STATUS_73(ShopSubStageEnum.SHOP_STAGE_7, 730, "已缴费", Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_74(ShopSubStageEnum.SHOP_STAGE_7, 740, "审核不通过", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_74(ShopSubStageEnum.SHOP_STAGE_7, 740, "审核不通过", Boolean.FALSE),

View File

@@ -34,6 +34,7 @@ public class CoolDateUtils {
public static final String DATE_FORMAT_SEC_5 = "yyyy.MM.dd HH:mm"; public static final String DATE_FORMAT_SEC_5 = "yyyy.MM.dd HH:mm";
public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd"; public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd";
public static final String DATE_FORMAT_SEC_7 = "yyyy/MM/dd HH:mm"; public static final String DATE_FORMAT_SEC_7 = "yyyy/MM/dd HH:mm";
public static final String DATE_FORMAT_SEC_8 = "yyyyMMdd";
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -136,6 +137,14 @@ public class CoolDateUtils {
return str; return str;
} }
/**
* 获取当前日期 yyyyMMdd
* @return
*/
public static final String getToday(){
DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern(DATE_FORMAT_SEC_8);
return LocalDate.now().format(DATE_FORMATTER);
}
/** /**
* 获取当前日期字符串 (yyyy-MM-dd) * 获取当前日期字符串 (yyyy-MM-dd)

View File

@@ -6,6 +6,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.text.MessageFormat;
/** /**
* redis常量工具类 * redis常量工具类
@@ -113,4 +115,8 @@ public class RedisConstantUtil {
return active + "_" + RedisConstant.GET_AI_MODULE + eid; return active + "_" + RedisConstant.GET_AI_MODULE + eid;
} }
public String getPaymentReceiptCode(String today){
return active + "_" + MessageFormat.format(RedisConstant.REDIS_KEY_PREFIX, today);
}
} }

View File

@@ -1,8 +1,13 @@
package com.cool.store.utils; package com.cool.store.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Random;
/** /**
* 唯一性ID工具类 * 唯一性ID工具类
* *
@@ -12,6 +17,10 @@ import org.apache.commons.lang3.StringUtils;
*/ */
public class UUIDUtils { public class UUIDUtils {
private static final String ID_PREFIX = "12";
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern(CoolDateUtils.DATE_FORMAT_SEC_8);
/** /**
* 简化的UUID去掉了横线使用性能更好的ThreadLocalRandom生成UUID * 简化的UUID去掉了横线使用性能更好的ThreadLocalRandom生成UUID
*/ */
@@ -26,5 +35,9 @@ public class UUIDUtils {
long uuid = (int) (Math.random() * 90000000 + 10000000); long uuid = (int) (Math.random() * 90000000 + 10000000);
return uuid; return uuid;
} }
// 生成 UUID 方法
public static String generateCustomUUID(Integer randomCount) {
String today = LocalDate.now().format(DATE_FORMATTER);
return ID_PREFIX + today + String.format("%04d", randomCount);
}
} }

View File

@@ -1,10 +1,12 @@
package com.cool.store.dao; package com.cool.store.dao;
import com.cool.store.dto.FranchiseFeeStageDateDTO;
import com.cool.store.entity.FranchiseFeeDO; import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.mapper.FranchiseFeeMapper; import com.cool.store.mapper.FranchiseFeeMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@@ -26,4 +28,18 @@ public class FranchiseFeeDAO {
} }
return franchiseFeeMapper.updateBill(list); return franchiseFeeMapper.updateBill(list);
} }
public Integer batchUpdateXgjCollectionStatus(List<Long> shopIds,Integer collectionStatus){
if (CollectionUtils.isEmpty(shopIds)|| collectionStatus==null){
return 0;
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatus(shopIds,collectionStatus);
}
public Integer batchUpdateXgjCollectionStatusAndXgjFeesPaid( List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList){
if (CollectionUtils.isEmpty(franchiseFeeStageDateDTOList)){
return 0;
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
}
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.mapper.LinePayMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
@@ -69,4 +70,48 @@ public class LinePayDAO {
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(null,shopIds,payBusinessType); List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(null,shopIds,payBusinessType);
return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getShopId, linePayDO1 -> linePayDO1, (o, n) -> o)); return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getShopId, linePayDO1 -> linePayDO1, (o, n) -> o));
} }
public List<LinePayDO>getFranchiseFeePayInfoByShopId(Long shopId){
if (Objects.isNull(shopId)){
return null;
}
List<LinePayDO> franchiseFeePayInfoByShopId = linePayMapper.getFranchiseFeePayInfoByShopId(shopId);
if (CollectionUtils.isEmpty(franchiseFeePayInfoByShopId)){
return new ArrayList<>();
}
return franchiseFeePayInfoByShopId;
}
public LinePayDO getById(Long id) {
return linePayMapper.selectByPrimaryKey(id);
}
public Integer deleteById(Long id,String userId) {
return linePayMapper.deleteById(id,userId);
}
//数据处理专用0604查询加盟费阶段缴费信息
public List<LinePayDO> getDateHandler() {
return linePayMapper.getDateHandler();
}
//数据处理专用0604处理paytime paypic
public Integer dataUpdateLinePay(List<LinePayDO> linePayDOList) {
if (CollectionUtils.isEmpty(linePayDOList)){
return null;
}
return linePayMapper.dataUpdateLinePay(linePayDOList);
}
public LinePayDO selectByPaymentReceiptCode(String paymentReceiptCode) {
return linePayMapper.selectByPaymentReceiptCode(paymentReceiptCode);
}
public Integer updateXgjClaimStatus(List<Long> shopIds,Integer xgjClaimStatus,Integer payBusinessType){
if (CollectionUtils.isEmpty(shopIds)){
return null;
}
return linePayMapper.updateXgjClaimStatus(shopIds,xgjClaimStatus,payBusinessType);
}
public Integer deleteByShopId(List<Long> shopIds){
if (CollectionUtils.isEmpty(shopIds)){
return null;
}
return linePayMapper.deleteByShopId(shopIds);
}
} }

View File

@@ -466,4 +466,10 @@ public class ShopStageInfoDAO {
example.createCriteria().andIn("shopId",shopIds).andEqualTo("shopStage",shopStage); example.createCriteria().andIn("shopId",shopIds).andEqualTo("shopStage",shopStage);
return shopStageInfoMapper.selectByExample(example); return shopStageInfoMapper.selectByExample(example);
} }
//查询处于xx状态的数据
public List<ShopStageInfoDO> getShopStageInfoByShopSubStageStatus(Integer shopSubStageStatus) {
Example example = new Example(ShopStageInfoDO.class);
example.createCriteria().andEqualTo("shopSubStageStatus", shopSubStageStatus);
return shopStageInfoMapper.selectByExample(example);
}
} }

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper; package com.cool.store.mapper;
import com.cool.store.dto.FranchiseFeeDTO; import com.cool.store.dto.FranchiseFeeDTO;
import com.cool.store.dto.FranchiseFeeStageDateDTO;
import com.cool.store.entity.FranchiseFeeDO; import com.cool.store.entity.FranchiseFeeDO;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@@ -24,4 +25,8 @@ public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
* @description: 数据处理修改账单 * @description: 数据处理修改账单
*/ */
Integer updateBill(@Param("list") List<FranchiseFeeDO> list); Integer updateBill(@Param("list") List<FranchiseFeeDO> list);
Integer batchUpdateXgjCollectionStatus(@Param("shopIds")List<Long> shopId, @Param("collectionStatus")Integer collectionStatus);
Integer batchUpdateXgjCollectionStatusAndXgjFeesPaid( @Param("list") List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList);
} }

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.entity.LinePayDO; import com.cool.store.entity.LinePayDO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List; import java.util.List;
@@ -9,7 +10,7 @@ import java.util.List;
* @author wxp * @author wxp
* @date 2024-03-27 09:25 * @date 2024-03-27 09:25
*/ */
public interface LinePayMapper { public interface LinePayMapper {
/** /**
* *
* 默认插入方法,只会给有值的字段赋值 * 默认插入方法,只会给有值的字段赋值
@@ -55,4 +56,18 @@ public interface LinePayMapper {
void updateByPidAndLid(@Param("lineId") Long lineId, void updateByPidAndLid(@Param("lineId") Long lineId,
@Param("partnerId") String partnerId, @Param("partnerId") String partnerId,
@Param("auditId") Long auditId); @Param("auditId") Long auditId);
List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId);
Integer deleteById(@Param("id") Long id,@Param("userId")String userId);
LinePayDO selectByPaymentReceiptCode(@Param("paymentReceiptCode") String paymentReceiptCode);
//数据处理专用0604查询加盟费阶段缴费信息
List<LinePayDO> getDateHandler();
Integer dataUpdateLinePay(@Param("list") List<LinePayDO> linePayDOList);
Integer updateXgjClaimStatus(@Param("list") List<Long> shopIds,@Param("xgjClaimStatus") Integer xgjClaimStatus,@Param("payBusinessType") Integer payBusinessType);
Integer deleteByShopId(@Param("list")List<Long> shopIds);
} }

View File

@@ -32,6 +32,22 @@
where shop_id = #{item.shopId} where shop_id = #{item.shopId}
</foreach> </foreach>
</update> </update>
<update id="batchUpdateXgjCollectionStatus">
update xfsg_franchise_fee
set xgj_collection_status = #{collectionStatus}
where shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
</update>
<update id="batchUpdateXgjCollectionStatusAndXgjFeesPaid">
<foreach collection="list" separator=";" item="item">
update xfsg_franchise_fee
set xgj_collection_status = #{item.xgjCollectionStatus},
xgj_fees_paid = #{item.xgjFeesPaid}
where shop_id = #{item.shopId}
</foreach>
</update>
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO"> <select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
select * select *

View File

@@ -25,23 +25,37 @@
<result column="pay_business_type" jdbcType="TINYINT" property="payBusinessType"/> <result column="pay_business_type" jdbcType="TINYINT" property="payBusinessType"/>
<result column="amount" jdbcType="DECIMAL" property="amount"/> <result column="amount" jdbcType="DECIMAL" property="amount"/>
<result column="combined_field" jdbcType="VARCHAR" property="combinedField"/> <result column="combined_field" jdbcType="VARCHAR" property="combinedField"/>
<result column="xgj_claim_status" jdbcType="TINYINT" property="xgjClaimStatus"/>
<result column="payment_receipt_code" jdbcType="VARCHAR" property="paymentReceiptCode"/>
<result column="pay_serial_number" jdbcType="VARCHAR" property="paySerialNumber"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,shop_id, partner_id, line_id, pay_status, pay_type, pay_user_name, pay_account, bank_code, id,shop_id, partner_id, line_id, pay_status, pay_type, pay_user_name, pay_account, bank_code,
bank_name, branch_bank_code, branch_bank_name, pay_time, pay_pic, promise_pic, create_time, bank_name, branch_bank_code, branch_bank_name, pay_time, pay_pic, promise_pic, create_time,
update_time, create_user_id, update_user_id, deleted,pay_business_type,amount,combined_field update_time, create_user_id, update_user_id,
deleted,pay_business_type,amount,combined_field,xgj_claim_status,payment_receipt_code,pay_serial_number,
remark
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from xfsg_line_pay from xfsg_line_pay
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} and deleted = 0
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete delete
from xfsg_line_pay from xfsg_line_pay
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<update id="deleteByShopId">
update xfsg_line_pay
set deleted = 1
where shop_id in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<insert id="insertSelective" parameterType="com.cool.store.entity.LinePayDO"> <insert id="insertSelective" parameterType="com.cool.store.entity.LinePayDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
@@ -78,8 +92,8 @@
<if test="branchBankName != null"> <if test="branchBankName != null">
branch_bank_name, branch_bank_name,
</if> </if>
pay_time, pay_time,
pay_pic, pay_pic,
<if test="promisePic != null"> <if test="promisePic != null">
promise_pic, promise_pic,
@@ -111,6 +125,18 @@
<if test="combinedField != null"> <if test="combinedField != null">
combined_field, combined_field,
</if> </if>
<if test="xgjClaimStatus !=null">
xgj_claim_status,
</if>
<if test="paymentReceiptCode !=null">
payment_receipt_code,
</if>
<if test="paySerialNumber !=null">
pay_serial_number,
</if>
<if test="remark != null">
remark
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="partnerId != null"> <if test="partnerId != null">
@@ -143,8 +169,8 @@
<if test="branchBankName != null"> <if test="branchBankName != null">
#{branchBankName,jdbcType=VARCHAR}, #{branchBankName,jdbcType=VARCHAR},
</if> </if>
#{payTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
#{payPic,jdbcType=VARCHAR}, #{payPic,jdbcType=VARCHAR},
<if test="promisePic != null"> <if test="promisePic != null">
#{promisePic,jdbcType=VARCHAR}, #{promisePic,jdbcType=VARCHAR},
</if> </if>
@@ -175,6 +201,18 @@
<if test="combinedField != null"> <if test="combinedField != null">
#{combinedField,jdbcType=VARCHAR}, #{combinedField,jdbcType=VARCHAR},
</if> </if>
<if test="xgjClaimStatus !=null">
#{xgjClaimStatus,jdbcType=TINYINT},
</if>
<if test="paymentReceiptCode !=null">
#{paymentReceiptCode,jdbcType=VARCHAR},
</if>
<if test="paySerialNumber !=null">
#{paySerialNumber,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR}
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.LinePayDO"> <update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.LinePayDO">
@@ -210,8 +248,8 @@
<if test="branchBankName != null"> <if test="branchBankName != null">
branch_bank_name = #{branchBankName,jdbcType=VARCHAR}, branch_bank_name = #{branchBankName,jdbcType=VARCHAR},
</if> </if>
pay_time = #{payTime,jdbcType=TIMESTAMP}, pay_time = #{payTime,jdbcType=TIMESTAMP},
pay_pic = #{payPic,jdbcType=VARCHAR}, pay_pic = #{payPic,jdbcType=VARCHAR},
<if test="promisePic != null"> <if test="promisePic != null">
promise_pic = #{promisePic,jdbcType=VARCHAR}, promise_pic = #{promisePic,jdbcType=VARCHAR},
@@ -237,6 +275,18 @@
<if test="combinedField != null"> <if test="combinedField != null">
combined_field = #{combinedField,jdbcType=VARCHAR}, combined_field = #{combinedField,jdbcType=VARCHAR},
</if> </if>
<if test="xgjClaimStatus !=null">
xgj_claim_status = #{xgjClaimStatus,jdbcType=TINYINT},
</if>
<if test="paymentReceiptCode !=null">
payment_receipt_code = #{paymentReceiptCode,jdbcType=VARCHAR},
</if>
<if test="paySerialNumber !=null">
pay_serial_number = #{paySerialNumber,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@@ -244,7 +294,7 @@
update xfsg_line_pay update xfsg_line_pay
set audit_id = #{auditId} set audit_id = #{auditId}
where line_id = #{lineId} where line_id = #{lineId}
and partner_id = #{partnerId} and partner_id = #{partnerId}
</update> </update>
<sql id="dynamicQuery"> <sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR"> <trim prefix="WHERE" prefixOverrides="AND | OR">
@@ -312,14 +362,15 @@
select * select *
from xfsg_line_pay from xfsg_line_pay
where line_id = #{lineId} where line_id = #{lineId}
and deleted = '0' limit 1 and deleted = '0' limit 1
</select> </select>
<select id="getByLineIdAndPayTypeAndShopId" resultMap="BaseResultMap"> <select id="getByLineIdAndPayTypeAndShopId" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> select
<include refid="Base_Column_List"/>
from xfsg_line_pay from xfsg_line_pay
<where> <where>
deleted = '0' deleted = '0'
and pay_business_type = #{payBusinessType} and pay_business_type = #{payBusinessType}
<if test="lineId != null and lineId != ''"> <if test="lineId != null and lineId != ''">
and line_id = #{lineId} and line_id = #{lineId}
@@ -346,4 +397,53 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="getFranchiseFeePayInfoByShopId" resultType="com.cool.store.entity.LinePayDO">
select * from xfsg_line_pay where deleted = 0 and shop_id = #{shopId} and pay_business_type = 1 order by
create_time desc
</select>
<select id="getDateHandler" resultType="com.cool.store.entity.LinePayDO">
select * from xfsg_line_pay where deleted = 0 and pay_business_type = 1 and pay_pic is null and combined_field
is not null
</select>
<update id="deleteById">
update xfsg_line_pay set deleted = 1 ,update_time = now(),update_user_id = #{userId} where id = #{id}
</update>
<select id="selectByPaymentReceiptCode" resultType="com.cool.store.entity.LinePayDO">
select * from xfsg_line_pay where deleted = 0 and payment_receipt_code = #{paymentReceiptCode} and
pay_business_type = 1 order by create_time desc
</select>
<update id="dataUpdateLinePay">
<foreach collection="list" separator=";" item="item" index="index">
update xfsg_line_pay
<set>
<if test="item.payTime !=null">
pay_time = #{item.payTime},
</if>
<if test="item.payPic !=null and item !=''">
pay_pic = #{item.payPic},
</if>
<if test="item.paymentReceiptCode!=null and item.paymentReceiptCode !=''">
payment_receipt_code = #{item.paymentReceiptCode},
</if>
<if test="item.xgjClaimStatus">
xgj_claim_status = #{item.xgjClaimStatus}
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<update id="updateXgjClaimStatus">
update xfsg_line_pay
set
xgj_claim_status = #{xgjClaimStatus},
update_time = now()
where shop_id in (
<foreach collection="list" item="shopId" separator=",">
#{shopId}
</foreach>
) and pay_business_type = #{payBusinessType}
</update>
</mapper> </mapper>

View File

@@ -0,0 +1,18 @@
package com.cool.store.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author: WangShuo
* @Date: 2025/06/09/11:02
* @Version 1.0
* @注释:
*/
@Data
public class FranchiseFeeStageDateDTO {
private Long shopId;
private Integer xgjCollectionStatus;
private BigDecimal xgjFeesPaid = BigDecimal.ZERO;
}

View File

@@ -27,5 +27,11 @@ public class StoreDTO {
private String signer2Phone; private String signer2Phone;
@ApiModelProperty("订单小程序名称") @ApiModelProperty("订单小程序名称")
private String orderMiniProgramName; private String orderMiniProgramName;
@ApiModelProperty("加盟模式")
private String joinMode;
@ApiModelProperty("门店类型")
private String storeType;
@ApiModelProperty("品牌")
private String brand;
} }

View File

@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.persistence.*; import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
@@ -59,4 +60,16 @@ public class FranchiseFeeDO {
@Column(name = "discount_reason") @Column(name = "discount_reason")
private String discountReason; private String discountReason;
@Column(name = "xgj_collection_status")
@ApiModelProperty("新管家收款状态 0-待缴费 1-部分缴款 2-已完成")
private Integer xgjCollectionStatus;
@Column(name = "xgj_remainder_payable_amount")
@ApiModelProperty("新管家剩余应缴金额")
private BigDecimal xgjRemainderPayableAmount;
@Column(name = "xgj_fees_paid")
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
} }

View File

@@ -11,6 +11,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.persistence.Column;
/** /**
* @author wxp * @author wxp
* @date 2024-03-27 09:25 * @date 2024-03-27 09:25
@@ -35,7 +37,7 @@ public class LinePayDO implements Serializable {
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败") @ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
private Integer payStatus; private Integer payStatus;
@ApiModelProperty("支付方式 1微信 2银行转账") @ApiModelProperty("支付方式 1微信 2银行转账 3-线下支付4-线上支付")
private Integer payType; private Integer payType;
@ApiModelProperty("付款人姓名") @ApiModelProperty("付款人姓名")
@@ -87,4 +89,20 @@ public class LinePayDO implements Serializable {
@ApiModelProperty("组合字段:缴费时间+付款截图,数组") @ApiModelProperty("组合字段:缴费时间+付款截图,数组")
private String combinedField; private String combinedField;
@Column(name = "xgj_claim_status")
@ApiModelProperty("新管家收款单状态0-待认领1-已认领")
private Integer xgjClaimStatus;
@Column(name = "payment_receipt_code")
@ApiModelProperty("付款单编码(系统生成)")
private String paymentReceiptCode;
@Column(name = "pay_serial_number")
@ApiModelProperty("交易流水号")
private String paySerialNumber;
@Column(name = "remark")
private String remark;
} }

View File

@@ -1,17 +1,27 @@
package com.cool.store.request; package com.cool.store.request;
import com.cool.store.entity.LinePayDO;
import com.cool.store.enums.ClaimStatusEnum;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.tika.utils.DateUtils;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Objects;
import static com.cool.store.enums.WorkflowSubStageStatusEnum.PAY_DEPOSIT_50;
@Data @Data
public class LinePaySubmitRequest { public class LinePaySubmitRequest {
private Long id;
@ApiModelProperty("xfsg_user_info.partner_id") @ApiModelProperty("xfsg_user_info.partner_id")
private String partnerId; private String partnerId;
@@ -21,7 +31,7 @@ public class LinePaySubmitRequest {
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败") @ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
private Integer payStatus; private Integer payStatus;
@ApiModelProperty("支付方式 1微信 2银行转账") @ApiModelProperty("支付方式 1微信 2银行转账,3-线上支付,4-线下支持")
private Integer payType; private Integer payType;
@ApiModelProperty("付款人姓名/加盟商姓名") @ApiModelProperty("付款人姓名/加盟商姓名")
@@ -42,7 +52,6 @@ public class LinePaySubmitRequest {
@ApiModelProperty("支行名称") @ApiModelProperty("支行名称")
private String branchBankName; private String branchBankName;
//正新缴纳加盟费后续payTimepayPic废弃使用combinedField
@ApiModelProperty("缴纳时间") @ApiModelProperty("缴纳时间")
private String payTime; private String payTime;
@@ -52,12 +61,54 @@ public class LinePaySubmitRequest {
@ApiModelProperty("承诺书图片") @ApiModelProperty("承诺书图片")
private String promisePic; private String promisePic;
@ApiModelProperty("支付类型 0-缴纳意向金 1-缴纳加盟费 2-装修款") @ApiModelProperty("支付类型 1-缴纳加盟费")
private Integer payBusinessType; private Integer payBusinessType;
@ApiModelProperty("铺位id") @ApiModelProperty("铺位id")
private Long shopId; private Long shopId;
@ApiModelProperty("缴费金额") @ApiModelProperty("缴费金额")
private BigDecimal amount; private BigDecimal amount;
//废弃
@ApiModelProperty("组合字段:缴费时间+付款截图,数组") @ApiModelProperty("组合字段:缴费时间+付款截图,数组")
private String combinedField; private String combinedField;
@ApiModelProperty("交易流水号")
private String paySerialNumber;
@ApiModelProperty("备注")
private String remark;
/**
* @Auther: wangshuo
* @Date: 2025/5/30
* @description:加盟费使用
*/
public static LinePayDO convertFranchiseFee(LinePaySubmitRequest request) {
LinePayDO linePayDO = new LinePayDO();
linePayDO.setId(request.getId());
linePayDO.setPartnerId(request.getPartnerId());
linePayDO.setShopId(request.getShopId());
linePayDO.setLineId(request.getLineId());
linePayDO.setPayStatus(PAY_DEPOSIT_50.getCode());
linePayDO.setXgjClaimStatus(ClaimStatusEnum.TO_BE_CLAIMED.getCode());
linePayDO.setPayType(request.getPayType());
linePayDO.setPayUserName(request.getPayUserName());
linePayDO.setPayAccount(request.getPayAccount());
linePayDO.setBankCode(request.getBankCode());
linePayDO.setBankName(request.getBankName());
linePayDO.setBranchBankCode(request.getBranchBankCode());
linePayDO.setBranchBankName(request.getBranchBankName());
try {
linePayDO.setPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(request.getPayTime()));
} catch (ParseException e) {
throw new RuntimeException(e);
}
linePayDO.setPayPic(request.getPayPic());
linePayDO.setPaySerialNumber(request.getPaySerialNumber());
linePayDO.setAmount(request.getAmount());
linePayDO.setPayBusinessType(request.getPayBusinessType());
linePayDO.setXgjClaimStatus(0);
linePayDO.setRemark(request.getRemark());
linePayDO.setDeleted(false);
return linePayDO;
}
} }

View File

@@ -217,7 +217,7 @@ public class ZxjpApiRequest {
private Integer storeType; private Integer storeType;
private Long shopId;

View File

@@ -0,0 +1,28 @@
package com.cool.store.request.xgj;
import com.cool.store.dto.region.BigRegionDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @Author suzhuhong
* @Date 2025/6/4 11:02
* @Version 1.0
*/
@Data
public class FranchiseFeeCallBackRequest {
@NotNull
private Long shopId;
@NotNull
private BigDecimal payableFee;
@NotNull
private BigDecimal paidFees;
@NotNull
private BigDecimal remainingFee;
@NotNull
private Integer paymentStatus;
}

View File

@@ -0,0 +1,66 @@
package com.cool.store.request.xgj;
import com.cool.store.entity.FranchiseFeeDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2025/6/3 16:52
* @Version 1.0
*/
@Data
public class PushFranchiseFeeRequest {
@ApiModelProperty( "CRM系统门店ID")
private Long shopId;
@ApiModelProperty( "加盟商姓名")
private String partnerName;
@ApiModelProperty( "账单ID")
private Integer billId;
@ApiModelProperty( "加盟费")
private BigDecimal franchiseFee;
@ApiModelProperty( "保证金")
private BigDecimal bond;
@ApiModelProperty( "第一年度管理费")
private BigDecimal firstYearManageFee;
@ApiModelProperty( "第一年度品牌使用费")
private BigDecimal firstYearFee;
@ApiModelProperty( "设计费")
private BigDecimal designFee;
@ApiModelProperty( "应缴费合计金额")
private BigDecimal totalFee;
@ApiModelProperty( "创建时间")
private Date createTime;
public PushFranchiseFeeRequest(){}
public PushFranchiseFeeRequest(Long shopId, String partnerName, FranchiseFeeDO franchiseFeeDO){
this.setShopId(shopId);
this.setPartnerName(partnerName);
this.setBillId(franchiseFeeDO.getId().intValue());
this.setFranchiseFee(new BigDecimal(franchiseFeeDO.getYearFranchiseFee()));
this.setBond(new BigDecimal(franchiseFeeDO.getLoanMargin()));
this.setFirstYearManageFee(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()));
this.setFirstYearFee(new BigDecimal(franchiseFeeDO.getFirstYearFee()));
this.setDesignFee(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
this.setTotalFee(this.getBond()
.add(this.getFranchiseFee())
.add(this.getFirstYearManageFee())
.add(this.getFirstYearFee())
.add(this.getDesignFee()));
this.setCreateTime(franchiseFeeDO.getCreateTime());
}
}

View File

@@ -0,0 +1,24 @@
package com.cool.store.request.xgj;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Author suzhuhong
* @Date 2025/6/4 11:01
* @Version 1.0
*/
@Data
public class ReceiptCallBackRequest {
@NotBlank
private String receiptId;
@Max(1)@Min(0)@NotNull
private Integer claimStatus;
}

View File

@@ -0,0 +1,77 @@
package com.cool.store.request.xgj;
import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.entity.LinePayDO;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;
/**
* @Author suzhuhong
* @Date 2025/6/4 9:33
* @Version 1.0
*/
@Data
public class ReceiptRequest {
@ApiModelProperty( "CRM系统门店ID")
private Long shopId;
@ApiModelProperty( "账单ID")
private Integer billId;
@ApiModelProperty( "收款单ID")
private String receiptId;
@ApiModelProperty( "付款人")
private String payer1;
@ApiModelProperty("付款金额")
private BigDecimal paymentAmount;
@ApiModelProperty("交易流水号")
private String transactionNumber;
@ApiModelProperty( "开户行")
private String bankName;
@ApiModelProperty( "开户支行")
private String branchBankName;
@ApiModelProperty( "付款账号")
private String payAccount;
@ApiModelProperty( "付款凭证")
private String payPic;
@ApiModelProperty( "付款方式")
private Integer payWay = 0;
@ApiModelProperty( "认领状态")
private Integer claimStatus = 0;
@ApiModelProperty( "删除标识")
private Integer deleted = 0;
public ReceiptRequest() {
}
public ReceiptRequest(Long shopId, Integer billId, LinePayDO payDO){
this.setShopId(shopId);
this.setBillId(billId);
this.setReceiptId(payDO.getPaymentReceiptCode());
this.setPayer1(payDO.getPayUserName());
this.setPayAccount(payDO.getPayAccount());
this.setTransactionNumber(payDO.getPaySerialNumber());
this.setBankName(payDO.getBankName());
this.setBranchBankName(payDO.getBranchBankName());
this.setPaymentAmount(payDO.getAmount());
this.setPayPic(payDO.getPayPic());
this.setClaimStatus(payDO.getXgjClaimStatus());
this.setDeleted(payDO.getDeleted()?1:0);
}
}

View File

@@ -0,0 +1,77 @@
package com.cool.store.response;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author: WangShuo
* @Date: 2025/05/30/16:51
* @Version 1.0
* @注释:
*/
@Data
public class FranchiseFeePayInfoResponse {
private Long id;
private String partnerName;
@ApiModelProperty("xfsg_user_info.partner_id")
private String partnerId;
@ApiModelProperty("line_info.id")
private Long lineId;
@ApiModelProperty("铺位id")
private Long shopId;
@ApiModelProperty("支付方式 1微信 2银行转账,3-线上支付,4-线下支持")
private Integer payType;
@ApiModelProperty("付款人姓名/加盟商姓名")
private String payUserName;
@ApiModelProperty("付款账号")
private String payAccount;
@ApiModelProperty("开户行code")
private String bankCode;
@ApiModelProperty("开户行名称")
private String bankName;
@ApiModelProperty("支行code")
private String branchBankCode;
@ApiModelProperty("支行名称")
private String branchBankName;
@ApiModelProperty("缴纳时间")
private String payTime;
@ApiModelProperty("付款截图")
private String payPic;
@ApiModelProperty("缴费金额")
private BigDecimal amount;
@ApiModelProperty("交易流水号")
private String paySerialNumber;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("提交时间")
private Date createTime;
@ApiModelProperty("认领状态 0-待认领 1-已认领")
private Integer xgjClaimStatus;
@ApiModelProperty("支付状态 45:待缴费 50:已缴费")
private Integer payStatus;
@ApiModelProperty("付款单编号")
private String paymentReceiptCode;
}

View File

@@ -6,12 +6,13 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
public class FranchiseFeeResponse { public class FranchiseFeeResponse {
private Long id; private Long id;
@ApiModelProperty("shopId") @ApiModelProperty("shopId门店id")
private Long shopId; private Long shopId;
@ApiModelProperty("payId") @ApiModelProperty("payId")
private Long payId; private Long payId;
@@ -53,6 +54,17 @@ public class FranchiseFeeResponse {
@ApiModelProperty("铺位面积") @ApiModelProperty("铺位面积")
private String pointArea; private String pointArea;
@ApiModelProperty("收款状态 0-待缴费 1-部分缴款 2-已完成")
private Integer xgjCollectionStatus;
@ApiModelProperty("剩余待缴金额")
private BigDecimal xgjRemainderPayableAmount;
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
@Data @Data
public static class LinePay{ public static class LinePay{
@ApiModelProperty("") @ApiModelProperty("")
@@ -185,6 +197,9 @@ public class FranchiseFeeResponse {
franchiseFeeResponse.setUpdateTime(franchiseFeeDO.getUpdateTime()); franchiseFeeResponse.setUpdateTime(franchiseFeeDO.getUpdateTime());
franchiseFeeResponse.setFirstYearManageFee(franchiseFeeDO.getFirstYearManageFee()); franchiseFeeResponse.setFirstYearManageFee(franchiseFeeDO.getFirstYearManageFee());
franchiseFeeResponse.setDiscountReason(franchiseFeeDO.getDiscountReason()); franchiseFeeResponse.setDiscountReason(franchiseFeeDO.getDiscountReason());
franchiseFeeResponse.setXgjCollectionStatus(franchiseFeeDO.getXgjCollectionStatus());
franchiseFeeResponse.setXgjRemainderPayableAmount(franchiseFeeDO.getXgjRemainderPayableAmount());
franchiseFeeResponse.setXgjFeesPaid(franchiseFeeDO.getXgjFeesPaid());
return franchiseFeeResponse; return franchiseFeeResponse;
} }
} }

View File

@@ -0,0 +1,20 @@
package com.cool.store.response;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/6/4 19:06
* @Version 1.0
*/
@Data
public class XgjAccessTokenDTO {
private String access_token;
private String scope;
private String token_type;
private Long expires_in;
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.response.bigdata; package com.cool.store.response.bigdata;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.ResponseCodeEnum; import com.cool.store.enums.ResponseCodeEnum;
import lombok.Data; import lombok.Data;
import org.slf4j.MDC; import org.slf4j.MDC;
@@ -29,4 +30,8 @@ public class ApiResponse<T> {
public static<T> ApiResponse<T> success(T data) { public static<T> ApiResponse<T> success(T data) {
return new ApiResponse(ResponseCodeEnum.SUCCESS.getCode(), "ok", data); return new ApiResponse(ResponseCodeEnum.SUCCESS.getCode(), "ok", data);
} }
public static<T> ApiResponse<T> error(ErrorCodeEnum errorCodeEnum) {
return new ApiResponse(errorCodeEnum.getCode(), errorCodeEnum.getMessage(), null);
}
} }

View File

@@ -1,6 +1,7 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.entity.ImportTaskDO; import com.cool.store.entity.ImportTaskDO;
import java.util.List; import java.util.List;
@@ -20,20 +21,59 @@ public interface DataHandlerServer {
* @description: 导入OA旧数据 * @description: 导入OA旧数据
*/ */
Boolean importOaOldShopData(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, Boolean importOaOldShopData(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task); ImportTaskDO task);
//数据处理阶段完成 某些阶段数据处理 /**
Boolean dataStageHandler(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, ImportTaskDO task,Boolean flag); * @Auther: wangshuo
* @Date: 2025/6/9
* @description: //数据处理阶段完成 某些阶段数据处理
*/
Boolean dataStageHandler(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, ImportTaskDO task, Boolean flag);
//装修数据初始化 /**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //装修数据初始化
*/
Boolean decorationDataInit(); Boolean decorationDataInit();
//处理2024年10-12月数据 /**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //处理2024年10-12月数据
*/
Boolean dataHandlerV20241012(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, Boolean dataHandlerV20241012(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task); ImportTaskDO task);
Integer JingDongStageHandler(); Integer JingDongStageHandler();
//处理测量 设计 施工 验收 完成 /**
* @Auther: wangshuo
* @Date: 2025/6/9
* //处理测量 设计 施工 验收 完成
*/
Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task); ImportTaskDO task);
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //处理加盟费阶段
*/
Boolean franchiseFeeStageDateHandler();
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description:处理加盟费缴费信息历史数据
*/
Boolean franchiseFeeDateHandler(Integer pageSize, Integer pageNum);
/**
* @Auther: wangshuo
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用
*/
Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO);
} }

View File

@@ -3,7 +3,9 @@ package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.AuditFranchiseFeeRequest; import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest; import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.response.FranchiseFeeResponse; import com.cool.store.response.FranchiseFeeResponse;
import com.cool.store.response.bigdata.ApiResponse;
public interface FranchiseFeeService { public interface FranchiseFeeService {
/** /**
@@ -22,4 +24,6 @@ public interface FranchiseFeeService {
FranchiseFeeResponse getDetail(Long shopId); FranchiseFeeResponse getDetail(Long shopId);
Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user); Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user);
ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request);
} }

View File

@@ -3,10 +3,16 @@ package com.cool.store.service;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.AmountDTO; import com.cool.store.dto.AmountDTO;
import com.cool.store.entity.LinePayDO;
import com.cool.store.request.LinePaySubmitRequest; import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.FranchiseFeePayInfoResponse;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.vo.LinePayVO; import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO; import com.cool.store.vo.PartnerUserInfoVO;
import java.util.List;
/** /**
* @Author wxp * @Author wxp
* @Date 2024/3/25 13:45 * @Date 2024/3/25 13:45
@@ -27,5 +33,25 @@ public interface LinePayService {
Long submitPayInfo(LinePaySubmitRequest followLog, PartnerUserInfoVO partnerUser); Long submitPayInfo(LinePaySubmitRequest followLog, PartnerUserInfoVO partnerUser);
Long submitFranchiseFeePayInfo(LinePaySubmitRequest request, String userId);
String getPaymentReceiptCode();
List<FranchiseFeePayInfoResponse> getFranchiseFeePayInfoList(Long shopId);
Boolean deleteFranchiseFeePayInfo(Long id,String userId);
FranchiseFeePayInfoResponse getById(Long id);
/**
* 推送数据到新管家
* @param shopId
* @param linePayDO
* @return
*/
Boolean pushPayInfo(Long shopId, LinePayDO linePayDO);
ApiResponse<Boolean> ReceiptCallBack(ReceiptCallBackRequest request);
} }

View File

@@ -2,6 +2,9 @@ package com.cool.store.service;
import com.cool.store.dto.BatchStatusRefreshDTO; import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.dto.StatusRefreshDTO; import com.cool.store.dto.StatusRefreshDTO;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.bigdata.ApiResponse;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -18,11 +21,9 @@ public interface OpenApiService {
*/ */
Boolean statusRefresh(StatusRefreshDTO statusRefreshDTO); Boolean statusRefresh(StatusRefreshDTO statusRefreshDTO);
/**
* @Auther: wangshuo ApiResponse<Boolean> changeReceiptStatus(ReceiptCallBackRequest request);
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用 ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request);
*/
Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO);
} }

View File

@@ -5,6 +5,9 @@ import com.cool.store.dto.ModifyPasswordDTO;
import com.cool.store.dto.XgjOrganizationDTO; import com.cool.store.dto.XgjOrganizationDTO;
import com.cool.store.request.AuditRequest; import com.cool.store.request.AuditRequest;
import com.cool.store.request.ZxjpApiRequest; import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
import com.cool.store.request.xgj.ReceiptRequest;
import com.cool.store.response.XgjAccessTokenDTO;
import java.util.List; import java.util.List;
@@ -23,6 +26,20 @@ public interface PushService {
*/ */
Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest); Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest);
/**
* 推送加盟账单到新管家
* @param request
* @return
*/
Boolean pushFranchiseFeeToXGJ(PushFranchiseFeeRequest request);
/**
* 推送收款单到新管家
* @param receiptRequest
* @return
*/
Boolean pushReceiptToXGJ(ReceiptRequest receiptRequest);
/** /**
* 推送数据到下游系统 POS * 推送数据到下游系统 POS
* @param zxjpApiRequest * @param zxjpApiRequest
@@ -62,6 +79,12 @@ public interface PushService {
List<XgjOrganizationDTO> getXgjOrganization(String parentId); List<XgjOrganizationDTO> getXgjOrganization(String parentId);
/**
* 获取新管家token
* @return
*/
XgjAccessTokenDTO getXgjAccessToken();

View File

@@ -132,4 +132,6 @@ public interface ShopService {
* @return * @return
*/ */
List<UserDTO> getSubStageHandle(Long shopId,Integer subStage); List<UserDTO> getSubStageHandle(Long shopId,Integer subStage);
ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage);
} }

View File

@@ -4,10 +4,7 @@ package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.*;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.OrderSysTypeEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.point.ShopSubStageEnum; import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
@@ -16,12 +13,14 @@ import com.cool.store.request.BuildInformationRequest;
import com.cool.store.response.BuildInformationResponse; import com.cool.store.response.BuildInformationResponse;
import com.cool.store.service.BuildInformationService; import com.cool.store.service.BuildInformationService;
import com.cool.store.mapper.BuildInformationMapper; import com.cool.store.mapper.BuildInformationMapper;
import com.cool.store.service.EnumInfoService;
import com.cool.store.service.PreparationService; import com.cool.store.service.PreparationService;
import com.cool.store.service.UserAuthMappingService; import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.RedisConstantUtil; import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.StringUtils; import com.cool.store.utils.poi.StringUtils;
import io.lettuce.core.ZAddArgs; import io.lettuce.core.ZAddArgs;
import org.apache.commons.collections4.CollectionUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -30,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @author EDY * @author EDY
@@ -38,7 +38,8 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class BuildInformationServiceImpl implements BuildInformationService { public class BuildInformationServiceImpl implements BuildInformationService {
@Resource
private EnumInfoService enumInfoService;
@Resource @Resource
private RedisConstantUtil redisConstantUtil; private RedisConstantUtil redisConstantUtil;
@Resource @Resource
@@ -116,9 +117,17 @@ public class BuildInformationServiceImpl implements BuildInformationService {
response.setDeclareGoodsType(orderSysInfoDO.getDeclareGoodsType()); response.setDeclareGoodsType(orderSysInfoDO.getDeclareGoodsType());
} }
if (StringUtils.isBlank(response.getXgjVicePresident())) { if (StringUtils.isBlank(response.getXgjVicePresident())) {
EnterpriseUserDO user = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.VICE_PRESIDENT_IN_CHARGE, shopInfo.getRegionId()); List<EnterpriseUserDO> userList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.VICE_PRESIDENT_IN_CHARGE, shopInfo.getRegionId());
if (Objects.nonNull(user)) { if (CollectionUtils.isNotEmpty(userList)) {
response.setXgjVicePresident(user.getName()); List<EnumInfoDO> xgjVicePresidentList = enumInfoService.getByTypeCode(ZxjpEnum.XGJ_VICE_PRESIDENT.getCode());
List<String> userNameSet = userList.stream().map(EnterpriseUserDO::getName).collect(Collectors.toList());
List<String> xgjVicePresidentNameList = xgjVicePresidentList.stream().map(EnumInfoDO::getSysValue).collect(Collectors.toList());
List<String> resultUserNameList = userNameSet.stream()
.filter(xgjVicePresidentNameList::contains)
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(resultUserNameList)){
response.setXgjVicePresident(resultUserNameList.get(0));
}
} }
} }
//根据映射关系默认带出新管家组织 //根据映射关系默认带出新管家组织

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
@@ -7,26 +8,28 @@ import com.cool.store.dao.*;
import com.cool.store.dto.*; import com.cool.store.dto.*;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.ShopStageEnum; import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum; import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*; import com.cool.store.mapper.*;
import com.cool.store.service.DataHandlerServer; import com.cool.store.service.*;
import com.cool.store.service.FranchiseFeeService;
import com.cool.store.service.PreparationService;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
import com.cool.store.utils.easyExcel.EasyExcelUtil; import com.cool.store.utils.easyExcel.EasyExcelUtil;
import com.cool.store.utils.poi.DateUtils; import com.cool.store.utils.poi.DateUtils;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -43,6 +46,12 @@ import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD;
@Service @Service
@Slf4j @Slf4j
public class DataHandlerServerImpl implements DataHandlerServer { public class DataHandlerServerImpl implements DataHandlerServer {
@Resource
private LinePayService linePayService;
@Resource
private OpenApiService openApiService;
@Resource
private LinePayDAO linePayDAO;
@Resource @Resource
private AcceptanceInfoDAO acceptanceInfoDAO; private AcceptanceInfoDAO acceptanceInfoDAO;
@Resource @Resource
@@ -924,7 +933,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_25; ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_25;
List<Long> shopIds = shopAccountDAO.getShopId(); List<Long> shopIds = shopAccountDAO.getShopId();
for (ShopStageInfoDO shopStageInfoDO : subStages) { for (ShopStageInfoDO shopStageInfoDO : subStages) {
if (jdStageShopIds.contains(shopStageInfoDO.getShopId())){ if (jdStageShopIds.contains(shopStageInfoDO.getShopId())) {
continue; continue;
} }
LineInfoDO lineInfoDO = lineMap.get(shopStageInfoDO.getLineId()); LineInfoDO lineInfoDO = lineMap.get(shopStageInfoDO.getLineId());
@@ -980,12 +989,12 @@ public class DataHandlerServerImpl implements DataHandlerServer {
if (CollectionUtils.isEmpty(shopInfoList)) { if (CollectionUtils.isEmpty(shopInfoList)) {
log.info("导入数据根据shopCode 未找到数据"); log.info("导入数据根据shopCode 未找到数据");
} }
List<Long> shopIds = shopInfoList.stream().map(ShopInfoDO::getId).collect(Collectors.toList()); List<Long> shopIds = shopInfoList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
Map<String, List<ShopInfoDO>> shopMapByCode = shopInfoList.stream().collect(Collectors.groupingBy(ShopInfoDO::getShopCode)); Map<String, List<ShopInfoDO>> shopMapByCode = shopInfoList.stream().collect(Collectors.groupingBy(ShopInfoDO::getShopCode));
//装修验收数据 //装修验收数据
List<AcceptanceInfoDO> acceptanceInfoDOList = acceptanceInfoDAO.selectByShopIds(shopIds); List<AcceptanceInfoDO> acceptanceInfoDOList = acceptanceInfoDAO.selectByShopIds(shopIds);
Map<Long, AcceptanceInfoDO> acceptanceInfoMap = acceptanceInfoDOList.stream().collect(Collectors.toMap(AcceptanceInfoDO::getShopId, item -> item)); Map<Long, AcceptanceInfoDO> acceptanceInfoMap = acceptanceInfoDOList.stream().collect(Collectors.toMap(AcceptanceInfoDO::getShopId, item -> item));
//合同阶段 //合同阶段
List<ShopStageInfoDO> signFranchiseStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage()); List<ShopStageInfoDO> signFranchiseStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
Map<Long, ShopStageInfoDO> signFranchiseStageMap = signFranchiseStageList.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity())); Map<Long, ShopStageInfoDO> signFranchiseStageMap = signFranchiseStageList.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity()));
//装修阶段需要变更的shopId //装修阶段需要变更的shopId
@@ -995,23 +1004,23 @@ public class DataHandlerServerImpl implements DataHandlerServer {
for (ImportOaOldShopDataDTO dto : list) { for (ImportOaOldShopDataDTO dto : list) {
String shopCode = dto.getShopCode(); String shopCode = dto.getShopCode();
List<ShopInfoDO> shopInfoDOS = shopMapByCode.get(shopCode); List<ShopInfoDO> shopInfoDOS = shopMapByCode.get(shopCode);
if (CollectionUtils.isEmpty(shopInfoDOS)){ if (CollectionUtils.isEmpty(shopInfoDOS)) {
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码未找到")); errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码未找到"));
continue; continue;
} }
if (shopInfoDOS.size() > 1){ if (shopInfoDOS.size() > 1) {
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码重复")); errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "门店编码重复"));
continue; continue;
} }
ShopInfoDO shopInfoDO = shopInfoDOS.get(0); ShopInfoDO shopInfoDO = shopInfoDOS.get(0);
Long shopId = shopInfoDO.getId(); Long shopId = shopInfoDO.getId();
ShopStageInfoDO signFranchiseStage = signFranchiseStageMap.get(shopId); ShopStageInfoDO signFranchiseStage = signFranchiseStageMap.get(shopId);
if (!signFranchiseStage.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_84.getShopSubStageStatus())){ if (!signFranchiseStage.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_84.getShopSubStageStatus())) {
errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "合同阶段未完成")); errorList.add(new ImportOaOldShopDataErrorDTO(dto.getShopCode(), "合同阶段未完成"));
continue; continue;
} }
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoMap.get(shopId); AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoMap.get(shopId);
if (Objects.isNull(acceptanceInfoDO)){ if (Objects.isNull(acceptanceInfoDO)) {
initFitmentShopIdList.add(shopId); initFitmentShopIdList.add(shopId);
} }
fitmentFhopIdList.add(shopId); fitmentFhopIdList.add(shopId);
@@ -1021,7 +1030,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91); 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_112);
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123); shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
//装修表初始化 //装修表初始化
acceptanceInfoDAO.initAcceptanceInfo(initFitmentShopIdList); acceptanceInfoDAO.initAcceptanceInfo(initFitmentShopIdList);
if (!errorList.isEmpty()) { if (!errorList.isEmpty()) {
task.setStatus(ImportTaskStatusEnum.ERROR.getCode()); task.setStatus(ImportTaskStatusEnum.ERROR.getCode());
@@ -1043,6 +1052,97 @@ public class DataHandlerServerImpl implements DataHandlerServer {
return null; return null;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean franchiseFeeStageDateHandler() {
//处理加盟费阶段待审核(对账中)
List<ShopStageInfoDO> waitAuditStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus());
log.info("waitAuditStageList:{}", JSONObject.toJSONString(waitAuditStageList));
List<Long> waitAuditShopIdList = waitAuditStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
// shopStageInfoDAO.dataUpdateStatus(waitAuditShopIdList,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73);
franchiseFeeDAO.batchUpdateXgjCollectionStatus(waitAuditShopIdList, XGJCollectionStatusEnum.WAIT_PAY.getCode());
// linePayDAO.updateXgjClaimStatus(waitAuditShopIdList, ClaimStatusEnum.TO_BE_CLAIMED.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
//已缴费 修改新管家回调状态
List<ShopStageInfoDO> isPaidStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus());
List<Long> isPaidShopId = isPaidStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
List<FranchiseFeeDO> franchiseFeeByShopIds = franchiseFeeMapper.getFranchiseFeeByShopIds(isPaidShopId);
List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList = new ArrayList<>();
for (FranchiseFeeDO franchiseFeeDO : franchiseFeeByShopIds){
FranchiseFeeStageDateDTO dto = new FranchiseFeeStageDateDTO();
dto.setShopId(franchiseFeeDO.getShopId());
dto.setXgjCollectionStatus(XGJCollectionStatusEnum.COMPLETED.getCode());
dto.setXgjFeesPaid(dto.getXgjFeesPaid()
.add(new BigDecimal(franchiseFeeDO.getYearFranchiseFee()))
.add(new BigDecimal(franchiseFeeDO.getLoanMargin()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
);
franchiseFeeStageDateDTOList.add(dto);
}
franchiseFeeDAO.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
// linePayDAO.updateXgjClaimStatus(isPaidShopId, ClaimStatusEnum.CLAIMED.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
//待加盟商缴费阶段
List<ShopStageInfoDO> waitPayStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus());
List<Long> waitPayShopIds = waitPayStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
franchiseFeeDAO.batchUpdateXgjCollectionStatus(waitPayShopIds, XGJCollectionStatusEnum.WAIT_PAY.getCode());
//审批拒绝阶段
List<ShopStageInfoDO> refuseStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74.getShopSubStageStatus());
List<Long> refuseShopIds = refuseStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
franchiseFeeDAO.batchUpdateXgjCollectionStatus(refuseShopIds, XGJCollectionStatusEnum.WAIT_PAY.getCode());
linePayDAO.deleteByShopId(refuseShopIds);
shopStageInfoDAO.dataUpdateStatus(refuseShopIds,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean franchiseFeeDateHandler(Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
List<LinePayDO> dateHandler = linePayDAO.getDateHandler();
List<ShopStageInfoDO> waitAuditStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus());
log.info("waitAuditStageList:{}", JSONObject.toJSONString(waitAuditStageList));
List<Long> waitAuditShopIdList = waitAuditStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
for (LinePayDO linePayDO : dateHandler) {
JSONArray jsonArray = JSONObject.parseArray(linePayDO.getCombinedField());
JSONObject jsonObject = jsonArray.getJSONObject(0);
linePayDO.setPayTime(jsonObject.getDate("payTime"));
linePayDO.setPayPic(jsonObject.getString("payPic"));
if (waitAuditShopIdList.contains(linePayDO.getShopId())) {
linePayDO.setXgjClaimStatus(ClaimStatusEnum.TO_BE_CLAIMED.getCode());
if (StringUtils.isBlank(linePayDO.getPaymentReceiptCode())) {
linePayDO.setPaymentReceiptCode(linePayService.getPaymentReceiptCode());
}
} else {
linePayDO.setXgjClaimStatus(ClaimStatusEnum.CLAIMED.getCode());
}
}
linePayDAO.dataUpdateLinePay(dateHandler);
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO) {
if (CollectionUtils.isEmpty(batchStatusRefreshDTO.getShopCode())) {
log.info("数据处理 门店编码为空");
return null;
}
for (String shopCode : batchStatusRefreshDTO.getShopCode()) {
StatusRefreshDTO statusRefreshDTO = new StatusRefreshDTO();
statusRefreshDTO.setShopCode(shopCode);
statusRefreshDTO.setSystemSource(batchStatusRefreshDTO.getSystemSource());
statusRefreshDTO.setOpenStatus(batchStatusRefreshDTO.getOpenStatus());
openApiService.statusRefresh(statusRefreshDTO);
}
List<String> shopCodeList = new ArrayList<>();
for (String shopCode : batchStatusRefreshDTO.getShopCode()) {
shopCodeList.add(StringUtils.substringAfter(shopCode, "_"));
}
posAndOrderInfoDAO.batchUpdateYlsRemarkByShopCode(shopCodeList, batchStatusRefreshDTO.getRemark());
return true;
}
private static @NotNull ShopStageInfoDO getShopStageInfoDO(ShopSubStageEnum shopSubStageEnum, ShopStageInfoDO shopStageInfoDO, ShopSubStageStatusEnum shopSubStageStatus) { private static @NotNull ShopStageInfoDO getShopStageInfoDO(ShopSubStageEnum shopSubStageEnum, ShopStageInfoDO shopStageInfoDO, ShopSubStageStatusEnum shopSubStageStatus) {
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum(); ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO(); ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();

View File

@@ -263,14 +263,11 @@ public class DeskServiceImpl implements DeskService {
//督导代填 //督导代填
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) { if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7, pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_74.getShopSubStageStatus()), Boolean.FALSE,keyword); Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.FALSE,keyword);
} else { } else {
if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())) { if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus()); subStageStatusList.add(SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus());
} }
if (userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus());
}
if (!subStageStatusList.isEmpty()) { if (!subStageStatusList.isEmpty()) {
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7, pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
subStageStatusList, Boolean.TRUE,keyword); subStageStatusList, Boolean.TRUE,keyword);

View File

@@ -13,8 +13,12 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*; import com.cool.store.mapper.*;
import com.cool.store.request.AuditFranchiseFeeRequest; import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest; import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
import com.cool.store.response.FranchiseFeeResponse; import com.cool.store.response.FranchiseFeeResponse;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.FranchiseFeeService; import com.cool.store.service.FranchiseFeeService;
import com.cool.store.service.PushService;
import com.cool.store.service.UserAuthMappingService; import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.poi.constant.Constants; import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -57,6 +61,8 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
CommonService commonService; CommonService commonService;
@Resource @Resource
UserAuthMappingService userAuthMappingService; UserAuthMappingService userAuthMappingService;
@Resource
PushService pushService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -76,21 +82,38 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
if (Objects.nonNull(isExist)){ if (Objects.nonNull(isExist)){
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT_2); throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT_2);
} }
franchiseFeeDO.setXgjCollectionStatus(XGJCollectionStatusEnum.WAIT_PAY.getCode());
franchiseFeeDO.setCreateTime(new Date());
franchiseFeeMapper.insertSelective(franchiseFeeDO); franchiseFeeMapper.insertSelective(franchiseFeeDO);
} }
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId()); ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId()); LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES); commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES);
//推送加盟费信息到新管家
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true; return true;
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean update(FranchiseFeeRequest request) { public Boolean update(FranchiseFeeRequest request) {
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
if (shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO(); FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
FranchiseFeeDO franchiseFeeDO1 = franchiseFeeMapper.selectByShopId(request.getShopId()); FranchiseFeeDO franchiseFeeDO1 = franchiseFeeMapper.selectByShopId(request.getShopId());
if (Objects.nonNull(franchiseFeeDO1)) { if (Objects.nonNull(franchiseFeeDO1)) {
franchiseFeeDO.setId(franchiseFeeDO1.getId()); franchiseFeeDO.setId(franchiseFeeDO1.getId());
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO); franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
//推送数据
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
//推送加盟费信息到新管家
franchiseFeeDO.setCreateTime(franchiseFeeDO1.getCreateTime());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true; return true;
} }
return false; return false;
@@ -103,22 +126,6 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
return new FranchiseFeeResponse(); return new FranchiseFeeResponse();
} }
FranchiseFeeResponse resp = FranchiseFeeResponse.from(result); FranchiseFeeResponse resp = FranchiseFeeResponse.from(result);
LinePayDO linePayDO = linePayMapper.selectByPrimaryKey(result.getPayId());
if (Objects.nonNull(linePayDO)) {
FranchiseFeeResponse.LinePay linePayResult = FranchiseFeeResponse.LinePay.from(linePayDO);
if (Objects.nonNull(linePayDO.getLineId())){
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(linePayDO.getLineId());
linePayResult.setPartnerName(lineInfoDO.getUsername());
}
linePayResult.setAmount(new BigDecimal(result.getPerformanceBond()).add(new BigDecimal(result.getFirstYearFee())).add(new BigDecimal(result.getFirstYearManageFee()))
.add(new BigDecimal(result.getYearFranchiseFee())).add(new BigDecimal(result.getLoanMargin())).toString());
if (Objects.nonNull(result.getAuditId())) {
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(result.getAuditId());
linePayResult.setStatus(shopAuditInfoDO.getResultType());
linePayResult.setResult(shopAuditInfoDO.getResultType() == 0 ? shopAuditInfoDO.getPassReason() : shopAuditInfoDO.getRejectReason());
}
resp.setLinePayDO(linePayResult);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId); ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
if (shopInfoDO.getPointId() != null ){ if (shopInfoDO.getPointId() != null ){
PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfoDO.getPointId()); PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfoDO.getPointId());
@@ -191,4 +198,25 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
// commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18, requestMap); // commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18, requestMap);
return true; return true;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request) {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
if (Objects.isNull(shopInfoDO)){
return ApiResponse.error(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
if (XGJCollectionStatusEnum.COMPLETED.getCode().equals(franchiseFeeDO.getXgjCollectionStatus())){
return ApiResponse.error(ErrorCodeEnum.XGJ_COLLECTION_STATUS_COMPLETE);
}
franchiseFeeDO.setXgjCollectionStatus(request.getPaymentStatus());
franchiseFeeDO.setXgjRemainderPayableAmount(request.getRemainingFee());
franchiseFeeDO.setXgjFeesPaid(request.getPaidFees());
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
if (XGJCollectionStatusEnum.COMPLETED.getCode().equals(request.getPaymentStatus())){
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73);
}
return ApiResponse.success(Boolean.TRUE);
}
} }

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.HyPartnerUserInfoDAO; import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dao.LineInfoDAO; import com.cool.store.dao.LineInfoDAO;
@@ -14,21 +15,32 @@ import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.enums.point.PayBusinessTypeEnum; import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.PayTypeEnum; import com.cool.store.enums.point.PayTypeEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.FranchiseFeeMapper; import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.ShopInfoMapper; import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.LinePaySubmitRequest; import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.request.xgj.ReceiptRequest;
import com.cool.store.response.FranchiseFeePayInfoResponse;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.LinePayService; import com.cool.store.service.LinePayService;
import com.cool.store.service.PushService;
import com.cool.store.service.UserAuthMappingService; import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.UUIDUtils;
import com.cool.store.utils.poi.DateUtils; import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.StringUtils; import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants; import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.LinePayVO; import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO; import com.cool.store.vo.PartnerUserInfoVO;
import jdk.nashorn.internal.codegen.types.BooleanType;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -38,9 +50,14 @@ import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.cool.store.utils.poi.DateUtils.SPECIAL_DATE_START;
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
/** /**
* @Author wxp * @Author wxp
* @Date 2024/3/28 13:48 * @Date 2024/3/28 13:48
@@ -50,6 +67,7 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class LinePayServiceImpl implements LinePayService { public class LinePayServiceImpl implements LinePayService {
@Value("${mybatis.configuration.variables.enterpriseId}") @Value("${mybatis.configuration.variables.enterpriseId}")
private String eid; private String eid;
@Resource @Resource
@@ -73,6 +91,10 @@ public class LinePayServiceImpl implements LinePayService {
private RedisUtilPool redisUtilPool; private RedisUtilPool redisUtilPool;
@Resource @Resource
private UserAuthMappingService userAuthMappingService; private UserAuthMappingService userAuthMappingService;
@Resource
RedisConstantUtil redisConstantUtil;
@Resource
PushService pushService;
@Override @Override
public LinePayVO getLinePayInfo(Long lineId, Integer businessType, Long shopId) { public LinePayVO getLinePayInfo(Long lineId, Integer businessType, Long shopId) {
@@ -132,6 +154,204 @@ public class LinePayServiceImpl implements LinePayService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public Long submitFranchiseFeePayInfo(LinePaySubmitRequest request, String userId) {
log.info("submitPayInfo request{}userId{}", JSONObject.toJSONString(request), JSONObject.toJSONString(userId));
if (!checkSubmitFranchiseFeePayRequest(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
if (StringUtils.isBlank(userId)) {
throw new ServiceException(ErrorCodeEnum.ACCESS_TOKEN_INVALID);
}
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
//判断付款人最多2人可重复
List<LinePayDO> list = linePayDAO.getFranchiseFeePayInfoByShopId(request.getShopId());
Map<Long, LinePayDO> payIdMap = list.stream().collect(Collectors.toMap(LinePayDO::getId, Function.identity()));
if (request.getId()!=null){
payIdMap.remove(request.getId());
}
//判断缴费金额不能大于未缴费金额
BigDecimal total = payIdMap.values().stream()
.map(LinePayDO::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
//应缴金额
BigDecimal amountDue = new BigDecimal(franchiseFeeDO.getYearFranchiseFee())
.add(new BigDecimal(franchiseFeeDO.getLoanMargin()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
//未缴费金额
BigDecimal amountUnpaid = amountDue.subtract(total);
if( request.getAmount().compareTo(amountUnpaid) > 0 ){
throw new ServiceException(ErrorCodeEnum.PAY_AMOUNT_ERROR);
}
Set<String> payUserList = list.stream().map(LinePayDO::getPayUserName).collect(Collectors.toSet());
if (!payUserList.contains(request.getPayUserName()) && payUserList.size() >= 2) {
throw new ServiceException(ErrorCodeEnum.PAY_USER_NAME_ERROR);
}
if (request.getId() != null) {
LinePayDO linePayById = linePayDAO.getById(request.getId());
if (linePayById == null) {
throw new ServiceException(ErrorCodeEnum.UPDATE_ERROR);
}
if (linePayById.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode())) {
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
}
}
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus())
&& !shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus())) {
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
String lockKey = "submitFranchiseFeePayInfo:lineId" + request.getLineId() + "shopId" + request.getShopId();
//流水
String lockValue = UUID.randomUUID().toString();
boolean acquired = false;
try {
//10s过期
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
if (Boolean.TRUE.equals(acquired)) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
LinePayDO linePayDO = LinePaySubmitRequest.convertFranchiseFee(request);
linePayDO.setPartnerId(lineInfo.getPartnerId());
linePayDO.setCreateUserId(userId);
linePayDO.setCreateTime(new Date());
if (linePayDO.getId() != null) {
LinePayDO linePayById = linePayDAO.getById(linePayDO.getId());
if (linePayById == null) {
log.info("linePayById is null");
throw new ServiceException(ErrorCodeEnum.UPDATE_ERROR);
} else {
linePayDAO.updateLinePay(linePayDO);
}
linePayDO.setPaymentReceiptCode(linePayById.getPaymentReceiptCode());
} else {
linePayDO.setPaymentReceiptCode(getPaymentReceiptCode());
Long payId = linePayDAO.addLinePay(linePayDO);
linePayDO.setId(payId);
}
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus())) {
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
}
//推送数据
this.pushPayInfo(request.getShopId(), linePayDO);
return linePayDO.getId();
} else {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
} finally {
if (Boolean.TRUE.equals(acquired)) {
String currentValue = redisUtilPool.getString(lockKey);
if (lockValue.equals(currentValue)) {
redisUtilPool.delKey(lockKey);
}
}
}
}
@Override
public String getPaymentReceiptCode() {
//当前日期
String today = CoolDateUtils.getToday();
String redisKey = redisConstantUtil.getPaymentReceiptCode(today);
Long sequence = redisUtilPool.incrby(redisKey, 1);
//第一次设置过期时间 一天
if (sequence == 1) {
redisUtilPool.expire(redisKey, RedisConstant.ONE_DAY_SECONDS);
}
return "12" + today + String.format("%04d", sequence);
}
@Override
public List<FranchiseFeePayInfoResponse> getFranchiseFeePayInfoList(Long shopId) {
List<LinePayDO> list = linePayDAO.getFranchiseFeePayInfoByShopId(shopId);
List<FranchiseFeePayInfoResponse> result = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) {
return result;
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
String username = lineInfoDO.getUsername();
for (LinePayDO linePayDO : list) {
FranchiseFeePayInfoResponse response = new FranchiseFeePayInfoResponse();
BeanUtil.copyProperties(linePayDO, response);
response.setPayTime(DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, linePayDO.getPayTime()));
response.setPartnerName(username);
result.add(response);
}
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteFranchiseFeePayInfo(Long id, String userId) {
LinePayDO linePay = linePayDAO.getById(id);
if (linePay == null) {
throw new ServiceException(ErrorCodeEnum.DELETE_ERROR);
}
if (linePay.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode())) {
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
}
linePayDAO.deleteById(id, userId);
//置为删除状态
linePay.setDeleted(Boolean.TRUE);
//推送数据
this.pushPayInfo(linePay.getShopId(), linePay);
return Boolean.TRUE;
}
@Override
public Boolean pushPayInfo(Long shopId, LinePayDO linePayDO) {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
ReceiptRequest receiptRequest = new ReceiptRequest(shopId, franchiseFeeDO.getId().intValue(), linePayDO);
//推送缴费单数据到新管家
pushService.pushReceiptToXGJ(receiptRequest);
return Boolean.TRUE;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ApiResponse<Boolean> ReceiptCallBack(ReceiptCallBackRequest request) {
LinePayDO linePayDO = linePayDAO.selectByPaymentReceiptCode(request.getReceiptId());
if (Objects.isNull(linePayDO)) {
return ApiResponse.error(ErrorCodeEnum.RECEIPT_NOT_EXIST);
}
linePayDO.setXgjClaimStatus(request.getClaimStatus());
linePayDAO.updateLinePay(linePayDO);
return ApiResponse.success(Boolean.TRUE);
}
@Override
public FranchiseFeePayInfoResponse getById(Long id) {
if (id == null) {
return null;
}
LinePayDO linePay = linePayDAO.getById(id);
if (linePay == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
FranchiseFeePayInfoResponse response = new FranchiseFeePayInfoResponse();
BeanUtil.copyProperties(linePay, response);
return response;
}
private Boolean checkSubmitFranchiseFeePayRequest(LinePaySubmitRequest request) {
if (StringUtils.isAnyBlank(request.getPayUserName(), request.getPayAccount(), request.getBankName(), request.getBranchBankName(),
request.getPayTime(), request.getPayPic())) {
return Boolean.FALSE;
}
if (Objects.isNull(request.getPayType()) || request.getLineId() == null || request.getShopId() == null) {
return Boolean.FALSE;
}
if (!request.getPayBusinessType().equals(PayBusinessTypeEnum.FRANCHISE_FEE.getCode())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) { public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
@@ -139,45 +359,44 @@ public class LinePayServiceImpl implements LinePayService {
if (Objects.isNull(request.getPayBusinessType())) { if (Objects.isNull(request.getPayBusinessType())) {
request.setPayBusinessType(Constants.ZERO_INTEGER); request.setPayBusinessType(Constants.ZERO_INTEGER);
} }
if (request.getPayBusinessType().equals(PayBusinessTypeEnum.FRANCHISE_FEE.getCode())) {
throw new ServiceException(ErrorCodeEnum.API_CALL_ERROR);
}
LineInfoDO lineInfo = new LineInfoDO(); LineInfoDO lineInfo = new LineInfoDO();
if (request.getLineId() != null) { if (request.getLineId() != null) {
lineInfo = lineInfoDAO.getLineInfo(request.getLineId()); lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
} }
// //缴纳加盟费检验缴费人必须是加盟商
// if(PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && !lineInfo.getUsername().trim().equals(request.getPayUserName().trim())){
// throw new ServiceException(ErrorCodeEnum.CHECK_PAYER_ERROR);
// }
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(), request.getShopId()); LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(), request.getShopId());
linePayDO = checkAndFill(linePayDO, request, partnerUser); linePayDO = checkAndFill(linePayDO, request, partnerUser);
Long payId = linePayDO.getId(); Long payId = linePayDO.getId();
if (PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && payId != null) { // if (PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && payId != null) {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId()); // FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
if (Objects.isNull(franchiseFeeDO)) { // if (Objects.isNull(franchiseFeeDO)) {
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT); // throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT);
} // }
franchiseFeeDO.setPayId(payId); // franchiseFeeDO.setPayId(payId);
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO); // franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72); // shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(franchiseFeeDO.getShopId()); // ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(franchiseFeeDO.getShopId());
Set<String> auditFranchiseFeeUsers = new HashSet<>(); // Set<String> auditFranchiseFeeUsers = new HashSet<>();
List<EnterpriseUserDO> branchUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.BRANCH_OFFICE, shopInfoDO.getRegionId()); // List<EnterpriseUserDO> branchUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.BRANCH_OFFICE, shopInfoDO.getRegionId());
if (Objects.nonNull(branchUser)) { // if (Objects.nonNull(branchUser)) {
Set<String> branchUserIds = branchUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toSet()); // Set<String> branchUserIds = branchUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toSet());
auditFranchiseFeeUsers.addAll(branchUserIds); // auditFranchiseFeeUsers.addAll(branchUserIds);
} // }
List<EnterpriseUserDO> regionUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.REGION_OFFICE, shopInfoDO.getRegionId()); // List<EnterpriseUserDO> regionUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.REGION_OFFICE, shopInfoDO.getRegionId());
if (Objects.nonNull(regionUser)) { // if (Objects.nonNull(regionUser)) {
Set<String> regionUserIds = regionUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toSet()); // Set<String> regionUserIds = regionUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toSet());
auditFranchiseFeeUsers.addAll(regionUserIds); // auditFranchiseFeeUsers.addAll(regionUserIds);
} // }
HashMap<String, String> map = new HashMap<>(); // HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername()); // map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile()); // map.put("partnerMobile", lineInfo.getMobile());
map.put("storeName", shopInfoDO.getShopName()); // map.put("storeName", shopInfoDO.getShopName());
commonService.sendQWMessage(new ArrayList<>(auditFranchiseFeeUsers), // commonService.sendQWMessage(new ArrayList<>(auditFranchiseFeeUsers),
MessageEnum.MESSAGE_18, // MessageEnum.MESSAGE_18,
map); // map);
} // }
if (PayBusinessTypeEnum.INTENT_MONEY.getCode().equals(request.getPayBusinessType())) { if (PayBusinessTypeEnum.INTENT_MONEY.getCode().equals(request.getPayBusinessType())) {
lineInfo.setWorkflowSubStage(WorkflowSubStageEnum.PAY_DEPOSIT.getCode()); lineInfo.setWorkflowSubStage(WorkflowSubStageEnum.PAY_DEPOSIT.getCode());
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
@@ -218,7 +437,7 @@ public class LinePayServiceImpl implements LinePayService {
linePayDO.setBranchBankName(request.getBranchBankName()); linePayDO.setBranchBankName(request.getBranchBankName());
if (Objects.nonNull(request.getPayTime())) { if (Objects.nonNull(request.getPayTime())) {
linePayDO.setPayTime(DateUtils.dateTime("yyyy-MM-dd HH:mm:ss", request.getPayTime())); linePayDO.setPayTime(DateUtils.dateTime("yyyy-MM-dd HH:mm:ss", request.getPayTime()));
}else { } else {
linePayDO.setPayTime(null); linePayDO.setPayTime(null);
} }
linePayDO.setPayPic(request.getPayPic()); linePayDO.setPayPic(request.getPayPic());
@@ -252,4 +471,5 @@ public class LinePayServiceImpl implements LinePayService {
} }
} }

View File

@@ -15,6 +15,11 @@ import com.cool.store.enums.ShopAccountEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.PostAndOrderRequest; import com.cool.store.request.PostAndOrderRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.FranchiseFeeService;
import com.cool.store.service.LinePayService;
import com.cool.store.service.OpenApiService; import com.cool.store.service.OpenApiService;
import com.cool.store.service.PosAndOrderInfoService; import com.cool.store.service.PosAndOrderInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -49,6 +54,10 @@ public class OpenApiServiceImpl implements OpenApiService {
PosAndOrderInfoService posAndOrderInfoService; PosAndOrderInfoService posAndOrderInfoService;
@Resource @Resource
PosAndOrderInfoDAO posAndOrderInfoDAO; PosAndOrderInfoDAO posAndOrderInfoDAO;
@Resource
LinePayService linePayService;
@Resource
FranchiseFeeService franchiseFeeService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -87,25 +96,14 @@ public class OpenApiServiceImpl implements OpenApiService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) public ApiResponse<Boolean> changeReceiptStatus(ReceiptCallBackRequest request) {
public Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO) { return linePayService.ReceiptCallBack(request);
if (CollectionUtils.isEmpty(batchStatusRefreshDTO.getShopCode())){ }
log.info("数据处理 门店编码为空");
return null; @Override
} public ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request) {
for (String shopCode : batchStatusRefreshDTO.getShopCode()){ return franchiseFeeService.changePaymentStatus(request);
StatusRefreshDTO statusRefreshDTO = new StatusRefreshDTO();
statusRefreshDTO.setShopCode(shopCode);
statusRefreshDTO.setSystemSource(batchStatusRefreshDTO.getSystemSource());
statusRefreshDTO.setOpenStatus(batchStatusRefreshDTO.getOpenStatus());
this.statusRefresh(statusRefreshDTO);
}
List<String> shopCodeList = new ArrayList<>();
for (String shopCode : batchStatusRefreshDTO.getShopCode()){
shopCodeList.add(StringUtils.substringAfter(shopCode, "_"));
}
posAndOrderInfoDAO.batchUpdateYlsRemarkByShopCode(shopCodeList,batchStatusRefreshDTO.getRemark());
return true;
} }
} }

View File

@@ -7,6 +7,9 @@ import com.cool.store.dto.XgjOrganizationDTO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.ZxjpApiRequest; import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
import com.cool.store.request.xgj.ReceiptRequest;
import com.cool.store.response.XgjAccessTokenDTO;
import com.cool.store.response.XgjBaseResponse; import com.cool.store.response.XgjBaseResponse;
import com.cool.store.response.XgjOrganizationResponse; import com.cool.store.response.XgjOrganizationResponse;
import com.cool.store.response.huoma.ShopBaseInfoResponse; import com.cool.store.response.huoma.ShopBaseInfoResponse;
@@ -25,13 +28,14 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.*;
import java.util.List; import java.util.concurrent.TimeUnit;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -60,6 +64,9 @@ public class PushServiceImpl implements PushService {
@Value("${xgj.api.auth.url}") @Value("${xgj.api.auth.url}")
private String xgjUrl; private String xgjUrl;
@Value("${xgj.api.token.url}")
private String xgjTokenUrl;
@Value("${xgj.api.auth.username}") @Value("${xgj.api.auth.username}")
private String xgjUsername; private String xgjUsername;
@@ -89,13 +96,33 @@ public class PushServiceImpl implements PushService {
@Value("${mybatis.configuration.variables.enterpriseId}") @Value("${mybatis.configuration.variables.enterpriseId}")
private String eid; private String eid;
@PostConstruct
public void init() {
okHttpClient = okHttpClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS) // 连接超时
.readTimeout(30, TimeUnit.SECONDS) // 读取超时
.writeTimeout(30, TimeUnit.SECONDS) // 写入超时
.build();
}
@Override @Override
public Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest) { public Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest) {
String apiUrl = xgjUrl + "/open/addStore"; String apiUrl = xgjUrl + "/dmp/one-id/open/addStore";
return executeApiCall(apiUrl, zxjpApiRequest, Boolean.class, xgjUsername, xgjSecret); return executeApiCall(apiUrl, zxjpApiRequest, Boolean.class, xgjUsername, xgjSecret);
} }
@Override
public Boolean pushFranchiseFeeToXGJ(PushFranchiseFeeRequest request) {
String apiUrl = xgjUrl + "/dmp/dmp-join/open/franchiseeBill";
return executePostApiCall(apiUrl, request, Boolean.class, xgjUsername, xgjSecret,getXgjAccessToken().getAccess_token());
}
@Override
public Boolean pushReceiptToXGJ(ReceiptRequest request) {
String apiUrl = xgjUrl + "/dmp/dmp-join/open/franchiseeReceipts";
return executePostApiCall(apiUrl, request, Boolean.class, xgjUsername, xgjSecret,getXgjAccessToken().getAccess_token());
}
@Override @Override
public Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest) { public Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest) {
String apiUrl = url + "/dzgV1/zxcrm/shop/upsert"; String apiUrl = url + "/dzgV1/zxcrm/shop/upsert";
@@ -103,7 +130,7 @@ public class PushServiceImpl implements PushService {
} }
private Boolean modifyXGJPassword(ModifyPasswordDTO dto) { private Boolean modifyXGJPassword(ModifyPasswordDTO dto) {
String apiUrl = xgjUrl + "/open/updateStorePassword"; String apiUrl = xgjUrl + "/dmp/one-id/open/updateStorePassword";
return executeApiCall(apiUrl, dto, Boolean.class, xgjUsername, xgjSecret); return executeApiCall(apiUrl, dto, Boolean.class, xgjUsername, xgjSecret);
} }
@@ -113,6 +140,7 @@ public class PushServiceImpl implements PushService {
} }
@Override @Override
public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) { public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) {
this.modifyPosPassword(modifyPasswordDTO); this.modifyPosPassword(modifyPasswordDTO);
@@ -145,7 +173,7 @@ public class PushServiceImpl implements PushService {
String key = active+"_XgjOrganization_" + eid; String key = active+"_XgjOrganization_" + eid;
String resObject = redisUtilPool.getString(key); String resObject = redisUtilPool.getString(key);
if (StringUtils.isBlank(resObject)) { if (StringUtils.isBlank(resObject)) {
String apiUrl = xgjUrl + "/open/organization"; String apiUrl = xgjUrl + "/dmp/one-id/open/organization";
resObject = JSONObject.toJSONString(executeApiGetCall(apiUrl, null, Object.class, xgjUsername, xgjSecret)); resObject = JSONObject.toJSONString(executeApiGetCall(apiUrl, null, Object.class, xgjUsername, xgjSecret));
redisUtilPool.setNxExpire(key, resObject, 7200000); redisUtilPool.setNxExpire(key, resObject, 7200000);
} }
@@ -168,13 +196,46 @@ public class PushServiceImpl implements PushService {
} }
@Override
public XgjAccessTokenDTO getXgjAccessToken() {
String apiUrl = xgjTokenUrl + "/oauth2/token?grant_type=client_credentials&scope=server";
String clientId = "dmp-join";
String clientSecret = "dmp20250528";
String auth = clientId + ":" + clientSecret;
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes(StandardCharsets.UTF_8));
byte[] bytes = new byte[0];
Request request = new Request.Builder()
.url(apiUrl)
.post(RequestBody.create(MediaType.parse("application/json; charset=UTF-8"),bytes))
.header("Authorization", "Basic " + encodedAuth)
.build();
try (Response response = okHttpClient.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
"HTTP请求失败状态码: " + response.code());
}
String responseBody = response.body().string();
XgjAccessTokenDTO xgjAccessTokenDTO = objectMapper.readValue(responseBody, XgjAccessTokenDTO.class);
return xgjAccessTokenDTO;
} catch (ServiceException e) {
throw e;
} catch (Exception e) {
log.error("API调用异常 - URL: {}, 错误: {}", url, e.getMessage(), e);
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
}
}
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType, String username, String secret) { private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType, String username, String secret){
return executePostApiCall(url,requestBody,responseType,username,secret,null);
}
private <T> T executePostApiCall(String url, Object requestBody, Class<T> responseType, String username, String secret,String accessToken) {
// 1. 打印请求前日志 // 1. 打印请求前日志
logRequest(url, requestBody); logRequest(url, requestBody);
try { try {
Request request = buildRequest(requestBody, url, username, secret); Request request = buildRequest(requestBody, url, username, secret,accessToken);
request.headers().names().forEach(x->{ request.headers().names().forEach(x->{
log.info(x+": {}",request.header(x)); log.info(x+": {}",request.header(x));
@@ -261,7 +322,7 @@ public class PushServiceImpl implements PushService {
} }
private Request buildRequest(Object requestBody, String url, String username, String secret) { private Request buildRequest(Object requestBody, String url, String username, String secret,String accessToken) {
try { try {
Map<String, String> authHeaders = HmacSigner.generateHeaders( Map<String, String> authHeaders = HmacSigner.generateHeaders(
@@ -279,9 +340,13 @@ public class PushServiceImpl implements PushService {
.addHeader("Accept", "application/json") .addHeader("Accept", "application/json")
.addHeader("x-Date", authHeaders.get("x-Date")) .addHeader("x-Date", authHeaders.get("x-Date"))
.addHeader("Digest", authHeaders.get("Digest")); .addHeader("Digest", authHeaders.get("Digest"));
if (!url.contains("get-token-byshopcode")){ if (!url.contains("get-token-byshopcode")&&StringUtils.isEmpty(accessToken)){
builder.addHeader("Authorization", authHeaders.get("Authorization")); builder.addHeader("Authorization", authHeaders.get("Authorization"));
} }
//新管家特定接口
if (StringUtils.isNotEmpty(accessToken)){
builder.addHeader("Authorization", "Bearer "+accessToken);
}
return builder.build(); return builder.build();
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.THIRD_API_SIGN_ERROR); throw new ServiceException(ErrorCodeEnum.THIRD_API_SIGN_ERROR);

View File

@@ -781,7 +781,7 @@ public class ShopServiceImpl implements ShopService {
case SHOP_SUB_STAGE_STATUS_85: case SHOP_SUB_STAGE_STATUS_85:
return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, JOIN_OFFICE), shopInfo.getRegionId()); return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, JOIN_OFFICE), shopInfo.getRegionId());
case SHOP_SUB_STAGE_STATUS_72: // case SHOP_SUB_STAGE_STATUS_72:
case SHOP_SUB_STAGE_STATUS_83: case SHOP_SUB_STAGE_STATUS_83:
return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, BRANCH_OFFICE), shopInfo.getRegionId()); return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, BRANCH_OFFICE), shopInfo.getRegionId());
@@ -860,6 +860,18 @@ public class ShopServiceImpl implements ShopService {
} }
} }
@Override
public ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage) {
if(shopId == null|| subStage == null ){
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
ShopStageInfoDO stage = shopStageInfoDAO.getByShopIdAndSubStage(shopId, subStage);
if (stage!=null){
return new ShopStageInfoVO(stage.getShopStage(), stage.getShopSubStage(), stage.getShopSubStageStatus(),stage.getIsTerminated());
}
return null;
}
/** /**
* 获取招商经理信息 * 获取招商经理信息
* @param * @param

View File

@@ -100,6 +100,18 @@ public class StoreServiceImpl implements StoreService {
case ONLINE_ORDER_NAME: case ONLINE_ORDER_NAME:
dto.setOrderMiniProgramName(entry.getValue()); dto.setOrderMiniProgramName(entry.getValue());
break; break;
case TEST_JOIN_MODE:
case ONLINE_JOIN_MODE:
dto.setJoinMode(entry.getValue());
break;
case TEST_STORE_TYPE:
case ONLINE_STORE_TYPE:
dto.setStoreType(entry.getValue());
break;
case TEST_BRAND:
case ONLINE_BRAND:
dto.setBrand(entry.getValue());
break;
} }
} }
} }

View File

@@ -71,6 +71,7 @@ public class SyncDataServiceImpl implements SyncDataService {
@Override @Override
public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType) { public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType) {
ZxjpApiRequest request = new ZxjpApiRequest(); ZxjpApiRequest request = new ZxjpApiRequest();
request.setShopId(shopId);
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId); ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (shopInfo == null) { if (shopInfo == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);

View File

@@ -3,16 +3,19 @@ package com.cool.store.controller.webb;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.entity.ImportTaskDO; import com.cool.store.entity.ImportTaskDO;
import com.cool.store.enums.FileTypeEnum; import com.cool.store.enums.FileTypeEnum;
import com.cool.store.enums.ImportTaskStatusEnum; import com.cool.store.enums.ImportTaskStatusEnum;
import com.cool.store.mapper.ImportTaskMapper; import com.cool.store.mapper.ImportTaskMapper;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.DataHandlerServer; import com.cool.store.service.DataHandlerServer;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -152,4 +155,26 @@ public class DataHandlerController {
dataHandlerServer.dataHandlerV2025029(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO); dataHandlerServer.dataHandlerV2025029(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO);
return ResponseResult.success(true); return ResponseResult.success(true);
} }
/**
* @Auther: wangshuo
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用
*/
@ApiOperation("批量修改门店云流水开通状态")
@PostMapping("/batchStatusRefreshYls")
public ApiResponse<Boolean> batchStatusRefreshYls(@RequestBody @Validated BatchStatusRefreshDTO batchStatusRefreshDTO) {
return ApiResponse.success(dataHandlerServer.batchStatusRefreshYls(batchStatusRefreshDTO));
}
@ApiOperation("处理加盟费阶段")
@GetMapping("/franchiseFeeStageDateHandler")
public ResponseResult<Boolean> franchiseFeeStageDateHandler(){
return ResponseResult.success(dataHandlerServer.franchiseFeeStageDateHandler());
}
@ApiOperation("处理加盟费缴费信息历史数据")
@GetMapping("/franchiseFeeDateHandler")
public ResponseResult<Boolean> franchiseFeeDateHandler(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum){
return ResponseResult.success(dataHandlerServer.franchiseFeeDateHandler(pageSize,pageNum));
}
} }

View File

@@ -76,7 +76,8 @@ public class DeskController {
@ApiOperation("待处理-支付加盟费保证金") @ApiOperation("待处理-支付加盟费保证金")
@GetMapping("/payFranchiseFeesPendingList") @GetMapping("/payFranchiseFeesPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestParam(value = "pageNumber", required = true, defaultValue = "1") Integer pageNumber, public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestParam(value = "pageNumber", required = true, defaultValue = "1") Integer pageNumber,
@RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize , @RequestParam(value = "keyword") String keyword) { @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize ,
@RequestParam(value = "keyword") String keyword) {
LoginUserInfo userInfo = CurrentUserHolder.getUser(); LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.payFranchiseFeesPendingList(pageNumber, pageSize, userInfo,keyword)); return ResponseResult.success(deskService.payFranchiseFeesPendingList(pageNumber, pageSize, userInfo,keyword));
} }

View File

@@ -3,6 +3,8 @@ package com.cool.store.controller.webb;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.*; import com.cool.store.dto.*;
import com.cool.store.request.OpenApiStoreRequest; import com.cool.store.request.OpenApiStoreRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.bigdata.ApiResponse; import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.OpenApiService; import com.cool.store.service.OpenApiService;
@@ -51,12 +53,23 @@ public class OpenApiController {
return ApiResponse.success(pushService.getYlsToken(new GetAccessTokenDTO(ylsCode,ylsCode))); return ApiResponse.success(pushService.getYlsToken(new GetAccessTokenDTO(ylsCode,ylsCode)));
} }
@ApiOperation("获取门店信息") @ApiOperation("获取门店信息")
@PostMapping("/getStoreList") @PostMapping("/getStoreList")
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) { public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum())); return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
} }
@ApiOperation("新管家回调 刷新收款单状态")
@PostMapping("/changeReceiptStatus")
public ApiResponse<Boolean> changeReceiptStatus(@RequestBody @Validated ReceiptCallBackRequest request){
log.info("changeReceiptStatus request{}", JSONObject.toJSONString(request));
return openApiService.changeReceiptStatus(request);
}
@ApiOperation("新管家回调 账单收款状态及缴款金额")
@PostMapping("/changePaymentStatus")
public ApiResponse<Boolean> changePaymentStatus(@RequestBody @Validated FranchiseFeeCallBackRequest request){
log.info("changePaymentStatus request{}", JSONObject.toJSONString(request));
return openApiService.changePaymentStatus(request);
}
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.AmountDTO; import com.cool.store.dto.AmountDTO;
import com.cool.store.enums.point.PayBusinessTypeEnum; import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.request.LinePaySubmitRequest; import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.response.FranchiseFeePayInfoResponse;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.LinePayService; import com.cool.store.service.LinePayService;
import com.cool.store.vo.LinePayVO; import com.cool.store.vo.LinePayVO;
@@ -17,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @Author wxp * @Author wxp
@@ -44,12 +46,27 @@ public class PCLinePayController {
return ResponseResult.success(linePayService.getAmount(lineId)); return ResponseResult.success(linePayService.getAmount(lineId));
} }
@ApiOperation("缴纳意向金/加盟费") @ApiOperation("加盟费提交缴费信息")
@PostMapping("/submitPayInfo") @PostMapping("/submitFranchiseFeePayInfo")
public ResponseResult<Long> submitPayInfo(@RequestBody LinePaySubmitRequest request){ public ResponseResult<Long> submitFranchiseFeePayInfo(@RequestBody LinePaySubmitRequest request){
PartnerUserInfoVO partnerUser = PartnerUserHolder.getUser();
return ResponseResult.success(linePayService.submitPayInfo(request, partnerUser)); return ResponseResult.success(linePayService.submitFranchiseFeePayInfo(request, CurrentUserHolder.getUserId()));
}
@ApiOperation("查询加盟费缴费信息")
@GetMapping("/getFranchiseFeePayInfoList")
public ResponseResult<List<FranchiseFeePayInfoResponse>> getFranchiseFeePayInfoList(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(linePayService.getFranchiseFeePayInfoList(shopId));
} }
@ApiOperation("删除加盟费缴费信息")
@GetMapping("/deleteFranchiseFeePayInfo")
public ResponseResult<Boolean> deleteFranchiseFeePayInfo(@RequestParam("id") Long id) {
return ResponseResult.success(linePayService.deleteFranchiseFeePayInfo(id, CurrentUserHolder.getUserId()));
}
@ApiOperation("查询缴费信息")
@GetMapping("/getById")
public ResponseResult<FranchiseFeePayInfoResponse> getById(@RequestParam("id") Long id) {
return ResponseResult.success(linePayService.getById(id));
}
} }

View File

@@ -159,21 +159,16 @@ public class PCShopController {
} }
/**
* @Auther: wangshuo
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用
*/
@ApiOperation("批量修改门店云流水开通状态")
@PostMapping("/batchStatusRefreshYls")
public ApiResponse<Boolean> batchStatusRefreshYls(@RequestBody @Validated BatchStatusRefreshDTO batchStatusRefreshDTO) {
return ApiResponse.success(openApiService.batchStatusRefreshYls(batchStatusRefreshDTO));
}
@ApiOperation("获取店铺所属品牌") @ApiOperation("获取店铺所属品牌")
@GetMapping("/getFranchiseBrandName") @GetMapping("/getFranchiseBrandName")
public ResponseResult<String> getFranchiseBrandName(@RequestParam(name = "shopId")Long shopId) { public ResponseResult<String> getFranchiseBrandName(@RequestParam(name = "shopId")Long shopId) {
return ResponseResult.success(shopService.getFranchiseBrandName(shopId)); return ResponseResult.success(shopService.getFranchiseBrandName(shopId));
} }
@ApiOperation("获取店铺某阶段状态")
@GetMapping("/getShopStageStatus")
public ResponseResult<ShopStageInfoVO> getShopStageStatus(@RequestParam("shopId")Long shopId, @RequestParam("subStage")Integer subStage) {
return ResponseResult.success(shopService.getShopStageStatus(shopId, subStage));
}
} }

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.dto.FoodTokenDTO; import com.cool.store.dto.FoodTokenDTO;
import com.cool.store.dto.GetAccessTokenDTO; import com.cool.store.dto.GetAccessTokenDTO;
@@ -8,12 +9,17 @@ import com.cool.store.entity.*;
import com.cool.store.enums.DownSystemTypeEnum; import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.enums.MessageEnum; import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.SMSMsgEnum; import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.job.XxlJobHandler; import com.cool.store.job.XxlJobHandler;
import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.mq.util.HttpRestTemplateService; import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.GetPasswordDTO; import com.cool.store.request.GetPasswordDTO;
import com.cool.store.request.bigdata.ProfitDataRequest; import com.cool.store.request.bigdata.ProfitDataRequest;
import com.cool.store.request.huoma.ShopBasicInfoRequest; import com.cool.store.request.huoma.ShopBasicInfoRequest;
import com.cool.store.request.oppty.*; import com.cool.store.request.oppty.*;
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.bigdata.ActDataResponse; import com.cool.store.response.bigdata.ActDataResponse;
import com.cool.store.response.bigdata.ProfitDataResponse; import com.cool.store.response.bigdata.ProfitDataResponse;
@@ -25,14 +31,19 @@ import com.cool.store.response.oppty.OpportunityInfoPageResponse;
import com.cool.store.service.*; import com.cool.store.service.*;
import com.cool.store.service.impl.CommonService; import com.cool.store.service.impl.CommonService;
import com.cool.store.service.impl.UserAuthMappingServiceImpl; import com.cool.store.service.impl.UserAuthMappingServiceImpl;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController @RestController
@@ -59,6 +70,15 @@ public class PCTestController {
private SyncDataService syncDataService; private SyncDataService syncDataService;
@Resource @Resource
private HttpRestTemplateService httpRestTemplateService; private HttpRestTemplateService httpRestTemplateService;
@Resource
FranchiseFeeMapper franchiseFeeMapper;
@Resource
ShopInfoMapper shopInfoMapper;
@Resource
LinePayService linePayService;
@Resource
LinePayDAO linePayDAO;
@GetMapping("/sendMessage") @GetMapping("/sendMessage")
public ResponseResult<Boolean> sendMessage(@RequestParam("lineId")Long lineId, public ResponseResult<Boolean> sendMessage(@RequestParam("lineId")Long lineId,
@@ -262,6 +282,12 @@ public class PCTestController {
return ResponseResult.success(pushService.getXgjOrganization(partnerId)); return ResponseResult.success(pushService.getXgjOrganization(partnerId));
} }
@GetMapping("/getXgjAccessToken")
@ApiOperation("获取新管家token")
public ResponseResult<Object> getXgjAccessToken() {
return ResponseResult.success(pushService.getXgjAccessToken());
}
@Resource @Resource
ShopAccountService accountService; ShopAccountService accountService;
@@ -304,4 +330,78 @@ public class PCTestController {
return ResponseResult.success(thirdFoodService.getFoodToken(dto)); return ResponseResult.success(thirdFoodService.getFoodToken(dto));
} }
@GetMapping("/getToday")
@ApiOperation("getToday")
public ResponseResult<Boolean> getToday() {
for (int i = 0; i < 10; i++) {
System.out.println(linePayService.getPaymentReceiptCode());
}
return ResponseResult.success(Boolean.TRUE);
}
@GetMapping("/pushFranchiseFee")
@ApiOperation("推送账单")
public ResponseResult<Boolean> pushFranchiseFee(@RequestParam(value = "shopId", required = true) Long shopId) {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
pushService.pushFranchiseFeeToXGJ(feeRequest);
return ResponseResult.success(Boolean.TRUE);
}
@GetMapping("/pushPay")
@ApiOperation("推送收款单")
public ResponseResult<Boolean> pushPay(@RequestParam(value = "shopId", required = true) Long shopId,
@RequestParam(value = "payId", required = true) Long payId) {
LinePayDO pay = linePayDAO.getById(payId);
linePayService.pushPayInfo(shopId,pay);
return ResponseResult.success(Boolean.TRUE);
}
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@GetMapping("/franchiseFeeDataHandler")
@ApiOperation("加盟费数据处理")
public ResponseResult<Boolean> franchiseFeeDataHandler(){
//查询所有的待加盟商缴费 推送账单
List<ShopStageInfoDO> shopList = shopStageInfoDAO.getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus());
log.info("----------开始推送账单数据---------");
shopList.forEach(x->{
try {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(x.getShopId());
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(x.getShopId());
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
pushService.pushFranchiseFeeToXGJ(feeRequest);
} catch (Exception e) {
log.error("推送数据失败 shopId {},异常信息:{}",x,e.getMessage());
}
});
log.info("----------推送账单数据结束---------");
//对账中
log.info("----------开始推送账单与收款单数据---------");
List<ShopStageInfoDO> shopList2 = shopStageInfoDAO.getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus());
shopList2.forEach(x->{
//先推送账单
try {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(x.getShopId());
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(x.getShopId());
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
pushService.pushFranchiseFeeToXGJ(feeRequest);
List<LinePayDO> franchiseFeePayInfoByShopId = linePayDAO.getFranchiseFeePayInfoByShopId(x.getShopId());
franchiseFeePayInfoByShopId.forEach(y->{
linePayService.pushPayInfo(x.getShopId(),y);
});
} catch (Exception e) {
log.error("推送数据失败 shopId {},异常信息:{}",x,e.getMessage());
}
});
log.info("----------账单与收款单数据推送完成---------");
return ResponseResult.success(Boolean.TRUE);
}
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.AmountDTO; import com.cool.store.dto.AmountDTO;
import com.cool.store.enums.point.PayBusinessTypeEnum; import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.request.LinePaySubmitRequest; import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.response.FranchiseFeePayInfoResponse;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.LinePayService; import com.cool.store.service.LinePayService;
import com.cool.store.vo.LinePayVO; import com.cool.store.vo.LinePayVO;
@@ -17,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @Author wxp * @Author wxp
@@ -54,4 +56,27 @@ public class LinePayController {
return ResponseResult.success(linePayService.getAmount(lineId)); return ResponseResult.success(linePayService.getAmount(lineId));
} }
@ApiOperation("加盟费提交缴费信息")
@PostMapping("/submitFranchiseFeePayInfo")
public ResponseResult<Long> submitFranchiseFeePayInfo(@RequestBody LinePaySubmitRequest request){
return ResponseResult.success(linePayService.submitFranchiseFeePayInfo(request, PartnerUserHolder.getUser().getPartnerId()));
}
@ApiOperation("查询加盟费缴费信息")
@GetMapping("/getFranchiseFeePayInfoList")
public ResponseResult<List<FranchiseFeePayInfoResponse>> getFranchiseFeePayInfoList(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(linePayService.getFranchiseFeePayInfoList(shopId));
}
@ApiOperation("删除加盟费缴费信息")
@GetMapping("/deleteFranchiseFeePayInfo")
public ResponseResult<Boolean> deleteFranchiseFeePayInfo(@RequestParam("id") Long id) {
return ResponseResult.success(linePayService.deleteFranchiseFeePayInfo(id, PartnerUserHolder.getUser().getPartnerId()));
}
@ApiOperation("查询缴费信息")
@GetMapping("/getById")
public ResponseResult<FranchiseFeePayInfoResponse> getById(@RequestParam("id") Long id) {
return ResponseResult.success(linePayService.getById(id));
}
} }

View File

@@ -138,4 +138,10 @@ public class MiniShopController {
return ResponseResult.success(shopService.getFranchiseBrandName(shopId)); return ResponseResult.success(shopService.getFranchiseBrandName(shopId));
} }
@ApiOperation("获取店铺某阶段状态")
@GetMapping("/getShopStageStatus")
public ResponseResult<ShopStageInfoVO> getShopStageStatus(@RequestParam("shopId")Long shopId, @RequestParam("subStage")Integer subStage) {
return ResponseResult.success(shopService.getShopStageStatus(shopId, subStage));
}
} }

View File

@@ -94,9 +94,10 @@ api.auth.username=GkqgAhUJ7p9swJo
api.auth.secret=NzVrnS3OWiupdDY api.auth.secret=NzVrnS3OWiupdDY
#xingguanjia #xingguanjia
xgj.api.auth.url=https://masterdata.zhengxinfood.com/dmp/one-id xgj.api.auth.url=https://masterdata.zhengxinfood.com
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
xgj.api.token.url=http://121.199.29.202:9000
#yunliushui #yunliushui
yls.api.auth.url=http://yuanguiwuliu.com yls.api.auth.url=http://yuanguiwuliu.com

View File

@@ -105,9 +105,10 @@ api.auth.username=VA59C0ubfcpcVpl
api.auth.secret=H9YKHF6R7N16Fvy api.auth.secret=H9YKHF6R7N16Fvy
#新管家账号 #新管家账号
xgj.api.auth.url=http://117.139.13.24:11180/dmp/one-id xgj.api.auth.url=http://117.139.13.24:11180
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
xgj.api.token.url=http://117.139.13.24:29000
#云流水账号 #云流水账号
#yls.api.auth.url=http://scm330-test.366ec.net #yls.api.auth.url=http://scm330-test.366ec.net