This commit is contained in:
zhangchenbiao
2024-04-02 11:43:52 +08:00
parent aca8aebd54
commit b239dac239
20 changed files with 156 additions and 157 deletions

View File

@@ -1,7 +1,7 @@
package com.cool.store.dao;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.mapper.ShopPointDetailInfoMapper;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.mapper.PointDetailInfoMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -14,18 +14,18 @@ import java.util.Objects;
* @date 2024-03-29 10:15
*/
@Repository
public class ShopPointDetailInfoDAO {
public class PointDetailInfoDAO {
@Resource
private ShopPointDetailInfoMapper shopPointDetailInfoMapper;
private PointDetailInfoMapper pointDetailInfoMapper;
/**
* 新增点位详情
* @param shopPointDetailInfo
* @return
*/
public Long addShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) {
shopPointDetailInfoMapper.insertSelective(shopPointDetailInfo);
public Long addPointDetailInfo(PointDetailInfoDO shopPointDetailInfo) {
pointDetailInfoMapper.insertSelective(shopPointDetailInfo);
return shopPointDetailInfo.getId();
}
@@ -34,20 +34,20 @@ public class ShopPointDetailInfoDAO {
* @param shopPointDetailInfo
* @return
*/
public Integer updateShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) {
public Integer updatePointDetailInfo(PointDetailInfoDO shopPointDetailInfo) {
if(Objects.isNull(shopPointDetailInfo.getId()) && Objects.nonNull(shopPointDetailInfo.getPointId())){
Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId());
shopPointDetailInfo.setId(pointDetailId);
}
return shopPointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo);
return pointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo);
}
public Long getPointDetailIdByPointId(Long pointId){
return shopPointDetailInfoMapper.getPointDetailIdByPointId(pointId);
return pointDetailInfoMapper.getPointDetailIdByPointId(pointId);
}
public ShopPointDetailInfoDO getShopPointDetailInfoByPointId(Long pointId) {
return shopPointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
public PointDetailInfoDO getPointDetailInfoByPointId(Long pointId) {
return pointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
}

View File

@@ -0,0 +1,38 @@
package com.cool.store.dao;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.mapper.PointInfoMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: ShopPointInfoDAO
* @Description:
* @date 2024-03-29 10:15
*/
@Repository
public class PointInfoDAO {
@Resource
private PointInfoMapper pointInfoMapper;
public PointInfoDO getPointInfoById(Long id) {
PointInfoDO shopPointInfo = pointInfoMapper.selectByPrimaryKey(id);
if(Objects.isNull(shopPointInfo) || shopPointInfo.getDeleted()){
return null;
}
return shopPointInfo;
}
public Long addPointInfo(PointInfoDO shopPointInfo) {
pointInfoMapper.insertSelective(shopPointInfo);
return shopPointInfo.getId();
}
public Integer updatePointInfo(PointInfoDO shopPointInfo) {
return pointInfoMapper.updateByPrimaryKeySelective(shopPointInfo);
}
}

View File

@@ -1,7 +1,7 @@
package com.cool.store.dao;
import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.mapper.ShopPointRecommendMapper;
import com.cool.store.mapper.PointRecommendMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
@@ -17,16 +17,16 @@ import java.util.stream.Collectors;
* @date 2024-04-01 14:36
*/
@Repository
public class ShopPointRecommendDAO {
public class PointRecommendDAO {
@Resource
private ShopPointRecommendMapper shopPointRecommendMapper;
private PointRecommendMapper pointRecommendMapper;
public Integer updateRecommendStatus(Long pointId, PointRecommendStatus status) {
if(Objects.isNull(status)){
return 0;
}
return shopPointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode());
return pointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode());
}
public Integer updateRecommendStatusByStatusAndPointId(Long pointId, PointRecommendStatus status, List<PointRecommendStatus> statusList) {
@@ -34,7 +34,7 @@ public class ShopPointRecommendDAO {
return 0;
}
List<Integer> statusCodeList = statusList.stream().map(PointRecommendStatus::getCode).collect(Collectors.toList());
return shopPointRecommendMapper.updateRecommendStatusByStatusAndPointId(pointId, status.getCode(), statusCodeList);
return pointRecommendMapper.updateRecommendStatusByStatusAndPointId(pointId, status.getCode(), statusCodeList);
}
}

View File

@@ -1,38 +0,0 @@
package com.cool.store.dao;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.mapper.ShopPointInfoMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: ShopPointInfoDAO
* @Description:
* @date 2024-03-29 10:15
*/
@Repository
public class ShopPointInfoDAO {
@Resource
private ShopPointInfoMapper shopPointInfoMapper;
public ShopPointInfoDO getShopPointInfoById(Long id) {
ShopPointInfoDO shopPointInfo = shopPointInfoMapper.selectByPrimaryKey(id);
if(Objects.isNull(shopPointInfo) || shopPointInfo.getDeleted()){
return null;
}
return shopPointInfo;
}
public Long addShopPointInfo(ShopPointInfoDO shopPointInfo) {
shopPointInfoMapper.insertSelective(shopPointInfo);
return shopPointInfo.getId();
}
public Integer updatePointInfo(ShopPointInfoDO shopPointInfo) {
return shopPointInfoMapper.updateByPrimaryKeySelective(shopPointInfo);
}
}

View File

@@ -1,10 +1,10 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO> {
public interface PointDetailInfoMapper extends Mapper<PointDetailInfoDO> {
/**
* 获取详情id
@@ -18,5 +18,5 @@ public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO>
* @param pointId
* @return
*/
ShopPointDetailInfoDO getShopPointDetailInfoByPointId(@Param("pointId") Long pointId);
PointDetailInfoDO getShopPointDetailInfoByPointId(@Param("pointId") Long pointId);
}

View File

@@ -0,0 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.entity.PointInfoDO;
import tk.mybatis.mapper.common.Mapper;
public interface PointInfoMapper extends Mapper<PointInfoDO> {
}

View File

@@ -1,12 +1,12 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopPointRecommendDO;
import com.cool.store.entity.PointRecommendDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ShopPointRecommendMapper extends Mapper<ShopPointRecommendDO> {
public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
/**
* 更新铺位推荐状态

View File

@@ -1,7 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopPointInfoDO;
import tk.mybatis.mapper.common.Mapper;
public interface ShopPointInfoMapper extends Mapper<ShopPointInfoDO> {
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.ShopPointDetailInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointDetailInfoDO">
<mapper namespace="com.cool.store.mapper.PointDetailInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointDetailInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" />
@@ -71,10 +71,10 @@
<result column="picture_obj" jdbcType="LONGVARCHAR" property="pictureObj" />
</resultMap>
<select id="getPointDetailIdByPointId" resultType="java.lang.Long">
select id from xfsg_shop_point_detail_info where point_id = #{pointId}
select id from xfsg_point_detail_info where point_id = #{pointId}
</select>
<select id="getShopPointDetailInfoByPointId" resultMap="BaseResultMap">
select * from xfsg_shop_point_detail_info where point_id = #{pointId} and deleted = 0
select * from xfsg_point_detail_info where point_id = #{pointId} and deleted = 0
</select>
</mapper>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.ShopPointInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointInfoDO">
<mapper namespace="com.cool.store.mapper.PointInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="point_code" jdbcType="VARCHAR" property="pointCode" />
<result column="point_name" jdbcType="VARCHAR" property="pointName" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.ShopPointRecommendMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointRecommendDO">
<mapper namespace="com.cool.store.mapper.PointRecommendMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
@@ -13,11 +13,11 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<update id="updateShopPointRecommendStatus">
update xfsg_shop_point_recommend set status = #{status} where point_id = #{pointId}
update xfsg_point_recommend set status = #{status} where point_id = #{pointId}
</update>
<update id="updateRecommendStatusByStatusAndPointId">
update xfsg_shop_point_recommend set status = #{status} where point_id = #{pointId} and status in
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and status in
<foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
#{status}
</foreach>

View File

@@ -9,8 +9,8 @@ import java.util.Objects;
import javax.persistence.*;
@Data
@Table(name = "xfsg_shop_point_detail_info")
public class ShopPointDetailInfoDO {
@Table(name = "xfsg_point_detail_info")
public class PointDetailInfoDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

View File

@@ -6,8 +6,8 @@ import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "xfsg_shop_point_info")
public class ShopPointInfoDO {
@Table(name = "xfsg_point_info")
public class PointInfoDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

View File

@@ -6,8 +6,8 @@ import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "xfsg_shop_point_recommend")
public class ShopPointRecommendDO {
@Table(name = "xfsg_point_recommend")
public class PointRecommendDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

View File

@@ -1,7 +1,7 @@
package com.cool.store.request;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -9,7 +9,7 @@ import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
@Data
public class AddShopPointDetailRequest {
public class AddPointDetailRequest {
@ApiModelProperty("铺位名称")
private String pointName;
@@ -222,8 +222,8 @@ public class AddShopPointDetailRequest {
private String pictureObj;
public static ShopPointDetailInfoDO convertDO(AddShopPointDetailRequest request) {
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO();
public static PointDetailInfoDO convertDO(AddPointDetailRequest request) {
PointDetailInfoDO result = new PointDetailInfoDO();
result.setBussinessStatus(request.getBussinessStatus());
result.setNineFlowRate(request.getNineFlowRate());
result.setTenFlowRate(request.getTenFlowRate());
@@ -277,8 +277,8 @@ public class AddShopPointDetailRequest {
return result;
}
public static ShopPointInfoDO convertPointDO(AddShopPointDetailRequest request) {
ShopPointInfoDO result = new ShopPointInfoDO();
public static PointInfoDO convertPointDO(AddPointDetailRequest request) {
PointInfoDO result = new PointInfoDO();
result.setPointName(request.getPointName());
result.setRegionId(request.getRegionId());
result.setPointArea(request.getPointArea());

View File

@@ -1,15 +1,14 @@
package com.cool.store.request;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
public class UpdatePointDetailRequest extends AddPointDetailRequest {
@NotNull
@ApiModelProperty("点位id")
@@ -17,8 +16,8 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
public static ShopPointDetailInfoDO convertDO(UpdateShopPointDetailRequest request) {
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO();
public static PointDetailInfoDO convertDO(UpdatePointDetailRequest request) {
PointDetailInfoDO result = new PointDetailInfoDO();
result.setPointId(request.getPointId());
result.setBussinessStatus(request.getBussinessStatus());
result.setNineFlowRate(request.getNineFlowRate());
@@ -73,8 +72,8 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
return result;
}
public static ShopPointInfoDO convertPointDO(UpdateShopPointDetailRequest request) {
ShopPointInfoDO result = new ShopPointInfoDO();
public static PointInfoDO convertPointDO(UpdatePointDetailRequest request) {
PointInfoDO result = new PointInfoDO();
result.setId(request.getPointId());
result.setPointName(request.getPointName());
result.setRegionId(request.getRegionId());

View File

@@ -1,14 +1,14 @@
package com.cool.store.vo.point;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class ShopPointDetailVO {
public class PointDetailVO {
@ApiModelProperty("店铺id")
private Long pointId;
@@ -227,8 +227,8 @@ public class ShopPointDetailVO {
private String pictureObj;
public static ShopPointDetailVO convertVO(ShopPointInfoDO pointInfo, ShopPointDetailInfoDO pointDetailInfo) {
ShopPointDetailVO result = new ShopPointDetailVO();
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
PointDetailVO result = new PointDetailVO();
result.setPointId(pointInfo.getId());
result.setPointName(pointInfo.getPointName());
result.setPointCode(pointInfo.getPointCode());

View File

@@ -1,9 +1,9 @@
package com.cool.store.service;
import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.vo.point.ShopPointDetailVO;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.vo.point.PointDetailVO;
/**
* @author zhangchenbiao
@@ -19,7 +19,7 @@ public interface ShopPointService {
* @param userId
* @return
*/
Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId);
Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId);
/**
@@ -27,14 +27,14 @@ public interface ShopPointService {
* @param pointId
* @return
*/
ShopPointDetailVO getShopPointDetailInfo(Long pointId);
PointDetailVO getPointDetailInfo(Long pointId);
/**
* 更新铺位
* @param shopPointDetailRequest
* @return
*/
Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest);
Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
/**
* 生成铺位评估报告

View File

@@ -1,18 +1,18 @@
package com.cool.store.service.impl;
import com.cool.store.dao.*;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.enums.point.PointStatusEnum;
import com.cool.store.enums.point.SelectStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.service.ShopPointService;
import com.cool.store.vo.point.ShopPointDetailVO;
import com.cool.store.vo.point.PointDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -36,54 +36,54 @@ public class ShopPointServiceImpl implements ShopPointService {
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private ShopPointInfoDAO shopPointInfoDAO;
private PointInfoDAO pointInfoDAO;
@Resource
private ShopPointDetailInfoDAO shopPointDetailInfoDAO;
private PointDetailInfoDAO pointDetailInfoDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
private ShopPointRecommendDAO shopPointRecommendDAO;
private PointRecommendDAO pointRecommendDAO;
@Override
public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) {
ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) {
PointInfoDO shopPointInfo = AddPointDetailRequest.convertPointDO(shopPointDetailRequest);
shopPointInfo.setPointCode(generateCode());
shopPointInfo.setDevelopmentManager(userId);
shopPointInfo.setDevelopmentTime(new Date());
Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo);
ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest);
Long pointId = pointInfoDAO.addPointInfo(shopPointInfo);
PointDetailInfoDO shopPoint = AddPointDetailRequest.convertDO(shopPointDetailRequest);
shopPoint.setPointId(pointId);
return shopPointDetailInfoDAO.addShopPointDetailInfo(shopPoint);
return pointDetailInfoDAO.addPointDetailInfo(shopPoint);
}
@Override
public ShopPointDetailVO getShopPointDetailInfo(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
public PointDetailVO getPointDetailInfo(Long pointId) {
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointDetailInfo)){
log.error("铺位详情信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
return ShopPointDetailVO.convertVO(pointInfo, pointDetailInfo);
return PointDetailVO.convertVO(pointInfo, pointDetailInfo);
}
@Override
public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) {
ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest);
public Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
PointInfoDO shopPointInfo = UpdatePointDetailRequest.convertPointDO(shopPointDetailRequest);
PointDetailInfoDO shopPoint = UpdatePointDetailRequest.convertDO(shopPointDetailRequest);
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
shopPointInfoDAO.updatePointInfo(shopPointInfo);
return shopPointDetailInfoDAO.updateShopPointDetailInfo(shopPoint);
pointInfoDAO.updatePointInfo(shopPointInfo);
return pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
}
@Override
public Integer generateEvaluationReport(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
@@ -91,17 +91,17 @@ public class ShopPointServiceImpl implements ShopPointService {
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
}
Integer totalPointScore = pointDetailInfo.getTotalPointScore();
ShopPointInfoDO updatePointInfo = new ShopPointInfoDO();
PointInfoDO updatePointInfo = new PointInfoDO();
updatePointInfo.setId(pointId);
updatePointInfo.setPointScore(totalPointScore);
updatePointInfo.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
shopPointInfoDAO.updatePointInfo(updatePointInfo);
pointInfoDAO.updatePointInfo(updatePointInfo);
return totalPointScore;
}
@Override
public Integer pointInvalid(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -109,16 +109,16 @@ public class ShopPointServiceImpl implements ShopPointService {
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
shopPointInfoDAO.updatePointInfo(updatePoint);
return shopPointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
pointInfoDAO.updatePointInfo(updatePoint);
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
}
@Override
public Integer pointUnbind(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -126,30 +126,30 @@ public class ShopPointServiceImpl implements ShopPointService {
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setSelectStatus(SelectStatusEnum.SELECT_STATUS_0.getCode());
shopPointInfoDAO.updatePointInfo(updatePoint);
pointInfoDAO.updatePointInfo(updatePoint);
//将已选择、已被他人选择的状态更新成待选泽
return shopPointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatus.POINT_RECOMMEND_STATUS_2, PointRecommendStatus.POINT_RECOMMEND_STATUS_3));
return pointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatus.POINT_RECOMMEND_STATUS_2, PointRecommendStatus.POINT_RECOMMEND_STATUS_3));
}
@Override
public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) {
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(request.getPointId());
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(request.getPointId());
if(Objects.isNull(pointDetailInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
ShopPointDetailInfoDO updatePoint = new ShopPointDetailInfoDO();
PointDetailInfoDO updatePoint = new PointDetailInfoDO();
updatePoint.setId(pointDetailInfo.getId());
updatePoint.setMapEvaluationReport(request.getMapEvaluationReport());
return shopPointDetailInfoDAO.updateShopPointDetailInfo(updatePoint);
return pointDetailInfoDAO.updatePointDetailInfo(updatePoint);
}
@Override
public Integer submitAudit(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -157,12 +157,12 @@ public class ShopPointServiceImpl implements ShopPointService {
if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
updatePoint.setSubmitAuditCount(pointInfo.getSubmitAuditCount() + 1);
//处理子任务审核记录表
return shopPointInfoDAO.updatePointInfo(updatePoint);
return pointInfoDAO.updatePointInfo(updatePoint);
}
/**

View File

@@ -2,11 +2,11 @@ package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopPointService;
import com.cool.store.vo.point.ShopPointDetailVO;
import com.cool.store.vo.point.PointDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
@@ -30,20 +30,20 @@ public class ShopPointController {
@ApiOperation("新增铺位")
@PostMapping("/add")
public ResponseResult<Long> addShopPointDetailInfo(@RequestBody @Validated AddShopPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.addShopPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
public ResponseResult<Long> addPointDetailInfo(@RequestBody @Validated AddPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
}
@ApiOperation("铺位详情")
@GetMapping("/detail")
public ResponseResult<ShopPointDetailVO> getShopPointDetailInfo(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getShopPointDetailInfo(pointId));
public ResponseResult<PointDetailVO> getPointDetailInfo(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getPointDetailInfo(pointId));
}
@ApiOperation("完善铺位")
@PostMapping("/update")
public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody @Validated UpdateShopPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.updateShopPointDetailInfo(shopPointDetailRequest));
public ResponseResult<Integer> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.updatePointDetailInfo(shopPointDetailRequest));
}
@ApiOperation("生成评估报告")