Commit 242d0978 by 崔彦峰

add:提交有效引荐数相关接口设计。

1 parent 3d07de94
package cn.com.glsx.dj.staff.dto.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* 有效引荐数表
*/
@Data
public class EffectiveReferralReviewCommonDTO extends EffectiveReferralReview {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "门店名称")
private String merchantName;
@ApiModelProperty(value = "提交状态:0-未提交 1-已提交")
private Integer submitStatus;
@ApiModelProperty(value = "商户号集合,无须前端传")
private List<Integer> merchantIds;
}
\ No newline at end of file
......@@ -17,11 +17,4 @@ import lombok.experimental.SuperBuilder;
@EqualsAndHashCode(callSuper=false)
public class EffectiveReferralReviewDTO extends EffectiveReferralReview {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "门店名称")
private String merchantName;
@ApiModelProperty(value = "提交状态:0-未提交 1-已提交")
private Integer submitStatus;
}
\ No newline at end of file
package cn.com.glsx.dj.staff.remote.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.StoreEffectiveReferralDetailDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
......@@ -10,6 +11,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiService(value = "小程序有效引荐接口", owner = "team", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface EffectiveReferralReviewMiniProgramRemote {
......@@ -17,7 +19,7 @@ public interface EffectiveReferralReviewMiniProgramRemote {
@ApiMethod("门店有效引荐数列表")
@ApiParam(name = "pagination", notes = "分页查询信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("门店有效引荐数分页")
RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralStorePage(@NotNull RpcPagination<EffectiveReferralReviewDTO> pagination);
RpcResponse<List<EffectiveReferralReviewCommonDTO>> effectiveReferralStoreList(@NotNull EffectiveReferralReviewCommonDTO request);
@ApiMethod("门店有效引荐数详情")
@ApiParam(name = "id", notes = "门店有效引荐记录id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
......
package cn.com.glsx.dj.staff.remote.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
......@@ -16,30 +17,30 @@ public interface EffectiveReferralReviewRemote {
@ApiMethod("店铺设置-有效引荐列表")
@ApiParam(name = "pagination", notes = "分页查询信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("有效引荐分页")
RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralPage(@NotNull RpcPagination<EffectiveReferralReviewDTO> pagination);
RpcResponse<RpcPagination<EffectiveReferralReviewCommonDTO>> effectiveReferralPage(@NotNull RpcPagination<EffectiveReferralReviewCommonDTO> pagination);
@ApiMethod("订单管理-有效引荐数复核列表")
@ApiParam(name = "pagination", notes = "分页查询信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("有效引荐复核分页")
RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralAuditPage(@NotNull RpcPagination<EffectiveReferralReviewDTO> pagination);
RpcResponse<RpcPagination<EffectiveReferralReviewCommonDTO>> effectiveReferralAuditPage(@NotNull RpcPagination<EffectiveReferralReviewCommonDTO> pagination);
@ApiMethod("有效引荐详情")
@ApiParam(name = "id", notes = "有效引荐记录id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("有效引荐详情")
RpcResponse<EffectiveReferralReviewDTO> effectiveReferralDetail(Integer id);
RpcResponse<EffectiveReferralReviewCommonDTO> effectiveReferralDetail(Integer id);
@ApiMethod("有效引荐数-复核")
@ApiParam(name = "dto", notes = "复核信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("复核结果")
RpcResponse<Boolean> effectiveReferralAudit(@NotNull EffectiveReferralReviewDTO dto);
RpcResponse<Boolean> effectiveReferralAudit(@NotNull EffectiveReferralReviewCommonDTO dto);
@ApiMethod("web端有效引荐导出数据查询")
@ApiParam(name = "pagination", notes = "分页查询信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("导出数据列表")
RpcResponse<String> effectiveReferralExportData(RpcPagination<EffectiveReferralReviewDTO> pagination);
RpcResponse<String> effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination);
@ApiMethod("web端有效引荐复核导出数据查询")
@ApiParam(name = "pagination", notes = "分页查询信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("复核导出数据列表")
RpcResponse<String> effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewDTO> pagination);
RpcResponse<String> effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination);
}
\ No newline at end of file
package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface EffectiveReferralReviewMapper extends OreMapper<EffectiveReferralReview> {
......@@ -15,4 +18,12 @@ public interface EffectiveReferralReviewMapper extends OreMapper<EffectiveReferr
* @return 记录
*/
EffectiveReferralReviewDTO selectOneByQuery(EffectiveReferralReviewDTO query);
/**
* 查询门店列表
*
* @param query 查询条件
* @return 门店列表
*/
List<EffectiveReferralReviewCommonDTO> selectStoreList(EffectiveReferralReviewCommonDTO query);
}
\ No newline at end of file
package cn.com.glsx.dj.staff.remote.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.StoreEffectiveReferralDetailDTO;
import cn.com.glsx.dj.staff.service.perfSalary.EffectiveReferralReviewMiniProgramService;
......@@ -10,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class EffectiveReferralReviewMiniProgramRemoteImpl implements EffectiveReferralReviewMiniProgramRemote {
......@@ -18,9 +21,9 @@ public class EffectiveReferralReviewMiniProgramRemoteImpl implements EffectiveRe
private EffectiveReferralReviewMiniProgramService effectiveReferralReviewMiniprogramService;
@Override
public RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralStorePage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcResponse<List<EffectiveReferralReviewCommonDTO>> effectiveReferralStoreList(EffectiveReferralReviewCommonDTO request) {
try{
return RpcResponse.success(effectiveReferralReviewMiniprogramService.effectiveReferralStorePage(pagination));
return RpcResponse.success(effectiveReferralReviewMiniprogramService.effectiveReferralStoreList(request));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
......
package cn.com.glsx.dj.staff.remote.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.service.perfSalary.EffectiveReferralReviewService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -17,7 +18,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
private EffectiveReferralReviewService effectiveReferralReviewService;
@Override
public RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralPage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcResponse<RpcPagination<EffectiveReferralReviewCommonDTO>> effectiveReferralPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
try{
return RpcResponse.success(effectiveReferralReviewService.effectiveReferralPage(pagination));
}catch(RpcServiceException e){
......@@ -27,7 +28,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
}
@Override
public RpcResponse<RpcPagination<EffectiveReferralReviewDTO>> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcResponse<RpcPagination<EffectiveReferralReviewCommonDTO>> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
try{
return RpcResponse.success(effectiveReferralReviewService.effectiveReferralAuditPage(pagination));
}catch(RpcServiceException e){
......@@ -37,7 +38,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
}
@Override
public RpcResponse<EffectiveReferralReviewDTO> effectiveReferralDetail(Integer id) {
public RpcResponse<EffectiveReferralReviewCommonDTO> effectiveReferralDetail(Integer id) {
try{
return RpcResponse.success(effectiveReferralReviewService.effectiveReferralDetail(id));
}catch(Exception e){
......@@ -47,7 +48,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
}
@Override
public RpcResponse<Boolean> effectiveReferralAudit(EffectiveReferralReviewDTO dto) {
public RpcResponse<Boolean> effectiveReferralAudit(EffectiveReferralReviewCommonDTO dto) {
try{
effectiveReferralReviewService.effectiveReferralAudit(dto);
return RpcResponse.success(true);
......@@ -58,7 +59,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
}
@Override
public RpcResponse<String> effectiveReferralExportData(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcResponse<String> effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
try{
return RpcResponse.success(effectiveReferralReviewService.effectiveReferralExportData(pagination));
}catch(Exception e){
......@@ -68,7 +69,7 @@ public class EffectiveReferralReviewRemoteImpl implements EffectiveReferralRevie
}
@Override
public RpcResponse<String> effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcResponse<String> effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
try{
return RpcResponse.success(effectiveReferralReviewService.effectiveReferralAuditExportData(pagination));
}catch(Exception e){
......
package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.StoreEffectiveReferralDetailDTO;
import cn.com.glsx.dj.staff.mapper.perfSalary.EffectiveReferralReviewMapper;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -23,13 +21,19 @@ public class EffectiveReferralReviewMiniProgramService {
@Resource
private EffectiveReferralReviewMapper effectiveReferralReviewMapper;
public RpcPagination<EffectiveReferralReviewDTO> effectiveReferralStorePage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
List<EffectiveReferralReviewDTO> list = null;
Page<EffectiveReferralReviewDTO> page = (Page<EffectiveReferralReviewDTO>) list;
public List<EffectiveReferralReviewCommonDTO> effectiveReferralStoreList(EffectiveReferralReviewCommonDTO request) {
//筛选项:门店名字(模糊搜索),状态:未提交、已提交,月份:2026-01,
//特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。
//不同业务场景`scene_type` '业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保 状态`status` '状态:0-未提交,1-草稿,2-已提交',全部为已提交时,总的提交状态submitStatus才是已提交。
//注意:要跟服务商户表dj_car_life_service_merchant根据`merchant_id`关联,用于筛选项门店搜索,sal_effective_referral_review作为主表
pagination = RpcPagination.copyPage(page);
return pagination;
log.info("查询有效引荐门店列表,参数:{}", request);
List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreList(request);
log.info("查询到有效引荐门店列表数量:{}", list == null ? 0 : list.size());
return list;
}
public StoreEffectiveReferralDetailDTO effectiveReferralStoreDetail(Integer id) {
......
package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO;
import cn.com.glsx.dj.staff.mapper.perfSalary.EffectiveReferralReviewMapper;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
......@@ -23,39 +24,39 @@ public class EffectiveReferralReviewService {
@Resource
private EffectiveReferralReviewMapper effectiveReferralReviewMapper;
public RpcPagination<EffectiveReferralReviewDTO> effectiveReferralPage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcPagination<EffectiveReferralReviewCommonDTO> effectiveReferralPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
List<EffectiveReferralReviewDTO> list = null;
Page<EffectiveReferralReviewDTO> page = (Page<EffectiveReferralReviewDTO>) list;
List<EffectiveReferralReviewCommonDTO> list = null;
Page<EffectiveReferralReviewCommonDTO> page = (Page<EffectiveReferralReviewCommonDTO>) list;
pagination = RpcPagination.copyPage(page);
return pagination;
}
public RpcPagination<EffectiveReferralReviewDTO> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public RpcPagination<EffectiveReferralReviewCommonDTO> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
List<EffectiveReferralReviewDTO> list = null;
Page<EffectiveReferralReviewDTO> page = (Page<EffectiveReferralReviewDTO>) list;
List<EffectiveReferralReviewCommonDTO> list = null;
Page<EffectiveReferralReviewCommonDTO> page = (Page<EffectiveReferralReviewCommonDTO>) list;
pagination = RpcPagination.copyPage(page);
return pagination;
}
public EffectiveReferralReviewDTO effectiveReferralDetail(Integer id) {
return (EffectiveReferralReviewDTO) effectiveReferralReviewMapper.selectByPrimaryKey(id);
public EffectiveReferralReviewCommonDTO effectiveReferralDetail(Integer id) {
return (EffectiveReferralReviewCommonDTO) effectiveReferralReviewMapper.selectByPrimaryKey(id);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void effectiveReferralAudit(EffectiveReferralReviewDTO dto) {
public void effectiveReferralAudit(EffectiveReferralReviewCommonDTO dto) {
// 核心业务逻辑暂不实现
effectiveReferralReviewMapper.updateByPrimaryKeySelective(dto);
}
public String effectiveReferralExportData(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public String effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
return null;
}
public String effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewDTO> pagination) {
public String effectiveReferralAuditExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
return null;
}
}
\ No newline at end of file
......@@ -34,6 +34,11 @@
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO" extends="BaseResultMap">
</resultMap>
<resultMap id="CommonDTOResultMap" type="cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO" extends="BaseResultMap">
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
<result column="submit_status" jdbcType="INTEGER" property="submitStatus"/>
</resultMap>
<sql id="Base_Column_List">
id, merchant_id, total_delivery_count, area_effective_count,
reviewed_effective_count, review_month, image_urls, remark,
......@@ -65,5 +70,42 @@
LIMIT
1
</select>
<select id="selectStoreList" resultMap="CommonDTOResultMap">
SELECT
serr.merchant_id,
MIN(dclsm.merchant_name) AS merchant_name,
serr.review_month,
CASE
WHEN MAX(CASE WHEN serr.status IN (0, 1) THEN 1 ELSE 0 END) = 1
THEN 0
ELSE 1
END AS submit_status
FROM sal_effective_referral_review serr
LEFT JOIN dj_car_life_service_merchant dclsm ON serr.merchant_id = dclsm.merchant_id
AND dclsm.deleted_flag = 'N'
WHERE serr.deleted_flag = 'N'
and serr.merchant_id in
<foreach collection="merchantIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="merchantName != null and merchantName != ''">
AND dclsm.merchant_name LIKE CONCAT('%', #{merchantName}, '%')
</if>
<if test="createdDate != null and createdDate != ''">
AND DATE_FORMAT(serr.created_date, '%Y-%m') = #{createdDate}
</if>
GROUP BY serr.merchant_id
<if test="submitStatus != null">
HAVING
CASE
WHEN MAX(CASE WHEN serr.status IN (0, 1) THEN 1 ELSE 0 END) = 1
THEN 0
ELSE 1
END = #{submitStatus}
</if>
ORDER BY
CONVERT(MIN(dclsm.merchant_name) USING gbk) DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!