|
@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -182,10 +183,17 @@ public class CompanyStatisticsController extends BaseController
|
|
|
timeList.add(beginTime);
|
|
|
beginTime = TimeUtils.formatTime(beginTime);
|
|
|
}
|
|
|
- List<JSONObject> jsonObjectList = storeOrderService.selectFsPackageOrderCounts(timeEntity.toMap());
|
|
|
+ Map<String, Object> map = timeEntity.toMap();
|
|
|
+ if (StringUtils.isNotBlank(param.getStartTime())){
|
|
|
+ map.put("startTime",param.getStartTime());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(param.getEndTime())){
|
|
|
+ map.put("endTime",param.getEndTime());
|
|
|
+ }
|
|
|
+ List<JSONObject> jsonObjectList = storeAfterSalesService.selectFsStoreAfterSales(map);
|
|
|
List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
|
|
|
List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
|
|
|
- List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
|
|
|
+ List<BigDecimal> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getBigDecimal("payPrice")).collect(Collectors.toList());
|
|
|
return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice);
|
|
|
}
|
|
|
else {
|
|
@@ -291,6 +299,32 @@ public class CompanyStatisticsController extends BaseController
|
|
|
return util.exportExcel(list, "orderLogs");
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/exportAfterSalesOrder")
|
|
|
+ public AjaxResult exportAfterSalesOrder(FsStoreStatisticsParam param)
|
|
|
+ {
|
|
|
+ if(StringUtils.isNotEmpty(param.getUserIds())){
|
|
|
+ String[] userIds=param.getUserIds().split(",");
|
|
|
+ Long[] ids=new Long[userIds.length];
|
|
|
+ for(int i=0;i<ids.length; i++){
|
|
|
+ ids[i]=Long.parseLong(userIds[i]);
|
|
|
+ }
|
|
|
+ param.setUsers(ids);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //获取所有员工
|
|
|
+ CompanyUser usermap=new CompanyUser();
|
|
|
+ usermap.setDeptId(param.getDeptId());
|
|
|
+ List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
+ List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
+ param.setUsers(userIds.toArray(new Long[userIds.size()]));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FsStoreOrderStatisticsVO> list= storeAfterSalesService.selectFsStoreAfterSalesServiceStatisticsList(param);
|
|
|
+
|
|
|
+ ExcelUtil<FsStoreOrderStatisticsVO> util = new ExcelUtil<FsStoreOrderStatisticsVO>(FsStoreOrderStatisticsVO.class);
|
|
|
+ return util.exportExcel(list, "orderLogs");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping("/exportInquiryOrder")
|
|
|
public AjaxResult exportInquiryOrder(FsStoreStatisticsParam param)
|