Merge remote-tracking branch 'origin/cc_20250106_v2.4' into cc_20250106_v2.4
This commit is contained in:
@@ -162,8 +162,8 @@ public class ShopInfoDAO {
|
|||||||
return shopInfoMapper.ListByCondition(request);
|
return shopInfoMapper.ListByCondition(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request){
|
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request,String userId){
|
||||||
return shopInfoMapper.ListByBranchShopRequest(request);
|
return shopInfoMapper.ListByBranchShopRequest(request,userId);
|
||||||
}
|
}
|
||||||
public Long getRegionIdByid(Long shopId){
|
public Long getRegionIdByid(Long shopId){
|
||||||
return shopInfoMapper.getRegionIdByid(shopId);
|
return shopInfoMapper.getRegionIdByid(shopId);
|
||||||
|
|||||||
@@ -174,16 +174,7 @@ public class ShopStageInfoDAO {
|
|||||||
return CommonConstants.ZERO;
|
return CommonConstants.ZERO;
|
||||||
}
|
}
|
||||||
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
||||||
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
|
extracted(subStageStatusList, shopId, shopStageList);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
||||||
}
|
}
|
||||||
@@ -196,26 +187,30 @@ public class ShopStageInfoDAO {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer batchUpdateByShopIdsAndSubStageStatus(List<Long> shopIds, List<ShopSubStageStatusEnum> subStageStatusList) {
|
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;
|
return CommonConstants.ZERO;
|
||||||
}
|
}
|
||||||
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
||||||
for (Long shopId : shopIds) {
|
for (Long shopId : shopIds) {
|
||||||
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
|
extracted(subStageStatusList, shopId, shopStageList);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return shopStageInfoMapper.batchUpdateByShopIdsAndSubStageStatus(shopIds, 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
|
* @param shopId
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
|||||||
|
|
||||||
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
|
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);
|
Long getRegionIdByid(@Param("shopId") Long shopId);
|
||||||
|
|
||||||
|
|||||||
@@ -294,12 +294,6 @@
|
|||||||
#{regionId}
|
#{regionId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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 != ''">
|
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
|
||||||
and a.investment_manager = #{request.investmentManagerUserId}
|
and a.investment_manager = #{request.investmentManagerUserId}
|
||||||
</if>
|
</if>
|
||||||
@@ -334,6 +328,15 @@
|
|||||||
#{wantShopAreaId}
|
#{wantShopAreaId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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
|
order by a.update_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getShopListByRegion" resultType="com.cool.store.entity.ShopInfoDO">
|
<select id="getShopListByRegion" resultType="com.cool.store.entity.ShopInfoDO">
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import com.cool.store.common.PageBasicInfo;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -39,5 +41,8 @@ public class BranchShopRequest extends PageBasicInfo{
|
|||||||
private List<String> authRegionIds;
|
private List<String> authRegionIds;
|
||||||
@ApiModelProperty(value="意向开店区域+子节点",hidden = true)
|
@ApiModelProperty(value="意向开店区域+子节点",hidden = true)
|
||||||
private List<Long> wantShopAreaAllIds;
|
private List<Long> wantShopAreaAllIds;
|
||||||
|
@ApiModelProperty("1-我负责的,2-我管辖的")
|
||||||
|
@NotNull
|
||||||
|
private Integer flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,4 +65,8 @@ public class BranchShopDetailResponse {
|
|||||||
|
|
||||||
@ApiModelProperty("门店状态:0.跟进中 1.已完成 2.已放弃")
|
@ApiModelProperty("门店状态:0.跟进中 1.已完成 2.已放弃")
|
||||||
private Integer shopStatus;
|
private Integer shopStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("铺位id")
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
|
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
|
||||||
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
|
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
|
||||||
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
|
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
|
||||||
}else{
|
} else {
|
||||||
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
|
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
|
||||||
}
|
}
|
||||||
return shopId;
|
return shopId;
|
||||||
@@ -305,6 +305,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
response.setRegionName(shopRegion.getName());
|
response.setRegionName(shopRegion.getName());
|
||||||
response.setWantRegionName(wantShopArea);
|
response.setWantRegionName(wantShopArea);
|
||||||
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
|
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
|
||||||
|
response.setPointId(shopInfo.getPointId());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,10 +355,12 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
||||||
if (!sysRoleService.checkIsAdmin(userId)) {
|
if (request.getFlag().equals(CommonConstants.ZERO)) {
|
||||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
|
if (!sysRoleService.checkIsAdmin(userId)) {
|
||||||
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
|
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
|
||||||
return new PageInfo<>();
|
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||||
@@ -374,7 +377,7 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
}
|
}
|
||||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
List<BranchShopResponse> responses = new ArrayList<>();
|
List<BranchShopResponse> responses = new ArrayList<>();
|
||||||
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request);
|
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request,userId);
|
||||||
if (CollectionUtils.isEmpty(preparations)) {
|
if (CollectionUtils.isEmpty(preparations)) {
|
||||||
return new PageInfo<>();
|
return new PageInfo<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.github.pagehelper.PageInfo;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -39,7 +40,7 @@ public class PreparationController {
|
|||||||
|
|
||||||
@ApiOperation("进度列表")
|
@ApiOperation("进度列表")
|
||||||
@PostMapping("/list")
|
@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()));
|
return ResponseResult.success(shopService.getBranchShopList(request,CurrentUserHolder.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user