feat:V2.4
This commit is contained in:
@@ -202,8 +202,8 @@ public class ShopInfoDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<ShopInfoDO> selectAllDataOrByShopId(Long shopId) {
|
||||
return shopInfoMapper.selectAllDataOrByShopId(shopId);
|
||||
public List<ShopInfoDO> selectAllDataOrByLineId(Long shopId) {
|
||||
return shopInfoMapper.selectAllDataOrByLineId(shopId);
|
||||
}
|
||||
|
||||
public Boolean batchUpdate(List<ShopInfoDO> list) {
|
||||
|
||||
@@ -114,7 +114,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<ShopInfoDO> selectAllDataOrByShopId(Long shopId);
|
||||
List<ShopInfoDO> selectAllDataOrByLineId(@Param("lineId") Long lineId);
|
||||
|
||||
Boolean batchUpdate(List<ShopInfoDO> list);
|
||||
}
|
||||
|
||||
@@ -357,11 +357,11 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllDataOrByShopId" resultMap="BaseResultMap">
|
||||
<select id="selectAllDataOrByLineId" resultMap="BaseResultMap">
|
||||
select * from xfsg_shop_info
|
||||
<where>
|
||||
<if test="shopId!=null">
|
||||
and id = #{shopId}
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -102,5 +102,5 @@ public interface ShopService {
|
||||
*/
|
||||
PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId);
|
||||
|
||||
Boolean dataHandle(Long shopId);
|
||||
Boolean dataHandler(Long shopId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
@@ -26,6 +27,7 @@ import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -213,6 +215,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);
|
||||
@@ -248,9 +252,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.isNotEmpty(shopList)) {
|
||||
lineInfo.setWantShopNum(lineInfo.getWantShopNum() + 1);
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
}
|
||||
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo.getPartnerId());
|
||||
shopInfoDO.setCreateUserId(userId);
|
||||
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
|
||||
@@ -396,24 +405,24 @@ public class ShopServiceImpl implements ShopService {
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param shopId
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean dataHandle(Long shopId){
|
||||
public Boolean dataHandler(Long lineId){
|
||||
log.info("------dataHandle start-----");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = 50;
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectAllDataOrByShopId(shopId);
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectAllDataOrByLineId(lineId);
|
||||
if (CollectionUtils.isEmpty(shopInfoDOS)) {
|
||||
log.info("------dataHandle end------");
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
List<Long> lineIds = shopInfoDOS.stream().map(ShopInfoDO::getLineId).collect(Collectors.toList());
|
||||
List<LineInfoDO> lines = lineInfoDAO.getByLineIds(lineIds);
|
||||
Set<Long> lineIds = shopInfoDOS.stream().map(ShopInfoDO::getLineId).collect(Collectors.toSet());
|
||||
List<LineInfoDO> lines = lineInfoDAO.getByLineIds(new ArrayList<>(lineIds));
|
||||
//转为map
|
||||
Map<Long, LineInfoDO> lineMap = lines.stream().collect(Collectors.toMap(LineInfoDO::getId, line -> line));
|
||||
List<Long> shopIds = shopInfoDOS.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
@@ -427,7 +436,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfoDO.setInvestmentManager(lineInfoDO.getInvestmentManager());
|
||||
shopInfoDO.setWantShopAreaId(lineInfoDO.getWantShopAreaId());
|
||||
}
|
||||
shopInfoDAO.batchUpdate(shopInfoDOS);
|
||||
//shopInfoDAO.batchUpdate(shopInfoDOS);
|
||||
log.info("------shopInfoDOS:{}------", JSONObject.toJSONString(shopInfoDOS));
|
||||
hasNext = shopInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,7 @@ import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||
import com.cool.store.request.xfsgFirstOrderListRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.xfsgFirstOderListResponse;
|
||||
import com.cool.store.service.AliyunService;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.PointService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.poi.ExcelUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.RegionPathNameVO;
|
||||
@@ -262,11 +259,16 @@ public class TestController {
|
||||
|
||||
@Resource
|
||||
PointService pointService;
|
||||
@Resource
|
||||
ShopService shopService;
|
||||
@GetMapping("/linePointToShopPoint")
|
||||
public ResponseResult linePointToShopPoint(@RequestParam("shopId")Long shopId){
|
||||
return ResponseResult.success(pointService.linePointToShopPoint(shopId));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/dataHandler")
|
||||
public ResponseResult dataHandler(@RequestParam("lineId")Long lineId){
|
||||
return ResponseResult.success(shopService.dataHandler(lineId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user