获取状态为完成的门店列表接口+记账本定时任务
This commit is contained in:
@@ -2,6 +2,7 @@ package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PointService;
|
||||
import com.cool.store.service.ShopService;
|
||||
@@ -115,6 +116,10 @@ public class MiniShopController {
|
||||
request.setCurLineId(lineId);
|
||||
return ResponseResult.success(pointService.updateRentContract(request));
|
||||
}
|
||||
|
||||
@ApiOperation("获取状态为完成的门店列表")
|
||||
@GetMapping("/getStatusOver")
|
||||
public ResponseResult<List<MiniShopsResponse>> getShopListAndStatusIsOverByLineId(@RequestParam("lineId")Long lineId) {
|
||||
return ResponseResult.success(shopService.getShopListAndStatusIsOverByLineId(lineId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.TallyBookService;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -27,12 +29,14 @@ public class TallyBookController {
|
||||
private TallyBookService tallyBookService;
|
||||
|
||||
@PostMapping("/insertOrUpdate")
|
||||
@ApiOperation(value = "新增或修改记账本")
|
||||
public ResponseResult insertOrUpdateSelective(@RequestBody @Validated TallyBookRequest request) {
|
||||
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(tallyBookService.insertOrUpdateSelective(request, user.getPartnerId()));
|
||||
}
|
||||
|
||||
@GetMapping("/getTallyBookListByShopIdAndYear")
|
||||
@ApiOperation(value = "根据店铺id和年份查询记账本")
|
||||
public ResponseResult<List<TallyBookDTO>> getTallyBookListByShopIdAndYear(@RequestParam("shopId") Long shopId, @RequestParam("year") Integer year) {
|
||||
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(tallyBookService.getTallyBookListByShopIdAndYear(shopId,year));
|
||||
|
||||
@@ -271,4 +271,8 @@ public class TestController {
|
||||
return ResponseResult.success(shopService.dataHandler(lineId));
|
||||
}
|
||||
|
||||
@GetMapping("/initTallyBook")
|
||||
public void initTallyBook(){
|
||||
xxlJobHandler.initTallyBook();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -98,7 +99,8 @@ public class XxlJobHandler {
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Resource
|
||||
ApplyLicenseMapper applyLicenseMapper;
|
||||
|
||||
@Resource
|
||||
private TallyBookService tallyBookService;
|
||||
|
||||
|
||||
|
||||
@@ -314,7 +316,23 @@ public class XxlJobHandler {
|
||||
int pageSize = 10;
|
||||
List<Long> shopIdList = new ArrayList<>();
|
||||
while (hasNext) {
|
||||
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopIdByShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
if (CollectionUtils.isEmpty(shopList)) {
|
||||
log.info("------initTallyBook is empty------");
|
||||
break;
|
||||
}
|
||||
for (ShopInfoDO shopInfoDO : shopList){
|
||||
try {
|
||||
tallyBookService.initData( shopInfoDO.getId(), shopInfoDO.getPartnerId());
|
||||
}catch (Exception e){
|
||||
log.info("生成记账本数据出错:shopId:{},Exception:{}",shopInfoDO.getId(),e.getMessage());
|
||||
}
|
||||
}
|
||||
if (shopList.size() < pageSize){
|
||||
hasNext = false;
|
||||
}
|
||||
pageNum++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user