Commit b38e297f by songyinghui

feat: 商品导出库存数据

parent 3d6314fb
package com.gic.haoban.manage.web.controller.content;
import cn.hutool.core.date.DateUtil;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO;
import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO;
......@@ -14,11 +19,14 @@ import com.gic.haoban.manage.web.vo.content.statistics.MaterialIndexDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialRealDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
......@@ -43,8 +51,30 @@ public class MaterialDataStaticsController {
@RequestMapping(path = "/content/material/index/data")
public RestResponse<MaterialIndexDataVO> queryMaterialIndexData(@RequestBody ContentMaterialBaseQO contentMaterialBaseQO) {
ContentMaterialPageFrontQDTO search = new ContentMaterialPageFrontQDTO();
search.setEnterpriseId(contentMaterialBaseQO.getEnterpriseId());
search.setPublishBeginStartTime(DateUtil.beginOfDay(new Date()));
search.setPublishBeginEndTime(DateUtil.endOfDay(new Date()));
if (StringUtils.isBlank(contentMaterialBaseQO.getStoreId())) {
// 区经 获取管辖的权限
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialBaseQO.getClerkId(), contentMaterialBaseQO.getWxEnterpriseId());
search.setStoreIdList(storeIds);
} else {
search.setStoreIdList(Collections.singletonList(contentMaterialBaseQO.getStoreId()));
}
BasePageInfo pageInfo = new BasePageInfo();
pageInfo.setPageNum(1);
pageInfo.setPageSize(1);
int totalMaterialNum = 0;
ServiceResponse<Page<ContentMaterialFrontDTO>> serviceResponse = this.contentMaterialApiService.pageMaterialFront(search, pageInfo);
if (serviceResponse.isSuccess()) {
totalMaterialNum = serviceResponse.getResult().getTotalCount();
}
List<String> storeIds = clerkStoreAdaptor.queryClerkStoreIds(contentMaterialBaseQO.getClerkId(), contentMaterialBaseQO.getWxEnterpriseId());
MaterialIndexDataVO indexDataVO = MaterialIndexDataVO.builder()
.newMaterialNum(totalMaterialNum)
.storeManagerNum(storeIds.size())
.build();
......
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