Compare commits
10 Commits
3d31c69b5b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
211195f387 | ||
|
|
f749f97911 | ||
|
|
94ee7b7d12 | ||
|
|
526482aab8 | ||
|
|
567ff3536f | ||
|
|
ce882e5d87 | ||
|
|
555f4cd089 | ||
|
|
e305fa8d95 | ||
|
|
5e8cb275fe | ||
|
|
0a62114639 |
@@ -495,6 +495,9 @@ public enum ErrorCodeEnum {
|
||||
CLOSE_UP_CLOSED_AUDIT_NOT_PASS(1840008, "歇业申请未通过", null),
|
||||
CLOSE_UP_EXIST_OPEN_APPLY(1840009, "该歇业申请单已存在开业申请", null),
|
||||
CLOSE_UP_APPROVED(1840010, "该申请单已审批", null),
|
||||
CLOSE_UP_PLATFORM_STATUS_UPDATE_ERROR(1840011, "平台状态更新失败:{0}", null),
|
||||
CLOSE_UP_PLATFORM_DATE_NOT_EXIST(1840012, "平台数据不存在", null),
|
||||
CLOSE_UP_PLATFORM_STATUS_MODIFYING(1840013, "平台状态正在修改中", null),
|
||||
|
||||
BONUS_EXIST_OVERLAP_RULE(1850000, "门店该有效期范围内存在相同类型的启用规则", null),
|
||||
BONUS_RULE_NOT_EXIST(1850001, "不存在该奖金发放规则", null),
|
||||
|
||||
@@ -17,7 +17,7 @@ public enum ShopSubStageEnum {
|
||||
SHOP_STAGE_2(ShopStageEnum.SHOP_STAGE_1, 20, "上传租赁合同", 14),
|
||||
SHOP_STAGE_3(ShopStageEnum.SHOP_STAGE_2, 30, "营业执照办理", 23),
|
||||
SHOP_STAGE_4(ShopStageEnum.SHOP_STAGE_2, 40, "食安许可证", 55),
|
||||
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "员工招聘", 23),
|
||||
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "培训登记", 23),
|
||||
SHOP_STAGE_7(ShopStageEnum.SHOP_STAGE_2, 70, "缴纳加盟费/保证金", 1),
|
||||
SHOP_STAGE_8(ShopStageEnum.SHOP_STAGE_2, 80, "加盟合同签约", 4),
|
||||
SHOP_STAGE_8_5(ShopStageEnum.SHOP_STAGE_2, 85, "发票回传", 5),
|
||||
|
||||
@@ -7,8 +7,10 @@ import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
import com.cool.store.enums.point.ShopStageEnum;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.mapper.ShopStageInfoMapper;
|
||||
@@ -27,6 +29,7 @@ import org.springframework.stereotype.Repository;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -39,6 +42,10 @@ public class ShopStageInfoDAO {
|
||||
|
||||
@Resource
|
||||
private ShopStageInfoMapper shopStageInfoMapper;
|
||||
@Resource
|
||||
ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
StoreDao storeDao;
|
||||
|
||||
/**
|
||||
* 初始化店铺阶段信息
|
||||
@@ -63,6 +70,12 @@ public class ShopStageInfoDAO {
|
||||
if (shopSubStageEnum.equals(ShopSubStageEnum.SHOP_STAGE_14)) {
|
||||
continue;
|
||||
}
|
||||
if (!CommonConstants.INDEX_ONE.equals(shopInfoDO.getUseStandardStore())
|
||||
&& !String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfoDO.getFranchiseBrand())
|
||||
&& ShopSubStageEnum.SHOP_STAGE_6.equals(shopSubStageEnum)) {
|
||||
// 不是标准店且不是正新鸡排的情况下,不开启网商钱包开通阶段
|
||||
continue;
|
||||
}
|
||||
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||
shopStageInfo.setLineId(lineInfoDO.getId());
|
||||
shopStageInfo.setShopId(shopId);
|
||||
@@ -87,6 +100,30 @@ public class ShopStageInfoDAO {
|
||||
return shopStageInfoMapper.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
public void updateShopStatus(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (shopInfo.getShopStatus().equals(ShopStatusEnum.ING.getCode())) {
|
||||
// 20260520门店状态判断排除食安阶段
|
||||
ScheduleDTO scheduleAll = getScheduleAllExcludeFoodLicense(shopId);
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setShopStatus(shopInfo.getShopStatus());
|
||||
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())) {
|
||||
shopInfoDO.setShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
}
|
||||
if (shopInfoDO.getShopStatus() == ShopStatusEnum.DONE.getCode()) {
|
||||
// 更新门店开店流程完成时间
|
||||
StoreDO store = storeDao.getByStoreNum(shopInfo.getShopCode());
|
||||
if (Objects.nonNull(store)) {
|
||||
storeDao.insertOrUpdateOpenReportTime(store.getStoreId(), new Date());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Integer batchInsert(List<ShopStageInfoDO> addShopStageList) {
|
||||
if (CollectionUtils.isEmpty(addShopStageList)) {
|
||||
return 0;
|
||||
@@ -180,7 +217,10 @@ public class ShopStageInfoDAO {
|
||||
}
|
||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR + shopStageInfo.getShopSubStageStatusName();
|
||||
boolean isTerminated = shopStageInfo.isTerminated();
|
||||
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
|
||||
Integer ii = shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
|
||||
//如果完成
|
||||
if (isTerminated){updateShopStatus(shopId);}
|
||||
return ii;
|
||||
}
|
||||
|
||||
//数据处理专用
|
||||
@@ -206,8 +246,13 @@ public class ShopStageInfoDAO {
|
||||
}
|
||||
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
||||
extracted(subStageStatusList, shopId, shopStageList);
|
||||
|
||||
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
||||
Integer i = shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
||||
//没有完成的数据 如果是空 表示都是完成的 如果有未完成的阶段 不需要调用
|
||||
List<ShopStageInfoDO> list = shopStageList.stream().filter(x -> !x.getIsTerminated()).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
updateShopStatus(shopId);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CloseUpPlatformDAO {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<CloseUpPlatformDO> getList(Long applyId, Integer status, Integer type, Boolean hasTaskId) {
|
||||
public List<CloseUpPlatformDO> getList(Long applyId, Integer status, Integer type, Boolean hasTaskId, Boolean needQueryTask) {
|
||||
Example example = new Example(CloseUpPlatformDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("applyId", applyId);
|
||||
@@ -57,13 +57,16 @@ public class CloseUpPlatformDAO {
|
||||
if (Boolean.TRUE.equals(hasTaskId)) {
|
||||
criteria.andIsNotNull("taskId").andNotEqualTo("taskId", "");
|
||||
}
|
||||
if (Boolean.TRUE.equals(needQueryTask)) {
|
||||
criteria.andNotEqualTo("taskStatus", 0);
|
||||
}
|
||||
return closeUpPlatformMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
public void updateStatusByIds(List<Long> ids, Integer status) {
|
||||
public void updateStatusByIds(List<Long> ids, Integer status, Integer taskStatus) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
@@ -71,6 +74,9 @@ public class CloseUpPlatformDAO {
|
||||
example.createCriteria()
|
||||
.andIn("id", ids);
|
||||
CloseUpPlatformDO update = CloseUpPlatformDO.builder().status(status).build();
|
||||
if (Objects.nonNull(taskStatus)) {
|
||||
update.setTaskStatus(taskStatus);
|
||||
}
|
||||
closeUpPlatformMapper.updateByExampleSelective(update, example);
|
||||
}
|
||||
|
||||
@@ -81,6 +87,13 @@ public class CloseUpPlatformDAO {
|
||||
closeUpPlatformMapper.updateStatusAndTaskId(list);
|
||||
}
|
||||
|
||||
public void updateStatusAndTaskIdExcludeTaskStatus(List<CloseUpPlatformDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
closeUpPlatformMapper.updateStatusAndTaskIdExcludeTaskStatus(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据申请单id删除
|
||||
*/
|
||||
@@ -94,4 +107,8 @@ public class CloseUpPlatformDAO {
|
||||
public List<Long> selectTodoApplyIds(Integer applyType, String storeKeyword) {
|
||||
return closeUpPlatformMapper.selectTodoApplyIds(applyType, storeKeyword);
|
||||
}
|
||||
|
||||
public CloseUpPlatformDO getById(Long id) {
|
||||
return closeUpPlatformMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,6 @@ public interface CloseUpPlatformMapper extends Mapper<CloseUpPlatformDO> {
|
||||
List<Long> selectTodoApplyIds(@Param("applyType") Integer applyType, @Param("storeKeyword") String storeKeyword);
|
||||
|
||||
void updateStatusAndTaskId(@Param("list") List<CloseUpPlatformDO> list);
|
||||
|
||||
void updateStatusAndTaskIdExcludeTaskStatus(@Param("list") List<CloseUpPlatformDO> list);
|
||||
}
|
||||
@@ -451,7 +451,21 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="operationsConsultant!=null and operationsConsultant!=''">
|
||||
and si.operations_consultant = #{operationsConsultant}
|
||||
and (
|
||||
si.operations_consultant = #{operationsConsultant}
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
or (
|
||||
si.region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
or si.invest_region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="request.shopKeyword !=null and request.shopKeyword !=''">
|
||||
and (si.shop_name like concat('%',#{request.shopKeyword},'%') or si.shop_code like concat('%',#{request.shopKeyword},'%'))
|
||||
|
||||
@@ -54,10 +54,33 @@
|
||||
<foreach collection="list" item="item">
|
||||
WHEN #{item.id} THEN #{item.taskId}
|
||||
</foreach>
|
||||
END,
|
||||
task_status = CASE id
|
||||
<foreach collection="list" item="item">
|
||||
WHEN #{item.id} THEN #{item.taskStatus}
|
||||
</foreach>
|
||||
END
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateStatusAndTaskIdExcludeTaskStatus">
|
||||
UPDATE zxjp_close_up_platform
|
||||
SET status = CASE id
|
||||
<foreach collection="list" item="item">
|
||||
WHEN #{item.id} THEN #{item.status}
|
||||
</foreach>
|
||||
END,
|
||||
task_id = CASE id
|
||||
<foreach collection="list" item="item">
|
||||
WHEN #{item.id} THEN #{item.taskId}
|
||||
</foreach>
|
||||
END
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -278,10 +278,6 @@ public class StoreXinFaDeviceDetail {
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return name+" 授权码:"+activateSn;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -81,4 +81,10 @@ public class CloseUpPlatformDO {
|
||||
*/
|
||||
@Column(name = "task_id")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 任务查询状态,0无需处理 1改成待处理 2改成已处理
|
||||
*/
|
||||
@Column(name = "task_status")
|
||||
private Integer taskStatus;
|
||||
}
|
||||
@@ -32,6 +32,9 @@ public class DeskRequest {
|
||||
@ApiModelProperty(value = "签约类型")
|
||||
private List<Integer> signTypes;
|
||||
|
||||
@ApiModelProperty(value = "管辖区域IDs")
|
||||
private List<String> authRegionIds;
|
||||
|
||||
@ApiModelProperty(value = "阶段状态")
|
||||
private List<Integer> stageStatus;
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.vo.closeup;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 歇业平台关闭开启状态VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/15
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CloseUpPlatformStatusVO {
|
||||
@ApiModelProperty("修改状态,1修改中 2成功")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.request.closeup.*;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormSimpleVO;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformStatusVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
@@ -84,7 +85,7 @@ public interface CloseUpService {
|
||||
/**
|
||||
* 平台关闭开启处理
|
||||
*/
|
||||
Boolean handlePlatform(CloseUpPlatformHandleRequest request);
|
||||
CloseUpPlatformStatusVO handlePlatform(CloseUpPlatformHandleRequest request);
|
||||
|
||||
/**
|
||||
* 根据任务id查询平台状态
|
||||
|
||||
@@ -28,13 +28,13 @@ import com.cool.store.request.closeup.*;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.closeup.CloseUpService;
|
||||
import com.cool.store.service.closeup.PlatformAutoStrategy;
|
||||
import com.cool.store.service.closeup.PlatformHttpClientRest;
|
||||
import com.cool.store.service.sms.AliyunSmsService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormSimpleVO;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformStatusVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -402,7 +402,7 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
|
||||
@Override
|
||||
public List<CloseUpPlatformVO> getPlatformListByApplyId(Long applyId) {
|
||||
List<CloseUpPlatformDO> list = platformDAO.getList(applyId, null, null, null);
|
||||
List<CloseUpPlatformDO> list = platformDAO.getList(applyId, null, null, null, null);
|
||||
return BeanUtil.toList(list, CloseUpPlatformVO.class);
|
||||
}
|
||||
|
||||
@@ -494,37 +494,37 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
* 自动开启关闭各平台
|
||||
*/
|
||||
public void autoPlatform(String storeId, Integer applyType, List<CloseUpPlatformDO> list) {
|
||||
try {
|
||||
StoreDO storeDO = storeDao.getByStoreId(storeId);
|
||||
if (Objects.isNull(storeDO)) {
|
||||
return;
|
||||
}
|
||||
int platformCode = 0;
|
||||
List<CloseUpPlatformDO> unClosePlatformList = list.stream()
|
||||
.filter(platformDO -> platformDO.getStatus().equals(0)
|
||||
&& platformDO.getType().equals(1)
|
||||
&& !(new Date()).before(platformDO.getTaskStartDate()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(unClosePlatformList)) {
|
||||
log.info("未处理的自动关闭平台为空");
|
||||
return;
|
||||
}
|
||||
StoreDO storeDO = storeDao.getByStoreId(storeId);
|
||||
if (Objects.isNull(storeDO)) {
|
||||
return;
|
||||
}
|
||||
int platformCode = 0;
|
||||
List<CloseUpPlatformDO> unClosePlatformList = list.stream()
|
||||
.filter(platformDO -> platformDO.getStatus().equals(0)
|
||||
&& platformDO.getType().equals(1)
|
||||
&& !(new Date()).before(platformDO.getTaskStartDate()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(unClosePlatformList)) {
|
||||
log.info("未处理的自动关闭平台为空");
|
||||
return;
|
||||
}
|
||||
|
||||
List<CloseUpPlatformDO> updatePlatformList = new ArrayList<>();
|
||||
// 歇业平台
|
||||
for (CloseUpPlatformDO v : unClosePlatformList) {
|
||||
Integer ongoingPlatformCode = CloseUpPlatformEnum.getPlatformCodeByCode(v.getCode());
|
||||
if (Objects.nonNull(ongoingPlatformCode)) {
|
||||
platformCode = platformCode | ongoingPlatformCode;
|
||||
} else {
|
||||
CloseUpPlatformDO updatePlatform = CloseUpPlatformDO.builder().id(v.getId()).status(1).build();
|
||||
updatePlatformList.add(updatePlatform);
|
||||
}
|
||||
}
|
||||
if (platformCode == 0) {
|
||||
log.info("未处理的自动关闭平台为空platformCode=0");
|
||||
return;
|
||||
List<CloseUpPlatformDO> updatePlatformList = new ArrayList<>();
|
||||
// 歇业平台
|
||||
for (CloseUpPlatformDO v : unClosePlatformList) {
|
||||
Integer ongoingPlatformCode = CloseUpPlatformEnum.getPlatformCodeByCode(v.getCode());
|
||||
if (Objects.nonNull(ongoingPlatformCode)) {
|
||||
platformCode = platformCode | ongoingPlatformCode;
|
||||
} else {
|
||||
CloseUpPlatformDO updatePlatform = CloseUpPlatformDO.builder().id(v.getId()).status(1).build();
|
||||
updatePlatformList.add(updatePlatform);
|
||||
}
|
||||
}
|
||||
if (platformCode == 0) {
|
||||
log.info("未处理的自动关闭平台为空platformCode=0");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
PlatformStatusDTO platformStatusDTO = platformHttpClientRest.platformCloseUp(storeDO.getStoreNum(), String.valueOf(platformCode), applyType);
|
||||
if (Objects.nonNull(platformStatusDTO) && CollectionUtils.isNotEmpty(platformStatusDTO.getPlatformResults())) {
|
||||
Map<String, PlatformStatusDTO.PlatformUpdateResult> map = CollStreamUtil.toMap(platformStatusDTO.getPlatformResults(), PlatformStatusDTO.PlatformUpdateResult::getPlatformCode, v -> v);
|
||||
@@ -546,10 +546,10 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
}
|
||||
}
|
||||
}
|
||||
platformDAO.updateStatusAndTaskId(updatePlatformList);
|
||||
} catch (Exception e) {
|
||||
log.info("平台自动歇业/营业失败", e);
|
||||
}
|
||||
platformDAO.updateStatusAndTaskIdExcludeTaskStatus(updatePlatformList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -564,9 +564,49 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean handlePlatform(CloseUpPlatformHandleRequest request) {
|
||||
platformDAO.updateStatusByIds(Collections.singletonList(request.getId()), request.getStatus());
|
||||
return true;
|
||||
public CloseUpPlatformStatusVO handlePlatform(CloseUpPlatformHandleRequest request) {
|
||||
CloseUpPlatformDO platformDO = platformDAO.getById(request.getId());
|
||||
if (Objects.isNull(platformDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_UP_PLATFORM_DATE_NOT_EXIST);
|
||||
}
|
||||
if (!platformDO.getTaskStatus().equals(0)) {
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_UP_PLATFORM_STATUS_MODIFYING);
|
||||
}
|
||||
CloseUpApplyFormDO formDO = applyFormDAO.getById(platformDO.getApplyId());
|
||||
if (Objects.isNull(formDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_UP_FORM_NOT_EXIST);
|
||||
}
|
||||
StoreDO storeDO = storeDao.getEffectiveByStoreId(formDO.getStoreId());
|
||||
if (Objects.isNull(storeDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
Integer platformCode = CloseUpPlatformEnum.getPlatformCodeByCode(platformDO.getCode());
|
||||
if (platformDO.getType().equals(1) && Objects.nonNull(platformCode)) {
|
||||
PlatformStatusDTO platformStatusDTO = platformHttpClientRest.platformCloseUp(storeDO.getStoreNum(), String.valueOf(platformCode), request.getStatus() ^ 1);
|
||||
if (Objects.nonNull(platformStatusDTO)) {
|
||||
if (CollectionUtils.isNotEmpty(platformStatusDTO.getPlatformResults())) {
|
||||
PlatformStatusDTO.PlatformUpdateResult result = platformStatusDTO.getPlatformResults().get(0);
|
||||
if (Boolean.TRUE.equals(result.getSuccess())) {
|
||||
boolean isDy = result.getPlatformCode().equals("8");
|
||||
CloseUpPlatformDO updatePlatform = CloseUpPlatformDO.builder()
|
||||
.id(platformDO.getId())
|
||||
.status(isDy ? platformDO.getStatus() : request.getStatus())
|
||||
.taskId(isDy ? result.getTaskId() : null)
|
||||
.taskStatus(isDy ? request.getStatus() + 1 : 0)
|
||||
.build();
|
||||
platformDAO.updateStatusAndTaskId(Collections.singletonList(updatePlatform));
|
||||
return new CloseUpPlatformStatusVO(isDy ? 1 : 2);
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_UP_PLATFORM_STATUS_UPDATE_ERROR, result.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_UP_PLATFORM_STATUS_UPDATE_ERROR, "系统异常");
|
||||
} else {
|
||||
// 手动关闭直接修改状态
|
||||
platformDAO.updateStatusByIds(Collections.singletonList(request.getId()), request.getStatus(), 0);
|
||||
return new CloseUpPlatformStatusVO(2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -591,7 +631,7 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
}
|
||||
PlatformAsyncStatusDTO result = platformHttpClientRest.queryPlatformStatusByTaskId(storeDO.getStoreNum(), String.valueOf(platformCode), Long.valueOf(platformDO.getTaskId()));
|
||||
if (Objects.nonNull(result) && result.getStatus().equals("50")) {
|
||||
platformDAO.updateStatusByIds(Collections.singletonList(platformDO.getId()), 1);
|
||||
platformDAO.updateStatusByIds(Collections.singletonList(platformDO.getId()), platformDO.getTaskStatus() - 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,8 +652,8 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
log.info("门店不存在");
|
||||
return;
|
||||
}
|
||||
if (!StoreStatusEnum.CLOSE_UP.getValue().equals(storeDO.getStoreStatus())) {
|
||||
log.info("门店不是歇业状态");
|
||||
if (!StoreStatusEnum.OPEN.getValue().equals(storeDO.getStoreStatus())) {
|
||||
log.info("门店不是open状态, storeNum:{}", storeDO.getStoreNum());
|
||||
return;
|
||||
}
|
||||
CloseUpApplyFormDO update = CloseUpApplyFormDO.builder()
|
||||
@@ -623,6 +663,12 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
applyFormDAO.updateByPrimaryKeySelective(update);
|
||||
// 校验歇业单是否已经恢复过营业
|
||||
storeDao.closeUpToOpen(formDO.getStoreId());
|
||||
try {
|
||||
StoreMasterIssueDTO storeMasterIssueDTO = new StoreMasterIssueDTO(enterpriseId, Collections.singletonList(formDO.getStoreId()));
|
||||
simpleMessageService.send(JSONObject.toJSONString(storeMasterIssueDTO), RocketMqTagEnum.STORE_MASTER_ISSUE);
|
||||
} catch (Exception e) {
|
||||
log.error("mq通知主应用下发门店主数据失败");
|
||||
}
|
||||
log.info("歇业申请后门店自动恢复营业, storeId:{}", formDO.getStoreId());
|
||||
}
|
||||
|
||||
@@ -661,7 +707,7 @@ public class CloseUpServiceImpl implements CloseUpService {
|
||||
}
|
||||
if (autoPlatform) {
|
||||
// 自动开关平台
|
||||
List<CloseUpPlatformDO> platformList = platformDAO.getList(formDO.getId(), 0, 1, null);
|
||||
List<CloseUpPlatformDO> platformList = platformDAO.getList(formDO.getId(), 0, 1, null, null);
|
||||
autoPlatform(storeId, applyType, platformList);
|
||||
}
|
||||
if (StringUtils.isNotBlank(storeDO.getTelephone())) {
|
||||
|
||||
@@ -116,9 +116,9 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (!acquired) {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (request.getLegalIsSamePartner()){
|
||||
// 法人身份证信息和加盟商一致
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfo.getLineId());
|
||||
if ( ! lineInfoDO.getUsername().equals(request.getLicenseLegalPerson())){
|
||||
throw new ServiceException(ErrorCodeEnum.LEGAL_PERSON_NAME_NOT_SAME);
|
||||
@@ -148,7 +148,10 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
preparationService.buildStoreAndDecorationComplete(request.getShopId());
|
||||
preparationService.selectSiteAndBuildStoreComplete(request.getShopId());
|
||||
}
|
||||
addTagIfUploadLicense(request.getShopId());
|
||||
if (CommonConstants.INDEX_ONE.equals(shopInfo.getUseStandardStore())
|
||||
|| String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfo.getFranchiseBrand())) {
|
||||
addTagIfUploadLicense(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -608,26 +608,35 @@ public class DeskServiceImpl implements DeskService {
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> openingAcceptance(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||
//如果运营顾问 查询直接返回
|
||||
List<Integer> stageList = new ArrayList<>();
|
||||
Boolean flag = Boolean.FALSE;
|
||||
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
|
||||
stageList.addAll(Arrays.asList(SHOP_SUB_STAGE_STATUS_270.getShopSubStageStatus(),SHOP_SUB_STAGE_STATUS_274.getShopSubStageStatus()));
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList);
|
||||
|
||||
boolean isSupervision = userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode());
|
||||
boolean isOperationGeneralConsultant = userRoleIds.contains(UserRoleEnum.OPERATION_GENERAL_CONSULTANT.getCode());
|
||||
|
||||
// 两个角色同时存在:使用OR条件一次查询
|
||||
if (isSupervision && isOperationGeneralConsultant) {
|
||||
List<Integer> stageList = Arrays.asList(SHOP_SUB_STAGE_STATUS_270.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_274.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_272.getShopSubStageStatus());
|
||||
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdByUserId(user.getUserId(), null);
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList, authRegionIds);
|
||||
}
|
||||
if (userRoleIds.contains(UserRoleEnum.OPERATION_GENERAL_CONSULTANT.getCode()) ) {
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_272.getShopSubStageStatus());
|
||||
flag = Boolean.TRUE;
|
||||
|
||||
// 仅运营顾问:按运营顾问ID精确查询
|
||||
if (isSupervision) {
|
||||
List<Integer> stageList = Arrays.asList(SHOP_SUB_STAGE_STATUS_270.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_274.getShopSubStageStatus());
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList, null);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(stageList)){
|
||||
return new PageInfo<>();
|
||||
|
||||
// 仅运营总顾问:按管辖范围过滤查询
|
||||
if (isOperationGeneralConsultant) {
|
||||
List<Integer> stageList = Collections.singletonList(SHOP_SUB_STAGE_STATUS_272.getShopSubStageStatus());
|
||||
return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList, Boolean.TRUE);
|
||||
}
|
||||
return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList, flag);
|
||||
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> openingConfirmPendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_30, Arrays.asList(SHOP_SUB_STAGE_STATUS_310.getShopSubStageStatus()));
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_30, Arrays.asList(SHOP_SUB_STAGE_STATUS_310.getShopSubStageStatus()), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -940,9 +949,13 @@ public class DeskServiceImpl implements DeskService {
|
||||
* @param user
|
||||
* @param shopSubStageEnum
|
||||
* @param subStageStatusList
|
||||
* @param authRegionIds 管辖区域IDs(可选,用于两角色同时存在时的OR条件)
|
||||
* @return
|
||||
*/
|
||||
private PageInfo<PreparationCommonPendingVO> operationCustomQueryList(DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List<Integer> subStageStatusList) {
|
||||
private PageInfo<PreparationCommonPendingVO> operationCustomQueryList(DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List<Integer> subStageStatusList, List<String> authRegionIds) {
|
||||
if (CollectionUtils.isNotEmpty(authRegionIds)) {
|
||||
deskRequest.setAuthRegionIds(authRegionIds);
|
||||
}
|
||||
PageHelper.startPage(deskRequest.getPageNum(), deskRequest.getPageSize());
|
||||
List<ShopStageInfoDO> specialShopStageInfo = shopStageInfoDAO.getOperationsConsultantStageInfo(null, shopSubStageEnum.getShopSubStage(),
|
||||
subStageStatusList, user.getUserId(), deskRequest);
|
||||
|
||||
@@ -1337,8 +1337,13 @@ public class PointServiceImpl implements PointService {
|
||||
shopInfoDAO.updateShopInfo(updateShop);
|
||||
//如果是通过 将钱包阶段状态从未开始改为已开始 已开始的不需要处理
|
||||
ShopStageInfoDO walletStage = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_6);
|
||||
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus().equals(walletStage.getShopSubStageStatus())) {
|
||||
if (Objects.nonNull(walletStage) && ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus().equals(walletStage.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_60);
|
||||
} else {
|
||||
ShopStageInfoDO payStage = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus().equals(payStage.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70);
|
||||
}
|
||||
}
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, subStageStatus, auditId);
|
||||
|
||||
@@ -1217,6 +1217,9 @@ public class ShopServiceImpl implements ShopService {
|
||||
}
|
||||
|
||||
private List<UserDTO> convertToUserDTOs(List<EnterpriseUserDO> users) {
|
||||
if (CollectionUtils.isEmpty(users)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//最多给10条数据
|
||||
return users.stream()
|
||||
.map(user -> new UserDTO(user.getName(), user.getMobile()))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.annotation.Debounce;
|
||||
import com.cool.store.request.closeup.CloseUpAuditRequest;
|
||||
import com.cool.store.request.closeup.CloseUpPlatformHandleRequest;
|
||||
import com.cool.store.request.closeup.CloseUpQueryRequest;
|
||||
@@ -9,6 +10,7 @@ import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.closeup.CloseUpService;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormSimpleVO;
|
||||
import com.cool.store.vo.closeup.CloseUpApplyFormVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformStatusVO;
|
||||
import com.cool.store.vo.closeup.CloseUpPlatformVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -55,12 +57,14 @@ public class CloseUpController {
|
||||
|
||||
@ApiOperation("审批通过")
|
||||
@PostMapping("/auditPass")
|
||||
@Debounce(timeMs = 5000)
|
||||
public ResponseResult<Boolean> auditPass(@RequestBody @Validated CloseUpAuditRequest request) {
|
||||
return ResponseResult.success(closeUpService.auditPass(request));
|
||||
}
|
||||
|
||||
@ApiOperation("审批拒绝")
|
||||
@PostMapping("/auditRejected")
|
||||
@Debounce(timeMs = 5000)
|
||||
public ResponseResult<Boolean> auditRefuse(@RequestBody @Validated CloseUpAuditRequest request) {
|
||||
return ResponseResult.success(closeUpService.auditRejected(request));
|
||||
}
|
||||
@@ -85,7 +89,7 @@ public class CloseUpController {
|
||||
|
||||
@ApiOperation("平台关闭开启处理")
|
||||
@PostMapping("/handlePlatform")
|
||||
public ResponseResult<Boolean> handlePlatform(@RequestBody @Validated CloseUpPlatformHandleRequest request) {
|
||||
public ResponseResult<CloseUpPlatformStatusVO> handlePlatform(@RequestBody @Validated CloseUpPlatformHandleRequest request) {
|
||||
return ResponseResult.success(closeUpService.handlePlatform(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +181,11 @@ public class PCTestController {
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/storeStatusAndPlatformUpdate")
|
||||
public void storeStatusAndPlatformUpdate(Long applyId) {
|
||||
closeUpService.storeStatusAndPlatformUpdate(applyId);
|
||||
}
|
||||
|
||||
@PostMapping("/closeUpAutoOpen")
|
||||
public void closeUpAutoOpen(Long applyId) {
|
||||
closeUpService.closeUpAutoOpen(applyId);
|
||||
@@ -194,7 +199,7 @@ public class PCTestController {
|
||||
@PostMapping("/autoPlatform")
|
||||
public void autoPlatform(Long applyId) {
|
||||
CloseUpApplyFormDO formDO = closeUpApplyFormDAO.getById(applyId);
|
||||
List<CloseUpPlatformDO> platformList = closeUpPlatformDAO.getList(applyId, 0, 1, null);
|
||||
List<CloseUpPlatformDO> platformList = closeUpPlatformDAO.getList(applyId, 0, 1, null, null);
|
||||
closeUpService.autoPlatform(formDO.getStoreId(), formDO.getType(), platformList);
|
||||
}
|
||||
|
||||
|
||||
@@ -806,7 +806,7 @@ public class XxlJobHandler {
|
||||
int pageSize = CommonConstants.BATCH_SIZE;
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<CloseUpPlatformDO> list = closeUpPlatformDAO.getList(null, 0, null, true);
|
||||
List<CloseUpPlatformDO> list = closeUpPlatformDAO.getList(null, null, null, true, true);
|
||||
hasNext = list.size() >= pageSize;
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user