待清算标记更新

master
yixian 3 years ago
parent 70d1c78885
commit f548bb7ce3

@ -851,14 +851,9 @@ public class RetailAppServiceImp implements RetailAppService {
PageList<JSONObject> logs = clearingDetailMapper.listClientSettlementLog(params, PageList<JSONObject> logs = clearingDetailMapper.listClientSettlementLog(params,
new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc"))); new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc")));
logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount")))); logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount"))));
logs.forEach(log -> log.put("padding", log.getBooleanValue("editable")));
JSONObject result = PageListUtils.buildPageListResult(logs); JSONObject result = PageListUtils.buildPageListResult(logs);
if (appQueryBean.getPage() == 1 && !logs.isEmpty()) { result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable")));
JSONObject clearingLog = clearingLogMapper.findById(logs.get(0).getIntValue("clearing_id"));
if (clearingLog.getBooleanValue("editable")) {
result.put("padding", true);
logs.get(0).put("padding", true);
}
}
return result; return result;
} }

@ -4119,20 +4119,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
logs.forEach(log -> log.put("padding", log.getBooleanValue("editable")));
JSONObject result = PageListUtils.buildPageListResult(logs); JSONObject result = PageListUtils.buildPageListResult(logs);
if (query.getPage() == 1) { result.put("padding", logs.stream().anyMatch(log->log.getBooleanValue("editable")));
if (!logs.isEmpty()) { logger.info("##editable{}", result.getBooleanValue("padding"));
JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id"));
if (clearingDetail != null) {
JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id"));
if (clearingLog.getBooleanValue("editable")) {
result.put("padding", true);
logs.get(0).put("padding", true);
logger.info("##editable{}", clearingLog.getBooleanValue("editable"));
}
}
}
}
return result; return result;
} }

@ -1425,21 +1425,10 @@ public class TradeLogServiceImpl implements TradeLogService {
} }
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
logs.forEach(log -> log.put("padding", log.getBooleanValue("editable")));
result.putAll(PageListUtils.buildPageListResult(logs)); result.putAll(PageListUtils.buildPageListResult(logs));
if (query.getPage() == 1) { result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable")));
if (!logs.isEmpty()) { logger.info("##editable{}", result.getBooleanValue("padding"));
JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id"));
if (clearingDetail != null) {
JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id"));
if (clearingLog.getBooleanValue("editable")) {
result.put("padding", true);
logs.get(0).put("padding", true);
logger.info("##editable{}", clearingLog.getBooleanValue("editable"));
}
}
}
}
return result; return result;
} }

@ -91,11 +91,13 @@
<select id="listClientSettlementLog" resultType="com.alibaba.fastjson.JSONObject"> <select id="listClientSettlementLog" resultType="com.alibaba.fastjson.JSONObject">
select select
*,DATE_FORMAT(report_date,'%y-%m-%d')clear_date,DATE_FORMAT(settle_date_from,'%m-%d')settle_from,DATE_FORMAT(settle_date_to,'%m-%d')settle_to cd.*,DATE_FORMAT(cd.report_date,'%y-%m-%d')clear_date,DATE_FORMAT(cd.settle_date_from,'%m-%d')settle_from,DATE_FORMAT(cd.settle_date_to,'%m-%d')settle_to,
FROM log_clearing_detail c.editable
FROM log_clearing_detail cd
inner join log_clearing c on c.clearing_id=cd.clearing_id
<where> <where>
<if test="client_ids!=null"> <if test="client_ids!=null">
AND client_id IN AND cd.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id"> <foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id} #{client_id}
</foreach> </foreach>
@ -103,8 +105,8 @@
<if test="client_ids==null and client_id !=null"> <if test="client_ids==null and client_id !=null">
and client_id=#{client_id} and client_id=#{client_id}
</if> </if>
<if test="begin!=null">and report_date &gt;= #{begin}</if> <if test="begin!=null">and cd.report_date &gt;= #{begin}</if>
<if test="end!=null">and report_date &lt;= #{end}</if> <if test="end!=null">and cd.report_date &lt;= #{end}</if>
</where> </where>
</select> </select>
<select id="batchReport" resultType="com.alibaba.fastjson.JSONObject"> <select id="batchReport" resultType="com.alibaba.fastjson.JSONObject">

@ -577,7 +577,7 @@
AND date(r.expiry_time) >= DATE(t.clearing_time) AND date(r.expiry_time) >= DATE(t.clearing_time)
AND date(r.active_time) &lt;= DATE(t.clearing_time)) rate, AND date(r.active_time) &lt;= DATE(t.clearing_time)) rate,
t.clearing_order clear_detail_id, t.clearing_order clear_detail_id,
lc.balance_group lc.balance_group, lc.editable
FROM pmt_transactions t FROM pmt_transactions t
left join log_clearing_detail cd on cd.clear_detail_id=t.clearing_order left join log_clearing_detail cd on cd.clear_detail_id=t.clearing_order
left join log_clearing lc on cd.clearing_id = lc.clearing_id left join log_clearing lc on cd.clearing_id = lc.clearing_id

Loading…
Cancel
Save