提交 9b794110 编写于 作者: E ext.shengxiyong1

首页相关bug修复

上级 66a61bed
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.annotation.Log; import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
...@@ -19,7 +20,7 @@ import java.util.List; ...@@ -19,7 +20,7 @@ import java.util.List;
/** /**
* 企业id相关配置Controller * 企业id相关配置Controller
* *
* @author ruoyi * @author ruoyi
* @date 2020-08-24 * @date 2020-08-24
*/ */
...@@ -39,12 +40,56 @@ public class WeCorpAccountController extends BaseController ...@@ -39,12 +40,56 @@ public class WeCorpAccountController extends BaseController
{ {
startPage(); startPage();
List<WeCorpAccount> list = weCorpAccountService.list(new LambdaQueryWrapper<WeCorpAccount>() List<WeCorpAccount> list = weCorpAccountService.list(new LambdaQueryWrapper<WeCorpAccount>()
.eq(WeCorpAccount::getDelFlag,Constants.NORMAL_CODE) .eq(WeCorpAccount::getDelFlag,Constants.NORMAL_CODE)
.like(WeCorpAccount::getCompanyName,weCorpAccount.getCompanyName())); .like(WeCorpAccount::getCompanyName,weCorpAccount.getCompanyName()));
return getDataTable(list); return getDataTable(list);
} }
/******************************************************
*************************Lw2.0相关start****************
*****************************************************/
/**
* 获取当前可用企业相关配置
* @return
*/
@GetMapping("/findCurrentCorpAccount")
public AjaxResult findCurrentCorpAccount(){
WeCorpAccount weCorpAccount=new WeCorpAccount();
List<WeCorpAccount> weCorpAccounts = weCorpAccountService.list(new LambdaQueryWrapper<WeCorpAccount>()
.eq(WeCorpAccount::getDelFlag,Constants.NORMAL_CODE));
if(CollectionUtil.isNotEmpty(weCorpAccounts)){
weCorpAccount=weCorpAccounts.stream().findFirst().get();
}
return AjaxResult.success(weCorpAccount);
}
/**
* 新增或编辑企业配置相关
* @param weCorpAccount
* @return
*/
@PostMapping("/addOrUpdate")
public AjaxResult addOrUpdate(@RequestBody WeCorpAccount weCorpAccount){
weCorpAccountService.saveOrUpdate(weCorpAccount);
return AjaxResult.success();
}
/******************************************************
*************************Lw2.0相关end****************
*****************************************************/
// @PreAuthorize("@ss.hasPermi('wechat:corp:add')") // @PreAuthorize("@ss.hasPermi('wechat:corp:add')")
...@@ -71,7 +116,7 @@ public class WeCorpAccountController extends BaseController ...@@ -71,7 +116,7 @@ public class WeCorpAccountController extends BaseController
// @PreAuthorize("@ss.hasPermi('wechat:corp:startVailWeCorpAccount')") // @PreAuthorize("@ss.hasPermi('wechat:corp:startVailWeCorpAccount')")
@Log(title = "启用有效企业微信账号", businessType = BusinessType.DELETE) @Log(title = "启用有效企业微信账号", businessType = BusinessType.DELETE)
@PutMapping("/startVailWeCorpAccount/{corpId}") @PutMapping("/startVailWeCorpAccount/{corpId}")
@ApiOperation("启用有效企业微信账号") @ApiOperation("启用有效企业微信账号")
public AjaxResult startWeCorpAccount(@PathVariable String corpId) public AjaxResult startWeCorpAccount(@PathVariable String corpId)
{ {
......
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom; import com.linkwechat.common.core.domain.AjaxResult;import com.linkwechat.common.core.redis.RedisCache;import com.linkwechat.wecom.domain.dto.WePageStaticDataDto;import com.linkwechat.wecom.service.IWePageService;import io.swagger.annotations.Api;import io.swagger.annotations.ApiOperation;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController; /** * @author danmo * @description 首页统计 * @date 2021/2/23 15:30 **/@Api(description = "首页统计contraller")@Slf4j@RestController@RequestMapping("wecom/page/")public class WePageDateContraller { @Autowired private RedisCache redisCache; @Autowired private IWePageService iWePageService; /** * */ @ApiOperation(value = "数据总览controller",httpMethod = "GET") // @PreAuthorize("@ss.hasPermi('wecom:page:getCorpBasicData')") @GetMapping("/getCorpBasicData") public AjaxResult getCorpBasicData(){ // return AjaxResult.success(redisCache.getCacheMap("getCorpBasicData")); return AjaxResult.success( iWePageService.getCcorpBasicData() ); } @ApiOperation(value = "实时数据controller",httpMethod = "GET") // @PreAuthorize("@ss.hasPermi('wecom:page:getCorpRealTimeData')") @GetMapping("/getCorpRealTimeData") public AjaxResult getCorpRealTimeData(){ WePageStaticDataDto wePageStaticDataDto = redisCache.getCacheObject("getCorpRealTimeData"); return AjaxResult.success(wePageStaticDataDto); } }
\ No newline at end of file
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.redis.RedisCache;
import com.linkwechat.wecom.domain.dto.WePageStaticDataDto;
import com.linkwechat.wecom.service.IWeCorpAccountService;
import com.linkwechat.wecom.service.IWeUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author danmo
* @description 首页统计
* @date 2021/2/23 15:30
**/
@Api(description = "首页统计contraller")
@Slf4j
@RestController
@RequestMapping("wecom/page/")
public class WePageDateContraller {
@Autowired
private RedisCache redisCache;
/**
*
*/
@ApiOperation(value = "数据总览controller",httpMethod = "GET")
// @PreAuthorize("@ss.hasPermi('wecom:page:getCorpBasicData')")
@GetMapping("/getCorpBasicData")
public AjaxResult getCorpBasicData(){
return AjaxResult.success(redisCache.getCacheMap("getCorpBasicData"));
}
@ApiOperation(value = "实时数据controller",httpMethod = "GET")
// @PreAuthorize("@ss.hasPermi('wecom:page:getCorpRealTimeData')")
@GetMapping("/getCorpRealTimeData")
public AjaxResult getCorpRealTimeData(){
WePageStaticDataDto wePageStaticDataDto = redisCache.getCacheObject("getCorpRealTimeData");
return AjaxResult.success(wePageStaticDataDto);
}
}
......
...@@ -16,7 +16,7 @@ import javax.validation.constraints.NotBlank; ...@@ -16,7 +16,7 @@ import javax.validation.constraints.NotBlank;
/** /**
* 企业id相关配置对象 wx_corp_account * 企业id相关配置对象 wx_corp_account
* *
* @author ruoyi * @author ruoyi
* @date 2020-08-24 * @date 2020-08-24
*/ */
...@@ -35,55 +35,114 @@ public class WeCorpAccount extends BaseEntity ...@@ -35,55 +35,114 @@ public class WeCorpAccount extends BaseEntity
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Long id= SnowFlakeUtil.nextId(); private Long id= SnowFlakeUtil.nextId();
/** 企业名称 */
@ApiModelProperty("企业名称") /*****************************************
@NotBlank(message = "企业名称不能为空") *******************企业配置****************
private String companyName; ******************************************/
/** 企业ID */ /** 企业ID */
@ApiModelProperty("企业corpId") @ApiModelProperty("企业corpId")
@NotBlank(message = "企业ID不能为空") @NotBlank(message = "企业ID不能为空")
private String corpId; private String corpId;
/** 应用的密钥凭证 */
/** 企业名称 */
@ApiModelProperty("企业名称")
@NotBlank(message = "企业名称不能为空")
private String companyName;
/*****************************************
*******************通讯录配置****************
******************************************/
/** 通讯录 Secret */
@ApiModelProperty("企业为corpSecret") @ApiModelProperty("企业为corpSecret")
@NotBlank(message = "应用的密钥凭证不能为空") @NotBlank(message = "应用的密钥凭证不能为空")
private String corpSecret; private String corpSecret;
/** 帐号状态(0正常 1停用) */
@ApiModelProperty("帐号状态(0正常 1停用)")
private String status;
/** 删除标志(0代表存在 2代表删除) */ /*****************************************
@ApiModelProperty("删除标志(0代表存在 2代表删除)") *******************客户联系配置****************
private String delFlag=new String("0"); ******************************************/
@ApiModelProperty("客户联系配置")
@ApiModelProperty("外部联系人密钥")
@NotBlank(message = "外部联系人密钥凭证不能为空") @NotBlank(message = "外部联系人密钥凭证不能为空")
private String contactSecret; private String contactSecret;
/*****************************************
*******************应用配置****************
******************************************/
@ApiModelProperty("应用id") @ApiModelProperty("应用id")
private String agentId; private String agentId;
@ApiModelProperty("应用密钥") @ApiModelProperty("应用密钥")
private String agentSecret; private String agentSecret;
@ApiModelProperty("服务商密钥")
private String providerSecret; @ApiModelProperty("会话存档私钥")
private String financePrivateKey;
@ApiModelProperty("会话存档密钥") @ApiModelProperty("会话存档密钥")
private String chatSecret; private String chatSecret;
/*****************************************
*******************接受事件服务器****************
******************************************/
/**回调URL*/
private String backOffUrl;
/**回调token*/
private String token;
/**回调EncodingAESKey*/
private String encodingAesKey;
/** 帐号状态(0正常 1停用) */
@ApiModelProperty("帐号状态(0正常 1停用)")
private String status;
/** 删除标志(0代表存在 1代表删除) */
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
private Integer delFlag;
@ApiModelProperty("服务商密钥")
private String providerSecret;
@ApiModelProperty("企业微信扫码登陆回调地址") @ApiModelProperty("企业微信扫码登陆回调地址")
private String wxQrLoginRedirectUri; private String wxQrLoginRedirectUri;
@ApiModelProperty("客户流失通知开关 0:关闭 1:开启") @ApiModelProperty("客户流失通知开关 0:关闭 1:开启")
private String customerChurnNoticeSwitch = Constants.NORMAL_CODE; private String customerChurnNoticeSwitch = Constants.NORMAL_CODE;
@ApiModelProperty("会话存档私钥")
private String financePrivateKey;
@ApiModelProperty("企业管理员账号") @ApiModelProperty("企业管理员账号")
private String corpAccount; private String corpAccount;
......
package com.linkwechat.wecom.domain; import lombok.Data; @Datapublic class CorpBasicPageData { private Long customerCount; private Long groupMemberCount; private Long groupCount; private Long userCount;}
\ No newline at end of file
package com.linkwechat.wecom.mapper; import com.linkwechat.wecom.domain.CorpBasicPageData; public interface WePageMapper { CorpBasicPageData getCcorpBasicData();}
\ No newline at end of file
package com.linkwechat.wecom.service; import com.linkwechat.wecom.domain.CorpBasicPageData; public interface IWePageService { CorpBasicPageData getCcorpBasicData();}
\ No newline at end of file
package com.linkwechat.wecom.service.impl; import com.linkwechat.wecom.domain.CorpBasicPageData;import com.linkwechat.wecom.mapper.WePageMapper;import com.linkwechat.wecom.service.IWePageService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service; @Servicepublic class WePageServiceImpl implements IWePageService { @Autowired WePageMapper wePageMapper; @Override public CorpBasicPageData getCcorpBasicData() { return wePageMapper.getCcorpBasicData(); }}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.linkwechat.wecom.mapper.WePageMapper"> <select id="getCcorpBasicData" resultType="com.linkwechat.wecom.domain.CorpBasicPageData"> SELECT (SELECT COUNT(*) FROM we_user WHERE is_activate !=6) as customerCount, (SELECT COUNT(*) FROM we_customer WHERE del_flag=0) as groupMemberCount, (SELECT COUNT(*) FROM we_group WHERE del_flag=0) as groupCount, (SELECT count(*) FROM we_group_member where del_flag=0) as userCount </select> </mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册