|
|
|
@ -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()); |
|
|
|
|