|
@@ -1,13 +1,18 @@
|
|
package com.fs.hisStore.controller;
|
|
package com.fs.hisStore.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.fs.common.annotation.Log;
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.TimeUtils;
|
|
import com.fs.common.utils.TimeUtils;
|
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.framework.web.service.TokenService;
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
|
+import com.fs.hisStore.domain.SysOperLogScrm;
|
|
import com.fs.hisStore.param.FsStoreStatisticsParam;
|
|
import com.fs.hisStore.param.FsStoreStatisticsParam;
|
|
import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
import com.fs.hisStore.service.IFsStorePaymentScrmService;
|
|
import com.fs.hisStore.service.IFsStorePaymentScrmService;
|
|
@@ -129,7 +134,7 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
timeEntityView.setOrderType(param.getOrderType());
|
|
timeEntityView.setOrderType(param.getOrderType());
|
|
timeEntityView.setOrderMedium(param.getOrderMedium());
|
|
timeEntityView.setOrderMedium(param.getOrderMedium());
|
|
|
|
|
|
- Map<String,Object> mapView = timeEntity.toMap();
|
|
|
|
|
|
+ Map<String,Object> mapView = timeEntityView.toMap();
|
|
mapView.put("queryType",param.getQueryType());
|
|
mapView.put("queryType",param.getQueryType());
|
|
mapView.put("amountType",param.getAmountType());
|
|
mapView.put("amountType",param.getAmountType());
|
|
// 统计图返回值
|
|
// 统计图返回值
|
|
@@ -145,6 +150,55 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("companyTableData",companyTableData).put("deptTableData",deptTableData).put("userTableData",userTableData);
|
|
return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("companyTableData",companyTableData).put("deptTableData",deptTableData).put("userTableData",userTableData);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 商品统计导出
|
|
|
|
+ * @Param:
|
|
|
|
+ * @Return:
|
|
|
|
+ * @Author xgb
|
|
|
|
+ * @Date 2025/9/24 18:03
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ public AjaxResult export(FsStoreStatisticsParam param)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ TimeUtils.TimeEntity timeEntity=TimeUtils.parseTimeTwo(param.getType()==null?null:param.getType().toString(),param.getStartTime(),param.getEndTime());
|
|
|
|
+ // 判断 员工是否为空
|
|
|
|
+ timeEntity.setCompanyUserId(param.getCompanyUserId());
|
|
|
|
+ timeEntity.setCompanyId(param.getCompanyId());
|
|
|
|
+ timeEntity.setDeptId(param.getDeptId());
|
|
|
|
+ timeEntity.setOrderType(param.getOrderType());
|
|
|
|
+ timeEntity.setOrderMedium(param.getOrderMedium());
|
|
|
|
+
|
|
|
|
+ Map<String,Object> map = timeEntity.toMap();
|
|
|
|
+ map.put("queryType",param.getQueryType());
|
|
|
|
+ map.put("amountType",param.getAmountType());
|
|
|
|
+
|
|
|
|
+ List<FsStoreOrderCountsVO> tableData;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String sheetName;
|
|
|
|
+ switch (param.getSummaryType()){
|
|
|
|
+ case 1: // 员工
|
|
|
|
+ tableData = storeOrderService.selectFsStoreOrderGroupByUserId(map);
|
|
|
|
+ sheetName = "商城订单统计-员工统计";
|
|
|
|
+ break;
|
|
|
|
+ case 2: // 部门
|
|
|
|
+ tableData = storeOrderService.selectFsStoreOrderGroupByDeptId(map);
|
|
|
|
+ sheetName = "商城订单统计-员工统计";
|
|
|
|
+ break;
|
|
|
|
+ case 3: // 公司
|
|
|
|
+ tableData = storeOrderService.selectFsStoreOrderGroupByCompanyId(map);
|
|
|
|
+ sheetName = "商城订单统计-员工统计";
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ throw new RuntimeException("参数错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExcelUtil<FsStoreOrderCountsVO> util = new ExcelUtil<>(FsStoreOrderCountsVO.class);
|
|
|
|
+ return util.exportExcel(tableData, sheetName);
|
|
|
|
+ }
|
|
|
|
+
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:storeProduct')")
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:storeProduct')")
|
|
@GetMapping("/storeProduct")
|
|
@GetMapping("/storeProduct")
|
|
public R storeProduct(FsStoreStatisticsParam param)
|
|
public R storeProduct(FsStoreStatisticsParam param)
|