Commit e34626ef authored by chenzhao's avatar chenzhao

代扣优化项 代扣金额

parent 71269f0a
......@@ -107,8 +107,7 @@
ph.regional_companies_name AS regionalCompaniesName,
ph.regional_companies_code AS regionalCompaniesCode,
wr.paymentAmount,
wr.payment_time AS paymentTime,
wrall.paymentAmount allPaymentAmount
wr.payment_time AS paymentTime
FROM
(
SELECT
......@@ -129,7 +128,6 @@
) ph
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, 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>
ph.is_delete = 0
<if test="param.custName != null and param.custName != ''">
......@@ -159,9 +157,7 @@
</if>
</where>
<if test="param.offset != null and param.limit != null">
LIMIT ${param.offset}, ${param.limit}
</if>
ORDER BY
ph.rec_date DESC
</select>
......
......@@ -111,7 +111,7 @@ public class HygfIcbcController extends BaseController {
@GetMapping (value = "/page")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@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));
}
......
......@@ -22,6 +22,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -454,10 +455,10 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
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);
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO);
double sum = list.stream().mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
......@@ -466,7 +467,9 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
pagenew.setTotal(page.getTotal());
pagenew.setSize(size);
pagenew.setRecords(toModels(page.getList()));
return pagenew;
Map<String, Object> resultMap = Bean.BeantoMap(pagenew);
resultMap.put("paymentAmountAll",sum);
return resultMap;
// ======================================================統計錯誤=================================================================
// // 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