upd:bd数据分析生成条件

master
dulingling 5 years ago
parent 79f3a40c93
commit 7f9bcd2cf3

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.20</version> <version>2.3.21</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.3.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.3.0</jib-maven-plugin.version>

@ -197,7 +197,7 @@ public class BDAnalysisServiceImpl implements BDAnalysisService {
List<JSONObject> bdSaleList = bdAnalysisMapper.getOneDayBDSaleList(params); List<JSONObject> bdSaleList = bdAnalysisMapper.getOneDayBDSaleList(params);
if (bdSaleList.size() != 0) { if (bdSaleList.size() != 0) {
for (JSONObject item : bdSaleList) { for (JSONObject item : bdSaleList) {
JSONObject existBDSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"),beginTime,0); JSONObject existBDSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"),date,0);
if(existBDSalesReport==null){ if(existBDSalesReport==null){
JSONObject object = new JSONObject(item); JSONObject object = new JSONObject(item);
object.put("log_id", UUID.randomUUID().toString()); object.put("log_id", UUID.randomUUID().toString());
@ -215,7 +215,7 @@ public class BDAnalysisServiceImpl implements BDAnalysisService {
List<JSONObject> orgSaleList= transactionAnalysisMapper.getOneDayOrgMerchantSaleList(params); List<JSONObject> orgSaleList= transactionAnalysisMapper.getOneDayOrgMerchantSaleList(params);
if (orgSaleList.size() != 0) { if (orgSaleList.size() != 0) {
for (JSONObject item : orgSaleList) { for (JSONObject item : orgSaleList) {
JSONObject existOrgSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"),beginTime,1); JSONObject existOrgSalesReport = bdSalesReportMapper.findByBDIdAndLogDate(item.getString("org_id"),item.getString("bd_id"), date,1);
if(existOrgSalesReport==null){ if(existOrgSalesReport==null){
JSONObject object = new JSONObject(item); JSONObject object = new JSONObject(item);
object.put("log_id", UUID.randomUUID().toString()); object.put("log_id", UUID.randomUUID().toString());

@ -22,7 +22,7 @@ public interface StatisticsBDSalesReportMapper {
List<JSONObject> getPartnerAmountList(JSONObject params); List<JSONObject> getPartnerAmountList(JSONObject params);
JSONObject findByBDIdAndLogDate(@Param("org_id") String org_id,@Param("bd_id") String bd_id, @Param("log_date")Date beginTime,@Param("isOrg") int isOrg); JSONObject findByBDIdAndLogDate(@Param("org_id") String org_id,@Param("bd_id") String bd_id, @Param("log_date")String beginTime,@Param("isOrg") int isOrg);
@AutoSql(SqlType.UPDATE) @AutoSql(SqlType.UPDATE)
void update(JSONObject existBDSalesReport); void update(JSONObject existBDSalesReport);

@ -206,7 +206,7 @@
org.org_id, org.org_id,
org.type AS org_type, org.type AS org_type,
org.name AS org_name, org.name AS org_name,
0 AS isOrg, 0 AS is_org,
0 AS clearing_amount, 0 AS clearing_amount,
SUM(if(temp.transaction_type = 'Credit',temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion)) pay_amount, SUM(if(temp.transaction_type = 'Credit',temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion)) pay_amount,
ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0) refund_amount, ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0) refund_amount,

@ -1068,7 +1068,7 @@
org.org_id AS org_id, org.org_id AS org_id,
org.name AS org_name, org.name AS org_name,
org.type AS org_type, org.type AS org_type,
1 AS isOrg, 1 AS is_org,
SUM(IF( trans.transaction_type = 'Credit', trans.clearing_amount, - trans.clearing_amount )) AS clearing_amount, SUM(IF( trans.transaction_type = 'Credit', trans.clearing_amount, - trans.clearing_amount )) AS clearing_amount,
0 AS pay_amount, 0 AS pay_amount,
0 AS refund_amount, 0 AS refund_amount,

@ -10,7 +10,7 @@
SUM(pay_amount) AS total, SUM(pay_amount) AS total,
SUM(refund_amount) AS refund_fee SUM(refund_amount) AS refund_fee
FROM statistics_bd_sales FROM statistics_bd_sales
WHERE isOrg = 0 WHERE is_org = 0
<if test="org_id != null"> <if test="org_id != null">
AND org_id = #{org_id} AND org_id = #{org_id}
</if> </if>
@ -42,7 +42,7 @@
SUM(pay_amount) AS total, SUM(pay_amount) AS total,
SUM(refund_amount) AS refund_fee SUM(refund_amount) AS refund_fee
FROM statistics_bd_sales FROM statistics_bd_sales
WHERE isOrg = 1 AND org_id!=1 WHERE is_org = 1 AND org_id!=1
<if test="org_id != null"> <if test="org_id != null">
AND org_id = #{org_id} AND org_id = #{org_id}
</if> </if>
@ -67,7 +67,7 @@
SELECT SELECT
log_id, log_id,
org_id, org_id,
isOrg, is_org,
org_name, org_name,
org_type, org_type,
bd_id, bd_id,
@ -81,7 +81,7 @@
FROM statistics_bd_sales FROM statistics_bd_sales
WHERE org_id = #{org_id} WHERE org_id = #{org_id}
AND log_date = #{log_date} AND log_date = #{log_date}
AND isOrg = #{isOrg} AND is_org = #{isOrg}
<if test="bd_id != null"> AND bd_id = #{bd_id}</if> <if test="bd_id != null"> AND bd_id = #{bd_id}</if>
</select> </select>

Loading…
Cancel
Save