Commit c43f4c33 authored by hezhuozhi's avatar hezhuozhi

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

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/HygfIcbcRecordMapper.xml # amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
parents eca86cdb 3f18be0c
...@@ -95,41 +95,36 @@ ...@@ -95,41 +95,36 @@
<select id="pageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO"> <select id="pageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT SELECT
icbc.sequence_nbr, icbc.sequence_nbr,
ifnull ( icbc.cust_name, ph.owners_name ) AS custName, ifnull( icbc.cust_name, ph.owners_name ) AS custName,
ifnull ( icbc.phone, ph.telephone ) AS phone, ifnull( icbc.phone, ph.telephone ) AS phone,
ifnull ( icbc.id_card, ph.id_card ) AS idCard, ifnull( icbc.id_card, ph.id_card ) AS idCard,
ph.amos_user_id, ph.amos_user_id,
icbc.open_account_status, icbc.open_account_status,
icbc.out_user_id AS outUserId, icbc.out_user_id as outUserId,
icbc.protocol_status, icbc.protocol_status,
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.paymentAmount,
wr.payment_time AS paymentTime, wr.payment_time as paymentTime
wrall.paymentAmount allPaymentAmount
FROM FROM
( (
SELECT SELECT
amos_user_id, amos_user_id,
MAX ( developer_code ) AS developer_code, MAX(developer_code) AS developer_code,
MAX ( regional_companies_code ) AS regional_companies_code, MAX(regional_companies_code ) AS regional_companies_code ,
MAX ( is_delete ) AS is_delete, MAX(is_delete) AS is_delete,
MAX ( owners_name ) AS owners_name, MAX(owners_name) AS owners_name,
MAX ( telephone ) AS telephone, MAX(telephone) AS telephone,
MAX ( id_card ) AS id_card, MAX(id_card) AS id_card,
MAX ( regional_companies_name ) AS regional_companies_name, MAX(regional_companies_name) AS regional_companies_name,
MAX ( project_address ) AS project_address, MAX(project_address) AS project_address,
MAX ( rec_date ) AS rec_date MAX(rec_date) AS rec_date
FROM FROM hygf_peasant_household GROUP BY amos_user_id
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 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
LEFT JOIN ( SELECT amos_user_id, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record GROUP BY amos_user_id ) wrall ON wrall.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 != ''">
......
...@@ -111,7 +111,7 @@ public class HygfIcbcController extends BaseController { ...@@ -111,7 +111,7 @@ public class HygfIcbcController extends BaseController {
@GetMapping (value = "/page") @GetMapping (value = "/page")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询") @ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@UserLimits @UserLimits
public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public ResponseModel<Map<String, Object>> queryForPage(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(hygfIcbcRecordQueryDTO.getCurrent(), hygfIcbcRecordQueryDTO.getSize(), hygfIcbcRecordQueryDTO)); return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(hygfIcbcRecordQueryDTO.getCurrent(), hygfIcbcRecordQueryDTO.getSize(), hygfIcbcRecordQueryDTO));
} }
......
...@@ -22,6 +22,7 @@ import javax.annotation.Resource; ...@@ -22,6 +22,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -454,10 +455,10 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -454,10 +455,10 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
return toModels(list); return toModels(list);
} }
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public Map<String, Object> 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);
double sum = list.stream().mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list); PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
...@@ -466,7 +467,9 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -466,7 +467,9 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
pagenew.setTotal(page.getTotal()); pagenew.setTotal(page.getTotal());
pagenew.setSize(size); pagenew.setSize(size);
pagenew.setRecords(toModels(page.getList())); pagenew.setRecords(toModels(page.getList()));
return pagenew; Map<String, Object> resultMap = Bean.BeantoMap(pagenew);
resultMap.put("paymentAmountAll",sum);
return resultMap;
// ======================================================統計錯誤================================================================= // ======================================================統計錯誤=================================================================
// // PageHelper.startPage(current, size); // // PageHelper.startPage(current, size);
......
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