Browse Source

账户2.0——导入账户

zhaoxian 3 years ago
parent
commit
0121cd9876

+ 1 - 0
ruixuan-framework/src/main/java/com/ruixuan/framework/config/SecurityConfig.java

@@ -117,6 +117,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                     .antMatchers("/demoController/**").permitAll()
                     .antMatchers("/sale/**").permitAll()
                     .antMatchers("/live/**").permitAll()
+                    .antMatchers("/launch/**").permitAll()
                     .antMatchers("/system/user/getUserRoleByUserId").permitAll()
                     .antMatchers("/system/user/getUserByRoleName").permitAll()
                     .antMatchers("/system/industry/**").permitAll()

+ 0 - 11
ruixuan-live/src/main/java/com/ruixuan/live/controller/KuaishouLiveUserAccountController.java

@@ -130,17 +130,6 @@ public class KuaishouLiveUserAccountController extends BaseController {
     }
 
     /**
-     * 导出快手直播账户列表
-     */
-    @Log(title = "快手直播账户", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, KuaishouLiveUserAccount kuaishouLiveUserAccount) {
-        List<KuaishouLiveUserAccount> list = kuaishouLiveUserAccountService.selectKuaishouLiveUserAccountList(kuaishouLiveUserAccount);
-        ExcelUtil<KuaishouLiveUserAccount> util = new ExcelUtil<KuaishouLiveUserAccount>(KuaishouLiveUserAccount.class);
-        util.exportExcel(response, list, "快手直播账户数据");
-    }
-
-    /**
      * 删除快手直播账户
      */
     @Log(title = "快手直播账户", businessType = BusinessType.DELETE)

+ 1 - 0
ruixuan-live/src/main/java/com/ruixuan/live/entity/KuaishouLiveUserAccount.java

@@ -146,6 +146,7 @@ public class KuaishouLiveUserAccount implements Serializable {
     private Date createTime;
 
     private Integer count;
+    private List<String> accountNames;
 
     public KuaishouLiveUserAccount() {
 

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/live/mapper/KuaishouLiveUserAccountMapper.java

@@ -73,7 +73,7 @@ public interface KuaishouLiveUserAccountMapper {
 
     List<String> queryAccountNamesByUserId(@Param("userId") Long userId);
 
-    List<KuaishouLiveUserAccount> queryAllListByAccountNames(@Param("accountNames") List<String> accountNames,@Param("accountName") String accountName,@Param("ksName") String ksName);
+    List<KuaishouLiveUserAccount> queryAllListByAccountNames(KuaishouLiveUserAccount kuaishouLiveUserAccount);
 
-    List<KuaishouLiveUserAccount> selectAllListByAccountNames(@Param("accountNames") List<String> accountNames,KuaishouLiveUserAccount kuaishouLiveUserAccount);
+    List<KuaishouLiveUserAccount> selectAllListByAccountNames(KuaishouLiveUserAccount kuaishouLiveUserAccount);
 }

+ 7 - 5
ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveUserAccountServiceImpl.java

@@ -85,8 +85,9 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
         } else {
             List<String> accountNames = kuaishouLiveUserAccountMapper.queryAccountNamesByUserId(kuaishouLiveUserAccount.getUserId());
             if (Check.isNotNull(accountNames) && accountNames.size() > 0) {
+                kuaishouLiveUserAccount.setAccountNames(accountNames);
                 PageUtils.startPage();
-                list = kuaishouLiveUserAccountMapper.selectAllListByAccountNames(accountNames, kuaishouLiveUserAccount);
+                list = kuaishouLiveUserAccountMapper.selectAllListByAccountNames(kuaishouLiveUserAccount);
             }
         }
         return list;
@@ -102,8 +103,9 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
         } else {
             List<String> accountNames = kuaishouLiveUserAccountMapper.queryAccountNamesByUserId(userAccount.getUserId());
             if (Check.isNotNull(accountNames) && accountNames.size() > 0) {
+                userAccount.setAccountNames(accountNames);
                 PageUtils.startPage();
-                list = kuaishouLiveUserAccountMapper.queryAllListByAccountNames(accountNames, userAccount.getAccountName(), userAccount.getKsName());
+                list = kuaishouLiveUserAccountMapper.queryAllListByAccountNames(userAccount);
             }
         }
         return list;
@@ -136,7 +138,7 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
         }
         account.setId(UUID.randomUUID().toString().replace("-", ""));
         account.setProjectId(getAndInsertProject(account.getKsId(), account.getKsName()));
-        account.setAccountStatus("正常");
+        account.setAccountStatus("审核通过");
         int num = kuaishouLiveUserAccountMapper.insertKuaishouLiveUserAccount(account);
         if (num > 0) {
             return ResultResponse.success();
@@ -156,13 +158,13 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
     }
 
     @Override
-    public ResultResponse insertByExcel(MultipartFile file,Long createrId) {
+    public ResultResponse insertByExcel(MultipartFile file, Long createrId) {
         List<KuaishouLiveUserAccount> accountList = new ArrayList<>();
         try {
             String fileName = file.getOriginalFilename();
             List<JSONObject> list = LiveDataExcelUtils.analysisFile(file, fileName);
             for (JSONObject object : list) {
-                KuaishouLiveUserAccount account = new KuaishouLiveUserAccount(object,createrId);
+                KuaishouLiveUserAccount account = new KuaishouLiveUserAccount(object, createrId);
                 account.setOperatorLeaderId(getUserIdByName(account.getOperatorLeader()));
                 account.setSaleLeaderId(getUserIdByName(account.getSaleLeader()));
                 account.setProjectId(getAndInsertProject(account.getKsId(), account.getProjectName()));

+ 6 - 3
ruixuan-live/src/main/resources/mapper/live/KuaishouLiveUserAccountMapper.xml

@@ -95,7 +95,7 @@
     </select>
 
 
-    <select id="selectAllListByAccountNames" resultMap="KuaishouLiveUserAccountResult">
+    <select id="selectAllListByAccountNames" parameterType="com.ruixuan.live.entity.KuaishouLiveUserAccount" resultMap="KuaishouLiveUserAccountResult">
         select id,
         ks_id,
         ks_name,
@@ -143,12 +143,13 @@
             </if>
             <if test="designerLeader != null  and designerLeader != ''">and designer_leader = #{designerLeader}</if>
             <if test="createrId != null  and createrId != ''">and creater_id = #{createrId}</if>
+            <if test="accountStatus != null  and accountStatus != ''">and account_status = #{accountStatus}</if>
         </where>
         ORDER BY create_time desc
     </select>
 
 
-    <select id="queryAllList" parameterType="String" resultMap="KuaishouLiveUserAccountResult">
+    <select id="queryAllList" parameterType="com.ruixuan.live.entity.KuaishouLiveUserAccount"  resultMap="KuaishouLiveUserAccountResult">
         <include refid="selectKuaishouLiveUserAccountVo"/>
         <where>
             <if test="ksId != null ">and ks_id = #{ksId}</if>
@@ -169,11 +170,12 @@
             </if>
             <if test="designerLeader != null  and designerLeader != ''">and designer_leader = #{designerLeader}</if>
             <if test="createrId != null  and createrId != ''">and creater_id = #{createrId}</if>
+            <if test="accountStatus != null  and accountStatus != ''">and account_status = #{accountStatus}</if>
         </where>
         ORDER BY create_time desc
     </select>
 
-    <select id="queryAllListByAccountNames" parameterType="String" resultMap="KuaishouLiveUserAccountResult">
+    <select id="queryAllListByAccountNames" parameterType="com.ruixuan.live.entity.KuaishouLiveUserAccount" resultMap="KuaishouLiveUserAccountResult">
         <include refid="selectKuaishouLiveUserAccountVo"/>
         <where>
             <if test="accountNames != null and accountNames.size() > 0">
@@ -186,6 +188,7 @@
             <if test="accountName != null  and accountName != ''">and account_name like concat('%', #{accountName}, '%')
             </if>
             <if test="ksName != null  and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
+            <if test="accountStatus != null  and accountStatus != ''">and account_status = #{accountStatus}</if>
         </where>
         ORDER BY create_time desc
     </select>