峰会申请与校区活跃
This commit is contained in:
parent
7b7efa1369
commit
6ab39d84f2
@ -0,0 +1,44 @@
|
||||
package com.cpop.api.cloudDb.core.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-04-12 11:41
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CloudStoreActiveDto {
|
||||
|
||||
/**
|
||||
* 云品牌id
|
||||
*/
|
||||
@SerializedName("brandId")
|
||||
private String brandCloudId;
|
||||
|
||||
/**
|
||||
* 品牌名
|
||||
*/
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 云校区id
|
||||
*/
|
||||
@SerializedName("storeId")
|
||||
private String storeCloudId;
|
||||
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 活跃数
|
||||
*/
|
||||
@SerializedName("logNum")
|
||||
private Integer activeNum;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.cpop.api.cloudDb.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
|
||||
import com.cpop.api.cloudDb.core.dto.CloudStoreActiveDto;
|
||||
import com.cpop.api.cloudDb.core.dto.CloudStoreDto;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.core.base.exception.UtilException;
|
||||
@ -9,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 云校区工具类
|
||||
* @author DB
|
||||
@ -54,4 +57,27 @@ public class CloudStoreHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校区活跃数据
|
||||
*
|
||||
* @param date 查询日期
|
||||
* @return List<Object>
|
||||
* @author DB
|
||||
* @since 2024/4/12
|
||||
*/
|
||||
public List<CloudStoreActiveDto> getStoreActiveData(String date) {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("_type", "storeLogNum");
|
||||
jsonBody.put("logDate", date);
|
||||
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.COMMON_USE_URL, jsonBody, JSONObject.class);
|
||||
if (jsonObject != null) {
|
||||
if (!jsonObject.getBoolean("success")) {
|
||||
throw new UtilException(jsonObject.getString("error"));
|
||||
}
|
||||
return jsonObject.getJSONArray("data").toJavaList(CloudStoreActiveDto.class);
|
||||
} else {
|
||||
throw new UtilException("获取云校区活跃数据失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,17 +40,17 @@ public class CpopGenerator {
|
||||
/**
|
||||
* 输出路径
|
||||
*/
|
||||
private static final String EXPORT_URL = "/Cpop-Oam";
|
||||
private static final String EXPORT_URL = "/Cpop-Jambox";
|
||||
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
private static final String EXPORT_ITEM = "oam";
|
||||
private static final String EXPORT_ITEM = "jambox";
|
||||
|
||||
/**
|
||||
* 表前缀
|
||||
*/
|
||||
private static final String TABLE_PREFIX = "cp_oam_";
|
||||
private static final String TABLE_PREFIX = "cp_j_";
|
||||
|
||||
/**
|
||||
* 主入口
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
package com.cpop.jambox.business.entity;
|
||||
|
||||
import com.cpop.core.base.entity.BaseEntity;
|
||||
import com.cpop.core.base.entity.BaseInsertListener;
|
||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 校区活跃数表 实体类。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_j_store_active", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class StoreActive extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 品牌名
|
||||
*/
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 品牌云id
|
||||
*/
|
||||
private String brandCloudId;
|
||||
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 校区云id
|
||||
*/
|
||||
private String storeCloudId;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate activeDate;
|
||||
|
||||
/**
|
||||
* 活跃数
|
||||
*/
|
||||
private Integer activeNum;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.jambox.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.jambox.business.entity.StoreActive;
|
||||
|
||||
/**
|
||||
* 校区活跃数表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-12
|
||||
*/
|
||||
public interface StoreActiveMapper extends BaseMapper<StoreActive> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.jambox.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.jambox.business.entity.StoreActive;
|
||||
|
||||
/**
|
||||
* 校区活跃数表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-12
|
||||
*/
|
||||
public interface StoreActiveService extends IService<StoreActive> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.jambox.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.jambox.business.entity.StoreActive;
|
||||
import com.cpop.jambox.business.mapper.StoreActiveMapper;
|
||||
import com.cpop.jambox.business.service.StoreActiveService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 校区活跃数表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-12
|
||||
*/
|
||||
@Service("storeActiveService")
|
||||
public class StoreActiveServiceImpl extends ServiceImpl<StoreActiveMapper, StoreActive> implements StoreActiveService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?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.cpop.jambox.business.mapper.StoreActiveMapper">
|
||||
|
||||
</mapper>
|
||||
@ -4,7 +4,7 @@ cpop:
|
||||
profile: E:/Cpop/uploadPath
|
||||
jwt:
|
||||
#白名单
|
||||
whiteList: /websocket/*,/login,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/cloudCallback/*
|
||||
whiteList: /websocket/*,/login,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/cloudCallback/*,/mini/summit/*
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
# 公钥文件
|
||||
|
||||
@ -4,7 +4,7 @@ cpop:
|
||||
profile: /root/cpop-union/cpop-oam/upload
|
||||
jwt:
|
||||
#白名单
|
||||
whiteList: /websocket/*,/login,/backstage/wxOpen/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/mini/sysCommon/miniSyncBrandAndStore
|
||||
whiteList: /websocket/*,/login,/backstage/wxOpen/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/mini/sysCommon/miniSyncBrandAndStore,/mini/summit/*
|
||||
#拦截
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
|
||||
@ -4,7 +4,7 @@ cpop:
|
||||
profile: /root/cpop-union/cpop-mall/upload
|
||||
jwt:
|
||||
#白名单
|
||||
whiteList: /websocket/*,/login,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**
|
||||
whiteList: /websocket/*,/login,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/mini/summit/*
|
||||
#拦截
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
package com.cpop.oam.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.cpop.api.cloudDb.core.dto.CloudStoreActiveDto;
|
||||
import com.cpop.api.cloudDb.handler.CloudStoreHandler;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.common.utils.bean.BeanUtils;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.jambox.business.entity.BrandExtend;
|
||||
import com.cpop.jambox.business.entity.CardTemplate;
|
||||
import com.cpop.jambox.business.entity.CardTemplateExtend;
|
||||
import com.cpop.jambox.business.entity.StoreExtend;
|
||||
import com.cpop.jambox.business.service.BrandExtendService;
|
||||
import com.cpop.jambox.business.service.CardTemplateExtendService;
|
||||
import com.cpop.jambox.business.service.CardTemplateService;
|
||||
import com.cpop.jambox.business.service.StoreExtendService;
|
||||
import com.cpop.jambox.business.entity.*;
|
||||
import com.cpop.jambox.business.service.*;
|
||||
import com.cpop.oam.business.entity.Clue;
|
||||
import com.cpop.oam.business.entity.Task;
|
||||
import com.cpop.oam.business.entity.TaskWorkOrder;
|
||||
@ -35,6 +32,7 @@ import com.mybatisflex.core.update.UpdateChain;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
@ -390,4 +388,25 @@ public class CpopDataSyncTests {
|
||||
SpringUtils.getBean(ClueService.class).saveBatch(clues);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入校区活跃数
|
||||
* @author DB
|
||||
* @since 2024/4/12
|
||||
*/
|
||||
@Test
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importStoreActiveData(){
|
||||
LocalDate localDate = LocalDate.of(2024, 4, 4);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
LocalDate date = localDate.plusDays(i);
|
||||
List<CloudStoreActiveDto> storeActiveData = SpringUtils.getBean(CloudStoreHandler.class).getStoreActiveData(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
List<StoreActive> storeActives = BeanUtils.mapToList(storeActiveData, StoreActive.class);
|
||||
if (!storeActives.isEmpty()) {
|
||||
storeActives.forEach(item -> {
|
||||
item.setActiveDate(date);
|
||||
});
|
||||
SpringUtils.getBean(StoreActiveService.class).saveBatch(storeActives);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,8 +51,8 @@ public class CpopEasyLearnDataAnalyseTest{
|
||||
.select("out_order_no")
|
||||
.select("create_time")
|
||||
.from("j_wx_pay_profit_sharing")
|
||||
.where("create_time >= ?", "2024-03-24 00:00:00")
|
||||
//.between("create_time", "2023-10-23 00:00:00","2023-11-13 22:00:00")
|
||||
.where("create_time >= ?", "2024-04-08 19:00:00")
|
||||
//.between("create_time", "2023-04-23 00:00:00","2023-11-13 22:00:00")
|
||||
.list();
|
||||
List<Row> insertList = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package com.cpop.oam.business.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-04-10 14:41
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "峰会报名请求参数")
|
||||
public class SummitApplyBo {
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
@NotBlank(message = "微信openId不能为空")
|
||||
@ApiModelProperty(value = "微信openId",required = true)
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@NotBlank(message = "机构名称不能为空")
|
||||
@ApiModelProperty(value = "机构名称",required = true)
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 牌匾号
|
||||
*/
|
||||
@NotBlank(message = "牌匾号不能为空")
|
||||
@ApiModelProperty(value = "牌匾号",required = true)
|
||||
private String boardName;
|
||||
|
||||
/**
|
||||
* 是否是会员
|
||||
*/
|
||||
@ApiModelProperty(value = "是否是会员")
|
||||
private String isMember = "是";
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
@NotNull(message = "参会人数不能为空")
|
||||
@ApiModelProperty(value = "参会人数")
|
||||
private Integer joinNum;
|
||||
|
||||
/**
|
||||
* 参会人员
|
||||
*/
|
||||
@NotEmpty(message = "参会人员不能为空")
|
||||
@ApiModelProperty(value = "参会人员",required = true)
|
||||
private List<JoinUser> users;
|
||||
|
||||
/**
|
||||
* 房间数
|
||||
*/
|
||||
@ApiModelProperty(value = "房间数")
|
||||
private Integer roomNum;
|
||||
|
||||
/**
|
||||
* 需要房间
|
||||
*/
|
||||
@ApiModelProperty(value = "需要房间")
|
||||
private String needRoom = "是";
|
||||
|
||||
/**
|
||||
* 参加晚宴
|
||||
*/
|
||||
@ApiModelProperty(value = "参加晚宴")
|
||||
private String joinParty = "是";
|
||||
|
||||
/**
|
||||
* 参加交流会
|
||||
*/
|
||||
@ApiModelProperty(value = "参加交流会")
|
||||
private String joinMeeting = "是";
|
||||
|
||||
@Data
|
||||
@ApiModel("参会人员信息")
|
||||
public static class JoinUser {
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ApiModelProperty(value = "姓名",required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ApiModelProperty(value = "手机号",required = true)
|
||||
private String phone;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,157 @@
|
||||
package com.cpop.oam.business.controller.mini;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
|
||||
import com.cpop.common.utils.bean.BeanUtils;
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.core.base.exception.ServiceException;
|
||||
import com.cpop.core.handler.TencentCosHandler;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.core.utils.file.FileUtils;
|
||||
import com.cpop.oam.business.bo.SummitApplyBo;
|
||||
import com.cpop.oam.business.dto.SummitApplyDto;
|
||||
import com.cpop.oam.business.entity.SummitApply;
|
||||
import com.cpop.oam.business.entity.SummitApplyUser;
|
||||
import com.cpop.oam.business.service.SummitApplyService;
|
||||
import com.cpop.oam.business.service.SummitApplyUserService;
|
||||
import com.cpop.oam.framework.constant.WebHookKeyConstant;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.qcloud.cos.model.UploadResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.oam.business.entity.table.SummitApplyTableDef.SUMMIT_APPLY;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-04-10 14:33
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "小程序峰会接口")
|
||||
@RequestMapping("/mini/summit")
|
||||
@Slf4j
|
||||
public class MiniSummitController {
|
||||
|
||||
@Autowired
|
||||
private SummitApplyService summitApplyService;
|
||||
|
||||
@Autowired
|
||||
private SummitApplyUserService summitApplyUserService;
|
||||
|
||||
/**
|
||||
* 获取峰会二维码
|
||||
* @author DB
|
||||
* @since 2023/12/07
|
||||
*/
|
||||
@ApiOperation("获取峰会二维码")
|
||||
@GetMapping("/getSummitQrCode")
|
||||
@Deprecated
|
||||
public R<String> getSummitQrCode() throws WxErrorException, IOException {
|
||||
WxMaQrcodeService qrcodeService = SpringUtils.getBean(WxMaService.class).getQrcodeService();
|
||||
//"release"
|
||||
File qrCode = qrcodeService.createWxaCodeUnlimit("100", "pages/pay/pay", false, "trial", 430,
|
||||
true, null, false);
|
||||
MultipartFile multipartFile = FileUtils.getInstance().getMultipartFile(qrCode);
|
||||
TencentCosHandler tencentCosHandler = SpringUtils.getBean(TencentCosHandler.class);
|
||||
UploadResult uploadResult = tencentCosHandler.cdnUpload(multipartFile);
|
||||
return R.ok("https://" + uploadResult.getBucketName() + tencentCosHandler.getCdnUrl() + uploadResult.getKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否已报名
|
||||
* @author DB
|
||||
* @since 2024/4/10
|
||||
* @param openId openId
|
||||
* @return R<Boolean>
|
||||
*/
|
||||
@ApiOperation("是否已报名")
|
||||
@GetMapping("/haveSummitApply")
|
||||
public R<Boolean> haveSummitApply(@RequestParam @ApiParam("openId") String openId) {
|
||||
long count = summitApplyService.count(QueryWrapper.create().where(SUMMIT_APPLY.OPEN_ID.eq(openId)));
|
||||
return R.ok(count > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 峰会报名
|
||||
* @author DB
|
||||
* @since 2024/4/10
|
||||
* @param bo 请求参数
|
||||
* @return R<String>
|
||||
*/
|
||||
@ApiOperation("峰会报名")
|
||||
@PostMapping("/summitApply")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<String> summitApply(@RequestBody @Validated SummitApplyBo bo) {
|
||||
long count = summitApplyService.count(QueryWrapper.create().where(SUMMIT_APPLY.OPEN_ID.eq(bo.getOpenId())));
|
||||
if (count > 0) {
|
||||
throw new ServiceException("您已报名,请勿重复提交!");
|
||||
}
|
||||
SummitApply summitApply = BeanUtils.mapToClass(bo, SummitApply.class);
|
||||
summitApplyService.save(summitApply);
|
||||
List<SummitApplyUser> summitApplyUsers = BeanUtils.mapToList(bo.getUsers(), SummitApplyUser.class);
|
||||
summitApplyUsers.forEach(item->{
|
||||
item.setSummitApplyId(summitApply.getId());
|
||||
});
|
||||
summitApplyUserService.saveBatch(summitApplyUsers);
|
||||
// 企微通知值班人员
|
||||
List<String> phoneList = new ArrayList<String>();
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
.webHookSendText(WebHookKeyConstant.MARKET_BOT,
|
||||
phoneList,
|
||||
"==========2024峰会报名==========\n" +
|
||||
"机构" + bo.getStoreName() + "报名成功",
|
||||
true);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("发送消息通知失败!");
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出峰会申请
|
||||
* @author DB
|
||||
* @since 2024/4/10
|
||||
* @param response 响应流
|
||||
*/
|
||||
@ApiOperation(value = "导出峰会申请", notes = "export", produces = "application/octet-stream")
|
||||
@GetMapping("/exportSummitApply")
|
||||
public void exportSummitApply(HttpServletResponse response) throws IOException {
|
||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系
|
||||
String fileName = URLEncoder.encode("峰会报名数据", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=" + fileName + ".xlsx");
|
||||
//获取峰会数据
|
||||
Map<String, SummitApply> summitApplyMap = summitApplyService.list().stream().collect(Collectors.toMap(SummitApply::getId, item -> item));
|
||||
List<SummitApplyDto> summitApplyDtos = summitApplyUserService.listAs(QueryWrapper.create(), SummitApplyDto.class);
|
||||
Map<String, List<SummitApplyDto>> summitApplyDtoMap = summitApplyDtos.stream().collect(Collectors.groupingBy(SummitApplyDto::getSummitApplyId));
|
||||
summitApplyDtoMap.forEach((key, value) -> {
|
||||
SummitApply summitApply = summitApplyMap.get(key);
|
||||
value.forEach(item -> {
|
||||
BeanUtils.copyBeanProp(item, summitApply);
|
||||
});
|
||||
});
|
||||
EasyExcel.write(response.getOutputStream(), SummitApplyDto.class).sheet("报名信息").doWrite(summitApplyDtos);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.cpop.oam.business.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ContentLoopMerge;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-04-10 15:08
|
||||
*/
|
||||
@Data
|
||||
public class SummitApplyDto {
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@ExcelProperty("机构名称")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 牌匾号
|
||||
*/
|
||||
@ExcelProperty("牌匾号")
|
||||
private String boardName;
|
||||
|
||||
/**
|
||||
* 是否是会员
|
||||
*/
|
||||
@ExcelProperty("是否是会员")
|
||||
private String isMember;
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
@ExcelProperty("参会人数")
|
||||
private Integer joinNum;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 房间数
|
||||
*/
|
||||
@ExcelProperty("房间数")
|
||||
private Integer roomNum;
|
||||
|
||||
/**
|
||||
* 需要房间
|
||||
*/
|
||||
@ExcelProperty("需要房间")
|
||||
private String needRoom;
|
||||
|
||||
/**
|
||||
* 参加晚宴
|
||||
*/
|
||||
@ExcelProperty("参加晚宴")
|
||||
private String joinParty;
|
||||
|
||||
/**
|
||||
* 参加交流会
|
||||
*/
|
||||
@ExcelProperty("参加交流会")
|
||||
private String joinMeeting;
|
||||
|
||||
/**
|
||||
* 申请字段
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String summitApplyId;
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.cpop.oam.business.entity;
|
||||
|
||||
import com.cpop.core.base.entity.BaseEntity;
|
||||
import com.cpop.core.base.entity.BaseInsertListener;
|
||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 峰会报名表 实体类。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_summit_apply", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class SummitApply extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 报名id
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* openId
|
||||
*/
|
||||
@Id
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 牌匾号
|
||||
*/
|
||||
private String boardName;
|
||||
|
||||
/**
|
||||
* 是否是会员
|
||||
*/
|
||||
private String isMember;
|
||||
|
||||
/**
|
||||
* 参会人数
|
||||
*/
|
||||
private Integer joinNum;
|
||||
|
||||
/**
|
||||
* 房间数
|
||||
*/
|
||||
private Integer roomNum;
|
||||
|
||||
/**
|
||||
* 需要房间
|
||||
*/
|
||||
private String needRoom;
|
||||
|
||||
/**
|
||||
* 参加晚宴
|
||||
*/
|
||||
private String joinParty;
|
||||
|
||||
/**
|
||||
* 参加交流会
|
||||
*/
|
||||
private String joinMeeting;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.cpop.oam.business.entity;
|
||||
|
||||
import com.cpop.core.base.entity.BaseEntity;
|
||||
import com.cpop.core.base.entity.BaseInsertListener;
|
||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 峰会参加人员 实体类。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_summit_apply_user", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class SummitApplyUser extends BaseEntity implements Serializable {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 峰会报名id
|
||||
*/
|
||||
@Id
|
||||
private String summitApplyId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.oam.business.entity.SummitApply;
|
||||
|
||||
/**
|
||||
* 峰会报名表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface SummitApplyMapper extends BaseMapper<SummitApply> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.oam.business.entity.SummitApplyUser;
|
||||
|
||||
/**
|
||||
* 峰会参加人员 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface SummitApplyUserMapper extends BaseMapper<SummitApplyUser> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.entity.SummitApply;
|
||||
|
||||
/**
|
||||
* 峰会报名表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface SummitApplyService extends IService<SummitApply> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.entity.SummitApplyUser;
|
||||
|
||||
/**
|
||||
* 峰会参加人员 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface SummitApplyUserService extends IService<SummitApplyUser> {
|
||||
|
||||
}
|
||||
@ -13,7 +13,6 @@ import com.cpop.oam.business.bo.ClueFollowUpBo;
|
||||
import com.cpop.oam.business.bo.CluePutOffBo;
|
||||
import com.cpop.oam.business.bo.ClueUpdateBo;
|
||||
import com.cpop.oam.business.entity.*;
|
||||
import com.cpop.oam.business.mapper.CluePutOffMapper;
|
||||
import com.cpop.oam.business.service.*;
|
||||
import com.cpop.oam.business.vo.*;
|
||||
import com.cpop.oam.framework.constant.OamRedisConstant;
|
||||
@ -465,11 +464,13 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
||||
.select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID)
|
||||
.select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE)
|
||||
.select(BRAND.BRAND_NAME)
|
||||
.select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime))
|
||||
// 跟进间隔
|
||||
.select(dateDiff(now(), CLUE.LAST_FOLLOW_UP_TIME).as(CluePageVo::getFollowUpInterval))
|
||||
.from(CLUE)
|
||||
.leftJoin(STORE).on(STORE.ID.eq(CLUE.STORE_ID))
|
||||
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
|
||||
.leftJoin(STORE_SIGN).on(STORE_SIGN.STORE_ID.eq(STORE.ID))
|
||||
//地区
|
||||
.and(CLUE.CITY.in(cityList))
|
||||
.and(CLUE.CITY.eq(city))
|
||||
@ -527,7 +528,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
||||
public Page<CluePageVo> getPublicCluePage(String city, String brandId, String storeId, String chargeOrPhone) {
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
int year = LocalDate.now().getYear();
|
||||
/*int year = LocalDate.now().getYear();
|
||||
List<String> cityList = SpringUtils.getBean(SignAreaService.class).queryChain()
|
||||
.select(distinct(SIGN_AREA.CITY))
|
||||
.leftJoin(SIGN_GOAL).on(SIGN_GOAL.ID.eq(SIGN_AREA.SIGN_GOAL_ID))
|
||||
@ -538,18 +539,20 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
||||
}
|
||||
if (!StringUtils.equals("其他", city)) {
|
||||
queryWrapper.and(CLUE.CITY.eq(city));
|
||||
}
|
||||
}*/
|
||||
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper
|
||||
.select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID)
|
||||
.select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE)
|
||||
.select(BRAND.BRAND_NAME)
|
||||
.select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime))
|
||||
// 跟进间隔
|
||||
.select(dateDiff(now(), CLUE.LAST_FOLLOW_UP_TIME).as(CluePageVo::getFollowUpInterval))
|
||||
.from(CLUE)
|
||||
.leftJoin(STORE).on(STORE.ID.eq(CLUE.STORE_ID))
|
||||
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
|
||||
.leftJoin(STORE_SIGN).on(STORE_SIGN.STORE_ID.eq(STORE.ID))
|
||||
//地区
|
||||
.and(CLUE.CITY.notIn(cityList))
|
||||
//.and(CLUE.CITY.notIn(cityList))
|
||||
//品牌
|
||||
.and(BRAND.ID.eq(brandId))
|
||||
//校区
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.oam.business.entity.SummitApply;
|
||||
import com.cpop.oam.business.mapper.SummitApplyMapper;
|
||||
import com.cpop.oam.business.service.SummitApplyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 峰会报名表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Service("summitApplyService")
|
||||
public class SummitApplyServiceImpl extends ServiceImpl<SummitApplyMapper, SummitApply> implements SummitApplyService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.oam.business.entity.SummitApplyUser;
|
||||
import com.cpop.oam.business.mapper.SummitApplyUserMapper;
|
||||
import com.cpop.oam.business.service.SummitApplyUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 峰会参加人员 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Service("summitApplyUserService")
|
||||
public class SummitApplyUserServiceImpl extends ServiceImpl<SummitApplyUserMapper, SummitApplyUser> implements SummitApplyUserService {
|
||||
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.cpop.oam.framework.tasks;
|
||||
|
||||
import com.cpop.api.cloudDb.core.dto.CloudStoreActiveDto;
|
||||
import com.cpop.api.cloudDb.handler.CloudStoreHandler;
|
||||
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.common.utils.bean.BeanUtils;
|
||||
@ -8,6 +10,8 @@ import com.cpop.core.base.table.SysConfig;
|
||||
import com.cpop.core.service.CoreService;
|
||||
import com.cpop.core.service.RedisService;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.jambox.business.entity.StoreActive;
|
||||
import com.cpop.jambox.business.service.StoreActiveService;
|
||||
import com.cpop.oam.business.entity.Clue;
|
||||
import com.cpop.oam.business.entity.ClueRecord;
|
||||
import com.cpop.oam.business.entity.DataImport;
|
||||
@ -32,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -259,4 +264,23 @@ public class OamScheduledTasks {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 每天晚上1点40或前天校区活跃数
|
||||
* @author DB
|
||||
* @since 2024/4/12
|
||||
*/
|
||||
@Scheduled(cron = "0 40 1 * * *")
|
||||
public void getStoreActivityData(){
|
||||
LocalDate date = LocalDate.now().minusDays(1);
|
||||
List<CloudStoreActiveDto> storeActiveData = SpringUtils.getBean(CloudStoreHandler.class).getStoreActiveData(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
List<StoreActive> storeActives = BeanUtils.mapToList(storeActiveData, StoreActive.class);
|
||||
if (!storeActives.isEmpty()){
|
||||
storeActives.forEach(item->{
|
||||
item.setActiveDate(date);
|
||||
});
|
||||
SpringUtils.getBean(StoreActiveService.class).saveBatch(storeActives);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
7
Cpop-Oam/src/main/resources/mapper/SummitApplyMapper.xml
Normal file
7
Cpop-Oam/src/main/resources/mapper/SummitApplyMapper.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?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.cpop.oam.business.mapper.SummitApplyMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?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.cpop.oam.business.mapper.SummitApplyUserMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user