Merge branch 'master' into cc_20250327_tallyBook

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/PointServiceImpl.java
This commit is contained in:
shuo.wang
2025-04-01 18:50:27 +08:00
13 changed files with 108 additions and 28 deletions

View File

@@ -63,6 +63,17 @@ public enum ShopSubStageEnum {
this.planCompleteDays = planCompleteDays; this.planCompleteDays = planCompleteDays;
} }
public static Integer getTotalStageIsLocationAndPreparation() {
int total=0;
for (ShopSubStageEnum shopStageEnum : ShopSubStageEnum.values()) {
if (shopStageEnum.getShopStageEnum().getShopStage().equals(ShopStageEnum.SHOP_STAGE_1.getShopStage())
||shopStageEnum.getShopStageEnum().getShopStage().equals(ShopStageEnum.SHOP_STAGE_2.getShopStage())) {
total++;
}
}
return total;
}
public static List<ShopSubStageEnum> getShopStageEnum(Integer shopStage) { public static List<ShopSubStageEnum> getShopStageEnum(Integer shopStage) {
List<ShopSubStageEnum> resultList = new ArrayList<>(); List<ShopSubStageEnum> resultList = new ArrayList<>();
for (ShopSubStageEnum shopStageEnum : ShopSubStageEnum.values()) { for (ShopSubStageEnum shopStageEnum : ShopSubStageEnum.values()) {

View File

@@ -128,6 +128,13 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.getAllCompletionCount(shopId); return shopStageInfoMapper.getAllCompletionCount(shopId);
} }
public Integer getCompletionCount(Long shopId) {
if (Objects.isNull(shopId)) {
return 0;
}
return shopStageInfoMapper.getCompletionCount(shopId);
}
/** /**
* @Auther: wangshuo * @Auther: wangshuo
* @Date: 2024/5/3 * @Date: 2024/5/3

View File

@@ -46,6 +46,9 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
*/ */
Integer getAllCompletionCount(@Param("shopId") Long shopId); Integer getAllCompletionCount(@Param("shopId") Long shopId);
Integer getCompletionCount(@Param("shopId") Long shopId);
/** /**
* 跟新店铺阶段信息 * 跟新店铺阶段信息
* @param shopId * @param shopId

View File

@@ -480,7 +480,7 @@
<if test="wantShopAreaName != null"> <if test="wantShopAreaName != null">
left join xfsg_open_area_info b on a.want_shop_area_id = b.id left join xfsg_open_area_info b on a.want_shop_area_id = b.id
</if> </if>
where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2) where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2) and c.deleted = 0
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and (a.investment_manager = #{userId} or c.investment_manager = #{userId} ) and (a.investment_manager = #{userId} or c.investment_manager = #{userId} )
</if> </if>

View File

@@ -51,7 +51,7 @@
op.result_type AS resultType,si.supervisor_user_id as supervisorUserId op.result_type AS resultType,si.supervisor_user_id as supervisorUserId
from xfsg_opening_operation_plan op from xfsg_opening_operation_plan op
join xfsg_shop_info si on si.id = op.shop_id join xfsg_shop_info si on si.id = op.shop_id
where 1=1 where si.deleted = 0
<if test="request.shopName != null and request.shopName != '' "> <if test="request.shopName != null and request.shopName != '' ">
AND si.shop_name like concat('%', #{request.shopName}, '%') AND si.shop_name like concat('%', #{request.shopName}, '%')
</if> </if>

View File

@@ -79,15 +79,17 @@
</select> </select>
<select id="getBySubStageStatusAndUser" resultType="com.cool.store.entity.OperationLogDO"> <select id="getBySubStageStatusAndUser" resultType="com.cool.store.entity.OperationLogDO">
select * select *
from xfsg_operation_log from xfsg_operation_log a
left join xfsg_shop_info b on a.shop_id = b.id
where where
operator = #{userId} b.deleted=0
and shop_sub_stage_status in and a.operator = #{userId}
and a.shop_sub_stage_status in
<foreach collection="list" index="index" item="item" open="(" close=")" separator=","> <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and status = 0 and a.status = 0
order by create_time desc order by a.create_time desc
</select> </select>
<select id="getByCondition" resultType="com.cool.store.entity.OperationLogDO"> <select id="getByCondition" resultType="com.cool.store.entity.OperationLogDO">
select * select *

View File

@@ -213,7 +213,8 @@
left join xfsg_line_info xli on xsi.line_id = xli.id left join xfsg_line_info xli on xsi.line_id = xli.id
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
where where
xssi.shop_stage = 3 xsi.deleted = 0
and xssi.shop_stage = 3
and xssi.shop_sub_stage_status != -100 and xssi.shop_sub_stage_status != -100
and and
xsi.region_id in xsi.region_id in
@@ -346,6 +347,9 @@
select select
<include refid="allColumn"/> <include refid="allColumn"/>
from xfsg_shop_info where line_id = #{lineId} and deleted= '0' from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
<if test="userId==null">
and shop_status in(0,1)
</if>
<if test="userId!=null and userId!=''"> <if test="userId!=null and userId!=''">
and( investment_manager = #{userId} and( investment_manager = #{userId}
<if test="list!=null and list.size>0"> <if test="list!=null and list.size>0">

View File

@@ -196,8 +196,9 @@
from from
xfsg_shop_stage_info a xfsg_shop_stage_info a
inner join xfsg_line_info b on a.line_id = b.id inner join xfsg_line_info b on a.line_id = b.id
where left join xfsg_shop_info c on a.shop_id = c.id
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and where c.deleted=0
and a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and
b.deleted = 0 and b.development_manager = #{userId} b.deleted = 0 and b.development_manager = #{userId}
</select> </select>
@@ -256,10 +257,9 @@
select select
* *
from xfsg_shop_stage_info a from xfsg_shop_stage_info a
<if test="(authRegionIds != null and authRegionIds.size() > 0) or (investmentUserId != null and investmentUserId != '')"> left join xfsg_shop_info si on a.shop_id = si.id
left join xfsg_shop_info si on a.shop_id = si.id
</if>
<where> <where>
si.deleted = 0
<if test="shopIds != null and shopIds.size() > 0"> <if test="shopIds != null and shopIds.size() > 0">
and a.shop_id in and a.shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")"> <foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
@@ -409,4 +409,12 @@
</select> </select>
<select id="getCompletionCount" resultType="java.lang.Integer">
select
count(1)
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and deleted = 0 and is_terminated = 1 and shop_stage in (1,2)
</select>
</mapper> </mapper>

View File

@@ -3,6 +3,8 @@ package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
* @FileName: DeleteShopRequest * @FileName: DeleteShopRequest
@@ -13,6 +15,8 @@ import lombok.Data;
public class DeleteShopRequest { public class DeleteShopRequest {
@ApiModelProperty("店铺id") @ApiModelProperty("店铺id")
@NotNull
private Long shopId; private Long shopId;
private String userId;
} }

View File

@@ -96,7 +96,7 @@ public interface ShopService {
* @return * @return
*/ */
Boolean shopClose(Long shopId); Boolean shopClose(Long shopId);
Boolean updateShopStatue(Long shopId);
/** /**
* 分店列表 * 分店列表

View File

@@ -254,6 +254,10 @@ public class PointServiceImpl implements PointService {
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
if (!pointInfo.getPointStatus().equals(PointStatusEnum.POINT_STATUS_2.getCode())
&& !pointInfo.getPointStatus().equals(PointStatusEnum.POINT_STATUS_1.getCode())) {
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId); PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if (Objects.isNull(pointDetailInfo)) { if (Objects.isNull(pointDetailInfo)) {
log.error("铺位详细信息不存在"); log.error("铺位详细信息不存在");

View File

@@ -175,6 +175,10 @@ public class ShopServiceImpl implements ShopService {
@Override @Override
public List<ShopStageInfoVO> getShopStageInfo(Long shopId, Integer shopStage) { public List<ShopStageInfoVO> getShopStageInfo(Long shopId, Integer shopStage) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
if (Objects.nonNull(shopStage)) { if (Objects.nonNull(shopStage)) {
ShopStageEnum shopStageEnum = ShopStageEnum.getShopStageEnum(shopStage); ShopStageEnum shopStageEnum = ShopStageEnum.getShopStageEnum(shopStage);
if (Objects.isNull(shopStageEnum)) { if (Objects.isNull(shopStageEnum)) {
@@ -193,26 +197,39 @@ public class ShopServiceImpl implements ShopService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Integer deleteShop(DeleteShopRequest request) { public Integer deleteShop(DeleteShopRequest request) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId()); ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (Objects.nonNull(shopInfo)) { if (shopInfo == null) {
//进入选址不允许删除操作 throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
} }
// ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3); // if (Objects.nonNull(shopInfo)) {
// if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){ // //进入选址不允许删除操作
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE); // throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
// } // }
if (Objects.nonNull(shopInfo.getPointId())) { // ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId()); // if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) { // throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
pointInfoDAO.recyclePoint(pointInfo.getId()); // }
} // if (Objects.nonNull(shopInfo.getPointId())) {
pointRecommendDAO.updateRecommendStatus(shopInfo.getPointId(), PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5)); // PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
// if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
// pointInfoDAO.recyclePoint(pointInfo.getId());
// }
// pointRecommendDAO.updateRecommendStatus(shopInfo.getPointId(), PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5));
// }
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
if (lineInfoDO.getWantShopNum() > 1) {
lineInfoDO.setWantShopNum(lineInfoDO.getWantShopNum() - 1);
} }
lineInfoDO.setUpdateTime(new Date());
lineInfoDO.setUpdateUserId(request.getUserId());
lineInfoDAO.updateLineInfo(lineInfoDO);
ShopInfoDO updateShop = new ShopInfoDO(); ShopInfoDO updateShop = new ShopInfoDO();
updateShop.setId(request.getShopId()); updateShop.setId(request.getShopId());
updateShop.setDeleted(true); updateShop.setDeleted(true);
updateShop.setUpdateTime(new Date());
updateShop.setUpdateUserId(request.getUserId());
return shopInfoDAO.updateShopInfo(updateShop); return shopInfoDAO.updateShopInfo(updateShop);
} }
@@ -411,6 +428,22 @@ public class ShopServiceImpl implements ShopService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
public Boolean updateShopStatue(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Integer completionCount = shopStageInfoDAO.getCompletionCount(shopId);
if (completionCount.equals(ShopSubStageEnum.getTotalStageIsLocationAndPreparation())) {
shopInfo.setShopStatus(ShopStatusEnum.DONE.getCode());
} else {
shopInfo.setShopStatus(ShopStatusEnum.ING.getCode());
}
shopInfoDAO.updateShopInfo(shopInfo);
return Boolean.TRUE;
}
@Override @Override
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) { public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
if (request.getFlag().equals(CommonConstants.TWO)) { if (request.getFlag().equals(CommonConstants.TWO)) {

View File

@@ -59,6 +59,7 @@ public class PCShopController {
@ApiOperation("删除店铺") @ApiOperation("删除店铺")
@PostMapping("/deleteShop") @PostMapping("/deleteShop")
public ResponseResult<Integer> deleteShop(@RequestBody @Validated DeleteShopRequest request) { public ResponseResult<Integer> deleteShop(@RequestBody @Validated DeleteShopRequest request) {
request.setUserId(CurrentUserHolder.getUserId());
return ResponseResult.success(shopService.deleteShop(request)); return ResponseResult.success(shopService.deleteShop(request));
} }
@@ -117,12 +118,15 @@ public class PCShopController {
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum, pageSize, lineId, lineShopType)); return ResponseResult.success(transferLogService.getTransferLogPage(pageNum, pageSize, lineId, lineShopType));
} }
@ApiOperation("门店结束跟进") @ApiOperation("门店结束跟进")
@GetMapping("/shopClose") @GetMapping("/shopClose")
public ResponseResult<Boolean> shopClose(@RequestParam("shopId")Long shopId) { public ResponseResult<Boolean> shopClose(@RequestParam("shopId")Long shopId) {
return ResponseResult.success(shopService.shopClose(shopId)); return ResponseResult.success(shopService.shopClose(shopId));
} }
@ApiOperation("门店恢复状态")
@GetMapping("/updateShopStatue")
public ResponseResult<Boolean> updateShopStatue(@RequestParam("shopId")Long shopId) {
return ResponseResult.success(shopService.updateShopStatue(shopId));
}
} }