充值明细添加查询条件
This commit is contained in:
@@ -71,6 +71,10 @@ public class ChargeRecordAdminVo {
|
||||
@FieldComment("创建时间")
|
||||
public String createTime; // 创建时间
|
||||
|
||||
@ExcelProperty("更新时间")
|
||||
@FieldComment("更新时间")
|
||||
public String updateTime; // 创建时间
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,10 +17,14 @@ public interface ChargeRecordAdminMapper extends BaseMapper<ChargeRecord> {
|
||||
|
||||
Page<ChargeRecordAdminVo> page(Page<ChargeRecordAdminVo> p, @Param("erbanNo") Long erbanNo, @Param("channel") String channel,
|
||||
@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("status") Integer status,
|
||||
@Param("newUser") Boolean newUser, @Param("appChannel") String appChannel, @Param("regionId") Integer regionId);
|
||||
@Param("newUser") Boolean newUser, @Param("appChannel") String appChannel, @Param("regionId") Integer regionId,
|
||||
@Param("chargeRecordId") String chargeRecordId,
|
||||
@Param("pingxxChargeId") String pingxxChargeId);
|
||||
List<ChargeRecordAdminVo> pageTotal(@Param("erbanNo") Long erbanNo, @Param("channel") String channel, @Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime, @Param("status") Integer status, @Param("newUser") Boolean newUser,
|
||||
@Param("appChannel") String appChannel, @Param("regionId") Integer regionId);
|
||||
@Param("appChannel") String appChannel, @Param("regionId") Integer regionId,
|
||||
@Param("chargeRecordId") String chargeRecordId,
|
||||
@Param("pingxxChargeId") String pingxxChargeId);
|
||||
|
||||
List<ChargeRecord> listFisrChargeRecordByUids(@Param("uids") List<Long> uids);
|
||||
|
||||
|
@@ -306,9 +306,11 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
}
|
||||
|
||||
public PageResult<ChargeRecordAdminVo> chargeRecordList(Integer pageNumber, Integer pageSize, Long erbanNo, String channel, Date startTime,
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Boolean totalStat, Integer regionId) {
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Boolean totalStat, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) {
|
||||
Page<ChargeRecordAdminVo> p = new Page<>(pageNumber, pageSize);
|
||||
chargeRecordAdminMapper.page(p, erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
chargeRecordAdminMapper.page(p, erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
PageResult<ChargeRecordAdminVo> pageResult = new PageResult<>(p);
|
||||
List<ChargeRecordAdminVo> rows = pageResult.getRows();
|
||||
if (CollectionUtils.isEmpty(rows)) {
|
||||
@@ -322,7 +324,8 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
row.setRegionName(regionName.get(row.getRegionId()));
|
||||
}
|
||||
if (totalStat) {
|
||||
List<ChargeRecordAdminVo> chargeRecordAdminVo = chargeRecordAdminMapper.pageTotal(erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
List<ChargeRecordAdminVo> chargeRecordAdminVo = chargeRecordAdminMapper
|
||||
.pageTotal(erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
if (CollectionUtils.isEmpty(chargeRecordAdminVo)) {
|
||||
return pageResult;
|
||||
}
|
||||
@@ -344,8 +347,10 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
|
||||
}
|
||||
|
||||
public void exportChargeRecordList(OutputStream outputStream, Long erbanNo, String channel, Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) {
|
||||
PageResult<ChargeRecordAdminVo> page = chargeRecordList(-1, -1, erbanNo, channel, startTime, endTime, status, newUser, appChannel, false, regionId);
|
||||
public void exportChargeRecordList(OutputStream outputStream, Long erbanNo, String channel, Date startTime, Date endTime, Integer status, Boolean newUser,
|
||||
String appChannel, Integer regionId, String chargeRecordId, String pingxxChargeId) {
|
||||
PageResult<ChargeRecordAdminVo> page = chargeRecordList(-1, -1, erbanNo, channel, startTime, endTime,
|
||||
status, newUser, appChannel, false, regionId, chargeRecordId, pingxxChargeId);
|
||||
EasyExcel.write(outputStream, ChargeRecordAdminVo.class).sheet("充值明细").doWrite(page.getRows());
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
<mapper namespace="com.accompany.admin.mapper.ChargeRecordAdminMapper">
|
||||
<resultMap id="BaseResultMap" type="com.accompany.admin.vo.ChargeRecordAdminVo">
|
||||
<id column="chargeRecordId" property="chargeRecordId" jdbcType="VARCHAR"/>
|
||||
<id column="pingxxChargeId" property="pingxxChargeId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="page" resultMap="BaseResultMap">
|
||||
@@ -12,6 +13,7 @@
|
||||
app_channel,a.uid,a.channel,p.`desc` `partitionName`,
|
||||
round(a.amount/100,2) amount, local_currency_code localCurrencyCode, round(a.local_amount/100,2) localAmount,
|
||||
a.charge_status status,DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%i:%s') createTime,
|
||||
DATE_FORMAT(a.update_time, '%Y-%m-%d %H:%i:%s') updateTime,
|
||||
if(date(a.create_time)=date(b.create_time), 1, 0) as new_user from charge_record
|
||||
as a
|
||||
join users as b on a.uid=b.uid
|
||||
@@ -35,6 +37,12 @@
|
||||
<if test="regionId != null and regionId != 0">
|
||||
and b.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="chargeRecordId != null and chargeRecordId != ''">
|
||||
and a.charge_prod_id = #{chargeRecordId}
|
||||
</if>
|
||||
<if test="pingxxChargeId != null and pingxxChargeId != ''">
|
||||
and a.pingxx_charge_id = #{pingxxChargeId}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
) as tmp_list
|
||||
where 1=1
|
||||
@@ -82,6 +90,12 @@
|
||||
<if test="regionId != null and regionId != 0">
|
||||
and b.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="chargeRecordId != null and chargeRecordId != ''">
|
||||
and a.charge_prod_id = #{chargeRecordId}
|
||||
</if>
|
||||
<if test="pingxxChargeId != null and pingxxChargeId != ''">
|
||||
and a.pingxx_charge_id = #{pingxxChargeId}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
) as tmp_list
|
||||
where 1=1
|
||||
|
@@ -296,9 +296,11 @@ public class ChargeRecordAdminController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
public BusiResult<PageResult<ChargeRecordAdminVo>> chargeRecordList(Integer pageNumber, Integer pageSize, Long erbanNo, String channel, Date startTime,
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) {
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) {
|
||||
PageResult<ChargeRecordAdminVo> pageInfo = chargeRecordAdminService.chargeRecordList(pageNumber, pageSize, erbanNo, channel, startTime,
|
||||
endTime, status, newUser, appChannel, true, regionId);
|
||||
endTime, status, newUser, appChannel, true, regionId, chargeRecordId, pingxxChargeId);
|
||||
return BusiResult.success(pageInfo);
|
||||
}
|
||||
|
||||
@@ -308,13 +310,16 @@ public class ChargeRecordAdminController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/exportChargeDetail", method = RequestMethod.POST)
|
||||
public void exportChargeDetail(HttpServletResponse response, Long erbanNo, String channel,
|
||||
Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) throws IOException {
|
||||
Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) throws IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("充值明细", "UTF-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
chargeRecordAdminService.exportChargeRecordList(response.getOutputStream(), erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
chargeRecordAdminService.exportChargeRecordList(response.getOutputStream(), erbanNo, channel, startTime,
|
||||
endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/countryDetail")
|
||||
|
Reference in New Issue
Block a user