Merge #144 into master from cc_20260520_unify_merge
0520需求汇总
* cc_20260520_unify_merge: (22 commits squashed)
- fix:正新鸡排信发自动开通改造
- fix:环境配置
- fix
- fix:信发门店设备信息接口入参修改
- fix:信发门店设备信息接口入参修改
- fix:新增根据门店id查询设备接口
- fix
- fix:限制设备数量
- fix:问题修复
- fix:网点信息获取转义;网点/设备创建异常抛出
- fix:更新开业报备流程完成日期、首次在营业状态时间
- fix
- fix:云流水&新管家账号关闭接口传入闭店原因;新增闭店原因违约闭店
- fix:闭店信息新增字段
- Merge branch 'master' into cc_20260518_store_date
- fix:开店流程完成状态判断排除食安阶段
- fix
- fix
- Merge branch 'cc_20260514_xinfa_modify' into cc_20260520_unify_merge
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
- Merge branch 'cc_20260518_store_date' into cc_20260520_unify_merge
- Merge branch 'cc_20260520_close_store_optimize' into cc_20260520_unify_merge
- Merge remote-tracking branch 'origin/cc_20260518_close_reason' into cc_20260520_unify_merge
Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/144
This commit is contained in:
@@ -505,6 +505,9 @@ public enum ErrorCodeEnum {
|
||||
|
||||
NO_PERMISSION_TO_DELETE_THE_RECORD(1850006, "无权限删除该记录", null),
|
||||
THE_AUDIO_GENERATION_RECORD_DOES_NOT_EXIST(1850007, "音频生成记录不存在", null),
|
||||
|
||||
CREATE_XIN_FA_DEVICE_ERROR(1860000, "创建设备失败", null),
|
||||
XIN_FA_DEVICE_NUM_LIMIT(1860001, "电视机及广告机数量均不能超过5台", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public enum StoreCloseReasonEnum {
|
||||
REASON3(3, "加盟老板失联", StoreCloseNatureEnum.REQUIRE_CLOSE),
|
||||
REASON4(4, "其他严重违反加盟规定", StoreCloseNatureEnum.REQUIRE_CLOSE),
|
||||
REASON5(5, "卫生操作不达标", StoreCloseNatureEnum.REQUIRE_CLOSE),
|
||||
REASON11(11, "违约闭店", StoreCloseNatureEnum.REQUIRE_CLOSE),
|
||||
|
||||
REASON6(6, "人员不足", StoreCloseNatureEnum.ONESELF_CLOSE),
|
||||
REASON7(7, "商圈转移或拆迁", StoreCloseNatureEnum.ONESELF_CLOSE),
|
||||
|
||||
@@ -147,6 +147,8 @@ public enum ShopSubStageStatusEnum {
|
||||
|
||||
//信发系统开通
|
||||
SHOP_SUB_STAGE_STATUS_230(ShopSubStageEnum.SHOP_STAGE_23, 2300, "待【火码】提交", Boolean.FALSE),
|
||||
// 正新鸡排初始化为这个阶段,同原来阶段区分开
|
||||
SHOP_SUB_STAGE_STATUS_233(ShopSubStageEnum.SHOP_STAGE_23, 2330, "待填写设备数量", Boolean.FALSE),
|
||||
SHOP_SUB_STAGE_STATUS_235(ShopSubStageEnum.SHOP_STAGE_23, 2350, "已完成", Boolean.TRUE),
|
||||
|
||||
//营帐通开通
|
||||
|
||||
@@ -296,6 +296,12 @@ public class ShopStageInfoDAO {
|
||||
}
|
||||
return shopStageInfoMapper.getScheduleAll(shopId);
|
||||
}
|
||||
public ScheduleDTO getScheduleAllExcludeFoodLicense(Long shopId) {
|
||||
if (Objects.isNull(shopId)) {
|
||||
return null;
|
||||
}
|
||||
return shopStageInfoMapper.getScheduleAllExcludeFoodLicense(shopId);
|
||||
}
|
||||
public List<ScheduleDTO> getPlatformBuildList(List<Long> shopIdList) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -311,4 +311,11 @@ public class StoreDao {
|
||||
public void updateStatusBatch(List<String> storeIds, String storeStatus) {
|
||||
storeMapper.updateStatusBatch(storeIds, storeStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或编辑门店开店流程完成时间
|
||||
*/
|
||||
public void insertOrUpdateOpenReportTime(String storeId, Date openReportTime) {
|
||||
storeMapper.insertOrUpdateOpenReportTime(storeId, openReportTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,11 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
|
||||
ScheduleDTO getScheduleAll(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 除了食安阶段外
|
||||
*/
|
||||
ScheduleDTO getScheduleAllExcludeFoodLicense(@Param("shopId") Long shopId);
|
||||
|
||||
List<ScheduleDTO> getPlatformBuildList(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
List<ShopStageInfoDO> getShopContractActualCompletionTime(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
@@ -188,4 +188,9 @@ public interface StoreMapper {
|
||||
* 批量修改门店状态
|
||||
*/
|
||||
void updateStatusBatch(@Param("storeIds") List<String> storeIds, @Param("storeStatus") String storeStatus);
|
||||
|
||||
/**
|
||||
* 新增或编辑门店开店流程完成时间
|
||||
*/
|
||||
void insertOrUpdateOpenReportTime(@Param("storeId") String storeId, @Param("openReportTime") Date openReportTime);
|
||||
}
|
||||
|
||||
@@ -608,6 +608,15 @@
|
||||
shop_id = #{shopId}
|
||||
|
||||
|
||||
</select>
|
||||
<select id="getScheduleAllExcludeFoodLicense" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
max(plan_complete_time) as planCompleteTime,
|
||||
count(1)-1 as totalColumn,
|
||||
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 2 and
|
||||
shop_id = #{shopId} AND shop_sub_stage != 40
|
||||
</select>
|
||||
<select id="getCompletionCount" resultType="java.lang.Integer">
|
||||
select
|
||||
|
||||
@@ -467,13 +467,14 @@
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdateSoftOpenDate">
|
||||
INSERT INTO store_extend_info_${enterpriseId}(store_id, soft_open_date)
|
||||
INSERT INTO store_extend_info_${enterpriseId}(store_id, soft_open_date, soft_open_job_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.storeId}, #{item.softOpenDate})
|
||||
(#{item.storeId}, #{item.softOpenDate}, now())
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
soft_open_date = VALUES(soft_open_date)
|
||||
soft_open_date = VALUES(soft_open_date),
|
||||
soft_open_job_time = VALUES(soft_open_job_time)
|
||||
</insert>
|
||||
|
||||
<update id="updateStatusBatch">
|
||||
@@ -484,4 +485,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<insert id="insertOrUpdateOpenReportTime">
|
||||
INSERT INTO store_extend_info_${enterpriseId}(store_id, open_report_time)
|
||||
VALUES
|
||||
(#{storeId}, #{openReportTime})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
open_report_time = VALUES(open_report_time)
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.cool.store.dto.huoma;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建网点请求DTO
|
||||
* @Author wangff
|
||||
* @Date 2026/05/14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CreatePointDTO {
|
||||
|
||||
/**
|
||||
* 营业时间,第一个是开始时间,第二个是结束时间
|
||||
*/
|
||||
private List<String> openTime;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 网店号(商户唯一)- 必填
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 网点名(同组织下唯一)- 必填
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 所属组织ID - 必填
|
||||
*/
|
||||
private Integer classifyId;
|
||||
|
||||
public CreatePointDTO(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.classifyId = 18360;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.cool.store.dto.huoma;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 创建网点响应DTO
|
||||
* @Author wangff
|
||||
* @Date 2026/05/14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class CreatePointResponseDTO {
|
||||
|
||||
/**
|
||||
* 网点ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 网点号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 点名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
private String openTime;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Long createTime;
|
||||
|
||||
/**
|
||||
* 商户ID
|
||||
*/
|
||||
private Integer sellerId;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean isDeleted;
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.cool.store.dto.huoma;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备创建请求DTO
|
||||
* @Author wangff
|
||||
* @Date 2026/05/14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CreateTerminalDTO {
|
||||
|
||||
/**
|
||||
* 网点ID - 必填
|
||||
*/
|
||||
private Integer pointId;
|
||||
|
||||
/**
|
||||
* 分组ID集合 - 必填
|
||||
*/
|
||||
private List<Integer> tagIdList;
|
||||
|
||||
/**
|
||||
* 设备名称 - 必填
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 设备编号 - 必填
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 管理信息 - 可选
|
||||
*/
|
||||
private String manageInfo;
|
||||
|
||||
/**
|
||||
* 横竖屏 - 必填
|
||||
* 1:横屏,2:竖屏,3:横屏翻转,4:竖屏翻转
|
||||
*/
|
||||
private Integer screenPoint;
|
||||
|
||||
/**
|
||||
* 屏幕类型 - 必填
|
||||
* 默认值:DEFAULT
|
||||
*/
|
||||
private String clientType;
|
||||
|
||||
/**
|
||||
* 设备类型 - 必填
|
||||
* 1:普通屏,2:联屏
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 联屏横个数 - 可选
|
||||
*/
|
||||
private Integer rowCount;
|
||||
|
||||
/**
|
||||
* 联屏竖个数 - 可选
|
||||
*/
|
||||
private Integer colCount;
|
||||
|
||||
/**
|
||||
* 联屏子设备 - 可选
|
||||
* 位置由集合顺序决定
|
||||
*/
|
||||
private List<Integer> terminalIds;
|
||||
|
||||
/**
|
||||
* 横长 - 联屏必传,普通屏在签到,激活的时候
|
||||
*/
|
||||
private Integer posX;
|
||||
|
||||
/**
|
||||
* 纵长 - 联屏必传,普通屏在签到,激活的时候
|
||||
*/
|
||||
private Integer posY;
|
||||
|
||||
/**
|
||||
* 说明 - 必填
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
public static CreateTerminalDTO of(Integer pointId, String shopName, String shopCode, int seq, boolean isAdMachine) {
|
||||
CreateTerminalDTO dto = new CreateTerminalDTO();
|
||||
dto.setPointId(pointId);
|
||||
dto.setTagIdList(Collections.emptyList());
|
||||
dto.setName(buildDeviceName(shopName, seq, isAdMachine));
|
||||
dto.setCode(shopCode + "_" + seq);
|
||||
dto.setScreenPoint(1); // 默认横屏
|
||||
dto.setClientType("DEFAULT");
|
||||
dto.setType(1); // 普通屏
|
||||
dto.setRemark("新店自动创建");
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static CreateTerminalDTO of(Integer pointId, String name, String code) {
|
||||
CreateTerminalDTO dto = new CreateTerminalDTO();
|
||||
dto.setPointId(pointId);
|
||||
dto.setTagIdList(Collections.emptyList());
|
||||
dto.setName(name);
|
||||
dto.setCode(code);
|
||||
dto.setScreenPoint(1); // 默认横屏
|
||||
dto.setClientType("DEFAULT");
|
||||
dto.setType(1); // 普通屏
|
||||
dto.setRemark("新店自动创建");
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建设备名称
|
||||
* 电视机:门店名称_序号
|
||||
* 广告机:门店名称_序号(广告机)
|
||||
*/
|
||||
public static String buildDeviceName(String shopName, int seq, boolean isAdMachine) {
|
||||
if (isAdMachine) {
|
||||
return shopName + "_" + seq + "(广告机)";
|
||||
}
|
||||
return shopName + "_" + seq;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.dto.huoma;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备创建响应DTO
|
||||
* @Author wangff
|
||||
* @Date 2026/05/14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class CreateTerminalResponseDTO {
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 授权码(登陆密码、激活码)
|
||||
*/
|
||||
private String activateSn;
|
||||
|
||||
/**
|
||||
* 网点ID
|
||||
*/
|
||||
private Integer pointId;
|
||||
|
||||
/**
|
||||
* 网点号
|
||||
*/
|
||||
private String pointNo;
|
||||
|
||||
/**
|
||||
* 网点名
|
||||
*/
|
||||
private String pointName;
|
||||
|
||||
/**
|
||||
* 横边
|
||||
*/
|
||||
private Integer posX;
|
||||
|
||||
/**
|
||||
* 竖边
|
||||
*/
|
||||
private Integer posY;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.dto.huoma;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 网点信息
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/14
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class XinfaPointInfoDTO {
|
||||
/**
|
||||
* 网点id
|
||||
*/
|
||||
@JsonProperty("ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 网点编号
|
||||
*/
|
||||
@JsonProperty("网点号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 网点名称
|
||||
*/
|
||||
@JsonProperty("网点名")
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.request.huoma;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 信发设备新建Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/14
|
||||
*/
|
||||
@Data
|
||||
public class XinfaTerminalCreateRequest {
|
||||
@ApiModelProperty("门店id")
|
||||
@NotBlank(message = "门店id不能为空")
|
||||
private String storeId;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
@NotBlank(message = "设备名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("设备编号")
|
||||
@NotBlank(message = "设备编号不能为空")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("说明")
|
||||
@NotBlank(message = "说明不能为空")
|
||||
private String remark;
|
||||
}
|
||||
@@ -22,4 +22,7 @@ public class XgjAccountCloseRequest {
|
||||
|
||||
@ApiModelProperty("关店时间,yyyy-MM-dd HH:mm:ss")
|
||||
private String closeTime;
|
||||
|
||||
@ApiModelProperty("开关订货原因")
|
||||
private String switchOrderReason;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.vo.close.store;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -48,6 +49,18 @@ public class CloseStoreSimpleVO {
|
||||
@ApiModelProperty("总流程数量")
|
||||
private Integer totalProcessNum;
|
||||
|
||||
@ApiModelProperty("闭店发起方式 1-主动发起 2-云流水发起")
|
||||
private Integer closeType;
|
||||
|
||||
@ApiModelProperty("计划闭店时间")
|
||||
private Date planCloseData;
|
||||
|
||||
@ApiModelProperty("闭店原因")
|
||||
private Integer closeReason;
|
||||
|
||||
@ApiModelProperty("闭店原因说明")
|
||||
private String reasonDescription;
|
||||
|
||||
@ApiModelProperty("闭店流程阶段信息")
|
||||
private List<CloseStoreSubStageStatusVO> stageList;
|
||||
}
|
||||
|
||||
@@ -125,6 +125,10 @@ public interface DeskService {
|
||||
* 信发系统
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> xinFaListPendingList(DeskRequest deskRequest, LoginUserInfo user );
|
||||
/**
|
||||
* 信发系统开通(填写设备数量)
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> xinFaFillNumPendingList(DeskRequest deskRequest, LoginUserInfo user );
|
||||
/**
|
||||
* pos
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.cool.store.service.close;
|
||||
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 账号关闭
|
||||
@@ -14,7 +16,7 @@ public interface AccountCloseStrategy {
|
||||
* 申请账号关闭
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean accountClose(String storeId);
|
||||
Boolean accountClose(CloseStoreInfoDO closeStoreInfoDO);
|
||||
|
||||
/**
|
||||
* 获取系统code
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service.close.impl;
|
||||
|
||||
import com.cool.store.dao.StoreDao;
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -22,7 +23,7 @@ public abstract class AbstractAccountClose implements AccountCloseStrategy {
|
||||
private StoreDao storeDao;
|
||||
|
||||
@Override
|
||||
public Boolean accountClose(String storeId) {
|
||||
public Boolean accountClose(CloseStoreInfoDO closeStoreInfoDO) {
|
||||
// 各平台待对接
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CloseStoreAccountServiceImpl implements CloseStoreAccountService {
|
||||
CloseStoreInfoDO closeStoreInfoDO = closeStoreInfoDAO.getById(accountInfo.getCloseStoreId());
|
||||
// 申请关闭
|
||||
AccountCloseStrategy accountClose = accountCloseFactory.getByCode(accountInfo.getSystemCode());
|
||||
if (Objects.nonNull(accountClose) && accountClose.accountClose(closeStoreInfoDO.getStoreId())) {
|
||||
if (Objects.nonNull(accountClose) && accountClose.accountClose(closeStoreInfoDO)) {
|
||||
closeStoreAccountInfoDAO.updateStatus(id, CloseStoreAccountStatusEnum.CLOSED.getStatus());
|
||||
verifyAndUpdateStage(accountInfo.getCloseStoreId());
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.close.impl;
|
||||
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.request.huoma.AccountCloseRequest;
|
||||
import com.cool.store.service.HuoMaService;
|
||||
@@ -25,8 +26,8 @@ public class HuomaAccountClose extends AbstractAccountClose {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean accountClose(String storeId) {
|
||||
StoreDO storeDO = getStore(storeId);
|
||||
public Boolean accountClose(CloseStoreInfoDO closeStoreInfoDO) {
|
||||
StoreDO storeDO = getStore(closeStoreInfoDO.getStoreId());
|
||||
AccountCloseRequest request = new AccountCloseRequest();
|
||||
request.setShop_sn(storeDO.getStoreNum());
|
||||
request.setEnable(0);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.service.close.impl;
|
||||
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.master.StoreCloseReasonEnum;
|
||||
import com.cool.store.request.xgj.XgjAccountCloseRequest;
|
||||
import com.cool.store.service.ThirdXgjService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -28,10 +30,11 @@ public class XinguanjiaAccountClose extends AbstractAccountClose {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean accountClose(String storeId) {
|
||||
StoreDO storeDO = getStore(storeId);
|
||||
public Boolean accountClose(CloseStoreInfoDO closeStoreInfoDO) {
|
||||
StoreDO storeDO = getStore(closeStoreInfoDO.getStoreId());
|
||||
String closeTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
thirdXgjService.accountClose(new XgjAccountCloseRequest(storeDO.getStoreNum(), closeTime));
|
||||
String closeReason = StoreCloseReasonEnum.getDescByCode(closeStoreInfoDO.getCloseReason());
|
||||
thirdXgjService.accountClose(new XgjAccountCloseRequest(storeDO.getStoreNum(), closeTime, closeReason));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.DeskStageDTO;
|
||||
@@ -381,6 +382,13 @@ public class DeskServiceImpl implements DeskService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> xinFaFillNumPendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(deskRequest, CurrentUserHolder.getUser(), ShopSubStageEnum.SHOP_STAGE_23,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_233.getShopSubStageStatus()), Boolean.TRUE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> posListPendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@ package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.core.utils.StringUtils;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.huoma.CreatePointDTO;
|
||||
import com.cool.store.dto.huoma.CreatePointResponseDTO;
|
||||
import com.cool.store.dto.huoma.CreateTerminalDTO;
|
||||
import com.cool.store.dto.huoma.CreateTerminalResponseDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.PosAndOrderInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
@@ -16,17 +21,16 @@ import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.request.xgj.UpdateTrainCompleteRequest;
|
||||
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 com.cool.store.service.PushService;
|
||||
import com.cool.store.service.xinfa.XinFaDeviceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author EDY
|
||||
@@ -50,6 +54,9 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
private PreparationService preparationService;
|
||||
@Resource
|
||||
PushService pushService;
|
||||
@Resource
|
||||
private XinFaDeviceService xinFaDeviceService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer submitOrUpdate(PostAndOrderRequest request, String user) {
|
||||
@@ -82,6 +89,14 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), subStageStatus);
|
||||
} else if (request.getType().equals(PosAndOrderEnum.XIN_FA_SYS.getCode())) {
|
||||
ShopStageInfoDO stageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_23);
|
||||
if (stageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_233.getShopSubStageStatus())) {
|
||||
// 自动创建信发设备
|
||||
JSONObject jsonObject = JSONObject.parseObject(request.getPassword());
|
||||
Integer tvNum = jsonObject.getInteger("tvNum");
|
||||
Integer adNum = jsonObject.getInteger("adNum");
|
||||
autoCreateXinfaDevice(request.getShopId(), tvNum, adNum);
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_235);
|
||||
} else if (request.getType().equals(PosAndOrderEnum.TENT_PASS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_245);
|
||||
@@ -93,6 +108,68 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 自动创建网点及设备
|
||||
* @param shopId 门店id
|
||||
* @param tvNum 电视机数量
|
||||
* @param adNum 广告机数量
|
||||
*/
|
||||
private void autoCreateXinfaDevice(Long shopId, Integer tvNum, Integer adNum) {
|
||||
if ((Objects.isNull(tvNum) || tvNum == 0) && (Objects.isNull(adNum) || adNum == 0)) {
|
||||
log.info("无广告机或电视机");
|
||||
return;
|
||||
}
|
||||
if (tvNum > 5 || adNum > 5) {
|
||||
throw new ServiceException(ErrorCodeEnum.XIN_FA_DEVICE_NUM_LIMIT);
|
||||
}
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
if (StringUtils.isBlank(shopInfo.getShopCode())) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NUM_NOT_FOUND);
|
||||
}
|
||||
log.info("创建网点, shopId:{}", shopInfo.getId());
|
||||
// 创建网点
|
||||
CreatePointDTO createPointDTO = new CreatePointDTO(shopInfo.getShopCode(), shopInfo.getShopName());
|
||||
CreatePointResponseDTO pointResponse = xinFaDeviceService.createPoint(createPointDTO);
|
||||
if (pointResponse == null || pointResponse.getId() == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "创建网点失败");
|
||||
}
|
||||
Integer pointId = pointResponse.getId();
|
||||
log.info("创建设备");
|
||||
// 创建设备
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
for (int i = 1; i <= tvNum + adNum; i++) {
|
||||
boolean isAdMachine = i > tvNum;
|
||||
String deviceName = CreateTerminalDTO.buildDeviceName(shopInfo.getShopName(), i, isAdMachine);
|
||||
try {
|
||||
CreateTerminalDTO terminalDTO = CreateTerminalDTO.of(pointId, shopInfo.getShopName(), shopInfo.getShopCode(), i, isAdMachine);
|
||||
CreateTerminalResponseDTO terminalResponse = xinFaDeviceService.createTerminal(terminalDTO);
|
||||
if (Objects.nonNull(terminalResponse)) {
|
||||
successCount++;
|
||||
log.info("创建设备成功,门店:{},设备名称:{},设备ID:{}",
|
||||
shopInfo.getShopName(), deviceName, terminalResponse.getId());
|
||||
} else {
|
||||
failCount++;
|
||||
log.error("设备{}创建失败:接口返回空", deviceName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failCount++;
|
||||
log.error("设备{}创建失败", deviceName, e);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有成功,抛出异常
|
||||
if (successCount == 0) {
|
||||
throw new ServiceException(ErrorCodeEnum.CREATE_XIN_FA_DEVICE_ERROR);
|
||||
}
|
||||
log.info("自动创建网点及设备完成,shopId:{},网点ID:{},成功创建{}台设备,失败{}台设备",
|
||||
shopInfo.getId(), pointId, successCount, failCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PosAndOrderResponse get(Long shopId, Integer type) {
|
||||
PosAndOrderResponse response = new PosAndOrderResponse();
|
||||
|
||||
@@ -60,6 +60,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
private AcceptanceInfoDAO acceptanceInfoDAO;
|
||||
@Resource
|
||||
private DecorationService decorationService;
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationScheduleVO> getPreparationSchedule(PreparationRequest request) {
|
||||
@@ -223,7 +225,13 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
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);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
// 正新鸡排走自动创建信发流程
|
||||
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfo.getFranchiseBrand())) {
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_233);
|
||||
} else {
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
|
||||
}
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||
}
|
||||
}
|
||||
@@ -292,11 +300,19 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
public void updateShopStatus(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (shopInfo.getShopStatus().equals(ShopStatusEnum.ING.getCode())) {
|
||||
ScheduleDTO scheduleAll = shopStageInfoDAO.getScheduleAll(shopId);
|
||||
// 20260520门店状态判断排除食安阶段
|
||||
ScheduleDTO scheduleAll = shopStageInfoDAO.getScheduleAllExcludeFoodLicense(shopId);
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())) {
|
||||
shopInfoDO.setShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
}
|
||||
if (shopInfoDO.getShopStatus() == ShopStatusEnum.DONE.getCode()) {
|
||||
// 更新门店开店流程完成时间
|
||||
StoreDO store = storeDao.getByStoreNum(shopInfo.getShopCode());
|
||||
if (Objects.nonNull(store)) {
|
||||
storeDao.insertOrUpdateOpenReportTime(store.getStoreId(), new Date());
|
||||
}
|
||||
}
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
|
||||
@@ -609,8 +609,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
Integer completionCount = shopStageInfoDAO.getCompletionCount(shopId);
|
||||
if (completionCount.equals(ShopSubStageEnum.getTotalStageIsLocationAndPreparation(shopInfo.getUseStandardStore()))) {
|
||||
ScheduleDTO scheduleAll = shopStageInfoDAO.getScheduleAllExcludeFoodLicense(shopId);
|
||||
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())) {
|
||||
shopInfo.setShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
} else {
|
||||
shopInfo.setShopStatus(ShopStatusEnum.ING.getCode());
|
||||
@@ -1017,6 +1017,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
|
||||
case SHOP_SUB_STAGE_STATUS_230:
|
||||
return getUsersByRoleAndRegion(UserRoleEnum.XIN_FA_SYS_CUSTOMER, shopInfo.getRegionId());
|
||||
case SHOP_SUB_STAGE_STATUS_233:
|
||||
return getUsersByRoleAndRegion(UserRoleEnum.INVESTMENT_MANGER, shopInfo.getRegionId());
|
||||
|
||||
case SHOP_SUB_STAGE_STATUS_240:
|
||||
return getUsersByRoleAndRegion(UserRoleEnum.TENT_PASS_CUSTOMER, shopInfo.getRegionId());
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.cool.store.service.impl.xinfa;
|
||||
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.StoreDao;
|
||||
import com.cool.store.dto.huoma.*;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
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.request.huoma.XinfaTerminalCreateRequest;
|
||||
import com.cool.store.service.xinfa.XinFaBusinessService;
|
||||
import com.cool.store.service.xinfa.XinFaDeviceService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
@@ -12,10 +16,7 @@ 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.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,10 @@ import java.util.stream.Collectors;
|
||||
public class XinFaBusinessServiceImpl implements XinFaBusinessService {
|
||||
@Resource
|
||||
XinFaDeviceService xinFaDeviceService;
|
||||
@Resource
|
||||
StoreDao storeDao;
|
||||
@Resource
|
||||
ShopInfoDAO shopInfoDAO;
|
||||
|
||||
@Override
|
||||
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetail(String storeNum) {
|
||||
@@ -36,6 +41,28 @@ public class XinFaBusinessServiceImpl implements XinFaBusinessService {
|
||||
return xinFaDeviceService.getStoreXinFaDeviceDetail(storeNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetailByStoreId(String storeId, Long shopId) {
|
||||
if (StringUtils.isBlank(storeId) && Objects.isNull(shopId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
String storeNum;
|
||||
if (StringUtils.isNotBlank(storeId)) {
|
||||
StoreDO storeDO = storeDao.getEffectiveByStoreId(storeId);
|
||||
if (Objects.isNull(storeDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
storeNum = storeDO.getStoreNum();
|
||||
} else {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
storeNum = shopInfo.getShopCode();
|
||||
}
|
||||
return getStoreXinFaDeviceDetail(storeNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TagDetailDTO> getAccountAllTags(String storeNum,String deviceName) {
|
||||
//如果是广告机,不需要展示标签
|
||||
@@ -70,4 +97,35 @@ public class XinFaBusinessServiceImpl implements XinFaBusinessService {
|
||||
public Boolean publishProgram(PublishDTO publishDTO) {
|
||||
return xinFaDeviceService.publish(publishDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XinfaPointInfoDTO getPointInfo(String storeNum) {
|
||||
if (StringUtils.isEmpty(storeNum)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
return xinFaDeviceService.getPointInfo(storeNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean createTerminal(XinfaTerminalCreateRequest request) {
|
||||
StoreDO storeDO = storeDao.getEffectiveByStoreId(request.getStoreId());
|
||||
if (Objects.isNull(storeDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
XinfaPointInfoDTO pointInfo = xinFaDeviceService.getPointInfo(storeDO.getStoreNum());
|
||||
Integer pointId;
|
||||
if (Objects.nonNull(pointInfo)) {
|
||||
pointId = pointInfo.getId();
|
||||
} else {
|
||||
CreatePointDTO createPointDTO = new CreatePointDTO(storeDO.getStoreNum(), storeDO.getStoreName());
|
||||
CreatePointResponseDTO point = xinFaDeviceService.createPoint(createPointDTO);
|
||||
if (Objects.isNull(point)) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "创建网点失败");
|
||||
}
|
||||
pointId = point.getId();
|
||||
}
|
||||
CreateTerminalDTO createTerminalDTO = CreateTerminalDTO.of(pointId, request.getName(), request.getCode());
|
||||
CreateTerminalResponseDTO terminal = xinFaDeviceService.createTerminal(createTerminalDTO);
|
||||
return Objects.nonNull(terminal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
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 com.cool.store.request.huoma.XinfaTerminalCreateRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -21,6 +20,8 @@ public interface XinFaBusinessService {
|
||||
*/
|
||||
List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetail(String storeNum);
|
||||
|
||||
List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetailByStoreId(String storeId, Long shopId);
|
||||
|
||||
/**
|
||||
* 获取账号下有哪些标签
|
||||
* @param storeNum
|
||||
@@ -43,6 +44,13 @@ public interface XinFaBusinessService {
|
||||
*/
|
||||
Boolean publishProgram(PublishDTO publishDTO);
|
||||
|
||||
/**
|
||||
* 获取门店网点信息
|
||||
*/
|
||||
XinfaPointInfoDTO getPointInfo(String storeNum);
|
||||
|
||||
|
||||
/**
|
||||
* 新增信发设备
|
||||
*/
|
||||
Boolean createTerminal(XinfaTerminalCreateRequest request);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,10 @@ 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.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -18,7 +17,6 @@ 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;
|
||||
@@ -66,6 +64,10 @@ public class XinFaDeviceService {
|
||||
private String huoMaGetProgramUrl;
|
||||
@Value("${huoMa.get.publish.url}")
|
||||
private String huoMaGetPublishUrl;
|
||||
@Value("${huoMa.create.point.url}")
|
||||
private String huoMaCreatePointUrl;
|
||||
@Value("${huoMa.create.terminal.url}")
|
||||
private String huoMaCreateTerminalUrl;
|
||||
|
||||
|
||||
private final Map<String, HuoMaAccountDTO> accountMap = new HashMap<>();
|
||||
@@ -295,8 +297,138 @@ public class XinFaDeviceService {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建网点
|
||||
* 使用 huoMa.franchise.stores.account 账号的token
|
||||
* @param createPointDTO 创建网点请求参数
|
||||
* @return 创建网点响应
|
||||
*/
|
||||
public CreatePointResponseDTO createPoint(CreatePointDTO createPointDTO) {
|
||||
String token = getFranchiseStoresToken();
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
log.error("获取franchise账号token失败");
|
||||
return null;
|
||||
}
|
||||
String responseBody = null;
|
||||
try {
|
||||
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(createPointDTO), huoMaCreatePointUrl, token);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode rootNode = mapper.readTree(responseBody);
|
||||
int code = rootNode.get("code").asInt();
|
||||
if (code != 0) {
|
||||
String msg = rootNode.path("msg").asText("");
|
||||
log.error("创建网点失败, code:{}, msg:{}", code, msg);
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, msg);
|
||||
}
|
||||
return mapper.convertValue(rootNode.get("data"), CreatePointResponseDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("创建网点失败, url:{}, responseBody:{}, exception:{}", huoMaCreatePointUrl, responseBody, e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备创建
|
||||
* 使用 huoMa.franchise.stores.account 号的token
|
||||
* @param createTerminalDTO 设备创建请求参数
|
||||
* @return 设备创建响应
|
||||
*/
|
||||
public CreateTerminalResponseDTO createTerminal(CreateTerminalDTO createTerminalDTO) {
|
||||
String token = getFranchiseStoresToken();
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
log.error("获取franchise账号token失败");
|
||||
return null;
|
||||
}
|
||||
String responseBody = null;
|
||||
try {
|
||||
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(createTerminalDTO), huoMaCreateTerminalUrl, token);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode rootNode = mapper.readTree(responseBody);
|
||||
int code = rootNode.get("code").asInt();
|
||||
if (code != 0) {
|
||||
String msg = rootNode.path("msg").asText("");
|
||||
log.error("设备创建失败, code:{}, msg:{}", code, msg);
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, msg);
|
||||
}
|
||||
return mapper.convertValue(rootNode.get("data"), CreateTerminalResponseDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("设备创建失败, url:{}, responseBody:{}, exception:{}", huoMaCreateTerminalUrl, responseBody, e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店网点信息
|
||||
*/
|
||||
public XinfaPointInfoDTO getPointInfo(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());
|
||||
XinfaPointInfoDTO pointInfo = getPointInfoByStoreNum(storeNum, token);
|
||||
if (Objects.nonNull(pointInfo)) {
|
||||
return pointInfo;
|
||||
}else {
|
||||
//如果在该账号下没有数据 清除缓存
|
||||
redisUtilPool.hashDel(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, storeNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, HuoMaAccountDTO> entry : accountMap.entrySet()) {
|
||||
HuoMaAccountDTO huoMaAccountDTO = entry.getValue();
|
||||
String token = getStoreToken(huoMaAccountDTO.getAccount(), huoMaAccountDTO.getPassword());
|
||||
XinfaPointInfoDTO pointInfo = getPointInfoByStoreNum(storeNum, token);
|
||||
if (Objects.nonNull(pointInfo)) {
|
||||
redisUtilPool.hashSet(RedisConstant.HUOMA_STORE_DEVICE_RESOURCE_KEY, storeNum, entry.getKey(), Constants.REFRESH_TOKEN_EXPIRE);
|
||||
return pointInfo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店网点信息
|
||||
* @param storeNum 门店编码
|
||||
* @param token token
|
||||
* @return 网点信息
|
||||
*/
|
||||
private XinfaPointInfoDTO getPointInfoByStoreNum(String storeNum, String token) {
|
||||
StoreRequestDTO requestBody = new StoreRequestDTO("point_report", 0, 10, storeNum);
|
||||
String responseBody = null;
|
||||
try {
|
||||
responseBody = sendPostRequestNoRetryByToken(JSONObject.toJSONString(requestBody), huoMaGetStoreIdUrl,token);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode rootNode = mapper.readTree(responseBody);
|
||||
int code = rootNode.get("code").asInt();
|
||||
if (code != 0) {
|
||||
String msg = rootNode.path("msg").asText("");
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, msg);
|
||||
}
|
||||
JsonNode dataList = rootNode.get("data").path("dataList");
|
||||
if (Objects.nonNull(dataList) && !dataList.isEmpty()) {
|
||||
return mapper.convertValue(dataList.get(0), XinfaPointInfoDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("网点信息获取失败, url:{}, responseBody:{}, exception:{}", huoMaGetStoreIdUrl, responseBody, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取franchise账号的token
|
||||
* @return token
|
||||
*/
|
||||
private String getFranchiseStoresToken() {
|
||||
return getStoreToken(huoMaFranchiseStoresAccount, huoMaFranchiseStoresPassword);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List<StoreXinFaDeviceDetail> getStoreXinFaDeviceDetailByPointId(String storeNum,Integer pointId, String token) {
|
||||
if (pointId != null){
|
||||
StoreXinFaDetailRequestDTO storeXinFaDetailRequestDTO = new StoreXinFaDetailRequestDTO(0, 10, pointId);
|
||||
|
||||
@@ -124,6 +124,13 @@ public class DeskController {
|
||||
return ResponseResult.success(deskService.xinFaListPendingList( deskRequest, userInfo ));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-信发系统开通(填写设备数量)")
|
||||
@PostMapping("/xinFaFillNumPendingList")
|
||||
public ResponseResult<PageInfo<PreparationCommonPendingVO>> xinFaFillNumPendingList(@RequestBody DeskRequest deskRequest) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.xinFaFillNumPendingList( deskRequest, userInfo ));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-pos")
|
||||
@PostMapping("/posListPendingList")
|
||||
public ResponseResult<PageInfo<PreparationCommonPendingVO>> posListPendingList(@RequestBody DeskRequest deskRequest) {
|
||||
|
||||
@@ -67,6 +67,7 @@ import com.cool.store.service.impl.UserAuthMappingServiceImpl;
|
||||
import com.cool.store.service.wallet.WalletApiService;
|
||||
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.RsaSignUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
@@ -165,6 +166,20 @@ public class PCTestController {
|
||||
BonusService bonusService;
|
||||
@Resource
|
||||
BonusDistributionRuleDAO bonusRuleDAO;
|
||||
@Resource
|
||||
XinFaDeviceService xinFaDeviceService;
|
||||
|
||||
@PostMapping("/createTerminal")
|
||||
public ResponseResult<Boolean> createTerminal(@RequestBody CreateTerminalDTO createTerminalDTO) {
|
||||
xinFaDeviceService.createTerminal(createTerminalDTO);
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/createPoint")
|
||||
public ResponseResult<Boolean> createPoint(@RequestBody CreatePointDTO createPointDTO) {
|
||||
xinFaDeviceService.createPoint(createPointDTO);
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/closeUpAutoOpen")
|
||||
public void closeUpAutoOpen(Long applyId) {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.huoma.StoreXinFaDeviceDetail;
|
||||
import com.cool.store.dto.huoma.XinfaPointInfoDTO;
|
||||
import com.cool.store.request.huoma.XinfaTerminalCreateRequest;
|
||||
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.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 信发
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pc/xinfa")
|
||||
@Api(tags = "信发")
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class XinFaController {
|
||||
private final XinFaBusinessService xinFaBusinessService;
|
||||
|
||||
@ApiOperation("门店设备信息")
|
||||
@GetMapping("/getStoreXinFaDeviceDetail")
|
||||
public ResponseResult<List<StoreXinFaDeviceDetail>> getStoreXinFaDeviceDetail(String storeId, Long shopId) {
|
||||
return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetailByStoreId(storeId, shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("门店网点信息")
|
||||
@GetMapping("/getPointInfo")
|
||||
public ResponseResult<XinfaPointInfoDTO> getPointInfo(@RequestParam("storeNum") String storeNum) {
|
||||
return ResponseResult.success(xinFaBusinessService.getPointInfo(storeNum));
|
||||
}
|
||||
|
||||
@ApiOperation("新增信发设备")
|
||||
@PostMapping("/createTerminal")
|
||||
public ResponseResult<Boolean> createTerminal(@RequestBody XinfaTerminalCreateRequest request) {
|
||||
return ResponseResult.success(xinFaBusinessService.createTerminal(request));
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,12 @@ public class MiniXinFaController {
|
||||
return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetail(storeNum));
|
||||
}
|
||||
|
||||
@ApiOperation("门店设备信息")
|
||||
@GetMapping("/getStoreXinFaDeviceDetailV2")
|
||||
public ResponseResult<List<StoreXinFaDeviceDetail>> getStoreXinFaDeviceDetail(String storeId, Long shopId) {
|
||||
return ResponseResult.success(xinFaBusinessService.getStoreXinFaDeviceDetailByStoreId(storeId, shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("测试标签信息")
|
||||
@PostMapping("/getAccountAllTags")
|
||||
public ResponseResult<List<TagDetailDTO>> getAccountAllTags(@RequestBody AccountTagDTO tagDTO) {
|
||||
|
||||
@@ -166,6 +166,8 @@ huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPoin
|
||||
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.create.point.url = https://www.huomayunping.com/api/point/create
|
||||
huoMa.create.terminal.url = https://www.huomayunping.com/api/terminal/create
|
||||
huoMa.direct.stores.account = 18375320931
|
||||
huoMa.direct.stores.password = Huoma@123456.
|
||||
huoMa.franchise.stores.account = 13345565081
|
||||
|
||||
@@ -164,6 +164,8 @@ huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPoin
|
||||
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.create.point.url = https://www.huomayunping.com/api/point/create
|
||||
huoMa.create.terminal.url = https://www.huomayunping.com/api/terminal/create
|
||||
huoMa.direct.stores.account = 18375320931
|
||||
huoMa.direct.stores.password = Huoma@123456.
|
||||
huoMa.franchise.stores.account = 13345565081
|
||||
|
||||
@@ -160,6 +160,8 @@ huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPoin
|
||||
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.create.point.url = https://www.huomayunping.com/api/point/create
|
||||
huoMa.create.terminal.url = https://www.huomayunping.com/api/terminal/create
|
||||
huoMa.direct.stores.account = 18375320931
|
||||
huoMa.direct.stores.password = Huoma@123456.
|
||||
huoMa.franchise.stores.account = 13345565081
|
||||
|
||||
@@ -166,6 +166,8 @@ huoMa.get.point.terminal.url = https://www.huoMayunping.com/api/terminal/getPoin
|
||||
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.create.point.url = https://www.huomayunping.com/api/point/create
|
||||
huoMa.create.terminal.url = https://www.huomayunping.com/api/terminal/create
|
||||
huoMa.direct.stores.account = 18375320931
|
||||
huoMa.direct.stores.password = Huoma@123456.
|
||||
huoMa.franchise.stores.account = 13345565081
|
||||
|
||||
Reference in New Issue
Block a user