Browse Source

渠道查询测试

master
huminghao 2 weeks ago
parent
commit
828f2a539c

+ 1
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/api/AgencyController.java View File



@ApiOperation(value = "查询所有启用渠道信息") @ApiOperation(value = "查询所有启用渠道信息")
@PostMapping(value = "/agencyqueryall") @PostMapping(value = "/agencyqueryall")
public ApiResponse<List<AgencyQueryAllModel> > agencyqueryall(@RequestBody @Valid AgencyQueryAllReqDTO reqDTO){
public ApiResponse<List<AgencyQueryAllModel> > agencyqueryall(@RequestBody @Valid AgencyQueryAllReqDTO reqDTO) throws ManagerException {
return ApiResponse.of(agencyManager.queryAll(reqDTO)); return ApiResponse.of(agencyManager.queryAll(reqDTO));
} }



+ 1
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyManager.java View File



List<StringKeyValue> listByNameLike(AgencyLikeNameReqDTO req); List<StringKeyValue> listByNameLike(AgencyLikeNameReqDTO req);


List<AgencyQueryAllModel> queryAll(AgencyQueryAllReqDTO reqDTO);
List<AgencyQueryAllModel> queryAll(AgencyQueryAllReqDTO reqDTO) throws ManagerException;


CommExportExcelResponse export(AgencyPageRequestDTO reqDto) throws ManagerException; CommExportExcelResponse export(AgencyPageRequestDTO reqDto) throws ManagerException;
} }

+ 8
- 4
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyManagerImpl.java View File

import cn.com.taiji.core.entity.basic.QtkAgency; import cn.com.taiji.core.entity.basic.QtkAgency;
import cn.com.taiji.core.entity.basic.QtkAgencyMap; import cn.com.taiji.core.entity.basic.QtkAgencyMap;
import cn.com.taiji.core.entity.basic.QtkAgencyModel; import cn.com.taiji.core.entity.basic.QtkAgencyModel;
import cn.com.taiji.core.entity.basic.QtkServiceHall;
import cn.com.taiji.core.entity.dict.BucketFileBus; import cn.com.taiji.core.entity.dict.BucketFileBus;
import cn.com.taiji.core.entity.dict.EnableStatus; import cn.com.taiji.core.entity.dict.EnableStatus;
import cn.com.taiji.core.entity.dict.log.OperateType; import cn.com.taiji.core.entity.dict.log.OperateType;
import cn.com.taiji.core.repo.jpa.user.StaffRepo; import cn.com.taiji.core.repo.jpa.user.StaffRepo;
import cn.com.taiji.userw.dto.agency.*; import cn.com.taiji.userw.dto.agency.*;
import cn.com.taiji.userw.manager.AbstractUserwManager; import cn.com.taiji.userw.manager.AbstractUserwManager;
import cn.com.taiji.userw.model.MyFinals;
import cn.com.taiji.userw.model.agency.AgencyExcelModel; import cn.com.taiji.userw.model.agency.AgencyExcelModel;
import cn.com.taiji.userw.model.agency.AgencyQueryAllModel; import cn.com.taiji.userw.model.agency.AgencyQueryAllModel;
import cn.com.taiji.userw.model.agency.QtkAgencyBkModel; import cn.com.taiji.userw.model.agency.QtkAgencyBkModel;
import cn.com.taiji.userw.model.agency.QtkAgencyModelDetails; import cn.com.taiji.userw.model.agency.QtkAgencyModelDetails;
import cn.com.taiji.userw.model.comm.CommExportExcelResponse; import cn.com.taiji.userw.model.comm.CommExportExcelResponse;
import cn.com.taiji.userw.model.serviceHall.ServiceHallExcelModel;
import cn.com.taiji.userw.repo.jpa.request.AgencyPageRequest; import cn.com.taiji.userw.repo.jpa.request.AgencyPageRequest;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
} }


@Override @Override
public List<AgencyQueryAllModel> queryAll(AgencyQueryAllReqDTO reqDTO) {
public List<AgencyQueryAllModel> queryAll(AgencyQueryAllReqDTO reqDTO) throws ManagerException{
List<QtkAgency> allEnable = qtkAgencyRepo.findAllEnable(); List<QtkAgency> allEnable = qtkAgencyRepo.findAllEnable();


String agencyIdByToken = findAgencyIdByToken(reqDTO.getAccessToken());
//非黔通只查当前渠道的数据
if (!MyFinals.QTZL_AGENCY_ID.equals(agencyIdByToken)){
allEnable = allEnable.stream().filter(t -> t.getAgencyId().equals(agencyIdByToken)).collect(Collectors.toList());
}

if (StringTools.hasText(reqDTO.getAgencyType())){ if (StringTools.hasText(reqDTO.getAgencyType())){
allEnable = allEnable.stream().filter(t -> t.getType().equals(reqDTO.getAgencyType())).collect(Collectors.toList()); allEnable = allEnable.stream().filter(t -> t.getType().equals(reqDTO.getAgencyType())).collect(Collectors.toList());
} }

+ 2
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/MyFinals.java View File

public final static int LOGIN_FAILED_EXPIRE = 5;// 分钟 public final static int LOGIN_FAILED_EXPIRE = 5;// 分钟
public static final String TOKEN_HEADER = "Authorization"; public static final String TOKEN_HEADER = "Authorization";
public static final int EXPIRE_TIME_SECOND = 60; public static final int EXPIRE_TIME_SECOND = 60;
public static String QTZL_AGENCY_ID = "52010106004";

} }

Loading…
Cancel
Save