Merge branch 'refs/heads/master' into cc_2021104_twelve_points

This commit is contained in:
wangff
2025-11-20 16:54:35 +08:00
65 changed files with 1529 additions and 49 deletions

View File

@@ -283,4 +283,10 @@ public class RedisConstant {
public static final String SUBMIT_BUILD_KEY = "submit_build_key_";
public static final String GET_AI_MODULE = "get_ai_module_";
public static final String HUOMA_STORE_DEVICE_RESOURCE_KEY = "huoma_store_device_resource";
public static final String HUO_MA_STORE_ID = "huo_ma_store_id";
public static final String HUO_MA_TOKEN= "huo_ma_token:{0}";
}

View File

@@ -9,7 +9,8 @@ package com.cool.store.enums;
public enum BusinessModelEnum {
NULL(0, ""),
DIRECT_SALES(1, "直营"),
JOIN_SALES(2, "加盟");
JOIN_SALES(2, "加盟"),
JOINT_STORE(3, "联营");
private Integer code;
private String desc;

View File

@@ -212,7 +212,9 @@ public enum ErrorCodeEnum {
INVOICING_EXIST(109016, "当前门店发票信息已存在!", null),
SHOP_STATUS_NOT_SUPPORT_HANDLER(109016, "当前门店状态为:{0},不能进行结束跟进操作", null),
SHOP_STATUS_NOT_SUPPORT_HANDLER(109017, "当前门店状态为:{0},不能进行结束跟进操作", null),
SYSTEM_NAME_NOT__SUPPORT(109018, "请不要使用系统默认店名!", null),
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),

View File

@@ -0,0 +1,58 @@
package com.cool.store.enums;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2025/11/5 16:03
* @Version 1.0
*/
public enum SpecialTagEnum {
ELECTRONIC_PRICE_LIST("电子价目牌"),
ACTIVITY_CAROUSEL("活动轮播"),
ACTIVITY_PACKAGE("活动套餐"),
PROMOTIONAL_VIDEO("宣传视频");
private final String tagName;
SpecialTagEnum(String tagName) {
this.tagName = tagName;
}
public String getTagName() {
return tagName;
}
/**
* 根据标签名称获取枚举值
*/
public static SpecialTagEnum fromTagName(String tagName) {
for (SpecialTagEnum tag : values()) {
if (tag.getTagName().equals(tagName)) {
return tag;
}
}
return null;
}
/**
* 获取所有标签名称列表
*/
public static List<String> getAllTagNames() {
return Arrays.stream(values())
.map(SpecialTagEnum::getTagName)
.collect(Collectors.toList());
}
/**
* 获取电子价目牌标签名称
* @return
*/
public static List<String> getElectronicPriceTagName() {
return Arrays.asList(ELECTRONIC_PRICE_LIST.getTagName());
}
}

View File

@@ -69,7 +69,8 @@ public enum UserRoleEnum {
JING_DONG_OPERATIONS_CUSTOMER(500000000L,"京东运营大区客服"),
JING_DONG_HEADQUARTERS_BUILD_CUSTOMER(510000000L,"京东总部建店客服"),
FRANCHISEES(530000000L,"加盟商")
FRANCHISEES(530000000L,"加盟商"),
SERVICE_PACKAGE_DEDICATED(1762761165005L,"服务包专用"),
;
private Long code;

View File

@@ -10,9 +10,9 @@ import java.util.List;
*/
public enum ModuleCodeEnum {
STORE_WORK(0,"店务日清/培训", Arrays.asList(MatterTypeEnum.QUESTION,MatterTypeEnum.LICENSE)),
PRODUCT_UPDATE(1,"营销政策/产品上新",Arrays.asList(MatterTypeEnum.SERVICE_PACKAGE)),
INVENTORY_MODULE(2,"原料订货库存管理",Arrays.asList(MatterTypeEnum.RESTOCK,MatterTypeEnum.INVENTORY,MatterTypeEnum.LOGISTICS)),
STORE_WORK(0,"店务/培训", Arrays.asList(MatterTypeEnum.QUESTION,MatterTypeEnum.LICENSE)),
PRODUCT_UPDATE(1,"营销/上新",Arrays.asList(MatterTypeEnum.SERVICE_PACKAGE)),
INVENTORY_MODULE(2,"订货/库存",Arrays.asList(MatterTypeEnum.RESTOCK,MatterTypeEnum.INVENTORY,MatterTypeEnum.LOGISTICS)),
DISH(3,"菜品",Arrays.asList(MatterTypeEnum.NOTICE)),
FRANCHISE(4,"加盟",Arrays.asList(MatterTypeEnum.NOTICE)),
//其他(投诉与客户服务、临时通知)

View File

@@ -0,0 +1,62 @@
package com.cool.store.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @Author suzhuhong
* @Date 2025/11/4 17:34
* @Version 1.0
*/
public class BrowserVersionUtils {
/**
* 检测是否为旧版Chrome浏览器版本小于60
* @param userAgent 浏览器User-Agent字符串
* @return true-是旧版Chromefalse-不是旧版Chrome
*/
public static boolean isOldChromeBrowser(String userAgent) {
if (userAgent == null || userAgent.isEmpty()) {
return false;
}
// 检查是否是Chrome浏览器
if (!userAgent.contains("Chrome")) {
return false; // 不是Chrome浏览器
}
// 提取Chrome版本号
Integer chromeVersion = extractChromeVersion(userAgent);
if (chromeVersion == null) {
return false; // 无法提取版本号
}
// 判断版本是否小于60
return chromeVersion < 60;
}
/**
* 从User-Agent中提取Chrome主版本号
* @param userAgent 浏览器User-Agent字符串
* @return Chrome主版本号如果无法提取返回null
*/
public static Integer extractChromeVersion(String userAgent) {
// 正则表达式匹配 Chrome/版本号 模式
Pattern pattern = Pattern.compile("Chrome/(\\d+)");
Matcher matcher = pattern.matcher(userAgent);
if (matcher.find()) {
try {
return Integer.parseInt(matcher.group(1));
} catch (NumberFormatException e) {
System.err.println("版本号格式错误: " + matcher.group(1));
return null;
}
}
return null;
}
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.utils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
/**
* <p>
* 公共工具
* </p>
*
* @author wangff
* @since 2025/10/29
*/
public class CommonUtil {
public static BigDecimal convertToBig(String value) {
if (StringUtils.isBlank(value)) {
return BigDecimal.ZERO;
}
try {
return new BigDecimal(value);
} catch (Exception ignored) {}
return BigDecimal.ZERO;
}
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.dao;
import com.cool.store.dto.region.BigRegionDTO;
import com.cool.store.entity.BigRegionDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.FranchiseBrandEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.BigRegionMapper;
import com.cool.store.request.QueryBigRegionRequest;
@@ -12,6 +13,7 @@ import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -25,8 +27,8 @@ public class BigRegionDAO {
@Resource
BigRegionMapper bigRegionMapper;
public List<BigRegionDTO> queryAllBigRegion(String keyword){
return bigRegionMapper.queryAllBigRegion(keyword);
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand){
return bigRegionMapper.queryAllBigRegion(keyword, joinBrand);
}
public BigRegionDO queryOrgInfoByBigRegionAndJoinMode(Long regionId, Integer joinMode){

View File

@@ -4,7 +4,9 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.BuildStageDTO;
import com.cool.store.dto.PlatformBuildStageDTO;
import com.cool.store.dto.Preparation.ScheduleDTO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.FranchiseBrandEnum;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
@@ -40,17 +42,22 @@ public class ShopStageInfoDAO {
/**
* 初始化店铺阶段信息
* @param lineId
* @param shopIds
* @param shopInfoList
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
*/
public Integer initShopStageInfo(Long lineId, List<Long> shopIds, Boolean flag) {
if (CollectionUtils.isEmpty(shopIds)) {
public Integer initShopStageInfo(Long lineId, List<ShopInfoDO> shopInfoList, Boolean flag) {
if (CollectionUtils.isEmpty(shopInfoList)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
LocalDate selectStartDate = LocalDate.now();
for (Long shopId : shopIds) {
for (ShopInfoDO shopInfoDO : shopInfoList) {
Long shopId = shopInfoDO.getId();
for (ShopSubStageEnum shopSubStageEnum : ShopSubStageEnum.values()) {
if (ShopSubStageEnum.SHOP_STAGE_24.equals(shopSubStageEnum) && String.valueOf(FranchiseBrandEnum.ZXSMZ.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
// 三明治跳过营帐通开通
continue;
}
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setLineId(lineId);
shopStageInfo.setShopId(shopId);

View File

@@ -15,7 +15,7 @@ public interface BigRegionMapper extends Mapper<BigRegionDO> {
* @param keyword
* @return
*/
List<BigRegionDTO> queryAllBigRegion(String keyword);
List<BigRegionDTO> queryAllBigRegion(@Param("keyword") String keyword, @Param("joinBrand") Integer joinBrand);
/**
* 根据所属大区与加盟模式查询新管家信息

View File

@@ -38,6 +38,9 @@
<if test="keyword!=null and keyword !=''">
and region_name like CONCAT('%',#{keyword},'%')
</if>
<if test="joinBrand != null">
and join_brand = #{joinBrand}
</if>
</where>
</select>

View File

@@ -278,7 +278,11 @@
from
xfsg_shop_info a
left join store_${enterpriseId} b on a.shop_code = b.store_num
where b.store_id is not null and a.id in
where a.shop_code is not null
and a.shop_code !=''
and b.store_id is not null
and b.is_delete = 'effective'
and a.id in
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
#{shopId}
</foreach>

View File

@@ -397,7 +397,7 @@
and eu.active = true
-- and sr.source = 'create'
<if test="positionType != null and positionType != '' ">
and (sr.position_type = #{positionType} or sr.id in (180000000,120000000,40000000))
and (sr.position_type = #{positionType} or sr.id in (180000000,120000000,40000000,1762761165005))
</if>
and eu.user_status = '1'
</select>

View File

@@ -55,7 +55,7 @@
</foreach>
</if>
<if test="positionType!=null and positionType!=''">
and (b.position_type =#{positionType} or b.id in (180000000,120000000,40000000) )
and (b.position_type =#{positionType} or b.id in (180000000,120000000,40000000,1762761165005))
</if>
<if test="notRoleAuth!=null and notRoleAuth!=''">
and b.role_auth !=#{notRoleAuth}

View File

@@ -0,0 +1,20 @@
package com.cool.store.dto.huoma;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/11/6 11:09
* @Version 1.0
*/
@Data
public class AccountTagDTO {
@ApiModelProperty("门店编码")
private String storeNum;
@ApiModelProperty("设备名称")
private String deviceName;
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.dto.huoma;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <p>
* 火码账号DTO
* </p>
*
* @author wangff
* @since 2025/9/23
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HuoMaAccountDTO {
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 是否已查询
*/
private Boolean isQuery;
public HuoMaAccountDTO(String account, String password) {
this.account = account;
this.password = password;
this.isQuery = false;
}
}

View File

@@ -0,0 +1,40 @@
package com.cool.store.dto.huoma;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2025/11/5 14:43
* @Version 1.0
*/
@Data
public class ProgramReqDTO {
@ApiModelProperty(name = "门店编码",required = true)
private String storeCode;
@ApiModelProperty(name = "设备名称",required = true)
@NotEmpty(message = "设备名称不能为空")
private String deviceName;
@ApiModelProperty(name = "第几页,",required = true)
private Integer index;
@ApiModelProperty(name ="每页数量",required = true)
private Integer size;
@ApiModelProperty(name = "时间",hidden = true)
private String date;
@ApiModelProperty(name = "排序",hidden = true)
private String sort;
@ApiModelProperty("标签id列表")
private List<Integer> tagIds;
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.dto.huoma;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/11/5 14:44
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProgramResponseDTO {
@ApiModelProperty("节目ID")
private Long id;
@ApiModelProperty("节目名称")
private String name;
@ApiModelProperty("节目缩略图")
private String thumbnail;
}

View File

@@ -0,0 +1,27 @@
package com.cool.store.dto.huoma;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2025/11/5 17:06
* @Version 1.0
*/
@Data
public class PublishDTO {
@ApiModelProperty(name = "门店编号",required = true)
@NotEmpty(message = "门店编码不能为空")
private String storeCode;
@ApiModelProperty(name = "设备ID列表",required = true)
@NotEmpty(message = "设备ID列表不能为空")
@JSONField(name = "terminals")
private List<String> deviceIdList;
@ApiModelProperty("节目id")
private Long programId;
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.dto.huoma;
import com.cool.store.utils.BrowserVersionUtils;
import lombok.Data;
import java.util.Objects;
/**
* @Author: WangShuo
* @Date: 2025/08/13/16:24
* @Version 1.0
* @注释:
*/
@Data
public class StoreEquipmentDTO {
/**
* 已授权登录数
*/
private Integer activeCount;
/**
* 总设备
*/
private Integer terminalCount;
/**
* 网点ID
*/
private Integer pointId;
/**
* 网点号
*/
private String pointCode;
/**
* 签到数
*/
private Integer signCount;
/**
* 在线
*/
private Integer connectCount;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StoreEquipmentDTO that = (StoreEquipmentDTO) o;
return Objects.equals(pointCode, that.pointCode);
}
@Override
public int hashCode() {
return Objects.hashCode(pointCode);
}
}

View File

@@ -0,0 +1,40 @@
package com.cool.store.dto.huoma;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/8/18 16:00
* @Version 1.0
*/
@Data
public class StoreRequestDTO {
private String reportCode;
private Integer index;
private Integer size;
private Params params;
public StoreRequestDTO(String reportCode, Integer index, Integer size, String shopCode) {
this.reportCode = reportCode;
this.index = index;
this.size = size;
this.params = new Params(shopCode);
}
@Data
static class Params{
private String inputText_2;
public Params(String inputText_2) {
this.inputText_2 = inputText_2;
}
}
}

View File

@@ -0,0 +1,24 @@
package com.cool.store.dto.huoma;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/8/18 16:38
* @Version 1.0
*/
@Data
public class StoreXinFaDetailRequestDTO {
private Integer index;
private Integer size;
private Integer pointId;
public StoreXinFaDetailRequestDTO(Integer index, Integer size, Integer pointId) {
this.index = index;
this.size = size;
this.pointId = pointId;
}
}

View File

@@ -0,0 +1,81 @@
package com.cool.store.dto.huoma;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
import com.cool.store.utils.BrowserVersionUtils;
import com.cool.store.utils.StringUtil;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.lang.reflect.Type;
/**
* @Author suzhuhong
* @Date 2025/8/18 16:27
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class StoreXinFaDeviceDetail {
/**
* 设备ID
*/
@ApiModelProperty(value = "设备ID")
private String id;
@ApiModelProperty("设备id")
private String deviceId;
/**
* 设备名称
*/
@ApiModelProperty(value = "设备名称")
private String name;
/**
* 设备连接状态 0:未连接 1:已连接
*/
@ApiModelProperty(value = "设备连接状态 false:未连接 true:已连接")
private Boolean isConnect;
/**
* 设备总内存
*/
@ApiModelProperty(value = "设备总内存")
private String totalRam;
/**
* 设备可用内存
*/
@ApiModelProperty(value = "设备可用内存")
private String availRam;
/**
* 设备浏览器信息
*/
@ApiModelProperty(value = "设备浏览器信息")
private String userAgent;
/**
* 内用内存小于300M 或者 浏览器版本小于60
*/
@ApiModelProperty(value = "内用内存小于300M 或者 浏览器版本小于60")
private Boolean flag;
public boolean getFlag() {
if (StringUtil.isEmpty(availRam)||StringUtil.isEmpty(userAgent)){
return false;
}
try {
Boolean isOldChromeBrowser = BrowserVersionUtils.isOldChromeBrowser(userAgent);
long availableMemoryMB = Long.parseLong(availRam) / (1024 * 1024);
return availableMemoryMB < 300 || isOldChromeBrowser;
} catch (NumberFormatException e) {
return false;
}
}
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.dto.huoma;
import io.swagger.models.auth.In;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/11/5 9:33
* @Version 1.0
*/
@Data
public class TagDTO {
private String channelType;
private Integer index;
private Integer size;
private String type;
public TagDTO(String channelType, Integer index, Integer size, String type) {
this.channelType = channelType;
this.index = index;
this.size = size;
this.type = type;
}
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.dto.huoma;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2025/11/5 9:41
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class TagDetailDTO {
@ApiModelProperty("标签Id")
private Integer id;
@ApiModelProperty("标签名称")
private String name;
}

View File

@@ -25,6 +25,12 @@ public class RevenueDataDTO {
@ApiModelProperty("实收")
private BigDecimal receivedAmt;
@ApiModelProperty("外卖实收")
private BigDecimal takeoutReceivedAmt;
@ApiModelProperty("堂食实收")
private BigDecimal dineInReceivedAmt;
@ApiModelProperty("营业时间yyyy-MM-dd")
private String businessDate;

View File

@@ -70,6 +70,12 @@ public class BigRegionDO {
@Column(name = "hqt_region_name")
private String hqtRegionName;
/**
* 加盟品牌
*/
@Column(name = "join_brand")
private Integer joinBrand;
public String getHqtRegionName() {
return hqtRegionName;
}

View File

@@ -72,4 +72,8 @@ public class FranchiseFeeDO {
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
@Column(name = "cashier_fee")
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
}

View File

@@ -117,4 +117,8 @@ public class OrderSysInfoDO {
/** 总部订货收款修改人 */
@Column(name = "receiving_update_user")
private String receivingUpdateUser;
/** 订货方式0先款后货、1先货后款 */
@Column(name = "order_type")
private Integer orderType;
}

View File

@@ -44,6 +44,8 @@ public class FranchiseFeeRequest {
@ApiModelProperty("加盟费优惠原因")
private String discountReason;
@ApiModelProperty("收银费(系统费)(三明治使用)")
private String cashierFee;
public FranchiseFeeDO toFranchiseFeeDO() {
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
@@ -63,6 +65,7 @@ public class FranchiseFeeRequest {
franchiseFeeDO.setThirdYearFee(this.thirdYearFee);
franchiseFeeDO.setPerformanceBond(this.performanceBond);
franchiseFeeDO.setDiscountReason(this.discountReason);
franchiseFeeDO.setCashierFee(this.cashierFee);
return franchiseFeeDO;
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.request;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.OrderSysInfoDO;
import com.cool.store.enums.JoinModeEnum;
import com.cool.store.enums.OrderSysTypeEnum;
@@ -95,6 +96,9 @@ public class OrderSysInfoRequest {
@ApiModelProperty(value = "总部订货收款修改人" )
private String receivingUpdateUser;
@ApiModelProperty("订货方式0先款后货、1先货后款")
private Integer orderType;
public OrderSysInfoDO toOrderSysInfoDO() {
OrderSysInfoDO orderSysInfoDO = new OrderSysInfoDO();
orderSysInfoDO.setShopId(this.shopId);
@@ -131,7 +135,10 @@ public class OrderSysInfoRequest {
if (Objects.equals(joinMode, JoinModeEnum.FLAGSHIP_STORE.getCode())&&this.shopCode!=null){
return true;
}
if (StringUtils.isAnyBlank(this.receivingFirmName,this.receivingMsBankAccount,this.receivingMsBankBranch,this.bankUnionPayAccount,this.shopCode)){
if (StringUtils.isBlank(this.shopCode)) {
return false;
}
if (!CommonConstants.INDEX_ONE.equals(this.orderType) && StringUtils.isAnyBlank(this.receivingFirmName,this.receivingMsBankAccount,this.receivingMsBankBranch,this.bankUnionPayAccount)){
return false;
}
}

View File

@@ -3,10 +3,13 @@ package com.cool.store.request.xgj;
import com.cool.store.entity.FranchiseFeeDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.Date;
import static com.cool.store.utils.CommonUtil.convertToBig;
/**
* @Author suzhuhong
* @Date 2025/6/3 16:52
@@ -45,16 +48,23 @@ public class PushFranchiseFeeRequest {
@ApiModelProperty( "创建时间")
private Date createTime;
@ApiModelProperty("品牌")
private Integer joinBrand;
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.setFranchiseFee(convertToBig(franchiseFeeDO.getYearFranchiseFee()));
this.setBond(convertToBig(franchiseFeeDO.getLoanMargin()));
this.setFirstYearManageFee(convertToBig(franchiseFeeDO.getFirstYearManageFee()));
this.setFirstYearFee(convertToBig(franchiseFeeDO.getFirstYearFee()));
this.setDesignFee(convertToBig(franchiseFeeDO.getPerformanceBond()));
// 三明治收银费
if (StringUtils.isNotBlank(franchiseFeeDO.getCashierFee())) {
this.setFranchiseFee(convertToBig(franchiseFeeDO.getCashierFee()));
}
this.setTotalFee(this.getBond()
.add(this.getFranchiseFee())
.add(this.getFirstYearManageFee())

View File

@@ -56,6 +56,9 @@ public class ReceiptRequest {
@ApiModelProperty( "删除标识")
private Integer deleted = 0;
@ApiModelProperty("品牌")
private Integer joinBrand;
public ReceiptRequest() {
}

View File

@@ -241,5 +241,9 @@ public class AddSignFranchiseResponse {
@ApiModelProperty("是否统管 1-统管0-不统管")
private Integer unifiedManagement;
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
@ApiModelProperty("收银费(系统费)大写")
private String bigCashierFee;
}

View File

@@ -206,4 +206,7 @@ public class BuildInformationResponse {
@ApiModelProperty(value = "建店资料当前阶段状态")
private Integer shopSubStageStatus;
@ApiModelProperty("订货方式0先款后货、1先货后款")
private Integer orderType;
}

View File

@@ -63,7 +63,8 @@ public class FranchiseFeeResponse {
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
@Data
public static class LinePay{
@@ -200,6 +201,7 @@ public class FranchiseFeeResponse {
franchiseFeeResponse.setXgjCollectionStatus(franchiseFeeDO.getXgjCollectionStatus());
franchiseFeeResponse.setXgjRemainderPayableAmount(franchiseFeeDO.getXgjRemainderPayableAmount());
franchiseFeeResponse.setXgjFeesPaid(franchiseFeeDO.getXgjFeesPaid());
franchiseFeeResponse.setCashierFee(franchiseFeeDO.getCashierFee());
return franchiseFeeResponse;
}
}

View File

@@ -56,4 +56,7 @@ public class PreparationCommonPendingVO {
@ApiModelProperty("签约人2姓名")
private String partnershipSignatorySecond;
@ApiModelProperty("加盟品牌")
private String franchiseBrand;
}

View File

@@ -34,5 +34,11 @@ public class RevenueDataVO {
@ApiModelProperty("菜品列表")
private List<LaunchDataVO> otherRecipeLaunchDates;
@ApiModelProperty("外卖实收")
private BigDecimal takeoutReceivedAmt;
@ApiModelProperty("堂食实收")
private BigDecimal dineInReceivedAmt;
}

View File

@@ -21,7 +21,7 @@ public interface BigRegionService {
* @param keyword 关键字
* @return
*/
List<BigRegionDTO> queryAllBigRegion(String keyword);
List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand);
/**
* 根据门店所属大区和加盟模式查询新管家对应组织信息

View File

@@ -25,8 +25,8 @@ public class BigRegionServiceImpl implements BigRegionService {
BigRegionDAO bigRegionDAO;
@Override
public List<BigRegionDTO> queryAllBigRegion(String keyword){
return bigRegionDAO.queryAllBigRegion(keyword);
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand){
return bigRegionDAO.queryAllBigRegion(keyword, joinBrand);
}
@Override

View File

@@ -213,6 +213,7 @@ public class BuildInformationServiceImpl implements BuildInformationService {
response.setReceivingMsBankAccount(orderSysInfoDO.getReceivingMsBankAccount());
response.setReceivingMsBankBranch(orderSysInfoDO.getReceivingMsBankBranch());
response.setBankUnionPayAccount(orderSysInfoDO.getBankUnionPayAccount());
response.setOrderType(orderSysInfoDO.getOrderType());
WarehouseInfoDO warehouseInfoDO = warehouseInfoMapper.getByCode(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse());
if (Objects.nonNull(warehouseInfoDO)) {
response.setDeclareGoodsLogisticsWarehouseName(warehouseInfoDO.getWarehouseName());

View File

@@ -1170,7 +1170,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
shopInfoDO.setManagerRegionId(isCreateStoreDTO.getPid());
updateList.add(shopInfoDO);
}
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null);
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null, null);
Map<Long, BigRegionDTO> bigRegionDTOMap = bigRegionDTOS.stream().collect(Collectors.toMap(BigRegionDTO::getRegionId, x -> x));
//XX大区 正烧鸡
List<Long> storeManageIds = bigRegionDTOS.stream().filter(x -> x.getStoreManageRegionId() != null).map(BigRegionDTO::getStoreManageRegionId).collect(Collectors.toList());

View File

@@ -725,6 +725,7 @@ public class DeskServiceImpl implements DeskService {
preparationCommonPendingVO.setShopManagerUserName(userNameMap.getOrDefault(shopInfoDO.getShopManagerUserId(), ""));
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(shopInfoDO.getRegionId(), ""));
preparationCommonPendingVO.setUpdateTime(x.getUpdateTime());
preparationCommonPendingVO.setFranchiseBrand(shopInfoDO.getFranchiseBrand());
list.add(preparationCommonPendingVO);
});
result.setList(list);

View File

@@ -75,6 +75,13 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
// 三明治前端没有改这块代码,还是会传这三个字段,因此后端这三个字段置空
if (Integer.valueOf(shopInfoDO.getFranchiseBrand()).equals(FranchiseBrandEnum.ZXSMZ.getCode())) {
request.setFirstYearManageFee("0");
request.setFirstYearFee("0");
request.setYearFranchiseFee("0");
}
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
if (request.getId() != null) {
@@ -89,11 +96,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
franchiseFeeDO.setCreateTime(new Date());
franchiseFeeMapper.insertSelective(franchiseFeeDO);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES);
//推送加盟费信息到新管家
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
feeRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true;
}
@@ -116,6 +123,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
//推送加盟费信息到新管家
franchiseFeeDO.setCreateTime(franchiseFeeDO1.getCreateTime());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
feeRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true;
}

View File

@@ -308,6 +308,10 @@ public class LinePayServiceImpl implements LinePayService {
public Boolean pushPayInfo(Long shopId, LinePayDO linePayDO) {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
ReceiptRequest receiptRequest = new ReceiptRequest(shopId, franchiseFeeDO.getId().intValue(), linePayDO);
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
if (Objects.nonNull(shopInfoDO)) {
receiptRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
}
//推送缴费单数据到新管家
pushService.pushReceiptToXGJ(receiptRequest);
return Boolean.TRUE;

View File

@@ -143,6 +143,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
orderSysInfoDO.setReceivingMsBankAccount(request.getReceivingMsBankAccount());
orderSysInfoDO.setReceivingMsBankBranch(request.getReceivingMsBankBranch());
orderSysInfoDO.setBankUnionPayAccount(request.getBankUnionPayAccount());
orderSysInfoDO.setOrderType(request.getOrderType());
if (shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
if (orderSysInfoDO.getReceivingCreateTime() == null) {
orderSysInfoDO.setReceivingCreateTime(new Date());

View File

@@ -519,6 +519,14 @@ public class PointServiceImpl implements PointService {
if (AuditStatusEnum.REJECT.equals(auditStatus)) {
return auditRejectDeal(pointInfo, request.getReason());
}
// 如果是三明治,将地址写入门店信息表
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(pointInfo.getShopId());
if (Objects.nonNull(shopInfo) && Integer.valueOf(shopInfo.getFranchiseBrand()).equals(FranchiseBrandEnum.ZXSMZ.getCode())) {
ShopInfoDO updateShopInfo = new ShopInfoDO();
updateShopInfo.setId(pointInfo.getShopId());
updateShopInfo.setDetailAddress(pointInfo.getAddress());
shopInfoDAO.updateShopInfo(updateShopInfo);
}
//处理下一节点任务及更新point状态
return dealNextAuditRecord(pointInfo, pointAuditRecordMap, pointTodo.getNodeNo());
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.*;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.PosAndOrderInfoDO;
@@ -16,6 +17,7 @@ import com.cool.store.response.PosAndOrderResponse;
import com.cool.store.service.PosAndOrderInfoService;
import com.cool.store.mapper.PosAndOrderInfoMapper;
import com.cool.store.service.PreparationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -30,6 +32,7 @@ import java.util.Objects;
* @createDate 2024-10-09 14:39:11
*/
@Service
@Slf4j
public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
@Resource
private LineInfoDAO lineInfoDAO;
@@ -46,6 +49,7 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
@Override
@Transactional(rollbackFor = Exception.class)
public Integer submitOrUpdate(PostAndOrderRequest request, String user) {
log.info("PosAndOrderInfoService_submitOrUpdate:{}", JSONObject.toJSONString(request));
PosAndOrderInfoDO posAndOrderInfoDO = posAndOrderInfoDAO.selectOneByShopId(request.getShopId(), request.getType());
PosAndOrderInfoDO posAndOrderInfo = request.toDO();
posAndOrderInfo.setCreateUser(user);

View File

@@ -220,6 +220,7 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
if (flag3) {
List<ShopSubStageStatusEnum> list = new ArrayList<>();
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
@@ -238,7 +239,6 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
if (flag1 && flag2) {
List<ShopSubStageStatusEnum> list = new ArrayList<>();
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
}
@@ -361,12 +361,10 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage()).getShopSubStageStatus());
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_156.getShopSubStageStatus().
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
Boolean flag4 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{} flag4->{}",flag2,flag3, flag4);
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{} flag4->{}",flag2,flag3);
//都完成了 状态修改
if (flag2 && flag3 && flag4) {
if (flag2 && flag3) {
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null,null);
}
}

View File

@@ -203,6 +203,7 @@ public class PushServiceImpl implements PushService {
//如果userRoleIds包含督导。大区总。分部负责人任何一个 使用当前门店的手机号
if (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode()) ||
userRoleIds.contains(UserRoleEnum.HEAD_OF_DIVISION.getCode()) ||
userRoleIds.contains(UserRoleEnum.SERVICE_PACKAGE_DEDICATED.getCode()) ||
userRoleIds.contains(UserRoleEnum.REGION_MANAGER.getCode())) {
StoreDO store = storeDao.getByStoreNum(dto.getShopCode());
if (store != null&&store.getTelephone()!=null){

View File

@@ -146,7 +146,7 @@ public class ShopServiceImpl implements ShopService {
}
shopInfoDAO.batchAddShop(addShopList);
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), addShopList, true);
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO, shopIds);
@@ -298,7 +298,7 @@ public class ShopServiceImpl implements ShopService {
}
shopInfoDAO.batchAddShop(addShopList);
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), addShopList, true);
return 1L;
}
@@ -356,7 +356,7 @@ public class ShopServiceImpl implements ShopService {
shopInfoDO.setCreateUserId(userId);
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopInfoDO), true);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
@@ -381,7 +381,7 @@ public class ShopServiceImpl implements ShopService {
MessageEnum.MESSAGE_21,
map);
} else {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopInfoDO), false);
}
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());

View File

@@ -36,6 +36,7 @@ import java.util.stream.Collectors;
import static com.cool.store.enums.UserRoleEnum.*;
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
import static com.cool.store.utils.CommonUtil.convertToBig;
@Service
@Slf4j
@@ -176,6 +177,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.isNull(request.getShopId())) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
//不要使用系统默认名称
if (StringUtils.isNotEmpty(request.getShopName())&&request.getShopName().matches("^店铺.$")) {
throw new ServiceException(ErrorCodeEnum.SYSTEM_NAME_NOT__SUPPORT);
}
SignFranchiseDO isExist = signFranchiseMapper.selectByShopId(request.getShopId());
if (Objects.nonNull(isExist) && Objects.isNull(request.getId())) {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
@@ -554,11 +559,12 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
} else {
if (Objects.nonNull(franchiseFeeDO)) {
BigDecimal total = 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 total = convertToBig(franchiseFeeDO.getYearFranchiseFee())
.add(convertToBig(franchiseFeeDO.getLoanMargin()))
.add(convertToBig(franchiseFeeDO.getFirstYearFee()))
.add(convertToBig(franchiseFeeDO.getFirstYearManageFee()))
.add(convertToBig(franchiseFeeDO.getPerformanceBond()))
.add(convertToBig(franchiseFeeDO.getCashierFee()));
addSignFranchiseResponse.setContractAmount(total.toString());
}
addSignFranchiseResponse.setMobile(lineInfoDO.getMobile());
@@ -611,9 +617,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.nonNull(franchiseFeeDO)) {
addSignFranchiseResponse.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
addSignFranchiseResponse.setBigYearFranchiseFee(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getYearFranchiseFee())));
addSignFranchiseResponse.setBigYearFranchiseFee(Convert.digitToChinese(convertToBig(franchiseFeeDO.getYearFranchiseFee())));
addSignFranchiseResponse.setLoanMargin(franchiseFeeDO.getLoanMargin());
addSignFranchiseResponse.setBigLoanMargin(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getLoanMargin())));
addSignFranchiseResponse.setBigLoanMargin(Convert.digitToChinese(convertToBig(franchiseFeeDO.getLoanMargin())));
addSignFranchiseResponse.setFirstYearStartTime(franchiseFeeDO.getFirstYearStartTime());
addSignFranchiseResponse.setFirstYearEndTime(franchiseFeeDO.getFirstYearEndTime());
addSignFranchiseResponse.setFirstYearFee(franchiseFeeDO.getFirstYearFee());
@@ -625,7 +631,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
addSignFranchiseResponse.setThirdYearEndTime(franchiseFeeDO.getThirdYearEndTime());
addSignFranchiseResponse.setThirdYearFee(franchiseFeeDO.getThirdYearFee());
addSignFranchiseResponse.setPerformanceBond(franchiseFeeDO.getPerformanceBond());
addSignFranchiseResponse.setBigPerformanceBond(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getPerformanceBond())));
addSignFranchiseResponse.setBigPerformanceBond(Convert.digitToChinese(convertToBig(franchiseFeeDO.getPerformanceBond())));
addSignFranchiseResponse.setCashierFee(franchiseFeeDO.getCashierFee());
addSignFranchiseResponse.setBigCashierFee(Convert.digitToChinese(convertToBig(franchiseFeeDO.getCashierFee())));
}
return addSignFranchiseResponse;
}

View File

@@ -131,6 +131,7 @@ public class StoreServiceImpl implements StoreService {
List<SysRoleDO> sysRoleDOS = roleIds.stream().filter(role -> "store_inside".equals(role.getPositionType())
||UserRoleEnum.SUPERVISION.getCode().equals(role.getId())
||UserRoleEnum.HEAD_OF_DIVISION.getCode().equals(role.getId())
||UserRoleEnum.SERVICE_PACKAGE_DEDICATED.getCode().equals(role.getId())
||UserRoleEnum.REGION_MANAGER.getCode().equals(role.getId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(sysRoleDOS)){
//获取用户管辖区域

View File

@@ -0,0 +1,67 @@
package com.cool.store.service.impl.xinfa;
import com.cool.store.dto.huoma.*;
import com.cool.store.enums.SpecialTagEnum;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.xinfa.XinFaBusinessService;
import com.cool.store.service.xinfa.XinFaDeviceService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2025/11/5 16:17
* @Version 1.0
*/
@Service
public class XinFaBusinessServiceImpl implements XinFaBusinessService {
@Resource
XinFaDeviceService xinFaDeviceService;
@Override
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetail(String storeNum) {
return xinFaDeviceService.getStoreXinFaDeviceDetail(storeNum);
}
@Override
public List<TagDetailDTO> getAccountAllTags(String storeNum,String deviceName) {
//如果是广告机,不需要展示标签
if (deviceName.contains("广告机")){
return new ArrayList<>();
}
List<TagDetailDTO> accountAllTags = xinFaDeviceService.getAccountAllTags(storeNum);
if (accountAllTags != null){
return accountAllTags.stream()
.filter(tag -> tag.getName() != null &&
SpecialTagEnum.getAllTagNames().contains(tag.getName()))
.sorted(Comparator.comparing(tag -> SpecialTagEnum.getAllTagNames().indexOf(tag.getName())))
.collect(Collectors.toList());
}
return null;
}
@Override
public List<ProgramResponseDTO> getProgramList(ProgramReqDTO programReqDTO) {
//如果没传tag 查所有 根据更新时间倒序排
programReqDTO.setSort("desc");
programReqDTO.setDate("updateTime");
if (CollectionUtils.isEmpty(programReqDTO.getTagIds())){
//设备名称包含 广告机 只查询电子价目表
programReqDTO.setTagIds(xinFaDeviceService.getAccountSpecialTagIds(programReqDTO.getStoreCode(), SpecialTagEnum.getElectronicPriceTagName()));
}
List<ProgramResponseDTO> programList = xinFaDeviceService.getProgramList(programReqDTO);
return programList;
}
@Override
public Boolean publishProgram(PublishDTO publishDTO) {
return xinFaDeviceService.publish(publishDTO);
}
}

View File

@@ -0,0 +1,48 @@
package com.cool.store.service.xinfa;
import com.cool.store.dto.huoma.*;
import com.cool.store.response.ResponseResult;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2025/11/5 16:15
* @Version 1.0
*/
public interface XinFaBusinessService {
/**
* 获取门店信发设备列表
* @param storeNum
* @return
*/
List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetail(String storeNum);
/**
* 获取账号下有哪些标签
* @param storeNum
* @return
*/
List<TagDetailDTO> getAccountAllTags(String storeNum,String deviceName);
/**
* 获取账号下有哪些节目、
* 通过门店在哪个账号下 确定账号
* @param programReqDTO
* @return
*/
List<ProgramResponseDTO> getProgramList(ProgramReqDTO programReqDTO);
/**
* 发布信发设备
* @param publishDTO
* @return
*/
Boolean publishProgram(PublishDTO publishDTO);
}

View File

@@ -0,0 +1,535 @@
package com.cool.store.service.xinfa;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dto.huoma.*;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.SpecialTagEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.response.ResponseResult;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.constant.Constants;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.text.MessageFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2025/11/4 15:47
* @Version 1.0
*/
@Service
@Slf4j
public class XinFaDeviceService {
@Value("${huoMa.direct.stores.account}")
private String huoMaDirectStoresAccount;
@Value("${huoMa.direct.stores.password}")
private String huoMaDirectStoresPassword;
@Value("${huoMa.franchise.stores.account}")
private String huoMaFranchiseStoresAccount;
@Value("${huoMa.franchise.stores.password}")
private String huoMaFranchiseStoresPassword;
@Value("${huoMa.restaurant.stores.account}")
private String huoMaRestaurantStoresAccount;
@Value("${huoMa.restaurant.stores.password}")
private String huoMaRestaurantStoresPassword;
@Resource
RedisUtilPool redisUtilPool;
@Value("${huoMa.token.url}")
private String huoMaTokenUrl;
@Value("${huoMa.get.point.terminal.url}")
private String huoMaGetPointTerminalUrl;
@Value("${huoMa.id.url}")
private String huoMaGetStoreIdUrl;
@Value("${huoMa.store.device.detail.url}")
private String huoMaGetStoreXinFaDeviceDetailUrl ;
@Value("${huoMa.get.tag.url}")
private String huoMaGetTagUrl;
@Value("${huoMa.get.program.url}")
private String huoMaGetProgramUrl;
@Value("${huoMa.get.publish.url}")
private String huoMaGetPublishUrl;
private final Map<String, HuoMaAccountDTO> accountMap = new HashMap<>();
private final OkHttpClient httpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.build();
@PostConstruct
public void initAccountMap() {
accountMap.put("restaurant", new HuoMaAccountDTO(huoMaRestaurantStoresAccount, huoMaRestaurantStoresPassword));
accountMap.put("direct", new HuoMaAccountDTO(huoMaDirectStoresAccount, huoMaDirectStoresPassword));
accountMap.put("franchise", new HuoMaAccountDTO(huoMaFranchiseStoresAccount, huoMaFranchiseStoresPassword));
}
public String getStoreToken(String account, String password) {
String key = MessageFormat.format(RedisConstant.HUO_MA_TOKEN, account);
String accessToken = redisUtilPool.getString(key);
if (accessToken != null) {
return accessToken;
}
Map<String, String> requestBody = new HashMap<>();
requestBody.put("account", account);
requestBody.put("password", password);
String responseBody = sendPostRequest(JSONObject.toJSONString(requestBody), huoMaTokenUrl);
try{
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
String token = rootNode.path("data").path("token").asText();
//缓存60秒
redisUtilPool.setString(key, token,60*60);
return token;
}catch (Exception e){
log.error("解析获取token失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
return null;
}
public List<StoreEquipmentDTO> getStoreEquipmentDataByStoreNumList(List<String> storeNumList, String token) {
Map<String,List<String>> requestBody = new HashMap<>();
requestBody.put("codeList", storeNumList);
String responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(requestBody), huoMaGetPointTerminalUrl,token);
try{
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
return mapper.convertValue(rootNode.get("data"),
mapper.getTypeFactory().constructCollectionType(List.class, StoreEquipmentDTO.class));
}catch (Exception e){
log.error("解析获取data失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
return Collections.emptyList();
}
public Integer getStoreIdByStoreNum(String storeNum, String token) {
String houMaStoreId = redisUtilPool.hashGet(RedisConstant.HUO_MA_STORE_ID, storeNum);
if (houMaStoreId != null) {
try {
return Integer.valueOf(houMaStoreId);
} catch (NumberFormatException e) {
// 如果缓存中的数据格式不正确,继续执行正常逻辑
log.warn("Redis缓存中的门店ID格式不正确storeNum: {}", storeNum);
}
}
StoreRequestDTO requestBody = new StoreRequestDTO("point_report", 0, 10, storeNum);
String responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(requestBody), huoMaGetStoreIdUrl,token);
try{
Integer storeId = extractIdsFromResponse(responseBody);
redisUtilPool.hashSet(RedisConstant.HUO_MA_STORE_ID, storeNum, storeId.toString());
return storeId;
}catch (Exception e){
log.error("解析获取data失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
return null;
}
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetail(String storeNum) {
String source = redisUtilPool.hashGet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, storeNum);
if (StringUtils.isNotBlank(source)) {
HuoMaAccountDTO huoMaAccountDTO = accountMap.get(source);
if (Objects.nonNull(huoMaAccountDTO)) {
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
List<StoreXinFaDeviceDetail> deviceDetailDetail = getStoreXinFaDeviceDetailDetail(storeNum, token);
if (CollectionUtils.isNotEmpty(deviceDetailDetail)) {
return deviceDetailDetail;
}
}
}
for (Map.Entry<String, HuoMaAccountDTO> entry : accountMap.entrySet()) {
HuoMaAccountDTO huoMaAccountDTO = entry.getValue();
if (!huoMaAccountDTO.getIsQuery()) {
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
List<StoreXinFaDeviceDetail> deviceDetailDetail = getStoreXinFaDeviceDetailDetail(storeNum, token);
if (CollectionUtils.isNotEmpty(deviceDetailDetail)) {
redisUtilPool.hashSet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, storeNum, entry.getKey(), Constants.REFRESH_TOKEN_EXPIRE);
return deviceDetailDetail;
}
}
}
return Collections.emptyList();
}
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetailDetail(String storeNum, String token) {
Integer storeIdByStoreNum = getStoreIdByStoreNum(storeNum, token);
return getStoreXinFaDeviceDetailByPointId(storeIdByStoreNum, token);
}
public List<TagDetailDTO> getAccountAllTags(String storeNum){
String source = redisUtilPool.hashGet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, storeNum);
//获取标签 必须要知道门店属于哪个账号下 获取对应账号下的标签 如果获取不到 直接返回空
if (StringUtils.isEmpty(source)){
log.info("门店没有找到对应的账号,storeNum: {}", storeNum);
return new ArrayList<>();
}
HuoMaAccountDTO huoMaAccountDTO = accountMap.get(source);
if (Objects.nonNull(huoMaAccountDTO)){
huoMaAccountDTO.setIsQuery(true);
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
TagDTO tagDTO = new TagDTO("DEFAULT", 0, 30,"program");
String responseBody = null;
try{
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(tagDTO), huoMaGetTagUrl,token);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
// 直接转换整个数组
return mapper.convertValue(
rootNode.path("data").path("content"),
mapper.getTypeFactory().constructCollectionType(List.class, TagDetailDTO.class)
);
}catch (Exception e){
log.error("getAccountAllTags解析获取data失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
}
return new ArrayList<>();
}
/**
* 获取账号下指定标签的id 只需要一下四个
* @param storeNum
* @return
*/
public List<Integer> getAccountSpecialTagIds( String storeNum,List<String> tagList) {
List<TagDetailDTO> accountAllTags = getAccountAllTags(storeNum);
if (accountAllTags != null) {
return accountAllTags.stream()
.filter(tag -> tag.getName() != null &&
tagList.contains(tag.getName()))
.map(TagDetailDTO::getId)
.collect(Collectors.toList());
}
return new ArrayList<>();
}
public List<ProgramResponseDTO> getProgramList(ProgramReqDTO programReqDTO) {
if (StringUtils.isEmpty(programReqDTO.getStoreCode())){
log.info("门店没有找到对应的账号,storeNum: {}", programReqDTO.getStoreCode());
return new ArrayList<>();
}
//先查询门店是属于哪个账号下
String source = redisUtilPool.hashGet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, programReqDTO.getStoreCode());
//获取标签 必须要知道门店属于哪个账号下 获取对应账号下的标签 如果获取不到 直接返回空
if (StringUtils.isEmpty(source)){
log.info("门店没有找到对应的账号,storeNum: {}", programReqDTO.getStoreCode());
return new ArrayList<>();
}
HuoMaAccountDTO huoMaAccountDTO = accountMap.get(source);
if (huoMaAccountDTO!=null){
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
String responseBody = null;
try{
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(programReqDTO), huoMaGetProgramUrl,token);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
// 直接转换整个数组
return mapper.convertValue(
rootNode.path("data").path("content"),
mapper.getTypeFactory().constructCollectionType(List.class, ProgramResponseDTO.class)
);
}catch (Exception e){
log.error("getProgramList 解析获取data失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
}
return new ArrayList<>();
}
public Boolean publish(PublishDTO publishDTO){
if (StringUtils.isEmpty(publishDTO.getStoreCode())){
log.info("门店没有找到对应的账号,发布失败,storeNum: {}", publishDTO.getStoreCode());
return Boolean.FALSE;
}
String source = redisUtilPool.hashGet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, publishDTO.getStoreCode());
//获取标签 必须要知道门店属于哪个账号下 获取对应账号下的标签 如果获取不到 直接返回空
if (StringUtils.isEmpty(source)){
log.info("门店没有找到对应的账号,storeNum: {}", publishDTO.getStoreCode());
return Boolean.FALSE;
}
HuoMaAccountDTO huoMaAccountDTO = accountMap.get(source);
if (huoMaAccountDTO!=null){
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
String responseBody = null;
try{
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(publishDTO), huoMaGetPublishUrl,token);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
int code = rootNode.get("code").asInt();
if (code != 0) {
throw new RuntimeException("发布失败");
}
// 直接转换整个数组
log.info("发布成功 deviceId:{},storeCode:{}",JSONObject.toJSONString(publishDTO.getDeviceIdList()), publishDTO.getStoreCode() );
return Boolean.TRUE;
}catch (Exception e){
log.error("发布失败, url:{}, responseBody:{}", huoMaTokenUrl, responseBody);
}
}
return Boolean.FALSE;
}
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetailByPointId(Integer pointId, String token) {
if (pointId != null){
StoreXinFaDetailRequestDTO storeXinFaDetailRequestDTO = new StoreXinFaDetailRequestDTO(0, 10, pointId);
String responseBody = null;
try{
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(storeXinFaDetailRequestDTO), huoMaGetStoreXinFaDeviceDetailUrl,token);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
// 直接转换整个数组
return mapper.convertValue(
rootNode.path("data").path("content"),
mapper.getTypeFactory().constructCollectionType(List.class, StoreXinFaDeviceDetail.class)
);
}catch (Exception e){
log.error("getStoreXinFaDeviceDetailByPointId解析获取data失败,url:{},responseBody:{}",huoMaTokenUrl, responseBody);
}
return null;
}
return null;
}
private Integer extractIdsFromResponse(String jsonResponse) throws IOException {
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(jsonResponse);
// 遍历dataList数组提取ID
JsonNode dataList = rootNode.path("data").path("dataList");
for (JsonNode item : dataList) {
if (item.has("ID")) {
//取出第一个id
return item.get("ID").asInt();
}
}
return null;
}
private String sendPostRequest(String requestBody, String requestUrl) {
log.info("开始发送请求,url:{},requestBody:{}", requestUrl, requestBody);
Request request = new Request.Builder()
.url(requestUrl)
.post(RequestBody.create(MediaType.parse("application/json"), requestBody))
.build();
return sendPost(requestUrl, request);
}
/**
* 不重试 请求接口
* @param requestBody
* @param requestUrl
* @param token
* @return
*/
private String sendPostRequestNoRetryByToken(String requestBody, String requestUrl, String token) {
log.info("开始发送请求,url:{},requestBody:{}", requestUrl, requestBody);
try {
Request request = new Request.Builder()
.url(requestUrl)
.post(RequestBody.create(MediaType.parse("application/json"), requestBody))
.addHeader("token", token)
.build();
String result = sendPost(requestUrl, request);
// 检查是否token失效
if (isTokenExpired(result)) {
log.warn("Token已失效清除缓存并重新获取token");
// 清除对应账号的token缓存并获取新token
String newToken = clearAccountTokenCacheForToken(token);
if (newToken != null) {
// 使用新token重新发起一次请求
Request newRequest = new Request.Builder()
.url(requestUrl)
.post(RequestBody.create(MediaType.parse("application/json"), requestBody))
.addHeader("token", newToken)
.build();
result = sendPost(requestUrl, newRequest);
} else {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "Token失效且无法获取新token");
}
}
return result;
} catch (Exception e) {
log.error("请求异常,错误: {}", e.getMessage());
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "请求失败: " + e.getMessage());
}
}
/**
* 包含重试 适用于批量拉取数据 ,正常页面接口无需重试
* @param requestBody
* @param requestUrl
* @param token
* @return
*/
private String sendPostRequestByToken(String requestBody, String requestUrl, String token) {
log.info("开始发送请求,url:{},requestBody:{}", requestUrl, requestBody);
int maxRetries = 3;
for (int i = 0; i < maxRetries; i++) {
try {
Request request = new Request.Builder()
.url(requestUrl)
.post(RequestBody.create(MediaType.parse("application/json"), requestBody))
.addHeader("token", token)
.build();
String result = sendPost(requestUrl, request);
// 检查是否token失效
if (isTokenExpired(result)) {
log.warn("Token已失效正在清除缓存并重试第{}次", i + 1);
// 直接清除对应账号的token缓存
token = clearAccountTokenCacheForToken(token);
// 抛出异常触发重试
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "Token失效需要重试");
}
return result;
} catch (ServiceException e) {
log.warn("请求失败,第{}次重试,错误: {}", i + 1, e.getMessage());
if (i == maxRetries - 1) {
throw e;
}
try {
Thread.sleep(1000 * (i + 1));
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "重试被中断");
}
} catch (Exception e) {
log.warn("请求异常,第{}次重试,错误: {}", i + 1, e.getMessage());
if (i == maxRetries - 1) {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "请求重试失败: " + e.getMessage());
}
try {
Thread.sleep(1000 * (20*i + 1));
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "重试被中断");
}
}
}
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "请求重试失败");
}
private boolean isTokenExpired(String responseBody) {
try {
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(responseBody);
int code = rootNode.path("code").asInt(-1);
String msg = rootNode.path("msg").asText("");
return code == 501;
} catch (Exception e) {
log.error("检查token失效状态时发生错误: {}", e.getMessage());
return false;
}
}
private String clearAccountTokenCacheForToken(String token) {
try {
// 遍历可能的账号,找到对应的缓存并删除
String[] accounts = {
huoMaDirectStoresAccount,
huoMaFranchiseStoresAccount,
huoMaRestaurantStoresAccount
};
for (String account : accounts) {
if (account != null) {
String key = MessageFormat.format(RedisConstant.HUO_MA_TOKEN, account);
String cachedToken = redisUtilPool.getString(key);
if (token.equals(cachedToken)) {
redisUtilPool.delKey(key);
log.info("已清除账号 {} 的token缓存", account);
// 根据账号类型获取对应的密码并重新获取token
String password = getPasswordForAccount(account);
if (password != null) {
String newToken = getStoreToken(account, password);
if (newToken != null) {
log.info("已为账号 {} 重新获取新的token", account);
return newToken;
}
}
break;
}
}
}
} catch (Exception e) {
log.error("清除token缓存或重新获取token失败: {}", e.getMessage());
}
return null;
}
private String getPasswordForAccount(String account) {
if (account.equals(huoMaDirectStoresAccount)) {
return huoMaDirectStoresPassword;
} else if (account.equals(huoMaFranchiseStoresAccount)) {
return huoMaFranchiseStoresPassword;
} else if (account.equals(huoMaRestaurantStoresAccount)) {
return huoMaRestaurantStoresPassword;
}
return null;
}
@NotNull
private String sendPost(String requestUrl, Request request) {
try (Response response = httpClient.newCall(request).execute()) {
log.info("发起请求 time{}", System.currentTimeMillis());
if (!response.isSuccessful()) {
log.info("HTTP请求失败msg: " + response.message());
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
"HTTP请求失败状态码: " + response.code());
}
String responseBody = response.body().string();
log.info("请求成功responseBody:{}", JSONObject.toJSONString(responseBody));
return responseBody;
} catch (SocketTimeoutException e) {
log.error("API调用超时 - URL: {}, 错误: {}", requestUrl, e.getMessage(), e);
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用超时: " + e.getMessage());
} catch (ServiceException e) {
throw e;
} catch (Exception e) {
log.error("API调用异常 - URL: {}, 错误: {}", requestUrl, e.getMessage(), e);
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
}
}
}

View File

@@ -220,4 +220,6 @@ public class Constants
public static final String WANG_LEI_JOB_NUMBER = "19060164";
public static final int REFRESH_TOKEN_EXPIRE = 60*60*24*30;
}

View File

@@ -28,8 +28,9 @@ public class BigRegionController {
@PostMapping("/queryAllBigRegion")
@ApiOperation("获取所有可选择的大区")
public ResponseResult<List<BigRegionDTO>> queryContentInfo(@RequestParam(required = false) String keyword) {
return ResponseResult.success(bigRegionService.queryAllBigRegion(keyword));
public ResponseResult<List<BigRegionDTO>> queryContentInfo(@RequestParam(required = false) String keyword,
@RequestParam(required = false) Integer joinBrand) {
return ResponseResult.success(bigRegionService.queryAllBigRegion(keyword, joinBrand));
}
@PostMapping("/queryBigRegion")

View File

@@ -8,6 +8,7 @@ import com.cool.store.dto.FoodTokenDTO;
import com.cool.store.dto.GetAccessTokenDTO;
import com.cool.store.dto.HqtTokenDTO;
import com.cool.store.dto.ModifyPasswordDTO;
import com.cool.store.dto.huoma.*;
import com.cool.store.dto.wechat.CallbackMessageDTO;
import com.cool.store.dto.wechat.WechatTemplateMessageDTO;
import com.cool.store.entity.*;
@@ -41,6 +42,8 @@ import com.cool.store.service.impl.CommonService;
import com.cool.store.service.impl.OrderSysInfoServiceImpl;
import com.cool.store.service.impl.UserAuthMappingServiceImpl;
import com.cool.store.service.wechat.WechatTemplateService;
import com.cool.store.service.xinfa.XinFaBusinessService;
import com.cool.store.service.xinfa.XinFaDeviceService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool;
@@ -605,5 +608,34 @@ public class PCTestController {
return ApiResponse.success(true);
}
@Resource
XinFaBusinessService xinFaBusinessService;
@ApiOperation("测试门店设备信息")
@GetMapping("/getStoreXinFaDeviceDetail")
public ResponseResult<List<StoreXinFaDeviceDetail>> getStoreXinFaDeviceDetail(@RequestParam("storeNum")String storeNum) {
return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetail(storeNum));
}
@ApiOperation("测试标签信息")
@GetMapping("/getAccountAllTags")
public ResponseResult<List<TagDetailDTO>> getAccountAllTags(@RequestParam("storeNum")String storeNum,
@RequestParam("deviceName")String deviceName) {
List<TagDetailDTO> accountAllTags = xinFaBusinessService.getAccountAllTags(storeNum,deviceName);
return ResponseResult.success(accountAllTags);
}
@ApiOperation("获取节目列表")
@PostMapping("/getProgramList")
public ResponseResult<List<ProgramResponseDTO>> getProgramList(@RequestBody ProgramReqDTO programReqDTO) {
List<ProgramResponseDTO> accountAllTags = xinFaBusinessService.getProgramList(programReqDTO);
return ResponseResult.success(accountAllTags);
}
@ApiOperation("发布/上架")
@PostMapping("/publishProgram")
public ResponseResult<Boolean> publishProgram(@RequestBody PublishDTO publishDTO) {
Boolean publishStatus = xinFaBusinessService.publishProgram(publishDTO);
return ResponseResult.success(publishStatus);
}
}

View File

@@ -0,0 +1,54 @@
package com.cool.store.controller.webc;
import com.cool.store.dto.huoma.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.xinfa.XinFaBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2025/11/5 17:49
* @Version 1.0
*/
@RestController
@RequestMapping("/mini/xinfa")
@Api(tags = "小程序-信发")
@Slf4j
public class MiniXinFaController {
@Resource
XinFaBusinessService xinFaBusinessService;
@ApiOperation("测试门店设备信息")
@GetMapping("/getStoreXinFaDeviceDetail")
public ResponseResult<List<StoreXinFaDeviceDetail>> getStoreXinFaDeviceDetail(@RequestParam("storeNum")String storeNum) {
return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetail(storeNum));
}
@ApiOperation("测试标签信息")
@PostMapping("/getAccountAllTags")
public ResponseResult<List<TagDetailDTO>> getAccountAllTags(@RequestBody AccountTagDTO tagDTO) {
List<TagDetailDTO> accountAllTags = xinFaBusinessService.getAccountAllTags(tagDTO.getStoreNum(), tagDTO.getDeviceName());
return ResponseResult.success(accountAllTags);
}
@ApiOperation("获取节目列表")
@PostMapping("/getProgramList")
public ResponseResult<List<ProgramResponseDTO>> getProgramList(@RequestBody ProgramReqDTO programReqDTO) {
List<ProgramResponseDTO> accountAllTags = xinFaBusinessService.getProgramList(programReqDTO);
return ResponseResult.success(accountAllTags);
}
@ApiOperation("发布/上架")
@PostMapping("/publishProgram")
public ResponseResult<Boolean> publishProgram(@RequestBody PublishDTO publishDTO) {
Boolean publishStatus = xinFaBusinessService.publishProgram(publishDTO);
return ResponseResult.success(publishStatus);
}
}

View File

@@ -20,6 +20,8 @@ import com.cool.store.job.XxlJobHandler;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.request.ShopListSuccessOpenRequest;
import com.cool.store.request.xfsgFirstOrderListRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.caipin.StoreUserResponse;
@@ -39,6 +41,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
@@ -85,6 +88,27 @@ public class TestController {
ThirdFoodService thirdFoodService;
@Autowired
StoreService storeService;
@Resource
LinePayDAO linePayDAO;
@Resource
OpenApiService openApiService;
@PostMapping("/testXgjCallback")
public ResponseResult<Boolean> testXgjCallback(Long linePayId) {
LinePayDO linePayDO = linePayDAO.getById(linePayId);
ReceiptCallBackRequest receiptRequest = new ReceiptCallBackRequest();
receiptRequest.setReceiptId(linePayDO.getPaymentReceiptCode());
receiptRequest.setClaimStatus(1);
openApiService.changeReceiptStatus(receiptRequest);
FranchiseFeeCallBackRequest franchiseRequest = new FranchiseFeeCallBackRequest();
franchiseRequest.setShopId(linePayDO.getShopId());
franchiseRequest.setPayableFee(linePayDO.getAmount());
franchiseRequest.setPaidFees(linePayDO.getAmount());
franchiseRequest.setRemainingFee(BigDecimal.ZERO);
franchiseRequest.setPaymentStatus(2);
openApiService.changePaymentStatus(franchiseRequest);
return ResponseResult.success(true);
}
@PostMapping("/getFirstOrders")
public ResponseResult<xfsgFirstOderListResponse> getFirstOrders(@RequestBody xfsgFirstOrderListRequest storeCodeList) {

View File

@@ -142,3 +142,18 @@ wechat.mp.appId=wx4a18ef8bb41aa55c
wechat.mp.appSecret=793904b58f4ecdead3bbe4312c5f5c45
#xiaochengxu appid
wechat.miniapp.appId=wxd77a2761c1911ee1
huoMa.token.url = https://www.huoMayunping.com/api/SAASLogin/merchant
huoMa.id.url = https://www.huomayunping.com/api/reportCenter/executeSql
huoMa.store.device.detail.url = https://www.huomayunping.com/api/terminal/search
huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPointTerminalInfos
huoMa.get.tag.url = https://www.huomayunping.com/api/tag/search
huoMa.get.program.url = https://www.huomayunping.com/api/program/search
huoMa.get.publish.url = https://www.huomayunping.com/api/channelPublish/target/v2/quick-publish
huoMa.direct.stores.account = 18375320931
huoMa.direct.stores.password = Huoma@123456.
huoMa.franchise.stores.account = 13345565081
huoMa.franchise.stores.password = Huoma@123456.
huoMa.restaurant.stores.account = 15167817007
huoMa.restaurant.stores.password = Huoma@123456.

View File

@@ -145,3 +145,17 @@ wechat.mp.appId=wx4a18ef8bb41aa55c
wechat.mp.appSecret=793904b58f4ecdead3bbe4312c5f5c45
#xiaochengxu appid
wechat.miniapp.appId=wxd77a2761c1911ee1
huoMa.token.url = https://www.huoMayunping.com/api/SAASLogin/merchant
huoMa.id.url = https://www.huomayunping.com/api/reportCenter/executeSql
huoMa.store.device.detail.url = https://www.huomayunping.com/api/terminal/search
huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPointTerminalInfos
huoMa.get.tag.url = https://www.huomayunping.com/api/tag/search
huoMa.get.program.url = https://www.huomayunping.com/api/program/search
huoMa.get.publish.url = https://www.huomayunping.com/api/channelPublish/target/v2/quick-publish
huoMa.direct.stores.account = 18375320931
huoMa.direct.stores.password = Huoma@123456.
huoMa.franchise.stores.account = 13345565081
huoMa.franchise.stores.password = Huoma@123456.
huoMa.restaurant.stores.account = 15167817007
huoMa.restaurant.stores.password = Huoma@123456.

View File

@@ -154,3 +154,18 @@ wechat.miniapp.appId=wxd77a2761c1911ee1
zx.iot.appId=p-ts3PhNyf
zx.iot.appSecret=X4cVmfxM+
huoMa.token.url = https://www.huoMayunping.com/api/SAASLogin/merchant
huoMa.id.url = https://www.huomayunping.com/api/reportCenter/executeSql
huoMa.store.device.detail.url = https://www.huomayunping.com/api/terminal/search
huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPointTerminalInfos
huoMa.get.tag.url = https://www.huomayunping.com/api/tag/search
huoMa.get.program.url = https://www.huomayunping.com/api/program/search
huoMa.get.publish.url = https://www.huomayunping.com/api/channelPublish/target/v2/quick-publish
huoMa.direct.stores.account = 18375320931
huoMa.direct.stores.password = Huoma@123456.
huoMa.franchise.stores.account = 13345565081
huoMa.franchise.stores.password = Huoma@123456.
huoMa.restaurant.stores.account = 15167817007
huoMa.restaurant.stores.password = Huoma@123456.