Commit 3d6314fb by songyinghui

feat: 周期性测试

parent 996fbd1f
......@@ -496,6 +496,8 @@ public class GroupMessageServiceImpl implements GroupMessageService {
*/
@Override
public List<String> hasMaterialRightEnterprise() {
return Collections.emptyList();
return Collections.singletonList("ff8080815dacd3a2015dacd3ef5c0000");
// return Collections.emptyList();
}
}
......@@ -17,6 +17,7 @@ import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.content.api.service.ContentMaterialShareApiService;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentColumnClerkViewQO;
import com.gic.haoban.manage.web.qo.content.ContentMaterialQO;
......@@ -57,7 +58,7 @@ public class ContentMaterialController {
private ContentMaterialShareApiService contentMaterialShareApiService;
@Autowired
private StaffApiService staffApiService;
private ClerkStoreAdaptor clerkStoreAdaptor;
@Autowired
private GoodsInfoAdaptor goodsInfoAdaptor;
......@@ -73,7 +74,7 @@ public class ContentMaterialController {
List<String> storeIdList = new ArrayList<>();
if (StringUtils.isBlank(storeId)) {
// 区经 获取管辖的权限
List<String> storeIds = this.queryClerkStoreIds(clerkId, wxEnterpriseId);
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(clerkId, wxEnterpriseId);
storeIdList.addAll(storeIds);
} else {
storeIdList.add(storeId);
......@@ -113,7 +114,7 @@ public class ContentMaterialController {
}
if (StringUtils.isBlank(contentMaterialQO.getStoreId())) {
// 区经 获取管辖的权限
List<String> storeIds = this.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId());
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId());
contentMaterialPageFrontQDTO.setStoreIdList(storeIds);
} else {
contentMaterialPageFrontQDTO.setStoreIdList(Collections.singletonList(contentMaterialQO.getStoreId()));
......@@ -226,25 +227,4 @@ public class ContentMaterialController {
return RestResponse.successResult();
}
/**
* 查询区经角色下管辖的门店权限
*
* @param clerkId
* @param wxEnterpriseId
* @return
*/
public List<String> queryClerkStoreIds(String clerkId, String wxEnterpriseId) {
List<String> storeIds = staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(storeIds)) {
log.info("根据区经id查询管辖的门店为空 {} {}", clerkId, wxEnterpriseId);
return Collections.singletonList("-100");
}
if (storeIds.size() == 1 && StringUtils.equals(storeIds.get(0), "-1")) {
// 全部门店权限
log.info("区经有全部门店权限 {}", clerkId);
return Collections.emptyList();
}
return storeIds;
}
}
......@@ -2,6 +2,8 @@ package com.gic.haoban.manage.web.controller.content;
import com.gic.api.base.commons.Page;
import com.gic.commons.webapi.reponse.RestResponse;
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;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialPersonalUsedQO;
......@@ -12,10 +14,13 @@ 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.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.List;
/**
* 素材-好办数据统计
**/
......@@ -23,6 +28,11 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class MaterialDataStaticsController {
@Autowired
private ClerkStoreAdaptor clerkStoreAdaptor;
@Autowired
private ContentMaterialApiService contentMaterialApiService;
/**
* 获取素材首页数据
......@@ -32,7 +42,13 @@ public class MaterialDataStaticsController {
*/
@RequestMapping(path = "/content/material/index/data")
public RestResponse<MaterialIndexDataVO> queryMaterialIndexData(@RequestBody ContentMaterialBaseQO contentMaterialBaseQO) {
return RestResponse.successResult();
List<String> storeIds = clerkStoreAdaptor.queryClerkStoreIds(contentMaterialBaseQO.getClerkId(), contentMaterialBaseQO.getWxEnterpriseId());
MaterialIndexDataVO indexDataVO = MaterialIndexDataVO.builder()
.storeManagerNum(storeIds.size())
.build();
return RestResponse.successResult(indexDataVO);
}
......
package com.gic.haoban.manage.web.controller.content.adaptor;
import com.gic.haoban.manage.api.service.StaffApiService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
/**
* @Author MUSI
* @Date 2023/3/25 10:29 PM
* @Description
* @Version
**/
@Slf4j
@Component
public class ClerkStoreAdaptor {
@Autowired
private StaffApiService staffApiService;
/**
* 查询区经角色下管辖的门店权限
*
* @param clerkId
* @param wxEnterpriseId
* @return
*/
public List<String> queryClerkStoreIds(String clerkId, String wxEnterpriseId) {
List<String> storeIds = staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(storeIds)) {
log.info("根据区经id查询管辖的门店为空 {} {}", clerkId, wxEnterpriseId);
return Collections.singletonList("-100");
}
if (storeIds.size() == 1 && StringUtils.equals(storeIds.get(0), "-1")) {
// 全部门店权限
log.info("区经有全部门店权限 {}", clerkId);
return Collections.emptyList();
}
return storeIds;
}
}
package com.gic.haoban.manage.web.vo.content.statistics;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
......@@ -9,6 +12,8 @@ import java.io.Serializable;
* @Version
* 好办素材首页数据统计
**/
@Data
@Builder
public class MaterialIndexDataVO implements Serializable {
private static final long serialVersionUID = 7362625836544624683L;
......@@ -33,35 +38,8 @@ public class MaterialIndexDataVO implements Serializable {
*/
private Integer newMaterialNum;
public Integer getUseMaterialClerkNum() {
return useMaterialClerkNum;
}
public void setUseMaterialClerkNum(Integer useMaterialClerkNum) {
this.useMaterialClerkNum = useMaterialClerkNum;
}
public Integer getUnUseMaterialClerkNum() {
return unUseMaterialClerkNum;
}
public void setUnUseMaterialClerkNum(Integer unUseMaterialClerkNum) {
this.unUseMaterialClerkNum = unUseMaterialClerkNum;
}
public String getConversionAmount() {
return conversionAmount;
}
public void setConversionAmount(String conversionAmount) {
this.conversionAmount = conversionAmount;
}
public Integer getNewMaterialNum() {
return newMaterialNum;
}
public void setNewMaterialNum(Integer newMaterialNum) {
this.newMaterialNum = newMaterialNum;
}
/**
* 管辖门店数量
*/
private Integer storeManagerNum;
}
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