Commit 03afed11 authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents d4430ef7 e3d39912
...@@ -79,7 +79,13 @@ public class HygfIcbcRecordExportDTO { ...@@ -79,7 +79,13 @@ public class HygfIcbcRecordExportDTO {
*/ */
@ExcelProperty(value = "扣款总金额(元)", index = 7) @ExcelProperty(value = "扣款总金额(元)", index = 7)
@ApiModelProperty (value = "扣款总金额") @ApiModelProperty (value = "扣款总金额")
private double paymentAmount; private Double paymentAmount;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelProperty(value = "最后扣款成功时间", index = 8)
@ApiModelProperty (value = "最后扣款成功时间")
private String paymentTime;
} }
\ No newline at end of file
...@@ -39,8 +39,8 @@ public class HygfIcbcWithholdRecordExportDTO { ...@@ -39,8 +39,8 @@ public class HygfIcbcWithholdRecordExportDTO {
/** /**
* 手机号码 * 手机号码
*/ */
@ExcelProperty(value = "批次号", index = 2) @ExcelProperty(value = "扣款批次号", index = 2)
@ApiModelProperty (value = "批次号") @ApiModelProperty (value = "扣款批次号")
private String batchNo; private String batchNo;
/** /**
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -76,6 +77,11 @@ public class IcbcWithholdDto extends BaseDto { ...@@ -76,6 +77,11 @@ public class IcbcWithholdDto extends BaseDto {
private String receiptFile; private String receiptFile;
@ApiModelProperty(value = "缴费开始时间")
private String paymentStartTime;
@ApiModelProperty(value = "缴费结束时间")
private String paymentEndTime;
/** /**
* 失败原因 * 失败原因
*/ */
......
...@@ -103,6 +103,8 @@ public class IcbcWithholdRecordDto extends BaseDto { ...@@ -103,6 +103,8 @@ public class IcbcWithholdRecordDto extends BaseDto {
private String amosUserId; private String amosUserId;
@ExcelIgnore @ExcelIgnore
private String contentText; private String contentText;
@ExcelIgnore
private String show;
@ExcelIgnore @ExcelIgnore
private String regionalCompaniesCode; private String regionalCompaniesCode;
......
...@@ -300,14 +300,16 @@ ...@@ -300,14 +300,16 @@
ELSE '未开户' ELSE '未开户'
END END
) AS openAccountStatus, ) AS openAccountStatus,
pa.paymentAmount AS paymentAmount pa.paymentAmount AS paymentAmount,
MAX(pa.payTime) paymentTime
FROM FROM
`hygf_peasant_household` ph `hygf_peasant_household` ph
LEFT JOIN LEFT JOIN
hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id
LEFT JOIN( SELECT LEFT JOIN( SELECT
iw.amos_user_id, iw.amos_user_id,
SUM(iw.payment_amount) AS paymentAmount SUM(iw.payment_amount) AS paymentAmount,
MAX(payment_time) as payTime
FROM FROM
hygf_icbc_withhold_record iw hygf_icbc_withhold_record iw
WHERE WHERE
...@@ -349,6 +351,6 @@ ...@@ -349,6 +351,6 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
ph.amos_user_id, pa.paymentAmount; ph.amos_user_id, pa.paymentAmount
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -161,6 +161,9 @@ ...@@ -161,6 +161,9 @@
<if test="dto.amosUserId != null and dto.amosUserId != ''"> <if test="dto.amosUserId != null and dto.amosUserId != ''">
AND re.amos_user_id = #{dto.amosUserId} AND re.amos_user_id = #{dto.amosUserId}
</if> </if>
<if test="dto.show != null and dto.show != ''">
AND re.withhold_status in ('成功','失败')
</if>
<if test="dto.batchNo != null and dto.batchNo != ''"> <if test="dto.batchNo != null and dto.batchNo != ''">
AND re.batch_no like concat('%',#{dto.batchNo},'%') AND re.batch_no like concat('%',#{dto.batchNo},'%')
</if> </if>
......
...@@ -172,10 +172,8 @@ public class IcbcWithholdController extends BaseController { ...@@ -172,10 +172,8 @@ public class IcbcWithholdController extends BaseController {
@ApiOperation(httpMethod = "POST",value = " 聚富通代扣信息文件生成", notes = " 聚富通代扣信息文件生成") @ApiOperation(httpMethod = "POST",value = " 聚富通代扣信息文件生成", notes = " 聚富通代扣信息文件生成")
@PostMapping(value = "/fileGeneration") @PostMapping(value = "/fileGeneration")
@Transactional @Transactional
public ResponseModel fileGeneration(@RequestBody List<IcbcWithhold> models ) throws Exception { public ResponseModel fileGeneration(@RequestBody IcbcWithhold model) throws Exception {
for (IcbcWithhold model : models) {
icbcWithholdServiceImpl.fileGeneration(model); icbcWithholdServiceImpl.fileGeneration(model);
}
return CommonResponseNewUtil.success(); return CommonResponseNewUtil.success();
} }
...@@ -246,7 +244,7 @@ public class IcbcWithholdController extends BaseController { ...@@ -246,7 +244,7 @@ public class IcbcWithholdController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "批次明细信息下载", notes = "批次明细信息下载") @ApiOperation(httpMethod = "POST",value = "批次明细信息下载", notes = "批次明细信息下载")
@PostMapping(value = "/export") @PostMapping(value = "/export")
public void downTemplate(HttpServletResponse response, @RequestBody IcbcWithhold model ) { public void downTemplate(HttpServletResponse response, @RequestBody IcbcWithholdDto model ) {
icbcWithholdServiceImpl.exportData(response,model); icbcWithholdServiceImpl.exportData(response,model);
} }
......
...@@ -44,6 +44,7 @@ public class IcbcWithholdRecordServiceImpl extends BaseService<IcbcWithholdRecor ...@@ -44,6 +44,7 @@ public class IcbcWithholdRecordServiceImpl extends BaseService<IcbcWithholdRecor
Page<IcbcWithholdRecordDto> page = new Page<>(); Page<IcbcWithholdRecordDto> page = new Page<>();
PageHelper.startPage(current,size); PageHelper.startPage(current,size);
dto.setShow("1");
List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto); List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto);
PageInfo<IcbcWithholdRecordDto> pageInfo = new PageInfo<>(dtos); PageInfo<IcbcWithholdRecordDto> pageInfo = new PageInfo<>(dtos);
......
...@@ -659,7 +659,9 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -659,7 +659,9 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
page.setTotal(pageInfo.getTotal()); page.setTotal(pageInfo.getTotal());
page.setRecords(icbcWithholdDtos); page.setRecords(icbcWithholdDtos);
Map<String, Object> resultMap = BeanUtil.beanToMap(page); Map<String, Object> resultMap = BeanUtil.beanToMap(page);
resultMap.put("paymentAmountAll",dto.getPaymentAmount()); if (!Objects.isNull(dto)){
resultMap.put("paymentAmountAll",null ==dto.getPaymentAmount()?0:dto.getPaymentAmount());
}
return resultMap; return resultMap;
} }
...@@ -721,28 +723,38 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -721,28 +723,38 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
public void exportData(HttpServletResponse response, IcbcWithhold icbcWithhold ){ public void exportData(HttpServletResponse response, IcbcWithholdDto icbcWithhold ){
String fileName = "付款记录明细";
List<HygfIcbcWithholdRecordExportDTO> datas = new ArrayList<>(); List<HygfIcbcWithholdRecordExportDTO> datas = new ArrayList<>();
IcbcWithholdRecordDto dto = new IcbcWithholdRecordDto(); IcbcWithholdRecordDto dto = new IcbcWithholdRecordDto();
if (StringUtils.isNotEmpty(icbcWithhold.getBatchNo())){ if (StringUtils.isNotEmpty(icbcWithhold.getBatchNo())){
dto.setBatchNo(icbcWithhold.getBatchNo()); dto.setBatchNo(icbcWithhold.getBatchNo());
fileName = icbcWithhold.getBatchNo()+"批次批扣明细记录";
}
if (StringUtils.isNotEmpty(icbcWithhold.getPaymentStartTime())){
dto.setPaymentStartTime(icbcWithhold.getPaymentStartTime());
}
if (StringUtils.isNotEmpty(icbcWithhold.getPaymentEndTime())){
dto.setPaymentEndTime(icbcWithhold.getPaymentEndTime());
} }
if (StringUtils.isNotEmpty(icbcWithhold.getIcbcId())){ if (StringUtils.isNotEmpty(icbcWithhold.getIcbcId())){
dto.setAmosUserId(icbcWithhold.getIcbcId()); dto.setAmosUserId(icbcWithhold.getIcbcId());
dto.setShow("1");
} }
List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto); List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto);
if (CollectionUtil.isNotEmpty(dtos)) {
for (IcbcWithholdRecordDto icbcWithholdRecordDto : dtos) {
HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO(); for (IcbcWithholdRecordDto icbcWithholdRecordDto : dtos) {
BeanUtil.copyProperties(icbcWithholdRecordDto,exportDTO); HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO();
exportDTO.setDesc(icbcWithholdRecordDto.getContentText()); BeanUtil.copyProperties(icbcWithholdRecordDto, exportDTO);
exportDTO.setUploader(icbcWithholdRecordDto.getRecUserName()); exportDTO.setDesc(icbcWithholdRecordDto.getContentText());
datas.add(exportDTO); exportDTO.setUploader(icbcWithholdRecordDto.getRecUserName());
datas.add(exportDTO);
}
} }
if (CollectionUtil.isNotEmpty(datas)){ if (CollectionUtil.isNotEmpty(datas)){
ExcelUtil.createTemplate(response,"付款记录明细","付款记录明细",datas,HygfIcbcWithholdRecordExportDTO.class,null,false); ExcelUtil.createTemplate(response,fileName,"付款记录明细",datas,HygfIcbcWithholdRecordExportDTO.class,null,false);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment