Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init

This commit is contained in:
苏竹红
2024-04-02 14:19:41 +08:00
20 changed files with 156 additions and 157 deletions

View File

@@ -1,7 +1,7 @@
package com.cool.store.dao; package com.cool.store.dao;
import com.cool.store.entity.ShopPointDetailInfoDO; import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.mapper.ShopPointDetailInfoMapper; import com.cool.store.mapper.PointDetailInfoMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -14,18 +14,18 @@ import java.util.Objects;
* @date 2024-03-29 10:15 * @date 2024-03-29 10:15
*/ */
@Repository @Repository
public class ShopPointDetailInfoDAO { public class PointDetailInfoDAO {
@Resource @Resource
private ShopPointDetailInfoMapper shopPointDetailInfoMapper; private PointDetailInfoMapper pointDetailInfoMapper;
/** /**
* 新增点位详情 * 新增点位详情
* @param shopPointDetailInfo * @param shopPointDetailInfo
* @return * @return
*/ */
public Long addShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) { public Long addPointDetailInfo(PointDetailInfoDO shopPointDetailInfo) {
shopPointDetailInfoMapper.insertSelective(shopPointDetailInfo); pointDetailInfoMapper.insertSelective(shopPointDetailInfo);
return shopPointDetailInfo.getId(); return shopPointDetailInfo.getId();
} }
@@ -34,20 +34,20 @@ public class ShopPointDetailInfoDAO {
* @param shopPointDetailInfo * @param shopPointDetailInfo
* @return * @return
*/ */
public Integer updateShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) { public Integer updatePointDetailInfo(PointDetailInfoDO shopPointDetailInfo) {
if(Objects.isNull(shopPointDetailInfo.getId()) && Objects.nonNull(shopPointDetailInfo.getPointId())){ if(Objects.isNull(shopPointDetailInfo.getId()) && Objects.nonNull(shopPointDetailInfo.getPointId())){
Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId()); Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId());
shopPointDetailInfo.setId(pointDetailId); shopPointDetailInfo.setId(pointDetailId);
} }
return shopPointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo); return pointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo);
} }
public Long getPointDetailIdByPointId(Long pointId){ public Long getPointDetailIdByPointId(Long pointId){
return shopPointDetailInfoMapper.getPointDetailIdByPointId(pointId); return pointDetailInfoMapper.getPointDetailIdByPointId(pointId);
} }
public ShopPointDetailInfoDO getShopPointDetailInfoByPointId(Long pointId) { public PointDetailInfoDO getPointDetailInfoByPointId(Long pointId) {
return shopPointDetailInfoMapper.getShopPointDetailInfoByPointId(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; package com.cool.store.dao;
import com.cool.store.enums.point.PointRecommendStatus; 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.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -17,16 +17,16 @@ import java.util.stream.Collectors;
* @date 2024-04-01 14:36 * @date 2024-04-01 14:36
*/ */
@Repository @Repository
public class ShopPointRecommendDAO { public class PointRecommendDAO {
@Resource @Resource
private ShopPointRecommendMapper shopPointRecommendMapper; private PointRecommendMapper pointRecommendMapper;
public Integer updateRecommendStatus(Long pointId, PointRecommendStatus status) { public Integer updateRecommendStatus(Long pointId, PointRecommendStatus status) {
if(Objects.isNull(status)){ if(Objects.isNull(status)){
return 0; return 0;
} }
return shopPointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode()); return pointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode());
} }
public Integer updateRecommendStatusByStatusAndPointId(Long pointId, PointRecommendStatus status, List<PointRecommendStatus> statusList) { public Integer updateRecommendStatusByStatusAndPointId(Long pointId, PointRecommendStatus status, List<PointRecommendStatus> statusList) {
@@ -34,7 +34,7 @@ public class ShopPointRecommendDAO {
return 0; return 0;
} }
List<Integer> statusCodeList = statusList.stream().map(PointRecommendStatus::getCode).collect(Collectors.toList()); 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; package com.cool.store.mapper;
import com.cool.store.entity.ShopPointDetailInfoDO; import com.cool.store.entity.PointDetailInfoDO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO> { public interface PointDetailInfoMapper extends Mapper<PointDetailInfoDO> {
/** /**
* 获取详情id * 获取详情id
@@ -18,5 +18,5 @@ public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO>
* @param pointId * @param pointId
* @return * @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; package com.cool.store.mapper;
import com.cool.store.entity.ShopPointRecommendDO; import com.cool.store.entity.PointRecommendDO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List; 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"?> <?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"> <!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"> <mapper namespace="com.cool.store.mapper.PointDetailInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointDetailInfoDO"> <resultMap id="BaseResultMap" type="com.cool.store.entity.PointDetailInfoDO">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="point_id" jdbcType="BIGINT" property="pointId" /> <result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" /> <result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" />
@@ -71,10 +71,10 @@
<result column="picture_obj" jdbcType="LONGVARCHAR" property="pictureObj" /> <result column="picture_obj" jdbcType="LONGVARCHAR" property="pictureObj" />
</resultMap> </resultMap>
<select id="getPointDetailIdByPointId" resultType="java.lang.Long"> <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>
<select id="getShopPointDetailInfoByPointId" resultMap="BaseResultMap"> <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> </select>
</mapper> </mapper>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <mapper namespace="com.cool.store.mapper.PointInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointInfoDO"> <resultMap id="BaseResultMap" type="com.cool.store.entity.PointInfoDO">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="point_code" jdbcType="VARCHAR" property="pointCode" /> <result column="point_code" jdbcType="VARCHAR" property="pointCode" />
<result column="point_name" jdbcType="VARCHAR" property="pointName" /> <result column="point_name" jdbcType="VARCHAR" property="pointName" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <mapper namespace="com.cool.store.mapper.PointRecommendMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointRecommendDO"> <resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" /> <result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="point_id" jdbcType="BIGINT" property="pointId" /> <result column="point_id" jdbcType="BIGINT" property="pointId" />
@@ -13,11 +13,11 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
<update id="updateShopPointRecommendStatus"> <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>
<update id="updateRecommendStatusByStatusAndPointId"> <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=")"> <foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
#{status} #{status}
</foreach> </foreach>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,18 +1,18 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.entity.ShopPointDetailInfoDO; import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO; import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.point.PointRecommendStatus; import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.enums.point.PointStatusEnum; import com.cool.store.enums.point.PointStatusEnum;
import com.cool.store.enums.point.SelectStatusEnum; import com.cool.store.enums.point.SelectStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.AddMapEvaluationReportRequest; import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest; import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest; import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.service.ShopPointService; 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 lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -36,54 +36,54 @@ public class ShopPointServiceImpl implements ShopPointService {
@Resource @Resource
private ShopInfoDAO shopInfoDAO; private ShopInfoDAO shopInfoDAO;
@Resource @Resource
private ShopPointInfoDAO shopPointInfoDAO; private PointInfoDAO pointInfoDAO;
@Resource @Resource
private ShopPointDetailInfoDAO shopPointDetailInfoDAO; private PointDetailInfoDAO pointDetailInfoDAO;
@Resource @Resource
private LineInfoDAO lineInfoDAO; private LineInfoDAO lineInfoDAO;
@Resource @Resource
private ShopPointRecommendDAO shopPointRecommendDAO; private PointRecommendDAO pointRecommendDAO;
@Override @Override
public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) { public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) {
ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest); PointInfoDO shopPointInfo = AddPointDetailRequest.convertPointDO(shopPointDetailRequest);
shopPointInfo.setPointCode(generateCode()); shopPointInfo.setPointCode(generateCode());
shopPointInfo.setDevelopmentManager(userId); shopPointInfo.setDevelopmentManager(userId);
shopPointInfo.setDevelopmentTime(new Date()); shopPointInfo.setDevelopmentTime(new Date());
Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo); Long pointId = pointInfoDAO.addPointInfo(shopPointInfo);
ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest); PointDetailInfoDO shopPoint = AddPointDetailRequest.convertDO(shopPointDetailRequest);
shopPoint.setPointId(pointId); shopPoint.setPointId(pointId);
return shopPointDetailInfoDAO.addShopPointDetailInfo(shopPoint); return pointDetailInfoDAO.addPointDetailInfo(shopPoint);
} }
@Override @Override
public ShopPointDetailVO getShopPointDetailInfo(Long pointId) { public PointDetailVO getPointDetailInfo(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){ if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId); PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointDetailInfo)){ if(Objects.isNull(pointDetailInfo)){
log.error("铺位详情信息不存在"); log.error("铺位详情信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
return ShopPointDetailVO.convertVO(pointInfo, pointDetailInfo); return PointDetailVO.convertVO(pointInfo, pointDetailInfo);
} }
@Override @Override
public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) { public Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest); PointInfoDO shopPointInfo = UpdatePointDetailRequest.convertPointDO(shopPointDetailRequest);
ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest); PointDetailInfoDO shopPoint = UpdatePointDetailRequest.convertDO(shopPointDetailRequest);
shopPointInfo.setPointScore(shopPoint.getTotalPointScore()); shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
shopPointInfoDAO.updatePointInfo(shopPointInfo); pointInfoDAO.updatePointInfo(shopPointInfo);
return shopPointDetailInfoDAO.updateShopPointDetailInfo(shopPoint); return pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
} }
@Override @Override
public Integer generateEvaluationReport(Long pointId) { public Integer generateEvaluationReport(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId); PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){ if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
@@ -91,17 +91,17 @@ public class ShopPointServiceImpl implements ShopPointService {
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE); throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
} }
Integer totalPointScore = pointDetailInfo.getTotalPointScore(); Integer totalPointScore = pointDetailInfo.getTotalPointScore();
ShopPointInfoDO updatePointInfo = new ShopPointInfoDO(); PointInfoDO updatePointInfo = new PointInfoDO();
updatePointInfo.setId(pointId); updatePointInfo.setId(pointId);
updatePointInfo.setPointScore(totalPointScore); updatePointInfo.setPointScore(totalPointScore);
updatePointInfo.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode()); updatePointInfo.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
shopPointInfoDAO.updatePointInfo(updatePointInfo); pointInfoDAO.updatePointInfo(updatePointInfo);
return totalPointScore; return totalPointScore;
} }
@Override @Override
public Integer pointInvalid(Long pointId) { public Integer pointInvalid(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){ if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); 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())){ if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED); throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
} }
ShopPointInfoDO updatePoint = new ShopPointInfoDO(); PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId); updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode()); updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
shopPointInfoDAO.updatePointInfo(updatePoint); pointInfoDAO.updatePointInfo(updatePoint);
return shopPointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6); return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
} }
@Override @Override
public Integer pointUnbind(Long pointId) { public Integer pointUnbind(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){ if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); 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())){ if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED); throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
} }
ShopPointInfoDO updatePoint = new ShopPointInfoDO(); PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId); updatePoint.setId(pointId);
updatePoint.setSelectStatus(SelectStatusEnum.SELECT_STATUS_0.getCode()); 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 @Override
public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) { public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) {
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(request.getPointId()); PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(request.getPointId());
if(Objects.isNull(pointDetailInfo)){ if(Objects.isNull(pointDetailInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
ShopPointDetailInfoDO updatePoint = new ShopPointDetailInfoDO(); PointDetailInfoDO updatePoint = new PointDetailInfoDO();
updatePoint.setId(pointDetailInfo.getId()); updatePoint.setId(pointDetailInfo.getId());
updatePoint.setMapEvaluationReport(request.getMapEvaluationReport()); updatePoint.setMapEvaluationReport(request.getMapEvaluationReport());
return shopPointDetailInfoDAO.updateShopPointDetailInfo(updatePoint); return pointDetailInfoDAO.updatePointDetailInfo(updatePoint);
} }
@Override @Override
public Integer submitAudit(Long pointId) { public Integer submitAudit(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){ if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); 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())){ if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE); throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
} }
ShopPointInfoDO updatePoint = new ShopPointInfoDO(); PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId); updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode()); updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
updatePoint.setSubmitAuditCount(pointInfo.getSubmitAuditCount() + 1); 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.context.CurrentUserHolder;
import com.cool.store.request.AddMapEvaluationReportRequest; import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest; import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest; import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopPointService; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -30,20 +30,20 @@ public class ShopPointController {
@ApiOperation("新增铺位") @ApiOperation("新增铺位")
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> addShopPointDetailInfo(@RequestBody @Validated AddShopPointDetailRequest shopPointDetailRequest) { public ResponseResult<Long> addPointDetailInfo(@RequestBody @Validated AddPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.addShopPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId())); return ResponseResult.success(shopPointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
} }
@ApiOperation("铺位详情") @ApiOperation("铺位详情")
@GetMapping("/detail") @GetMapping("/detail")
public ResponseResult<ShopPointDetailVO> getShopPointDetailInfo(@RequestParam("pointId")Long pointId) { public ResponseResult<PointDetailVO> getPointDetailInfo(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getShopPointDetailInfo(pointId)); return ResponseResult.success(shopPointService.getPointDetailInfo(pointId));
} }
@ApiOperation("完善铺位") @ApiOperation("完善铺位")
@PostMapping("/update") @PostMapping("/update")
public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody @Validated UpdateShopPointDetailRequest shopPointDetailRequest) { public ResponseResult<Integer> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.updateShopPointDetailInfo(shopPointDetailRequest)); return ResponseResult.success(shopPointService.updatePointDetailInfo(shopPointDetailRequest));
} }
@ApiOperation("生成评估报告") @ApiOperation("生成评估报告")