Commit d26591aa authored by zuoyh's avatar zuoyh

Merge remote-tracking branch 'origin/dev' into dev

parents ffdeef22 a74c2c5f
...@@ -134,17 +134,12 @@ public class MsgBiz { ...@@ -134,17 +134,12 @@ public class MsgBiz {
} }
number = number == null ? 10 : number; number = number == null ? 10 : number;
Query query = new Query(Criteria.where("body.type").is(4).and("count.praise").gt(getNumber()).and("visible").is(1)); Query query = new Query(Criteria.where("body.type").is(4).and("count.praise").gt(getNumber()).and("visible").is(1));
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
if (StringUtils.isNotBlank(messageId)) { if (StringUtils.isNotBlank(messageId)) {
query = new Query(Criteria.where("_id").is(new ObjectId(messageId))); query.addCriteria(Criteria.where("_id").ne(new ObjectId(messageId)));
Msg msg = mongoTemplate.findOne(query, Msg.class, "s_msg");
if (msg != null) {
List<Msg> removeOne = new ArrayList<>();
removeOne.add(msg);
msgList.removeAll(removeOne);
}
} }
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
Set<Msg> resultList = new HashSet<>(); Set<Msg> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(msgList)) { if(CollectionUtils.isNotEmpty(msgList)) {
if(number >= msgList.size()) { if(number >= msgList.size()) {
......
...@@ -5,8 +5,8 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -5,8 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.google.common.collect.Lists; 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.contant.enumerate.AccountTypeEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.pojo.Achievement; import com.xxfc.platform.order.pojo.Achievement;
import com.xxfc.platform.order.pojo.QueryCriteria; import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.pojo.ReturnOrderAmount; import com.xxfc.platform.order.pojo.ReturnOrderAmount;
...@@ -15,9 +15,6 @@ import com.xxfc.platform.order.pojo.account.OrderAccountDetail; ...@@ -15,9 +15,6 @@ import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat; 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.hssf.util.CellReference;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
...@@ -131,7 +128,9 @@ public class TotalPerformanceBiz { ...@@ -131,7 +128,9 @@ public class TotalPerformanceBiz {
//判断押金退还是否大于0 //判断押金退还是否大于0
if ( depositAmount.compareTo(BigDecimal.ZERO)>0) { if ( depositAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount); ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
//判断是违章还是租车 //判断是违章还是租车
if (OrderTypeEnum.RENT_VEHICLE.equals(returnOrderAmount.getType())) {
if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) { if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) {
returnOrderAmountClone.setRefundInstruction("违章押金"); returnOrderAmountClone.setRefundInstruction("违章押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount()); returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
...@@ -139,13 +138,17 @@ public class TotalPerformanceBiz { ...@@ -139,13 +138,17 @@ public class TotalPerformanceBiz {
returnOrderAmountClone.setRefundInstruction("租车押金"); returnOrderAmountClone.setRefundInstruction("租车押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount()); returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
} }
}
arrayList.add(returnOrderAmountClone); arrayList.add(returnOrderAmountClone);
} }
//判断订单退款是否大于0 //判断订单退款是否大于0
if (orderAmount.compareTo(BigDecimal.ZERO)>0) { if (orderAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount); ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
returnOrderAmountClone.setRefundInstruction("订单退款"); returnOrderAmountClone.setRefundInstruction("订单退款");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getOrderAmount()); returnOrderAmountClone.setRefundAmount(accountDetailStr.getOrderAmount());
arrayList.add(returnOrderAmountClone);
} }
} }
...@@ -173,6 +176,8 @@ public class TotalPerformanceBiz { ...@@ -173,6 +176,8 @@ public class TotalPerformanceBiz {
} }
List<String[]> achievementArray =getAchievementArrays(achievements,12); List<String[]> achievementArray =getAchievementArrays(achievements,12);
createCellData(sheet,1,generalCellStyle,achievementArray); createCellData(sheet,1,generalCellStyle,achievementArray);
//设置最后一行 //设置最后一行
int lastRowNum = sheet.getLastRowNum(); int lastRowNum = sheet.getLastRowNum();
XSSFRow rown = sheet.createRow(lastRowNum); XSSFRow rown = sheet.createRow(lastRowNum);
...@@ -308,13 +313,6 @@ public class TotalPerformanceBiz { ...@@ -308,13 +313,6 @@ public class TotalPerformanceBiz {
private void createHeader(Row row, int cellStartIndex, String[] header, CellStyle cellStyle){ private void createHeader(Row row, int cellStartIndex, String[] header, CellStyle cellStyle){
for (int i =0 ;i<header.length;i++){ for (int i =0 ;i<header.length;i++){
Cell cell = row.createCell(cellStartIndex); 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.setCellValue(header[i]);
cell.setCellStyle(cellStyle); cell.setCellStyle(cellStyle);
cellStartIndex+=1; cellStartIndex+=1;
......
...@@ -86,15 +86,13 @@ public class TotalPerformanceStatementController extends CommonBaseController { ...@@ -86,15 +86,13 @@ public class TotalPerformanceStatementController extends CommonBaseController {
String name = DateTimeFormatter.ofPattern("YYYYMMddHHmmss").format(LocalDateTime.now()); String name = DateTimeFormatter.ofPattern("YYYYMMddHHmmss").format(LocalDateTime.now());
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) { String filename = String.format("%s.xlsx",name);
String filename = String.format("%s-总业绩-入账表.xlsx",name); response.setHeader("Content-Disposition","attachment;filename="+filename);
response.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes(), "iso8859-1"));
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) {
totalPerformanceBiz.exportEntry(queryCriteria, name, outputStream); totalPerformanceBiz.exportEntry(queryCriteria, name, outputStream);
}else if (BookkeepingTypeEnum.OUT.getCode().equals(queryCriteria.getType())){ }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); totalPerformanceBiz.exportAccount(queryCriteria, name, outputStream);
}else { }else {
throw new BaseException("无相关数据"); throw new BaseException("无相关数据");
......
...@@ -444,7 +444,7 @@ ...@@ -444,7 +444,7 @@
<select id="selectTotalStatistical" parameterType="com.xxfc.platform.order.pojo.QueryCriteria" <select id="selectTotalStatistical" parameterType="com.xxfc.platform.order.pojo.QueryCriteria"
resultType="com.xxfc.platform.order.pojo.Achievement"> resultType="com.xxfc.platform.order.pojo.Achievement">
select 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 from order_user_position_company
<where> <where>
<if test="startDate != null"> <if test="startDate != null">
......
...@@ -64,12 +64,12 @@ ...@@ -64,12 +64,12 @@
</if> </if>
<if test="queryCriteria.jurisdiction != null and queryCriteria.jurisdiction.size() !=0 "> <if test="queryCriteria.jurisdiction != null and queryCriteria.jurisdiction.size() !=0 ">
and oupc.company_id in 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} #{companyId}
</foreach> </foreach>
</if> </if>
<if test="queryCriteria.orderType != null"> <if test="queryCriteria.orderType != null">
and oupc.type = #{orderType} and oupc.type = #{queryCriteria.orderType}
</if> </if>
order by oa.crt_time DESC order by oa.crt_time DESC
</select> </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