PC+mini铺位改造

This commit is contained in:
shuo.wang
2025-03-31 15:37:22 +08:00
parent ae381ea81a
commit 4e3eda6659
17 changed files with 601 additions and 392 deletions

View File

@@ -0,0 +1,29 @@
package com.cool.store.enums;
/**
* @Author: WangShuo
* @Date: 2025/03/31/10:58
* @Version 1.0
* @注释:
*/
public enum PointListType {
POINT_LIST_TYPE_1(1, "推荐铺位"),
POINT_LIST_TYPE_2(2, "我创建的"),
;
private Integer code;
private String desc;
PointListType(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@@ -3,8 +3,10 @@ package com.cool.store.dao;
import com.cool.store.entity.PointDetailInfoDO; import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.mapper.PointDetailInfoMapper; import com.cool.store.mapper.PointDetailInfoMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.Objects; import java.util.Objects;
/** /**
@@ -58,5 +60,11 @@ public class PointDetailInfoDAO {
return pointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId); return pointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
} }
public List<PointDetailInfoDO> getByPointIdList(List<Long> pointIdList) {
Example example = new Example(PointDetailInfoDO.class);
example.createCriteria().andIn("point_id", pointIdList);
return pointDetailInfoMapper.selectByExample(example);
}
} }

View File

@@ -6,9 +6,11 @@ import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO; import com.cool.store.entity.PointInfoDO;
import com.cool.store.mapper.PointInfoMapper; import com.cool.store.mapper.PointInfoMapper;
import com.cool.store.request.AllPointPageRequest; import com.cool.store.request.AllPointPageRequest;
import com.cool.store.request.MiniPointPageRequest;
import com.cool.store.request.PointPageRequest; import com.cool.store.request.PointPageRequest;
import com.cool.store.request.RecommendPointPageRequest; import com.cool.store.request.RecommendPointPageRequest;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
import com.cool.store.vo.point.MiniPointPageVO;
import com.cool.store.vo.point.PointHomePageDataVO; import com.cool.store.vo.point.PointHomePageDataVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@@ -117,4 +119,13 @@ public class PointInfoDAO {
} }
return pointInfoMapper.recyclePoint(pointId); return pointInfoMapper.recyclePoint(pointId);
} }
public List<MiniPointPageVO> getMiniPointPage(Long lineId ) {
List<MiniPointPageVO> pointInfoDOPage = pointInfoMapper.MiniPointPageVO(lineId);
if(CollectionUtils.isEmpty(pointInfoDOPage)){
return Lists.newArrayList();
}
return pointInfoDOPage ;
}
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.entity.PointInfoDO;
import com.cool.store.request.AllPointPageRequest; import com.cool.store.request.AllPointPageRequest;
import com.cool.store.request.PointPageRequest; import com.cool.store.request.PointPageRequest;
import com.cool.store.request.RecommendPointPageRequest; import com.cool.store.request.RecommendPointPageRequest;
import com.cool.store.vo.point.MiniPointPageVO;
import com.cool.store.vo.point.PointHomePageDataVO; import com.cool.store.vo.point.PointHomePageDataVO;
import com.cool.store.vo.point.PointPageVO; import com.cool.store.vo.point.PointPageVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
@@ -88,4 +89,11 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
* @return * @return
*/ */
Integer perfectPointInfo(@Param("request") PointInfoDO request); Integer perfectPointInfo(@Param("request") PointInfoDO request);
/**
* @Auther: wangshuo
* @Date: 2025/3/31
* @description:获取铺位部分数据
*/
List<MiniPointPageVO> MiniPointPageVO(@Param("lineId") Long lineId);
} }

View File

@@ -30,12 +30,15 @@
<result column="storage_status" jdbcType="TINYINT" property="storageStatus"/> <result column="storage_status" jdbcType="TINYINT" property="storageStatus"/>
<result column="opportunity_point_code" jdbcType="VARCHAR" property="opportunityPointCode"/> <result column="opportunity_point_code" jdbcType="VARCHAR" property="opportunityPointCode"/>
<result column="opportunity_point_name" jdbcType="VARCHAR" property="opportunityPointName"/> <result column="opportunity_point_name" jdbcType="VARCHAR" property="opportunityPointName"/>
<result column="open_shop_name" jdbcType="VARCHAR" property="openShopName"/>
</resultMap> </resultMap>
<sql id="allColumn"> <sql id="allColumn">
id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address, development_manager, operate_user_id, id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address,
development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted, create_time, update_time, development_manager, operate_user_id,
province, city, district, township development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted,
create_time, update_time,
province, city, district, township, opportunity_point_code, opportunity_point_name,open_shop_name
</sql> </sql>
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO"> <select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
@@ -64,11 +67,15 @@
development_time, development_time,
select_status, select_status,
create_time, create_time,
update_time update_time,
open_shop_name,
opportunity_point_code,
opportunity_point_name
from xfsg_point_info from xfsg_point_info
where deleted = 0 and development_manager = #{request.developmentManager} where deleted = 0 and development_manager = #{request.developmentManager}
<if test="request.keyword != null and request.keyword != ''"> <if test="request.keyword != null and request.keyword != ''">
and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword}, '%')) and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword},
'%'))
</if> </if>
<if test="request.developmentStartTime != null and request.developmentStartTime != ''"> <if test="request.developmentStartTime != null and request.developmentStartTime != ''">
and development_time >= #{request.developmentStartTime} and development_time >= #{request.developmentStartTime}
@@ -126,7 +133,8 @@
select select
<include refid="allColumn"/> <include refid="allColumn"/>
from xfsg_point_info from xfsg_point_info
where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager} and select_status = 0 where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager} and
select_status = 0
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0"> <if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
and point_status in and point_status in
<foreach collection="request.pointStatusList" item="pointStatus" separator="," open="(" close=")"> <foreach collection="request.pointStatusList" item="pointStatus" separator="," open="(" close=")">
@@ -159,12 +167,16 @@
development_time, development_time,
select_status, select_status,
create_time, create_time,
update_time update_time,
open_shop_name,
opportunity_point_code,
opportunity_point_name
from from
xfsg_point_info xfsg_point_info
where deleted = 0 and point_status in (4,5,6,7) where deleted = 0 and point_status in (4,5,6,7)
<if test="request.keyword != null and request.keyword != ''"> <if test="request.keyword != null and request.keyword != ''">
and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword}, '%')) and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword},
'%'))
</if> </if>
<if test="request.developmentManager != null and request.developmentManager != ''"> <if test="request.developmentManager != null and request.developmentManager != ''">
and development_manager = #{request.developmentManager} and development_manager = #{request.developmentManager}
@@ -190,6 +202,9 @@
#{regionId} #{regionId}
</foreach> </foreach>
</if> </if>
<if test="request.storageStatus != null ">
and storage_status = #{request.storageStatus}
</if>
order by id desc order by id desc
</select> </select>
<select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO"> <select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO">
@@ -200,9 +215,28 @@
AND line_id = #{lineId} AND line_id = #{lineId}
AND deleted = 0 AND deleted = 0
</select> </select>
<select id="MiniPointPageVO" resultType="com.cool.store.vo.point.MiniPointPageVO">
select a.id as pointId,
a.point_name as pointName,
a.point_code as pointCode,
a.longitude as longitude,
a.latitude as latitude,
a.address as address,
a.create_time as createTime,
a.opportunity_point_code as opportunityPointCode,
a.opportunity_point_name as opportunityPointName,
a.picture_obj as pictureObj,
a.point_area as pointArea,
b.landlord_mobile as landlordMobile,
b.month_rent as monthRent,
from xfsg_point_info a
left join xfsg_point_recommend b on a.id = b.point_id
where a.line_id = #{lineId} and a.point_source = 2
</select>
<update id="recyclePoint"> <update id="recyclePoint">
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status = if(point_status = 6, 5, point_status) where id = #{pointId} update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status
= if(point_status = 6, 5, point_status) where id = #{pointId}
</update> </update>
<update id="perfectPointInfo"> <update id="perfectPointInfo">

View File

@@ -116,11 +116,17 @@
p.point_name as pointName, p.point_name as pointName,
p.point_code as pointCode, p.point_code as pointCode,
p.region_id as regionId, p.region_id as regionId,
p.longitude as longitude,
p.latitude as latitude,
p.address as address, p.address as address,
p.point_score as pointScore, p.point_score as pointScore,
p.point_area as pointArea, p.point_area as pointArea,
p.point_status as pointStatus, p.point_status as pointStatus,
p.select_status as selectStatus, p.select_status as selectStatus,
p.create_time as createTime,
p.opportunity_point_code as opportunityPointCode,
p.opportunity_point_name as opportunityPointName,
p.picture_obj as pictureObj,
pr.status as recommendStatus pr.status as recommendStatus
from from
xfsg_point_recommend pr xfsg_point_recommend pr

View File

@@ -160,4 +160,7 @@ public class PointInfoDO {
@Column(name = "opportunity_point_name") @Column(name = "opportunity_point_name")
private String opportunityPointName; private String opportunityPointName;
@Column(name = "open_shop_name")
private String openShopName;
} }

View File

@@ -43,4 +43,6 @@ public class AllPointPageRequest extends PageBasicInfo {
@ApiModelProperty(value = "管辖区域",hidden = true) @ApiModelProperty(value = "管辖区域",hidden = true)
private List<String> authRegionIds; private List<String> authRegionIds;
@ApiModelProperty(value = "是否入库1已入库 2暂未入库")
private Integer storageStatus;
} }

View File

@@ -6,6 +6,7 @@ import lombok.Data;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -24,4 +25,11 @@ public class MiniPointPageRequest extends PageBasicInfo {
@ApiModelProperty(value = "门店线索ID") @ApiModelProperty(value = "门店线索ID")
private Long shopId; private Long shopId;
@ApiModelProperty(value = "1-推荐铺位,2-我创建的")
@NotNull
private Integer type;
private Long lineId;
private String partnerId;
} }

View File

@@ -11,6 +11,7 @@ import lombok.Data;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -41,6 +42,30 @@ public class MiniPointPageVO {
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效") @ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
private Integer recommendStatus; private Integer recommendStatus;
@ApiModelProperty("租金")
private String monthRent;
@ApiModelProperty("房东电话")
private String landlordMobile;
@ApiModelProperty("录入时间")
private Date createTime;
@ApiModelProperty("机会点编号")
private String opportunityPointCode;
@ApiModelProperty("机会点名称")
private String opportunityPointName;
@ApiModelProperty("图片/视频附件")
private String pictureObj;
@ApiModelProperty("经度")
private String longitude;
@ApiModelProperty("纬度")
private String latitude;
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) { public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) {
if(CollectionUtils.isEmpty(pointList)){ if(CollectionUtils.isEmpty(pointList)){
return Lists.newArrayList(); return Lists.newArrayList();

View File

@@ -260,6 +260,14 @@ public class PointDetailVO {
@ApiModelProperty("是否可以上传租赁合同") @ApiModelProperty("是否可以上传租赁合同")
private boolean canSubmitRentContract; private boolean canSubmitRentContract;
@ApiModelProperty("成功开店")
private String openShopName;
@ApiModelProperty("所属机会点编码")
private String opportunityPointCode;
@ApiModelProperty("所属机会点名称")
private String opportunityPointName;
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) { public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
PointDetailVO result = new PointDetailVO(); PointDetailVO result = new PointDetailVO();
@@ -344,6 +352,9 @@ public class PointDetailVO {
result.setCity(pointInfo.getCity()); result.setCity(pointInfo.getCity());
result.setDistrict(pointInfo.getDistrict()); result.setDistrict(pointInfo.getDistrict());
result.setTownship(pointInfo.getTownship()); result.setTownship(pointInfo.getTownship());
result.setOpenShopName(pointInfo.getOpenShopName());
result.setOpportunityPointCode(pointInfo.getOpportunityPointCode());
result.setOpportunityPointName(pointInfo.getOpportunityPointName());
return result; return result;
} }

View File

@@ -57,6 +57,13 @@ public class PointPageVO {
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("成功开店")
private String openShopName;
@ApiModelProperty("所属机会点编码")
private String opportunityPointCode;
@ApiModelProperty("所属机会点名称")
private String opportunityPointName;
public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) { public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {

View File

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

View File

@@ -22,6 +22,7 @@ import com.cool.store.vo.point.*;
import com.cool.store.vo.shop.RentInfoToDoVO; import com.cool.store.vo.shop.RentInfoToDoVO;
import com.cool.store.vo.shop.ShopPointBaseInfoVO; import com.cool.store.vo.shop.ShopPointBaseInfoVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -726,17 +727,33 @@ public class PointServiceImpl implements PointService {
@Override @Override
public PageInfo<MiniPointPageVO> getLineRecommendPointPage(MiniPointPageRequest request) { public PageInfo<MiniPointPageVO> getLineRecommendPointPage(MiniPointPageRequest request) {
if (Objects.equals(request.getType(), PointListType.POINT_LIST_TYPE_1.getCode())) {
Page<MiniPointPageDTO> pointPage = pointRecommendDAO.getLineRecommendPointPage(request); Page<MiniPointPageDTO> pointPage = pointRecommendDAO.getLineRecommendPointPage(request);
List<MiniPointPageVO> resultList = new ArrayList<>(); List<MiniPointPageVO> resultList = new ArrayList<>();
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) { if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
List<Long> regionIds = pointPage.getResult().stream().map(MiniPointPageDTO::getRegionId).distinct().collect(Collectors.toList()); List<Long> regionIds = pointPage.getResult().stream().map(MiniPointPageDTO::getRegionId).distinct().collect(Collectors.toList());
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds); Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap); resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap);
List<Long> pointList = pointPage.getResult().stream().map(MiniPointPageDTO::getPointId).distinct().collect(Collectors.toList());
List<PointDetailInfoDO> pointDetailList = pointDetailInfoDAO.getByPointIdList(pointList);
Map<Long, PointDetailInfoDO> map = pointDetailList.stream().collect(Collectors.toMap(PointDetailInfoDO::getPointId, Function.identity()));
resultList.forEach(x -> {
PointDetailInfoDO pointDetailInfoDO = map.getOrDefault(x.getPointId(),new PointDetailInfoDO());
x.setMonthRent(pointDetailInfoDO.getMonthRent());
x.setLandlordMobile(pointDetailInfoDO.getLandlordMobile());
});
} }
PageInfo resultPage = new PageInfo(pointPage); PageInfo resultPage = new PageInfo(pointPage);
resultPage.setList(resultList); resultPage.setList(resultList);
return resultPage; return resultPage;
} }
if (request.getType().equals(PointListType.POINT_LIST_TYPE_2.getCode())){
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<MiniPointPageVO> miniPointPage = pointInfoDAO.getMiniPointPage(request.getLineId());
return new PageInfo<>(miniPointPage);
}
return new PageInfo<>();
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -811,6 +828,7 @@ public class PointServiceImpl implements PointService {
redisUtilPool.delKey(lockKey); redisUtilPool.delKey(lockKey);
} }
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Integer lineRejectPoint(RejectPointRequest request) { public Integer lineRejectPoint(RejectPointRequest request) {
@@ -843,6 +861,8 @@ public class PointServiceImpl implements PointService {
pointInfo.setDevelopmentTime(new Date()); pointInfo.setDevelopmentTime(new Date());
pointInfo.setPointSource(PointSourceEnum.POINT_SOURCE_2.getCode()); pointInfo.setPointSource(PointSourceEnum.POINT_SOURCE_2.getCode());
pointInfo.setPointCode(generateCode()); pointInfo.setPointCode(generateCode());
pointInfo.setOpportunityPointName(request.getOpportunityPointName());
pointInfo.setOpportunityPointCode(request.getOpportunityPointCode());
Long pointId = pointInfoDAO.addPointInfo(pointInfo); Long pointId = pointInfoDAO.addPointInfo(pointInfo);
pointDetailInfo.setPointId(pointId); pointDetailInfo.setPointId(pointId);
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo); pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);

View File

@@ -33,10 +33,10 @@ public class TallyBookServiceImpl implements TallyBookService {
@Override @Override
public Long insertOrUpdateSelective(TallyBookRequest request, String partnerId) { public Long insertOrUpdateSelective(TallyBookRequest request, String partnerId) {
TallyBookDO tallyBookDO = request.toTallyBookDO(); TallyBookDO tallyBookDO = request.toTallyBookDO();
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());
if (request.getId()==null){ if (request.getId()==null){
tallyBookDO.setCreateUser(partnerId); tallyBookDO.setCreateUser(partnerId);
tallyBookDO.setPartnerId(partnerId); tallyBookDO.setPartnerId(partnerId);
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());
return tallyBookDAO.insertSelective(tallyBookDO); return tallyBookDAO.insertSelective(tallyBookDO);
}else{ }else{
tallyBookDO.setUpdateUser(partnerId); tallyBookDO.setUpdateUser(partnerId);
@@ -59,15 +59,14 @@ public class TallyBookServiceImpl implements TallyBookService {
} }
return result; return result;
} }
@Override
public TallyBookDO initData(Date date,Long shopId, String partnerId){ public Long initData(Date date,Long shopId, String partnerId){
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 获取年份 // 获取年份
int year = localDate.getYear(); int year = localDate.getYear();
// 获取月份 // 获取月份
int month = localDate.getMonthValue(); int month = localDate.getMonthValue();
List<TallyBookDO> list = tallyBookDAO.getTallyBookListByShopIdAndYear(shopId,year); List<TallyBookDO> list = tallyBookDAO.getTallyBookListByShopIdAndYear(shopId,year);
if(CollectionUtils.isEmpty(list)){
TallyBookDO tallyBookDO = new TallyBookDO(); TallyBookDO tallyBookDO = new TallyBookDO();
tallyBookDO.setShopId(shopId); tallyBookDO.setShopId(shopId);
tallyBookDO.setPartnerId(partnerId); tallyBookDO.setPartnerId(partnerId);
@@ -75,18 +74,12 @@ public class TallyBookServiceImpl implements TallyBookService {
tallyBookDO.setMonth(month); tallyBookDO.setMonth(month);
tallyBookDO.setCreateTime(new Date()); tallyBookDO.setCreateTime(new Date());
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode()); tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
return tallyBookDO; if(CollectionUtils.isEmpty(list)){
return tallyBookDAO.insertSelective(tallyBookDO);
} }
List<Integer> monthList = list.stream().map(TallyBookDO::getMonth).collect(Collectors.toList()); List<Integer> monthList = list.stream().map(TallyBookDO::getMonth).collect(Collectors.toList());
if (!monthList.contains(month)){ if (!monthList.contains(month)){
TallyBookDO tallyBookDO = new TallyBookDO(); return tallyBookDAO.insertSelective(tallyBookDO);
tallyBookDO.setShopId(shopId);
tallyBookDO.setPartnerId(partnerId);
tallyBookDO.setYear(year);
tallyBookDO.setMonth(month);
tallyBookDO.setCreateTime(new Date());
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
return tallyBookDO;
} }
return null; return null;
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.request.*;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.PointService; import com.cool.store.service.PointService;
import com.cool.store.service.ShopService; import com.cool.store.service.ShopService;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.point.MiniPointPageVO; import com.cool.store.vo.point.MiniPointPageVO;
import com.cool.store.vo.point.PointDetailVO; import com.cool.store.vo.point.PointDetailVO;
import com.cool.store.vo.point.ShopRentInfoVO; import com.cool.store.vo.point.ShopRentInfoVO;
@@ -59,6 +60,9 @@ public class MiniShopController {
@ApiOperation("获取推荐给我的铺位") @ApiOperation("获取推荐给我的铺位")
@PostMapping("/getLineRecommendPointPage") @PostMapping("/getLineRecommendPointPage")
public ResponseResult<PageInfo<MiniPointPageVO>> getLineRecommendPointPage(@RequestBody MiniPointPageRequest request) { public ResponseResult<PageInfo<MiniPointPageVO>> getLineRecommendPointPage(@RequestBody MiniPointPageRequest request) {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
request.setPartnerId(user.getPartnerId());
request.setLineId(user.getLineId());
return ResponseResult.success(pointService.getLineRecommendPointPage(request)); return ResponseResult.success(pointService.getLineRecommendPointPage(request));
} }

View File

@@ -0,0 +1,40 @@
package com.cool.store.controller.webc;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.TallyBookDTO;
import com.cool.store.request.TallyBookRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.TallyBookService;
import com.cool.store.vo.PartnerUserInfoVO;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author: WangShuo
* @Date: 2025/03/31/14:23
* @Version 1.0
* @注释:
*/
@RestController
@Api("mini记账本")
@RequestMapping("/mini/tallyBook")
public class TallyBookController {
@Resource
private TallyBookService tallyBookService;
@PostMapping("/insertOrUpdate")
public ResponseResult insertOrUpdateSelective(@RequestBody @Validated TallyBookRequest request) {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(tallyBookService.insertOrUpdateSelective(request, user.getPartnerId()));
}
@GetMapping("/getTallyBookListByShopIdAndYear")
public ResponseResult<List<TallyBookDTO>> getTallyBookListByShopIdAndYear(@RequestParam("shopId") Long shopId, @RequestParam("year") Integer year) {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(tallyBookService.getTallyBookListByShopIdAndYear(shopId,year));
}
}