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 Dec 29, 2023
2 parents 913dbd7 + 727961d commit 3900101
Show file tree
Hide file tree
Showing 22 changed files with 1,107 additions and 440 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![license](http://img.shields.io/badge/license-GPL%203.0-orange)](https://gitee.com/LinkWeChat/link-wechat/blob/master/LICENSE)
[![木兰社区](https://img.shields.io/badge/Mulan-incubating-blue)](https://portal.mulanos.cn//)

[官方网站](http://www.linkwechat.net/) | [官方论坛](http://community.linkwechat.net/) | [在线演示](http://demo.linkwechat.net/)
[官方网站](http://www.linkwechat.net/) | [在线演示](http://demo.linkwechat.net/)

[项目手册](https://www.yuque.com/linkwechat/help) | [用户手册](https://docs.qq.com/pdf/DZUpLbEVZR3RLdmxO?) | [常见问题](https://www.yuque.com/linkwechat/help/qk5gl6) | [V5.x功能清单](https://docs.qq.com/sheet/DZWNxelVoT2VSU1V6?tab=BB08J3)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.domain.entity.SysDictData;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.DateUtils;
Expand All @@ -18,12 +17,13 @@
import com.linkwechat.common.utils.file.FileUtils;
import com.linkwechat.common.utils.poi.ExcelUtil;
import com.linkwechat.common.utils.poi.LwExcelUtil;
import com.linkwechat.domain.WeCustomerSeas;
import com.linkwechat.domain.groupcode.entity.WeGroupCode;
import com.linkwechat.domain.WeGroup;
import com.linkwechat.domain.storecode.entity.WeStoreCode;
import com.linkwechat.domain.storecode.entity.WeStoreCodeConfig;
import com.linkwechat.domain.qr.WeQrAttachments;
import com.linkwechat.domain.storecode.entity.WeStoreCodeCount;
import com.linkwechat.domain.storecode.query.WeStoreCodeQuery;
import com.linkwechat.domain.storecode.query.WxStoreCodeQuery;
import com.linkwechat.domain.storecode.vo.WeStoreCodeTableVo;
import com.linkwechat.domain.storecode.vo.WeStoreCodesVo;
import com.linkwechat.domain.storecode.vo.datareport.WeStoreGroupReportVo;
import com.linkwechat.domain.storecode.vo.datareport.WeStoreShopGuideReportVo;
Expand All @@ -34,14 +34,13 @@
import com.linkwechat.domain.storecode.vo.tab.WeStoreTabVo;
import com.linkwechat.domain.storecode.vo.trend.WeStoreGroupTrendVo;
import com.linkwechat.domain.storecode.vo.trend.WeStoreShopGuideTrendVo;
import com.linkwechat.service.IWeGroupService;
import com.linkwechat.service.IWeQrAttachmentsService;
import com.linkwechat.service.IWeStoreCodeConfigService;
import com.linkwechat.service.IWeStoreCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.MessageFormat;
Expand All @@ -66,6 +65,9 @@ public class WeStoreCodeController extends BaseController {
@Autowired
private IWeQrAttachmentsService attachmentsService;

@Autowired
private IWeGroupService iWeGroupService;

@Autowired
private MapUtils mapUtils;

Expand All @@ -86,6 +88,8 @@ public AjaxResult<WeStoreCodeConfig> getStoreCodeConfig(@PathVariable Integer st
.eq(WeQrAttachments::getQrId, storeCodeConfig.getId())
.eq(WeQrAttachments::getBusinessType,2))
);
}else{
storeCodeConfig=new WeStoreCodeConfig();
}

return AjaxResult.success(
Expand Down Expand Up @@ -266,6 +270,7 @@ public AjaxResult<WeStoreGroupTabVo> countWeStoreGroupTab(){
public AjaxResult<List<WeStoreShopGuideTrendVo>> countStoreShopGuideTrend(WeStoreCode weStoreCode){



return AjaxResult.success(
iWeStoreCodeService.countStoreShopGuideTrend(weStoreCode)
);
Expand Down Expand Up @@ -394,6 +399,64 @@ public void exportCountStoreGroupReport(WeStoreCode weStoreCode){
}


/**
* 数据明细获取
* @param weStoreCodeQuery
* @return
*/
@GetMapping("/findWeStoreCodeTables")
public TableDataInfo<List<WeStoreCodeTableVo>> findWeStoreCodeTables(WeStoreCodeQuery weStoreCodeQuery){
startPage();
return getDataTable(
iWeStoreCodeService.findWeStoreCodeTables(weStoreCodeQuery)
);
}


/**
* 数据明细导出
* @param weStoreCodeQuery
* @return
*/
@GetMapping("/weStoreCodeTablesExport")
public void weStoreCodeTablesExport(WeStoreCodeQuery weStoreCodeQuery) {

List<WeStoreCodeTableVo> weStoreCodeTables = iWeStoreCodeService.findWeStoreCodeTables(weStoreCodeQuery);


LwExcelUtil.exprotForWeb(
ServletUtils.getResponse(), WeStoreCodeTableVo.class,weStoreCodeTables,"数据明细_" + System.currentTimeMillis()
);

}




/**
* 获取当前客户对应的群
* @param weStoreCodeQuery
* @return
*/
@GetMapping("/findWeStoreCodeGroupTables")
public TableDataInfo<WeGroup> findWeStoreCodeGroupTables(WeStoreCodeQuery weStoreCodeQuery){
List<WeGroup> weGroups =new ArrayList<>();
WeStoreCode weStoreCode = iWeStoreCodeService.getById(weStoreCodeQuery.getStoreCodeId());

if(null != weStoreCode){
startPage();
if(StringUtils.isNotEmpty(weStoreCode.getGroupCodeState())){
weGroups=iWeGroupService
.findGroupByUserId(weStoreCodeQuery.getExternalUserid()
, weStoreCode.getGroupCodeState());
}

}

return getDataTable(weGroups);
}


/***************************************************************
**************************统计数据报表相关 end********************
****************************************************************/
Expand Down Expand Up @@ -463,9 +526,7 @@ public AjaxResult importData(MultipartFile file) throws Exception {
k.setLatitude(lMap.get(MapUtils.lat));
k.setLongitude(lMap.get(MapUtils.lng));
});
// List<WeStoreCode> weStoreCodeList = iWeStoreCodeService.getBaseMapper().selectList(new LambdaQueryWrapper<WeStoreCode>()
// .eq(WeStoreCode::getDelFlag, 0));
// List<String> lst = weStoreCodeList.stream().map(WeStoreCode::getStoreName).collect(Collectors.toList());

deduplicationSeasNoRepeat = deduplicationSeasNoRepeat.stream().filter(item -> item.getStoreName().length()<30).collect(Collectors.toList());
if(iWeStoreCodeService.saveBatch(deduplicationSeasNoRepeat)){
tip = MessageFormat.format(tip, new Object[]{new Integer(deduplicationSeasNoRepeat.size()).toString()});
Expand All @@ -486,18 +547,14 @@ public AjaxResult importData(MultipartFile file) throws Exception {

/**
* 获取附件门店
* @param storeCodeType 门店码类型(1:门店导购码;2:门店群活码)
* @param unionid 微信unionid
* @param longitude 经度
* @param latitude 纬度
* @param area 区域
* @param wxStoreCodeQuery 门店码类型(1:门店导购码;2:门店群活码)
* @return
*/
@GetMapping("/findStoreCode")
public AjaxResult<WeStoreCodesVo> findStoreCode(Integer storeCodeType, String unionid, String longitude, String latitude, String area){
public AjaxResult<WeStoreCodesVo> findStoreCode(WxStoreCodeQuery wxStoreCodeQuery){

return AjaxResult.success(
iWeStoreCodeService.findStoreCode(storeCodeType,unionid,longitude,latitude,area)
iWeStoreCodeService.findStoreCode(wxStoreCodeQuery)
);
}

Expand All @@ -509,23 +566,30 @@ public AjaxResult<WeStoreCodesVo> findStoreCode(Integer storeCodeType, String un
*/
@GetMapping("/findWeStoreCodeConfig")
public AjaxResult<WeStoreCodeConfig> findWeStoreCodeConfig(Integer storeCodeType){
WeStoreCodeConfig weStoreCodeConfig=new WeStoreCodeConfig();
List<WeStoreCodeConfig> weStoreCodeConfigList = iWeStoreCodeConfigService.list(new LambdaQueryWrapper<WeStoreCodeConfig>()
.eq(WeStoreCodeConfig::getStoreCodeType, storeCodeType));

if(CollectionUtil.isNotEmpty(weStoreCodeConfigList)){
weStoreCodeConfig=weStoreCodeConfigList.stream().findFirst().get();
}


return AjaxResult.success(
iWeStoreCodeConfigService.getWeStoreCodeConfig(storeCodeType)
weStoreCodeConfig
);
}


/**
* 记录用户扫码行为
* @return
*/
@PostMapping("/countUserBehavior")
public AjaxResult countUserBehavior(@RequestBody WeStoreCodeCount weStoreCodeCount){
iWeStoreCodeService.countUserBehavior(weStoreCodeCount);
return AjaxResult.success();
}
// /**
// * 记录用户扫码行为
// * @return
// */
// @PostMapping("/countUserBehavior")
// public AjaxResult countUserBehavior(@RequestBody WeStoreCodeCount weStoreCodeCount){
// iWeStoreCodeService.countUserBehavior(weStoreCodeCount);
// return AjaxResult.success();
// }



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ public class WeComeStateContants {
* 标签建群
*/
public final static String BQJQ_STATE="bqjq_";


/**
* 门店活码导购渠道标识
*/
public final static String MDDG_STATE="mddg_";


/**
* 门店群码渠道标识
*/
public final static String MDQM_STATE="mdqm_";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.linkwechat.domain;

import com.linkwechat.domain.groupcode.entity.WeGroupCode;
import com.linkwechat.domain.qr.query.WeQrAddQuery;
import lombok.Data;

/**
* 构建活码或者员工活码条件参数
*/
@Data
public class WeBuildUserOrGroupConditVo {


//构建员工活码
WeQrAddQuery weQrAddQuery;


//构建群活码
WeGroupCode addGroupCode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@Data
public class WeAgentAddQuery {


@ApiModelProperty("应用ID")
@NotNull(message = "应用ID不能为空")
private Integer agentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class WeLeadsFollowerVO {
/**
* 客户Id
*/
private Integer customerId;
private Long customerId;

/**
* 绑定客户时间
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,47 @@ public class WeQrAddQuery {
* @return 企微接口参数实体类
*/
public WeAddWayQuery getWeContactWay() {
// WeAddWayQuery weContactWay = new WeAddWayQuery();
// //根据类型生成相应的活码
// if(this.qrId == null){
// Snowflake snowflake = IdUtil.getSnowflake(RandomUtil.randomLong(6), RandomUtil.randomInt(6));
// this.state = WelcomeMsgTypeEnum.WE_QR_CODE_PREFIX.getType() + snowflake.nextIdStr();
// weContactWay.setState(state);
// }
// weContactWay.setIs_exclusive(BooleanUtils.toBoolean(this.isExclusive));
// weContactWay.setConfig_id(this.configId);
// weContactWay.setType(this.qrType);
// weContactWay.setScene(WeConstans.QR_CODE_EMPLE_CODE_SCENE);
// weContactWay.setSkip_verify(BooleanUtils.toBoolean(this.qrAutoAdd));
// if (CollectionUtil.isNotEmpty(qrUserInfos)) {
// //员工列表
// List<String> userIdArr = qrUserInfos.stream().map(WeQrUserInfoQuery::getUserIds)
// .filter(CollectionUtil::isNotEmpty).flatMap(Collection::stream).collect(Collectors.toList());
// if (CollectionUtil.isNotEmpty(userIdArr)) {
// weContactWay.setUser(userIdArr);
// }
// //部门列表
// List<Long> partyArr = qrUserInfos.stream().map(WeQrUserInfoQuery::getPartys)
// .filter(CollectionUtil::isNotEmpty).flatMap(Collection::stream).collect(Collectors.toList());
// if (CollectionUtil.isNotEmpty(partyArr)) {
// weContactWay.setParty(partyArr);
// }
// }
// return weContactWay;
return getWeContactWayByState(WelcomeMsgTypeEnum.WE_QR_CODE_PREFIX.getType() + IdUtil.getSnowflake(RandomUtil.randomLong(6), RandomUtil.randomInt(6)).nextIdStr());
}


/**
* 设置渠道活码
* @param channelState
* @return
*/
public WeAddWayQuery getWeContactWayByState(String channelState){
WeAddWayQuery weContactWay = new WeAddWayQuery();
//根据类型生成相应的活码
if(this.qrId == null){
Snowflake snowflake = IdUtil.getSnowflake(RandomUtil.randomLong(6), RandomUtil.randomInt(6));
this.state = WelcomeMsgTypeEnum.WE_QR_CODE_PREFIX.getType() + snowflake.nextIdStr();
weContactWay.setState(state);
weContactWay.setState(channelState);
}
weContactWay.setIs_exclusive(BooleanUtils.toBoolean(this.isExclusive));
weContactWay.setConfig_id(this.configId);
Expand All @@ -126,7 +161,6 @@ public WeAddWayQuery getWeContactWay() {
return weContactWay;
}


/**
* 获取数据表实体
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static class ExecuteUserCondit{
//员工id
private List<String> weUserIds;


}

@Data
Expand Down
Loading

0 comments on commit 3900101

Please sign in to comment.