Bläddra i källkod

修改账户状态添加记录信息

yangzian 3 år sedan
förälder
incheckning
5281d6a3c1

+ 4 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -213,10 +213,11 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ai/projectCreate/*", "anon");
         filterChainDefinitionMap.put("/cwjsPolicyInfo/**", "anon");
 
+
         filterChainDefinitionMap.put("/exportReportController/**", "anon");
-        filterChainDefinitionMap.put("/settLementController/**", "anon");
-        filterChainDefinitionMap.put("/settLementFileController/**", "anon");
-        filterChainDefinitionMap.put("/ctop/projectMember/**", "anon");
+        //filterChainDefinitionMap.put("/settLementController/**", "anon");
+        //filterChainDefinitionMap.put("/settLementFileController/**", "anon");
+        //filterChainDefinitionMap.put("/ctop/projectMember/**", "anon");
 
 
         // 添加自己的过滤器并且取名为jwt

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

@@ -227,7 +227,7 @@
             ctop_user_allocation u
         WHERE
             f.account_id = u.account_id
-          AND u.account_status = 0
+          -- AND u.account_status = 0
           AND u.account_id = #{accountId}
           and f.media_id = #{mediaId}
             LIMIT 1

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

@@ -522,7 +522,18 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
                     //使用政策 返点类型和比例
                     Map<String,Object>  policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    vo.setRebateType(policyRateMap.getOrDefault("rebateType","")+"");//返点类型
+                  //  vo.setRebateType(policyRateMap.getOrDefault("rebateType","")+"");//返点类型
+
+                    if(policyRateMap.getOrDefault("rebateType","").equals("0")){
+                        vo.setRebateType("返现");//返点类型
+                    }else if (policyRateMap.getOrDefault("rebateType","").equals("1")){
+                        vo.setRebateType("返货");
+                    }else if (policyRateMap.getOrDefault("rebateType","").equals("2")){
+                        vo.setRebateType("返现+返货");
+                    }else {
+                        vo.setRebateType("");
+                    }
+
                     vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"");//返点比列
                     // 时间段内 账户流水 信息
                     List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
@@ -658,7 +669,20 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
                     //使用政策 返点类型和比例
                     Map<String,Object>  policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
-                    vo.setRebateType(policyRateMap.getOrDefault("rebateType","")+"");//返点类型
+                    if(policyRateMap.getOrDefault("rebateType","").equals("0")){
+                        vo.setRebateType("返现");//返点类型
+                    }else if (policyRateMap.getOrDefault("rebateType","").equals("1")){
+                        vo.setRebateType("返货");
+                    }else if (policyRateMap.getOrDefault("rebateType","").equals("2")){
+                        vo.setRebateType("返现+返货");
+                    }else {
+                        vo.setRebateType("");
+                    }
+
+
+
+
+
                     vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"");//返点比列
                     // 时间段内 账户流水 信息
                     List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
@@ -726,7 +750,8 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
      */
     @Override
     public Result sendMessageToOperate() {
-        int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
+        //上个月份
+        int month = Calendar.getInstance().get(Calendar.MONTH);
         int productNum = 0;
         int accountNum = 0;
         String productInfo = null;
@@ -757,7 +782,8 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
 
     @Override
     public Result sendMessageToOperateDemo(String userId) {
-        int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
+        //上个月份
+        int month = Calendar.getInstance().get(Calendar.MONTH);
         int productNum = 0;
         int accountNum = 0;
         String productInfo = null;

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

@@ -5,7 +5,9 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
 import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
 import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
 import cn.com.ctop.alarm.modules.service.impl.RuleAccountTemplateServiceImpl;
+import cn.com.ctop.common.module.entity.SysLog;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.mapper.SysLogMapper;
 import cn.com.ctop.common.module.service.impl.UserAllocationServiceImpl;
 import cn.com.ctop.common.module.utils.Check;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -14,7 +16,9 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
 import org.jeecg.ctop.finance.settlement.entity.vo.AccountImportVo;
 import org.jeecg.ctop.finance.settlement.mapper.SettlementInfoMapper;
@@ -32,10 +36,7 @@ import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 
 @Slf4j
@@ -46,6 +47,10 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
     private SettlementInfoMapper settlementInfoMapper;
 
 
+    @Resource
+    SysLogMapper sysLogMapper;
+
+
     /**
      *
      * @description: 查询 财务结算-账户列表
@@ -86,9 +91,19 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
         if (!Check.isNull(userAllocation)){
             userAllocation.setAccountStatus(status);
             userAllocationService.editUserAlloCation(userAllocation);
+        }else{
+            LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            SysLog sysLog = new SysLog();
+            sysLog.setLogType(2);
+            sysLog.setLogContent("修改账户状态为==="+status);
+            sysLog.setRequestParam(String.valueOf(status));
+            sysLog.setOperateType(10001);
+            sysLog.setUserid(user.getId());
+            sysLog.setCreateBy(user.getRealname());
+            sysLog.setCreateTime(new Date());
+            sysLogMapper.insert(sysLog);
         }
 
-
         return Result.successMsg("财务结算-修改账户状态成功", null);
     }
 

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

@@ -2,7 +2,9 @@ package cn.com.ctop.common.module.service.impl;
 
 import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
 import cn.com.ctop.alarm.modules.mapper.RuleAccountTemplateMapper;
+import cn.com.ctop.common.module.entity.SysLog;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.mapper.SysLogMapper;
 import cn.com.ctop.common.module.mapper.SysRoleMapper;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IUserAllocationService;
@@ -14,16 +16,15 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: 用户分配
@@ -237,6 +238,8 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     @Autowired
     ProjectMemberMapper memberMapper;
 
+    @Autowired
+    SysLogMapper sysLogMapper;
 
     @Override
     public Result<UserAllocation> editUserAlloCation(UserAllocation userAllocation) {
@@ -284,6 +287,17 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
             if (!Check.isNull(cwjs)){
                 userAllocationMapper.updCwjsSettlementStatus(cwjs.get("id").toString(),accountStatus);
             }
+            LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            SysLog sysLog = new SysLog();
+            sysLog.setLogType(2);
+            sysLog.setLogContent("修改账户状态为==="+accountStatus);
+            sysLog.setRequestParam(String.valueOf(accountStatus));
+            sysLog.setOperateType(10001);
+            sysLog.setUserid(user.getId());
+            sysLog.setCreateBy(user.getRealname());
+            sysLog.setCreateTime(new Date());
+            sysLogMapper.insert(sysLog);
+
         }
 
         return result;

+ 0 - 2
jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemCloudApplication.java

@@ -8,11 +8,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.core.env.Environment;
-import org.springframework.scheduling.annotation.EnableScheduling;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;