فهرست منبع

申请记录、充值列表

zhaoxian 2 سال پیش
والد
کامیت
078cea6831
15فایلهای تغییر یافته به همراه125 افزوده شده و 13 حذف شده
  1. 3 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  2. 13 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  3. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  4. 3 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MessageTemplateImpl.java
  5. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  6. 9 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentPoolController.java
  7. 12 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/entity/FinancePaymentRechargeAccount.java
  8. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/entity/FinancePaymentRechargeApplication.java
  9. 3 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/FinancePaymentPoolMapper.java
  10. 34 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentPoolMapper.xml
  11. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeAccountMapper.xml
  12. 13 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeApplicationMapper.xml
  13. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/IFinancePaymentPoolService.java
  14. 7 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentPoolServiceImpl.java
  15. 16 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentRechargeApplicationServiceImpl.java

+ 3 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -68,11 +68,13 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     void updCwjsSettlementStatus(@Param("id") String id, @Param("status") Integer status);
 
-    List<UserAllocation> getAccountInfoBySalesId(@Param("sales") Set<String> sales, @Param("mediaId") String mediaId, @Param("advertiserId") String advertiserId, @Param("productId") String productId,@io.lettuce.core.dynamic.annotation.Param("projectId")String projectId);
+    List<UserAllocation> getAccountInfoBySalesId(@Param("sales") Set<String> sales, @Param("mediaId") String mediaId, @Param("advertiserId") String advertiserId, @Param("productId") String productId, @io.lettuce.core.dynamic.annotation.Param("projectId") String projectId);
 
     List<JSONObject> getAccountListByProjectListV2(@Param("list") List list);
 
     List<JSONObject> getAccountListByProjectAndUserId(@Param("projectId") Long projectId, @Param("userId") String userId);
 
     List<Long> getAccountListByProjectId(@Param("projectId") Long projectId);
+
+    JSONObject getProductInfo(@Param("accountId") Long accountId);
 }

+ 13 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -347,4 +347,17 @@ ORDER BY
     </select>
 
 
+    <select id="getProductInfo" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT id,product_name  FROM ctop_product
+        WHERE id = (
+        SELECT product_id FROM ctop_project
+        WHERE id = (
+            SELECT project_id FROM ctop_user_allocation
+            WHERE account_id = #{accountId}
+        )
+        )
+
+    </select>
+
+
 </mapper>

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

@@ -76,4 +76,6 @@ public interface IUserAllocationService extends IService<UserAllocation> {
     List<JSONObject> getAccountListByProjectAndUserId(Long projectId, String userId);
 
     List<Long> getAccountListByProjectId(Long projectId);
+
+    JSONObject getProductInfo(Long accountId);
 }

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MessageTemplateImpl.java

@@ -289,6 +289,7 @@ public class MessageTemplateImpl implements IMessageTemplate {
 //                .append("类型:").append("1".equals(data.getString("rechargeType")) ? "充值" : "自运营充值").append("<br/>")
                 .append("充值现金金额:").append(data.getBigDecimal("totalAmount")).append("<br/>")
                 .append("充值账显金额:").append(data.getBigDecimal("displayAmount")).append("<br/>")
+                .append("是否后补:").append("1".equals(data.getString("amends"))?"是":"否").append("<br/>")
                 .append("请及时登录有腾助手平台进行审核");
         return text.toString();
     }
@@ -320,6 +321,7 @@ public class MessageTemplateImpl implements IMessageTemplate {
                 .append("账户ID:").append(data.getString("accountIds")).append("<br/>")
                 .append("充值现金金额:").append(data.getBigDecimal("totalAmount")).append("<br/>")
                 .append("充值账显金额:").append(data.getBigDecimal("displayAmount")).append("<br/>")
+                .append("是否后补:").append("1".equals(data.getString("amends"))?"是":"否").append("<br/>")
                 .append("请及时登录有腾助手平台进行充值");
         return text.toString();
     }
@@ -351,6 +353,7 @@ public class MessageTemplateImpl implements IMessageTemplate {
                 .append("账户ID:").append(data.getString("accountIds")).append("<br/>")
                 .append("充值现金金额:").append(data.getBigDecimal("totalAmount")).append("<br/>")
                 .append("充值账显金额:").append(data.getBigDecimal("displayAmount")).append("<br/>")
+                .append("是否后补:").append("1".equals(data.getString("amends"))?"是":"否").append("<br/>")
                 .append("已充值完成");
         return text.toString();
     }

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

@@ -345,5 +345,10 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
         return userAllocationMapper.getAccountListByProjectId(projectId);
     }
 
+    @Override
+    public JSONObject getProductInfo(Long accountId) {
+        return userAllocationMapper.getProductInfo(accountId);
+    }
+
 
 }

+ 9 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentPoolController.java

@@ -194,9 +194,18 @@ public class FinancePaymentPoolController {
      */
     @GetMapping(value = "/queryPoolProjectList")
     public Result<Object> queryPoolProjectList(String advertiserId, Long productId, String type) {
+        productId = null;
         return financePaymentPoolService.queryPoolProjectList(advertiserId, productId, type);
     }
 
+    /**
+     * 获取账户
+     */
+    @GetMapping(value = "/queryPoolAccountList")
+    public Result<Object> queryPoolAccountList(String advertiserId, Long projectId, String type) {
+        return financePaymentPoolService.queryPoolAccountList(advertiserId, projectId, type);
+    }
+
 
     /**
      * 为充值提供客户,产品等信息

+ 12 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/entity/FinancePaymentRechargeAccount.java

@@ -35,6 +35,18 @@ public class FinancePaymentRechargeAccount {
     @ApiModelProperty(value = "主键")
     private Long id;
     /**
+     * 产品id
+     */
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "产品id")
+    private Long productId;
+    /**
+     * 产品名
+     */
+    @Excel(name = "产品名", width = 15)
+    @ApiModelProperty(value = "产品名")
+    private String productName;
+    /**
      * 充值表ID
      */
     @Excel(name = "充值表ID", width = 15)

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/entity/FinancePaymentRechargeApplication.java

@@ -35,6 +35,7 @@ public class FinancePaymentRechargeApplication {
     @Excel(name = "款项池ID", width = 15)
     @ApiModelProperty(value = "款项池ID")
     private Long poolId;
+
     /**
      * 客户(主体)ID
      */

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/FinancePaymentPoolMapper.java

@@ -26,4 +26,7 @@ public interface FinancePaymentPoolMapper extends BaseMapper<FinancePaymentPool>
     FinancePaymentPool queryFinancePaymentPoolById(@Param("advertiserId") String advertiserId, @Param("productId") Long productId, @Param("paymentMedia") String paymentMedia, @Param("paymentPort") String paymentPort);
 
     List<JSONObject> queryPaymentPort(@Param("advertiserId") String advertiserId, @Param("productId") Long productId, @Param("paymentMedia") String paymentMedia);
+
+    List<JSONObject> queryPoolAccountList(@Param("advertiserIds") List<String> advertiserIds, @Param("projectId") Long projectId, @Param("type") String type);
+
 }

+ 34 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentPoolMapper.xml

@@ -78,14 +78,16 @@
                  open="(" separator="," close=")">
             #{item}
         </foreach>
-        AND product_id = #{productId}
+        <if test="productId != null and productId != '' ">
+            AND product_id = #{productId}
+        </if>
         <choose>
-          <when test="type != 11 ">
-              AND media_id = #{type}
-          </when>
-          <when test="type == 11 ">
-              AND (media_id = 1 or media_id = 2 )
-          </when>
+            <when test="type != 11 ">
+                AND media_id = #{type}
+            </when>
+            <when test="type == 11 ">
+                AND (media_id = 1 or media_id = 2 )
+            </when>
         </choose>
     </select>
 
@@ -103,4 +105,29 @@
           AND payment_media = #{paymentMedia}
     </select>
 
+    <select id="queryPoolAccountList" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        account_id as 'id',
+        auth_name as 'name',
+        media_id as 'mediaId'
+        from ctop_user_allocation
+        Where advertiser_id in
+        <foreach item="item" index="index" collection="advertiserIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="projectId != null and projectId != '' ">
+            AND project_id = #{projectId}
+        </if>
+        <choose>
+            <when test="type != 11 ">
+                AND media_id = #{type}
+            </when>
+            <when test="type == 11 ">
+                AND (media_id = 1 or media_id = 2 )
+            </when>
+        </choose>
+        group by account_id
+    </select>
+
 </mapper>

+ 2 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeAccountMapper.xml

@@ -13,6 +13,8 @@
                t1.recharge_id,
                t1.project_id,
                t1.account_id,
+               t1.product_id,
+               t1.product_name,
                t1.account_name,
                t1.cash_amount,
                t1.received_amount,

+ 13 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeApplicationMapper.xml

@@ -38,7 +38,8 @@
         t1.advertiser_id as 'advertiserId',
         t1.advertiser_name as 'advertiserName',
         t1.product_id as 'productId',
-        t1.product_name as 'productName',
+        GROUP_CONCAT(DISTINCT t2.product_id) as 'productIds',
+        GROUP_CONCAT(DISTINCT t2.product_name) as 'productName',
         t1.project_id as 'projectId',
         t1.project_name as 'projectName',
         GROUP_CONCAT(t2.account_id) as 'accountIds',
@@ -94,6 +95,9 @@
             <if test="rechargeType != null and rechargeType != '' ">
                 and t1.recharge_type=#{rechargeType}
             </if>
+            <if test="amends != null and amends != '' ">
+                and t1.amends=#{amends}
+            </if>
             <if test="accountId != null and accountId != '' ">
                 and t2.account_id=#{accountId}
             </if>
@@ -110,8 +114,8 @@
         SELECT t1.id,
         t1.advertiser_id as 'advertiserId',
         t1.advertiser_name as 'advertiserName',
-        t1.product_id as 'productId',
-        t1.product_name as 'productName',
+        t2.product_id as 'productId',
+        t2.product_name as 'productName',
         t1.project_id as 'projectId',
         t1.project_name as 'projectName',
         t2.account_id as 'accountId',
@@ -166,6 +170,12 @@
             <if test="rechargeType != null and rechargeType != '' ">
                 and t1.recharge_type=#{rechargeType}
             </if>
+            <if test="amends != null and amends != '' ">
+                and t1.amends=#{amends}
+            </if>
+            <if test="accountId != null and accountId != '' ">
+                and t2.account_id=#{accountId}
+            </if>
             <if test="startDate != null and startDate != '' ">
                 and t1.create_time >= #{startDate}
                 and t1.create_time &lt;= #{endDate}

+ 2 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/IFinancePaymentPoolService.java

@@ -29,4 +29,6 @@ public interface IFinancePaymentPoolService extends IService<FinancePaymentPool>
     Result<Object> queryPoolAmountById(String advertiserId, Long productId, String type, String paymentPort);
 
     Result<Object> queryPaymentPort(String advertiserId, Long productId, String paymentMedia);
+
+    Result<Object> queryPoolAccountList(String advertiserId, Long projectId, String type);
 }

+ 7 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentPoolServiceImpl.java

@@ -116,6 +116,13 @@ public class FinancePaymentPoolServiceImpl extends ServiceImpl<FinancePaymentPoo
         return Result.ok(baseMapper.queryPoolProjectList(advertiserIds, productId, type));
     }
 
+
+    @Override
+    public Result<Object> queryPoolAccountList(String advertiserId, Long projectId, String type) {
+        List<String> advertiserIds = Arrays.asList(advertiserId.split(","));
+        return Result.ok(baseMapper.queryPoolAccountList(advertiserIds, projectId, type));
+    }
+
     @Override
     public Result<Object> queryPoolAmountById(String advertiserId, Long productId, String type, String paymentPort) {
         return Result.ok(baseMapper.queryFinancePaymentPoolById(advertiserId, productId, type, paymentPort));

+ 16 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentRechargeApplicationServiceImpl.java

@@ -114,7 +114,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
                 data.put("projectName", project.getProjectName());
             }
             Date createTime = new Date();
-            Thread.sleep(800);
+            Thread.sleep(1000);
             //判断审核人和状态
             getReviewedRole(recharge);
             recharge.setPoolId(pool.getId());
@@ -136,6 +136,15 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
                 UserAllocation allocation = userAllocationService.getByAccountId(obj.getLong("accountId"));
                 if (!Check.isNull(allocation)) {
                     account.setAccountName(allocation.getAuthName());
+                    account.setProjectId(allocation.getProjectId());
+                }
+                JSONObject productObj = userAllocationService.getProductInfo(obj.getLong("accountId"));
+                if (Check.isNull(productObj)) {
+                    account.setProductId(recharge.getProductId());
+                    account.setProductName(recharge.getProductName());
+                } else {
+                    account.setProductId(productObj.getLong("id"));
+                    account.setProductName(productObj.getString("product_name"));
                 }
                 account.setCashAmount(obj.getBigDecimal("cashAmount"));
                 account.setReceivedAmount(obj.getBigDecimal("receivedAmount"));
@@ -147,6 +156,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             }
             rechargeAccountService.saveBatch(accountList);
             data.put("displayAmount", displayAmount);
+            data.put("amends",recharge.getAmends());
             //消息通知内容
             String message = null;
             List<SysUser> users = null;
@@ -206,7 +216,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         insertRecord(recharge.getId(), oldRecharge.getReviewederId(), oldRecharge.getAuditStatus(), oldRecharge.getApprovalContent(), oldRecharge.getFiles(), oldRecharge.getUpdateTime());
         //添加申请记录 -1 退回修改
         insertRecord(recharge.getId(), recharge.getApplicanterId(), "-1", null, recharge.getFiles(), new Date());
-        Thread.sleep(800);
+        Thread.sleep(1000);
 
         this.updateById(recharge);
 
@@ -237,6 +247,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         rechargeAccountService.saveBatch(accountList);
 
         data.put("displayAmount", displayAmount);
+        data.put("amends",recharge.getAmends());
         //消息通知内容
         String message = null;
         List<SysUser> users = null;
@@ -272,6 +283,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             //添加审核记录 1:财务审核完成
             insertRecord(recharge.getId(), recharge.getUserId(), "6", recharge.getApprovalContent(), recharge.getFiles(), new Date());
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
+            oldData.put("amends",oldRecharge.getAmends());
             JSONObject amount = rechargeAccountService.queryAmounts(recharge.getId());
             if (!Check.isNull(amount)) {
                 oldData.put("accountIds", amount.getString("accountIds"));
@@ -294,6 +306,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             poolService.reduce(oldRecharge, null);
 
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
+            oldData.put("amends",oldRecharge.getAmends());
             JSONObject amount = rechargeAccountService.queryAmounts(recharge.getId());
             if (!Check.isNull(amount)) {
                 oldData.put("accountIds", amount.getString("accountIds"));
@@ -317,6 +330,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             //添加审核记录
             insertRecord(recharge.getId(), recharge.getUserId(), oldRecharge.getAuditStatus(), oldRecharge.getApprovalContent(), oldRecharge.getFiles(), oldRecharge.getUpdateTime());
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
+            oldData.put("amends",oldRecharge.getAmends());
             String failMessage = null;
             List<SysUser> users = null;
             if ("financialReview".equals(oldRecharge.getReviewederId())) {