|
|
@ -111,41 +111,80 @@ public class HighGasController { |
|
|
|
Map<String, Object> param = new HashMap<>();; |
|
|
|
Map<String, Object> param = new HashMap<>();; |
|
|
|
param.put("gasName", userInfoModel.getMerchantStore().getStoreName()); |
|
|
|
param.put("gasName", userInfoModel.getMerchantStore().getStoreName()); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> history = new HashMap<>(); |
|
|
|
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType()) |
|
|
|
// 历史加油总金额
|
|
|
|
&& userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) { |
|
|
|
Map<String, Object> historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); |
|
|
|
|
|
|
|
history.put("totalPrice", historyTotal.get("price")); |
|
|
|
Map<String, Object> history = new HashMap<>(); |
|
|
|
history.put("totalCount", historyTotal.get("count")); |
|
|
|
// 历史加油总金额
|
|
|
|
|
|
|
|
Map<String, Object> historyTotal = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7"); |
|
|
|
// 历史加油金额
|
|
|
|
history.put("totalPrice", historyTotal.get("price")); |
|
|
|
Map<String, Object> historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); |
|
|
|
history.put("totalCount", historyTotal.get("count")); |
|
|
|
history.put("incomePrice", historyIncomet.get("price")); |
|
|
|
|
|
|
|
history.put("incomeCount", historyIncomet.get("count")); |
|
|
|
// 历史加油金额
|
|
|
|
|
|
|
|
Map<String, Object> historyIncomet = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7"); |
|
|
|
// 历史退款
|
|
|
|
history.put("incomePrice", historyIncomet.get("price")); |
|
|
|
Map<String, Object> historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4"); |
|
|
|
history.put("incomeCount", historyIncomet.get("count")); |
|
|
|
history.put("refundPrice", historyRefund.get("price")); |
|
|
|
|
|
|
|
history.put("refundCount", historyRefund.get("count")); |
|
|
|
// 历史退款
|
|
|
|
param.put("history", history); |
|
|
|
Map<String, Object> historyRefund = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "4"); |
|
|
|
|
|
|
|
history.put("refundPrice", historyRefund.get("price")); |
|
|
|
|
|
|
|
history.put("refundCount", historyRefund.get("count")); |
|
|
|
Map<String, Object> today = new HashMap<>(); |
|
|
|
param.put("history", history); |
|
|
|
// 今日加油总金额
|
|
|
|
|
|
|
|
Map<String, Object> todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); |
|
|
|
|
|
|
|
today.put("totalPrice", todayTotal.get("price")); |
|
|
|
Map<String, Object> today = new HashMap<>(); |
|
|
|
today.put("totalCount", todayTotal.get("count")); |
|
|
|
// 今日加油总金额
|
|
|
|
|
|
|
|
Map<String, Object> todayTotal = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7"); |
|
|
|
// 今日加油金额
|
|
|
|
today.put("totalPrice", todayTotal.get("price")); |
|
|
|
Map<String, Object> todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); |
|
|
|
today.put("totalCount", todayTotal.get("count")); |
|
|
|
today.put("incomePrice", todayIncomet.get("price")); |
|
|
|
|
|
|
|
today.put("incomeCount", todayIncomet.get("count")); |
|
|
|
// 今日加油金额
|
|
|
|
|
|
|
|
Map<String, Object> todayIncomet = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7"); |
|
|
|
// 今日退款
|
|
|
|
today.put("incomePrice", todayIncomet.get("price")); |
|
|
|
Map<String, Object> todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4"); |
|
|
|
today.put("incomeCount", todayIncomet.get("count")); |
|
|
|
today.put("refundPrice", todayRefund.get("price")); |
|
|
|
|
|
|
|
today.put("refundCount", todayRefund.get("count")); |
|
|
|
// 今日退款
|
|
|
|
param.put("today", today); |
|
|
|
Map<String, Object> todayRefund = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "4"); |
|
|
|
|
|
|
|
today.put("refundPrice", todayRefund.get("price")); |
|
|
|
|
|
|
|
today.put("refundCount", todayRefund.get("count")); |
|
|
|
|
|
|
|
param.put("today", today); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Map<String, Object> history = new HashMap<>(); |
|
|
|
|
|
|
|
// 历史加油总金额
|
|
|
|
|
|
|
|
Map<String, Object> historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); |
|
|
|
|
|
|
|
history.put("totalPrice", historyTotal.get("price")); |
|
|
|
|
|
|
|
history.put("totalCount", historyTotal.get("count")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 历史加油金额
|
|
|
|
|
|
|
|
Map<String, Object> historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); |
|
|
|
|
|
|
|
history.put("incomePrice", historyIncomet.get("price")); |
|
|
|
|
|
|
|
history.put("incomeCount", historyIncomet.get("count")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 历史退款
|
|
|
|
|
|
|
|
Map<String, Object> historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4"); |
|
|
|
|
|
|
|
history.put("refundPrice", historyRefund.get("price")); |
|
|
|
|
|
|
|
history.put("refundCount", historyRefund.get("count")); |
|
|
|
|
|
|
|
param.put("history", history); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> today = new HashMap<>(); |
|
|
|
|
|
|
|
// 今日加油总金额
|
|
|
|
|
|
|
|
Map<String, Object> todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7"); |
|
|
|
|
|
|
|
today.put("totalPrice", todayTotal.get("price")); |
|
|
|
|
|
|
|
today.put("totalCount", todayTotal.get("count")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 今日加油金额
|
|
|
|
|
|
|
|
Map<String, Object> todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7"); |
|
|
|
|
|
|
|
today.put("incomePrice", todayIncomet.get("price")); |
|
|
|
|
|
|
|
today.put("incomeCount", todayIncomet.get("count")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 今日退款
|
|
|
|
|
|
|
|
Map<String, Object> todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4"); |
|
|
|
|
|
|
|
today.put("refundPrice", todayRefund.get("price")); |
|
|
|
|
|
|
|
today.put("refundCount", todayRefund.get("count")); |
|
|
|
|
|
|
|
param.put("today", today); |
|
|
|
|
|
|
|
} |
|
|
|
return ResponseMsgUtil.success(param); |
|
|
|
return ResponseMsgUtil.success(param); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -159,6 +198,7 @@ public class HighGasController { |
|
|
|
@ApiOperation(value = "查询油站订单列表") |
|
|
|
@ApiOperation(value = "查询油站订单列表") |
|
|
|
public ResponseData getGasOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
public ResponseData getGasOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
@RequestParam(name = "storeId", required = false) Long storeId, |
|
|
|
@RequestParam(name = "storeId", required = false) Long storeId, |
|
|
|
|
|
|
|
@RequestParam(name = "staffId", required = false) Long staffId, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
|
|
@ -170,7 +210,7 @@ public class HighGasController { |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, Object> param = new HashMap<>();; |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
|
|
|
|
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
|
|
|
|
if (userInfoModel.getSecUser().getObjectType().equals(2)) { |
|
|
|
if (userInfoModel.getSecUser().getObjectType().equals(2)) { |
|
|
|
if (storeId != null) { |
|
|
|
if (storeId != null) { |
|
|
@ -191,15 +231,20 @@ public class HighGasController { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
param.put("storeId", 0); |
|
|
|
param.put("storeId", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
param.put("gasStaffId", staffId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) { |
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) { |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
|
|
|
|
param.put("gasStaffId", staffId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) { |
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) { |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
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 { |
|
|
|
} else { |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
@ -260,6 +305,7 @@ public class HighGasController { |
|
|
|
@ApiOperation(value = "导出油站订单") |
|
|
|
@ApiOperation(value = "导出油站订单") |
|
|
|
public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
@RequestParam(name = "storeId", required = false) Long storeId, |
|
|
|
@RequestParam(name = "storeId", required = false) Long storeId, |
|
|
|
|
|
|
|
@RequestParam(name = "staffId", required = false) Long staffId, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE) { |
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE) { |
|
|
@ -290,20 +336,24 @@ public class HighGasController { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
param.put("storeId", 0); |
|
|
|
param.put("storeId", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
param.put("gasStaffId", staffId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) { |
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) { |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
|
|
|
|
param.put("gasStaffId", staffId); |
|
|
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) { |
|
|
|
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) { |
|
|
|
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
|
|
|
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 { |
|
|
|
} else { |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
log.error("HighGasController -> disabledOil() error!",""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("createTimeS", createTimeS); |
|
|
|
param.put("createTimeS", createTimeS); |
|
|
|
param.put("createTimeE", createTimeE); |
|
|
|
param.put("createTimeE", createTimeE); |
|
|
@ -317,6 +367,7 @@ public class HighGasController { |
|
|
|
List<String> headList = new ArrayList<>(); |
|
|
|
List<String> headList = new ArrayList<>(); |
|
|
|
headList.add("订单号"); |
|
|
|
headList.add("订单号"); |
|
|
|
headList.add("油站名称"); |
|
|
|
headList.add("油站名称"); |
|
|
|
|
|
|
|
headList.add("加油员"); |
|
|
|
headList.add("油品类型"); |
|
|
|
headList.add("油品类型"); |
|
|
|
headList.add("油品油号"); |
|
|
|
headList.add("油品油号"); |
|
|
|
headList.add("油枪号"); |
|
|
|
headList.add("油枪号"); |
|
|
@ -337,6 +388,7 @@ public class HighGasController { |
|
|
|
data = new ArrayList<>(); |
|
|
|
data = new ArrayList<>(); |
|
|
|
data.add(orderModel.getOrderNo()); |
|
|
|
data.add(orderModel.getOrderNo()); |
|
|
|
data.add(orderModel.getGasName()); |
|
|
|
data.add(orderModel.getGasName()); |
|
|
|
|
|
|
|
data.add(StringUtils.isNotBlank(orderModel.getGasStaffName())?orderModel.getGasStaffName():"未知"); |
|
|
|
data.add(orderModel.getGasOilType().equals("1") ? "汽油": "柴油"); |
|
|
|
data.add(orderModel.getGasOilType().equals("1") ? "汽油": "柴油"); |
|
|
|
data.add(orderModel.getGasOilNo() + "#"); |
|
|
|
data.add(orderModel.getGasOilNo() + "#"); |
|
|
|
data.add(orderModel.getGasGunNo() + "号"); |
|
|
|
data.add(orderModel.getGasGunNo() + "号"); |
|
|
@ -357,7 +409,7 @@ public class HighGasController { |
|
|
|
if (!file.exists()) { |
|
|
|
if (!file.exists()) { |
|
|
|
file.mkdirs(); |
|
|
|
file.mkdirs(); |
|
|
|
} |
|
|
|
} |
|
|
|
EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("油卡").doWrite(dataList); |
|
|
|
EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("加油订单").doWrite(dataList); |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(pathName); |
|
|
|
return ResponseMsgUtil.success(pathName); |
|
|
|
|
|
|
|
|
|
|
|