修改增加意向门店接口

This commit is contained in:
shuo.wang
2025-01-10 17:22:27 +08:00
parent 1b752aff83
commit 2f962e4039
3 changed files with 33 additions and 19 deletions

View File

@@ -23,6 +23,8 @@ public class AddShopRequest {
@NotEmpty
@ApiModelProperty("店铺名称")
private List<String> shopNameList;
@ApiModelProperty(value = "当前登录用户id",hidden = true)
private String userId;
public AddShopRequest() {
}

View File

@@ -118,7 +118,7 @@ public class ShopServiceImpl implements ShopService {
public List<MiniShopPageVO> getShopList(Long lineId, String userId) {
List<Long> authRegions = new ArrayList<>();
if (StringUtils.isNotBlank(userId) && !sysRoleService.checkIsAdmin(userId)) {
for (String region : userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId)){
for (String region : userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId)) {
authRegions.add(Long.valueOf(region));
}
}
@@ -201,6 +201,8 @@ public class ShopServiceImpl implements ShopService {
addShop.setPartnerId(lineInfo.getPartnerId());
addShop.setShopName(shopName);
addShop.setSupervisorUserId(lineInfo.getInvestmentManager());
addShop.setInvestmentManager(lineInfo.getInvestmentManager());
addShop.setDevelopmentManager(lineInfo.getInvestmentManager());
addShopList.add(addShop);
}
shopInfoDAO.batchAddShop(addShopList);
@@ -236,9 +238,14 @@ public class ShopServiceImpl implements ShopService {
request.setInvestmentManagerUserId(userId);
}
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
Integer wantShopNum = lineInfo.getWantShopNum() + 1;
lineInfo.setWantShopNum(wantShopNum);
lineInfoDAO.updateLineInfo(lineInfo);
if (lineInfo.getWorkflowSubStageStatus() < WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode()) {
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
}
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
if (!CollectionUtils.isEmpty(shopList)) {
lineInfo.setWantShopNum(lineInfo.getWantShopNum() + 1);
lineInfoDAO.updateLineInfo(lineInfo);
}
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo.getPartnerId());
shopInfoDO.setCreateUserId(userId);
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);

View File

@@ -37,21 +37,22 @@ public class PCShopController {
private ShopService shopService;
@Resource
private TransferLogService transferLogService;
@ApiOperation("获取店铺列表")
@GetMapping("/getShopList")
public ResponseResult<List<MiniShopPageVO>> getShopList(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(shopService.getShopList(lineId,CurrentUserHolder.getUserId()));
public ResponseResult<List<MiniShopPageVO>> getShopList(@RequestParam("lineId") Long lineId) {
return ResponseResult.success(shopService.getShopList(lineId, CurrentUserHolder.getUserId()));
}
@ApiOperation("获取各个阶段店铺数量")
@GetMapping("/getStageShopCount")
public ResponseResult<StageShopCountVO> getStageShopCount(@RequestParam("lineId")Long lineId) {
public ResponseResult<StageShopCountVO> getStageShopCount(@RequestParam("lineId") Long lineId) {
return ResponseResult.success(shopService.getStageShopCount(lineId));
}
@ApiOperation("获取店铺的阶段信息")
@GetMapping("/getShopStageInfo")
public ResponseResult<List<ShopStageInfoVO>> getShopStageInfo(@RequestParam("shopId")Long shopId, @RequestParam(value = "shopStage", required = false)Integer shopStage) {
public ResponseResult<List<ShopStageInfoVO>> getShopStageInfo(@RequestParam("shopId") Long shopId, @RequestParam(value = "shopStage", required = false) Integer shopStage) {
return ResponseResult.success(shopService.getShopStageInfo(shopId, shopStage));
}
@@ -64,19 +65,21 @@ public class PCShopController {
@ApiOperation("新增店铺")
@PostMapping("/addShop")
public ResponseResult<Long> addShop(@RequestBody @Validated AddShopRequest request) {
request.setUserId(CurrentUserHolder.getUserId());
return ResponseResult.success(shopService.addShop(request));
}
@ApiOperation("修改门店编号和门店名称和门店所属区域")
@PostMapping("/updateShopCode")
public ResponseResult<Integer> updateShopCode(@RequestBody @Validated UpdateShopCodeRequest request) {
return ResponseResult.success(shopService.updateShopCode(request,CurrentUserHolder.getUserId()));
return ResponseResult.success(shopService.updateShopCode(request, CurrentUserHolder.getUserId()));
}
@ApiOperation("新建分店")
@PostMapping("/addBranchShop")
public ResponseResult<Long> addBranchShop(@RequestBody @Validated AddBranchShopRequest request) {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(shopService.addBranchShop(request,userId));
return ResponseResult.success(shopService.addBranchShop(request, userId));
}
@ApiOperation("开店详情/左边小窗")
@@ -84,17 +87,19 @@ public class PCShopController {
public ResponseResult<BranchShopDetailResponse> getBranchShopDetail(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(shopService.getBranchShopDetail(shopId));
}
@ApiOperation("修改开店详情/左边小窗")
@PostMapping("/updateBranchShopDetail")
public ResponseResult<Integer> updateBranchShopDetail(@RequestBody @Validated BranchShopDetailRequest request) {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(shopService.updateBranchShopDetail(request,userId));
return ResponseResult.success(shopService.updateBranchShopDetail(request, userId));
}
@ApiOperation("修改门店招商专员/督导")
@GetMapping("/updateShopInvestment")
public ResponseResult<Integer> updateShopInvestment(@RequestParam("shopId") Long shopId,@RequestParam("updateUserId") String updateUserId) {
public ResponseResult<Integer> updateShopInvestment(@RequestParam("shopId") Long shopId, @RequestParam("updateUserId") String updateUserId) {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(shopService.updateShopInvestment(shopId,updateUserId,userId));
return ResponseResult.success(shopService.updateShopInvestment(shopId, updateUserId, userId));
}
@ApiOperation("门店转让记录")
@@ -105,17 +110,17 @@ public class PCShopController {
@ApiImplicitParam(name = "pageSize", value = "大小", required = true),
@ApiImplicitParam(name = "lineShopType", value = "1-线索2-门店", required = true)
})
public ResponseResult<PageInfo<TransferLogDTO>> getTransferLogPage(@RequestParam("lineId")Long lineId,
@RequestParam(value = "pageNum" ,defaultValue = "1")Integer pageNum,
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,
@RequestParam(value = "lineShopType",defaultValue = "1") Integer lineShopType) {
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum,pageSize,lineId,lineShopType));
public ResponseResult<PageInfo<TransferLogDTO>> getTransferLogPage(@RequestParam("lineId") Long lineId,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(value = "lineShopType", defaultValue = "1") Integer lineShopType) {
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum, pageSize, lineId, lineShopType));
}
@ApiOperation("开店管理列表")
@PostMapping("/getBranchShopList")
public ResponseResult<PageInfo<BranchShopResponse>> getBranchShopList(@RequestBody @Validated BranchShopRequest request) {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(shopService.getBranchShopList(request,userId));
return ResponseResult.success(shopService.getBranchShopList(request, userId));
}
}