Skip to content

Commit

Permalink
Merge branch 'gitee-master' into github-master
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoNanSheng committed Apr 7, 2023
2 parents 37c4731 + 486028c commit 964b857
Show file tree
Hide file tree
Showing 110 changed files with 4,645 additions and 542 deletions.
Binary file modified config/lw_nacos_config.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.linkwechat.aspecj;

import com.alibaba.fastjson.JSONObject;
import com.linkwechat.common.utils.ip.IpUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Objects;

/**
* 请求入参日志记录处理
*
* @author ruoyi
*/
@Aspect
@Component
public class RequestArgsLogAspect {
private static final Logger log = LoggerFactory.getLogger(RequestArgsLogAspect.class);


// 配置织入点
@Pointcut("execution(public * com.linkwechat.controller..*.*(..)))")
public void logPointCut() {
}

/**
* 处理请求前日志打印
*/
@Before(value = "logPointCut()")
public void doBefore(JoinPoint joinPoint) {

Object[] args = joinPoint.getArgs();
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (Objects.isNull(attributes)) {
return;
}
HttpServletRequest request = attributes.getRequest();
String url = request.getRequestURL().toString();
String ipAddr = IpUtils.getIpAddr(request);
Object[] params = new Object[args.length];
for (int i = 0; i< args.length;i++) {
if (!(args[i] instanceof HttpServletRequest) && !(args[i] instanceof HttpServletResponse) && !(args[i] instanceof MultipartFile)) {
params[i]=args[i];
}
}
log.info("api 接口请求 url:{},HTTP:{},IP:{},params:{}", url, request.getMethod(), ipAddr, JSONObject.toJSONString(params));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.domain.WeAgentMsg;
import com.linkwechat.domain.agent.query.WeAgentAddQuery;
import com.linkwechat.domain.agent.query.WeAgentEditQuery;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package com.linkwechat.controller;

import com.alibaba.excel.EasyExcel;
import com.github.pagehelper.PageInfo;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.utils.ServletUtils;
import com.linkwechat.domain.qr.query.WeLxQrAddQuery;
import com.linkwechat.domain.qr.query.WeLxQrCodeListQuery;
import com.linkwechat.domain.qr.query.WeLxQrCodeQuery;
import com.linkwechat.domain.qr.vo.*;
import com.linkwechat.service.IWeLxQrCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;

/**
* @author danmo
* @description 拉新活码管理
* @date 2023/03/06 18:22
**/

@RestController
@RequestMapping(value = "lxqr")
@Api(tags = "拉新活码管理")
public class WeLxQrCodeController extends BaseController {

@Autowired
private IWeLxQrCodeService weLxQrCodeService;

@ApiOperation(value = "新增拉新活码", httpMethod = "POST")
@PostMapping("/add")
public AjaxResult<WeLxQrAddVo> addQrCode(@RequestBody @Validated WeLxQrAddQuery query) {
Long id = weLxQrCodeService.addQrCode(query);
WeLxQrAddVo lxQrCode = weLxQrCodeService.generateQrCode(id,query.getQrType());
return AjaxResult.success(lxQrCode);
}

@ApiOperation(value = "修改活码", httpMethod = "POST")
@PutMapping("/update/{id}")
public AjaxResult updateQrCode(@PathVariable("id") Long id, @RequestBody @Validated WeLxQrAddQuery query) {
query.setQrId(id);
weLxQrCodeService.updateQrCode(query);
return AjaxResult.success();
}


@ApiOperation(value = "删除拉新活码", httpMethod = "DELETE")
@DeleteMapping("/del/{ids}")
public AjaxResult<WeQrCodeDetailVo> delQrCode(@PathVariable("ids") List<Long> ids) {
weLxQrCodeService.delQrCode(ids);
return AjaxResult.success();
}

@ApiOperation(value = "获取拉新活码详情", httpMethod = "GET")
@GetMapping("/get/{id}")
public AjaxResult<WeLxQrCodeDetailVo> getQrDetail(@PathVariable("id") Long id) {
WeLxQrCodeDetailVo qrDetail = weLxQrCodeService.getQrDetail(id);
return AjaxResult.success(qrDetail);
}

@ApiOperation(value = "获取活码列表", httpMethod = "GET")
@GetMapping("/list")
public TableDataInfo<WeLxQrCodeListVo> getQrCodeList(WeLxQrCodeListQuery query) {
startPage();
PageInfo<WeLxQrCodeListVo> qrCodeList = weLxQrCodeService.getQrCodeList(query);
return getDataTable(qrCodeList);
}


@ApiOperation(value = "获取活码折线统计", httpMethod = "GET")
@GetMapping("/line/statistics")
public AjaxResult<WeLxQrCodeLineVo> getWeQrCodeLineStatistics(WeLxQrCodeListQuery query) {
weLxQrCodeService.statisticsParamsCheck(query);
WeLxQrCodeLineVo weQrCodeScanCount = weLxQrCodeService.getWeQrCodeLineStatistics(query);
return AjaxResult.success(weQrCodeScanCount);
}

@ApiOperation(value = "获取活码列表统计", httpMethod = "GET")
@GetMapping("/list/statistics")
public TableDataInfo<WeLxQrCodeSheetVo> getWeQrCodeListStatistics(WeLxQrCodeListQuery query) {
weLxQrCodeService.statisticsParamsCheck(query);
startPage();
List<WeLxQrCodeSheetVo> list = weLxQrCodeService.getWeQrCodeListStatistics(query);
return getDataTable(list);
}

@ApiOperation(value = "导出活码列表统计", httpMethod = "GET")
@GetMapping("/list/statistics/export")
public void qrCodeListStatisticsExport(WeLxQrCodeListQuery query) throws IOException {
List<WeLxQrCodeSheetVo> list = weLxQrCodeService.getWeQrCodeListStatistics(query);
HttpServletResponse response = ServletUtils.getResponse();
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("活码列表统计", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), WeLxQrCodeSheetVo.class).sheet("活码列表统计").doWrite(list);
}


@ApiOperation(value = "领取总数统计", httpMethod = "GET")
@GetMapping("/receive/statistics")
public AjaxResult<WeLxQrCodeReceiveVo> receiveStatistics(WeLxQrCodeQuery query) {
WeLxQrCodeReceiveVo receiveStatistics = weLxQrCodeService.receiveStatistics(query);
return AjaxResult.success(receiveStatistics);
}

@ApiOperation(value = "领取红包个数统计(折线图)", httpMethod = "GET")
@GetMapping("/receive/line/num")
public AjaxResult<WeLxQrCodeReceiveLineVo> receiveLineNum(WeLxQrCodeQuery query) {
WeLxQrCodeReceiveLineVo lineNum = weLxQrCodeService.receiveLineNum(query);
return AjaxResult.success(lineNum);
}

@ApiOperation(value = "领取红包金额统计(折线图)", httpMethod = "GET")
@GetMapping("/receive/line/amount")
public AjaxResult<WeLxQrCodeReceiveLineVo> receiveLineAmount(WeLxQrCodeQuery query) {
WeLxQrCodeReceiveLineVo lineNum = weLxQrCodeService.receiveLineAmount(query);
return AjaxResult.success(lineNum);
}

@ApiOperation(value = "领取红包列表统计(表格)", httpMethod = "GET")
@GetMapping("/receive/list/statistics")
public TableDataInfo<List<WeLxQrCodeReceiveListVo>> receiveListStatistics(WeLxQrCodeQuery query) {
startPage();
List<WeLxQrCodeReceiveListVo> list = weLxQrCodeService.receiveListStatistics(query);
return getDataTable(list);
}

@ApiOperation(value = "领取红包列表统计(表格)", httpMethod = "GET")
@GetMapping("/receive/list/statistics/export")
public void receiveListStatisticsExport(WeLxQrCodeQuery query) throws IOException {
List<WeLxQrCodeReceiveListVo> list = weLxQrCodeService.receiveListStatistics(query);
HttpServletResponse response = ServletUtils.getResponse();
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("领取红包列表统计", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), WeLxQrCodeReceiveListVo.class).sheet("领取红包列表统计").doWrite(list);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ public AjaxResult<List<WeGroupMemberRealCntVo>> getGroupMemberRealCnt(WeOperatio
@GetMapping("/group/member/getGroupMemberRealPageCnt")
public TableDataInfo<WeGroupMemberRealCntVo> getGroupMemberRealPageCnt(WeOperationGroupQuery query) {
startPage();
return getDataTable(weOperationCenterService.getGroupMemberRealCnt(query));
// return getDataTable(weOperationCenterService.selectGroupMemberBrokenLine(query));
// return getDataTable(weOperationCenterService.getGroupMemberRealCnt(query));
return getDataTable(weOperationCenterService.selectGroupMemberBrokenLine(query));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
import com.linkwechat.domain.envelopes.WeRedEnvelopesRecord;
import com.linkwechat.domain.envelopes.WeUserRedEnvelopsLimit;
import com.linkwechat.domain.envelopes.query.H5RedEnvelopesParmQuery;
import com.linkwechat.domain.envelopes.query.WeRedEnvelopeListQuery;
import com.linkwechat.domain.envelopes.vo.RedEnvelopesBaseInfoVo;
import com.linkwechat.domain.envelopes.vo.WeCutomerRedEnvelopesVo;
import com.linkwechat.domain.envelopes.vo.WeGroupRedEnvelopesVo;
import com.linkwechat.domain.storecode.entity.WeStoreCode;
import com.linkwechat.service.IWeCorpAccountService;
import com.linkwechat.service.IWeRedEnvelopesService;
import com.linkwechat.service.IWeUserRedEnvelopsLimitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
Expand All @@ -36,6 +39,7 @@
/**
* 红包相关接口
*/
@Api(tags = "红包接口管理")
@RestController
@RequestMapping(value = "/RedEnvelopes")
public class WeRedEnvelopesController extends BaseController {
Expand Down Expand Up @@ -374,13 +378,6 @@ public TableDataInfo findRecordGroupByUserId(String beginTime,String endTime){
*/
@PostMapping("/sendReEnvelopesToCustomer")
public AjaxResult sendPersonReEnvelopesToCustomer(@RequestBody H5RedEnvelopesParmQuery parmDto) {

String returnMsg = iWeRedEnvelopesService.checkWeUserQuotaLimit(parmDto);

if(StringUtils.isNotEmpty(returnMsg)){
return AjaxResult.error(HttpStatus.NOT_ORTHER_IMPLEMENTED,returnMsg);
}

return AjaxResult.success(
iWeRedEnvelopesService.createCustomerRedEnvelopesOrder(parmDto.getRedenvelopesId(),parmDto.getRedEnvelopeAmount(),
parmDto.getRedEnvelopeName(),1,
Expand Down Expand Up @@ -426,12 +423,6 @@ public AjaxResult sendCompanyEnvelopesToCustomer(@RequestBody H5RedEnvelopesParm
@PostMapping("/sendPersonReEnvelopesToGroup")
public AjaxResult sendPersonReEnvelopesToGroup(@RequestBody H5RedEnvelopesParmQuery parmDto){

String returnMsg = iWeRedEnvelopesService.checkWeUserQuotaLimit(parmDto);

if(StringUtils.isNotEmpty(returnMsg)){
return AjaxResult.error(HttpStatus.NOT_ORTHER_IMPLEMENTED,returnMsg);
}

return AjaxResult.success(

iWeRedEnvelopesService.createGroupRedEnvelopesOrder(parmDto.getRedenvelopesId(),
Expand Down Expand Up @@ -504,19 +495,11 @@ public AjaxResult findCompanyRedEnvelopes(Integer sceneType){
@GetMapping("/receiveRedEnvelopes")
public AjaxResult receiveRedEnvelopes(String orderNo,String openId,String receiveName,String avatar) throws Exception {

String checkMsg
= iWeRedEnvelopesService.checkCustomerRedEnvelopesLimit(openId);

if(StringUtils.isNotEmpty(checkMsg)){
return AjaxResult.error(HttpStatus.NOT_IMPLEMENTED,checkMsg);
}

String returnMsg = iWeRedEnvelopesService.customerReceiveRedEnvelopes(orderNo, openId,receiveName,avatar);

if(StringUtils.isNotEmpty(returnMsg)){
return AjaxResult.error(HttpStatus.NOT_IMPLEMENTED,returnMsg);
}

return AjaxResult.success(
returnMsg
);
Expand Down Expand Up @@ -577,7 +560,12 @@ public AjaxResult checkRecevieRedEnvelopes(String orderNo,String openId){
**********************************************************/




@ApiOperation(value = "红包列表查询",httpMethod = "GET")
@GetMapping("/list")
public TableDataInfo<List<WeRedEnvelopes>> getList(WeRedEnvelopeListQuery query){
super.startPage();
List<WeRedEnvelopes> list = iWeRedEnvelopesService.getList(query);
return getDataTable(list);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.linkwechat.common.utils.poi.LwExcelUtil;
import com.linkwechat.domain.WeCustomerSeas;
import com.linkwechat.domain.groupcode.entity.WeGroupCode;
import com.linkwechat.domain.live.WeLive;
import com.linkwechat.domain.storecode.entity.WeStoreCode;
import com.linkwechat.domain.storecode.entity.WeStoreCodeConfig;
import com.linkwechat.domain.qr.WeQrAttachments;
Expand Down Expand Up @@ -83,7 +82,8 @@ public AjaxResult<WeStoreCodeConfig> getStoreCodeConfig(@PathVariable Integer st
if(null != storeCodeConfig){
storeCodeConfig.setWeQrAttachments(
attachmentsService.list(new LambdaQueryWrapper<WeQrAttachments>()
.eq(WeQrAttachments::getQrId, storeCodeConfig.getId()))
.eq(WeQrAttachments::getQrId, storeCodeConfig.getId())
.eq(WeQrAttachments::getBusinessType,2))
);
}

Expand Down
2 changes: 1 addition & 1 deletion linkwe-auth/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<property name="app_name" value="linkwe-auth"/>
<!-- 日志根目录-->
<springProperty scope="context" name="log.path" source="logging.path"
defaultValue="/usr/local/app/linwechat-api/logs/linkwe-auth"/>
defaultValue="./logs/linkwe-auth"/>

<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public class LinkWeChatConfig {
*/
private String shortAppletUrl;

/**
* 拉新活码H5地址
*/
private String lxQrCodeUrl;


public String getName() {
return name;
Expand Down
Loading

0 comments on commit 964b857

Please sign in to comment.