瀏覽代碼

Merge remote-tracking branch 'origin/master'

yumeng 2 年之前
父節點
當前提交
336b09a395

+ 24 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -1878,6 +1878,7 @@
         t0.realname AS 'userName',
         CONCAT(IFNULL(ROUND(((SUM( t1.cost )-t3.totalCost) / t3.totalCost) * 100,2),0),'%') AS 'yearOnYear',
         CONCAT(IFNULL(ROUND(((SUM( t1.cost )-t5.totalCost) / t5.totalCost) * 100,2),0),'%') AS 'equallyRate',
+        t6.adspNum,
         t4.*
         FROM
         ${tableName} t1
@@ -1973,6 +1974,29 @@
         </if>
         GROUP BY project_id
         ) t5 ON t1.project_id = t5.project_id
+        LEFT JOIN (
+        SELECT
+        project_id,
+        IFNULL( SUM( material_num ), 0 ) 'adspNum'
+        FROM
+        application.new_material_num_in_project
+        <where>
+            <if test="startDate != null and startDate != '' ">
+                and stat_date &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != '' ">
+                and stat_date &lt;= #{endDate}
+            </if>
+            <if test='projectIds!=null and projectIds.size()>0'>
+                AND project_id IN
+                <foreach collection="projectIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        GROUP BY project_id
+        )t6 ON t1.project_id = t6.project_id
         WHERE t1.cost > 0
         <if test="startDate != null and startDate != '' ">
             and t1.stat_datetime &gt;= #{startDate}

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

@@ -97,6 +97,8 @@ public interface IMessageTemplate {
 
     String getFinancePaymentApplicationCWRechargeMessage(JSONObject data);
 
+    String getFinancePaymentApplicationRechargeMessage(JSONObject data);
+
     String getFinancePaymentApplicationMJRechargeMessage(JSONObject data);
 
     String getRechargedSuccessfullyMessage(JSONObject data);

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

@@ -295,6 +295,20 @@ public class MessageTemplateImpl implements IMessageTemplate {
     }
 
     @Override
+    public String getFinancePaymentApplicationRechargeMessage(JSONObject data) {
+        StringBuilder text = new StringBuilder();
+        text.append("垫款池金额不足通知").append("<br/>")
+                .append("客户名称:").append(data.getString("advertiserName")).append("<br/>")
+                .append("产品名称:").append(data.getString("productName")).append("<br/>")
+                .append("项目名称:").append(data.getString("projectName")).append("<br/>")
+//                .append("类型:").append("1".equals(data.getString("rechargeType")) ? "充值" : "自运营充值").append("<br/>")
+                .append("充值现金金额:").append(data.getBigDecimal("totalAmount")).append("<br/>")
+                .append("充值账显金额:").append(data.getBigDecimal("displayAmount")).append("<br/>")
+                .append("垫款池额度不足,请及时进行充值");
+        return text.toString();
+    }
+
+    @Override
     public String getFinancePaymentApplicationMJRechargeMessage(JSONObject data) {
         //媒体类型 1-头条、2-快手、7-磁力金牛、9-广点通
         String paymentMedia = data.getString("paymentMedia");

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

@@ -24,7 +24,7 @@ public class SendMessageServiceImpl implements ISendMessageService {
         JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
         if (!Check.isNull(weChatId)) {
             corpWexinUtils.sendMessageByWeChatId(weChatId, text);
-            log.info("消息发送成功,userId:{}", userId);
+            log.info("消息发送成功,userId:{},消息内容:{}", userId, text);
         }
     }
 

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

@@ -167,6 +167,8 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
                 message = messageTemplate.getFinancePaymentApplicationCWRechargeMessage(data);
                 users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
                 users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
+                //财务审核时,同时发送消息告诉申请人,池子资金不足
+                sendMessageService.sendMessage(recharge.getApplicanterId(),messageTemplate.getFinancePaymentApplicationRechargeMessage(data));
             } else {
                 //媒介
                 data.put("accountIds", accountIds.substring(0, accountIds.length() - 1));