Commit 459cc8ee authored by hanfeng's avatar hanfeng

Merge branch 'master-report-form' into dev

parents dabc742e 4c2aea9f
......@@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.google.common.collect.Lists;
import com.jayway.jsonpath.internal.function.numeric.Sum;
import com.xxfc.platform.order.contant.enumerate.AccountTypeEnum;
import com.xxfc.platform.order.pojo.Achievement;
import com.xxfc.platform.order.pojo.QueryCriteria;
......@@ -15,9 +14,6 @@ import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
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.hssf.util.CellReference;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;
......@@ -173,6 +169,8 @@ public class TotalPerformanceBiz {
}
List<String[]> achievementArray =getAchievementArrays(achievements,12);
createCellData(sheet,1,generalCellStyle,achievementArray);
//设置最后一行
int lastRowNum = sheet.getLastRowNum();
XSSFRow rown = sheet.createRow(lastRowNum);
......@@ -308,13 +306,6 @@ public class TotalPerformanceBiz {
private void createHeader(Row row, int cellStartIndex, String[] header, CellStyle cellStyle){
for (int i =0 ;i<header.length;i++){
Cell cell = row.createCell(cellStartIndex);
//设置head填充色
CellStyle cellStyle1 = cell.getCellStyle();
cellStyle1.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex());
cellStyle1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell.setCellStyle(cellStyle1);
cell.setCellValue(header[i]);
cell.setCellStyle(cellStyle);
cellStartIndex+=1;
......
......@@ -86,15 +86,13 @@ public class TotalPerformanceStatementController extends CommonBaseController {
String name = DateTimeFormatter.ofPattern("YYYYMMddHHmmss").format(LocalDateTime.now());
response.setContentType("application/vnd.ms-excel;charset=utf-8");
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) {
String filename = String.format("%s-总业绩-入账表.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes(), "iso8859-1"));
String filename = String.format("%s.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+filename);
ServletOutputStream outputStream = response.getOutputStream();
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) {
totalPerformanceBiz.exportEntry(queryCriteria, name, outputStream);
}else if (BookkeepingTypeEnum.OUT.getCode().equals(queryCriteria.getType())){
String filename = String.format("%s-总业绩-出账表.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes(), "iso8859-1"));
ServletOutputStream outputStream = response.getOutputStream();
totalPerformanceBiz.exportAccount(queryCriteria, name, outputStream);
}else {
throw new BaseException("无相关数据");
......
......@@ -444,7 +444,7 @@
<select id="selectTotalStatistical" parameterType="com.xxfc.platform.order.pojo.QueryCriteria"
resultType="com.xxfc.platform.order.pojo.Achievement">
select
crt_time,no,type,order_amount,real_amount,realname,username,parentRealname,positionName,parentUsername,companyName,pay_way,company_id
crt_time,no,type,order_amount,real_amount,realname,username,parentRealname,positionName,parentUsername,companyName,pay_way,company_id,(order_amount-real_amount) as favorablePrice
from order_user_position_company
<where>
<if test="startDate != null">
......
......@@ -64,12 +64,12 @@
</if>
<if test="queryCriteria.jurisdiction != null and queryCriteria.jurisdiction.size() !=0 ">
and oupc.company_id in
<foreach collection="jurisdiction" index="index" item="companyId" open="(" separator="," close=")">
<foreach collection="queryCriteria.jurisdiction" index="index" item="companyId" open="(" separator="," close=")">
#{companyId}
</foreach>
</if>
<if test="queryCriteria.orderType != null">
and oupc.type = #{orderType}
and oupc.type = #{queryCriteria.orderType}
</if>
order by oa.crt_time DESC
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment