Browse Source

利润单-全部账户

yangzian 4 years ago
parent
commit
cea0fe3a35

+ 3 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportBytedanceVo.java

@@ -20,6 +20,9 @@ public class ProfitReportBytedanceVo implements Serializable {
     @Excel(name = "产品名称",width = 25)
     private String productName;
 
+    @Excel(name = "账户ID",width = 25)
+    private String accountId;
+
     @Excel(name = "总消耗",width = 10)
     private String cost;
 

+ 16 - 16
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -220,9 +220,9 @@
 
         SELECT
         d.advertiser_id as accountId,
-        SUM( d.cost ) AS cost,
-        SUM( d.cash_cost ) AS cashCost,
-        SUM( d.reward_cost ) rewardCost,
+        ROUND(SUM( d.cost ),2) AS cost,
+        ROUND(SUM( d.cash_cost ),2) AS cashCost,
+        ROUND(SUM( d.reward_cost ),2) as rewardCost,
         IFNULL((SELECT a.name from ctop_user_allocation u,ctop_advertiser a where d.advertiser_id = u.account_id and u.advertiser_id = a.id),(SELECT a.name
         from ctop_cwjs_settlement_info c ,ctop_advertiser a where c.account_id = d.advertiser_id and c.advertiser_id = a.id)) as advertiserName,
         IFNULL((SELECT
@@ -282,15 +282,17 @@
         SUM( d.reward_cost ) rewardCost
         FROM
         ctop_account_transaction_day d
-        <if test="accountId !=null and accountId != ''">
-            AND d.advertiser_id = #{accountId}
-        </if>
-        <if test="startTime !=null and startTime != ''">
-            AND d.date &gt;= #{startTime}
-        </if>
-        <if test="endTime !=null and endTime != ''">
-            AND d.date &lt;= #{endTime}
-        </if>
+        <where>
+            <if test="accountId !=null and accountId != ''">
+                AND d.advertiser_id = #{accountId}
+            </if>
+            <if test="startTime !=null and startTime != ''">
+                AND d.date &gt;= #{startTime}
+            </if>
+            <if test="endTime !=null and endTime != ''">
+                AND d.date &lt;= #{endTime}
+            </if>
+        </where>
 
     </select>
 
@@ -347,9 +349,7 @@
         <if test="mediaType !=null and mediaType != ''">
             AND cp.media_type = #{mediaType}
         </if>
-        <if test="productName !=null and productName != ''">
             AND r.product_name = #{productName}
-        </if>
         <if test="startTime !=null and startTime != ''">
             AND  r.policy_date &gt;= #{startTime}
         </if>
@@ -502,8 +502,8 @@
         SELECT
         d.account_id as accountId,
         d.user_id AS ksId,
-        SUM(d.total_charged_in_yuan) AS cost,
-        SUM((d.real_charged_in_yuan + d.total_rebate_real_charged_in_yuan + d.credit_real_charged_in_yuan)) as cashCost,
+        round(SUM(d.total_charged_in_yuan),3) AS cost,
+        round(SUM((d.real_charged_in_yuan + d.total_rebate_real_charged_in_yuan + d.credit_real_charged_in_yuan)),3) as cashCost,
         IFNULL((SELECT a.name from ctop_user_allocation u,ctop_advertiser a where d.account_id = u.account_id and u.advertiser_id = a.id),(SELECT a.name
         from ctop_cwjs_settlement_info c ,ctop_advertiser a where c.account_id = d.account_id and c.advertiser_id = a.id)) as advertiserName,
         IFNULL((SELECT

+ 159 - 127
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java

@@ -2,7 +2,9 @@ package org.jeecg.ctop.finance.settlement.service.serviceImpl;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.com.ctop.common.module.entity.SysLog;
 import cn.com.ctop.common.module.mapper.MailLogMapper;
+import cn.com.ctop.common.module.mapper.SysLogMapper;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import cn.com.ctop.common.module.utils.ImageUtils;
 import com.alibaba.fastjson.JSONObject;
@@ -64,6 +66,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
     private CwjsProfitMapper cwjsProfitMapper;
 
 
+    @Resource
+    private SysLogMapper sysLogMapper;
+
+
     @Override
     public List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance() {
         return reportSettlementMapper.getAccountTransactionDayBytedance(null);
@@ -478,80 +484,93 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
             }
             List<ProfitReportBytedanceVo> resultList = new ArrayList<>(list.size());
             for (Map<String, Object> map : list) {
-              /*  //查看该账户 状态信息
-                QueryWrapper<CtopCwjsSettlementInfo> settlementAccountQw = new QueryWrapper<>();
-                settlementAccountQw.eq("account_id",map.get("accountId"));
-                //账户状态 0-开 1-关
-                settlementAccountQw.eq("status",0);
-                //(0,正常,1已删除)
-                settlementAccountQw.eq("del_flag",0);
-                List<CtopCwjsSettlementInfo> settlementAccountList =  settlementInfoMapper.selectList(settlementAccountQw);
-                if (Check.isNull(settlementAccountList)){
+              //查看该账户 状态信息
+                //查看该账户 状态信息
+                QueryWrapper<SysLog> sysLogQw = new QueryWrapper<>();
+                sysLogQw.eq("log_type", 2);
+                //操作类型
+                sysLogQw.eq("operate_type", 10001);
+                sysLogQw.eq("log_content", "0");//0开 1关
+                sysLogQw.eq("request_param", map.get("accountId").toString());
+                sysLogQw.orderByDesc("create_time");
+                sysLogQw.last("limit 1");
+                SysLog sysLog = sysLogMapper.selectOne(sysLogQw);
+                if (Check.isNull(sysLog)) {
                     continue;
-                }*/
-
+                }
+                if (sysLog.getLogContent().equals("1")){
+                    continue;
+                }
                 ProfitReportBytedanceVo voSource = new ProfitReportBytedanceVo();
+                voSource.setAccountId(map.get("accountId")+"");
+
                 //查询销售
                 Map<String,Object> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("accountId")+"");
                 voSource.setSaleName(Check.isNull(slaeMap) ? "" : slaeMap.getOrDefault("saleName","")+"");//销售
 
+                voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName","")+"" : "" );//广告主名称
                 //产品名称
-                voSource.setProductName(map.getOrDefault("productName","")+"");
+                voSource.setProductName(!Check.isNull(map.get("productName")) ? map.getOrDefault("productName","")+"" : "" );
 
                 Map<String,Object> operateMap = reportSettlementMapper.getProfitBytedanceOperate(map.get("accountId")+"");
                 if (!Check.isNull(operateMap)){
-                    voSource.setAdvertiserName(operateMap.getOrDefault("advertiserName","")+"");//广告主名称
                     voSource.setOperateName(operateMap.getOrDefault("operateName","")+"");//运营
                     voSource.setOperateArea(operateMap.getOrDefault("operateArea","")+"");//运营所属区域
                 }
-
-                //查询 头条利润表  返点类型和比列
-                List<Map<String,Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("productName")+"","1",paramsVo.getStartTime(),paramsVo.getEndTime());
-                List listPolicyTIme = new ArrayList();
-                for (Map<String, Object> rate : rateMap) {
-                    listPolicyTIme.add(rate.get("policyStartDate"));
-                    listPolicyTIme.add(rate.get("policyEndDate"));
-                }
-                //政策时间 去重 排序
-                List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
-                // 使用政策的时间段 拼接 开始 和 截至 时间
-                List<Map<String, String>> arrayList = new ArrayList<>();
-                for ( int i = 0; i < times.size(); i++) {
-                    HashMap<String, String> mapTime = new HashMap<>();
-                    mapTime.put("startDate", times.get(i).toString());
-                    mapTime.put("endDate",  times.get(i+1).toString());
-                    i += 1;
-                    arrayList.add(mapTime);
-                }
-
                 //政策所有时间点
                 List<String> policyDaysList = new ArrayList<>();
-                for (Map<String, String> stringMap : arrayList) {
-                    ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
-                    //使用政策 返点类型和比例
-                    Map<String,Object>  policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    if (!Check.isNull(policyRateMap)){
-                        if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 0){
-                            vo.setRebateType("返现");//返点类型
-                        }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 1){
-                            vo.setRebateType("返货");
-                        }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 2){
-                            vo.setRebateType("返现+返货");
+                if (!Check.isNull(map.get("productName"))){
+                    //查询 头条利润表  返点类型和比列
+                    List<Map<String,Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("productName")+"","1",paramsVo.getStartTime(),paramsVo.getEndTime());
+                    List listPolicyTIme = new ArrayList();
+                    for (Map<String, Object> rate : rateMap) {
+                        listPolicyTIme.add(rate.get("policyStartDate"));
+                        listPolicyTIme.add(rate.get("policyEndDate"));
+                    }
+                    //政策时间 去重 排序
+                    List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
+                    // 使用政策的时间段 拼接 开始 和 截至 时间
+                    List<Map<String, String>> arrayList = new ArrayList<>();
+                    for ( int i = 0; i < times.size(); i++) {
+                        HashMap<String, String> mapTime = new HashMap<>();
+                        mapTime.put("startDate", times.get(i).toString());
+                        mapTime.put("endDate",  times.size() < 2 ? times.get(i).toString() : times.get(i + 1).toString());
+                        i += 1;
+                        arrayList.add(mapTime);
+                    }
+
+
+                    for (Map<String, String> stringMap : arrayList) {
+                        ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
+                        //使用政策 返点类型和比例
+                        Map<String,Object>  policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
+                        if (!Check.isNull(policyRateMap)){
+                            if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 0){
+                                vo.setRebateType("返现");//返点类型
+                            }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 1){
+                                vo.setRebateType("返货");
+                            }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 2){
+                                vo.setRebateType("返现+返货");
+                            }
+                            vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"%");//返点比列
+                        }else {
+                            vo.setRebateType("");
                         }
-                        vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"%");//返点比列
-                    }else {
-                        vo.setRebateType("");
+                        // 时间段内 账户流水 信息
+                        List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
+                        listAccount.removeAll(Collections.singleton(null));
+                        vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
+                        vo.setCost(String.format("%.3f",new Double(vo.getCost())));
+                        vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
+                        vo.setCashCost(String.format("%.3f",new Double(vo.getCashCost())));
+                        vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
+                        vo.setRewardCost(String.format("%.3f",new Double(vo.getRewardCost())));
+                        BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
+                        vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
+                        resultList.add(vo);
+                        policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
                     }
-                    // 时间段内 账户流水 信息
-                    List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    listAccount.removeAll(Collections.singleton(null));
-                    vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
-                    vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
-                    vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
-                    BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
-                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
-                    resultList.add(vo);
-                    policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
+
                 }
 
                 //不使用政策 的时间段
@@ -573,10 +592,13 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
                     listAccount.removeAll(Collections.singleton(null));
                     vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
+                    vo.setCost(String.format("%.3f",new Double(vo.getCost())));
                     vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
+                    vo.setCashCost(String.format("%.3f",new Double(vo.getCashCost())));
                     vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
+                    vo.setRewardCost(String.format("%.3f",new Double(vo.getRewardCost())));
                     BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
-                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
+                    vo.setTime((!Check.isNull(vo.getRebateType()) ? stringMap.get("startDate")+"----"+stringMap.get("endDate") : ""));
                     resultList.add(vo);
                 }
             }
@@ -599,7 +621,6 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
     }
 
 
-
     /**
      *
      * @description: 财务结算 利润表导出 快手
@@ -620,88 +641,99 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
             List<ProfitReportKuaiShouVo> resultList = new ArrayList<>(list.size());
             for (Map<String, Object> map : list) {
                 //查看该账户 状态信息
-                QueryWrapper<CtopCwjsSettlementInfo> settlementAccountQw = new QueryWrapper<>();
-                settlementAccountQw.eq("account_id",map.get("accountId"));
-                //账户状态 0-开 1-关
-                settlementAccountQw.eq("status",0);
-                //(0,正常,1已删除)
-                settlementAccountQw.eq("del_flag",0);
-                List<CtopCwjsSettlementInfo> settlementAccountList =  settlementInfoMapper.selectList(settlementAccountQw);
-                if (Check.isNull(settlementAccountList)){
+                QueryWrapper<SysLog> sysLogQw = new QueryWrapper<>();
+                sysLogQw.eq("log_type", 2);
+                //操作类型
+                sysLogQw.eq("operate_type", 10001);
+                sysLogQw.eq("log_content", "0");//0开 1关
+                sysLogQw.eq("request_param", map.get("accountId").toString());
+                sysLogQw.orderByDesc("create_time");
+                sysLogQw.last("limit 1");
+                SysLog sysLog = sysLogMapper.selectOne(sysLogQw);
+                if (Check.isNull(sysLog)) {
+                    continue;
+                }
+                if (sysLog.getLogContent().equals("1")){
                     continue;
                 }
+
                 ProfitReportKuaiShouVo voSource = new ProfitReportKuaiShouVo();
 
-                voSource.setAccountId(map.getOrDefault("accountId","")+"");//账户id
-                voSource.setProductName(map.getOrDefault("productName","")+"");//产品名称
-                voSource.setKsId(map.getOrDefault("ksId","")+"");//快手id
-                voSource.setAdvertiserName(map.getOrDefault("advertiserName","")+"");//广告主名称
+                voSource.setAccountId(map.getOrDefault("accountId", "") + "");//账户id
+                voSource.setProductName( !Check.isNull(map.get("productName")) ? map.getOrDefault("productName", "") + "" : "");//产品名称
+                voSource.setKsId(map.getOrDefault("ksId", "") + "");//快手id
+                voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName", "") + "" : "");//广告主名称
 
                 //查询销售
-                Map<String,Object> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("accountId")+"");
-                voSource.setSaleName(Check.isNull(slaeMap) ? "" : slaeMap.getOrDefault("saleName","")+"");//销售
-
-                Map<String,Object> operateMap = reportSettlementMapper.getProfitKuaiShouOperate(map.get("accountId")+"");
-                if (!Check.isNull(operateMap)){
-                    voSource.setOperateName(operateMap.getOrDefault("operateName","")+"");//运营
-                    voSource.setOperateArea(operateMap.getOrDefault("operateArea","")+"");//运营所属区域
-                }
-
-                //查询 快手利润表  返点类型和比列
-                List<Map<String,Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("productName")+"","2",paramsVo.getStartTime(),paramsVo.getEndTime());
-                List listPolicyTIme = new ArrayList();
-                for (Map<String, Object> rate : rateMap) {
-                    listPolicyTIme.add(rate.get("policyStartDate"));
-                    listPolicyTIme.add(rate.get("policyEndDate"));
-                }
+                Map<String, Object> slaeMap = reportSettlementMapper.getProfitBytedanceSale(map.get("accountId") + "");
+                voSource.setSaleName(Check.isNull(slaeMap) ? "" : slaeMap.getOrDefault("saleName", "") + "");//销售
 
-                //政策时间 去重 排序
-                List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
-                // 使用政策的时间段 拼接 开始 和 截至 时间
-                List<Map<String, String>> arrayList = new ArrayList<>();
-                for ( int i = 0; i < times.size(); i++) {
-                    HashMap<String, String> mapTime = new HashMap<>();
-                    mapTime.put("startDate", times.get(i).toString());
-                    mapTime.put("endDate",  times.get(i+1).toString());
-                    i += 1;
-                    arrayList.add(mapTime);
+                Map<String, Object> operateMap = reportSettlementMapper.getProfitKuaiShouOperate(map.get("accountId") + "");
+                if (!Check.isNull(operateMap)) {
+                    voSource.setOperateName(operateMap.getOrDefault("operateName", "") + "");//运营
+                    voSource.setOperateArea(operateMap.getOrDefault("operateArea", "") + "");//运营所属区域
                 }
 
                 //政策所有时间点
                 List<String> policyDaysList = new ArrayList<>();
-                for (Map<String, String> stringMap : arrayList) {
-                    ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
-                    //使用政策 返点类型和比例
-                    Map<String,Object>  policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    if (!Check.isNull(policyRateMap)){
-                        if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 0){
-                            vo.setRebateType("返现");//返点类型
-                        }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 1){
-                            vo.setRebateType("返货");
-                        }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 2){
-                            vo.setRebateType("返现+返货");
+                if (!Check.isNull(map.get("productName"))) {
+                    //查询 快手利润表  返点类型和比列
+                    List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("productName") + "", "2", paramsVo.getStartTime(), paramsVo.getEndTime());
+                    List listPolicyTIme = new ArrayList();
+                    for (Map<String, Object> rate : rateMap) {
+                        listPolicyTIme.add(rate.get("policyStartDate"));
+                        listPolicyTIme.add(rate.get("policyEndDate"));
+                    }
+
+                    //政策时间 去重 排序
+                    List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
+                    // 使用政策的时间段 拼接 开始 和 截至 时间
+                     List<Map<String, String>> arrayList = new ArrayList<>();
+                    if (!Check.isNull(times)){
+                        for (int i = 0; i < times.size(); i++) {
+                            HashMap<String, String> mapTime = new HashMap<>();
+                            mapTime.put("startDate", times.get(i).toString());
+                            mapTime.put("endDate", times.size() < 2 ? times.get(i).toString() : times.get(i + 1).toString());
+                            i += 1;
+                            arrayList.add(mapTime);
                         }
-                        vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"%");//返点比列
-                    }else {
-                        vo.setRebateType("");
                     }
 
-                    // 时间段内 账户流水 信息
-                    List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    listAccount.removeAll(Collections.singleton(null));
-                    vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
-                    vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
-                    BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
-                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
-                    resultList.add(vo);
-                    policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
+                    for (Map<String, String> stringMap : arrayList) {
+                        ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
+                        //使用政策 返点类型和比例
+                        Map<String, Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName") + "", stringMap.get("startDate"), stringMap.get("endDate"));
+                        if (!Check.isNull(policyRateMap)) {
+                            if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 0) {
+                                vo.setRebateType("返现");//返点类型
+                            } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 1) {
+                                vo.setRebateType("返货");
+                            } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 2) {
+                                vo.setRebateType("返现+返货");
+                            }
+                            vo.setRebateRate(policyRateMap.getOrDefault("rebateRate", "") + "%");//返点比列
+                        } else {
+                            vo.setRebateType("");
+                        }
+
+                        // 时间段内 账户流水 信息
+                        List<Map<String, Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId") + "", stringMap.get("startDate"), stringMap.get("endDate"));
+                        listAccount.removeAll(Collections.singleton(null));
+                        vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost", "") + "");//总消耗
+                        vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost", "") + "");//现金消耗
+                        BeanUtils.copyProperties(voSource, vo, SettlementUtil.getNullPropertyNames(voSource));
+                        vo.setTime(stringMap.get("startDate") + "----" + stringMap.get("endDate"));
+                        resultList.add(vo);
+                        policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"), stringMap.get("endDate")));
+                    }
                 }
 
+
                 //不使用政策 的时间段
                 // 获取两个日期之间 所有的 时间 年-月-日
-                List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(paramsVo.getStartTime(),paramsVo.getEndTime());
+                List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(paramsVo.getStartTime(), paramsVo.getEndTime());
                 // 时间差集(所有时间段 - 使用政策的时间段)
-                List<String>  reduceList = betweenDaysList.stream().filter(item -> !policyDaysList.contains(item)).collect(Collectors.toList());
+                List<String> reduceList = betweenDaysList.stream().filter(item -> !policyDaysList.contains(item)).collect(Collectors.toList());
                 //差集拼接  开始 和 结束时间
                 List<Map<String, String>> stringList = SettlementUtil.getTime(reduceList);
                 for (Map<String, String> stringMap : stringList) {
@@ -713,12 +745,12 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     vo.setRebateType("");//返点类型
                     vo.setRebateRate("");//返点比列
                     //账户流水 信息
-                    List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
+                    List<Map<String, Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId") + "", stringMap.get("startDate"), stringMap.get("endDate"));
                     listAccount.removeAll(Collections.singleton(null));
-                    vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
-                    vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
-                    BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
-                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
+                    vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost", "") + "");//总消耗
+                    vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost", "") + "");//现金消耗
+                    BeanUtils.copyProperties(voSource, vo, SettlementUtil.getNullPropertyNames(voSource));
+                    vo.setTime(!Check.isNull(vo.getRebateType()) ? stringMap.get("startDate") + "----" + stringMap.get("endDate") : "");
                     resultList.add(vo);
                 }
 

+ 2 - 2
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/SettlementInfoServiceImpl.java

@@ -96,8 +96,8 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             SysLog sysLog = new SysLog();
             sysLog.setLogType(2);
-            sysLog.setLogContent("修改账户状态为==="+status);
-            sysLog.setRequestParam(String.valueOf(status));
+            sysLog.setLogContent(String.valueOf(status));
+            sysLog.setRequestParam(userAllocation.getAccountId().toString());
             sysLog.setOperateType(10001);
             sysLog.setUserid(user.getId());
             sysLog.setCreateBy(user.getRealname());

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -290,8 +290,8 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             SysLog sysLog = new SysLog();
             sysLog.setLogType(2);
-            sysLog.setLogContent("修改账户状态为==="+accountStatus);
-            sysLog.setRequestParam(String.valueOf(accountStatus));
+            sysLog.setLogContent(String.valueOf(accountStatus));
+            sysLog.setRequestParam(userAllocationEntity.getAccountId().toString());
             sysLog.setOperateType(10001);
             sysLog.setUserid(user.getId());
             sysLog.setCreateBy(user.getRealname());