|  |  |  | 
|---|
|  |  |  | package com.doumee.api.web; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cn.hutool.http.HttpRequest; | 
|---|
|  |  |  | import com.amazonaws.util.Md5Utils; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDataPermissionBiz; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.biz.zbom.ZbomCRMService; | 
|---|
|  |  |  | import com.doumee.biz.zbom.ZbomZhongTaiService; | 
|---|
|  |  |  | import com.doumee.config.annotation.LoginRequired; | 
|---|
|  |  |  | import com.doumee.config.annotation.UserLoginRequired; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.annotation.trace.Trace; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.codec.digest.DigestUtils; | 
|---|
|  |  |  | import org.apache.commons.codec.digest.Md5Crypt; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.apache.tomcat.util.security.MD5Encoder; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.imageio.ImageIO; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.io.InputStream; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | public UsersService usersService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | public SystemDictDataBiz systemDictDataBiz; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @UserLoginRequired | 
|---|
|  |  |  | @LoginRequired | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() { | 
|---|
|  |  |  | return  ApiResponse.success(getZhongTaiDataService.getZSZXCatalogs(getMemberId(),getUserType())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @UserLoginRequired | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<PageData<News>> newsPage (@RequestBody PageWrap<News> pageWrap) { | 
|---|
|  |  |  | pageWrap.getModel().setIsPublish(Constants.ONE); | 
|---|
|  |  |  | pageWrap.getModel().setStatus(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success(newsService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @UserLoginRequired | 
|---|
|  |  |  | @ApiOperation(value = "获取客户管理授权-列表跳转地址", notes = "获取客户管理授权跳转地址") | 
|---|
|  |  |  | 
|---|
|  |  |  | return  ApiResponse.success(zbomCRMService.getCrmGoUrl(this.getLoginUserInfo().getIamUsername(),type)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "生成小程序码", notes = "PAD端") | 
|---|
|  |  |  | @PostMapping("/getQrCode") | 
|---|
|  |  |  | public void getQrCode(@RequestBody GenerateQRCodeRequest generateQRCodeRequest, HttpServletResponse response) { | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | response.setHeader("Cache-Control", "no-store, no-cache"); | 
|---|
|  |  |  | response.setContentType("image/jpeg"); | 
|---|
|  |  |  | InputStream inputStream = usersService.getQrCode(generateQRCodeRequest); | 
|---|
|  |  |  | ImageIO.write(ImageIO.read(inputStream),"png",response.getOutputStream()); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|