获取状态为完成的门店列表接口+记账本定时任务

This commit is contained in:
shuo.wang
2025-03-31 17:36:10 +08:00
parent 4e3eda6659
commit 00a57cc6e6
14 changed files with 98 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.*;
import com.cool.store.response.BranchShopDetailResponse;
import com.cool.store.response.BranchShopResponse;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.vo.shop.MiniShopPageVO;
import com.cool.store.vo.shop.ShopStageInfoVO;
import com.cool.store.vo.shop.StageShopCountVO;
@@ -103,4 +104,6 @@ public interface ShopService {
PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId);
Boolean dataHandler(Long shopId);
List<MiniShopsResponse> getShopListAndStatusIsOverByLineId(Long lineId);
}

View File

@@ -19,5 +19,5 @@ public interface TallyBookService {
List<TallyBookDTO> getTallyBookListByShopIdAndYear(Long shopId, Integer year);
Long initData(Date date, Long shopId, String partnerId);
Long initData( Long shopId, String partnerId);
}

View File

@@ -16,6 +16,7 @@ import com.cool.store.mapper.RegionMapper;
import com.cool.store.request.*;
import com.cool.store.response.BranchShopDetailResponse;
import com.cool.store.response.BranchShopResponse;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.service.*;
import com.cool.store.utils.NumberConverter;
import com.cool.store.utils.RandomEightCharCodeUtils;
@@ -522,5 +523,10 @@ public class ShopServiceImpl implements ShopService {
return Boolean.TRUE;
}
@Override
public List<MiniShopsResponse> getShopListAndStatusIsOverByLineId(Long lineId) {
return shopInfoDAO.getShopListAndStatusIsOverByLineId(lineId);
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.TallyBookDAO;
import com.cool.store.dto.TallyBookDTO;
import com.cool.store.entity.TallyBookDO;
@@ -8,6 +9,7 @@ import com.cool.store.enums.TallyBookStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.TallyBookRequest;
import com.cool.store.service.TallyBookService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -24,6 +26,7 @@ import java.util.stream.Collectors;
* @Version 1.0
* @注释:
*/
@Slf4j
@Service
public class TallyBookServiceImpl implements TallyBookService {
@@ -36,10 +39,12 @@ public class TallyBookServiceImpl implements TallyBookService {
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());
if (request.getId()==null){
tallyBookDO.setCreateUser(partnerId);
tallyBookDO.setCreateTime(new Date());
tallyBookDO.setPartnerId(partnerId);
return tallyBookDAO.insertSelective(tallyBookDO);
return tallyBookDAO.insertSelective(tallyBookDO);
}else{
tallyBookDO.setUpdateUser(partnerId);
tallyBookDO.setUpdateTime(new Date());
return tallyBookDAO.updateByPrimaryKeySelective(tallyBookDO);
}
}
@@ -60,7 +65,8 @@ public class TallyBookServiceImpl implements TallyBookService {
return result;
}
@Override
public Long initData(Date date,Long shopId, String partnerId){
public Long initData(Long shopId, String partnerId){
Date date = new Date();
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 获取年份
int year = localDate.getYear();
@@ -74,6 +80,7 @@ public class TallyBookServiceImpl implements TallyBookService {
tallyBookDO.setMonth(month);
tallyBookDO.setCreateTime(new Date());
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
log.info("initData记账本DO:{}", JSONObject.toJSONString(tallyBookDO));
if(CollectionUtils.isEmpty(list)){
return tallyBookDAO.insertSelective(tallyBookDO);
}