提交代码

dev-discount
胡锐 3 years ago
parent 7d7c2587aa
commit 1b48501075
  1. 40
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java
  2. 16
      hai-service/src/main/java/com/hai/dao/HighTyAgentOilStationMapperExt.java
  3. 18
      hai-service/src/main/java/com/hai/model/TyOrderModel.java

@ -1,6 +1,7 @@
package com.bweb.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
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.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighTySalesman;
import com.hai.enum_type.UserObjectTypeEnum;
@ -20,6 +22,7 @@ import com.hai.service.HighTyAgentOilStationService;
import com.hai.service.HighTySalesmanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
@ -27,10 +30,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Controller
@RequestMapping(value = "/tyAgentOilStation")
@ -334,6 +334,9 @@ public class HighTyAgentOilStationController {
@RequestParam(name = "salesmanName", required = false) String salesmanName,
@RequestParam(name = "agentName", required = false) String agentName,
@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 = "pageSize", required = true) Integer pageSize) {
try {
@ -344,6 +347,14 @@ public class HighTyAgentOilStationController {
Map<String, Object> param = new HashMap<>();
param.put("orderNo", orderNo);
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)) {
param.put("companyId", userModel.getBsCompany().getId());
@ -380,6 +391,9 @@ public class HighTyAgentOilStationController {
public ResponseData excelOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "goodsName", required = false) String goodsName,
@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 = "orgName", required = false) String orgName) {
try {
@ -390,6 +404,14 @@ public class HighTyAgentOilStationController {
Map<String, Object> param = new HashMap<>();
param.put("orderNo", orderNo);
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)) {
param.put("companyId", userModel.getBsCompany().getId());
@ -423,8 +445,12 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
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("优惠金额");
@ -450,8 +476,12 @@ public class HighTyAgentOilStationController {
if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) {
data.add(orderModel.getSalesmanName());
}
if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) {
data.add(orderModel.getMemPhone());
}
data.add(orderModel.getGoodsName());
data.add(orderModel.getOrderNo());
data.add(orderModel.getGasOrderNo());
data.add(orderModel.getPayType());
data.add(orderModel.getTotalPrice());
data.add(orderModel.getDeductionPrice());

@ -54,7 +54,9 @@ public interface HighTyAgentOilStationMapperExt {
@Select("<script>" +
" SELECT" +
" b.mem_phone memPhone," +
" b.order_no orderNo," +
" a.gas_order_no gasOrderNo," +
" CASE" +
" b.pay_type " +
" WHEN 1 THEN '支付' " +
@ -80,22 +82,22 @@ public interface HighTyAgentOilStationMapperExt {
" a.gas_salesman_name salesmanName " +
" FROM" +
" high_child_order a," +
" high_order b," +
" high_user c" +
" high_order b" +
" WHERE" +
" a.order_id = b.id " +
" and b.mem_id = c.id" +
" AND a.goods_type = 3 " +
" <if test='param.companyId != null'> AND a.gas_salesman_id in ( select id from high_ty_salesman where ty_agent_id in (select id from high_ty_agent " +
" where org_id in (select id from bs_organization WHERE company_id = #{param.companyId} and `status` = 1) and `status` = 1) and `status` = 1) </if> " +
" <if test='param.orgId != null'> AND a.gas_salesman_id in (select id from high_ty_salesman where ty_agent_id in (select id from high_ty_agent where org_id = #{param.orgId} and `status` = 1) and `status` = 1 ) </if> " +
" <if test='param.agentId != null'> AND a.gas_salesman_id in (select id from high_ty_salesman where ty_agent_id = #{param.agentId} and status = 1) </if> " +
" <if test='param.companyId != null'> AND a.gas_org_id in (select id from bs_organization WHERE company_id = #{param.companyId} and `status` = 1) </if> " +
" <if test='param.orgId != null'> AND a.gas_org_id = #{param.orgId} </if> " +
" <if test='param.agentId != null'> AND a.gas_agent_id = #{param.agentId} </if> " +
" <if test='param.salesmanId != null'> AND a.gas_salesman_id = #{param.salesmanId} </if> " +
" <if test='param.goodsName != null'> AND a.goods_name like concat('%',#{param.goodsName},'%') </if> " +
" <if test='param.orderNo != null'> AND b.order_no like concat('%',#{param.orderNo},'%') </if> " +
" <if test='param.orgName != null'> AND a.gas_org_name like concat('%',#{param.orgName},'%') </if> " +
" <if test='param.agentName != null'> AND a.gas_agent_name like concat('%',#{param.agentName},'%') </if> " +
" <if test='param.salesmanName != null'> AND a.gas_salesman_name like concat('%',#{param.salesmanName},'%') </if> " +
" <if test='param.memPhone != null'> AND b.mem_phone like concat('%',#{param.memPhone},'%') </if> " +
" <if test='param.payTimeS != null'> <![CDATA[ AND b.pay_time >= #{param.payTimeS} ]]> </if> " +
" <if test='param.payTimeE != null'> <![CDATA[ AND b.pay_time <= #{param.payTimeE} ]]> </if> " +
" AND a.child_orde_status IN ( 2, 3 ) " +
" ORDER BY" +
" b.pay_time DESC" +

@ -5,7 +5,9 @@ import java.util.Date;
public class TyOrderModel {
private String memPhone;
private String orderNo;
private String gasOrderNo;
private String payType;
private BigDecimal totalPrice;
private BigDecimal deductionPrice;
@ -22,6 +24,14 @@ public class TyOrderModel {
private String agentName;
private String salesmanName;
public String getMemPhone() {
return memPhone;
}
public void setMemPhone(String memPhone) {
this.memPhone = memPhone;
}
public String getOrgName() {
return orgName;
}
@ -54,6 +64,14 @@ public class TyOrderModel {
this.orderNo = orderNo;
}
public String getGasOrderNo() {
return gasOrderNo;
}
public void setGasOrderNo(String gasOrderNo) {
this.gasOrderNo = gasOrderNo;
}
public String getPayType() {
return payType;
}

Loading…
Cancel
Save