提交代码

new-dev
胡锐 1 year ago committed by Sum1Dream
parent 6fac43e6f3
commit bea7f4e7b6
  1. 10
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 22
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  3. 13
      hai-service/src/main/java/com/hai/service/impl/HighGasOrderServiceImpl.java

@ -74,6 +74,9 @@ public class HighGasController {
@Resource @Resource
private ShellGroupService shellGroupService; private ShellGroupService shellGroupService;
@Resource
private HighGasOrderService gasOrderService;
@RequestMapping(value="/getMerGasStatistical",method = RequestMethod.POST) @RequestMapping(value="/getMerGasStatistical",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询商户油站统计") @ApiOperation(value = "查询商户油站统计")
@ -271,8 +274,7 @@ public class HighGasController {
} }
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
// return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getGasOrderList(param))); return ResponseMsgUtil.success(new PageInfo<>(gasOrderService.getGasOrderList(param)));
return ResponseMsgUtil.success(null);
} catch (Exception e) { } catch (Exception e) {
log.error("HighGasController -> getGasOrderList() error!",e); log.error("HighGasController -> getGasOrderList() error!",e);
@ -418,7 +420,7 @@ public class HighGasController {
param.put("createTimeE", createTimeE); param.put("createTimeE", createTimeE);
if (status == null) { if (status == null) {
param.put("status", "2,3,4,6,7"); param.put("status", "2,4,5,6");
} else { } else {
param.put("status", status); param.put("status", status);
} }
@ -590,7 +592,7 @@ public class HighGasController {
public ResponseData getGasOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { public ResponseData getGasOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) {
try { try {
return ResponseMsgUtil.success(highOrderService.getGasOrderDetail(orderNo)); return ResponseMsgUtil.success(gasOrderService.getDetailByOrderNo(orderNo));
} catch (Exception e) { } catch (Exception e) {
log.error("HighGasController -> getGasOrderDetail() error!",e); log.error("HighGasController -> getGasOrderDetail() error!",e);

@ -1094,20 +1094,20 @@ public interface HighOrderMapperExt {
@Select({ @Select({
"<script> " + "<script> " +
" select" + " select" +
" case when sum(b.gas_refuel_price) is not null then sum(b.gas_refuel_price) else 0 end refuelPrice," + " case when sum(a.gas_refuel_price) is not null then sum(a.gas_refuel_price) else 0 end refuelPrice," +
" count(1) refuelNum," + " count(1) refuelNum," +
" case when sum(a.gas_oil_liters) is not null then sum(a.gas_oil_liters) else 0 end refuelLiters" + " case when sum(a.gas_oil_liters) is not null then sum(a.gas_oil_liters) else 0 end refuelLiters" +
" from high_gas_order a" + " from high_gas_order a" +
" where " + " where 1 = 1" +
" <if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" + " <if test='param.storeId != null'> and store_id in (${param.storeId}) </if>" +
" <if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" + " <if test='param.gasStaffId != null'> and gas_staff_id = #{param.gasStaffId}</if>" +
" <if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" + " <if test='param.gasOilNo != null'> and gas_oil_no = #{param.gasOilNo}</if>" +
" <if test='param.status != null'> and b.order_status in (${param.status} )</if>" + " <if test='param.status != null'> and status in (${param.status} )</if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>", " <if test='param.createTimeS != null'> <![CDATA[ and create_time >= #{param.createTimeS} ]]> </if>",
" <if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>", " <if test='param.createTimeE != null'> <![CDATA[ and create_time <= #{param.createTimeE} ]]> </if>",
" <if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>", " <if test='param.payTimeS != null'> <![CDATA[ and pay_time >= #{param.payTimeS} ]]> </if>",
" <if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>", " <if test='param.payTimeE != null'> <![CDATA[ and pay_time <= #{param.payTimeE} ]]> </if>",
" <if test='param.orderNo != null'> and b.order_no LIKE concat('%', #{param.orderNo}, '%')</if>" + " <if test='param.orderNo != null'> and order_no LIKE concat('%', #{param.orderNo}, '%')</if>" +
" ORDER BY create_time desc" + " ORDER BY create_time desc" +
"</script>" "</script>"
}) })

@ -9,9 +9,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.*;
import java.util.List; import java.util.stream.Collectors;
import java.util.Map; import java.util.stream.IntStream;
/** /**
* @className: HighGasOrderServiceImpl * @className: HighGasOrderServiceImpl
@ -126,8 +126,11 @@ public class HighGasOrderServiceImpl implements HighGasOrderService {
criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType")); criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType"));
} }
if (MapUtils.getInteger(param, "status") != null) { if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()
.collect(Collectors.toList());
criteria.andStatusIn(status);
} }
if (MapUtils.getLong(param, "createTimeS") != null) { if (MapUtils.getLong(param, "createTimeS") != null) {

Loading…
Cancel
Save