Commit c1bc29f3 authored by chenzhao's avatar chenzhao

代扣优化项

parent f7a18731
...@@ -181,4 +181,8 @@ public class HygfIcbcRecordDTO { ...@@ -181,4 +181,8 @@ public class HygfIcbcRecordDTO {
} }
@ApiModelProperty (value = "代扣金额") @ApiModelProperty (value = "代扣金额")
private double paymentAmount; private double paymentAmount;
@ApiModelProperty (value = "代扣时间")
private String paymentTime;
} }
\ No newline at end of file
...@@ -101,6 +101,8 @@ public class IcbcWithholdRecordDto extends BaseDto { ...@@ -101,6 +101,8 @@ public class IcbcWithholdRecordDto extends BaseDto {
private String outUserId; private String outUserId;
@ExcelIgnore @ExcelIgnore
private String amosUserId; private String amosUserId;
@ExcelIgnore
private String contentText;
@ExcelIgnore @ExcelIgnore
private String regionalCompaniesCode; private String regionalCompaniesCode;
......
...@@ -101,6 +101,12 @@ public class IcbcWithholdRecord extends BaseEntity { ...@@ -101,6 +101,12 @@ public class IcbcWithholdRecord extends BaseEntity {
private String regionalCompaniesName; private String regionalCompaniesName;
/* /*
* 备注
* */
@TableField("content_text")
private String contentText;
/*
* *
* */ * */
@TableField("phone") @TableField("phone")
......
...@@ -18,4 +18,8 @@ import java.util.List; ...@@ -18,4 +18,8 @@ import java.util.List;
public interface IcbcWithholdRecordMapper extends BaseMapper<IcbcWithholdRecord> { public interface IcbcWithholdRecordMapper extends BaseMapper<IcbcWithholdRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and",specific=false) @UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and",specific=false)
List<IcbcWithholdRecordDto> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district, String year, String month, List<String> quarters, @Param("dto")IcbcWithholdRecordDto dto); List<IcbcWithholdRecordDto> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district, String year, String month, List<String> quarters, @Param("dto")IcbcWithholdRecordDto dto);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and",specific=false)
List<IcbcWithholdRecordDto> exportData( @Param("dto")IcbcWithholdRecordDto dto);
} }
...@@ -105,7 +105,9 @@ ...@@ -105,7 +105,9 @@
icbc.medium_id, icbc.medium_id,
ph.rec_date, ph.rec_date,
ph.regional_companies_name as regionalCompaniesName, ph.regional_companies_name as regionalCompaniesName,
ph.regional_companies_code as regionalCompaniesCode ph.regional_companies_code as regionalCompaniesCode,
wr.paymentAmount,
wr.payment_time as paymentTime
FROM FROM
( (
SELECT SELECT
...@@ -122,6 +124,7 @@ ...@@ -122,6 +124,7 @@
FROM hygf_peasant_household GROUP BY amos_user_id FROM hygf_peasant_household GROUP BY amos_user_id
) ph ) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id
<where> <where>
ph.is_delete = 0 ph.is_delete = 0
<if test="param.custName != null and param.custName != ''"> <if test="param.custName != null and param.custName != ''">
......
...@@ -137,4 +137,45 @@ ...@@ -137,4 +137,45 @@
ORDER BY ORDER BY
re.rec_date DESC re.rec_date DESC
</select> </select>
<select id="exportData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto">
SELECT
re.*
FROM
(
SELECT
amos_user_id,
MAX(developer_code) AS developer_code,
MAX(regional_companies_code ) AS regional_companies_code ,
MAX(is_delete) AS is_delete,
MAX(owners_name) AS owners_name,
MAX(telephone) AS telephone,
MAX(id_card) AS id_card,
MAX(regional_companies_name) AS regional_companies_name,
MAX(project_address) AS project_address,
MAX(rec_date) AS rec_date
FROM hygf_peasant_household GROUP BY amos_user_id
) ph
LEFT JOIN hygf_icbc_withhold_record re ON ph.amos_user_id = re.amos_user_id
<where>
ph.is_delete = 0
<if test="dto.amosUserId != null and dto.amosUserId != ''">
AND re.amos_user_id = #{dto.amosUserId}
</if>
<if test="dto.batchNo != null and dto.batchNo != ''">
AND re.batch_no like concat('%',#{dto.batchNo},'%')
</if>
<if test="dto.withholdStatus != null and dto.withholdStatus != ''">
AND re.withhold_status = #{dto.withholdStatus}
</if>
<if test="dto.paymentStartTime != null and dto.paymentStartTime != ''">
AND re.payment_time > #{dto.paymentStartTime}
</if>
<if test="dto.paymentEndTime != null and dto.paymentEndTime != ''">
AND re.payment_time <![CDATA[<]]> #{dto.paymentEndTime}
</if>
</where>
ORDER BY
re.rec_date DESC
</select>
</mapper> </mapper>
...@@ -457,6 +457,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -457,6 +457,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
PageHelper.startPage(current, size); PageHelper.startPage(current, size);
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO);
for (HygfIcbcRecordDTO hygfIcbcRecordDTO : list) {
}
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list); PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
Page<HygfIcbcRecordDTO> pagenew = new Page<>(); Page<HygfIcbcRecordDTO> pagenew = new Page<>();
pagenew.setCurrent(current); pagenew.setCurrent(current);
......
...@@ -44,7 +44,7 @@ public class IcbcWithholdRecordServiceImpl extends BaseService<IcbcWithholdRecor ...@@ -44,7 +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);
List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportTotal(null, null, null, null, null,null,null,null,dto); List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto);
PageInfo<IcbcWithholdRecordDto> pageInfo = new PageInfo<>(dtos); PageInfo<IcbcWithholdRecordDto> pageInfo = new PageInfo<>(dtos);
page.setSize(pageInfo.getSize()); page.setSize(pageInfo.getSize());
......
...@@ -145,6 +145,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -145,6 +145,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
withholdLoopField.setBillNo(++billNo); withholdLoopField.setBillNo(++billNo);
recordDTO.setBatchNo(batchNo); recordDTO.setBatchNo(batchNo);
recordDTO.setProjectId(projectId); recordDTO.setProjectId(projectId);
recordDTO.setContentText(model.getDesc());
withholdLoopField.setBusiCode(recordDTO.getOutUserId()); withholdLoopField.setBusiCode(recordDTO.getOutUserId());
withholdLoopField.setBusiAcct(recordDTO.getMediumId()); withholdLoopField.setBusiAcct(recordDTO.getMediumId());
withholdLoopField.setBusiName(recordDTO.getCustName()); withholdLoopField.setBusiName(recordDTO.getCustName());
...@@ -225,6 +226,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -225,6 +226,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
model.getRecordDTOS().forEach(e->{ model.getRecordDTOS().forEach(e->{
e.setSequenceNbr(null); e.setSequenceNbr(null);
e.setBatchNo(batch); e.setBatchNo(batch);
e.setContentText(model.getDesc());
e.setProjectId(projectId); e.setProjectId(projectId);
}); });
icbcWithholdRecordService.saveBatch(model.getRecordDTOS()); icbcWithholdRecordService.saveBatch(model.getRecordDTOS());
...@@ -722,7 +724,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -722,7 +724,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
if (StringUtils.isNotEmpty(icbcWithhold.getIcbcId())){ if (StringUtils.isNotEmpty(icbcWithhold.getIcbcId())){
dto.setAmosUserId(icbcWithhold.getIcbcId()); dto.setAmosUserId(icbcWithhold.getIcbcId());
} }
List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportTotal(null, null, null, null, null,null,null,null,dto); List<IcbcWithholdRecordDto> dtos = icbcWithholdRecordMapper.exportData(dto);
for (IcbcWithholdRecordDto icbcWithholdRecordDto : dtos) { for (IcbcWithholdRecordDto icbcWithholdRecordDto : dtos) {
HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO(); HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO();
...@@ -732,7 +734,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -732,7 +734,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
} }
if (CollectionUtil.isNotEmpty(datas)){ if (CollectionUtil.isNotEmpty(datas)){
ExcelUtil.createTemplate(response,icbcWithhold.getBatchNo()+"人员信息",icbcWithhold.getBatchNo()+"人员信息",datas,HygfIcbcRecordExportDTO.class,null,false); ExcelUtil.createTemplate(response,icbcWithhold.getBatchNo()+"导出明细",icbcWithhold.getBatchNo()+"人员信息",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