|
@@ -5,24 +5,32 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
|
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.entity.UserAllocation;
|
|
-import cn.com.ctop.common.module.mapper.*;
|
|
|
|
|
|
+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.SysUserMapper;
|
|
|
|
+import cn.com.ctop.common.module.mapper.UserAllocationMapper;
|
|
import cn.com.ctop.common.module.utils.CorpWexinUtils;
|
|
import cn.com.ctop.common.module.utils.CorpWexinUtils;
|
|
-import cn.com.ctop.common.module.utils.ImageUtils;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.google.gson.JsonObject;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
-import org.apache.poi.hssf.usermodel.*;
|
|
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFDataFormat;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
import org.apache.poi.ss.usermodel.ClientAnchor;
|
|
import org.apache.poi.ss.usermodel.ClientAnchor;
|
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
-import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.ctop.finance.policy.entity.CwjsCompanySubject;
|
|
import org.jeecg.ctop.finance.policy.entity.CwjsCompanySubject;
|
|
import org.jeecg.ctop.finance.policy.entity.CwjsPolicyApprovalLog;
|
|
import org.jeecg.ctop.finance.policy.entity.CwjsPolicyApprovalLog;
|
|
@@ -35,12 +43,15 @@ import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyProductMapper;
|
|
import org.jeecg.ctop.finance.policy.service.ICreateSheetService;
|
|
import org.jeecg.ctop.finance.policy.service.ICreateSheetService;
|
|
import org.jeecg.ctop.finance.policy.service.impl.CwjsSaleAssistantInfoServiceImpl;
|
|
import org.jeecg.ctop.finance.policy.service.impl.CwjsSaleAssistantInfoServiceImpl;
|
|
import org.jeecg.ctop.finance.policy.utils.Check;
|
|
import org.jeecg.ctop.finance.policy.utils.Check;
|
|
-import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
|
|
|
|
import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSlettementReport;
|
|
import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSlettementReport;
|
|
-import org.jeecg.ctop.finance.settlement.entity.vo.*;
|
|
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.PolicyImportVo;
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.ProfitReportBytedanceVo;
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.ProfitReportKuaiShouVo;
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
|
|
|
|
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
|
|
import org.jeecg.ctop.finance.settlement.mapper.CwjsProfitMapper;
|
|
import org.jeecg.ctop.finance.settlement.mapper.CwjsProfitMapper;
|
|
import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
|
|
import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
|
|
-import org.jeecg.ctop.finance.settlement.mapper.SettlementInfoMapper;
|
|
|
|
import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
|
|
import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
|
|
import org.jeecg.ctop.finance.utils.SettlementUtil;
|
|
import org.jeecg.ctop.finance.utils.SettlementUtil;
|
|
import org.jeecg.ctop.finance.utils.createExcelByTemplate;
|
|
import org.jeecg.ctop.finance.utils.createExcelByTemplate;
|
|
@@ -53,16 +64,25 @@ import org.springframework.web.multipart.MultipartFile;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.imageio.ImageIO;
|
|
import javax.imageio.ImageIO;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-import javax.swing.*;
|
|
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
import java.awt.image.BufferedImage;
|
|
import java.awt.image.BufferedImage;
|
|
-import java.io.*;
|
|
|
|
|
|
+import java.io.BufferedOutputStream;
|
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.OutputStream;
|
|
import java.net.URL;
|
|
import java.net.URL;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.text.MessageFormat;
|
|
import java.text.MessageFormat;
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.Calendar;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@@ -97,6 +117,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
public List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance() {
|
|
public List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance() {
|
|
return reportSettlementMapper.getAccountTransactionDayBytedance(null);
|
|
return reportSettlementMapper.getAccountTransactionDayBytedance(null);
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Result settlementReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response, SysUser user) {
|
|
public Result settlementReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response, SysUser user) {
|
|
try {
|
|
try {
|
|
@@ -118,9 +139,9 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
|
|
|
|
//查询 账户id
|
|
//查询 账户id
|
|
- List<String> accountIdList = this.getAccountId(paramsVo,user);
|
|
|
|
|
|
+ List<String> accountIdList = this.getAccountId(paramsVo, user);
|
|
|
|
|
|
- if (Check.isNull(accountIdList)){
|
|
|
|
|
|
+ if (Check.isNull(accountIdList)) {
|
|
return Result.errorMsg("该广告主和产品下无法查询到绑定的账户信息");
|
|
return Result.errorMsg("该广告主和产品下无法查询到绑定的账户信息");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -128,9 +149,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
|
|
|
|
//设置第一个sheet页 汇总页
|
|
//设置第一个sheet页 汇总页
|
|
- createSheetService.createBytedance(wb,style,accountIdList,paramsVo.getUploadYears());
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ createSheetService.createBytedance(wb, style, accountIdList, paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < accountIdList.size(); k++) {
|
|
for (int k = 0; k < accountIdList.size(); k++) {
|
|
@@ -139,7 +158,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
//获取账户 日流水数据 根据账户id 和 年月 查询数据
|
|
//获取账户 日流水数据 根据账户id 和 年月 查询数据
|
|
List<SettlementReportBytedanceVo> settlementList = reportSettlementMapper.getAccountTransactionDayBytedance(paramsVo);
|
|
List<SettlementReportBytedanceVo> settlementList = reportSettlementMapper.getAccountTransactionDayBytedance(paramsVo);
|
|
- if (Check.isNull(settlementList)){
|
|
|
|
|
|
+ if (Check.isNull(settlementList)) {
|
|
num++;
|
|
num++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -154,7 +173,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
//设置 第一行 表头
|
|
//设置 第一行 表头
|
|
- cell0.setCellValue(paramsVo.getUploadYears()+"-头条结算单");
|
|
|
|
|
|
+ cell0.setCellValue(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-头条结算单");
|
|
CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
|
|
CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
|
|
sheet.addMergedRegion(region);//合并行
|
|
sheet.addMergedRegion(region);//合并行
|
|
cell0.setCellStyle(style);
|
|
cell0.setCellStyle(style);
|
|
@@ -238,9 +257,9 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
//查询 图片 url
|
|
//查询 图片 url
|
|
- List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId,paramsVo.getUploadYears());
|
|
|
|
|
|
+ List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId, paramsVo.getEndTime());
|
|
|
|
|
|
- if (!Check.isNull(imageUrlList)){
|
|
|
|
|
|
+ if (!Check.isNull(imageUrlList)) {
|
|
for (int j = 0; j < imageUrlList.size(); j++) {
|
|
for (int j = 0; j < imageUrlList.size(); j++) {
|
|
//先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
|
|
//先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
@@ -253,11 +272,11 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
Image imageTookittitle = Toolkit.getDefaultToolkit().createImage(url);
|
|
Image imageTookittitle = Toolkit.getDefaultToolkit().createImage(url);
|
|
BufferedImage bufferImg = createExcelByTemplate.toBufferedImage(imageTookittitle);
|
|
BufferedImage bufferImg = createExcelByTemplate.toBufferedImage(imageTookittitle);
|
|
ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
|
|
ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
|
|
- int startIndex = settlementList.size() +6;
|
|
|
|
- int hight = (int)Math.round(bufferImg.getHeight() / 28.35 / (sheet.getDefaultRowHeightInPoints() / 28.35));
|
|
|
|
- int width = (int)Math.round(bufferImg.getWidth() / (96/2.54) / ((sheet.getColumnWidthInPixels(settlementList.size()) / (96 / 2.54))));
|
|
|
|
|
|
+ int startIndex = settlementList.size() + 6;
|
|
|
|
+ int hight = (int) Math.round(bufferImg.getHeight() / 28.35 / (sheet.getDefaultRowHeightInPoints() / 28.35));
|
|
|
|
+ int width = (int) Math.round(bufferImg.getWidth() / (96 / 2.54) / ((sheet.getColumnWidthInPixels(settlementList.size()) / (96 / 2.54))));
|
|
//anchor主要用于设置图片的属性
|
|
//anchor主要用于设置图片的属性
|
|
- HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex+(5*j)+hight*j, (short) width, startIndex+(5*j)+hight*(j+1));
|
|
|
|
|
|
+ HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex + (5 * j) + hight * j, (short) width, startIndex + (5 * j) + hight * (j + 1));
|
|
//HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
|
|
//HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
|
|
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
|
|
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
|
|
//插入图片
|
|
//插入图片
|
|
@@ -267,7 +286,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if(accountIdList.size() == num){
|
|
|
|
|
|
+ if (accountIdList.size() == num) {
|
|
return Result.errorMsg("暂无账户流水数据");
|
|
return Result.errorMsg("暂无账户流水数据");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -276,7 +295,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
response.setDateHeader("Expires", 0);
|
|
response.setDateHeader("Expires", 0);
|
|
- response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getUploadYears()+"-头条结算单.xlsx", "UTF-8"));
|
|
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-头条结算单.xlsx", "UTF-8"));
|
|
OutputStream output = response.getOutputStream();
|
|
OutputStream output = response.getOutputStream();
|
|
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
|
|
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
|
|
wb.write(bufferedOutPut);
|
|
wb.write(bufferedOutPut);
|
|
@@ -289,53 +308,67 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param paramsVo
|
|
* @param paramsVo
|
|
* @param user
|
|
* @param user
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<String> getAccountId(SettlementFileParamsVo paramsVo,SysUser user) {
|
|
|
|
|
|
+ public List<String> getAccountId(SettlementFileParamsVo paramsVo, SysUser user) {
|
|
String uploadYears = paramsVo.getUploadYears();
|
|
String uploadYears = paramsVo.getUploadYears();
|
|
|
|
+ String startTime = paramsVo.getStartTime();
|
|
//1:区分媒体(头条:1 快手:2)
|
|
//1:区分媒体(头条:1 快手:2)
|
|
Integer mediaId = paramsVo.getMediaId();
|
|
Integer mediaId = paramsVo.getMediaId();
|
|
String roleCode = roleMapper.getRoleCodeByUserId(user.getId());
|
|
String roleCode = roleMapper.getRoleCodeByUserId(user.getId());
|
|
- Set<String>sales = new HashSet<>();
|
|
|
|
|
|
+ Set<String> sales = new HashSet<>();
|
|
List<String> userIds = new ArrayList<>();
|
|
List<String> userIds = new ArrayList<>();
|
|
- List<UserAllocation>allocations ;
|
|
|
|
- if("admin".equals(roleCode)|| "finance".equals(roleCode)){
|
|
|
|
|
|
+ List<UserAllocation> allocations;
|
|
|
|
+ if ("admin".equals(roleCode) || "finance".equals(roleCode)) {
|
|
//查询所有可用的账户
|
|
//查询所有可用的账户
|
|
sales = null;
|
|
sales = null;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//查询 销售及助理 关联对应的人员
|
|
//查询 销售及助理 关联对应的人员
|
|
userIds = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(user.getId());
|
|
userIds = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(user.getId());
|
|
- if (Check.isNull(userIds)){
|
|
|
|
|
|
+ if (Check.isNull(userIds)) {
|
|
userIds.add(user.getId());
|
|
userIds.add(user.getId());
|
|
}
|
|
}
|
|
sales.addAll(new HashSet<>(userIds));
|
|
sales.addAll(new HashSet<>(userIds));
|
|
}
|
|
}
|
|
//查询财务模块中已上传的账户
|
|
//查询财务模块中已上传的账户
|
|
- List<String> settlementAccountList = reportSettlementMapper.getAccountIdBytedance(sales,String.valueOf(mediaId),paramsVo.getAdvertiserId(),paramsVo.getProductId(),paramsVo.getProjectId());
|
|
|
|
|
|
+ List<String> settlementAccountList = reportSettlementMapper.getAccountIdBytedance(sales, String.valueOf(mediaId), paramsVo.getAdvertiserId(), paramsVo.getProductId(), paramsVo.getProjectId());
|
|
//查询已绑定账户
|
|
//查询已绑定账户
|
|
- allocations = userAllocationMapper.getAccountInfoBySalesId(sales,String.valueOf(mediaId),paramsVo.getAdvertiserId(),paramsVo.getProductId(),paramsVo.getProjectId());
|
|
|
|
- return mergeAccountId(settlementAccountList,allocations,uploadYears);
|
|
|
|
|
|
+ allocations = userAllocationMapper.getAccountInfoBySalesId(sales, String.valueOf(mediaId), paramsVo.getAdvertiserId(), paramsVo.getProductId(), paramsVo.getProjectId());
|
|
|
|
+ return mergeAccountId(settlementAccountList, allocations, uploadYears, startTime);
|
|
}
|
|
}
|
|
|
|
|
|
//账户处理
|
|
//账户处理
|
|
- private List<String> mergeAccountId(List<String> settlementAccountList, List<UserAllocation> allocations,String downloadYear) {
|
|
|
|
- List<String>salesAccount = new ArrayList<>();
|
|
|
|
|
|
+ private List<String> mergeAccountId(List<String> settlementAccountList, List<UserAllocation> allocations, String downloadYear, String startTime) {
|
|
|
|
+ List<String> salesAccount = new ArrayList<>();
|
|
// 账户状态 0 启动 1 禁用
|
|
// 账户状态 0 启动 1 禁用
|
|
- for(UserAllocation allocation : allocations){
|
|
|
|
- if(allocation.getAccountStatus() == 0){
|
|
|
|
- salesAccount.add(allocation.getAccountId()+"");
|
|
|
|
|
|
+ for (UserAllocation allocation : allocations) {
|
|
|
|
+ if (allocation.getAccountStatus() == 0) {
|
|
|
|
+ salesAccount.add(allocation.getAccountId() + "");
|
|
}
|
|
}
|
|
- if(allocation.getAccountStatus() == 1){
|
|
|
|
|
|
+ if (allocation.getAccountStatus() == 1) {
|
|
//被关停的账户
|
|
//被关停的账户
|
|
- Long updateDateNum = Long.parseLong(DateUtils.formatDate(allocation.getUpdateTime(),"yyyyMM"));
|
|
|
|
- downloadYear = downloadYear.replace("-","");
|
|
|
|
- Long downloadYearNum = Long.parseLong(downloadYear);
|
|
|
|
- if(updateDateNum >= downloadYearNum){
|
|
|
|
- salesAccount.add(allocation.getAccountId()+"");
|
|
|
|
|
|
+ Long updateDateNum = Long.parseLong(DateUtils.formatDate(allocation.getUpdateTime(), "yyyyMM"));
|
|
|
|
+ if (!Check.isNull(downloadYear)) {
|
|
|
|
+ downloadYear = downloadYear.replace("-", "");
|
|
|
|
+ Long downloadYearNum = Long.parseLong(downloadYear);
|
|
|
|
+ if (updateDateNum >= downloadYearNum) {
|
|
|
|
+ salesAccount.add(allocation.getAccountId() + "");
|
|
|
|
+ }
|
|
|
|
+ } else if (!Check.isNull(startTime)) {
|
|
|
|
+ try {
|
|
|
|
+ Long startTimeNum = Long.parseLong(DateUtils.formatDate(startTime, "yyyyMM"));
|
|
|
|
+ if (updateDateNum >= startTimeNum) {
|
|
|
|
+ salesAccount.add(allocation.getAccountId() + "");
|
|
|
|
+ }
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -366,22 +399,22 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
style.setFont(font);
|
|
style.setFont(font);
|
|
|
|
|
|
//查询 需要导出的数据的账户id
|
|
//查询 需要导出的数据的账户id
|
|
- List<String> accountIdList = this.getAccountId(paramsVo,user);
|
|
|
|
|
|
+ List<String> accountIdList = this.getAccountId(paramsVo, user);
|
|
|
|
|
|
|
|
|
|
- if (Check.isNull(accountIdList)){
|
|
|
|
|
|
+ if (Check.isNull(accountIdList)) {
|
|
return Result.errorMsg("该广告主和产品下无法查询到绑定的快手账户信息");
|
|
return Result.errorMsg("该广告主和产品下无法查询到绑定的快手账户信息");
|
|
}
|
|
}
|
|
//设置第一个sheet 汇总页-快手
|
|
//设置第一个sheet 汇总页-快手
|
|
- createSheetService.createKuaiShou(wb,style,accountIdList,paramsVo.getUploadYears());
|
|
|
|
|
|
+ createSheetService.createKuaiShou(wb, style, accountIdList, paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
int num = 0;
|
|
int num = 0;
|
|
for (int k = 0; k < accountIdList.size(); k++) {
|
|
for (int k = 0; k < accountIdList.size(); k++) {
|
|
String accountId = accountIdList.get(k);
|
|
String accountId = accountIdList.get(k);
|
|
paramsVo.setAccountId(accountId);
|
|
paramsVo.setAccountId(accountId);
|
|
|
|
|
|
- // List<SettlementReportKuaiShouVo> settlementList = reportSettlementMapper.getTransactionDayKuaiShouAgentAndAccount(paramsVo);
|
|
|
|
|
|
+ // List<SettlementReportKuaiShouVo> settlementList = reportSettlementMapper.getTransactionDayKuaiShouAgentAndAccount(paramsVo);
|
|
List<SettlementReportKuaiShouVo> settlementList = intranetSettlementService.getTransactionDayKuaiShouAgentAndAccountIntranet(paramsVo);
|
|
List<SettlementReportKuaiShouVo> settlementList = intranetSettlementService.getTransactionDayKuaiShouAgentAndAccountIntranet(paramsVo);
|
|
- if (Check.isNull(settlementList)){
|
|
|
|
|
|
+ if (Check.isNull(settlementList)) {
|
|
num++;
|
|
num++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -396,7 +429,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
HSSFRow row0 = sheet.createRow(0);
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
HSSFCell cell0 = row0.createCell(0);
|
|
//设置 第一行 表头
|
|
//设置 第一行 表头
|
|
- cell0.setCellValue(paramsVo.getUploadYears()+"-快手结算单");
|
|
|
|
|
|
+ cell0.setCellValue(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-快手结算单");
|
|
CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
|
|
CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
|
|
sheet.addMergedRegion(region);//合并行
|
|
sheet.addMergedRegion(region);//合并行
|
|
cell0.setCellStyle(style);
|
|
cell0.setCellStyle(style);
|
|
@@ -486,11 +519,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
//查询 图片 url
|
|
//查询 图片 url
|
|
- List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId,paramsVo.getUploadYears());
|
|
|
|
|
|
+ List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId, paramsVo.getEndTime());
|
|
|
|
|
|
- if (!Check.isNull(imageUrlList)){
|
|
|
|
|
|
+ if (!Check.isNull(imageUrlList)) {
|
|
for (int j = 0; j < imageUrlList.size(); j++) {
|
|
for (int j = 0; j < imageUrlList.size(); j++) {
|
|
//先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
|
|
//先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
@@ -504,10 +536,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
BufferedImage bufferImg = createExcelByTemplate.toBufferedImage(imageTookittitle);
|
|
BufferedImage bufferImg = createExcelByTemplate.toBufferedImage(imageTookittitle);
|
|
ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
|
|
ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
|
|
//anchor主要用于设置图片的属性
|
|
//anchor主要用于设置图片的属性
|
|
- int startIndex = settlementList.size()+7;
|
|
|
|
- int hight = (int)Math.round(bufferImg.getHeight() / 28.35 / (sheet.getDefaultRowHeightInPoints() / 28.35));
|
|
|
|
- int width = (int)Math.round(bufferImg.getWidth() / (96/2.54) / ((sheet.getColumnWidthInPixels(settlementList.size()) / (96 / 2.54))));
|
|
|
|
- HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex+(5*j)+hight*j, (short) width, startIndex+(5*j)+hight*(j+1));
|
|
|
|
|
|
+ int startIndex = settlementList.size() + 7;
|
|
|
|
+ int hight = (int) Math.round(bufferImg.getHeight() / 28.35 / (sheet.getDefaultRowHeightInPoints() / 28.35));
|
|
|
|
+ int width = (int) Math.round(bufferImg.getWidth() / (96 / 2.54) / ((sheet.getColumnWidthInPixels(settlementList.size()) / (96 / 2.54))));
|
|
|
|
+ HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex + (5 * j) + hight * j, (short) width, startIndex + (5 * j) + hight * (j + 1));
|
|
|
|
|
|
//HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
|
|
//HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
|
|
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
|
|
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
|
|
@@ -518,7 +550,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if(accountIdList.size() == num){
|
|
|
|
|
|
+ if (accountIdList.size() == num) {
|
|
return Result.errorMsg("暂无数据");
|
|
return Result.errorMsg("暂无数据");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -527,7 +559,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
response.setDateHeader("Expires", 0);
|
|
response.setDateHeader("Expires", 0);
|
|
- response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getUploadYears()+"-快手结算单.xlsx", "UTF-8"));
|
|
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-快手结算单.xlsx", "UTF-8"));
|
|
OutputStream output = response.getOutputStream();
|
|
OutputStream output = response.getOutputStream();
|
|
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
|
|
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
|
|
wb.write(bufferedOutPut);
|
|
wb.write(bufferedOutPut);
|
|
@@ -542,10 +574,9 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
- * @description: 财务结算 利润表导出 头条
|
|
|
|
* @param paramsVo
|
|
* @param paramsVo
|
|
* @param response
|
|
* @param response
|
|
|
|
+ * @description: 财务结算 利润表导出 头条
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @author: zianY
|
|
* @author: zianY
|
|
*/
|
|
*/
|
|
@@ -553,38 +584,38 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
public Result porfitReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
|
|
public Result porfitReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
|
|
try {
|
|
try {
|
|
//查询 头条利润表 时间段内 所有 账户
|
|
//查询 头条利润表 时间段内 所有 账户
|
|
- List<Map<String,Object>> list = reportSettlementMapper.getProfitBytedanceAccount(paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
- if (Check.isNull(list)){
|
|
|
|
|
|
+ List<Map<String, Object>> list = reportSettlementMapper.getProfitBytedanceAccount(paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
|
|
+ if (Check.isNull(list)) {
|
|
return Result.errorMsg("暂无数据");
|
|
return Result.errorMsg("暂无数据");
|
|
}
|
|
}
|
|
List<ProfitReportBytedanceVo> resultList = new ArrayList<>(list.size());
|
|
List<ProfitReportBytedanceVo> resultList = new ArrayList<>(list.size());
|
|
for (Map<String, Object> mapList : list) {
|
|
for (Map<String, Object> mapList : list) {
|
|
|
|
|
|
//查看账户数据
|
|
//查看账户数据
|
|
- Map<String,Object> map = reportSettlementMapper.getProfitBytedanceAccountCost(mapList.get("accountId").toString(),paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
|
|
+ Map<String, Object> map = reportSettlementMapper.getProfitBytedanceAccountCost(mapList.get("accountId").toString(), paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
|
|
|
|
ProfitReportBytedanceVo voSource = new ProfitReportBytedanceVo();
|
|
ProfitReportBytedanceVo voSource = new ProfitReportBytedanceVo();
|
|
- voSource.setAccountId(map.get("accountId")+"");
|
|
|
|
|
|
+ voSource.setAccountId(map.get("accountId") + "");
|
|
|
|
|
|
- voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName","")+"" : "" );//广告主名称
|
|
|
|
|
|
+ voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName", "") + "" : "");//广告主名称
|
|
//产品名称
|
|
//产品名称
|
|
- voSource.setProductName(!Check.isNull(map.get("productName")) ? map.getOrDefault("productName","")+"" : "" );
|
|
|
|
|
|
+ voSource.setProductName(!Check.isNull(map.get("productName")) ? map.getOrDefault("productName", "") + "" : "");
|
|
|
|
|
|
|
|
|
|
//查询销售
|
|
//查询销售
|
|
- Map<String,Object> slaeMap = reportSettlementMapper.getProfitReportSale(map.get("accountId")+"");
|
|
|
|
- voSource.setSaleName(Check.isNull(slaeMap) ? "" : slaeMap.getOrDefault("saleName","")+"");//销售
|
|
|
|
|
|
+ Map<String, Object> slaeMap = reportSettlementMapper.getProfitReportSale(map.get("accountId") + "");
|
|
|
|
+ voSource.setSaleName(Check.isNull(slaeMap) ? "" : slaeMap.getOrDefault("saleName", "") + "");//销售
|
|
//查询运营
|
|
//查询运营
|
|
- Map<String,Object> operateMap = reportSettlementMapper.getProfitReportOperateAndArea(map.get("accountId")+"");
|
|
|
|
- if (!Check.isNull(operateMap)){
|
|
|
|
- voSource.setOperateName(operateMap.getOrDefault("operateName","")+"");//运营
|
|
|
|
- voSource.setOperateArea(operateMap.getOrDefault("operateArea","")+"");//运营所属区域
|
|
|
|
|
|
+ Map<String, Object> operateMap = reportSettlementMapper.getProfitReportOperateAndArea(map.get("accountId") + "");
|
|
|
|
+ if (!Check.isNull(operateMap)) {
|
|
|
|
+ voSource.setOperateName(operateMap.getOrDefault("operateName", "") + "");//运营
|
|
|
|
+ voSource.setOperateArea(operateMap.getOrDefault("operateArea", "") + "");//运营所属区域
|
|
}
|
|
}
|
|
//政策所有时间点
|
|
//政策所有时间点
|
|
List<String> policyDaysList = new ArrayList<>();
|
|
List<String> policyDaysList = new ArrayList<>();
|
|
- if (!Check.isNull(map.get("productName"))){
|
|
|
|
|
|
+ if (!Check.isNull(map.get("productName"))) {
|
|
//查询 头条利润表 返点类型和比列
|
|
//查询 头条利润表 返点类型和比列
|
|
- List<Map<String,Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName")+"",map.get("productName")+"",slaeMap.get("saleId")+"","1",paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
|
|
+ List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName") + "", map.get("productName") + "", slaeMap.get("saleId") + "", "1", paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
List listPolicyTIme = new ArrayList();
|
|
List listPolicyTIme = new ArrayList();
|
|
for (Map<String, Object> rate : rateMap) {
|
|
for (Map<String, Object> rate : rateMap) {
|
|
listPolicyTIme.add(rate.get("policyStartDate"));
|
|
listPolicyTIme.add(rate.get("policyStartDate"));
|
|
@@ -594,10 +625,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
|
|
List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
|
|
// 使用政策的时间段 拼接 开始 和 截至 时间
|
|
// 使用政策的时间段 拼接 开始 和 截至 时间
|
|
List<Map<String, String>> arrayList = new ArrayList<>();
|
|
List<Map<String, String>> arrayList = new ArrayList<>();
|
|
- for ( int i = 0; i < times.size(); i++) {
|
|
|
|
|
|
+ for (int i = 0; i < times.size(); i++) {
|
|
HashMap<String, String> mapTime = new HashMap<>();
|
|
HashMap<String, String> mapTime = new HashMap<>();
|
|
mapTime.put("startDate", times.get(i).toString());
|
|
mapTime.put("startDate", times.get(i).toString());
|
|
- mapTime.put("endDate", times.size() < 2 ? times.get(i).toString() : times.get(i + 1).toString());
|
|
|
|
|
|
+ mapTime.put("endDate", times.size() < 2 ? times.get(i).toString() : times.get(i + 1).toString());
|
|
i += 1;
|
|
i += 1;
|
|
arrayList.add(mapTime);
|
|
arrayList.add(mapTime);
|
|
}
|
|
}
|
|
@@ -606,64 +637,64 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
for (Map<String, String> stringMap : arrayList) {
|
|
for (Map<String, String> stringMap : arrayList) {
|
|
ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
|
|
ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
|
|
//使用政策 返点类型和比例
|
|
//使用政策 返点类型和比例
|
|
- Map<String,Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("advertiserName")+"",map.get("productName")+"",slaeMap.get("saleId")+"","1",stringMap.get("startDate"),stringMap.get("endDate"));
|
|
|
|
- if (!Check.isNull(policyRateMap)){
|
|
|
|
- if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 0){
|
|
|
|
|
|
+ Map<String, Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("advertiserName") + "", map.get("productName") + "", slaeMap.get("saleId") + "", "1", stringMap.get("startDate"), stringMap.get("endDate"));
|
|
|
|
+ if (!Check.isNull(policyRateMap)) {
|
|
|
|
+ if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 0) {
|
|
vo.setRebateType("返现");//返点类型
|
|
vo.setRebateType("返现");//返点类型
|
|
- }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 1){
|
|
|
|
|
|
+ } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 1) {
|
|
vo.setRebateType("返货");
|
|
vo.setRebateType("返货");
|
|
- }else if (Integer.valueOf(policyRateMap.get("rebateType").toString())== 2){
|
|
|
|
|
|
+ } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 2) {
|
|
vo.setRebateType("返现+返货");
|
|
vo.setRebateType("返现+返货");
|
|
- }else if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 3){
|
|
|
|
|
|
+ } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 3) {
|
|
vo.setRebateType("服务费");
|
|
vo.setRebateType("服务费");
|
|
}
|
|
}
|
|
- vo.setRebateRate(policyRateMap.getOrDefault("rebateRate","")+"%");//返点比列
|
|
|
|
- }else {
|
|
|
|
|
|
+ vo.setRebateRate(policyRateMap.getOrDefault("rebateRate", "") + "%");//返点比列
|
|
|
|
+ } else {
|
|
vo.setRebateType("");
|
|
vo.setRebateType("");
|
|
}
|
|
}
|
|
// 时间段内 账户流水 信息
|
|
// 时间段内 账户流水 信息
|
|
- List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
|
|
|
|
|
|
+ List<Map<String, Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId") + "", stringMap.get("startDate"), stringMap.get("endDate"));
|
|
listAccount.removeAll(Collections.singleton(null));
|
|
listAccount.removeAll(Collections.singleton(null));
|
|
- vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
|
|
|
|
- vo.setCost(String.format("%.3f",new Double(vo.getCost())));
|
|
|
|
- vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
|
|
|
|
- vo.setCashCost(String.format("%.3f",new Double(vo.getCashCost())));
|
|
|
|
- vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
|
|
|
|
- vo.setRewardCost(String.format("%.3f",new Double(vo.getRewardCost())));
|
|
|
|
- BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
|
|
|
|
- vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
|
|
|
|
|
|
+ vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost", "") + "");//总消耗
|
|
|
|
+ vo.setCost(String.format("%.3f", new Double(vo.getCost())));
|
|
|
|
+ vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost", "") + "");//现金消耗
|
|
|
|
+ vo.setCashCost(String.format("%.3f", new Double(vo.getCashCost())));
|
|
|
|
+ vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost", "") + "");//赠款消耗
|
|
|
|
+ vo.setRewardCost(String.format("%.3f", new Double(vo.getRewardCost())));
|
|
|
|
+ BeanUtils.copyProperties(voSource, vo, SettlementUtil.getNullPropertyNames(voSource));
|
|
|
|
+ vo.setTime(stringMap.get("startDate") + "----" + stringMap.get("endDate"));
|
|
resultList.add(vo);
|
|
resultList.add(vo);
|
|
- policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
|
|
|
|
|
|
+ policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"), stringMap.get("endDate")));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//不使用政策 的时间段
|
|
//不使用政策 的时间段
|
|
// 获取两个日期之间 所有的 时间 年-月-日
|
|
// 获取两个日期之间 所有的 时间 年-月-日
|
|
- List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
|
|
+ List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
// 时间差集(所有时间段 - 使用政策的时间段)
|
|
// 时间差集(所有时间段 - 使用政策的时间段)
|
|
- List<String> reduceList = betweenDaysList.stream().filter(item -> !policyDaysList.contains(item)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> reduceList = betweenDaysList.stream().filter(item -> !policyDaysList.contains(item)).collect(Collectors.toList());
|
|
//差集拼接 开始 和 结束时间
|
|
//差集拼接 开始 和 结束时间
|
|
List<Map<String, String>> stringList = SettlementUtil.getTime(reduceList);
|
|
List<Map<String, String>> stringList = SettlementUtil.getTime(reduceList);
|
|
for (Map<String, String> stringMap : stringList) {
|
|
for (Map<String, String> stringMap : stringList) {
|
|
ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
|
|
ProfitReportBytedanceVo vo = new ProfitReportBytedanceVo();
|
|
// 不使用 政策 则 返点为空
|
|
// 不使用 政策 则 返点为空
|
|
//政策 返点类型和比例
|
|
//政策 返点类型和比例
|
|
- /* Map<String,Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
|
|
|
|
- */
|
|
|
|
|
|
+ /* Map<String,Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("productName")+"",stringMap.get("startDate"),stringMap.get("endDate"));
|
|
|
|
+ */
|
|
vo.setRebateType("");//返点类型
|
|
vo.setRebateType("");//返点类型
|
|
vo.setRebateRate("");//返点比列
|
|
vo.setRebateRate("");//返点比列
|
|
//账户流水 信息
|
|
//账户流水 信息
|
|
- List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
|
|
|
|
|
|
+ List<Map<String, Object>> listAccount = reportSettlementMapper.getProfitBytedanceCost(map.get("accountId") + "", stringMap.get("startDate"), stringMap.get("endDate"));
|
|
listAccount.removeAll(Collections.singleton(null));
|
|
listAccount.removeAll(Collections.singleton(null));
|
|
- vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
|
|
|
|
- vo.setCost(String.format("%.3f",new Double(vo.getCost())));
|
|
|
|
- vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
|
|
|
|
- vo.setCashCost(String.format("%.3f",new Double(vo.getCashCost())));
|
|
|
|
- vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
|
|
|
|
- vo.setRewardCost(String.format("%.3f",new Double(vo.getRewardCost())));
|
|
|
|
- BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
|
|
|
|
- vo.setTime((!Check.isNull(vo.getRebateType()) ? stringMap.get("startDate")+"----"+stringMap.get("endDate") : ""));
|
|
|
|
|
|
+ vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost", "") + "");//总消耗
|
|
|
|
+ vo.setCost(String.format("%.3f", new Double(vo.getCost())));
|
|
|
|
+ vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost", "") + "");//现金消耗
|
|
|
|
+ vo.setCashCost(String.format("%.3f", new Double(vo.getCashCost())));
|
|
|
|
+ vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost", "") + "");//赠款消耗
|
|
|
|
+ vo.setRewardCost(String.format("%.3f", new Double(vo.getRewardCost())));
|
|
|
|
+ BeanUtils.copyProperties(voSource, vo, SettlementUtil.getNullPropertyNames(voSource));
|
|
|
|
+ vo.setTime((!Check.isNull(vo.getRebateType()) ? stringMap.get("startDate") + "----" + stringMap.get("endDate") : ""));
|
|
resultList.add(vo);
|
|
resultList.add(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -685,10 +716,9 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
- * @description: 财务结算 利润表导出 快手
|
|
|
|
* @param paramsVo
|
|
* @param paramsVo
|
|
* @param response
|
|
* @param response
|
|
|
|
+ * @description: 财务结算 利润表导出 快手
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @author: zianY
|
|
* @author: zianY
|
|
*/
|
|
*/
|
|
@@ -697,18 +727,18 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
try {
|
|
try {
|
|
//查询 快手利润表 时间段内的 所有账户
|
|
//查询 快手利润表 时间段内的 所有账户
|
|
- List<Map<String,Object>> list = reportSettlementMapper.getProfitKuaiShouAgentAccount(paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
- if (Check.isNull(list)){
|
|
|
|
|
|
+ List<Map<String, Object>> list = reportSettlementMapper.getProfitKuaiShouAgentAccount(paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
|
|
+ if (Check.isNull(list)) {
|
|
return Result.errorMsg("暂无数据");
|
|
return Result.errorMsg("暂无数据");
|
|
}
|
|
}
|
|
List<ProfitReportKuaiShouVo> resultList = new ArrayList<>(list.size());
|
|
List<ProfitReportKuaiShouVo> resultList = new ArrayList<>(list.size());
|
|
for (Map<String, Object> mapList : list) {
|
|
for (Map<String, Object> mapList : list) {
|
|
|
|
|
|
//查询账户数据信息
|
|
//查询账户数据信息
|
|
- Map<String,Object> map = reportSettlementMapper.getProfitKuaiShouAccountCost(mapList.get("account_id").toString(),paramsVo.getStartTime(),paramsVo.getEndTime());
|
|
|
|
|
|
+ Map<String, Object> map = reportSettlementMapper.getProfitKuaiShouAccountCost(mapList.get("account_id").toString(), paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
ProfitReportKuaiShouVo voSource = new ProfitReportKuaiShouVo();
|
|
ProfitReportKuaiShouVo voSource = new ProfitReportKuaiShouVo();
|
|
voSource.setAccountId(map.getOrDefault("accountId", "") + "");//账户id
|
|
voSource.setAccountId(map.getOrDefault("accountId", "") + "");//账户id
|
|
- voSource.setProductName( !Check.isNull(map.get("productName")) ? map.getOrDefault("productName", "") + "" : "");//产品名称
|
|
|
|
|
|
+ voSource.setProductName(!Check.isNull(map.get("productName")) ? map.getOrDefault("productName", "") + "" : "");//产品名称
|
|
voSource.setKsId(map.getOrDefault("ksId", "") + "");//快手id
|
|
voSource.setKsId(map.getOrDefault("ksId", "") + "");//快手id
|
|
voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName", "") + "" : "");//广告主名称
|
|
voSource.setAdvertiserName(!Check.isNull(map.get("advertiserName")) ? map.getOrDefault("advertiserName", "") + "" : "");//广告主名称
|
|
|
|
|
|
@@ -726,7 +756,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
List<String> policyDaysList = new ArrayList<>();
|
|
List<String> policyDaysList = new ArrayList<>();
|
|
if (!Check.isNull(map.get("productName"))) {
|
|
if (!Check.isNull(map.get("productName"))) {
|
|
//查询 快手利润表 返点类型和比列
|
|
//查询 快手利润表 返点类型和比列
|
|
- List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName")+"",map.get("productName") + "", slaeMap.get("saleId")+"","2", paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
|
|
|
|
+ List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName") + "", map.get("productName") + "", slaeMap.get("saleId") + "", "2", paramsVo.getStartTime(), paramsVo.getEndTime());
|
|
List listPolicyTIme = new ArrayList();
|
|
List listPolicyTIme = new ArrayList();
|
|
for (Map<String, Object> rate : rateMap) {
|
|
for (Map<String, Object> rate : rateMap) {
|
|
listPolicyTIme.add(rate.get("policyStartDate"));
|
|
listPolicyTIme.add(rate.get("policyStartDate"));
|
|
@@ -736,8 +766,8 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
//政策时间 去重 排序
|
|
//政策时间 去重 排序
|
|
List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
|
|
List<Object> times = SettlementUtil.sortlistTest(listPolicyTIme);
|
|
// 使用政策的时间段 拼接 开始 和 截至 时间
|
|
// 使用政策的时间段 拼接 开始 和 截至 时间
|
|
- List<Map<String, String>> arrayList = new ArrayList<>();
|
|
|
|
- if (!Check.isNull(times)){
|
|
|
|
|
|
+ List<Map<String, String>> arrayList = new ArrayList<>();
|
|
|
|
+ if (!Check.isNull(times)) {
|
|
for (int i = 0; i < times.size(); i++) {
|
|
for (int i = 0; i < times.size(); i++) {
|
|
HashMap<String, String> mapTime = new HashMap<>();
|
|
HashMap<String, String> mapTime = new HashMap<>();
|
|
mapTime.put("startDate", times.get(i).toString());
|
|
mapTime.put("startDate", times.get(i).toString());
|
|
@@ -750,7 +780,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
for (Map<String, String> stringMap : arrayList) {
|
|
for (Map<String, String> stringMap : arrayList) {
|
|
ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
|
|
ProfitReportKuaiShouVo vo = new ProfitReportKuaiShouVo();
|
|
//使用政策 返点类型和比例
|
|
//使用政策 返点类型和比例
|
|
- Map<String, Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("advertiserName")+"",map.get("productName") + "", slaeMap.get("saleId")+"","2",stringMap.get("startDate"), stringMap.get("endDate"));
|
|
|
|
|
|
+ Map<String, Object> policyRateMap = reportSettlementMapper.getProfitRebate(map.get("advertiserName") + "", map.get("productName") + "", slaeMap.get("saleId") + "", "2", stringMap.get("startDate"), stringMap.get("endDate"));
|
|
if (!Check.isNull(policyRateMap)) {
|
|
if (!Check.isNull(policyRateMap)) {
|
|
if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 0) {
|
|
if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 0) {
|
|
vo.setRebateType("返现");//返点类型
|
|
vo.setRebateType("返现");//返点类型
|
|
@@ -758,7 +788,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
vo.setRebateType("返货");
|
|
vo.setRebateType("返货");
|
|
} else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 2) {
|
|
} else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 2) {
|
|
vo.setRebateType("返现+返货");
|
|
vo.setRebateType("返现+返货");
|
|
- }else if(Integer.valueOf(policyRateMap.get("rebateType").toString())== 3){
|
|
|
|
|
|
+ } else if (Integer.valueOf(policyRateMap.get("rebateType").toString()) == 3) {
|
|
vo.setRebateType("服务费");
|
|
vo.setRebateType("服务费");
|
|
}
|
|
}
|
|
vo.setRebateRate(policyRateMap.getOrDefault("rebateRate", "") + "%");//返点比列
|
|
vo.setRebateRate(policyRateMap.getOrDefault("rebateRate", "") + "%");//返点比列
|
|
@@ -823,10 +853,8 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
- * @description: 给运营发送消息
|
|
|
|
- *
|
|
|
|
* @param
|
|
* @param
|
|
|
|
+ * @description: 给运营发送消息
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
* @author: zianY
|
|
* @author: zianY
|
|
*/
|
|
*/
|
|
@@ -837,27 +865,27 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
int productNum = 0;
|
|
int productNum = 0;
|
|
int accountNum = 0;
|
|
int accountNum = 0;
|
|
String productInfo = null;
|
|
String productInfo = null;
|
|
- String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
|
|
|
+ String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
//查询所有 运营绑定的账户
|
|
//查询所有 运营绑定的账户
|
|
- List<Map<String,Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
|
|
|
|
+ List<Map<String, Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
for (Map<String, Object> userMap : userList) {
|
|
for (Map<String, Object> userMap : userList) {
|
|
- String userId = userMap.get("userId").toString();
|
|
|
|
|
|
+ String userId = userMap.get("userId").toString();
|
|
//查询运营下的 账户 和 产品信息
|
|
//查询运营下的 账户 和 产品信息
|
|
- List<Map<String,Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(userId);
|
|
|
|
- if (Check.isNull(productList)){
|
|
|
|
|
|
+ List<Map<String, Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(userId);
|
|
|
|
+ if (Check.isNull(productList)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
//产品名称
|
|
//产品名称
|
|
List product = productList.stream().map(map -> map.get("productName")).distinct().collect(Collectors.toList());
|
|
List product = productList.stream().map(map -> map.get("productName")).distinct().collect(Collectors.toList());
|
|
productNum = product.size();
|
|
productNum = product.size();
|
|
accountNum = productList.size();
|
|
accountNum = productList.size();
|
|
- productInfo = StringUtils.join(product.toArray(),"、");
|
|
|
|
|
|
+ productInfo = StringUtils.join(product.toArray(), "、");
|
|
//发送微信通知
|
|
//发送微信通知
|
|
- JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(userId);
|
|
|
|
- String msg = MessageFormat.format(message,userMap.get("userName").toString(),month,productNum,accountNum,productInfo);
|
|
|
|
- corpWexinUtils.sendMessageByWeChatId(jsonObject,msg);
|
|
|
|
|
|
+ JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(userId);
|
|
|
|
+ String msg = MessageFormat.format(message, userMap.get("userName").toString(), month, productNum, accountNum, productInfo);
|
|
|
|
+ corpWexinUtils.sendMessageByWeChatId(jsonObject, msg);
|
|
}
|
|
}
|
|
- return Result.successMsg("成功",null);
|
|
|
|
|
|
+ return Result.successMsg("成功", null);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -867,28 +895,28 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
int productNum = 0;
|
|
int productNum = 0;
|
|
int accountNum = 0;
|
|
int accountNum = 0;
|
|
String productInfo = null;
|
|
String productInfo = null;
|
|
- String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
|
|
|
+ String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
|
|
|
//查询所有 运营绑定的账户
|
|
//查询所有 运营绑定的账户
|
|
- List<Map<String,Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
|
|
|
|
+ List<Map<String, Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
for (Map<String, Object> userMap : userList) {
|
|
for (Map<String, Object> userMap : userList) {
|
|
- String realUserId = userMap.get("userId").toString();
|
|
|
|
|
|
+ String realUserId = userMap.get("userId").toString();
|
|
//查询运营下的 账户 和 产品信息
|
|
//查询运营下的 账户 和 产品信息
|
|
- List<Map<String,Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(realUserId);
|
|
|
|
- if (Check.isNull(productList)){
|
|
|
|
|
|
+ List<Map<String, Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(realUserId);
|
|
|
|
+ if (Check.isNull(productList)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
//产品名称
|
|
//产品名称
|
|
List product = productList.stream().map(map -> map.get("productName")).distinct().collect(Collectors.toList());
|
|
List product = productList.stream().map(map -> map.get("productName")).distinct().collect(Collectors.toList());
|
|
productNum = product.size();
|
|
productNum = product.size();
|
|
accountNum = productList.size();
|
|
accountNum = productList.size();
|
|
- productInfo = StringUtils.join(product.toArray(),"、");
|
|
|
|
|
|
+ productInfo = StringUtils.join(product.toArray(), "、");
|
|
//发送微信通知
|
|
//发送微信通知
|
|
- JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(Check.isNull(userId) ? "f990f815ecef43fab9cbe1bb22bb6d63" : userId);
|
|
|
|
- String msg = MessageFormat.format(message,userMap.get("userName").toString(),month,productNum,accountNum,productInfo);
|
|
|
|
- corpWexinUtils.sendMessageByWeChatId(jsonObject,msg);
|
|
|
|
|
|
+ JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(Check.isNull(userId) ? "f990f815ecef43fab9cbe1bb22bb6d63" : userId);
|
|
|
|
+ String msg = MessageFormat.format(message, userMap.get("userName").toString(), month, productNum, accountNum, productInfo);
|
|
|
|
+ corpWexinUtils.sendMessageByWeChatId(jsonObject, msg);
|
|
}
|
|
}
|
|
- return Result.successMsg("发送微信通知成功-test",null);
|
|
|
|
|
|
+ return Result.successMsg("发送微信通知成功-test", null);
|
|
}
|
|
}
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -900,11 +928,11 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
@Override
|
|
@Override
|
|
public void cwjsPRofit(CwjsPolicyInfo cwjsPolicyInfo) {
|
|
public void cwjsPRofit(CwjsPolicyInfo cwjsPolicyInfo) {
|
|
// 获取两个日期之间 所有的 时间 年-月-日
|
|
// 获取两个日期之间 所有的 时间 年-月-日
|
|
- List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(cwjsPolicyInfo.getPolicyStartDate(),cwjsPolicyInfo.getPolicyEndDate());
|
|
|
|
|
|
+ List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(cwjsPolicyInfo.getPolicyStartDate(), cwjsPolicyInfo.getPolicyEndDate());
|
|
//查看 政策下的产品
|
|
//查看 政策下的产品
|
|
List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(cwjsPolicyInfo.getId());
|
|
List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(cwjsPolicyInfo.getId());
|
|
- if (!Check.isNull(productList)){
|
|
|
|
- if (!Check.isNull(betweenDaysList)){
|
|
|
|
|
|
+ if (!Check.isNull(productList)) {
|
|
|
|
+ if (!Check.isNull(betweenDaysList)) {
|
|
List<CtopCwjsSlettementReport> reportList = new ArrayList<>();
|
|
List<CtopCwjsSlettementReport> reportList = new ArrayList<>();
|
|
for (CwjsPolicyProduct product : productList) {
|
|
for (CwjsPolicyProduct product : productList) {
|
|
for (String day : betweenDaysList) {
|
|
for (String day : betweenDaysList) {
|
|
@@ -933,7 +961,6 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
policyApprovalLogMapper.insert(policyApprovalLog);
|
|
policyApprovalLogMapper.insert(policyApprovalLog);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -959,10 +986,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
for (PolicyImportVo importVo : importResult.getList()) {
|
|
for (PolicyImportVo importVo : importResult.getList()) {
|
|
- if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getCompanyName())){
|
|
|
|
|
|
+ if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getCompanyName())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getPolicyProductName())){
|
|
|
|
|
|
+ if (cn.com.ctop.common.module.utils.Check.isNull(importVo.getPolicyProductName())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
List<String> productNameList = Arrays.asList(importVo.getPolicyProductName().split("-"));
|
|
List<String> productNameList = Arrays.asList(importVo.getPolicyProductName().split("-"));
|
|
@@ -989,16 +1016,16 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
|
|
|
CwjsPolicyInfo policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
|
|
CwjsPolicyInfo policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
|
|
|
|
|
|
- if (cn.com.ctop.common.module.utils.Check.isNull(policy)){
|
|
|
|
|
|
+ if (cn.com.ctop.common.module.utils.Check.isNull(policy)) {
|
|
cwjsPolicyInfoMapper.insert(cwjsPolicyInfo);
|
|
cwjsPolicyInfoMapper.insert(cwjsPolicyInfo);
|
|
policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
|
|
policy = cwjsPolicyInfoMapper.getPolicyInfo(cwjsPolicyInfo);
|
|
}
|
|
}
|
|
|
|
|
|
//查看 政策下的产品
|
|
//查看 政策下的产品
|
|
List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(policy.getId());
|
|
List<CwjsPolicyProduct> productList = cwjsPolicyProductMapper.queryProductsByPolicyId(policy.getId());
|
|
- List proList = productList.stream().map(CwjsPolicyProduct:: getPolicyProductName).collect(Collectors.toList());
|
|
|
|
|
|
+ List proList = productList.stream().map(CwjsPolicyProduct::getPolicyProductName).collect(Collectors.toList());
|
|
for (String str : productNameList) {
|
|
for (String str : productNameList) {
|
|
- if (!proList.contains(str)){
|
|
|
|
|
|
+ if (!proList.contains(str)) {
|
|
//新增产品
|
|
//新增产品
|
|
CwjsPolicyProduct policyProduct = new CwjsPolicyProduct();
|
|
CwjsPolicyProduct policyProduct = new CwjsPolicyProduct();
|
|
policyProduct.setPolicyId(policy.getId());
|
|
policyProduct.setPolicyId(policy.getId());
|
|
@@ -1018,7 +1045,4 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|