Merge remote-tracking branch 'origin/cc_20250106_v2.4' into cc_20250106_v2.4

This commit is contained in:
苏竹红
2025-01-16 16:57:07 +08:00
8 changed files with 48 additions and 37 deletions

View File

@@ -162,8 +162,8 @@ public class ShopInfoDAO {
return shopInfoMapper.ListByCondition(request);
}
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request){
return shopInfoMapper.ListByBranchShopRequest(request);
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request,String userId){
return shopInfoMapper.ListByBranchShopRequest(request,userId);
}
public Long getRegionIdByid(Long shopId){
return shopInfoMapper.getRegionIdByid(shopId);

View File

@@ -174,16 +174,7 @@ public class ShopStageInfoDAO {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setShopId(shopId);
shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage());
shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus());
shopStageInfo.setRemark(remark);
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
shopStageList.add(shopStageInfo);
}
extracted(subStageStatusList, shopId, shopStageList);
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
}
@@ -196,26 +187,30 @@ public class ShopStageInfoDAO {
* @return
*/
public Integer batchUpdateByShopIdsAndSubStageStatus(List<Long> shopIds, List<ShopSubStageStatusEnum> subStageStatusList) {
if (Objects.isNull(shopIds) || CollectionUtils.isEmpty(subStageStatusList)) {
if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(subStageStatusList)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
for (Long shopId : shopIds) {
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setShopId(shopId);
shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage());
shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus());
shopStageInfo.setRemark(remark);
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
shopStageList.add(shopStageInfo);
}
extracted(subStageStatusList, shopId, shopStageList);
}
return shopStageInfoMapper.batchUpdateByShopIdsAndSubStageStatus(shopIds, shopStageList);
}
private static void extracted(List<ShopSubStageStatusEnum> subStageStatusList, Long shopId, List<ShopStageInfoDO> shopStageList) {
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setShopId(shopId);
shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage());
shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus());
shopStageInfo.setRemark(remark);
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
shopStageList.add(shopStageInfo);
}
}
/**
* 更新子阶段到未开始状态
* @param shopId

View File

@@ -86,7 +86,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request);
List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request,@Param("userId") String userId);
Long getRegionIdByid(@Param("shopId") Long shopId);

View File

@@ -294,12 +294,6 @@
#{regionId}
</foreach>
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and a.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
and a.investment_manager = #{request.investmentManagerUserId}
</if>
@@ -334,6 +328,15 @@
#{wantShopAreaId}
</foreach>
</if>
<if test="request.flag == 1">
and a.investment_manager = #{userId}
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and a.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
order by a.update_time desc
</select>
<select id="getShopListByRegion" resultType="com.cool.store.entity.ShopInfoDO">

View File

@@ -4,6 +4,8 @@ import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@@ -39,5 +41,8 @@ public class BranchShopRequest extends PageBasicInfo{
private List<String> authRegionIds;
@ApiModelProperty(value="意向开店区域+子节点",hidden = true)
private List<Long> wantShopAreaAllIds;
@ApiModelProperty("1-我负责的2-我管辖的")
@NotNull
private Integer flag;
}

View File

@@ -65,4 +65,8 @@ public class BranchShopDetailResponse {
@ApiModelProperty("门店状态:0.跟进中 1.已完成 2.已放弃")
private Integer shopStatus;
@ApiModelProperty("铺位id")
private Long pointId;
}

View File

@@ -265,7 +265,7 @@ public class ShopServiceImpl implements ShopService {
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
}else{
} else {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
}
return shopId;
@@ -305,6 +305,7 @@ public class ShopServiceImpl implements ShopService {
response.setRegionName(shopRegion.getName());
response.setWantRegionName(wantShopArea);
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
response.setPointId(shopInfo.getPointId());
return response;
}
@@ -354,10 +355,12 @@ public class ShopServiceImpl implements ShopService {
@Override
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
if (!sysRoleService.checkIsAdmin(userId)) {
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
return new PageInfo<>();
if (request.getFlag().equals(CommonConstants.ZERO)) {
if (!sysRoleService.checkIsAdmin(userId)) {
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
return new PageInfo<>();
}
}
}
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
@@ -374,7 +377,7 @@ public class ShopServiceImpl implements ShopService {
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<BranchShopResponse> responses = new ArrayList<>();
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request);
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request,userId);
if (CollectionUtils.isEmpty(preparations)) {
return new PageInfo<>();
}

View File

@@ -16,6 +16,7 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -39,7 +40,7 @@ public class PreparationController {
@ApiOperation("进度列表")
@PostMapping("/list")
public ResponseResult<PageInfo<BranchShopResponse>> distribution(@RequestBody BranchShopRequest request) {
public ResponseResult<PageInfo<BranchShopResponse>> distribution(@RequestBody @Validated BranchShopRequest request) {
return ResponseResult.success(shopService.getBranchShopList(request,CurrentUserHolder.getUserId()));
}