yangzian 3 лет назад
Родитель
Сommit
8ebc8ab172

+ 2 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -216,6 +216,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/estimatePeopleNumber/**", "anon");
 
         filterChainDefinitionMap.put("/exportReportController/**", "anon");
+
+        filterChainDefinitionMap.put("/importPolicyController/importPolicyInit", "anon");
         //filterChainDefinitionMap.put("/settLementController/**", "anon");
 //        filterChainDefinitionMap.put("/settLementFileController/**", "anon");
 

+ 2 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/mapper/CwjsPolicyInfoMapper.java

@@ -30,4 +30,6 @@ public interface CwjsPolicyInfoMapper extends BaseMapper<CwjsPolicyInfo> {
     List<JSONObject> getAllSaleByUserId(String userId);
 
     void updatePolicyInfoById(CwjsPolicyInfo policyInfo);
+
+    CwjsPolicyInfo getPolicyInfo(CwjsPolicyInfo policyInfo);
 }

+ 87 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/mapper/xml/CwjsPolicyInfoMapper.xml

@@ -134,4 +134,91 @@
         where id = #{id}
     </update>
 
+
+
+
+
+
+
+
+
+    <select id="getPolicyInfo" resultType="org.jeecg.ctop.finance.policy.entity.CwjsPolicyInfo">
+        SELECT pi.*
+        FROM
+            ctop_cwjs_policy_info pi
+          where pi.del_flag = 0
+        <if test="companyName != null and companyName != ''">
+            and pi.company_name = #{companyName}
+        </if>
+        <if test="advertiserName != null and advertiserName != ''">
+            and pi.advertiser_name = #{advertiserName}
+        </if>
+        <if test="mediaType != null and mediaType != ''">
+            and pi.media_type = #{mediaType}
+        </if>
+
+        <if test="companySubjectId != null">
+            and pi.company_subject_id = #{companySubjectId}
+        </if>
+
+        <if test="groupAbbreviation != null and groupAbbreviation != ''">
+            and pi.group_abbreviation = #{groupAbbreviation}
+        </if>
+
+        <if test="advancePay != null">
+            and pi.advance_pay = #{advancePay}
+        </if>
+        <if test="accountingPeriod != null and accountingPeriod != ''">
+            and pi.accounting_period = #{accountingPeriod}
+        </if>
+
+        <if test="rebateType != null">
+            and pi.rebate_type = #{rebateType}
+        </if>
+
+        <if test="rebateRate != null and rebateRate != ''">
+            and pi.rebate_rate = #{rebateRate}
+        </if>
+
+        <if test="isDianPay != null">
+            and pi.is_dian_pay = #{isDianPay}
+        </if>
+
+        <if test="dianPayCompanyName != null and dianPayCompanyName != ''">
+            and pi.dian_pay_company_name = #{dianPayCompanyName}
+        </if>
+
+        <if test="dianPayCompanyRebateRate != null and dianPayCompanyRebateRate != ''">
+            and pi.dian_pay_company_rebate_rate = #{dianPayCompanyRebateRate}
+        </if>
+
+        <if test="promotionType != null">
+            and pi.promotion_type = #{promotionType}
+        </if>
+
+        <if test="policyStartDate != null and policyStartDate != ''">
+            and pi.policy_start_date = #{policyStartDate}
+        </if>
+
+        <if test="policyEndDate != null and policyEndDate != ''">
+            and pi.policy_end_date = #{policyEndDate}
+        </if>
+
+        <if test="createUserId != null and createUserId != ''">
+            and pi.create_user_id = #{createUserId}
+        </if>
+        limit 1
+
+
+    </select>
+
+
+
+
+
+
+
+
+
+
 </mapper>

+ 49 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ImportPolicyController.java

@@ -0,0 +1,49 @@
+package org.jeecg.ctop.finance.settlement.controller;
+
+import cn.com.ctop.common.module.service.ISysUserService;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.entity.SysUser;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
+import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
+import org.jeecg.ctop.finance.settlement.service.ISettlementInfoService;
+import org.jeecg.ctop.finance.settlement.service.serviceImpl.ReportSettlementServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+
+
+/**
+ * 政策信息 导入
+ * Administrator
+ * 2021/7/28
+ **/
+
+@Slf4j
+@RestController
+@RequestMapping("/importPolicyController")
+public class ImportPolicyController {
+
+    @Autowired
+    private ReportSettlementServiceImpl reportSettlementService;
+    @Autowired
+    private ISysUserService userService;
+
+    @ApiOperation(value = "财务结算-导入政策数据", notes = "财务结算-导入政策数据")
+    @PostMapping(value = "/importPolicyInit")
+    public Result importPolicyInit(@RequestParam("file") MultipartFile files) throws Exception{
+
+        return reportSettlementService.importPolicyInit(files);
+    }
+
+
+
+
+
+
+}

+ 1 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/pojo/CtopCwjsSlettementReport.java

@@ -20,6 +20,7 @@ public class CtopCwjsSlettementReport implements Serializable {
     private Long id;
     private Integer policyId;
     private String advertiserName;
+    private String companyName;
     private String productName;
     private String policyDate;
     private Integer mediaType;

+ 105 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/PolicyImportVo.java

@@ -0,0 +1,105 @@
+package org.jeecg.ctop.finance.settlement.entity.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ *
+ * @description: 政策 上传 数据 excel
+ * @return:
+ * @author: zianY
+ */
+@Data
+public class PolicyImportVo implements Serializable {
+    /**公司名称*/
+    @Excel(name = "公司名称")
+    private String companyName;
+    /**广告主id*/
+    @Excel(name = "广告主")
+    private String advertiserName;
+
+    @Excel(name = "产品名称(多个产品名称使用英文'-'分割)")
+    private String policyProductName;
+
+
+    /**媒体类型*/
+    @Excel(name = "媒体(1-头条 2-快手)")
+    private Integer mediaType;
+
+    @Excel(name = "销售人员名称")
+    private String createUserName;
+    /**区域 华北,华南,华东*/
+    @Excel(name = "区域(华北,石家庄,华南,骄阳,杭州,华东)")
+    private String areaInfo;
+
+    /**我司主体*/
+    @Excel(name = "我司主体(北京汇创思拓数字科技有限公司,广州汇创思拓数字科技有限公司,骄阳,上海贯月,舟山有梗)")
+    private String companySubjectIdStr;
+
+
+    /**运营方式: 0:自运营  1:代运营*/
+    @Excel(name = "运营方式(0:自运营  1:代运营)")
+    private Integer promotionType;
+
+    /**集团简称*/
+    @Excel(name = "集团简称")
+    private String groupAbbreviation;
+    /**状态 0:待审核 1:审核中 2:审核通过3:审核拒绝*/
+
+    @ApiModelProperty(value = "状态 0:待审核 1:审核中 2:审核通过3:审核拒绝")
+    private Integer approvedStatus;
+
+    /**是否预付:0:否  1:是 */
+    @Excel(name = "是否预付(0:否  1:是)")
+    private Integer advancePay;
+
+    /**返点类型:0:返现  1:返货   2:返现+返货*/
+    @Excel(name = "返点类型(0:返现  1:返货   2:返现+返货)")
+    private Integer rebateType;
+
+    /**返点比例*/
+    @Excel(name = "返点比列(保留2位小数,不需要带'%')")
+    private java.math.BigDecimal rebateRate;
+
+    /**账期*/
+    @Excel(name = "账期")
+    private String accountingPeriod;
+
+    /**是否垫付:0:否  1:是 */
+    @Excel(name = "是否第三方垫付(0:否  1:是)")
+    private Integer isDianPay;
+    /**垫付公司名称*/
+    @Excel(name = "垫付公司")
+    private String dianPayCompanyName;
+    /**垫付公司返点比例*/
+    @Excel(name = "垫付返点(保留4位小数)")
+    private java.math.BigDecimal dianPayCompanyRebateRate;
+
+    /**政策开始时间*/
+    @Excel(name = "政策开始时间(年-月-日)")
+    private String policyStartDate;
+    /**政策结束时间*/
+    @Excel(name = "政策结束时间(年-月-日)")
+    private String policyEndDate;
+    /**备注:如果没人填的话记录被拒次数*/
+    @Excel(name = "备注")
+    private String remarks;
+
+
+    @ApiModelProperty(value = "删除状态(0,正常,1已删除)")
+    private Integer delFlag;
+    /**创建时间*/
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**更新时间*/
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+}

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

@@ -6,6 +6,7 @@
     <insert id="replaceCwjsSlettementProfit">
             replace into ctop_cwjs_slettement_report(
             advertiser_name,
+            company_name,
             product_name,
             policy_date,
             create_user_id,
@@ -15,6 +16,7 @@
             values
             <foreach collection="list" item="l" separator=",">
                 (#{l.advertiserName},
+                #{l.companyName},
                 #{l.productName},
                 #{l.policyDate},
                 #{l.createUserId},

+ 6 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java

@@ -6,6 +6,7 @@ import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.ctop.finance.policy.entity.CwjsPolicyInfo;
 import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
 import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -29,4 +30,9 @@ public interface IReportSettlementService {
     void cwjsPRofit(CwjsPolicyInfo cwjsPolicyInfo);
 
     List<String> getAccountId(SettlementFileParamsVo paramsVo,SysUser user);
+
+
+
+    Result importPolicyInit(MultipartFile file);
+
 }

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

@@ -1,13 +1,13 @@
 package org.jeecg.ctop.finance.settlement.service.serviceImpl;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
 import cn.com.ctop.common.module.entity.SysLog;
 import cn.com.ctop.common.module.entity.UserAllocation;
-import cn.com.ctop.common.module.mapper.MailLogMapper;
-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.mapper.*;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import cn.com.ctop.common.module.utils.ImageUtils;
 import com.alibaba.fastjson.JSONObject;
@@ -24,8 +24,11 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.entity.SysUser;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
+import org.jeecg.ctop.finance.policy.entity.CwjsCompanySubject;
 import org.jeecg.ctop.finance.policy.entity.CwjsPolicyInfo;
 import org.jeecg.ctop.finance.policy.entity.CwjsPolicyProduct;
+import org.jeecg.ctop.finance.policy.mapper.CwjsCompanySubjectMapper;
+import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyInfoMapper;
 import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyProductMapper;
 import org.jeecg.ctop.finance.policy.utils.Check;
 import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
@@ -41,6 +44,7 @@ import org.jeecg.modules.ctop.service.IMaterialReportOverViewService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.imageio.ImageIO;
@@ -903,12 +907,14 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
         List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(cwjsPolicyInfo.getId());
         if (!Check.isNull(productList)){
             if (!Check.isNull(betweenDaysList)){
+
                 List<CtopCwjsSlettementReport> reportList = new ArrayList<>();
                 for (CwjsPolicyProduct product : productList) {
                     for (String day : betweenDaysList) {
                         CtopCwjsSlettementReport report = new CtopCwjsSlettementReport();
                         report.setPolicyId(cwjsPolicyInfo.getId());
                         report.setAdvertiserName(cwjsPolicyInfo.getAdvertiserName());
+                        report.setCompanyName(cwjsPolicyInfo.getCompanyName());
                         report.setProductName(product.getPolicyProductName());
                         report.setMediaType(cwjsPolicyInfo.getMediaType());
                         report.setCreateUserId(cwjsPolicyInfo.getCreateUserId());
@@ -920,4 +926,107 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
             }
         }
     }
+
+
+
+
+    @Resource
+    private CwjsPolicyInfoMapper cwjsPolicyInfoMapper;
+    @Resource
+    private SysUserMapper sysUserMapper;
+    @Resource
+    private CwjsCompanySubjectMapper cwjsCompanySubjectMapper;
+
+
+
+    @Override
+    public Result importPolicyInit(MultipartFile file) {
+        try {
+            //LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            //settlementInfo.setCreateUserId(user.getId());
+            //settlementInfo.setCreateUserId("b161b7d9793942f980dbfe8c931cd1b0");
+            ImportParams importParams = new ImportParams();
+
+            //表头行数
+            importParams.setHeadRows(1);
+
+            ExcelImportResult<PolicyImportVo> importResult = ExcelImportUtil.importExcelMore(file.getInputStream(), PolicyImportVo.class, importParams);
+            if (importResult.getList().size() < 1) {
+                return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入");
+            }
+
+
+            for (PolicyImportVo importVo : importResult.getList()) {
+                if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getCompanyName())){
+                    continue;
+                }
+
+                if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getPolicyProductName())){
+                    continue;
+                }
+
+
+                List<String> productNameList = Arrays.asList(importVo.getPolicyProductName().split("-"));
+
+                CwjsPolicyInfo cwjsPolicyInfo = new CwjsPolicyInfo();
+                BeanUtils.copyProperties(importVo, cwjsPolicyInfo);
+
+                // 销售 - 创建人
+                QueryWrapper<SysUser> sysUserQw = new QueryWrapper<>();
+                sysUserQw.eq("realname", importVo.getCreateUserName());
+                sysUserQw.last("limit 1");
+                SysUser user = sysUserMapper.selectOne(sysUserQw);
+                cwjsPolicyInfo.setCreateUserId(user.getId());
+
+                //公司主体
+                QueryWrapper<CwjsCompanySubject> companySubQw = new QueryWrapper<>();
+                companySubQw.eq("company_subject_name", importVo.getCompanySubjectIdStr());
+                companySubQw.eq("area_info", importVo.getAreaInfo());
+                companySubQw.last("limit 1");
+                CwjsCompanySubject companySubject = cwjsCompanySubjectMapper.selectOne(companySubQw);
+                cwjsPolicyInfo.setCompanySubjectId(companySubject.getId());
+
+
+                cwjsPolicyInfo.setApprovedStatus(3);
+
+
+                CwjsPolicyInfo policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
+
+                if (cn.com.ctop.common.module.utils.Check.isNull(policy)){
+                    cwjsPolicyInfoMapper.insert(cwjsPolicyInfo);
+                    policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
+                }
+
+                //查看 政策下的产品
+                List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(policy.getId());
+                List proList = productList.stream().map(CwjsPolicyProduct:: getPolicyProductName).collect(Collectors.toList());
+
+                for (String str : productNameList) {
+
+                    if (!proList.contains(str)){
+                        //新增产品
+                        CwjsPolicyProduct policyProduct = new CwjsPolicyProduct();
+                        policyProduct.setPolicyId(policy.getId());
+                        policyProduct.setPolicyProductName(str);
+                        policyProduct.setCreateUserId(cwjsPolicyInfo.getCreateUserId());
+                        policyProduct.setDelFlag(0);
+                        cwjsPolicyProductMapper.insert(policyProduct);
+                    }
+                }
+
+                this.cwjsPRofit(policy);
+
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("政策数据上传失败,请使用正确的模板导入!");
+        }
+        return Result.successMsg("政策数据上传成功", null);
+    }
+
+
+
+
 }

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

@@ -8,6 +8,7 @@ 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.mapper.SysUserMapper;
 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;
@@ -19,9 +20,18 @@ 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.entity.SysUser;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.ctop.finance.policy.entity.CwjsCompanySubject;
+import org.jeecg.ctop.finance.policy.entity.CwjsPolicyInfo;
+import org.jeecg.ctop.finance.policy.entity.CwjsPolicyProduct;
+import org.jeecg.ctop.finance.policy.mapper.CwjsCompanySubjectMapper;
+import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyInfoMapper;
+import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyProductMapper;
+import org.jeecg.ctop.finance.policy.service.impl.CwjsPolicyProductServiceImpl;
 import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
 import org.jeecg.ctop.finance.settlement.entity.vo.AccountImportVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.PolicyImportVo;
 import org.jeecg.ctop.finance.settlement.mapper.SettlementInfoMapper;
 import org.jeecg.ctop.finance.settlement.service.ISettlementInfoService;
 import org.jeecg.modules.ctop.entity.ProjectMember;
@@ -38,6 +48,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Slf4j
@@ -53,12 +64,10 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
 
 
     /**
-     *
-     * @description: 查询 财务结算-账户列表
-     *
      * @param settlementInfo
      * @param pageNo
      * @param pageSize
+     * @description: 查询 财务结算-账户列表
      * @return: org.jeecg.common.api.vo.Result
      * @author: zianY
      */
@@ -73,26 +82,27 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
 
     @Autowired
     private UserAllocationServiceImpl userAllocationService;
+
     /**
-     * @description: 财务结算-修改账户状态
      * @param id
      * @param status 账户状态 0-开 1-关
+     * @description: 财务结算-修改账户状态
      * @return: org.jeecg.common.api.vo.Result
      * @author: zianY
      */
     @Override
     public Result updSettlementStatusById(Long id, Integer status) {
         // 修改状态
-        settlementInfoMapper.updSettlementStatusById(id,status);
+        settlementInfoMapper.updSettlementStatusById(id, status);
 
         //同步 状态
-       CtopCwjsSettlementInfo settlementInfo =  settlementInfoMapper.selectById(id);
+        CtopCwjsSettlementInfo settlementInfo = settlementInfoMapper.selectById(id);
 
         UserAllocation userAllocation = userAllocationService.getByAccountId(new Long(settlementInfo.getAccountId()));
-        if (!Check.isNull(userAllocation)){
+        if (!Check.isNull(userAllocation)) {
             userAllocation.setAccountStatus(status);
             userAllocationService.editUserAlloCation(userAllocation);
-        }else{
+        } else {
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             SysLog sysLog = new SysLog();
             sysLog.setLogType(2);
@@ -155,10 +165,8 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
     */
 
     /**
-     *
-     * @description: 删除
-     *
      * @param id
+     * @description: 删除
      * @return: org.jeecg.common.api.vo.Result
      * @author: zianY
      */
@@ -170,11 +178,9 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
 
 
     /**
-     *
-     * @description:
-     *
      * @param settlementInfo
      * @param file
+     * @description:
      * @return: org.jeecg.common.api.vo.Result
      * @author: zianY
      * @time: 2021/7/30 16:26
@@ -182,69 +188,67 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
     @Override
     public Result settlementAccountImport(CtopCwjsSettlementInfo settlementInfo, MultipartFile file) {
 
-            try {
-                //LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-                //settlementInfo.setCreateUserId(user.getId());
-                //settlementInfo.setCreateUserId("b161b7d9793942f980dbfe8c931cd1b0");
-                ImportParams importParams = new ImportParams();
-                //表格标题行数
-                importParams.setTitleRows(1);
-                //表头行数
-                importParams.setHeadRows(1);
-
-                //校验表头 头条
-                if (StringUtils.equals("1",String.valueOf(settlementInfo.getMediaId()))){
-                    importParams.setImportFields(new String[]{"账户ID","账户名称"});
-                    //快手
-                }else if (StringUtils.equals("2",String.valueOf(settlementInfo.getMediaId()))){
-                    importParams.setImportFields(new String[]{"快手ID","账户ID","账户名称"});
+        try {
+            //LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            //settlementInfo.setCreateUserId(user.getId());
+            //settlementInfo.setCreateUserId("b161b7d9793942f980dbfe8c931cd1b0");
+            ImportParams importParams = new ImportParams();
+            //表格标题行数
+            importParams.setTitleRows(1);
+            //表头行数
+            importParams.setHeadRows(1);
+
+            //校验表头 头条
+            if (StringUtils.equals("1", String.valueOf(settlementInfo.getMediaId()))) {
+                importParams.setImportFields(new String[]{"账户ID", "账户名称"});
+                //快手
+            } else if (StringUtils.equals("2", String.valueOf(settlementInfo.getMediaId()))) {
+                importParams.setImportFields(new String[]{"快手ID", "账户ID", "账户名称"});
+            }
+            //校验excel的标题列顺序
+            importParams.setNeedCheckOrder(true);
+            ExcelImportResult<AccountImportVo> importResult = ExcelImportUtil.importExcelMore(file.getInputStream(), AccountImportVo.class, importParams);
+            if (importResult.getList().size() < 1) {
+                return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入");
+            }
+            for (AccountImportVo importVo : importResult.getList()) {
+                if (Check.isNull(importVo.getAccountId())) {
+                    continue;
                 }
-                //校验excel的标题列顺序
-                importParams.setNeedCheckOrder(true);
-                ExcelImportResult<AccountImportVo> importResult = ExcelImportUtil.importExcelMore(file.getInputStream(), AccountImportVo.class,importParams);
-                if (importResult.getList().size() < 1){
-                    return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入");
+                //查询 账户 状态
+                UserAllocation userAllocation = userAllocationService.getByAccountId(new Long(importVo.getAccountId()));
+                if (Check.isNull(userAllocation)) {
+                    settlementInfo.setStatus(0);
+                } else {
+                    settlementInfo.setStatus(userAllocation.getAccountStatus());
                 }
-                for (AccountImportVo importVo : importResult.getList()) {
-                    if (Check.isNull(importVo.getAccountId())){
-                        continue;
-                    }
-                    //查询 账户 状态
-                    UserAllocation userAllocation = userAllocationService.getByAccountId(new Long(importVo.getAccountId()));
-                    if (Check.isNull(userAllocation)){
-                        settlementInfo.setStatus(0);
-                    }else {
-                        settlementInfo.setStatus(userAllocation.getAccountStatus());
-                    }
-                    BeanUtils.copyProperties(importVo,settlementInfo);
-                    //根据账户id 查看
-                    CtopCwjsSettlementInfo cwjs = settlementInfoMapper.getSettlementByAccountId(importVo.getAccountId());
-                    if (Check.isNull(cwjs)){
-                       // BeanUtils.copyProperties(importVo,settlementInfo);
-                        settlementInfoMapper.insert(settlementInfo);
-                    }else {
-                        settlementInfo.setId(cwjs.getId());
-                        settlementInfoMapper.updateById(settlementInfo);
-                    }
+                BeanUtils.copyProperties(importVo, settlementInfo);
+                //根据账户id 查看
+                CtopCwjsSettlementInfo cwjs = settlementInfoMapper.getSettlementByAccountId(importVo.getAccountId());
+                if (Check.isNull(cwjs)) {
+                    // BeanUtils.copyProperties(importVo,settlementInfo);
+                    settlementInfoMapper.insert(settlementInfo);
+                } else {
+                    settlementInfo.setId(cwjs.getId());
+                    settlementInfoMapper.updateById(settlementInfo);
                 }
-            }catch (Exception e){
-                e.printStackTrace();
-                return Result.error("账户数据上传失败,请使用正确的模板导入!");
             }
-            return Result.successMsg("账户数据上传成功",null);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("账户数据上传失败,请使用正确的模板导入!");
         }
+        return Result.successMsg("账户数据上传成功", null);
+    }
 
 
     /**
-     *
-     * @description: 查询多个用户信息
-     *
      * @param userIds
-     * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
+     * @description: 查询多个用户信息
+     * @return: java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
      * @author: zianY
      */
     @Override
-    public List<Map<String,Object>> getUserByIds(Set userIds) {
+    public List<Map<String, Object>> getUserByIds(Set userIds) {
         return settlementInfoMapper.getUserByIds(userIds);
     }