Forráskód Böngészése

Merge branch 'test'

yangzian 3 éve
szülő
commit
fdd98b2403

+ 13 - 5
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java

@@ -128,11 +128,19 @@ public class CwjsPolicyInfoController {
 	  * @param approvalContent 审核内容
 	  * @return
 	  */
-	 @GetMapping(value = "/policyApproval")
-	 public Result policyApproval(@RequestParam(name="id") Integer id,
-	 							@RequestParam(name="type") Integer type,
-								  @RequestParam(name="userId") String userId,
-								@RequestParam(name="approvalContent",required=false) String approvalContent) {
+	 @PostMapping(value = "/policyApproval")
+	 public Result policyApproval(@RequestBody JSONObject object
+	 		//@RequestParam(name="id") Integer id,
+	 							//@RequestParam(name="type") Integer type,
+								  //@RequestParam(name="userId") String userId,
+								//@RequestParam(name="approvalContent",required=false) String approvalContent
+								   ) {
+
+	 	Integer id = object.getInteger("id");
+		 Integer type = object.getInteger("type");
+		 String userId = object.getString("userId");
+		 String approvalContent = object.getString("approvalContent");
+
 
 		 CwjsPolicyInfo cwjsPolicyInfo = cwjsPolicyInfoService.getById(id);
 		 if (cwjsPolicyInfo == null) {

+ 29 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/IntranetSettlementMapper.java

@@ -0,0 +1,29 @@
+package org.jeecg.ctop.finance.settlement.mapper;
+
+import io.lettuce.core.dynamic.annotation.Param;
+import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSlettementReport;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
+
+import java.util.List;
+
+
+/**
+ *
+ * @description:
+ *
+ * @return:
+ * @author: zianY
+ */
+public interface IntranetSettlementMapper {
+
+
+    // 获取快手 结算单 账户 和 代理商 维度
+    List<SettlementReportKuaiShouVo> getTransactionDayKuaiShouAgentAndAccountInrtanet(SettlementFileParamsVo paramsVo);
+
+
+
+
+
+
+}

+ 73 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/IntranetSettlementMapper.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.ctop.finance.settlement.mapper.IntranetSettlementMapper">
+
+
+    <!-- 获取快手 账户 日流水信息  代理商 和 账户 维度-->
+    <select id="getTransactionDayKuaiShouAgentAndAccountInrtanet" resultType="org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo">
+
+        SELECT
+            *
+        FROM
+            (
+                SELECT
+                    t.*
+                FROM
+                    (
+                        SELECT
+                            stat_date as date,
+                            account_id AS accountId,
+                            total_charged_in_yuan as dailyCharge,
+                            contract_rebate_real_charged_in_yuan as contractRebateRealCharged,
+                            direct_rebate_real_charged_in_yuan as directRebateRealCharged,
+                            ( real_charged_in_yuan + total_rebate_real_charged_in_yuan + credit_real_charged_in_yuan ) realCharged,
+                            account_name AS accountName,
+                            kuaishou_id AS ksId
+                        FROM
+                            application.app_kuaishou_agent_report_d
+                        WHERE
+                            total_charged_in_yuan >0
+                          and account_id = #{accountId}
+                    ) t
+                WHERE
+                    DATE_FORMAT( t.date, '%Y-%m' ) = #{uploadYears}
+                ORDER BY
+                    t.date
+                    LIMIT 31
+            ) a
+                LEFT JOIN (
+                SELECT
+                    t.*,
+                    c.auth_name AS accountNameF,
+                    base.user_id AS ksIdF
+                FROM
+                    (
+                        SELECT
+                            advertiser_id AS accountIdF,
+                            date,
+                            daily_transfer_in as dailyTransferIn,
+                            daily_transfer_out as dailyTransferOut,
+                            balance as balance,
+                            real_recharged as realRecharged,
+                            contract_rebate_real_recharged as contractRebateRealRecharged,
+                            direct_rebate_real_recharged as directRebateRealRecharged
+                        FROM
+                            media_api.kuaishou_advertiser_fund_daily_flows
+                        WHERE
+                            advertiser_id = #{accountId}
+                    ) t
+                        LEFT JOIN `jeecg-boot`.ctop_user_allocation c ON t.accountIdF = c.account_id
+                        LEFT JOIN `jeecg-boot`.ctop_kuaishou_advertiser_base_info base ON base.account_id = t.accountIdF
+                WHERE
+                    DATE_FORMAT( t.date, '%Y-%m' ) = #{uploadYears}
+                ORDER BY
+                    date
+                    LIMIT 31
+            ) b ON a.accountId = b.accountIdF
+                AND a.date = b.date
+            LIMIT 31
+
+    </select>
+
+
+</mapper>

+ 2 - 4
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/SettlementFileInfoMapper.xml

@@ -102,14 +102,12 @@
         f.product_id AS productId,
         cp.product_name as productName,
         IFNULL(u.project_id, cwjs.project_id ) AS projectId,
-        IFNULL((SELECT project.project_name FROM ctop_user_allocation u,ctop_project project WHERE u.account_id = f.account_id AND project.id = u.project_id),
-        (SELECT project.project_name FROM ctop_project project WHERE project.id = cwjs.project_id LIMIT 1 )
-        ) AS projectName,
+        project.project_name AS projectName,
         IFNULL(cwjs.account_id, f.account_id) AS accountId,
         IFNULL(u.auth_name,cwjs.account_name) AS accountName,
         f.del_flag,
         IFNULL(project.sale_id,cwjs.create_user_id) AS saleUserId,
-        IFNULL((SELECT su.realname FROM sys_user su WHERE f.account_id = u.account_id AND u.project_id = project.id AND project.sale_id = su.id),
+        IFNULL((SELECT su.realname FROM sys_user su WHERE project.sale_id = su.id LIMIT 1),
         (SELECT su.realname FROM sys_user su  LEFT JOIN ctop_cwjs_settlement_info cwjs1  on su.id = cwjs1.create_user_id LIMIT 1 )
         ) as saleUserName,
         f.create_user_id AS operateUserId,

+ 21 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IntranetSettlementService.java

@@ -0,0 +1,21 @@
+package org.jeecg.ctop.finance.settlement.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+public interface IntranetSettlementService{
+
+    // 获取快手 结算单 账户 和 代理商 维度---内网
+    List<SettlementReportKuaiShouVo> getTransactionDayKuaiShouAgentAndAccountIntranet(SettlementFileParamsVo paramsVo);
+
+}

+ 29 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/IntranetSettlementServiceImpl.java

@@ -0,0 +1,29 @@
+package org.jeecg.ctop.finance.settlement.service.serviceImpl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
+import org.jeecg.ctop.finance.settlement.mapper.IntranetSettlementMapper;
+import org.jeecg.ctop.finance.settlement.service.IntranetSettlementService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * Administrator
+ * 2022/5/5
+ **/
+@DS("multi-datasource1")
+@Service
+public class IntranetSettlementServiceImpl implements IntranetSettlementService {
+
+    @Resource
+    private IntranetSettlementMapper intranetSettlementMapper;
+
+
+    @Override
+    public List<SettlementReportKuaiShouVo> getTransactionDayKuaiShouAgentAndAccountIntranet(SettlementFileParamsVo paramsVo) {
+        return intranetSettlementMapper.getTransactionDayKuaiShouAgentAndAccountInrtanet(paramsVo);
+    }
+}

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

@@ -345,6 +345,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
         return settlementAccountList;
     }
 
+
+    @Resource
+    private IntranetSettlementServiceImpl intranetSettlementService;
+
     @Override
     public Result settlementReportKuaiShou(SettlementFileParamsVo paramsVo, HttpServletResponse response, SysUser user) {
         try {
@@ -375,7 +379,8 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                 String accountId = accountIdList.get(k);
                 paramsVo.setAccountId(accountId);
 
-                List<SettlementReportKuaiShouVo> settlementList = reportSettlementMapper.getTransactionDayKuaiShouAgentAndAccount(paramsVo);
+               // List<SettlementReportKuaiShouVo> settlementList = reportSettlementMapper.getTransactionDayKuaiShouAgentAndAccount(paramsVo);
+                List<SettlementReportKuaiShouVo> settlementList = intranetSettlementService.getTransactionDayKuaiShouAgentAndAccountIntranet(paramsVo);
                 if (Check.isNull(settlementList)){
                     num++;
                     continue;

+ 8 - 5
jeecg-boot-finance/src/main/resources/application-dev.yml

@@ -109,13 +109,16 @@ spring:
           url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: hcst
           password: hcst@2020
+          #url: jdbc:mysql://139.186.27.96:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          #username: data
+          #password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.cj.jdbc.Driver
+        multi-datasource1:
+          url: jdbc:mysql://192.168.0.184:3390/jeecg-boot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: hcst
+          password: hcst@2021
+          driver-class-name: com.mysql.cj.jdbc.Driver
   #redis 配置
   redis:
     database: 0

+ 5 - 0
jeecg-boot-finance/src/main/resources/application-prod.yml

@@ -110,6 +110,11 @@ spring:
           username: data
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
+        multi-datasource1:
+          url: jdbc:mysql://111.206.86.186:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&serverTimezone=GMT%2B8
+          username: hcst
+          password: hcst@2021
+          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

+ 6 - 0
jeecg-boot-finance/src/main/resources/application-test.yml

@@ -105,6 +105,12 @@ spring:
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
+            # 多数据源配置
+        multi-datasource1:
+          url: jdbc:mysql://192.168.0.184:3390/jeecg-boot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: hcst
+          password: hcst@2021
+          driver-class-name: com.mysql.cj.jdbc.Driver
   #redis 配置
   redis:
     database: 0