Commit 1bc6b334 by songyinghui

feat: 素材数据接口调整

parent f7c0113e
...@@ -28,7 +28,6 @@ import com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO; ...@@ -28,7 +28,6 @@ import com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO;
import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO; import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -210,8 +209,7 @@ public class MaterialDataStaticsController { ...@@ -210,8 +209,7 @@ public class MaterialDataStaticsController {
} }
Page<MaterialPersonalUsedDataVO> usedDataVOPage = Page<MaterialPersonalUsedDataVO> usedDataVOPage =
materialDataAdaptor.queryMaterialClerkUsedReport(materialReportQO.getEnterpriseId(), materialReportQO.getClerkId(), materialDataAdaptor.queryMaterialClerkUsedReport(materialReportQO, storeIds);
materialReportQO.getReportType(), storeIds, 1, 1, null, null);
if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) { if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) {
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -243,8 +241,7 @@ public class MaterialDataStaticsController { ...@@ -243,8 +241,7 @@ public class MaterialDataStaticsController {
} }
Page<MaterialStoreUsedDataVO> usedDataVOPage = Page<MaterialStoreUsedDataVO> usedDataVOPage =
materialDataAdaptor.queryMaterialStoreUseReport(materialReportQO.getEnterpriseId(), materialReportQO.getClerkId(), materialDataAdaptor.queryMaterialStoreUseReport(materialReportQO, storeIds);
materialReportQO.getReportType(), storeIds, 1, 1, null, null);
if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) { if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) {
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -274,7 +271,8 @@ public class MaterialDataStaticsController { ...@@ -274,7 +271,8 @@ public class MaterialDataStaticsController {
} else { } else {
storeIds.add(materialReportQO.getStoreId()); storeIds.add(materialReportQO.getStoreId());
} }
MaterialAreaUsedDataVO materialAreaUsedDataVO = materialDataAdaptor.queryMaterialAreaOverviewData(materialReportQO.getEnterpriseId(), materialReportQO.getClerkId(), materialReportQO.getReportType(), storeIds); MaterialAreaUsedDataVO materialAreaUsedDataVO = materialDataAdaptor.queryMaterialAreaOverviewData(materialReportQO.getEnterpriseId(),
materialReportQO.getClerkId(), materialReportQO.getReportType(), storeIds, materialReportQO.getBizDate());
return RestResponse.successResult(materialAreaUsedDataVO); return RestResponse.successResult(materialAreaUsedDataVO);
} }
...@@ -295,8 +293,7 @@ public class MaterialDataStaticsController { ...@@ -295,8 +293,7 @@ public class MaterialDataStaticsController {
} }
Page<MaterialPersonalUsedDataVO> usedDataVOPage = Page<MaterialPersonalUsedDataVO> usedDataVOPage =
materialDataAdaptor.queryMaterialClerkUsedReport(materialReportQO.getEnterpriseId(), materialReportQO.getClerkId(), materialDataAdaptor.queryMaterialClerkUsedReport(materialReportQO, storeIds);
materialReportQO.getReportType(), storeIds, 1, 1, materialReportQO.getOrderByField(), materialReportQO.getOrder());
if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) { if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) {
return RestResponse.successResult(); return RestResponse.successResult();
} }
...@@ -340,8 +337,7 @@ public class MaterialDataStaticsController { ...@@ -340,8 +337,7 @@ public class MaterialDataStaticsController {
} }
Page<MaterialStoreUsedDataVO> usedDataVOPage = Page<MaterialStoreUsedDataVO> usedDataVOPage =
materialDataAdaptor.queryMaterialStoreUseReport(materialReportQO.getEnterpriseId(), materialReportQO.getClerkId(), materialDataAdaptor.queryMaterialStoreUseReport(materialReportQO, storeIds);
materialReportQO.getReportType(), storeIds, 1, 1, materialReportQO.getOrderByField(), materialReportQO.getOrder());
if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) { if (usedDataVOPage == null || CollectionUtils.isEmpty(usedDataVOPage.getResult())) {
return RestResponse.successResult(); return RestResponse.successResult();
} }
......
...@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.enums.content.MaterialReportType; import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils; import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO; import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO; import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
...@@ -227,15 +228,17 @@ public class MaterialDataAdaptor { ...@@ -227,15 +228,17 @@ public class MaterialDataAdaptor {
/** /**
* 查询导购素材使用情况 * 查询导购素材使用情况
* *
* @param enterpriseId
* @param reportType
* @param storeIds * @param storeIds
* @return * @return
*/ */
public Page<MaterialPersonalUsedDataVO> queryMaterialClerkUsedReport(String enterpriseId, String clerkId, public Page<MaterialPersonalUsedDataVO> queryMaterialClerkUsedReport(MaterialReportQO materialReportQO, List<String> storeIds) {
Integer reportType, List<String> storeIds, Integer reportType = materialReportQO.getReportType();
Integer pageNo, Integer pageSize, Integer pageNo = materialReportQO.getPageNum();
String orderField, String orderStr) { Integer pageSize = materialReportQO.getPageSize();
String clerkId = materialReportQO.getClerkId();
String enterpriseId = materialReportQO.getEnterpriseId();
String orderField = materialReportQO.getOrderByField();
String orderStr = materialReportQO.getOrder();
// 获取当前时间周期 // 获取当前时间周期
DateTime startTime = null; DateTime startTime = null;
DateTime endTime = null; DateTime endTime = null;
...@@ -289,17 +292,18 @@ public class MaterialDataAdaptor { ...@@ -289,17 +292,18 @@ public class MaterialDataAdaptor {
/** /**
* 查询门店/区经使用数据 * 查询门店/区经使用数据
* *
* @param enterpriseId
* @param clerkId
* @param reportType
* @param storeIds * @param storeIds
* @return * @return
*/ */
public Page<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(String enterpriseId, String clerkId, public Page<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(MaterialReportQO materialReportQO, List<String> storeIds) {
Integer reportType, List<String> storeIds,
Integer pageNo, Integer pageSize, Integer reportType = materialReportQO.getReportType();
String orderField, String order) { Integer pageNo = materialReportQO.getPageNum();
Integer pageSize = materialReportQO.getPageSize();
String clerkId = materialReportQO.getClerkId();
String enterpriseId = materialReportQO.getEnterpriseId();
String orderField = materialReportQO.getOrderByField();
String order = materialReportQO.getOrder();
// 获取当前时间周期 // 获取当前时间周期
DateTime startTime = null; DateTime startTime = null;
DateTime endTime = null; DateTime endTime = null;
...@@ -357,12 +361,11 @@ public class MaterialDataAdaptor { ...@@ -357,12 +361,11 @@ public class MaterialDataAdaptor {
* @return * @return
*/ */
public MaterialAreaUsedDataVO queryMaterialAreaOverviewData(String enterpriseId, String clerkId, public MaterialAreaUsedDataVO queryMaterialAreaOverviewData(String enterpriseId, String clerkId,
Integer reportType, List<String> storeIds) { Integer reportType, List<String> storeIds, String bizDate) {
// 获取当前时间周期 // 获取当前时间周期
DateTime startTime = null; DateTime startTime = null;
DateTime endTime = null; DateTime endTime = null;
String bizDate = this.calcBizDate(reportType);
String apolloKey = MATERIAL_AREA_WEEK_DATA; String apolloKey = MATERIAL_AREA_WEEK_DATA;
if (MaterialReportType.WEEK.getCode().equals(reportType)) { if (MaterialReportType.WEEK.getCode().equals(reportType)) {
// 周报 // 周报
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment