|
@@ -27,6 +27,7 @@ import com.leromro.core.service.IVolunteerInfoService;
|
|
|
import com.leromro.framework.web.domain.server.Sys;
|
|
|
import com.leromro.system.mapper.SysUserMapper;
|
|
|
import com.leromro.system.service.ISysDeptService;
|
|
|
+import com.leromro.system.service.impl.SysConfigServiceImpl;
|
|
|
import com.leromro.system.service.impl.SysUserServiceImpl;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -73,8 +74,11 @@ public class OrgStatDataController extends BaseController {
|
|
|
private final ISysDeptService deptService;
|
|
|
|
|
|
private final SysUserServiceImpl sysUserServiceImpl;
|
|
|
+
|
|
|
private final SysUserMapper sysUserMapper;
|
|
|
|
|
|
+ private final SysConfigServiceImpl sysConfigService;
|
|
|
+
|
|
|
/**
|
|
|
* 订单总览
|
|
|
*/
|
|
@@ -88,16 +92,28 @@ public class OrgStatDataController extends BaseController {
|
|
|
dto.setDeptId(SecurityUtils.getDeptId());
|
|
|
}
|
|
|
LocalDate today = LocalDate.now();
|
|
|
+ int orderTotal = Integer.parseInt(sysConfigService.selectConfigByKey("orderTotal"));
|
|
|
+ int orderRefund = Integer.parseInt(sysConfigService.selectConfigByKey("orderRefund"));
|
|
|
+ int orderFinish = Integer.parseInt(sysConfigService.selectConfigByKey("yesterdayOrderFinish"));
|
|
|
+ String totalOrderMoney = sysConfigService.selectConfigByKey("totalOrderMoney");
|
|
|
switch (dto.getPageType()) {
|
|
|
case "1":
|
|
|
//昨天
|
|
|
dto.setStartDate(today.minusDays(1));
|
|
|
dto.setEndDate(today);
|
|
|
+ orderTotal = Integer.parseInt(sysConfigService.selectConfigByKey("yesterdayOrderTotal"));
|
|
|
+ orderRefund = Integer.parseInt(sysConfigService.selectConfigByKey("yesterdayOrderRefund"));
|
|
|
+ orderFinish = Integer.parseInt(sysConfigService.selectConfigByKey("yesterdayOrderFinish"));
|
|
|
+ totalOrderMoney = sysConfigService.selectConfigByKey("yesterdayTotalOrderMoney");
|
|
|
break;
|
|
|
case "2":
|
|
|
//今天
|
|
|
dto.setStartDate(today);
|
|
|
dto.setEndDate(today.plusDays(1));
|
|
|
+ orderTotal = Integer.parseInt(sysConfigService.selectConfigByKey("todayOrderTotal"));
|
|
|
+ orderRefund = Integer.parseInt(sysConfigService.selectConfigByKey("todayOrderRefund"));
|
|
|
+ orderFinish = Integer.parseInt(sysConfigService.selectConfigByKey("todayOrderFinish"));
|
|
|
+ totalOrderMoney = sysConfigService.selectConfigByKey("todayTotalOrderMoney");
|
|
|
break;
|
|
|
case "3":
|
|
|
//本月
|
|
@@ -107,17 +123,22 @@ public class OrgStatDataController extends BaseController {
|
|
|
dto.setEndDate(lastDayOfMonth);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+ if (!sysDept.getAreaType().equals("0")){
|
|
|
+ orderTotal = 0;
|
|
|
+ orderRefund = 0;
|
|
|
+ orderFinish = 0;
|
|
|
+ totalOrderMoney = "0";
|
|
|
+ }
|
|
|
//获取指定时间范围的订单
|
|
|
List<SecondOrder> list = secondOrderService.getCurrentOrgSecondOrderList(dto);
|
|
|
//订单总量
|
|
|
- orderSummaryVO.setOrderTotal(list.size());
|
|
|
+ orderSummaryVO.setOrderTotal(list.size()+orderTotal);
|
|
|
//取消单量
|
|
|
- orderSummaryVO.setOrderCancelTotal((int) list.stream().filter(item -> "4".equals(item.getOrderStatus())).count());
|
|
|
+ orderSummaryVO.setOrderCancelTotal((int) list.stream().filter(item -> "4".equals(item.getOrderStatus())).count()+orderRefund);
|
|
|
//订单金额
|
|
|
- orderSummaryVO.setOrderTotalAmount(BigDecimal.valueOf(list.stream().mapToDouble(item -> item.getServiceTotalPrice().doubleValue()).sum()));
|
|
|
+ orderSummaryVO.setOrderTotalAmount(BigDecimal.valueOf(list.stream().mapToDouble(item -> item.getServiceTotalPrice().doubleValue()).sum()).add(new BigDecimal(totalOrderMoney)));
|
|
|
//完成单量
|
|
|
- orderSummaryVO.setOrderFinishTotal((int) list.stream().filter(item -> "2".equals(item.getOrderStatus())).count());
|
|
|
+ orderSummaryVO.setOrderFinishTotal((int) list.stream().filter(item -> "2".equals(item.getOrderStatus())).count()+orderFinish);
|
|
|
return R.ok(orderSummaryVO);
|
|
|
}
|
|
|
|
|
@@ -127,6 +148,12 @@ public class OrgStatDataController extends BaseController {
|
|
|
@ApiOperation(value = "人员总览", notes = "前端传入人员类型")
|
|
|
@PostMapping("/userSummary")
|
|
|
public R<UserSummaryVO> userSummary(@RequestBody HomePageDTO dto) {
|
|
|
+ try{
|
|
|
+
|
|
|
+
|
|
|
+ }catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
UserSummaryVO userSummaryVO = new UserSummaryVO();
|
|
|
//判断人员类型是否有值
|
|
|
if (ObjectUtil.isNull(dto.getUserType())) {
|