@ -1,6 +1,7 @@
package com.bweb.controller ;
package com.bweb.controller ;
import com.alibaba.excel.EasyExcel ;
import com.alibaba.excel.EasyExcel ;
import com.alibaba.excel.util.DateUtils ;
import com.alibaba.fastjson.JSONObject ;
import com.alibaba.fastjson.JSONObject ;
import com.bweb.config.SysConst ;
import com.bweb.config.SysConst ;
import com.github.pagehelper.PageHelper ;
import com.github.pagehelper.PageHelper ;
@ -9,6 +10,7 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp ;
import com.hai.common.exception.ErrorHelp ;
import com.hai.common.exception.SysCode ;
import com.hai.common.exception.SysCode ;
import com.hai.common.security.UserCenter ;
import com.hai.common.security.UserCenter ;
import com.hai.common.utils.DateUtil ;
import com.hai.common.utils.ResponseMsgUtil ;
import com.hai.common.utils.ResponseMsgUtil ;
import com.hai.entity.HighTySalesman ;
import com.hai.entity.HighTySalesman ;
import com.hai.enum_type.UserObjectTypeEnum ;
import com.hai.enum_type.UserObjectTypeEnum ;
@ -20,6 +22,7 @@ import com.hai.service.HighTyAgentOilStationService;
import com.hai.service.HighTySalesmanService ;
import com.hai.service.HighTySalesmanService ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.ApiOperation ;
import io.swagger.annotations.ApiOperation ;
import org.apache.commons.collections4.MapUtils ;
import org.slf4j.Logger ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
import org.slf4j.LoggerFactory ;
import org.springframework.stereotype.Controller ;
import org.springframework.stereotype.Controller ;
@ -27,10 +30,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource ;
import javax.annotation.Resource ;
import java.io.File ;
import java.io.File ;
import java.util.ArrayList ;
import java.util.* ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
@Controller
@Controller
@RequestMapping ( value = "/tyAgentOilStation" )
@RequestMapping ( value = "/tyAgentOilStation" )
@ -334,6 +334,9 @@ public class HighTyAgentOilStationController {
@RequestParam ( name = "salesmanName" , required = false ) String salesmanName ,
@RequestParam ( name = "salesmanName" , required = false ) String salesmanName ,
@RequestParam ( name = "agentName" , required = false ) String agentName ,
@RequestParam ( name = "agentName" , required = false ) String agentName ,
@RequestParam ( name = "orgName" , required = false ) String orgName ,
@RequestParam ( name = "orgName" , required = false ) String orgName ,
@RequestParam ( name = "memPhone" , required = false ) String memPhone ,
@RequestParam ( name = "payTimeS" , required = false ) Long payTimeS ,
@RequestParam ( name = "payTimeE" , required = false ) Long payTimeE ,
@RequestParam ( name = "pageNum" , required = true ) Integer pageNum ,
@RequestParam ( name = "pageNum" , required = true ) Integer pageNum ,
@RequestParam ( name = "pageSize" , required = true ) Integer pageSize ) {
@RequestParam ( name = "pageSize" , required = true ) Integer pageSize ) {
try {
try {
@ -344,6 +347,14 @@ public class HighTyAgentOilStationController {
Map < String , Object > param = new HashMap < > ( ) ;
Map < String , Object > param = new HashMap < > ( ) ;
param . put ( "orderNo" , orderNo ) ;
param . put ( "orderNo" , orderNo ) ;
param . put ( "goodsName" , goodsName ) ;
param . put ( "goodsName" , goodsName ) ;
param . put ( "memPhone" , memPhone ) ;
if ( payTimeS ! = null ) {
param . put ( "payTimeS" , DateUtil . format ( new Date ( payTimeS ) , "yyyy-MM-dd HH:mm:ss" ) ) ;
}
if ( payTimeE ! = null ) {
param . put ( "payTimeE" , DateUtil . format ( new Date ( payTimeE ) , "yyyy-MM-dd HH:mm:ss" ) ) ;
}
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
param . put ( "companyId" , userModel . getBsCompany ( ) . getId ( ) ) ;
param . put ( "companyId" , userModel . getBsCompany ( ) . getId ( ) ) ;
@ -380,6 +391,9 @@ public class HighTyAgentOilStationController {
public ResponseData excelOrder ( @RequestParam ( name = "orderNo" , required = false ) String orderNo ,
public ResponseData excelOrder ( @RequestParam ( name = "orderNo" , required = false ) String orderNo ,
@RequestParam ( name = "goodsName" , required = false ) String goodsName ,
@RequestParam ( name = "goodsName" , required = false ) String goodsName ,
@RequestParam ( name = "salesmanName" , required = false ) String salesmanName ,
@RequestParam ( name = "salesmanName" , required = false ) String salesmanName ,
@RequestParam ( name = "memPhone" , required = false ) String memPhone ,
@RequestParam ( name = "payTimeS" , required = false ) Long payTimeS ,
@RequestParam ( name = "payTimeE" , required = false ) Long payTimeE ,
@RequestParam ( name = "agentName" , required = false ) String agentName ,
@RequestParam ( name = "agentName" , required = false ) String agentName ,
@RequestParam ( name = "orgName" , required = false ) String orgName ) {
@RequestParam ( name = "orgName" , required = false ) String orgName ) {
try {
try {
@ -390,6 +404,14 @@ public class HighTyAgentOilStationController {
Map < String , Object > param = new HashMap < > ( ) ;
Map < String , Object > param = new HashMap < > ( ) ;
param . put ( "orderNo" , orderNo ) ;
param . put ( "orderNo" , orderNo ) ;
param . put ( "goodsName" , goodsName ) ;
param . put ( "goodsName" , goodsName ) ;
param . put ( "memPhone" , memPhone ) ;
if ( payTimeS ! = null ) {
param . put ( "payTimeS" , DateUtil . format ( new Date ( payTimeS ) , "yyyy-MM-dd HH:mm:ss" ) ) ;
}
if ( payTimeE ! = null ) {
param . put ( "payTimeE" , DateUtil . format ( new Date ( payTimeE ) , "yyyy-MM-dd HH:mm:ss" ) ) ;
}
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
param . put ( "companyId" , userModel . getBsCompany ( ) . getId ( ) ) ;
param . put ( "companyId" , userModel . getBsCompany ( ) . getId ( ) ) ;
@ -423,8 +445,12 @@ public class HighTyAgentOilStationController {
if ( userModel . getBsCompany ( ) ! = null | | userModel . getSecUser ( ) . getObjectType ( ) . equals ( UserObjectTypeEnum . type6 . getType ( ) ) ) {
if ( userModel . getBsCompany ( ) ! = null | | userModel . getSecUser ( ) . getObjectType ( ) . equals ( UserObjectTypeEnum . type6 . getType ( ) ) ) {
headList . add ( "业务员" ) ;
headList . add ( "业务员" ) ;
}
}
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
headList . add ( "用户手机号" ) ;
}
headList . add ( "加油站" ) ;
headList . add ( "加油站" ) ;
headList . add ( "订单号" ) ;
headList . add ( "平台订单号" ) ;
headList . add ( "团油订单号" ) ;
headList . add ( "支付类型" ) ;
headList . add ( "支付类型" ) ;
headList . add ( "加油金额" ) ;
headList . add ( "加油金额" ) ;
headList . add ( "优惠金额" ) ;
headList . add ( "优惠金额" ) ;
@ -450,8 +476,12 @@ public class HighTyAgentOilStationController {
if ( userModel . getBsCompany ( ) ! = null | | userModel . getSecUser ( ) . getObjectType ( ) . equals ( UserObjectTypeEnum . type6 . getType ( ) ) ) {
if ( userModel . getBsCompany ( ) ! = null | | userModel . getSecUser ( ) . getObjectType ( ) . equals ( UserObjectTypeEnum . type6 . getType ( ) ) ) {
data . add ( orderModel . getSalesmanName ( ) ) ;
data . add ( orderModel . getSalesmanName ( ) ) ;
}
}
if ( userModel . getBsCompany ( ) ! = null & & userModel . getSecUser ( ) . getAdminFlag ( ) . equals ( 1 ) ) {
data . add ( orderModel . getMemPhone ( ) ) ;
}
data . add ( orderModel . getGoodsName ( ) ) ;
data . add ( orderModel . getGoodsName ( ) ) ;
data . add ( orderModel . getOrderNo ( ) ) ;
data . add ( orderModel . getOrderNo ( ) ) ;
data . add ( orderModel . getGasOrderNo ( ) ) ;
data . add ( orderModel . getPayType ( ) ) ;
data . add ( orderModel . getPayType ( ) ) ;
data . add ( orderModel . getTotalPrice ( ) ) ;
data . add ( orderModel . getTotalPrice ( ) ) ;
data . add ( orderModel . getDeductionPrice ( ) ) ;
data . add ( orderModel . getDeductionPrice ( ) ) ;