提交代码

dev-discount
胡锐 2 years ago
parent f6896767fe
commit ad4033e426
  1. 87
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 26
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  3. 8
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  4. 23
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -200,8 +200,11 @@ public class HighGasController {
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "staffId", required = false) Long staffId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "oilNo", required = false) Integer oilNo,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@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 {
@ -250,8 +253,11 @@ public class HighGasController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("orderNo", orderNo);
param.put("gasOilNo", oilNo);
param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE);
param.put("payTimeS", payTimeS);
param.put("payTimeE", payTimeE);
if (status == null) {
param.put("status", "2,3,4,6,7");
@ -268,6 +274,85 @@ public class HighGasController {
}
}
@RequestMapping(value="/countGasOrder",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "统计加油订单")
public ResponseData countGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "staffId", required = false) Long staffId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "oilNo", required = false) Integer oilNo,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@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 {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> param = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) {
if (storeId != null) {
param.put("storeId", storeId);
} else {
String storeIdStr = "";
List<HighMerchantStore> storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId());
for (HighMerchantStore store : storeList) {
if (StringUtils.isBlank(storeIdStr)) {
storeIdStr += store.getId().toString();
} else {
storeIdStr += "," + store.getId().toString();
}
}
if (StringUtils.isNotBlank(storeIdStr)) {
param.put("storeId", storeIdStr);
} else {
param.put("storeId", 0);
}
}
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
}
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) {
param.put("gasStaffId", userInfoModel.getGasStaff().getId());
}
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("orderNo", orderNo);
param.put("gasOilNo", oilNo);
param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE);
param.put("payTimeS", payTimeS);
param.put("payTimeE", payTimeE);
if (status == null) {
param.put("status", "2,3,4,6,7");
} else {
param.put("status", status);
}
return ResponseMsgUtil.success(highOrderService.countGasOrder(param));
} catch (Exception e) {
log.error("HighGasController -> countGasOrder() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasOrderCount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站订单列表")
@ -684,7 +769,7 @@ public class HighGasController {
if (store.getSourceType().equals(1)) {
if (order.getPayType() == 2) {
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice());
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getAccountMerchantNum(), order.getPayRealPrice());
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setOrderStatus(4);
order.setRefundTime(new Date());

@ -1185,12 +1185,38 @@ public interface HighOrderMapperExt {
" and goods_type = 3 " +
"<if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
"<if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
"<if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" +
"<if test='param.status != null'> and b.order_status in (${param.status})</if>" +
"<if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>",
"<if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </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>",
"<if test='param.orderNo != null'> and b.order_no LIKE concat('%', #{param.orderNo}, '%')</if>" +
" ORDER BY create_time desc" +
"</script>"
})
List<GasOrderModel> selectGasStoreOrderList(@Param("param") Map<String, Object> param);
@Select({
"<script> " +
" select" +
" sum(b.total_price) refuelPrice," +
" count(1) refuelNum," +
" sum(a.gas_oil_liters) refuelLiters",
" from high_child_order a,high_order b " +
" where a.order_id = b.id " +
" and goods_type = 3 " +
" <if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
" <if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
" <if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" +
" <if test='param.status != null'> and b.order_status in (${param.status})</if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>",
" <if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </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>",
" <if test='param.orderNo != null'> and b.order_no LIKE concat('%', #{param.orderNo}, '%')</if>" +
" ORDER BY create_time desc" +
"</script>"
})
Map<String, Object> countGasStoreOrder(@Param("param") Map<String, Object> param);
}

@ -457,6 +457,14 @@ public interface HighOrderService {
*/
List<GasOrderModel> getGasOrderList(Map<String, Object> param) throws Exception;
/**
* 统计加油站订单
* @param param
* @return
* @throws Exception
*/
Map<String, Object> countGasOrder(Map<String, Object> param) throws Exception;
/**
* 查询加油站订单列表
* @param orderNo

@ -1698,9 +1698,32 @@ public class HighOrderServiceImpl implements HighOrderService {
if (MapUtils.getLong(param, "createTimeE") != null) {
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(param, "payTimeS") != null) {
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(param, "payTimeE") != null) {
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
return highOrderMapperExt.selectGasStoreOrderList(param);
}
@Override
public Map<String, Object> countGasOrder(Map<String, Object> param) throws Exception {
if (MapUtils.getLong(param, "createTimeS") != null) {
param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(param, "createTimeE") != null) {
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(param, "payTimeS") != null) {
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(param, "payTimeE") != null) {
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
return highOrderMapperExt.countGasStoreOrder(param);
}
@Override
public GasOrderModel getGasOrderDetail(String orderNo) {
Map<String, Object> param = new HashMap<>();

Loading…
Cancel
Save