Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

songyh 4 tahun lalu
induk
melakukan
1af4d1df3a

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -220,6 +220,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/settLementFileController/**", "anon");
         filterChainDefinitionMap.put("/ctop/projectMember/**", "anon");
         filterChainDefinitionMap.put("/agent/**", "anon");
+        filterChainDefinitionMap.put("/materialUse/**", "anon");
 
 
         // 添加自己的过滤器并且取名为jwt

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

@@ -44,6 +44,10 @@ public class ProfitReportBytedanceVo implements Serializable {
     @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
+    @Excel(name = "政策起止时间",width = 30)
+    private String time;
+
+
 
 
 }

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

@@ -49,6 +49,9 @@ public class ProfitReportKuaiShouVo implements Serializable {
     @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
+    @Excel(name = "政策起止时间",width = 30)
+    private String time;
+
 
 
 }

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

@@ -199,6 +199,7 @@
         GROUP BY
             d.advertiser_id;
 -->
+<!--
 
         SELECT
         d.advertiser_id AS accountId,
@@ -214,19 +215,38 @@
         WHERE
         d.advertiser_id = c.account_id
         AND c.product_id = p.id
-        <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>
+
+-->
+
+        SELECT
+        d.advertiser_id as accountId,
+        SUM( d.cost ) AS cost,
+        SUM( d.cash_cost ) AS cashCost,
+        SUM( d.reward_cost ) 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
+        p.product_name
+        FROM ctop_user_allocation u,ctop_project pj,ctop_product p where d.advertiser_id = u.account_id and u.project_id = pj.id and pj.product_id = p.id
+        ),(SELECT p.product_name
+        FROM ctop_cwjs_settlement_info c,ctop_product p where d.advertiser_id = c.account_id and c.product_id = p.id)) productName
+        FROM
+        ctop_account_transaction_day d
+<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>
         GROUP BY
         d.advertiser_id;
 
-    </select>
+</select>
 
 
     <!-- 查询 头条利润表 总花费-->
@@ -330,16 +350,15 @@
         <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>
+        <if test="endTime !=null and endTime != ''">
+            AND r.policy_date &lt;= #{endTime}
+        </if>
         GROUP BY r.policy_id
         ) t
-<where>
-    <if test="startTime !=null and startTime != ''">
-        AND (t.policyStartDate &gt;= #{startTime} or t.policyStartDate &lt;= #{endTime})
-    </if>
-    <if test="endTime !=null and endTime != ''">
-        AND (t.policyEndDate &gt;= #{startTime} or t.policyEndDate &lt;= #{endTime})
-    </if>
-</where>
+
 
 
     </select>
@@ -453,7 +472,7 @@
         GROUP BY
             d.account_id;-->
 
-        SELECT
+     <!--   SELECT
         d.account_id as accountId,
         d.user_id AS ksId,
         SUM(d.total_charged_in_yuan) AS cost,
@@ -478,7 +497,35 @@
             </if>
         </where>
 
+        GROUP BY d.account_id-->
+
+        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,
+        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
+        p.product_name
+        FROM ctop_user_allocation u,ctop_project pj,ctop_product p where d.account_id = u.account_id and u.project_id = pj.id and pj.product_id = p.id
+        ),(SELECT p.product_name
+        FROM ctop_cwjs_settlement_info c,ctop_product p where d.account_id = c.account_id and c.product_id = p.id)) productName
+        FROM
+        ctop_kuaishou_daily_agent d
+        <where>
+            <if test="accountId !=null and accountId != ''">
+                AND d.account_id = #{accountId}
+            </if>
+            <if test="startTime !=null and startTime != ''">
+                AND d.date_time &gt;= #{startTime}
+            </if>
+            <if test="endTime !=null and endTime != ''">
+                AND d.date_time &lt;= #{endTime}
+            </if>
+        </where>
         GROUP BY d.account_id
+
     </select>
 
 

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

@@ -549,6 +549,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     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")));
                 }
@@ -575,6 +576,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     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);
                 }
             }
@@ -617,7 +619,7 @@ 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-关
@@ -628,7 +630,6 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                 if (Check.isNull(settlementAccountList)){
                     continue;
                 }
-*/
                 ProfitReportKuaiShouVo voSource = new ProfitReportKuaiShouVo();
 
                 voSource.setAccountId(map.getOrDefault("accountId","")+"");//账户id
@@ -685,13 +686,13 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                         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")));
                 }
@@ -717,6 +718,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     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);
                 }
 

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -142,6 +142,8 @@ public class LoginController {
 				}
 				String departId = sysDepartService.selectIdByOrdCode(sysUser.getOrgCode());
 				sysUser.setDepartId(departId);
+				//根据 账号 查看该用户以及角色名称
+				sysUser = sysUserService.getUserByName(sysUser.getUsername());
 				result = sysUserService.checkUserIsEffective(sysUser);
 				if (!result.isSuccess()) {
 					return result;