Commit 0ff3c5be by fudahua

secret接口更改

parent c95a7ec2
package com.gic.haoban.manage.web.controller;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created 2020/6/3.
*
* @author hua
*/
@RestController
@RequestMapping("/pay")
public class PayController extends WebBaseController {
private static final Logger logger= LoggerFactory.getLogger(PayController.class);
@Autowired
private StaffApiService staffApiService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
private StaffClerkRelationApiService staffClerkRelationApiService;
/**
* 微信成员列表
* @param userId
* @param corpId
* @return
*/
@RequestMapping("/wx-user-list")
public HaobanResponse enterpriseList(String userId,String corpId) {
if (StringUtils.isAnyBlank(userId,corpId)) {
logger.info("参数异常");
return resultResponse(HaoBanErrCode.ERR_2);
}
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
if (enterpriseDTO==null) {
logger.info("不存在商户");
return resultResponse(HaoBanErrCode.ERR_20001);
}
StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(userId, enterpriseDTO.getWxEnterpriseId());
if (staffDTO==null) {
logger.info("不存在成员");
return resultResponse(HaoBanErrCode.ERR_6);
}
List<StaffClerkInfoDTO> list = staffClerkRelationApiService.listBindDetailByStaffId(staffDTO.getStaffId());
return resultResponse(HaoBanErrCode.ERR_1,list);
}
/**
* 微信成员列表
* @param storeId
* @return
*/
@RequestMapping("/store-list")
public HaobanResponse enterpriseList(String storeId) {
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
if (enterpriseDTO==null) {
logger.info("不存在商户");
return resultResponse(HaoBanErrCode.ERR_20001);
}
StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(userId, enterpriseDTO.getWxEnterpriseId());
if (staffDTO==null) {
logger.info("不存在成员");
return resultResponse(HaoBanErrCode.ERR_6);
}
List<StaffClerkInfoDTO> list = staffClerkRelationApiService.listBindDetailByStaffId(staffDTO.getStaffId());
return resultResponse(HaoBanErrCode.ERR_1,list);
}
}
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