## 直推升级数据,导出
This commit is contained in:
		
							parent
							
								
									0b0ebc93f9
								
							
						
					
					
						commit
						490c523822
					
				| 
						 | 
				
			
			@ -8,7 +8,10 @@ import com.hzs.activity.recommend.param.AcDirectPushUpgradeParam;
 | 
			
		|||
import com.hzs.activity.recommend.param.AcRecommendParam;
 | 
			
		||||
import com.hzs.activity.recommend.service.IAcRecomUpgradeRecordService;
 | 
			
		||||
import com.hzs.activity.recommend.service.IAcRepurCouponsRuleConfigService;
 | 
			
		||||
import com.hzs.activity.recommend.vo.AcDirectPushUpgradeListVO;
 | 
			
		||||
import com.hzs.activity.recommend.vo.AcRecommendVO;
 | 
			
		||||
import com.hzs.activity.tourism.param.TourismDataParam;
 | 
			
		||||
import com.hzs.activity.tourism.vo.TourismDataVo;
 | 
			
		||||
import com.hzs.common.core.annotation.Log;
 | 
			
		||||
import com.hzs.common.core.enums.EActType;
 | 
			
		||||
import com.hzs.common.core.enums.EOperationBusiness;
 | 
			
		||||
| 
						 | 
				
			
			@ -91,6 +94,14 @@ public class AcRecommendConfigController extends BaseController {
 | 
			
		|||
        return getDataTable(iAcRecomUpgradeRecordService.queryList(param));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/directPushUpgradeExport")
 | 
			
		||||
    public void export(AcDirectPushUpgradeListParam param, HttpServletResponse response) {
 | 
			
		||||
        startPage();
 | 
			
		||||
        List<AcDirectPushUpgradeListVO> list = iAcRecomUpgradeRecordService.queryList(param);
 | 
			
		||||
        ExcelUtil<AcDirectPushUpgradeListVO> util = new ExcelUtil<>(AcDirectPushUpgradeListVO.class);
 | 
			
		||||
        util.exportExcel(response, list, "直推升级数据导出");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 直推赠送查看详情
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,59 @@
 | 
			
		|||
package com.hzs.activity.recommend.dto;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
public class AcDirectPushUpgradeListDTO {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 活动名称
 | 
			
		||||
     */
 | 
			
		||||
    private String actName;
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员编号
 | 
			
		||||
     */
 | 
			
		||||
    private String memberCode;
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员名称
 | 
			
		||||
     */
 | 
			
		||||
    private String memberName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原等级
 | 
			
		||||
     */
 | 
			
		||||
    private Integer pkSettleGrade;
 | 
			
		||||
    /**
 | 
			
		||||
     * 新等级
 | 
			
		||||
     */
 | 
			
		||||
    private Integer pkRecommendGrade;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 活动开始时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date actStartDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 活动结束时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date actEndDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date creationTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 升级年月
 | 
			
		||||
     */
 | 
			
		||||
    private String upgradeTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
package com.hzs.activity.recommend.mapper;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
			
		||||
import com.hzs.activity.recommend.dto.AcDirectPushUpgradeListDTO;
 | 
			
		||||
import com.hzs.activity.recommend.param.AcDirectPushUpgradeListParam;
 | 
			
		||||
import com.hzs.activity.recommend.vo.AcDirectPushUpgradeListVO;
 | 
			
		||||
import com.hzs.common.domain.activity.recommend.AcRecomUpgradeRecord;
 | 
			
		||||
| 
						 | 
				
			
			@ -41,5 +42,5 @@ public interface AcRecomUpgradeRecordMapper extends BaseMapper<AcRecomUpgradeRec
 | 
			
		|||
                                 @Param("startTime") Date startTime,
 | 
			
		||||
                                 @Param("endTime") Date endTime);
 | 
			
		||||
 | 
			
		||||
    List<AcDirectPushUpgradeListVO> queryList(AcDirectPushUpgradeListParam param);
 | 
			
		||||
    List<AcDirectPushUpgradeListDTO> queryList(AcDirectPushUpgradeListParam param);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,15 +1,23 @@
 | 
			
		|||
package com.hzs.activity.recommend.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.hzs.activity.recommend.dto.AcDirectPushUpgradeListDTO;
 | 
			
		||||
import com.hzs.activity.recommend.mapper.AcRecomUpgradeRecordMapper;
 | 
			
		||||
import com.hzs.activity.recommend.param.AcDirectPushUpgradeListParam;
 | 
			
		||||
import com.hzs.activity.recommend.service.IAcRecomUpgradeRecordService;
 | 
			
		||||
import com.hzs.activity.recommend.vo.AcDirectPushUpgradeListVO;
 | 
			
		||||
import com.hzs.common.core.enums.EDelFlag;
 | 
			
		||||
import com.hzs.common.core.enums.EGrade;
 | 
			
		||||
import com.hzs.common.core.utils.bean.BeanUtils;
 | 
			
		||||
import com.hzs.common.core.web.page.TableDataInfo;
 | 
			
		||||
import com.hzs.common.domain.activity.recommend.AcRecomUpgradeRecord;
 | 
			
		||||
import com.hzs.common.domain.activity.recommend.AcRecomUpgradeRecordExt;
 | 
			
		||||
import com.hzs.common.domain.sale.order.SaOrder;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -53,4 +61,17 @@ public class AcRecomUpgradeRecordServiceImpl extends ServiceImpl<AcRecomUpgradeR
 | 
			
		|||
        return baseMapper.listRecomOrder(pkMember, pkGrade, num, startTime, endTime);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<AcDirectPushUpgradeListVO> queryList(AcDirectPushUpgradeListParam param) {
 | 
			
		||||
        List<AcDirectPushUpgradeListDTO> acDirectPushUpgradeListDTOS = baseMapper.queryList(param);
 | 
			
		||||
        ArrayList<AcDirectPushUpgradeListVO> acDirectPushUpgradeListVOS = new ArrayList<>();
 | 
			
		||||
        acDirectPushUpgradeListDTOS.forEach(item -> {
 | 
			
		||||
            AcDirectPushUpgradeListVO acDirectPushUpgradeListVO = BeanUtil.copyProperties(item, AcDirectPushUpgradeListVO.class);
 | 
			
		||||
            acDirectPushUpgradeListVO.setPkSettleGrade(EGrade.getGradeByIndex(item.getPkSettleGrade()).getLabel());
 | 
			
		||||
            acDirectPushUpgradeListVO.setPkRecommendGrade(EGrade.getGradeByIndex(item.getPkRecommendGrade()).getLabel());
 | 
			
		||||
            acDirectPushUpgradeListVOS.add(acDirectPushUpgradeListVO);
 | 
			
		||||
        });
 | 
			
		||||
        return acDirectPushUpgradeListVOS;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,5 +61,41 @@
 | 
			
		|||
        ) t
 | 
			
		||||
        where #{num} >= rownum
 | 
			
		||||
    </select>
 | 
			
		||||
      <select id="queryList" resultType="com.hzs.activity.recommend.dto.AcDirectPushUpgradeListDTO">
 | 
			
		||||
        SELECT
 | 
			
		||||
        abc.ACT_NAME,
 | 
			
		||||
        cmm.member_code,
 | 
			
		||||
        cmm.member_name,
 | 
			
		||||
        arur.PK_SETTLE_GRADE,
 | 
			
		||||
        arur.PK_RECOMMEND_GRADE,
 | 
			
		||||
        abc.ACT_START_DATE,
 | 
			
		||||
        abc.ACT_END_DATE,
 | 
			
		||||
        arur.CREATION_TIME,
 | 
			
		||||
        arur.UPGRADE_TIME
 | 
			
		||||
        FROM
 | 
			
		||||
        AC_RECOM_UPGRADE_RECORD arur
 | 
			
		||||
        LEFT JOIN AC_BASE_CONFIG abc ON arur.PK_BASE_ID = abc.PK_ID
 | 
			
		||||
        LEFT JOIN CU_MEMBER cm ON arur.pk_member = cm.PK_PARENT
 | 
			
		||||
        LEFT JOIN CU_MEMBER cmm ON cm.PK_PARENT = cmm.PK_ID
 | 
			
		||||
        WHERE arur.DEL_FLAG = 0
 | 
			
		||||
        <if test="actName != null">
 | 
			
		||||
            AND abc.ACT_NAME = #{actName}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="memberCode != null">
 | 
			
		||||
            AND cmm.member_code = #{memberCode}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="startActStartDate != null">
 | 
			
		||||
            AND abc.ACT_START_DATE >= #{startActStartDate}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="startActEndDate != null">
 | 
			
		||||
            AND abc.ACT_START_DATE <= #{startActEndDate}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="startActEndDate != null">
 | 
			
		||||
            AND abc.ACT_END_DATE >= #{endActStartDate}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="endActStartDate != null">
 | 
			
		||||
            AND abc.ACT_END_DATE <= #{endActEndDate}
 | 
			
		||||
        </if>
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,4 +94,13 @@ public enum EGrade {
 | 
			
		|||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static EGrade getGradeByIndex(int value){
 | 
			
		||||
        for (EGrade eGrade : EGrade.values()) {
 | 
			
		||||
            if (value == eGrade.index){
 | 
			
		||||
                return eGrade;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue