Commit 5c6c7ab5 authored by jiaorz's avatar jiaorz

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

# Conflicts:
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
parents db5593d3 bf5dcdd5
......@@ -5,6 +5,10 @@ import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 手动给集合分页
* @author Administrator
*/
@Data
public class PageResult<M> {
/** 页码 */
......
......@@ -168,6 +168,16 @@ public interface UserFeign {
boolean isCollectionByTypeAndTypeId(@RequestParam("userId") Integer userId,
@RequestParam(value = "type") int type,
@RequestParam("id") Integer typId);
/**
* 通过公司id,获取员工的下级用户id
* @param parentCompanyId
* @return
*/
@GetMapping("/postion/admin/userid")
List<Integer> getUserIdByParentCompany(@RequestParam("parentCompanyId") List<Integer> parentCompanyId);
@GetMapping("/app/user/list_staff")
List<UserStaffBo> findAllStaffs();
......
......@@ -345,4 +345,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
}
public List<Integer> getUserIdByParentCompany(List<Integer> parentCompanyId) {
return mapper.getUserIdByParentCompany(parentCompanyId);
}
}
......@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.admin.dto.StaffStatisticsFindDTO;
import com.github.wxiaoqi.security.admin.vo.WalletPostionVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists;
import com.xxfc.platform.order.contant.enumerate.StatisticsStatusEnum;
import com.xxfc.platform.order.feign.OrderFeign;
import com.xxfc.platform.order.pojo.dto.OrderDTO;
......@@ -86,7 +87,7 @@ public class StaffStatisticsBiz {
Row ctpRow = sheet.createRow(1);
Cell ctpCell = ctpRow.createCell(0);
//缺少判断 公司 身份 时间
//
String companyName = StringUtils.hasText(staffStatisticsFindDTO.getCompanyName()) ? staffStatisticsFindDTO.getCompanyName() : "全集团";
String postionName = StringUtils.hasText(staffStatisticsFindDTO.getPostionName()) ? staffStatisticsFindDTO.getPostionName() : "全部员工";
String startTimeStr = staffStatisticsFindDTO.getStartDate()==null?"":DateUtil.format(staffStatisticsFindDTO.getStartDate(), "yyyy-MM-dd HH:mm:ss");
......@@ -250,7 +251,7 @@ public class StaffStatisticsBiz {
//2.根据员工id范围和其他条件分页查询
List<Integer> userIds = allStaffs.stream().map(UserStaffBo::getUserId).collect(Collectors.toList());
List<AppUserSellingWaterDTO> appUserSellingWaterDTOS = appUserSellingWaterBiz.findStatffSellerWaterByUserIdsAndTime(userIds, staffStatisticsFindDTO.getStartDate(), staffStatisticsFindDTO.getEndDate());
Map<Integer, Map<String, Map<Integer, Map<Integer, List<AppUserSellingWaterDTO>>>>> sellingWaterMap = new HashMap<>();
Map<Integer, Map<String, Map<Integer, List<AppUserSellingWaterDTO>>>> sellingWaterMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(appUserSellingWaterDTOS)) {
//3.根据订单id查询订单相关信息
......@@ -265,7 +266,7 @@ public class StaffStatisticsBiz {
sellingWaterMap = appUserSellingWaterDTOS.stream().collect(Collectors.groupingBy(AppUserSellingWaterDTO::getUserId,
Collectors.groupingBy(AppUserSellingWaterDTO::getStateGroup, Collectors.groupingBy(AppUserSellingWaterDTO::getOrderType, Collectors.groupingBy(AppUserSellingWaterDTO::getStatus, Collectors.toList())))));
Collectors.groupingBy(AppUserSellingWaterDTO::getStateGroup, Collectors.groupingBy(AppUserSellingWaterDTO::getOrderType,Collectors.toList()))));
}
Map<Integer, String> companyMap = vehicleFeign.findCompanyMap();
......@@ -275,13 +276,13 @@ public class StaffStatisticsBiz {
String stateGroup = String.format("%d-%d-%d", userStaffBo.getUserId(), userStaffBo.getPostionId(), userStaffBo.getCompanyId() == null ? NO_COMPANY_STATE : userStaffBo.getCompanyId());
StaffStatisticsBo staffStatisticsBo = creatDefaultStaffStatistics(userStaffBo);
if (!sellingWaterMap.isEmpty()) {
Map<String, Map<Integer, Map<Integer, List<AppUserSellingWaterDTO>>>> userSellingWaterMap = sellingWaterMap.get(userStaffBo.getUserId());
Map<String, Map<Integer, List<AppUserSellingWaterDTO>>> userSellingWaterMap = sellingWaterMap.get(userStaffBo.getUserId());
if (userSellingWaterMap != null && !userSellingWaterMap.isEmpty()) {
AtomicReference<BigDecimal> royaltyAmountAtomicReference = new AtomicReference<>(BigDecimal.ZERO);
List<String> postionNames = new ArrayList<>(staffStatisticsBo.getPostionNames());
List<Integer> postionIds = new ArrayList<>(staffStatisticsBo.getPostionIds());
List<String> companyNames = new ArrayList<>(staffStatisticsBo.getCompanyNames());
List<Integer> compnayIds = new ArrayList<>(staffStatisticsBo.getCompnayIds());
List<String> postionNames = Lists.newArrayList(staffStatisticsBo.getPostionNames());
List<Integer> postionIds = Lists.newArrayList(staffStatisticsBo.getPostionIds());
List<String> companyNames = Lists.newArrayList(staffStatisticsBo.getCompanyNames());
List<Integer> compnayIds = Lists.newArrayList(staffStatisticsBo.getCompnayIds());
userSellingWaterMap.forEach((K, V) -> {
if (!K.equals(stateGroup)) {
String[] sates = K.split("-");
......@@ -319,7 +320,7 @@ public class StaffStatisticsBiz {
return staffStatisticsBos;
}
private StaffStatisticsBo wrapStaffStatistics(Map<Integer, Map<Integer, List<AppUserSellingWaterDTO>>> waterDTOSMap, AtomicReference<BigDecimal> royaltyAmountAtomicReference, StaffStatisticsBo staffStatisticsBo) {
private StaffStatisticsBo wrapStaffStatistics(Map<Integer, List<AppUserSellingWaterDTO>> waterDTOSMap, AtomicReference<BigDecimal> royaltyAmountAtomicReference, StaffStatisticsBo staffStatisticsBo) {
waterDTOSMap.forEach((K, V) -> {
Map<String, Object> orderRentResultMap = wrapStaffStatisticsMap(V);
BigDecimal royaltyAmount = royaltyAmountAtomicReference.get();
......@@ -345,34 +346,45 @@ public class StaffStatisticsBiz {
return staffStatisticsBo;
}
private Map<String, Object> wrapStaffStatisticsMap(Map<Integer, List<AppUserSellingWaterDTO>> sellingWaters) {
private Map<String, Object> wrapStaffStatisticsMap(List<AppUserSellingWaterDTO> sellingWaters) {
Map<String, Object> staffStatisticsResultMap = new HashMap<>(2);
AtomicInteger orderCounter = new AtomicInteger(0);
if (sellingWaters == null || sellingWaters.isEmpty()) {
if (CollectionUtils.isEmpty(sellingWaters)) {
staffStatisticsResultMap.put(TOTAL_AMOUNT_VAL, BigDecimal.ZERO);
staffStatisticsResultMap.put(TOTAL_NUM_VAL, orderCounter.get());
}
BigDecimal totalAmount = BigDecimal.ZERO;
BigDecimal royaltyAmount = BigDecimal.ZERO;
Set<Map.Entry<Integer, List<AppUserSellingWaterDTO>>> sellingWaterSet = sellingWaters.entrySet();
for (Map.Entry<Integer, List<AppUserSellingWaterDTO>> sellingWaterEntry : sellingWaterSet) {
List<AppUserSellingWaterDTO> waterDTOS = sellingWaterEntry.getValue();
for (AppUserSellingWaterDTO waterDTO : waterDTOS) {
if (sellingWaterEntry.getKey() == 0) {
royaltyAmount = royaltyAmount.add(waterDTO.getCommission());
totalAmount = totalAmount.add(waterDTO.getPrice());
orderCounter.incrementAndGet();
Map<Integer, List<AppUserSellingWaterDTO>> orderSellingMap = sellingWaters.stream().collect(Collectors.groupingBy(AppUserSellingWaterDTO::getOrderId, Collectors.toList()));
Set<Map.Entry<Integer, List<AppUserSellingWaterDTO>>> orderSellingSet = orderSellingMap.entrySet();
for (Map.Entry<Integer, List<AppUserSellingWaterDTO>> orderSellingEntry : orderSellingSet) {
BigDecimal inAmount = BigDecimal.ZERO;
BigDecimal outAmount = BigDecimal.ZERO;
boolean isCommissionZero=false;
List<AppUserSellingWaterDTO> appUserSellingWaterDTOS = orderSellingEntry.getValue();
for (AppUserSellingWaterDTO waterDTO : appUserSellingWaterDTOS) {
if (waterDTO.getStatus() == 0) {
royaltyAmount = royaltyAmount.add(waterDTO.getCommission());
totalAmount = totalAmount.add(waterDTO.getCommission().divide(new BigDecimal(String.valueOf(waterDTO.getExtract()/100.00)),2,BigDecimal.ROUND_HALF_UP));
inAmount = inAmount.add(waterDTO.getCommission());
isCommissionZero = waterDTO.getCommission().intValue()==0;
}
if (waterDTO.getStatus() == 1) {
royaltyAmount = royaltyAmount.subtract(waterDTO.getCommission());
totalAmount = totalAmount.subtract(waterDTO.getCommission().divide(new BigDecimal(String.valueOf(waterDTO.getExtract()/100.00)),2,BigDecimal.ROUND_HALF_UP));
outAmount = outAmount.add(waterDTO.getCommission());
isCommissionZero=!isCommissionZero;
}
}
if (sellingWaterEntry.getKey() == 1) {
royaltyAmount = royaltyAmount.subtract(waterDTO.getCommission());
totalAmount = totalAmount.subtract(waterDTO.getPrice());
if(appUserSellingWaterDTOS.size()==1 || inAmount.subtract(outAmount).doubleValue()>0 || isCommissionZero){
orderCounter.incrementAndGet();
}
}
staffStatisticsResultMap.put(TOTAL_AMOUNT_VAL, totalAmount);
staffStatisticsResultMap.put(TOTAL_NUM_VAL, orderCounter.get());
staffStatisticsResultMap.put(TOTAL_COMMISSION_VAL, royaltyAmount);
}
return staffStatisticsResultMap;
}
......
......@@ -3,8 +3,12 @@ package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 用户身份职位表
*
......@@ -17,4 +21,6 @@ public interface AppUserPositionTempMapper extends Mapper<AppUserPositionTemp> {
@Insert("INSERT IGNORE INTO `app_user_position_temp`(`user_id`,`phone`,`name`,`position_id`,`crt_time`)VALUES(#{userId},#{phone},#{name},#{positionId},#{crtTime})")
void insertWithIgnoreRepeat(AppUserPositionTemp appUserPositionTemp);
List<Integer> getUserIdByParentCompany(@Param("parentCompanyId") List<Integer> parentCompanyId);
}
......@@ -107,4 +107,10 @@ public class AppUserPositionController {
return ObjectRestResponse.succ(dataVO);
}
@GetMapping("/userid")
public List<Integer> getUserIdByParentCompany(@RequestParam("parentCompanyId") List<Integer> parentCompanyId){
return appUserPositionTempBiz.getUserIdByParentCompany(parentCompanyId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppUserPositionTempMapper">
<select id="getUserIdByParentCompany" resultType="Integer">
SELECT
r.uid
FROM
app_user_position_temp pt
LEFT JOIN app_user_detail d ON pt.user_id = d.userid
LEFT JOIN (
SELECT
parent_id AS pid,
user_id AS uid
FROM
app_user_relation
WHERE
is_del = 0
) r ON d.userid = r.pid
WHERE
pt.is_del = 0
<if test="parentCompanyId != null and parentCompanyId.size() !=0">
AND pt.company_id IN
<foreach collection="parentCompanyId" index="index" item="pid" open="(" separator="," close=")">
#{pid}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
package com.xxfc.platform.order.contant.enumerate;
/**
* 账目类型
* @author Administrator
*/
public enum BookkeepingTypeEnum {
ENTER(0,"入账"),OUT(1,"出账");
private Integer code;
private String msg;
BookkeepingTypeEnum(int code, String msg) {
this.code=code;
this.msg=msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
package com.xxfc.platform.order.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Data
@ApiModel("订单业绩明细表")
public class Achievement implements Serializable {
private static final Map<Integer, String> orderTypeMap = new HashMap<>();
private static final Map<Integer, String> payWayMap = new HashMap<>();
static {
orderTypeMap.put(1, "租车");
orderTypeMap.put(2, "旅游");
orderTypeMap.put(3, "会员");
payWayMap.put(null, "微信");
payWayMap.put(1, "微信支付");
payWayMap.put(2, "支付宝支付");
payWayMap.put(3, "银联支付");
}
@ApiModelProperty(value = "下单用户真实姓名")
private String realname;
@ApiModelProperty(value = "用户手机号")
private String username;
@ApiModelProperty(value = "上级姓名")
private String parentRealname;
@ApiModelProperty(value = "上级职位")
private String positionName;
@ApiModelProperty(value = "上级手机号")
private String parentUsername;
@ApiModelProperty(value = "订单所属公司id")
private Integer companyId;
@ApiModelProperty(value = "订单所属公司名")
private String companyName;
@ApiModelProperty(value = "优惠价格")
private BigDecimal favorablePrice = BigDecimal.ZERO;
@ApiModelProperty(value = "创建时间", hidden = true)
@Column(name = "crt_time")
private String crtTime;
@ApiModelProperty(value = "订单号")
private String no;
@ApiModelProperty(value = "订单类型")
private Integer type;
@Column(name = "order_amount")
@ApiModelProperty("订单总额")
private BigDecimal orderAmount = BigDecimal.ZERO;
@ApiModelProperty(value = "实际订单额")
@Column(name = "real_amount")
private BigDecimal realAmount = BigDecimal.ZERO;
@Column(name = "pay_way")
@ApiModelProperty(value = "支付方式")
private Integer payWay;
public void setCrtTime(Date crtTime) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
this.crtTime = dateFormat.format(crtTime);
}
public String getType() {
return orderTypeMap.get(type);
}
public String getPayWay() {
return payWayMap.get(payWay);
}
}
package com.xxfc.platform.order.pojo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* 总业绩查询条件
* @author Administrator
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
public class QueryCriteria {
@ApiModelProperty(value ="开始时间" )
private Date startDate;
@ApiModelProperty(value = "结束时间")
private Date endDate;
@ApiModelProperty(value = "订单类型:1-租车 2-旅游 3-会员 null-全部")
private Integer orderType;
@ApiModelProperty(value = "业绩所属公司")
private Integer companyId;
@ApiModelProperty(value = "支付方式: 1-微信支付 2-支付宝支付 3-银联支付 null-全部")
private Integer paymentMethod;
@ApiModelProperty(value = "账目类型: 0-入账 1-出账")
private Integer type = 0;
@ApiModelProperty("权限公司id")
private List<Integer> jurisdiction;
@ApiModelProperty(value = "当前页数")
private Integer page=1;
@ApiModelProperty(value = "每页条数")
private Integer limit=10;
}
package com.xxfc.platform.order.pojo;
import com.alibaba.fastjson.JSON;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Data
public class ReturnOrderAmount implements Serializable {
private static final long serialVersionUID = -8445943548965154778L;
private static final Map<Integer, String> orderTypeMap = new HashMap<>();
static {
orderTypeMap.put(1, "租车");
orderTypeMap.put(2, "旅游");
orderTypeMap.put(3, "会员");
}
@ApiModelProperty(value = "时间")
private Long time;
@ApiModelProperty(value = "订单号")
private String no;
@ApiModelProperty(value = "订单类型")
private Integer type;
@ApiModelProperty(value = "订单明细")
private String accountDetail;
@ApiModelProperty(value = "用户姓名")
private String realname;
@ApiModelProperty(value = "手机号")
private String username;
@ApiModelProperty(value = "退款说明")
private String refundInstruction;
@ApiModelProperty(value = "退款明细")
private BigDecimal refundAmount = BigDecimal.ZERO;
@ApiModelProperty("退还类型")
@Column(name = "account_type")
private Integer accountType;
public OrderAccountDetail getAccountDetail() {
return StringUtils.hasText(accountDetail) ? JSON.parseObject(accountDetail, OrderAccountDetail.class) : new OrderAccountDetail();
}
public String getType() {
return orderTypeMap.get(type);
}
public String getTime() {
Date date = new Date(this.time);
return new SimpleDateFormat("yyyy-MM-dd").format(date);
}
}
package com.xxfc.platform.order.pojo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
/**
* 总业绩报表类
*
* @author Administrator
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TotalOrderRevenue {
@ApiModelProperty(value = "总订单数")
private Integer orderSum;
@ApiModelProperty(value = "应收总额")
private BigDecimal totalReceivables=BigDecimal.ZERO;
@ApiModelProperty(value = "优惠金额")
private BigDecimal discount=BigDecimal.ZERO;
@ApiModelProperty(value = "实收金额")
private BigDecimal actual=BigDecimal.ZERO;
@ApiModelProperty(value = "数据明细")
private PageInfo<Achievement> achievements;
}
......@@ -5,6 +5,8 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
......@@ -134,10 +136,10 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
return mapper.pageByParm(paramMap);
}
public List<OrderListVo> listOrder(Map<String, Object> paramMap) {
List<OrderListVo> orderListVos = mapper.listOrder(paramMap);
return orderListVos;
}
public List<OrderListVo> listOrder(Map<String, Object> paramMap) {
return mapper.listOrder(paramMap);
}
public List<OrderPageVO> getRentVehicle(Map<String, Object> paramMap) {
return mapper.getRentVehicle(paramMap);
......@@ -929,4 +931,18 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
return mapper.selectAllRentVehicleOrder(paramMap);
}
public List<Achievement> entryStatisticalData(QueryCriteria queryCriteria) {
return mapper.selectTotalStatistical(queryCriteria);
}
public PageInfo<Achievement> getAchievementPageInfo(QueryCriteria queryCriteria) {
PageHelper.startPage(queryCriteria.getPage(),queryCriteria.getLimit());
List<Achievement> achievements = mapper.selectTotalStatistical(queryCriteria);
return PageInfo.of(achievements);
}
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -17,6 +19,8 @@ import com.xxfc.platform.order.contant.enumerate.*;
import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.mapper.OrderAccountMapper;
import com.xxfc.platform.order.pojo.DedDetailDTO;
import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.pojo.ReturnOrderAmount;
import com.xxfc.platform.order.pojo.Term;
import com.xxfc.platform.order.pojo.account.OrderAccountBo;
import com.xxfc.platform.order.pojo.account.OrderAccountDTO;
......@@ -671,4 +675,17 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
List<OrderAccountBo> orderAccountBos = mapper.selectByDateAndStatffIds(startDate,endDate,staffUserIds);
return CollectionUtils.isNotEmpty(orderAccountBos)?Collections.EMPTY_LIST:orderAccountBos;
}
public List<ReturnOrderAmount> outStatisticalData(QueryCriteria queryCriteria) {
Long startTime=null;
Long endTime= null;
if (queryCriteria.getStartDate()!=null) {
startTime=queryCriteria.getStartDate().getTime();
}
if (queryCriteria.getEndDate()!=null) {
endTime= queryCriteria.getEndDate().getTime();
}
return mapper.outStatisticalData(queryCriteria,startTime,endTime);
}
}
\ No newline at end of file
......@@ -229,13 +229,14 @@ public class StaffStatisticsBiz extends BaseBiz<StaffStatisticsMapper, StaffStat
for (AppUserSellingWaterDTO waterDTO : waterDTOS) {
if (sellingWaterEntry.getKey() == 0){
royaltyAmount = royaltyAmount.add(waterDTO.getCommission());
totalAmount = totalAmount.add(waterDTO.getPrice());
totalAmount = totalAmount.add(waterDTO.getCommission().divide(new BigDecimal(String.valueOf(waterDTO.getExtract()))));
orderCounter.incrementAndGet();
}
if (sellingWaterEntry.getKey()==1){
royaltyAmount = royaltyAmount.subtract(waterDTO.getCommission());
totalAmount = totalAmount.subtract(waterDTO.getPrice());
totalAmount = totalAmount.subtract(waterDTO.getCommission().divide(new BigDecimal(String.valueOf(waterDTO.getExtract()/100.00))));
}
}
staffStatisticsResultMap.put(TOTAL_AMOUNT_VAL,totalAmount);
......
package com.xxfc.platform.order.biz;
import cn.hutool.core.collection.CollectionUtil;
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;
import com.xxfc.platform.order.pojo.ReturnOrderAmount;
import com.xxfc.platform.order.pojo.TotalOrderRevenue;
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.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* 总业绩报表service层
*
* @author Administrator
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TotalPerformanceBiz {
private final BaseOrderBiz baseOrderBiz;
private final OrderAccountBiz accountBiz;
/**
* 入账数据统计
* @param queryCriteria 查询条件
*
*/
public TotalOrderRevenue entryStatisticalData(QueryCriteria queryCriteria) {
//获取总数据
TotalOrderRevenue totalOrderRevenue = incomeDataProcessing(queryCriteria);
//设置订单明细并分页
getAchievementPageInfo(totalOrderRevenue,queryCriteria);
return totalOrderRevenue ;
}
/**
* 核算总收益
* @return
* @param queryCriteria
*/
private TotalOrderRevenue incomeDataProcessing( QueryCriteria queryCriteria) {
List<Achievement> achievements = baseOrderBiz.entryStatisticalData(queryCriteria);
if (CollectionUtil.isEmpty(achievements)) {
return new TotalOrderRevenue();
}
//应收总额
BigDecimal totalReceivables = BigDecimal.ZERO;
//优惠总额
BigDecimal discount=BigDecimal.ZERO;
//实收总额
BigDecimal actual =BigDecimal.ZERO;
for (Achievement achievement : achievements) {
totalReceivables=totalReceivables.add(achievement.getOrderAmount());
actual=actual.add(achievement.getRealAmount());
discount=discount.add(achievement.getOrderAmount().subtract(achievement.getRealAmount()));
}
return TotalOrderRevenue
.builder()
.orderSum(achievements.size())
.totalReceivables(totalReceivables)
.discount(discount)
.actual(actual)
.build();
}
/**
* 设置支出明细
* @param totalOrderRevenue
* @param queryCriteria 条件
*/
private void getAchievementPageInfo(TotalOrderRevenue totalOrderRevenue, QueryCriteria queryCriteria){
PageInfo<Achievement> achievementPageInfo = baseOrderBiz.getAchievementPageInfo(queryCriteria);
totalOrderRevenue.setAchievements(achievementPageInfo);
}
/**
* 获取支出明细
* @param queryCriteria
* @return
*/
public List<ReturnOrderAmount> outStatisticalData(QueryCriteria queryCriteria) {
List<ReturnOrderAmount> returnOrderAmounts = accountBiz.outStatisticalData(queryCriteria);
if (CollectionUtils.isEmpty(returnOrderAmounts)) {
return Lists.newArrayList();
}
//拆分明细
return splitReturnOrderAmountList(returnOrderAmounts);
}
/**
* 进行对支出记录拆分,拆分为-押金、订单和违章
* @param returnOrderAmounts
* @return
*/
private List<ReturnOrderAmount> splitReturnOrderAmountList(List<ReturnOrderAmount> returnOrderAmounts) {
ArrayList<ReturnOrderAmount> arrayList = Lists.newArrayList();
//进行遍历拆分出-押金、订单和违章
for (ReturnOrderAmount returnOrderAmount : returnOrderAmounts) {
OrderAccountDetail accountDetailStr = returnOrderAmount.getAccountDetail();
//押金退还金额
BigDecimal depositAmount = accountDetailStr.getDepositAmount();
//订单退还
BigDecimal orderAmount = accountDetailStr.getOrderAmount();
//判断押金退还是否大于0
if ( depositAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
//判断是违章还是租车
if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) {
returnOrderAmountClone.setRefundInstruction("违章押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
}else {
returnOrderAmountClone.setRefundInstruction("租车押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
}
arrayList.add(returnOrderAmountClone);
}
//判断订单退款是否大于0
if (orderAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
returnOrderAmountClone.setRefundInstruction("订单退款");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getOrderAmount());
}
}
return arrayList;
}
/**
* 导出入账记录
* @param queryCriteria
* @param name
* @param outputStream
*/
public void exportEntry(QueryCriteria queryCriteria, String name, ServletOutputStream outputStream) throws IOException {
XSSFWorkbook hssfWorkbook = new XSSFWorkbook();
XSSFSheet sheet = hssfWorkbook.createSheet("收入");
CellStyle generalCellStyle = createGeneralCellStyle(hssfWorkbook);
XSSFRow row1 = sheet.createRow(0);
String[] head =new String[]{"下单时间","订单ID","订单类型","应收金额","优惠金额","实收金额","客户姓名","客户手机号","邀约人/身份","要约人手机号","业绩所属公司","支付方式"};
createHeader(row1,0,head,generalCellStyle);
List<Achievement> achievements = baseOrderBiz.entryStatisticalData(queryCriteria);
if (CollectionUtil.isEmpty(achievements)) {
throw new BaseException("无数据");
}
List<String[]> achievementArray =getAchievementArrays(achievements,12);
createCellData(sheet,1,generalCellStyle,achievementArray);
//设置最后一行
int lastRowNum = sheet.getLastRowNum();
XSSFRow rown = sheet.createRow(lastRowNum);
//设置第一列
XSSFCell cell1 = rown.createCell(0);
cell1.setCellValue("合计");
//第五列求和
int[] cel= new int[]{3,4,5};
sum(sheet, lastRowNum,cel);
hssfWorkbook.write(outputStream);
hssfWorkbook.close();
}
public void sum(XSSFSheet sheet, int lastRowNum, int[] cel) {
for (int i : cel) {
String colString = CellReference.convertNumToColString(i);
//该求和公式的意思就是:sum(第几列+第几个 : 第几列+需要累计到的第几个单元格位置)
String sumstring = "SUM(" + colString + "2:" + colString + (lastRowNum) + ")";
sheet.getRow(lastRowNum).createCell(i).setCellFormula(sumstring);
}
}
/**
* 获取入账数组
* @param achievements
* @param length
* @return
*/
private List<String[]> getAchievementArrays(List<Achievement> achievements, int length) {
ArrayList<String[]> arrayList = Lists.newArrayList();
for (Achievement achievement : achievements) {
String [] data= new String[length];
data[0]=achievement.getCrtTime();
data[1]=achievement.getNo();
data[2]=achievement.getType();
data[3]=achievement.getOrderAmount().toString();
data[4]=achievement.getFavorablePrice().toString();
data[5]=achievement.getRealAmount().toString();
data[6]=achievement.getRealname();
data[7]=achievement.getUsername();
data[8]=String.format("%s/%s",achievement.getParentRealname()==null?"":achievement.getParentRealname(),achievement.getPositionName()==null?"":achievement.getPositionName());
data[9]=achievement.getParentUsername();
data[10]=achievement.getCompanyName();
data[11]=achievement.getPayWay();
arrayList.add(data);
}
return arrayList;
}
/**
* 导出支出
* @param queryCriteria
* @param name
* @param outputStream
*/
public void exportAccount(QueryCriteria queryCriteria, String name, ServletOutputStream outputStream) throws IOException {
XSSFWorkbook hssfWorkbook = new XSSFWorkbook();
XSSFSheet sheet = hssfWorkbook.createSheet("支出");
CellStyle generalCellStyle = createGeneralCellStyle(hssfWorkbook);
XSSFRow row1 = sheet.createRow(0);
String[] head =new String[]{"退款日期","订单ID","订单类型","退还类型","退还押金","客户名","客户手机号"};
createHeader(row1,0,head,generalCellStyle);
List<ReturnOrderAmount> returnOrderAmounts = outStatisticalData(queryCriteria);
List<String[]> achievementArray =getReturnOrderAmountArrays(returnOrderAmounts,7);
if (CollectionUtil.isEmpty(achievementArray)) {
throw new BaseException("无数据");
}
createCellData(sheet,1,generalCellStyle,achievementArray);
//设置最后一行
int lastRowNum = sheet.getLastRowNum();
XSSFRow rown = sheet.createRow(lastRowNum);
//设置第一列
XSSFCell cell1 = rown.createCell(0);
cell1.setCellValue("合计");
//第五列求和
String colString = CellReference.convertNumToColString(4);
//该求和公式的意思就是:sum(第几列+第几个 : 第几列+需要累计到的第几个单元格位置)
String sumstring = "SUM(" + colString + "2:" + colString + (lastRowNum) + ")";
sheet.getRow(lastRowNum).createCell(4).setCellFormula(sumstring);
hssfWorkbook.write(outputStream);
hssfWorkbook.close();
}
/**
* 获取支出数组
* @param returnOrderAmounts
* @param length
* @return
*/
private List<String[]> getReturnOrderAmountArrays(List<ReturnOrderAmount> returnOrderAmounts, int length) {
ArrayList<String[]> arrayList = Lists.newArrayList();
for (ReturnOrderAmount returnOrderAmount : returnOrderAmounts) {
String [] data= new String[length];
data[0]=returnOrderAmount.getTime();
data[1]=returnOrderAmount.getNo();
data[2]=returnOrderAmount.getType();
data[3]=returnOrderAmount.getRefundInstruction();
data[4]=returnOrderAmount.getRefundAmount().toString();
data[5]=returnOrderAmount.getRealname();
data[6]=returnOrderAmount.getUsername();
arrayList.add(data);
}
return arrayList;
}
private CellStyle createGeneralCellStyle(XSSFWorkbook hssfWorkbook){
CellStyle cellStyleGeneral = createHeaderCellStyle(hssfWorkbook);
cellStyleGeneral.setWrapText(true);
XSSFFont generalFont = createFont(hssfWorkbook);
generalFont.setBold(false);
cellStyleGeneral.setFont(generalFont);
return cellStyleGeneral;
}
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;
}
}
private CellStyle createHeaderCellStyle(XSSFWorkbook hssfWorkbook){
XSSFCellStyle cellStyleHeader = hssfWorkbook.createCellStyle();
cellStyleHeader.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,#0"));
cellStyleHeader.setAlignment(HorizontalAlignment.CENTER);
cellStyleHeader.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyleHeader.setLocked(false);
cellStyleHeader.setBorderBottom(CellStyle.BORDER_THIN);
cellStyleHeader.setBorderLeft(CellStyle.BORDER_THIN);
cellStyleHeader.setBorderTop(CellStyle.BORDER_THIN);
cellStyleHeader.setBorderRight(CellStyle.BORDER_THIN);
XSSFFont headerFont = createFont(hssfWorkbook);
cellStyleHeader.setFont(headerFont);
return cellStyleHeader;
}
private XSSFFont createFont(XSSFWorkbook hssfWorkbook){
XSSFFont font = hssfWorkbook.createFont();
font.setFontName("黑体");
font.setBold(true);
return font;
}
private void createCellData(Sheet sheet,int startRowIndex,CellStyle cellStyle,List<String[]> memberOrderList){
for (String[] data : memberOrderList) {
Row row = sheet.createRow(startRowIndex++);
createHeader(row,0,data,cellStyle);
}
}
}
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.pojo.Achievement;
import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.pojo.bg.BgOrderListVo;
import com.xxfc.platform.order.pojo.dto.MemberOrderBo;
import com.xxfc.platform.order.pojo.dto.MemberOrderFindDTO;
......@@ -46,5 +48,7 @@ public interface BaseOrderMapper extends Mapper<BaseOrder> {
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
List<Achievement> selectTotalStatistical(QueryCriteria queryCriteria);
List<OrderDTO> selectBaeOrderByOrderIds(@Param("orderIds") List<Integer> orderIds);
}
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.OrderAccount;
import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.pojo.ReturnOrderAmount;
import com.xxfc.platform.order.pojo.Term;
import com.xxfc.platform.order.pojo.account.OrderAccountBo;
import com.xxfc.platform.order.pojo.account.OrderAccountDTO;
......@@ -9,6 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
......@@ -22,6 +25,8 @@ public interface OrderAccountMapper extends Mapper<OrderAccount> {
List<OrderAccountDTO> getOrderAccountByOrderType(Term term);
List<ReturnOrderAmount> outStatisticalData(@Param("queryCriteria")QueryCriteria queryCriteria,@Param("startTime") Long startTime,@Param("endTime")Long endTime);
List<OrderAccountBo> selectOrderAccountByOrderTypeAndStartTimeAndEndTime(@Param("orderType") Integer orderType,
@Param("startTime") long startTime,
@Param("endTime") long endTime);
......
package com.xxfc.platform.order.rest.background;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.auth.PageResult;
import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.xxfc.platform.order.biz.TotalPerformanceBiz;
import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.contant.enumerate.BookkeepingTypeEnum;
import com.xxfc.platform.order.pojo.ReturnOrderAmount;
import com.xxfc.platform.order.pojo.TotalOrderRevenue;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
/**
* 总业绩报表
*
* @author Administrator
*/
@RestController()
@RequestMapping("/report/form")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "总业绩统计")
@IgnoreClientToken
@IgnoreUserToken
public class TotalPerformanceStatementController extends CommonBaseController {
private final TotalPerformanceBiz totalPerformanceBiz;
private final HttpServletRequest request;
private final UserAuthConfig userAuthConfig;
private final UserFeign userFeign;
private final VehicleFeign vehicleFeign;
private final Integer HIGHEST_AUTHORITY = 1;
@PostMapping("/list")
public ObjectRestResponse statisticalData(@RequestBody QueryCriteria queryCriteria) throws Exception {
UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
//获取用户权限
List<Integer> Jurisdiction = null;
//是否有查询所有数据的权限
if (!HIGHEST_AUTHORITY.equals(userDTO.getDataAll())) {
List<BranchCompany> branchCompanies = vehicleFeign.companyAll(userDTO.getDataAll(), userDTO.getDataCompany(), userDTO.getDataZone());
Jurisdiction = branchCompanies.parallelStream().map(BranchCompany::getId).collect(Collectors.toList());
}
queryCriteria.setJurisdiction(Jurisdiction);
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) {
TotalOrderRevenue totalOrderRevenue = totalPerformanceBiz.entryStatisticalData(queryCriteria);
return ObjectRestResponse.succ(totalOrderRevenue);
}else if (BookkeepingTypeEnum.OUT.getCode().equals(queryCriteria.getType())){
List<ReturnOrderAmount> returnOrderAmounts = totalPerformanceBiz.outStatisticalData(queryCriteria);
return ObjectRestResponse.succ(PageResult.nowPageResult(queryCriteria.getPage(),queryCriteria.getLimit(),returnOrderAmounts));
}
return ObjectRestResponse.succ();
}
@PostMapping("/excel")
public void exportTotalPerformance(@RequestBody QueryCriteria queryCriteria, HttpServletResponse response) throws Exception {
try {
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"));
ServletOutputStream outputStream = response.getOutputStream();
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("无相关数据");
}
response.setCharacterEncoding("UTF-8");
} catch (IOException e) {
throw new BaseException("导入数据失败");
}
}
}
......@@ -116,14 +116,14 @@
<select id="listOrder" parameterType="Map" resultMap="orderListMap">
select b.*
<if test="type==1">
,i.detail as carArticlesJson
,i.detail as carArticlesJson
</if>
from base_order b
LEFT JOIN order_rent_vehicle_detail r on r.order_id = b.id
LEFT JOIN order_tour_detail t on t.order_id = b.id
LEFT JOIN order_member_detail m on m.order_id = b.id
<if test="type==1">
LEFT JOIN (select * from order_item where type = 104) i on b.id = i.order_id
LEFT JOIN (select * from order_item where type = 104) i on b.id = i.order_id
</if>
<where>
<if test="crtUser != null">
......@@ -439,4 +439,37 @@
#{orderId}
</foreach>
</select>
<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
from order_user_position_company
<where>
<if test="startDate != null">
and crt_time <![CDATA[>=]]> #{startDate}
</if>
<if test="endDate != null">
and crt_time <![CDATA[<=]]> #{endDate}
</if>
<if test="paymentMethod !=null">
and pay_way = #{paymentMethod}
</if>
<if test="jurisdiction != null and jurisdiction.size() !=0 ">
and company_id in
<foreach collection="jurisdiction" index="index" item="companyId" open="(" separator="," close=")">
#{companyId}
</foreach>
</if>
<if test="companyId != null ">
and company_id =#{companyId}
</if>
<if test="orderType != null">
and type = #{orderType}
</if>
</where>
order by crt_time DESC
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.order.mapper.OrderAccountMapper">
<select id="getOrderAccountByOrderType" parameterType="com.xxfc.platform.order.pojo.Term" resultType="com.xxfc.platform.order.pojo.account.OrderAccountDTO">
<select id="getOrderAccountByOrderType" parameterType="com.xxfc.platform.order.pojo.Term"
resultType="com.xxfc.platform.order.pojo.account.OrderAccountDTO">
SELECT
<if test="subdivide !=null and subdivide ==1">
date( FROM_UNIXTIME( a.crt_time / 1000 ) ) as oneDay,
......@@ -27,7 +28,7 @@
AND
b.type = #{orderType}
<if test="startTime != null">
AND a.crt_time <![CDATA[>= ]]> #{startTime}
AND a.crt_time <![CDATA[>= ]]> #{startTime}
</if>
<if test="endTime != null">
AND a.crt_time &gt; endTime
......@@ -49,7 +50,28 @@
<if test="subdivide !=null and subdivide ==1">
AND date( FROM_UNIXTIME( a.crt_time / 1000 ) ) = date( DATE_SUB( now( ), INTERVAL #{day} DAY ) )
</if>
</select>
<select id="outStatisticalData" resultType="com.xxfc.platform.order.pojo.ReturnOrderAmount">
select oa.crt_time as time ,oupc.no,oupc.type,oa.account_detail as accountDetail ,oupc.realname,oupc.username,oa.account_type
from order_account oa
left join order_user_position_company oupc ON oa.order_id=oupc.id
WHERE oa.account_type!=101
<if test="startTime != null">
and oa.crt_time <![CDATA[>=]]> #{startTime}
</if>
<if test="endTime != null">
and oa.crt_time <![CDATA[<=]]> #{endTime}
</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=")">
#{companyId}
</foreach>
</if>
<if test="queryCriteria.orderType != null">
and oupc.type = #{orderType}
</if>
order by oa.crt_time DESC
</select>
<select id="selectOrderAccountByOrderTypeAndStartTimeAndEndTime"
......
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