Java8->Java17(二)

This commit is contained in:
DB 2024-04-23 18:24:30 +08:00
parent 69dbc94b48
commit 25773526cd
98 changed files with 1051 additions and 2457 deletions

View File

@ -14,7 +14,7 @@ public class CpopDataSourceShardingStrategy implements DataSourceShardingStrateg
@Override
public String doSharding(String currentDataSourceKey, Object mapper, Method mapperMethod, Object[] methodArgs){
// 不管 other 数据源的情况
if ("oam".equals(currentDataSourceKey)){
if ("jambox".equals(currentDataSourceKey)){
return currentDataSourceKey;
}
@ -22,7 +22,7 @@ public class CpopDataSourceShardingStrategy implements DataSourceShardingStrateg
/*if (StringUtils.startWithAny(mapperMethod.getName(), "insert", "delete", "update")){
return "master";
}*/
return "jambox";
return "oam";
//其他场景使用 slave1 或者 slave2 进行负载均衡
//return "slave";
}

View File

@ -2,6 +2,6 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jambox.core.mapper.ConfigMapper">
<mapper namespace="com.cpop.core.mapper.ConfigMapper">
</mapper>

View File

@ -2,6 +2,6 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jambox.core.mapper.OperationLogMapper">
<mapper namespace="com.cpop.core.mapper.OperationLogMapper">
</mapper>

View File

@ -2,6 +2,6 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jambox.core.mapper.UserMapper">
<mapper namespace="com.cpop.core.mapper.UserMapper">
</mapper>

View File

@ -28,11 +28,6 @@
<groupId>com.cpop</groupId>
<artifactId>Cpop-Pay</artifactId>
</dependency>
<!--微信小程序-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -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/*,/mini/summit/*
white-list: /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:
# 公钥文件
@ -16,6 +16,7 @@ cpop:
spring:
application:
name: Cpop-Oam-Dev
data:
#redis配置
redis:
#地址
@ -30,89 +31,63 @@ spring:
timeout: 5000
jedis:
pool:
#
min-idle: 0
#
max-idle: 16
#
max-active: 16
#
max-wait: -1ms
client-type: jedis
data:
mongodb:
host: localhost
port: 27017
database: cpop-dev
username: Cpop
password: Admin@123
server:
port: 9420
servlet:
context-path: /Cpop-Oam
# mongo-plus
mongo-plus:
data:
mongodb:
#ip
host: 1panel.cpopsz.com
#端口
port: 27017
#数据库名
database: jambox_dev
#用户名,没有可不填(若账号中出现@,!等等符号,不需要再进行转码!!!)
username: mongo_kBXjhm
#密码,同上(若密码中出现@,!等等符号,不需要再进行转码!!!)
password: mongo_7RF4Zj
#验证数据库 admin
authentication-database: admin
connect-timeout-m-s: 50000
#Mybatis-Flex
mybatis-flex:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
datasource:
oam:
url: jdbc:mysql://localhost:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Admin@123
password: Customer0401
jambox:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: root
password: Customer0401
# springdoc-openapi项目配置
springdoc:
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
api-docs:
path: /v3/api-docs
group-configs:
- group: '系统后台'
paths-to-match: '/**'
packages-to-scan: com.cpop.oam.business.controller.backstage
# knife4j的增强配置不需要增强可以不配
knife4j:
enable: true
openapi:
title: PuPu-OAM开发API
description: PuPu-OAM开发API
email:
concat: DB
url: https://api.jamboxsys.com
version: 1.0.0
license: Apache 2.0
license-url: https://stackoverflow.com/
terms-of-service-url: https://api.jamboxsys.com
group:
#系统
Oam:
group-name: Oam
api-rule: package
api-rule-resources:
- com.cpop.oam
#系统
System:
group-name: System
api-rule: package
api-rule-resources:
- com.cpop.system
#果酱
Jambox:
group-name: Jambox
api-rule: package
api-rule-resources:
- com.cpop.jambox
#微信
wx:
pay:
# p12证书的位置可以指定绝对路径也可以指定类路径以classpath:开头)
keyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.p12
# 私钥证书
privateKeyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_key.pem
# 私钥文件
privateCertPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.pem
# 先学后付用户签约通知地址
learn-now-pay-later-user-sign-plan-notify-url: https://frp-oak.top:11899/Cpop-Oam/callback/easyLearn/learnNowPayLaterUserSignPlanNotify
# 先学后付用户核销通知地址
learn-now-pay-later-service-order-notify-url: https://frp-oak.top:11899/Cpop-Oam/callback/easyLearn/learnNowPayLaterUserSignPlanNotify
#数币
ecpp:
pay:
base-url: https://newstage.ecnyenter.com
setting:
language: zh_cn

View File

@ -12,6 +12,25 @@ cpop:
# 初始化大小
keySize: 2048
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
sa-token:
# token 名称(同时也是 cookie 名称)
token-name: Authorization
# token 有效期(单位:秒) 默认30天-1 代表永久有效
timeout: 604800
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
active-timeout: -1
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
is-concurrent: false
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token
is-share: true
# token 风格默认可取值uuid、simple-uuid、random-32、random-64、random-128、tik
token-style: random-64
# 是否输出操作日志
is-log: true
# jwt秘钥
jwt-secret-key: asdasdasifhueuizzurfewbfjsdafjk
#Spring
spring:
mvc:

View File

@ -19,10 +19,6 @@
<groupId>com.cpop</groupId>
<artifactId>Cpop-Core</artifactId>
</dependency>
<dependency>
<groupId>com.cpop</groupId>
<artifactId>Cpop-Jambox</artifactId>
</dependency>
<dependency>
<groupId>com.cpop</groupId>
<artifactId>Cpop-System</artifactId>
@ -45,11 +41,6 @@
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<!-- 打卡Demo包 -->
<dependency>
<groupId>com.cpop</groupId>
<artifactId>Cpop-ClockIn-Demo</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,13 +1,11 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author DB
* @version 1.0.0
@ -15,27 +13,27 @@ import javax.validation.constraints.NotNull;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "ChangePlugOpenBo对象")
@Schema(description = "ChangePlugOpenBo对象")
public class ChangePlugOpenBo {
/**
* 校区
*/
@NotBlank(message = "校区不能为空")
@ApiModelProperty(value = "校区",required = true)
@Schema(description = "校区",requiredMode = Schema.RequiredMode.REQUIRED)
private String storeId;
/**
* 插件
*/
@NotBlank(message = "插件不能为空")
@ApiModelProperty(value = "插件",required = true)
@Schema(description = "插件",requiredMode = Schema.RequiredMode.REQUIRED)
private String plugTag;
/**
* 开启与关闭
*/
@NotNull(message = "开启与关闭不能为空")
@ApiModelProperty(value = "开启与关闭",required = true)
@Schema(description = "开启与关闭",requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean isOpen;
}

View File

@ -1,11 +1,10 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import java.sql.Date;
/**
@ -15,43 +14,43 @@ import java.sql.Date;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "CloudUnionCallbackBo对象", description = "云回调统一入参")
@Schema(description = "云回调统一入参")
public class CloudUnionCallbackBo {
/**
* 回调枚举(DATA_IMPORT_CALLBACK:数据导入回调)
*/
@NotBlank(message = "回调枚举不能为空")
@ApiModelProperty(value = "回调枚举(DATA_IMPORT_CALLBACK:数据导入回调;SYNC_BRAND_AND_STORE_CALLBACK:同步品牌与校区)",required = true)
@Schema(description = "回调枚举(DATA_IMPORT_CALLBACK:数据导入回调;SYNC_BRAND_AND_STORE_CALLBACK:同步品牌与校区)",required = true)
private String callbackEnum;
/**
* 主要id
*/
@ApiModelProperty(value = "主要id")
@Schema(description = "主要id")
private String mainId;
/**
* 同步品牌与校区相关参数
*/
@ApiModelProperty(value = "同步品牌与校区相关参数")
@Schema(description = "同步品牌与校区相关参数")
private SyncBrandAndStore syncBrandAndStore;
@Data
@ApiModel("同步品牌与校区")
@Schema(description = "同步品牌与校区")
public class SyncBrandAndStore {
/**
* 品牌
*/
@ApiModelProperty(value = "品牌")
private SyncBrandAndStoreBo.BrandInfo brandInfo;
@Schema(description = "品牌")
private BrandInfo brandInfo;
/**
* 校区
*/
@ApiModelProperty(value = "校区")
private SyncBrandAndStoreBo.StoreInfo storeInfo;
@Schema(description = "校区")
private StoreInfo storeInfo;
/**
@ -63,13 +62,13 @@ public class CloudUnionCallbackBo {
/**
* 云品牌id
*/
@ApiModelProperty(value = "云品牌id")
@Schema(description = "云品牌id")
private String brandCloudId;
/**
* 品牌名
*/
@ApiModelProperty(value = "品牌名")
@Schema(description = "品牌名")
private String brandName;
}
@ -82,79 +81,79 @@ public class CloudUnionCallbackBo {
/**
* 云品牌id
*/
@ApiModelProperty(value = "云校区id")
@Schema(description = "云校区id")
private String storeCloudId;
/**
* 店铺/校区名
*/
@ApiModelProperty(value = "店铺/校区名")
@Schema(description = "店铺/校区名")
private String storeName;
/**
* 店铺/校区地址
*/
@ApiModelProperty(value = "店铺/校区地址")
@Schema(description = "店铺/校区地址")
private String storeAddr;
/**
* 负责人
*/
@ApiModelProperty(value = "负责人")
@Schema(description = "负责人")
private String personCharge;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
@Schema(description = "手机号")
private String phone;
/**
* 营业执照地址
*/
@ApiModelProperty(value = "营业执照地址")
@Schema(description = "营业执照地址")
private String licenseAddr;
/**
* 营业执照日期
*/
@ApiModelProperty(value = "营业执照日期")
@Schema(description = "营业执照日期")
private Date licenseDate;
/**
* 营业执照公司名
*/
@ApiModelProperty(value = "营业执照公司名")
@Schema(description = "营业执照公司名")
private String licenseName;
/**
* 营业执照证书码
*/
@ApiModelProperty(value = "营业执照证书码")
@Schema(description = "营业执照证书码")
private String licenseCode;
/**
* 营业执照法人名
*/
@ApiModelProperty(value = "营业执照法人名")
@Schema(description = "营业执照法人名")
private String licenseUserName;
/**
* 营业执照图片地址
*/
@ApiModelProperty(value = "营业执照图片地址")
@Schema(description = "营业执照图片地址")
private String licensePicUrl;
/**
* 经度
*/
@ApiModelProperty(value = "经度")
@Schema(description = "经度")
private String longitude;
/**
* 纬度
*/
@ApiModelProperty(value = "纬度")
@Schema(description = "纬度")
private String latitude;
}
}

View File

@ -1,11 +1,10 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
/**
* @author DB
@ -14,40 +13,40 @@ import javax.validation.constraints.NotBlank;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DataImportBo对象")
@Schema(description = "DataImportBo对象")
public class DataImportBo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
@Schema(description = "主键")
private String id;
/**
* 品牌id
*/
@NotBlank(message = "不能为空")
@ApiModelProperty(value = "品牌")
@Schema(description = "品牌")
private String brandId;
/**
* 校区
*/
@NotBlank(message = "不能为空")
@ApiModelProperty(value = "校区")
@Schema(description = "校区")
private String storeId;
/**
* 导入文件地址
*/
@NotBlank(message = "不能为空")
@ApiModelProperty(value = "导入文件地址")
@Schema(description = "导入文件地址")
private String fileUrl;
/**
* 是否清空
*/
@ApiModelProperty(value = "是否清空")
@Schema(description = "是否清空")
private Boolean isClear;
}

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author DB
@ -15,20 +13,20 @@ import javax.validation.constraints.NotNull;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DataImportPageBo对象")
@Schema(description = "DataImportPageBo对象")
public class DataImportPageBo {
/**
* 导入状态
*/
@NotNull(message = "导入状态不能为空")
@ApiModelProperty(value = "导入状态")
@Schema(description = "导入状态")
private Boolean importStatus;
/**
* 校区名
*/
@ApiModelProperty(value = "校区名")
@Schema(description = "校区名")
private String storeName;
}

View File

@ -1,103 +0,0 @@
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.NotNull;
import java.io.Serializable;
/**
* 员工表Bo
*
* @author DB.lost
* @since 2023-05-11
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Staff对象", description = "员工表")
public class MallStaffBo implements Serializable {
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 姓名不能为空
*/
@NotBlank(message = "姓名不能为空")
@ApiModelProperty("姓名")
private String name;
/**
* 品牌id不能为空
*/
@NotBlank(message = "品牌id不能为空")
@ApiModelProperty(value = "品牌id")
private String brandId;
/**
* 用户id
*/
@ApiModelProperty("用户id")
private String userId;
/**
* 用户名
*/
@NotBlank(message = "用户名不能为空")
@ApiModelProperty(value = "用户名",required = true)
private String userName;
/**
* 密码
*/
@NotBlank(message = "密码不能为空")
@ApiModelProperty(value = "密码",required = true)
private String password;
/**
* 昵称
*/
@NotBlank(message = "昵称不能为空")
@ApiModelProperty(value = "昵称",required = true)
private String nickName;
/**
* 邮箱
*/
@ApiModelProperty(value = "邮箱")
private String email;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
@ApiModelProperty(value = "手机号",required = true)
private String phoneNumber;
/**
* 性别(0:;1:)
*/
@NotNull(message = "性别不能为空")
@ApiModelProperty(value = "性别(0:男;1:女)",required = true)
private Boolean sex;
/**
* 头像
*/
@ApiModelProperty(value = "头像")
private String avatar;
/**
* 状态(0:停用;1:启用)
*/
@NotNull(message = "状态不能为空")
@ApiModelProperty(value = "状态(0:停用;1:启用)",required = true)
private Boolean status;
}

View File

@ -1,29 +0,0 @@
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.NotNull;
import java.io.Serializable;
/**
* 员工表Bo
*
* @author DB.lost
* @since 2023-05-11
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Staff对象", description = "员工表")
public class MallStaffPageBo implements Serializable {
/**
* 姓名不能为空
*/
@ApiModelProperty("姓名")
private String name;
}

View File

@ -1,15 +1,12 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 系统菜单表Bo
@ -19,91 +16,89 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysMenu对象", description = "系统菜单表")
public class MenuBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "系统菜单表")
public class MenuBo {
/**
* 菜单ID
*/
@ApiModelProperty("菜单ID")
@Schema(description ="菜单ID")
private String id;
/**
* 父级菜单ID
*/
@ApiModelProperty("父级菜单ID")
@Schema(description ="父级菜单ID")
private String parentMenu;
/**
* 菜单名称
*/
@ApiModelProperty("菜单名称")
@Schema(description ="菜单名称")
private String name;
/**
* 菜单图标
*/
@ApiModelProperty(value = "菜单图标")
@Schema(description = "菜单图标")
private String icon;
/**
* 菜单路由父菜单为空
*/
@ApiModelProperty("菜单路由,父菜单为空")
@Schema(description ="菜单路由,父菜单为空")
private String component;
/**
* 标记菜单的状态 0:禁用 1启用根据权限正常显示
*/
@NotNull(message = "状态不能为空")
@ApiModelProperty(value = "标记菜单的状态 0:禁用 1启用根据权限正常显示", required = true)
@Schema(description = "标记菜单的状态 0:禁用 1启用根据权限正常显示", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean status;
/**
* 菜单类型0:目录1:菜单2:按钮
*/
@NotNull(message = "菜单类型不能为空")
@ApiModelProperty(value = "菜单类型0:目录1:菜单2:按钮", required = true)
@Schema(description = "菜单类型0:目录1:菜单2:按钮", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer type;
/**
* 权限
*/
@ApiModelProperty("权限")
@Schema(description ="权限")
private String permission;
/**
* 重定向路径一级菜单有值
*/
@ApiModelProperty("重定向路径,一级菜单有值")
@Schema(description ="重定向路径,一级菜单有值")
private String redirect;
/**
* 排序值越小越靠前一级菜单有值
*/
@NotNull(message = "排序不能为空")
@ApiModelProperty(value = "排序,值越小越靠前,一级菜单有值", required = true)
@Schema(description = "排序,值越小越靠前,一级菜单有值", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer orderNo;
/**
* 路由地址
*/
@ApiModelProperty(value = "路由地址")
@Schema(description = "路由地址")
private String path;
/**
* 标题
*/
@NotBlank(message = "标题不能为空")
@ApiModelProperty(value = "标题", required = true)
@Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
private String title;
/**
* 隐藏菜单
*/
@ApiModelProperty("隐藏菜单")
@Schema(description ="隐藏菜单")
private Boolean hideMenu;
}

View File

@ -1,12 +1,9 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* Description:
* date: 2023/4/25 18:01
@ -14,20 +11,18 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
@ApiModel(description = "菜单传入对象")
public class MenuListBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "菜单传入对象")
public class MenuListBo {
/**
* 标题
*/
@ApiModelProperty(value = "标题")
@Schema(description = "标题")
private String title;
/**
* 标记菜单的状态 0:禁用 1启用根据权限正常显示
*/
@ApiModelProperty(value = "标记菜单的状态 0:禁用 1启用根据权限正常显示")
@Schema(description = "标记菜单的状态 0:禁用 1启用根据权限正常显示")
private Boolean status;
}

View File

@ -1,14 +1,13 @@
package com.cpop.oam.business.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 工单暂停请求对象
@ -18,14 +17,14 @@ import javax.validation.constraints.NotNull;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "工单暂停请求对象")
@Schema(description = "工单暂停请求对象")
public class PauseWorkOrderBo {
/**
* 工单id
*/
@NotBlank(message = "工单id不能为空")
@ApiModelProperty("工单id")
@Schema(description = "工单id")
private String workOrderId;
/**
@ -33,7 +32,7 @@ public class PauseWorkOrderBo {
*/
@NotNull(message = "时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("暂停到时间")
@Schema(description = "暂停到时间")
private LocalDateTime pauseExpireTime;
}

View File

@ -1,13 +1,11 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
@ -18,55 +16,53 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysRole对象", description = "系统角色表")
public class RoleBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "系统角色表")
public class RoleBo {
/**
* 主键
*/
@ApiModelProperty("主键")
@Schema(description ="主键")
private String id;
/**
* 角色名称
*/
@NotBlank(message = "角色名称不能为空")
@ApiModelProperty("角色名称")
@Schema(description ="角色名称")
private String roleName;
/**
* 角色值
*/
@NotBlank(message = "角色值不能为空")
@ApiModelProperty("角色值")
@Schema(description ="角色值")
private String roleValue;
/**
* 状态
*/
@NotNull(message = "状态不能为空")
@ApiModelProperty("状态")
@Schema(description ="状态")
private Boolean status;
/**
* 备注
*/
@ApiModelProperty("备注")
@Schema(description ="备注")
private String remark;
/**
* 排序
*/
@NotNull(message = "排序不能为空")
@ApiModelProperty("排序")
@Schema(description ="排序")
private Integer orderNo;
/**
* 菜单集合
*/
@ApiModelProperty("菜单集合")
@Schema(description ="菜单集合")
private List<String> menuIds;
}

View File

@ -1,12 +1,9 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* Description:
* date: 2023/5/9 13:58
@ -15,20 +12,18 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysRole分页对象")
public class RolePageBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "SysRole分页对象")
public class RolePageBo {
/**
* 角色名称
*/
@ApiModelProperty("角色名称")
@Schema(description ="角色名称")
private String roleName;
/**
* 状态
*/
@ApiModelProperty("状态")
@Schema(description ="状态")
private Boolean status;
}

View File

@ -1,14 +1,11 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* Description:
* date: 2023/5/9 14:12
@ -17,22 +14,20 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysRole状态对象", description = "修改角色状态")
public class RoleStatusBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "修改角色状态")
public class RoleStatusBo {
/**
* 主键
*/
@NotBlank(message = "id不能为空")
@ApiModelProperty(value = "主键",required = true)
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
private String id;
/**
* 状态
*/
@NotNull(message = "状态不能为空")
@ApiModelProperty(value = "状态", required = true)
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean status;
}

View File

@ -1,106 +0,0 @@
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;
}
}

View File

@ -1,12 +1,11 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 任务-工单表Bo
@ -16,61 +15,59 @@ import javax.validation.constraints.NotNull;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TaskWorkOrder对象", description = "任务-工单表")
@Schema(description = "任务-工单表")
public class TaskWorkOrderBo {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("主键")
@Schema(description ="主键")
private String id;
/**
* 品牌id
*/
@NotBlank(message = "品牌id不能为空")
@ApiModelProperty(value = "品牌id", required = true)
@Schema(description = "品牌id", requiredMode = Schema.RequiredMode.REQUIRED)
private String brandId;
/**
* 校区id
*/
@NotBlank(message = "校区/店铺id不能为空")
@ApiModelProperty(value = "校区/店铺id", required = true)
@Schema(description = "校区/店铺id", requiredMode = Schema.RequiredMode.REQUIRED)
private String storeId;
/**
* 工单内容
*/
@NotBlank(message = "工单内容不能为空")
@ApiModelProperty(value = "工单内容", required = true)
@Schema(description = "工单内容", requiredMode = Schema.RequiredMode.REQUIRED)
private String taskContent;
/**
* 任务类型(0:迭代;1:需求;2:工单)
*/
@NotNull(message = "任务类型不能为空")
@ApiModelProperty(value = "任务类型(0:迭代;1:需求;2:工单)", required = true)
@Schema(description = "任务类型(0:迭代;1:需求;2:工单)", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer taskType;
/**
* 问题手机号
*/
@ApiModelProperty("问题手机号")
@Schema(description ="问题手机号")
private String phoneNumber;
/**
* 附件地址
*/
@ApiModelProperty("附件地址")
@Schema(description ="附件地址")
private String attachmentUrl;
/**
* 备注
*/
@ApiModelProperty("备注")
@Schema(description ="备注")
private String remark;
}

View File

@ -1,13 +1,10 @@
package com.cpop.oam.business.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* @author DB
@ -16,41 +13,41 @@ import java.time.LocalDateTime;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TechnologyToolBo对象")
@Schema(description = "TechnologyToolBo对象")
public class TechnologyToolBo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
@Schema(description = "主键")
private String id;
/**
* 工具名
*/
@NotBlank(message = "工具名不能为空")
@ApiModelProperty(value = "工具名",required = true)
@Schema(description = "工具名",requiredMode = Schema.RequiredMode.REQUIRED)
private String toolName;
/**
* 工具地址
*/
@NotBlank(message = "工具地址不能为空")
@ApiModelProperty(value = "工具地址",required = true)
@Schema(description = "工具地址",requiredMode = Schema.RequiredMode.REQUIRED)
private String toolUrl;
/**
* 工具介绍
*/
@NotBlank(message = "工具介绍不能为空")
@ApiModelProperty(value = "工具介绍",required = true)
@Schema(description = "工具介绍",requiredMode = Schema.RequiredMode.REQUIRED)
private String toolDesc;
/**
* 工具类型(字典)
*/
@NotBlank(message = "工具类型不能为空")
@ApiModelProperty(value = "工具类型(字典)",required = true)
@Schema(description = "工具类型(字典)",requiredMode = Schema.RequiredMode.REQUIRED)
private String toolType;
}

View File

@ -1,56 +1,52 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author DB
* @createTime 2023/10/10 17:14
* @description
* @since 2023/10/10 17:14
*/
@Data
@ApiModel(value = "OpenPlatformCommit上传代码对象")
public class WxOpenMaCodeCommitBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "OpenPlatformCommit上传代码对象")
public class WxOpenMaCodeCommitBo {
/**
* 授权方 appid
*/
@NotBlank(message = "授权方appid不能为空")
@ApiModelProperty(value = "授权方 appid",required = true)
@Schema(description = "授权方 appid",requiredMode = Schema.RequiredMode.REQUIRED)
private String authorizerAppid;
/**
* 代码库中的代码模板 ID
*/
@NotNull(message = "代码库中的代码模板ID不能为空")
@ApiModelProperty(value = "代码库中的代码模板 ID",required = true)
@Schema(description = "代码库中的代码模板 ID",requiredMode = Schema.RequiredMode.REQUIRED)
private Long templateId;
/**
* 为了方便第三方平台的开发者引入 extAppid 的开发调试工作
*/
@NotBlank(message = "extJson不能为空")
@ApiModelProperty(value = "该参数则是用于控制ext.json配置文件的内容",required = true)
@Schema(description = "该参数则是用于控制ext.json配置文件的内容",requiredMode = Schema.RequiredMode.REQUIRED)
private String extJson;
/**
* 代码版本号开发者可自定义
*/
@NotBlank(message = "代码版本号不能为空")
@ApiModelProperty(value = "代码版本号,开发者可自定义",required = true)
@Schema(description = "代码版本号,开发者可自定义",requiredMode = Schema.RequiredMode.REQUIRED)
private String userVersion;
/**
* 代码描述开发者可自定义
*/
@NotBlank(message = "代码描述不能为空")
@ApiModelProperty(value = "代码描述,开发者可自定义",required = true)
@Schema(description = "代码描述,开发者可自定义",requiredMode = Schema.RequiredMode.REQUIRED)
private String userDesc;
}

View File

@ -1,9 +0,0 @@
package com.cpop.oam.business.bo;
/**
* @author DB
* @createTime 2023/10/10 17:35
* @description
*/
public class WxOpenMaSubmitAuditBo {
}

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author DB
@ -15,21 +13,19 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "WxOpenMaTrialQrCodeBo生产二维码")
public class WxOpenMaTrialQrCodeBo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "WxOpenMaTrialQrCodeBo生产二维码")
public class WxOpenMaTrialQrCodeBo {
/**
* 授权方 appid
*/
@NotBlank(message = "授权方appid不能为空")
@ApiModelProperty(value = "授权方 appid",required = true)
@Schema(description = "授权方 appid",required = true)
private String authorizerAppid;
/**
* 指定二维码扫码后直接进入指定页面并可同时带上参数
*/
@ApiModelProperty("指定二维码扫码后直接进入指定页面并可同时带上参数")
@Schema(description ="指定二维码扫码后直接进入指定页面并可同时带上参数")
private String path;
}

View File

@ -1,98 +0,0 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.core.base.entity.R;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.bo.MallStaffBo;
import com.cpop.oam.business.service.OamMallService;
import com.cpop.oam.business.vo.MallStaffPageVo;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.vo.BrandListVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author DB
* @since 2023/11/09 14:40
*/
@RestController
@Tag(name = "商城管理模块")
@RequestMapping("/backstage/oamMall")
@Deprecated(since = "1.1.0")
public class BackstageOamMallController {
@Autowired
private OamMallService oamMallService;
/**
* 查询商城管理员分页列表
* @author DB
* @since 2023/11/09 15:33
* @param brandIds 品牌id集合
* @param name 姓名
* @return com.cpop.core.base.entity.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.MallStaffPageVo>>
*/
@GetMapping("/getMallStaffPage")
public R<Page<MallStaffPageVo>> getMallStaffPage(String brandIds, String name) {
Page<MallStaffPageVo> page = oamMallService.getMallStaffPage(brandIds, name);
return R.ok(page);
}
/**
* 查询品牌列表
* @author DB
* @since 2023/11/10 11:45
* @return com.cpop.core.base.entity.R<java.util.List<com.cpop.system.business.vo.BrandListVo>>
*/
@GetMapping("/getBrandList")
public R<List<BrandListVo>> getBrandList() {
List<BrandListVo> list = SpringUtils.getBean(BrandService.class).queryChain().listAs(BrandListVo.class);
return R.ok(list);
}
/**
* 用户名是否存在
* @author DB
* @since 2023/11/10 12:03
* @param username 用户名
* @param id id
* @param userType 用户类型
* @return com.cpop.core.base.entity.R<java.lang.Void>
*/
@GetMapping("/isAccountExist")
public R<Void> isAccountExist(@Parameter(description = "用户名") String username, @Parameter(description = "userId") String id, @Parameter(description = "用户类型") String userType) {
//SpringUtils.getBean(UserService.class).isAccountExist(username, id, userType);
return R.ok();
}
/**
* 新增管理员
* @author DB
* @since 2023/09/08 14:04
* @param bo 请求参数
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PostMapping("/insertAdmin")
public R<Void> insertAdmin(@RequestBody @Validated MallStaffBo bo) {
oamMallService.insertAdmin(bo);
return R.ok();
}
/**
* 删除管理员
* @author DB
* @since 2023/11/10 14:33
* @param id 主键
* @return com.cpop.core.base.entity.R<java.lang.Void>
*/
@DeleteMapping("/removeAdmin/{id}")
public R<Void> removeAdmin(@PathVariable String id) {
oamMallService.removeAdmin(id);
return R.ok();
}
}

View File

@ -1,28 +1,8 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.core.base.entity.R;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.jambox.business.bo.PlugBo;
import com.cpop.jambox.business.entity.StorePlug;
import com.cpop.jambox.business.service.PlugService;
import com.cpop.jambox.business.service.StorePlugService;
import com.cpop.jambox.business.vo.PlugPageVo;
import com.cpop.jambox.business.vo.PlugVo;
import com.cpop.jambox.business.vo.StorePlugListVo;
import com.cpop.oam.business.bo.ChangePlugOpenBo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.cpop.jambox.business.entity.table.PlugTableDef.PLUG;
import static com.cpop.jambox.business.entity.table.StorePlugTableDef.STORE_PLUG;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 校区-插件记录表 控制层
@ -36,107 +16,107 @@ import static com.cpop.jambox.business.entity.table.StorePlugTableDef.STORE_PLUG
@Deprecated(since = "1.1.0")
public class BackstageStorePlugController {
@Autowired
private StorePlugService storePlugService;
@Autowired
private PlugService plugService;
/**
* 查询插件分页
* @author DB
* @since 2024/1/5
* @return R<Page<PlugPageVo>>
*/
@GetMapping("/getPlugPage")
@Operation(summary = "查询插件分页")
public R<Page<PlugPageVo>> getPlugPage() {
Page<PlugPageVo> page = plugService.getPlugPage();
return R.ok(page);
}
/**
* 查询插件详情
* @author DB
* @since 2024/1/5
* @param id 主键
* @return R<PlugVo>
*/
@GetMapping("/getPlugById/{id}")
@Operation(summary = "查询插件详情")
public R<PlugVo> getPlugById(@PathVariable String id) {
PlugVo vo = plugService.getOneAs(QueryWrapper.create().where(PLUG.ID.eq(id)), PlugVo.class);
return R.ok(vo);
}
/**
* 新增插件
* @author DB
* @since 2024/1/5
* @param bo 请求参数
* @return R<Void>
*/
@Operation(summary = "新增插件")
@PostMapping("/insertPlug")
public R<Void> insertPlug(@RequestBody @Validated PlugBo bo) {
plugService.insertPlug(bo);
return R.ok();
}
/**
* 修改插件
* @author DB
* @since 2024/1/5
* @param bo 请求参数
* @return R<Void>
*/
@Operation(summary = "修改插件")
@PutMapping("/updatePlug")
public R<Void> updateStaff(@RequestBody @Validated PlugBo bo) {
plugService.updatePlug(bo);
return R.ok();
}
/**
* 删除插件
* @author DB
* @since 2024/1/5
* @param id 主键
* @return R<Void>
*/
@Operation(summary = "删除插件")
@DeleteMapping("/removePlugById/{id}")
public R<Void> removeStaffById(@PathVariable String id) {
plugService.removeById(id);
return R.ok();
}
/**
* 查询校区插件列表
*
* @param brandId brandId
* @param storeId storeId
*/
@GetMapping("/getStorePlugList")
@Operation(summary = "查询校区插件列表")
public R<List<StorePlugListVo>> getStorePlugList(@Parameter(description = "品牌id") String brandId, @Parameter(description = "校区id") String storeId) {
List<StorePlugListVo> list = storePlugService.getStorePlugList(brandId, storeId);
return R.ok(list);
}
/**
* 插件开启与关闭
*/
@PutMapping("/changePlugOpen")
@Operation(summary = "插件开启与关闭")
public R<Void> changePlugOpen(@RequestBody @Validated ChangePlugOpenBo bo) {
StorePlug storePlug = BeanUtils.mapToClass(bo, StorePlug.class);
if (bo.getIsOpen()){
storePlugService.save(storePlug);
} else {
storePlugService.updateChain().where(STORE_PLUG.STORE_ID.eq(bo.getStoreId())).and(STORE_PLUG.PLUG_TAG.eq(bo.getPlugTag())).remove();
}
return R.ok();
}
// @Autowired
// private StorePlugService storePlugService;
//
// @Autowired
// private PlugService plugService;
//
// /**
// * 查询插件分页
// * @author DB
// * @since 2024/1/5
// * @return R<Page<PlugPageVo>>
// */
// @GetMapping("/getPlugPage")
// @Operation(summary = "查询插件分页")
// public R<Page<PlugPageVo>> getPlugPage() {
// Page<PlugPageVo> page = plugService.getPlugPage();
// return R.ok(page);
// }
//
// /**
// * 查询插件详情
// * @author DB
// * @since 2024/1/5
// * @param id 主键
// * @return R<PlugVo>
// */
// @GetMapping("/getPlugById/{id}")
// @Operation(summary = "查询插件详情")
// public R<PlugVo> getPlugById(@PathVariable String id) {
// PlugVo vo = plugService.getOneAs(QueryWrapper.create().where(PLUG.ID.eq(id)), PlugVo.class);
// return R.ok(vo);
// }
//
// /**
// * 新增插件
// * @author DB
// * @since 2024/1/5
// * @param bo 请求参数
// * @return R<Void>
// */
// @Operation(summary = "新增插件")
// @PostMapping("/insertPlug")
// public R<Void> insertPlug(@RequestBody @Validated PlugBo bo) {
// plugService.insertPlug(bo);
// return R.ok();
// }
//
// /**
// * 修改插件
// * @author DB
// * @since 2024/1/5
// * @param bo 请求参数
// * @return R<Void>
// */
// @Operation(summary = "修改插件")
// @PutMapping("/updatePlug")
// public R<Void> updateStaff(@RequestBody @Validated PlugBo bo) {
// plugService.updatePlug(bo);
// return R.ok();
// }
//
// /**
// * 删除插件
// * @author DB
// * @since 2024/1/5
// * @param id 主键
// * @return R<Void>
// */
// @Operation(summary = "删除插件")
// @DeleteMapping("/removePlugById/{id}")
// public R<Void> removeStaffById(@PathVariable String id) {
// plugService.removeById(id);
// return R.ok();
// }
//
// /**
// * 查询校区插件列表
// *
// * @param brandId brandId
// * @param storeId storeId
// */
// @GetMapping("/getStorePlugList")
// @Operation(summary = "查询校区插件列表")
// public R<List<StorePlugListVo>> getStorePlugList(@Parameter(description = "品牌id") String brandId, @Parameter(description = "校区id") String storeId) {
// List<StorePlugListVo> list = storePlugService.getStorePlugList(brandId, storeId);
// return R.ok(list);
// }
//
// /**
// * 插件开启与关闭
// */
// @PutMapping("/changePlugOpen")
// @Operation(summary = "插件开启与关闭")
// public R<Void> changePlugOpen(@RequestBody @Validated ChangePlugOpenBo bo) {
// StorePlug storePlug = BeanUtils.mapToClass(bo, StorePlug.class);
// if (bo.getIsOpen()){
// storePlugService.save(storePlug);
// } else {
// storePlugService.updateChain().where(STORE_PLUG.STORE_ID.eq(bo.getStoreId())).and(STORE_PLUG.PLUG_TAG.eq(bo.getPlugTag())).remove();
// }
// return R.ok();
// }
}

View File

@ -1,7 +1,6 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.core.base.entity.R;
import com.cpop.jambox.business.vo.BrandListVo;
import com.cpop.oam.business.bo.AgreeOrRejectEnforceFinishBo;
import com.cpop.oam.business.bo.PauseWorkOrderBo;
import com.cpop.oam.business.bo.TaskWorkOrderBo;
@ -10,13 +9,13 @@ import com.cpop.oam.business.service.TaskWorkOrderService;
import com.cpop.oam.business.vo.*;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.cpop.system.business.vo.BrandListVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -32,7 +31,7 @@ import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
* @since 2023-09-18
*/
@RestController
@Api(tags = "工单模块-工单")
@Tag(name = "工单模块-工单")
@RequestMapping("/backstage/taskWorkOrder")
public class BackstageTaskWorkOrderController {
@ -51,8 +50,7 @@ public class BackstageTaskWorkOrderController {
* @since 2023/09/18 17:18
* @return com.cpop.core.base.entity.R<com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.TaskWorkOrderPageVo>>
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
@ApiOperation("工单模块-工单提交-接收/处理/暂停中")
@Operation(summary = "工单模块-工单提交-接收/处理/暂停中")
@GetMapping("/receiveDealPause")
public R<TaskWorkOrderReceiveDealPauseVo> receiveDealPause() {
TaskWorkOrderReceiveDealPauseVo vo = taskWorkOrderService.receiveDealPause();
@ -64,7 +62,7 @@ public class BackstageTaskWorkOrderController {
* @author DB
* @since 2023-11-29 14:01:03
*/
@ApiOperation("工单模块-工单提交-获取当天值班人员")
@Operation(summary = "工单模块-工单提交-获取当天值班人员")
@GetMapping("/getWorkOrderDutyStaff")
public R<WorkOrderDutyVo> getWorkOrderDutyStaff() {
WorkOrderDutyVo vo = taskWorkOrderService.getWorkOrderDutyStaff();
@ -76,7 +74,7 @@ public class BackstageTaskWorkOrderController {
* @author DB
* @since 2023-11-29 14:35:08
*/
@ApiOperation("工单模块-工单提交-已办结分页列表")
@Operation(summary = "工单模块-工单提交-已办结分页列表")
@GetMapping("/finishWorkOrderPage")
public R<Page<TaskWorkOrderPageVo>> finishWorkOrderPage() {
Page<TaskWorkOrderPageVo> page = taskWorkOrderService.finishWorkOrderPage();
@ -90,7 +88,7 @@ public class BackstageTaskWorkOrderController {
* @author DB
* @since 2023/5/30 16:53
**/
@ApiOperation("工单模块-工单提交-新增工单")
@Operation(summary = "工单模块-工单提交-新增工单")
@PostMapping("/insertWorkOrder")
public R<Void> insertWorkOrder(@RequestBody @Validated TaskWorkOrderBo bo) {
taskWorkOrderService.insertWorkOrder(bo);
@ -103,9 +101,9 @@ public class BackstageTaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 11:25:28
*/
@ApiOperation("工单模块-工单提交-工单记录列表")
@Operation(summary = "工单模块-工单提交-工单记录列表")
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id") String workOrderId) {
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @Parameter(description ="工单id") String workOrderId) {
List<TaskWorkOrderRecordListVo> list = taskWorkOrderService.getWorkOrderRecordList(workOrderId);
return R.ok(list);
}
@ -116,7 +114,7 @@ public class BackstageTaskWorkOrderController {
* @param bo 请求参数
* @since 2023-11-29 11:33:35
*/
@ApiOperation("工单模块-工单提交-新增工单记录")
@Operation(summary = "工单模块-工单提交-新增工单记录")
@PostMapping("/insertWorkOrderRecord")
public R<Void> insertWorkOrderRecord(@RequestBody @Validated TaskWorkOrderRecordBo bo) {
taskWorkOrderService.insertWorkOrderRecord(bo);
@ -129,9 +127,9 @@ public class BackstageTaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 11:41:46
*/
@ApiOperation("工单模块-工单提交-工单提醒")
@Operation(summary = "工单模块-工单提交-工单提醒")
@PutMapping("/workOrderRemind/{workOrderId}")
public R<Void> workOrderRemind(@PathVariable @ApiParam("工单id") String workOrderId) {
public R<Void> workOrderRemind(@PathVariable @Parameter(description ="工单id") String workOrderId) {
taskWorkOrderService.workOrderRemind(workOrderId);
return R.ok();
}
@ -142,9 +140,9 @@ public class BackstageTaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 12:30:21
*/
@ApiOperation("工单模块-工单提交-工单转需求")
@Operation(summary = "工单模块-工单提交-工单转需求")
@PutMapping("/workOrderToDemand/{workOrderId}")
public R<Void> workOrderToDemand(@PathVariable @ApiParam("工单id") String workOrderId) {
public R<Void> workOrderToDemand(@PathVariable @Parameter(description ="工单id") String workOrderId) {
taskWorkOrderService.workOrderToDemand(workOrderId);
return R.ok();
}
@ -155,7 +153,7 @@ public class BackstageTaskWorkOrderController {
* @param bo 请求参数
* @since 2023-11-29 16:00:18
*/
@ApiOperation("工单模块-工单提交-工单暂停")
@Operation(summary = "工单模块-工单提交-工单暂停")
@PutMapping("/pauseWorkOrder")
public R<Void> pauseWorkOrder(@RequestBody @Validated PauseWorkOrderBo bo) {
taskWorkOrderService.pauseWorkOrder(bo);
@ -168,9 +166,9 @@ public class BackstageTaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 15:44:08
*/
@ApiOperation("工单模块-工单提交-工单办结")
@Operation(summary = "工单模块-工单提交-工单办结")
@PutMapping("/workOrderFinish/{workOrderId}")
public R<Void> workOrderFinish(@PathVariable("workOrderId") @ApiParam("工单id") String workOrderId) {
public R<Void> workOrderFinish(@PathVariable("workOrderId") @Parameter(description ="工单id") String workOrderId) {
taskWorkOrderService.workOrderFinish(workOrderId);
return R.ok();
}
@ -181,9 +179,9 @@ public class BackstageTaskWorkOrderController {
* @param brandName 品牌名
* @since 2023-11-30 17:59:29
*/
@ApiOperation("工单模块-工单提交-获取品牌列表")
@Operation(summary = "工单模块-工单提交-获取品牌列表")
@GetMapping("/getBrandList")
public R<List<BrandListVo>> getBrandList(@ApiParam("品牌名") String brandName) {
public R<List<BrandListVo>> getBrandList(@Parameter(description ="品牌名") String brandName) {
List<BrandListVo> list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class);
return R.ok(list);
}
@ -194,9 +192,9 @@ public class BackstageTaskWorkOrderController {
* @param brandId 品牌id
* @since 2023-11-30 18:00:08
*/
@ApiOperation("工单模块-工单提交-获取校区/店铺列表")
@Operation(summary = "工单模块-工单提交-获取校区/店铺列表")
@GetMapping("/getStoreList")
public R<List<StoreListVo>> getStoreList(@ApiParam("品牌id") String brandId) {
public R<List<StoreListVo>> getStoreList(@Parameter(description ="品牌id") String brandId) {
List<StoreListVo> list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class);
return R.ok(list);
}
@ -210,11 +208,11 @@ public class BackstageTaskWorkOrderController {
* @param endDate 结束日期
* @return R<Page<TaskWorkOrderPageVo>>
*/
@ApiOperation("工单统计-获取工单统计分页")
@Operation(summary = "工单统计-获取工单统计分页")
@GetMapping("/getWorkOrderStatPage")
public R<Page<TaskWorkOrderStatPageVo>> getWorkOrderStatPage(@ApiParam("员工id") @RequestParam(value = "staffId", required = false) String staffId,
@RequestParam(value = "startDate", required = false) @ApiParam("开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
@RequestParam(value = "endDate", required = false) @ApiParam("结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
public R<Page<TaskWorkOrderStatPageVo>> getWorkOrderStatPage(@Parameter(description = "员工id") @RequestParam(value = "staffId", required = false) String staffId,
@RequestParam(value = "startDate", required = false) @Parameter(description ="开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
@RequestParam(value = "endDate", required = false) @Parameter(description ="结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
Page<TaskWorkOrderStatPageVo> page = taskWorkOrderService.getWorkOrderStatPage(staffId, startDate, endDate);
return R.ok(page);
}
@ -226,7 +224,7 @@ public class BackstageTaskWorkOrderController {
* @param bo 请求参数
* @return R<Void>
*/
@ApiOperation("工单模块-工单提交-同意与拒绝强制办结")
@Operation(summary = "工单模块-工单提交-同意与拒绝强制办结")
@PutMapping("/agreeOrRejectEnforceFinish")
public R<Void> agreeOrRejectEnforceFinish(@RequestBody @Validated AgreeOrRejectEnforceFinishBo bo) {
taskWorkOrderService.agreeOrRejectEnforceFinish(bo);

View File

@ -1,23 +1,23 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.R;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.entity.R;
import com.cpop.core.utils.SqlUtils;
import com.cpop.oam.business.bo.TechnologyToolBo;
import com.cpop.oam.business.entity.TechnologyTool;
import com.cpop.oam.business.service.TechnologyToolService;
import com.cpop.oam.business.vo.TechnologyToolPageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cpop.oam.business.entity.TechnologyTool;
import com.cpop.oam.business.service.TechnologyToolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
import static com.cpop.core.base.table.table.UserTableDef.USER;
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
import static com.cpop.oam.business.entity.table.TechnologyToolTableDef.TECHNOLOGY_TOOL;
@ -28,7 +28,7 @@ import static com.cpop.oam.business.entity.table.TechnologyToolTableDef.TECHNOLO
* @since 2023-12-10
*/
@RestController
@Api(tags = "技术工具管理")
@Tag(name = "技术工具管理")
@RequestMapping("/backstage/technologyTool")
public class BackstageTechnologyToolController {
@ -42,14 +42,14 @@ public class BackstageTechnologyToolController {
* @return Page<TechnologyToolPageVo>
*/
@GetMapping("/getTechnologyToolPage")
@ApiOperation("技术工具分页查询")
public R<Page<TechnologyToolPageVo>> getTechnologyToolPage(@RequestParam("toolType") @ApiParam(value = "工具类型", required = true) String toolType) {
@Operation(summary = "技术工具分页查询")
public R<Page<TechnologyToolPageVo>> getTechnologyToolPage(@RequestParam("toolType") @Parameter(description = "工具类型", required = true) String toolType) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
Page<TechnologyToolPageVo> page = technologyToolService.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
QueryWrapper.create().select(TECHNOLOGY_TOOL.ALL_COLUMNS)
.select(STAFF.NAME.as(TechnologyToolPageVo::getCreateUser))
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(TECHNOLOGY_TOOL.CREATE_USER_ID))
.leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID))
.leftJoin(USER).on(USER.ID.eq(TECHNOLOGY_TOOL.CREATE_USER_ID))
.leftJoin(STAFF).on(STAFF.USER_ID.eq(USER.ID))
.where(TECHNOLOGY_TOOL.TOOL_TYPE.eq(toolType)),
TechnologyToolPageVo.class);
return R.ok(page);
@ -63,7 +63,7 @@ public class BackstageTechnologyToolController {
* @return R<Void>
*/
@PostMapping("/insertTool")
@ApiOperation("保存技术工具")
@Operation(summary = "保存技术工具")
public R<Void> insertTool(@RequestBody @Validated TechnologyToolBo bo) {
technologyToolService.save(BeanUtils.mapToClass(bo, TechnologyTool.class));
return R.ok();
@ -77,7 +77,7 @@ public class BackstageTechnologyToolController {
* @return R<Void>
*/
@PutMapping("/updateTool")
@ApiOperation("根据主键更新技术工具")
@Operation(summary = "根据主键更新技术工具")
public R<Void> update(@RequestBody @Validated TechnologyToolBo bo) {
technologyToolService.updateById(BeanUtils.mapToClass(bo, TechnologyTool.class));
return R.ok();
@ -90,8 +90,8 @@ public class BackstageTechnologyToolController {
* @return {@code true} 删除成功{@code false} 删除失败
*/
@DeleteMapping("/removeById/{id}")
@ApiOperation("根据主键删除技术工具")
public R<Void> remove(@PathVariable @ApiParam("技术工具表主键") String id) {
@Operation(summary = "根据主键删除技术工具")
public R<Void> remove(@PathVariable @Parameter(description = "技术工具表主键") String id) {
technologyToolService.removeById(id);
return R.ok();
}

View File

@ -5,16 +5,15 @@ import com.cpop.oam.business.service.OamWxCpService;
import com.cpop.oam.business.vo.WxCpLoginVo;
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
import com.cpop.system.business.vo.LoginUserInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.cp.api.WxCpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @author DB
@ -23,7 +22,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@Slf4j
@RestController
@Api(tags = "企业微信相关模块")
@Tag(name = "企业微信相关模块")
@RequestMapping("/backstage/wxCp")
public class BackstageWxCpController {
@ -40,7 +39,7 @@ public class BackstageWxCpController {
* @return {@link R<LoginUserInfoVo>}
**/
@GetMapping("/getOauth2Url")
@ApiOperation("获取oauth2认证链接")
@Operation(summary = "获取oauth2认证链接")
public R<String> getOauth2Url() {
WxCpService cpService = WxCpConfiguration.getCpService(1000024);
String authUrl = cpService.getOauth2Service().buildAuthorizationUrl(oAuth2registerUrl, null, "snsapi_privateinfo");
@ -54,7 +53,7 @@ public class BackstageWxCpController {
* @return {@link R<LoginUserInfoVo>}
**/
@GetMapping("/loginUserInfoByCode")
@ApiOperation("根据code换取用户信息")
@Operation(summary = "根据code换取用户信息")
public R<WxCpLoginVo> loginUserInfoByCode(HttpServletRequest httpServletRequest, @RequestParam("code") String code) {
WxCpLoginVo loginVo = oamWxCpService.loginUserInfoByCode(httpServletRequest, code);
return R.ok(loginVo);
@ -62,13 +61,12 @@ public class BackstageWxCpController {
/**
* @return R<Void>
* @Description: 同步企业微信部门
* @Author DB
* @Date: 2023/5/9 20:47
* 同步企业微信部门
* @author DB
* @since 2023/5/9 20:47
*/
@Deprecated
@PreAuthorize("@aps.hasPermission('*:*:*')")
@ApiOperation("同步企业微信部门")
@Operation(summary = "同步企业微信部门")
@PostMapping("/syncWxCpDept")
public R<Void> syncWxCpDept() {
oamWxCpService.syncWxCpDept();
@ -77,13 +75,12 @@ public class BackstageWxCpController {
/**
* @return R<Void>
* @Description: 同步企业微信员工
* @Author DB
* @Date: 2023/5/9 20:47
* 同步企业微信员工
* @author DB
* @since 2023/5/9 20:47
*/
@Deprecated
@PreAuthorize("@aps.hasPermission('*:*:*')")
@ApiOperation("同步企业微信员工")
@Operation(summary = "同步企业微信员工")
@PostMapping("/syncWxCpStaff")
public R<Void> syncWxCpStaff() {
oamWxCpService.syncWxCpStaff();

View File

@ -1,20 +1,20 @@
package com.cpop.oam.business.controller.backstage;
import cn.binarywang.wx.miniapp.bean.WxMaAuditMediaUploadResult;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.entity.R;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.entity.R;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SqlUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.oam.business.bo.WxOpenMaCodeCommitBo;
import com.cpop.oam.business.bo.WxOpenMaTrialQrCodeBo;
import com.cpop.oam.business.service.WxOpenMiniService;
import com.cpop.oam.business.vo.WxOpenMiniVo;
import com.cpop.oam.framework.config.wxOpen.WxOpenProperties;
import com.cpop.oam.framework.config.wxOpen.WechatOpenProperties;
import com.cpop.oam.framework.handler.wxOpen.WxOpenService;
import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
@ -27,7 +27,6 @@ import me.chanjar.weixin.open.bean.result.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -42,11 +41,11 @@ import java.util.List;
/**
* @author DB
* @createTime 2023/10/10 13:40
* @description 微信开放平台
* @since 2023/10/10 13:40
* 微信开放平台
*/
@RestController
@Api(tags = "微信开放平台模块")
@Tag(name = "微信开放平台模块")
@RequestMapping("/backstage/wxOpen")
public class BackstageWxOpenController {
@ -56,22 +55,21 @@ public class BackstageWxOpenController {
private WxOpenService wxOpenService;
@Autowired
private WxOpenProperties properties;
private WechatOpenProperties properties;
@Autowired
private WxOpenMiniService wxOpenMiniService;
/**
* @descriptions 第三方平台授权
* 第三方平台授权
* @author DB
* @date 2023/10/10 13:43
* @since 2023/10/10 13:43
* @param requestBody 请求参数
* @param timestamp 时间戳
* @param nonce 随机串
* @param signature 签名
* @param encType 解密类型
* @param msgSignature 签名信息
* @return: java.lang.Object 返回
*/
@RequestMapping("/receiveTicket")
public Object receiveTicket(@RequestBody(required = false) String requestBody, @RequestParam("timestamp") String timestamp,
@ -97,13 +95,12 @@ public class BackstageWxOpenController {
* @Author DB
* @Date: 2023/6/14 21:47
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:insert')")
@ApiOperation("获取授权链接")
@Operation(summary = "获取授权链接")
@GetMapping("/getAuthorizedLink")
public R<String> getAuthorizedLink() {
String preAuthUrl;
try {
preAuthUrl = wxOpenService.getWxOpenComponentService().getPreAuthUrl(properties.getRedirectUri());
preAuthUrl = wxOpenService.getWxOpenComponentService().getPreAuthUrl(properties.getAuthorizedLink());
} catch (WxErrorException e) {
throw new ServiceException(e.getMessage());
}
@ -111,11 +108,11 @@ public class BackstageWxOpenController {
}
/**
* @descriptions 授权回调地址
* 授权回调地址
* @author DB
* @date 2023/10/10 15:49
* @since 2023/10/10 15:49
* @param authorizationCode 授权码
* @return: me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult
* @return me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult
*/
@GetMapping("/redirectUrl")
@ResponseBody
@ -129,9 +126,8 @@ public class BackstageWxOpenController {
}
/**
* @descriptions
* @author DB
* @date 2023/10/10 14:56
* @since 2023/10/10 14:56
* @param requestBody 请求体
* @param appId appid
* @param signature 签名
@ -140,7 +136,6 @@ public class BackstageWxOpenController {
* @param openid openId
* @param encType 加密类型
* @param msgSignature 加密信息
* @return: java.lang.Object
*/
@RequestMapping("/{appId}/callback")
public Object callback(@RequestBody(required = false) String requestBody,
@ -193,15 +188,15 @@ public class BackstageWxOpenController {
/**
* @param appid 绑定小程序appid
* @return R<String>
* @Description: 小程序绑定开放平台
* @Author DB
* @Date: 2023/6/14 21:47
* 小程序绑定开放平台
* @author DB
* @since 2023/6/14 21:47
*/
@ApiOperation("小程序绑定开放平台")
@Operation(summary = "小程序绑定开放平台")
@GetMapping("/bindOpenAccount/{appid}")
public R<Void> bindOpenAccount(@PathVariable String appid) {
try {
wxOpenService.getWxOpenComponentService().bindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getOpenAppid());
wxOpenService.getWxOpenComponentService().bindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getComponentAppId());
} catch (WxErrorException e) {
throw new ServiceException(e.getMessage());
}
@ -209,17 +204,17 @@ public class BackstageWxOpenController {
}
/**
* @Description: 解除绑定开放平台帐号
* 解除绑定开放平台帐号
* @param appid 绑定小程序appid
* @return R<String>
* @Author DB
* @Date: 2023/6/14 21:47
* @author DB
* @since 2023/6/14 21:47
*/
@ApiOperation("解除绑定开放平台帐号")
@Operation(summary = "解除绑定开放平台帐号")
@GetMapping("/unbindOpenAccount/{appid}")
public R<Void> unbindOpenAccount(@PathVariable String appid) {
try {
wxOpenService.getWxOpenComponentService().unbindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getOpenAppid());
wxOpenService.getWxOpenComponentService().unbindOpenAccount(appid, WxConsts.AppIdType.MINI_TYPE, properties.getComponentAppId());
} catch (WxErrorException e) {
throw new ServiceException(e.getMessage());
}
@ -228,12 +223,11 @@ public class BackstageWxOpenController {
/**
* @return R<Page<Map<String, String>>>
* @Description: 获取授权小程序列表
* 获取授权小程序列表
* @author DB
* @Date: 2023/6/14 0014 17:00
* @since 2023/6/14 0014 17:00
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:list')")
@ApiOperation("获取授权小程序列表")
@Operation(summary = "获取授权小程序列表")
@GetMapping("/getAuthorizerList")
public R<Page<WxOpenMiniVo>> getAuthorizerList() {
try {
@ -249,13 +243,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 数据同步
* 数据同步
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("数据同步")
@Operation(summary = "数据同步")
@PutMapping("/dataSync/{authorizerAppid}")
public R<Void> dataSync(@PathVariable("authorizerAppid") String authorizerAppid) {
try {
@ -268,14 +261,13 @@ public class BackstageWxOpenController {
}
/**
* @Description: 获取授权小程序详情
* 获取授权小程序详情
* @param authorizerAppid 授权小程序appid
* @return R<List<OpenPlatformAuthorizerListVo>>
* @author DB
* @Date: 2023/6/15 0015 16:38
* @since 2023/6/15 0015 16:38
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("获取授权小程序详情")
@Operation(summary = "获取授权小程序详情")
@GetMapping("/getAuthorizerInfo/{authorizerAppid}")
public R<WxOpenAuthorizerInfoResult> getAuthorizerInfo(@PathVariable String authorizerAppid) {
try {
@ -287,14 +279,13 @@ public class BackstageWxOpenController {
}
/**
* @Description: 上传代码并生成体验版
* 上传代码并生成体验版
* @param bo 请求参数
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("上传代码并生成体验版")
@Operation(summary = "上传代码并生成体验版")
@PostMapping("/commit")
public R<Void> commit(@RequestBody @Validated WxOpenMaCodeCommitBo bo) {
try {
@ -307,14 +298,13 @@ public class BackstageWxOpenController {
}
/**
* @Description: 获取体验版二维码
* 获取体验版二维码
* @param bo 请求参数
* @return R<JSONObject>
* @author DB
* @Date: 2023/6/16 0016 17:35
* @since 2023/6/16 0016 17:35
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("获取体验版二维码")
@Operation(summary = "获取体验版二维码")
@PostMapping("/getTrialQrCode")
public R<String> getTrialQrCode(@RequestBody WxOpenMaTrialQrCodeBo bo) {
try {
@ -333,14 +323,13 @@ public class BackstageWxOpenController {
}
/**
* @Description: 提交代码审核
* 提交代码审核
* @param message 微信小程序代码包提交审核(仅供第三方开发者代小程序调用
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("提交代码审核")
@Operation(summary = "提交代码审核")
@PostMapping("/submitAudit/{authorizerAppid}")
public R<WxOpenMaSubmitAuditResult> submitAudit(@PathVariable String authorizerAppid ,@RequestBody WxOpenMaSubmitAuditMessage message) {
try {
@ -353,15 +342,13 @@ public class BackstageWxOpenController {
}
/**
* @descriptions 查询审核单状态
* 查询审核单状态
* @author DB
* @date 2023/10/10 17:41
* @since 2023/10/10 17:41
* @param authorizerAppid 授权appid
* @param auditId 审核id
* @return: com.cpop.core.base.entity.R<me.chanjar.weixin.open.bean.result.WxOpenMaQueryAuditResult>
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("查询审核单状态")
@Operation(summary = "查询审核单状态")
@GetMapping("/getAuditStatus")
public R<WxOpenMaQueryAuditResult> getAuditStatus(@RequestParam("authorizerAppid") String authorizerAppid, @RequestParam("auditId") Long auditId) {
try {
@ -373,13 +360,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 撤回代码审核
* 撤回代码审核
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("撤回代码审核")
@Operation(summary = "撤回代码审核")
@PutMapping("/undoAudit/{authorizerAppid}")
public R<Void> getAuditStatus(@PathVariable String authorizerAppid) {
try {
@ -391,13 +377,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 发布已通过审核的小程序
* 发布已通过审核的小程序
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("发布已通过审核的小程序")
@Operation(summary = "发布已通过审核的小程序")
@PutMapping("/release/{authorizerAppid}")
public R<Void> release(@PathVariable String authorizerAppid) {
try {
@ -409,13 +394,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 撤回代码审核
* 撤回代码审核
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("小程序版本回退")
@Operation(summary = "小程序版本回退")
@PutMapping("/revertCodeRelease/{authorizerAppid}")
public R<Void> revertCodeRelease(@PathVariable String authorizerAppid) {
try {
@ -427,13 +411,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 加急代码审核
* 加急代码审核
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("加急代码审核")
@Operation(summary = "加急代码审核")
@PutMapping("/speedupCodeAudit")
public R<Void> speedupCodeAudit(@RequestParam("authorizerAppid") String authorizerAppid, @RequestParam("auditId") Long auditId) {
try {
@ -445,13 +428,12 @@ public class BackstageWxOpenController {
}
/**
* 查询小程序版本信息
* @return R<OpenPlatformVersionInfoVo>
* @Description: 查询小程序版本信息
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("查询小程序版本信息")
@Operation(summary = "查询小程序版本信息")
@GetMapping("/getVersionInfo/{authorizerAppid}")
public R<WxOpenVersioninfoResult> getVersionInfo(@PathVariable String authorizerAppid) {
try {
@ -463,13 +445,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 查询最新一次审核单状态
* 查询最新一次审核单状态
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("查询最新一次审核单状态")
@Operation(summary = "查询最新一次审核单状态")
@GetMapping("/getLatestAuditStatus/{authorizerAppid}")
public R<WxOpenMaQueryAuditResult> getLatestAuditStatus(@PathVariable String authorizerAppid) {
try {
@ -481,13 +462,12 @@ public class BackstageWxOpenController {
}
/**
* 上传提审素材
* @return R<OpenPlatformVersionInfoVo>
* @Description: 上传提审素材
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("上传提审素材")
@Operation(summary = "上传提审素材")
@PostMapping("/uploadMediaToCodeAudit/{authorizerAppid}")
public R<WxMaAuditMediaUploadResult> uploadMediaToCodeAudit(@RequestParam("file") File file, @PathVariable("authorizerAppid") String authorizerAppid) {
try {
@ -499,14 +479,12 @@ public class BackstageWxOpenController {
}
/**
* @descriptions 获取模板列表
* 获取模板列表
* @author DB
* @date 2023/10/10 18:17
* @since 2023/10/10 18:17
* @param templateType 模板类型
* @return: com.cpop.core.base.entity.R<java.util.List<me.chanjar.weixin.open.bean.WxOpenMaCodeTemplate>>
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("获取模板列表")
@Operation(summary = "获取模板列表")
@GetMapping("/getTemplateList")
public R<List<WxOpenMaCodeTemplate>> getTemplateList(Integer templateType) {
try {
@ -518,13 +496,12 @@ public class BackstageWxOpenController {
}
/**
* @Description: 获取草稿箱列表
* 获取草稿箱列表
* @return R<Void>
* @author DB
* @Date: 2023/6/16 0016 17:34
* @since 2023/6/16 0016 17:34
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:info')")
@ApiOperation("获取草稿箱列表")
@Operation(summary = "获取草稿箱列表")
@GetMapping("/getTemplateDraftList")
public R<List<WxOpenMaCodeTemplate>> getTemplateDraftList() {
try {
@ -536,15 +513,13 @@ public class BackstageWxOpenController {
}
/**
* @descriptions 将草稿添加到模板库
* 将草稿添加到模板库
* @author DB
* @date 2023/10/10 18:16
* @since 2023/10/10 18:16
* @param draftId 草稿id
* @param templateType 模板类型
* @return: com.cpop.core.base.entity.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:update')")
@ApiOperation("将草稿添加到模板库")
@Operation(summary = "将草稿添加到模板库")
@PostMapping("/addToTemplate")
public R<Void> addToTemplate(@RequestParam("draftId") Long draftId, @RequestParam("templateType") Integer templateType) {
try {
@ -556,14 +531,13 @@ public class BackstageWxOpenController {
}
/**
* @Description: 删除代码模板
* 删除代码模板
* @param templateId 模板id
* @return R<Void>
* @author DB
* @Date: 2023/6/27 0027 14:28
* @since 2023/6/27 0027 14:28
*/
@PreAuthorize("@aps.hasPermission('wxOpen:applet:remove')")
@ApiOperation("删除代码模板")
@Operation(summary = "删除代码模板")
@DeleteMapping("/deleteTemplate/{templateId}")
public R<Void> deleteTemplate(@PathVariable Integer templateId) {
try {

View File

@ -1,93 +0,0 @@
package com.cpop.oam.business.controller.backstage;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.entity.R;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.pay.framewok.config.wxPay.WxPayConfiguration;
import com.cpop.system.business.entity.Brand;
import com.cpop.system.business.service.BrandService;
import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingReceiverRequest;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
/**
* @author DB
* @createTime 2023/11/15 11:21
* @description
*/
@RestController
@Api(tags = "微信支付模块")
@RequestMapping("/backstage/wxPay")
public class BackstageWxPayController {
@Autowired
private WxPayConfiguration wxPayConfiguration;
@Autowired
private WxPayService wxPayService;
@Autowired
private BrandService brandService;
/**
* @descriptions 开通微信分账
* @author DB
* @date 2023/11/15 11:06
* @return: com.cpop.core.base.entity.R<java.lang.Void>
*/
@ApiOperation("开通微信分账")
@PutMapping("/changeBrandSharing")
public R<Void> changeBrandSharing(@RequestBody @Validated ChangeWechatSharingBo bo) {
//获取品牌下属商户
Brand brand = brandService.getById(bo.getBrandId());
if (StringUtils.isBlank(brand.getWxMchId())) {
throw new ServiceException("当前品牌暂未绑定系统,请联系相关人员绑定");
}
//固定商户信息
Map<String, Object> mapReceiver = new HashMap<>(4);
mapReceiver.put("type", "MERCHANT_ID");
mapReceiver.put("account", wxPayConfiguration.getProperties().getSharingAccount());
//添加分账接收方
ProfitSharingReceiverRequest profitSharingReceiver = new ProfitSharingReceiverRequest();
//开启
if (bo.getIsOpenSharing()) {
mapReceiver.put("relation_type", "SERVICE_PROVIDER");
mapReceiver.put("name", wxPayConfiguration.getProperties().getSharingAccountName());
profitSharingReceiver.setReceiver(JSONObject.toJSONString(mapReceiver));
WxPayConfig config = wxPayService.getConfig();
config.setSubMchId(brand.getWxMchId());
try {
wxPayService.getProfitSharingService().addReceiver(profitSharingReceiver);
} catch (WxPayException e) {
throw new ServiceException(e.getMessage());
}
} else {
//关闭
profitSharingReceiver.setReceiver(JSONObject.toJSONString(mapReceiver));
WxPayConfig config = wxPayService.getConfig();
config.setSubMchId(brand.getWxMchId());
try {
wxPayService.getProfitSharingService().removeReceiver(profitSharingReceiver);
} catch (WxPayException e) {
throw new ServiceException(e.getMessage());
}
}
brandService.updateChain().set(BRAND.IS_OPEN_SHARING, bo.getIsOpenSharing()).where(BRAND.ID.eq(bo.getBrandId())).update();
return R.ok();
}
}

View File

@ -1,42 +0,0 @@
package com.cpop.oam.business.controller.callback;
import com.cpop.core.base.entity.R;
import com.cpop.oam.business.bo.CloudUnionCallbackBo;
import com.cpop.oam.framework.enums.CloudCallbackEnums;
import com.cpop.oam.framework.strategy.cloud.CloudCallbackStrategy;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author DB
* @version 1.0.0
* @since 2024-01-16 11:28
*/
@Api(tags = "云回调controller")
@RestController
@RequestMapping("/cloudCallback")
@Deprecated
public class CallBackCloudCallbackController {
/**
* 云联合回调
* @author DB
* @since 2024/1/16
* @param callback 回调参数
* @return R<Void>
*/
//@SimpleSignatureCheck
@ApiOperation("云联合回调")
@PostMapping("/cloudUnionCallback")
public R<Void> cloudUnionCallback(@RequestBody @Validated CloudUnionCallbackBo callback) {
CloudCallbackStrategy cloudCallbackStrategy = CloudCallbackEnums.valueOf(callback.getCallbackEnum()).getCloudCallbackStrategy();
cloudCallbackStrategy.callback(callback);
return R.ok();
}
}

View File

@ -4,8 +4,8 @@ import com.cpop.core.base.entity.R;
import com.cpop.oam.business.bo.CloudUnionCallbackBo;
import com.cpop.oam.framework.enums.CloudCallbackEnums;
import com.cpop.oam.framework.strategy.cloud.CloudCallbackStrategy;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
* @version 1.0.0
* @since 2024-01-16 11:28
*/
@Api(tags = "云回调controller")
@Tag(name = "云回调controller")
@RestController
@RequestMapping("/callback/cloud")
public class CallbackCloudController {
@ -30,7 +30,7 @@ public class CallbackCloudController {
* @return R<Void>
*/
//@SimpleSignatureCheck
@ApiOperation("云联合回调")
@Operation(summary = "云联合回调")
@PostMapping("/cloudUnionCallback")
public R<Void> cloudUnionCallback(@RequestBody @Validated CloudUnionCallbackBo callback) {
CloudCallbackStrategy cloudCallbackStrategy = CloudCallbackEnums.valueOf(callback.getCallbackEnum()).getCloudCallbackStrategy();

View File

@ -1,10 +1,10 @@
package com.cpop.oam.business.controller.callback;
import com.cpop.common.utils.JsonUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.utils.JsonUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.oam.business.service.OamWxCpService;
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.tags.Tag;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage;
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
* @createTime 2023/10/12 15:17
* @description 企业微信认证回调接口
*/
@Api(tags = "企业微信消息接收controller")
@Tag(name = "企业微信消息接收controller")
@RestController
@RequestMapping("/callback/wxCp/{agentId}")
public class CallbackWxCpController {
@ -97,10 +97,7 @@ public class CallbackWxCpController {
* @param state 信息 注册
*/
@GetMapping(produces = "text/plain;charset=utf-8", value = "/registerCode")
public void registerCode(@PathVariable
Integer agentId, @RequestParam("code")
String code, @RequestParam("state")
String state) {
public void registerCode(@PathVariable Integer agentId, @RequestParam("code") String code, @RequestParam("state") String state) {
oamWxCpService.registerCode(agentId, code);
}

View File

@ -1,109 +0,0 @@
package com.cpop.oam.business.controller.callback;
import com.cpop.common.utils.JsonUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.oam.business.service.OamWxCpService;
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
import io.swagger.annotations.Api;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage;
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author DB
* @createTime 2023/10/12 15:17
* @description 企业微信认证回调接口
*/
@Api(tags = "企业微信消息接收controller")
@RestController
@RequestMapping("/wxCp/portal/{agentId}")
@Deprecated
public class WxCpPortalController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private OamWxCpService oamWxCpService;
@GetMapping(produces = "text/plain;charset=utf-8")
public String authGet(@PathVariable
Integer agentId, @RequestParam(name = "msg_signature", required = false)
String signature, @RequestParam(name = "timestamp", required = false)
String timestamp, @RequestParam(name = "nonce", required = false)
String nonce, @RequestParam(name = "echostr", required = false)
String echostr) {
this.logger.info("\n接收到来自微信服务器的认证消息signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]",
signature,
timestamp,
nonce,
echostr);
if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
throw new IllegalArgumentException("请求参数非法,请核实!");
}
final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId);
if (wxCpService == null) {
throw new IllegalArgumentException(String.format("未找到对应agentId=[%d]的配置,请核实!", agentId));
}
if (wxCpService.checkSignature(signature, timestamp, nonce, echostr)) {
return new WxCpCryptUtil(wxCpService.getWxCpConfigStorage()).decrypt(echostr);
}
return "非法请求";
}
@PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable
Integer agentId, @RequestBody
String requestBody, @RequestParam("msg_signature")
String signature, @RequestParam("timestamp")
String timestamp, @RequestParam("nonce")
String nonce) {
this.logger.info("\n接收微信请求[signature=[{}], timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
signature,
timestamp,
nonce,
requestBody);
final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId);
WxCpXmlMessage inMessage = WxCpXmlMessage
.fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(), timestamp, nonce, signature);
this.logger.debug("\n消息解密后内容为\n{} ", JsonUtils.toJson(inMessage));
WxCpXmlOutMessage outMessage = this.route(agentId, inMessage);
if (outMessage == null) {
return "";
}
String out = outMessage.toEncryptedXml(wxCpService.getWxCpConfigStorage());
this.logger.debug("\n组装回复信息{}", out);
return out;
}
private WxCpXmlOutMessage route(Integer agentId, WxCpXmlMessage message) {
try {
return WxCpConfiguration.getRouters().get(agentId).route(message);
} catch (Exception e) {
this.logger.error(e.getMessage(), e);
}
return null;
}
/**
* 企微的o2认证可查询用户敏感信息
* @author DB
* @since 2023/11/17 14:42
* @param agentId 企业微信服务应用id
* @param code 授权码
* @param state 信息 注册
*/
@GetMapping(produces = "text/plain;charset=utf-8", value = "/registerCode")
public void registerCode(@PathVariable
Integer agentId, @RequestParam("code")
String code, @RequestParam("state")
String state) {
oamWxCpService.registerCode(agentId, code);
}
}

View File

@ -1,156 +0,0 @@
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.entity.R;
import com.cpop.core.base.exception.ServiceException;
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);
}
}

View File

@ -1,7 +1,5 @@
package com.cpop.oam.business.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;

View File

@ -6,13 +6,11 @@ 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;
import java.io.Serializable;
/**
* 品牌管理员表 实体类
*

View File

@ -5,13 +5,11 @@ 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.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 品牌管理员-品牌-校区表 实体类
*

View File

@ -6,14 +6,12 @@ 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.LocalDate;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
/**
* Oam-事务表 实体类
*

View File

@ -6,13 +6,12 @@ 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;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 业务详情表 实体类
*

View File

@ -5,13 +5,11 @@ 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.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 事务-负责员工表 实体类
*

View File

@ -3,17 +3,15 @@ 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.fasterxml.jackson.annotation.JsonFormat;
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;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 线索表 实体类
*

View File

@ -6,15 +6,12 @@ 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.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;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 校区延期表 实体类
*

View File

@ -6,9 +6,6 @@ import com.cpop.core.base.entity.BaseUpdateListener;
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;

View File

@ -5,13 +5,11 @@ 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.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 线索更新 实体类
*

View File

@ -7,9 +7,6 @@ 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;

View File

@ -5,13 +5,11 @@ 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.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 签约目标区域表 实体类
*

View File

@ -7,9 +7,6 @@ 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;

View File

@ -6,13 +6,11 @@ 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;
import java.io.Serializable;
/**
* 峰会报名表 实体类
*

View File

@ -6,13 +6,11 @@ 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;
import java.io.Serializable;
/**
* 峰会参加人员 实体类
*

View File

@ -6,13 +6,11 @@ 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;
import java.io.Serializable;
/**
* oam-技术工具表 实体类
*

View File

@ -6,13 +6,11 @@ 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;
import java.io.Serializable;
/**
* Oam-微信开放平台-小程序 实体类
*

View File

@ -1,39 +0,0 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.bo.MallStaffBo;
import com.cpop.oam.business.vo.MallStaffPageVo;
import com.mybatisflex.core.paginate.Page;
import java.util.List;
/**
* 商城管理
*/
public interface OamMallService {
/**
* @descriptions 查询商城管理员分页列表
* @author DB
* @date 2023/11/09 14:47
* @return: com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.MallStaffPageVo>
*/
Page<MallStaffPageVo> getMallStaffPage(String brandIds, String name);
/**
* @descriptions 新增管理员
* @author DB
* @date 2023/11/10 12:14
* @param bo 请求参数
* @return: void
*/
void insertAdmin(MallStaffBo bo);
/**
* @descriptions 删除管理员
* @author DB
* @date 2023/11/10 14:34
* @param id 主键
* @return: void
*/
void removeAdmin(String id);
}

View File

@ -1,8 +1,8 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.vo.WxCpLoginVo;
import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
/**
* Oam暴露的企业微信接口

View File

@ -5,8 +5,6 @@ import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.entity.Task;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestParam;
import java.time.LocalDate;

View File

@ -1,24 +1,11 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.SqlUtils;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.jambox.business.entity.BrandExtend;
import com.cpop.jambox.business.entity.StoreExtend;
import com.cpop.jambox.business.entity.table.BrandExtendTableDef;
import com.cpop.jambox.business.entity.table.StoreExtendTableDef;
import com.cpop.jambox.business.service.BrandExtendService;
import com.cpop.jambox.business.service.StoreExtendService;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.BrandManagerBo;
import com.cpop.oam.business.bo.BrandManagerPageBo;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.cpop.oam.business.entity.BrandManager;
import com.cpop.oam.business.mapper.BrandManagerMapper;
import com.cpop.oam.business.service.BrandManagerStoreService;
import com.cpop.oam.business.service.BrandManagerService;
import com.cpop.oam.business.vo.BrandManagePageVo;
import com.mybatisflex.core.paginate.Page;
@ -27,11 +14,6 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.cpop.oam.business.entity.table.BrandManagerStoreTableDef.BRAND_MANAGER_STORE;
import static com.cpop.oam.business.entity.table.BrandManagerTableDef.BRAND_MANAGER;
@ -91,14 +73,14 @@ public class BrandManagerServiceImpl extends ServiceImpl<BrandManagerMapper, Bra
@Override
@Transactional(rollbackFor = Exception.class)
public void removeBrandManagerById(String id) {
BrandManager brandManage = this.getById(id);
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type","brandManagerDel");
jsonBody.put("brandManagerId", brandManage.getBrandManagerCloudId());
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
this.removeById(id);
//删除中间表
SpringUtils.getBean(BrandManagerStoreService.class).updateChain().where(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(id)).remove();
// BrandManager brandManage = this.getById(id);
// JSONObject jsonBody = new JSONObject();
// jsonBody.put("_type","brandManagerDel");
// jsonBody.put("brandManagerId", brandManage.getBrandManagerCloudId());
// SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
// this.removeById(id);
// //删除中间表
// SpringUtils.getBean(BrandManagerStoreService.class).updateChain().where(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(id)).remove();
}
/**
@ -110,47 +92,47 @@ public class BrandManagerServiceImpl extends ServiceImpl<BrandManagerMapper, Bra
@Override
@Transactional(rollbackFor = Exception.class)
public void insertBrandManager(BrandManagerBo bo) {
//查询此管理员是否已存在
if (this.count(QueryWrapper.create().leftJoin(BRAND_MANAGER_STORE).on(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(BRAND_MANAGER.ID))
.where(BRAND_MANAGER.NAME.eq(bo.getName()))
.and(BRAND_MANAGER.PHONE.eq(bo.getPhone()))
.and(BRAND_MANAGER_STORE.BRAND_ID.eq(bo.getBrandId()))) > 0) {
throw new ServiceException("当前管理员已存在");
}
//获取云品牌id
BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain().where(BrandExtendTableDef.BRAND_EXTEND.BRAND_ID.eq(bo.getBrandId())).one();
//获取用户信息
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "brandManagerAdd");
jsonBody.put("brandId", brandExtend.getBrandCloudId());
jsonBody.put("name", bo.getName());
jsonBody.put("phone", bo.getPhone());
jsonBody.put("position", "OAM添加");
if (bo.getStoreIds() != null) {
//获取云校区id
List<String> cloudStoreIds = SpringUtils.getBean(StoreExtendService.class).queryChain().where(StoreExtendTableDef.STORE_EXTEND.STORE_ID.in(bo.getStoreIds())).list()
.stream().map(StoreExtend::getStoreCloudId).collect(Collectors.toList());
jsonBody.put("store", cloudStoreIds);
}
//本地新增
BrandManager brandManage = BeanUtils.mapToClass(bo, BrandManager.class);
JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
assert result != null;
brandManage.setBrandManagerCloudId(result.getString("data"));
this.save(brandManage);
List<BrandManagerStore> brandManagerStores = new ArrayList<>();
//添加中间表
if (bo.getStoreIds() != null) {
bo.getStoreIds().forEach(item -> {
BrandManagerStore brandManageStore = new BrandManagerStore();
brandManageStore.setStoreId(item).setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
brandManagerStores.add(brandManageStore);
});
} else {
BrandManagerStore brandManageStore = new BrandManagerStore();
brandManageStore.setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
brandManagerStores.add(brandManageStore);
}
SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores);
// //查询此管理员是否已存在
// if (this.count(QueryWrapper.create().leftJoin(BRAND_MANAGER_STORE).on(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(BRAND_MANAGER.ID))
// .where(BRAND_MANAGER.NAME.eq(bo.getName()))
// .and(BRAND_MANAGER.PHONE.eq(bo.getPhone()))
// .and(BRAND_MANAGER_STORE.BRAND_ID.eq(bo.getBrandId()))) > 0) {
// throw new ServiceException("当前管理员已存在");
// }
// //获取云品牌id
// BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain().where(BrandExtendTableDef.BRAND_EXTEND.BRAND_ID.eq(bo.getBrandId())).one();
// //获取用户信息
// JSONObject jsonBody = new JSONObject();
// jsonBody.put("_type", "brandManagerAdd");
// jsonBody.put("brandId", brandExtend.getBrandCloudId());
// jsonBody.put("name", bo.getName());
// jsonBody.put("phone", bo.getPhone());
// jsonBody.put("position", "OAM添加");
// if (bo.getStoreIds() != null) {
// //获取云校区id
// List<String> cloudStoreIds = SpringUtils.getBean(StoreExtendService.class).queryChain().where(StoreExtendTableDef.STORE_EXTEND.STORE_ID.in(bo.getStoreIds())).list()
// .stream().map(StoreExtend::getStoreCloudId).collect(Collectors.toList());
// jsonBody.put("store", cloudStoreIds);
// }
// //本地新增
// BrandManager brandManage = BeanUtils.mapToClass(bo, BrandManager.class);
// JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
// assert result != null;
// brandManage.setBrandManagerCloudId(result.getString("data"));
// this.save(brandManage);
// List<BrandManagerStore> brandManagerStores = new ArrayList<>();
// //添加中间表
// if (bo.getStoreIds() != null) {
// bo.getStoreIds().forEach(item -> {
// BrandManagerStore brandManageStore = new BrandManagerStore();
// brandManageStore.setStoreId(item).setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
// brandManagerStores.add(brandManageStore);
// });
// } else {
// BrandManagerStore brandManageStore = new BrandManagerStore();
// brandManageStore.setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
// brandManagerStores.add(brandManageStore);
// }
// SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores);
}
}

View File

@ -52,9 +52,7 @@ public class CluePutOffServiceImpl extends ServiceImpl<CluePutOffMapper, CluePut
.select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE)
.select(BRAND.BRAND_NAME)
.select(STORE_SIGN.EXPIRE_DATE)
// 跟进间隔
.select(dateDiff(now(), CLUE.LAST_FOLLOW_UP_TIME).as(CluePageVo::getFollowUpInterval))
// 签约时间
.select(dateDiff(now(), CLUE.RECEIPT_TIME).as(CluePageVo::getSignInterval))
.from(CLUE_PUT_OFF)
.leftJoin(CLUE).on(CLUE.ID.eq(CLUE_PUT_OFF.CLUE_ID))
@ -63,7 +61,6 @@ public class CluePutOffServiceImpl extends ServiceImpl<CluePutOffMapper, CluePut
.leftJoin(STORE_SIGN).on(STORE_SIGN.STORE_ID.eq(STORE.ID))
.where(CLUE_PUT_OFF.AUDIT_STATUS.eq(0)),
PutOffAuditPageVo.class,
// 负责人
item -> item.field(PutOffAuditPageVo::getPutOffStaffName)
.queryWrapper(putOffStaff -> queryChain().select(STAFF.NAME.as(PutOffAuditPageVo::getPutOffStaffName))
.from(STAFF)

View File

@ -7,36 +7,31 @@ import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.fastjson.JSON;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.SqlUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.core.utils.file.FileUploadUtils;
import com.cpop.core.utils.file.FileUtils;
import com.cpop.core.utils.SqlUtils;
import com.cpop.jambox.business.entity.StoreExtend;
import com.cpop.jambox.business.service.StoreExtendService;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.DataImportBo;
import com.cpop.oam.business.bo.DataImportPageBo;
import com.cpop.oam.business.dto.DataImportDto;
import com.cpop.oam.business.dto.DataImportParamsDto;
import com.cpop.oam.business.vo.DataImportPageVo;
import com.cpop.oam.framework.constant.OamRedisConstant;
import com.cpop.system.business.vo.SysFileVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.oam.business.entity.DataImport;
import com.cpop.oam.business.mapper.DataImportMapper;
import com.cpop.oam.business.service.DataImportService;
import com.cpop.oam.business.vo.DataImportPageVo;
import com.cpop.oam.framework.constant.OamRedisConstant;
import com.cpop.system.business.vo.SysFileVo;
import com.cpop.system.framework.handler.TencentCosHandler;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.qcloud.cos.model.UploadResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@ -48,7 +43,6 @@ import java.util.Map;
import java.util.concurrent.locks.Lock;
import static com.alibaba.excel.cache.Ehcache.BATCH_COUNT;
import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND;
import static com.cpop.oam.business.entity.table.DataImportTableDef.DATA_IMPORT;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
@ -84,6 +78,7 @@ public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImp
.orderBy(DATA_IMPORT.CREATE_TIME.desc()),
DataImportPageVo.class);
}
/**
* 新增数据导入
* @author DB
@ -93,7 +88,7 @@ public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImp
@Override
public void insertDataImport(DataImportBo bo) {
DataImport dataImport = BeanUtils.mapToClass(bo, DataImport.class);
dataImport.setImportStatus(false).setSourceType(SourceType.JAMBOX.toString());
dataImport.setImportStatus(false).setSourceType("JAMBOX");
this.save(dataImport);
}
@ -136,21 +131,21 @@ public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImp
*/
@Override
public void importNow(DataImport dataImport) {
//读取数据
DataImportParamsDto dataImportParamsDto = new DataImportParamsDto();
dataImportParamsDto.setFileUrl(dataImport.getFileUrl()).setEmptyTag(dataImport.getIsClear() ? 1 : 0).setUploadId(dataImport.getId());
if (SourceType.valueOf(dataImport.getSourceType()) == SourceType.JAMBOX) {
StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_ID.eq(dataImport.getStoreId())).one();
dataImportParamsDto.setStoreId(storeExtend.getStoreCloudId());
} else {
dataImportParamsDto.setStoreId(dataImport.getStoreId());
}
this.updateChain().set(DATA_IMPORT.IMPORT_STATUS, true).where(DATA_IMPORT.ID.eq(dataImport.getId())).update();
try {
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.DATA_IMPORT, dataImportParamsDto, String.class);
} catch (Exception e) {
log.info("数据导入超时,导入id为{}", dataImport.getId());
}
// //读取数据
// DataImportParamsDto dataImportParamsDto = new DataImportParamsDto();
// dataImportParamsDto.setFileUrl(dataImport.getFileUrl()).setEmptyTag(dataImport.getIsClear() ? 1 : 0).setUploadId(dataImport.getId());
// if (StringUtils.equals(dataImport.getSourceType(), "JAMBOX")) {
// StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_ID.eq(dataImport.getStoreId())).one();
// dataImportParamsDto.setStoreId(storeExtend.getStoreCloudId());
// } else {
// dataImportParamsDto.setStoreId(dataImport.getStoreId());
// }
// this.updateChain().set(DATA_IMPORT.IMPORT_STATUS, true).where(DATA_IMPORT.ID.eq(dataImport.getId())).update();
// try {
// SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.DATA_IMPORT, dataImportParamsDto, String.class);
// } catch (Exception e) {
// log.info("数据导入超时,导入id为{}", dataImport.getId());
// }
}
/**
@ -276,8 +271,7 @@ public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImp
@Override
public void onException(Exception exception, AnalysisContext context) {
// 如果是某一个单元格的转换异常 能获取到具体行号 如果要获取头的信息 配合invokeHeadMap使用
if (exception instanceof ExcelDataConvertException) {
ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception;
if (exception instanceof ExcelDataConvertException excelDataConvertException) {
throw new ServiceException("" + (excelDataConvertException.getRowIndex() + 1) + "行,第" + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,数据为:" + excelDataConvertException.getCellData());
} else {
throw new ServiceException(exception.getMessage());
@ -287,6 +281,7 @@ public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImp
if (cachedDataList.isEmpty()){
throw new ServiceException("导入数据为空,请检查文件内容,按照模板格式导入");
}
assert fileName != null;
tempFile = File.createTempFile(fileName, ".xlsx");
log.info("文件名:{};临时文件地址: {}", fileName, tempFile.getPath());
EasyExcel.write(tempFile.getPath(), DataImportDto.class)

View File

@ -1,180 +0,0 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.system.framework.enums.InitRoleEnum;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysUser;
import com.cpop.core.utils.*;
import com.cpop.core.utils.SqlUtils;
import com.cpop.core.utils.uuid.IdUtils;
import com.cpop.oam.business.bo.MallStaffBo;
import com.cpop.oam.business.service.OamMallService;
import com.cpop.oam.business.vo.MallStaffPageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.row.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Arrays;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
/**
* @author DB
* @createTime 2023/11/09 14:42
* @description
*/
@Service("oamMallService")
public class OamMallServiceImpl implements OamMallService {
/**
* @descriptions 查询商城管理员分页列表
* @author DB
* @date 2023/11/09 14:47
* @return: com.mybatisflex.core.paginate.Page<com.cpop.oam.business.vo.MallStaffPageVo>
*/
@Override
public Page<MallStaffPageVo> getMallStaffPage(String brandIds, String name) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
QueryWrapper queryWrapper = QueryWrapper.create();
if (StringUtils.isNotBlank(name)) {
queryWrapper.and("name like ?", name + "%");
}
if (StringUtils.isNotBlank(brandIds)) {
queryWrapper.in("cp_mall_role_brand.brand_id", Arrays.asList(brandIds.split(",")));
}
Page<Row> rowPage = Db.paginate("cp_mall_staff", pageDomain.getPageNum(), pageDomain.getPageSize(),
queryWrapper.select("cp_mall_staff.*")
.select(SYS_USER.USER_NAME, SYS_USER.AVATAR, SYS_USER.EMAIL, SYS_USER.NICK_NAME, SYS_USER.PASSWORD, SYS_USER.PHONE_NUMBER, SYS_USER.SEX, SYS_USER.STATUS)
//角色
.select("cp_sys_role.role_name", "cp_sys_role.id as roleId")
//品牌
.select("cp_sys_brand.id as brandId", "cp_sys_brand.brand_name")
.from("cp_mall_staff")
.leftJoin(SYS_USER).on("cp_sys_user.id = cp_mall_staff.user_id")
.leftJoin("cp_mall_role_brand").on("cp_mall_role_brand.id = cp_mall_staff.role_brand_id")
.leftJoin("cp_sys_role").on("cp_sys_role.id = cp_mall_role_brand.role_id")
.leftJoin("cp_sys_brand").on("cp_sys_brand.id = cp_mall_role_brand.brand_id")
.where(SYS_USER.USER_TYPE.eq(UserType.MALL_USER))
.and("cp_mall_staff.is_delete = 0"));
return rowPage.map(item -> RowUtil.toEntity(item, MallStaffPageVo.class));
}
/**
* @descriptions 新增管理员
* @author DB
* @date 2023/11/10 12:14
* @param bo 请求参数
* @return: void
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void insertAdmin(MallStaffBo bo) {
//先添加用户信息
SysUser sysUser;
if (validatedUserInfo(bo)) {
throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist"));
} else {
//用户名-手机-邮箱都需要做唯一校验
sysUser = BeanUtils.mapToClass(bo, SysUser.class);
//解密与重设密码
decryptAndResetPasswords(sysUser);
sysUser.setId(IdUtils.fastSimpleUUID());
//获取当前创建人员信息
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
sysUser.setCreateUserId(loginUser.getUserId());
sysUser.setUpdateUserId(loginUser.getUserId());
sysUser.setUserType(UserType.MALL_USER.toString());
SpringUtils.getBean(CoreService.class).insertSysUser(sysUser);
}
LocalDateTime now = LocalDateTime.now();
//创建中间表
Row roleBrand = Row.ofKey(RowKey.SNOW_FLAKE_ID);
roleBrand.set("brand_id", bo.getBrandId())
.set("role_id", InitRoleEnum.SUPER_MALL_ROLE.getId())
.set("create_time", now)
.set("update_time", now)
.set("create_user_id", 1)
.set("update_user_id", 1);
Db.insert("cp_mall_role_brand",roleBrand);
Row mallStaff = Row.ofKey(RowKey.SNOW_FLAKE_ID);
mallStaff.set("name", bo.getName())
.set("role_brand_id", roleBrand.getString("id"))
.set("user_id", sysUser.getId())
.set("create_time", now)
.set("update_time", now)
.set("create_user_id", 1)
.set("update_user_id", 1);
long count = DbChain.table("cp_j_brand_extend").where("brand_id = ?", bo.getBrandId()).count();
if (count > 0) {
mallStaff.set("source_type", SourceType.JAMBOX.toString());
} else {
mallStaff.set("source_type", SourceType.COMMON.toString());
}
Db.insert("cp_mall_staff", mallStaff);
}
/**
* @descriptions 删除管理员
* @author DB
* @date 2023/11/10 14:34
* @param id 主键
* @return: void
*/
@Override
public void removeAdmin(String id) {
//查询员工信息
Row staff = DbChain.table("cp_mall_staff").where("id = ?", id).one();
if (null != staff) {
DbChain.table("cp_mall_staff")
.set("is_delete", 1)
.where("id = ?", id)
.update();
DbChain.table("cp_mall_role_brand")
.where("id = ?", staff.getString("roleBrandId"))
.remove();
//删除系统用户
SpringUtils.getBean(CoreService.class).removeSysUserById(staff.getString("userId"));
}
}
/**
* @Description: 用户名-手机-邮箱都需要做唯一校验
* @param bo 请求参数
* @return Boolean 通过/未通过
* @Author DB
* @Date: 2023/5/11 11:02
**/
private Boolean validatedUserInfo(MallStaffBo bo) {
long count = DbChain.table(SYS_USER)
//用户名
.where(SYS_USER.USER_NAME.eq(bo.getUserName()))
//手机号
.or(SYS_USER.PHONE_NUMBER.eq(bo.getPhoneNumber()))
.count();
if (StringUtils.isNotBlank(bo.getUserId())) {
return count > 1;
} else {
return count > 0;
}
}
/**
* @Description: 解密与重设密码
* @param sysUser 系统用户
* @Author: DB
* @Date: 2023/5/11 11:03
**/
private void decryptAndResetPasswords(SysUser sysUser) {
//先用rsa解密
String password = SpringUtils.getBean(RsaUtils.class).decrypt(sysUser.getPassword());
//再加密
sysUser.setPassword(SpringUtils.getBean(PasswordEncoder.class).encode(password));
}
}

View File

@ -1,11 +1,12 @@
package com.cpop.oam.business.service.impl;
import com.cpop.common.utils.StringUtils;
import com.cpop.system.framework.enums.InitRoleEnum;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysUser;
import com.cpop.core.utils.*;
import com.cpop.core.base.table.User;
import com.cpop.core.service.UserService;
import com.cpop.core.utils.RsaUtils;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.core.utils.uuid.IdUtils;
import com.cpop.oam.business.bo.StaffBo;
import com.cpop.oam.business.entity.Dept;
@ -17,10 +18,12 @@ import com.cpop.oam.business.service.StaffMidDeptService;
import com.cpop.oam.business.service.StaffService;
import com.cpop.oam.business.vo.WxCpLoginVo;
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
import com.cpop.system.framework.enums.InitRoleEnum;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.row.Db;
import com.mybatisflex.core.row.Row;
import com.mybatisflex.core.row.RowUtil;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpOAuth2Service;
@ -32,28 +35,26 @@ import me.chanjar.weixin.cp.bean.WxCpUserDetail;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.stream.Collectors;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
import static com.cpop.core.base.table.table.UserTableDef.USER;
import static com.cpop.oam.business.entity.table.DeptTableDef.DEPT;
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
/**
* @author DB
* @createTime 2023/11/17 9:42
* @description Oam暴露的企业微信接口
* @since 2023/11/17 9:42
* Oam暴露的企业微信接口
*/
@Slf4j
@Service("oamWxCpService")
public class OamWxCpServiceImpl implements OamWxCpService {
/**
* @descriptions 同步企业微信部门
* 同步企业微信部门
* @author DB
* @date 2023/11/15 16:56
* @return: void
* @since 2023/11/15 16:56
*/
@Override
public void syncWxCpDept() {
@ -85,12 +86,11 @@ public class OamWxCpServiceImpl implements OamWxCpService {
}
/**
* @descriptions 递归保存子部门
* 递归保存子部门
* @author DB
* @date 2023/11/16 16:06
* @since 2023/11/16 16:06
* @param wxCpDepartList 部门id
* @param parentDept 父部门
* @return: void
*/
private void recursionSonDept(List<WxCpDepart> wxCpDepartList, Dept parentDept) {
List<Dept> deptList = new ArrayList<Dept>();
@ -119,10 +119,9 @@ public class OamWxCpServiceImpl implements OamWxCpService {
}
/**
* @descriptions 同步企业微信员工
* 同步企业微信员工
* @author DB
* @date 2023/11/16 17:04
* @return: void
* @since 2023/11/16 17:04
*/
@Override
@Transactional(rollbackFor = Exception.class)
@ -132,9 +131,9 @@ public class OamWxCpServiceImpl implements OamWxCpService {
List<WxCpUser> wxCpUsers = cpService.getUserService().listByDepartment(1L, true, 0);
if (!wxCpUsers.isEmpty()) {
// 批量插入用户
Map<SysUser, WxCpUser> userWxCpUserMap = new HashMap<>();
Map<User, WxCpUser> userWxCpUserMap = new HashMap<>();
wxCpUsers.forEach(item -> {
SysUser sysUser = new SysUser();
User sysUser = new User();
sysUser.setId(IdUtils.fastSimpleUUID())
.setStatus(item.getStatus() == 1)
.setUserType(UserType.OAM_USER.toString())
@ -142,7 +141,7 @@ public class OamWxCpServiceImpl implements OamWxCpService {
sysUser.setUpdateUserId("1");
userWxCpUserMap.put(sysUser, item);
});
Db.executeBatch(userWxCpUserMap.keySet(), CoreMapper.class, CoreMapper::insertSysUser);
Db.executeBatch(userWxCpUserMap.keySet(), UserService.class, UserService::save);
List<Staff> staffList = new ArrayList<>();
// 批量创建用户
userWxCpUserMap.forEach((key, value) -> {
@ -175,11 +174,10 @@ public class OamWxCpServiceImpl implements OamWxCpService {
}
/**
* @descriptions 根据code换取用户信息
* 根据code换取用户信息
* @author DB
* @date 2023/11/20 18:19
* @since 2023/11/20 18:19
* @param code code
* @return: void
*/
@Override
public WxCpLoginVo loginUserInfoByCode(HttpServletRequest httpServletRequest, String code) {
@ -193,14 +191,14 @@ public class OamWxCpServiceImpl implements OamWxCpService {
// 查询用户信息
Row row = Db.selectOneByQuery("cp_sys_user",
QueryWrapper.create()
.select(SYS_USER.ALL_COLUMNS)
.select(USER.ALL_COLUMNS)
.leftJoin(STAFF)
.on(STAFF.USER_ID.eq(SYS_USER.ID))
.on(STAFF.USER_ID.eq(USER.ID))
.where(STAFF.WX_CP_USER_ID.eq(wxCpUserId)));
if (null == row) {
throw new ServiceException("请先在企微上的Oam应用中进行注册");
}
SysUser sysUser = RowUtil.toEntity(row, SysUser.class);
User sysUser = RowUtil.toEntity(row, User.class);
return new WxCpLoginVo(sysUser.getUserName(), sysUser.getRsaPassword());
} catch (WxErrorException e) {
throw new ServiceException(e.getMessage());
@ -208,12 +206,11 @@ public class OamWxCpServiceImpl implements OamWxCpService {
}
/**
* @descriptions 企微的o2认证可查询用户敏感信息
* 企微的o2认证可查询用户敏感信息
* @author DB
* @date 2023/11/21 15:31
* @since 2023/11/21 15:31
* @param agentId 应用id
* @param code 授权码
* @return: void
*/
@Override
@Transactional(rollbackFor = Exception.class)

View File

@ -13,14 +13,16 @@ import com.cpop.core.service.UserService;
import com.cpop.core.utils.*;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.core.utils.uuid.IdUtils;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.entity.Staff;
import com.cpop.oam.business.entity.StaffMidDept;
import com.cpop.oam.business.mapper.StaffMapper;
import com.cpop.oam.business.service.StaffMidDeptService;
import com.cpop.oam.business.service.StaffService;
import com.cpop.oam.business.vo.*;
import com.cpop.oam.business.vo.OperationLogVo;
import com.cpop.oam.business.vo.StaffInfoVo;
import com.cpop.oam.business.vo.StaffPageVo;
import com.cpop.oam.business.vo.StaffVo;
import com.cpop.oam.framework.constant.OamConfigKey;
import com.cpop.oam.framework.enums.OamConfigEnum;
import com.mybatisflex.core.paginate.Page;
@ -32,7 +34,6 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@ -385,13 +386,13 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
jsonBody.put("_type", "oamDel");
jsonBody.put("phone", User.getPhoneNumber());
}
JSONObject jsonObject = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
assert jsonObject != null;
if (!jsonObject.getBoolean("success")) {
throw new ServiceException(jsonObject.getString("error"));
} else {
this.updateChain().set(STAFF.IS_OPERATION, bo.getIsOperation()).where(STAFF.ID.eq(bo.getId())).update();
}
// JSONObject jsonObject = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
// assert jsonObject != null;
// if (!jsonObject.getBoolean("success")) {
// throw new ServiceException(jsonObject.getString("error"));
// } else {
// this.updateChain().set(STAFF.IS_OPERATION, bo.getIsOperation()).where(STAFF.ID.eq(bo.getId())).update();
// }
}
}

View File

@ -1,17 +1,17 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import cn.dev33.satoken.stp.StpUtil;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.constant.Constants;
import com.cpop.common.utils.DateUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysConfig;
import com.cpop.core.base.table.Config;
import com.cpop.core.constant.Constants;
import com.cpop.core.service.ConfigService;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.SqlUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.entity.Staff;
import com.cpop.oam.business.entity.Task;
@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.stream.Collectors;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
import static com.cpop.core.base.table.table.UserTableDef.USER;
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP;
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
@ -195,17 +195,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
*/
@Override
public void insertIterationTask(TaskIterationBo bo) {
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
Task entity = BeanUtils.mapToClass(bo, Task.class);
// 默认待审核 默认开发中
entity.setTaskStatus(0).setTaskItem(0).setTaskType(0).setRecordStaffId(loginUserInfo.getString("id"));
entity.setTaskStatus(0).setTaskItem(0).setTaskType(0).setRecordStaffId(StpUtil.getLoginIdAsString());
this.save(entity);
// 获取审核管理员手机号
RedisService redisService = SpringUtils.getBean(RedisService.class);
String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
if (StringUtils.isBlank(auditStaffPhone)) {
CoreService coreService = SpringUtils.getBean(CoreService.class);
SysConfig sysConfig = coreService.selectConfigByKey(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
ConfigService configService = SpringUtils.getBean(ConfigService.class);
Config sysConfig = configService.getById(OamConfigEnum.AUDIT_STAFF_PHONE.getKey());
auditStaffPhone = sysConfig.getConfigValue();
if (StringUtils.isBlank(auditStaffPhone)) {
throw new ServiceException("尚未配置审核管理员信息!");
@ -262,10 +261,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
task.setExpectedCompletionDate(now.plusDays(Integer.parseInt(dictValue.split(",")[1]) - 1));
}
// 获取当前用户
JSONObject loginUser = SecurityUtils.getInstance().getLoginUserInfo();
if (!Constants.SUPER_ADMIN.equals(loginUser.getString("userName"))) {
if (!Constants.SUPER_ADMIN.equals(StpUtil.getSession().getString("username"))) {
// 获取当前员工
Staff staff = SpringUtils.getBean(StaffService.class).getOne(QueryWrapper.create().where(STAFF.USER_ID.eq(loginUser.getString("userId"))));
Staff staff = SpringUtils.getBean(StaffService.class).getOne(QueryWrapper.create().where(STAFF.USER_ID.eq(StpUtil.getSession().getString("userId"))));
task.setResponsibleStaffId(staff.getId());
}
this.updateById(task);
@ -276,7 +274,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
// 通知所有人
try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
Collections.singletonList(loginUser.getString("phoneNumber")),
Collections.singletonList(StpUtil.getSession().getString("phone")),
"==========任务领取==========" + "\n" + task.getTaskContent(),
false);
} catch (IOException e) {
@ -339,8 +337,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
}
QueryWrapper queryWrapper = QueryWrapper.create();
if (StringUtils.isNotBlank(staffId)){
Row staff = Db.selectOneByQuery(SYS_USER.getTableName(), QueryWrapper.create().select(SYS_USER.PHONE_NUMBER)
.leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID))
Row staff = Db.selectOneByQuery(USER.getTableName(), QueryWrapper.create().select(USER.PHONE_NUMBER)
.leftJoin(STAFF).on(STAFF.USER_ID.eq(USER.ID))
.where(STAFF.ID.eq(staffId)));
//对比当前员工是否是测试管理员
if (!Arrays.asList(testStaffPhones.split(",")).contains(staff.getString("phoneNumber"))) {
@ -352,11 +350,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
.groupBy(TASK.ID);
}
} else {
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
//对比当前员工是否是测试管理员
if (!Arrays.asList(testStaffPhones.split(",")).contains(loginUserInfo.getString("phoneNumber"))) {
if (!Arrays.asList(testStaffPhones.split(",")).contains(StpUtil.getSession().getString("phone"))) {
queryWrapper.and(TASK.TASK_STATUS.in(2, 3, 8, 9))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id")));
.and(TASK_STAFF_GROUP.STAFF_ID.eq(StpUtil.getSession().getString("id")));
} else {
//测试人员
queryWrapper.and(TASK.TASK_STATUS.in(3, 8, 9))
@ -405,13 +402,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
//查询任务进度
Task task = this.getById(bo.getId());
//进行中转测试
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
switch (bo.getTaskItem()) {
//逾期
case -1:
//判断当前任务状态
if (task.getTaskStatus() == 2) {
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) {
@ -424,7 +420,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交");
}
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8);
testStaffAddPoint(task, loginUserInfo);
testStaffAddPoint(task, StpUtil.getLoginIdAsString());
LocalDate now = LocalDate.now();
LocalDate expectedCompletionDate = task.getExpectedCompletionDate();
//测试任务延期一天
@ -438,7 +434,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
break;
//转测试
case 0:
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) {
@ -452,7 +448,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交");
}
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2);
testStaffAddPoint(task, loginUserInfo);
testStaffAddPoint(task, StpUtil.getLoginIdAsString());
break;
default:
}
@ -482,11 +478,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
* @since 2023/12/21
* @param task 任务
*/
private void testStaffAddPoint(Task task, JSONObject loginUserInfo) {
private void testStaffAddPoint(Task task, String id) {
//计算绩点
double v = task.getTaskWeight() * 0.2;
TaskStaffGroup taskStaffGroup = new TaskStaffGroup();
taskStaffGroup.setTaskId(task.getId()).setStaffId(loginUserInfo.getString("id")).setGradePoint((int) v).setRemark("测试员工获取绩点");
taskStaffGroup.setTaskId(task.getId()).setStaffId(id).setGradePoint((int) v).setRemark("测试员工获取绩点");
SpringUtils.getBean(TaskStaffGroupService.class).save(taskStaffGroup);
}
@ -575,8 +571,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
private void isTaskResponsibleStaff(String taskId) {
// 获取任务
Task task = this.getById(taskId);
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
}
@ -603,7 +598,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
firstDay = date.with(TemporalAdjusters.firstDayOfMonth());
} else {
// 查询当月
DateUtils.getDate();
LocalDate now = LocalDate.now();
firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
}
@ -649,13 +643,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
Long finishGpa = statisticalGpa(taskStaffGroups.stream().filter(s -> finishTaskSet.contains(s.getTaskId())).collect(Collectors.toList()));
statisticsVo.setGpaOfTheMonth(finishGpa);
}
List<Date> allTheDateOfMonth;
//TODO 获取月付
List<Date> allTheDateOfMonth = new ArrayList<>();
// 有传入月份
if (StringUtils.isNotBlank(bo.getTaskMoth())) {
allTheDateOfMonth = DateUtils.getAllTheDateOfTheMonth(DateUtils.parseDate(bo.getTaskMoth() + "-15"));
//allTheDateOfMonth = DateUtils.getAllTheDateOfTheMonth(DateUtils.parseDate(bo.getTaskMoth() + "-15"));
} else {
// 获取当月日期数组并遍历
allTheDateOfMonth = DateUtils.getAllTheDateOfTheMonth(new Date());
//allTheDateOfMonth = DateUtils.getAllTheDateOfTheMonth(new Date());
}
allTheDateOfMonth.forEach(item -> {
LocalDate localDate = item.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
@ -744,9 +739,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
private String createDailyPaper(List<Task> taskList, Map<String, List<TaskStaffGroup>> taskStaffGroupMap) {
//所有技术员工信息
Map<String, Staff> staffMap = SpringUtils.getBean(StaffService.class).queryChain()
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID))
.leftJoin(USER).on(USER.ID.eq(STAFF.USER_ID))
.where(STAFF.STAFF_TYPE.in(0, 2))
.and(SYS_USER.STATUS.eq(1))
.and(USER.STATUS.eq(1))
.list()
.stream().collect(Collectors.toMap(Staff::getId, item -> item));
StringBuilder dailyPaper = new StringBuilder();
@ -785,8 +780,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
queryWrapper.and(TASK_STAFF_GROUP.STAFF_ID.eq(staffId));
} else {
//获取当前用户信息
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
queryWrapper.and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id")));
queryWrapper.and(TASK_STAFF_GROUP.STAFF_ID.eq(StpUtil.getLoginIdAsString()));
}
if (startDate != null && endDate != null) {
queryWrapper.and(dateFormat(TASK.TASK_RECEIPT_TIME, "%Y-%m-%d").between(startDate, endDate));

View File

@ -1,13 +1,11 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import cn.dev33.satoken.stp.StpUtil;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.StringUtils;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.oam.business.bo.TaskStaffGroupBo;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.entity.TaskStaffGroup;
@ -18,6 +16,8 @@ import com.cpop.oam.business.service.TaskStaffGroupService;
import com.cpop.oam.business.vo.StaffInfoVo;
import com.cpop.oam.business.vo.TaskStaffGroupVo;
import com.cpop.oam.framework.constant.WebHookKeyConstant;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -71,8 +71,7 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById(bo.getTaskId());
// 当前操作员工是否是主要负责人不是抛出异常
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
// 查询当前添加的员工是否存在在此任务中
@ -98,14 +97,14 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
this.updateById(responsibleStaff);
// 企微通知绩点调整人员
List<String> phoneList = new ArrayList<String>();
phoneList.add(loginUserInfo.getString("phoneNumber"));
phoneList.add(StpUtil.getSession().getString("phone"));
// 获取新增员工信息
StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId());
phoneList.add(staffInfo.getPhoneNumber());
try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList,
"任务:" + task.getTaskContent() + "\n" +
loginUserInfo.getString("name") + "您的绩点调整为" + responsibleStaff.getGradePoint() + "\n" + staffInfo.getName()
StpUtil.getSession().getString("name") + "您的绩点调整为" + responsibleStaff.getGradePoint() + "\n" + staffInfo.getName()
+ "您新加入任务:" + task.getTaskContent() + "绩点为:" + bo.getGradePoint(),
false);
} catch (IOException e) {
@ -128,8 +127,7 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
if (null == task) {
throw new ServiceException("获取任务失败!请联系相关人员!");
}
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
if (StringUtils.equals(bo.getStaffId(), task.getResponsibleStaffId())) {
@ -167,14 +165,14 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
.update();
// 企微通知绩点调整人员
List<String> phoneList = new ArrayList<String>();
phoneList.add(loginUserInfo.getString("phoneNumber"));
phoneList.add(StpUtil.getSession().getString("phone"));
// 获取新增员工信息
StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(bo.getStaffId());
phoneList.add(staffInfo.getPhoneNumber());
try {
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList,
"任务:" + task.getTaskContent() + "\n" +
loginUserInfo.getString("name") + "您的绩点调整为" + responsibleStaffTaskInfo.getGradePoint() + "\n"
StpUtil.getSession().getString("name") + "您的绩点调整为" + responsibleStaffTaskInfo.getGradePoint() + "\n"
+ staffInfo.getName() + "您的绩点调整为:" + bo.getGradePoint(),
false);
} catch (IOException e) {
@ -195,8 +193,7 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl<TaskStaffGroupMapper,
TaskStaffGroup taskStaffGroup = this.getById(id);
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById(taskStaffGroup.getTaskId());
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) {
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
}
// 不允许删除主要负责人

View File

@ -1,56 +0,0 @@
package com.cpop.oam.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 登录用户的基本信息
* 用于记录到token的信息使用
* @author Gewj
*
*/
@Data
@Accessors(chain = true)
@ApiModel
public class LoginUserInfoVo {
/**
* 用户id
*/
@ApiModelProperty("用户id")
private String userId;
/**
* 头像
*/
@ApiModelProperty("头像")
private String avatar;
/**
* 登录用户名
*/
@ApiModelProperty("登录用户名")
private String username;
/**
* 真实姓名
*/
@ApiModelProperty("真实姓名")
private String realName;
/**
* 介绍
*/
@ApiModelProperty("介绍")
private String desc;
/**
* 用户首页路由
*/
@ApiModelProperty("用户首页路由")
private String homePath;
}

View File

@ -1,126 +0,0 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author DB
* @createTime 2023/10/20 11:06
* @description
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "商城员工分页返回对象")
public class MallStaffPageVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 姓名
*/
@ApiModelProperty("姓名")
private String name;
/**
* 用户id
*/
@ApiModelProperty("用户id")
private String userId;
/**
* 角色-品牌-id
*/
@ApiModelProperty("角色-品牌-id")
private String roleBrandId;
/**
* 品牌id
*/
@ApiModelProperty("品牌id")
private String brandId;
/**
* 品牌
*/
@ApiModelProperty("品牌")
private String brandName;
/**
* 用户名
*/
@ApiModelProperty("用户名")
private String userName;
/**
* 昵称
*/
@ApiModelProperty("昵称")
private String nickName;
/**
* 邮箱
*/
@ApiModelProperty("邮箱")
private String email;
/**
* 手机号
*/
@ApiModelProperty("手机号")
private String phoneNumber;
/**
* 性别(0:;1:)
*/
@ApiModelProperty("性别(0:男;1:女)")
private Boolean sex;
/**
* 头像
*/
@ApiModelProperty("头像")
private String avatar;
/**
* 状态(0:停用;1:启用)
*/
@ApiModelProperty("状态(0:停用;1:启用)")
private Boolean status;
/**
* 角色id
*/
@ApiModelProperty("角色id")
private String roleId;
/**
* 角色名
*/
@ApiModelProperty("角色名")
private String roleName;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private LocalDateTime updateTime;
/**
* 密码
*/
@ApiModelProperty("密码")
private String password;
}

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.vo;
import com.mybatisflex.annotation.Column;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
@ -17,101 +15,99 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Menu对象", description = "")
public class MenuRouteVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "Menu对象")
public class MenuRouteVo {
/**
* 菜单ID
*/
@ApiModelProperty("菜单ID")
@Schema(description ="菜单ID")
private String id;
/**
* 父级菜单ID
*/
@ApiModelProperty("父级菜单ID")
@Schema(description ="父级菜单ID")
private String parentMenu;
/**
* 菜单名
*/
@ApiModelProperty("菜单名")
@Schema(description ="菜单名")
private String name;
/**
* 菜单图标
*/
@ApiModelProperty("菜单图标")
@Schema(description ="菜单图标")
private String icon;
/**
* 菜单路由父菜单为空
*/
@ApiModelProperty("菜单路由,父菜单为空")
@Schema(description ="菜单路由,父菜单为空")
private String component;
/**
* 标记菜单的状态 0:禁用 1正常根据权限正常显示
*/
@ApiModelProperty("标记菜单的状态 0:禁用 1正常根据权限正常显示")
@Schema(description ="标记菜单的状态 0:禁用 1正常根据权限正常显示")
private Boolean status;
/**
* 用户类型1管理员2审计管理员3安全管理员4普通用户
*/
@ApiModelProperty("用户类型1管理员2审计管理员3安全管理员4普通用户")
@Schema(description ="用户类型1管理员2审计管理员3安全管理员4普通用户")
private String type;
/**
* 权限
*/
@ApiModelProperty("权限")
@Schema(description ="权限")
private String permission;
/**
* 重定向路径一级菜单有值
*/
@ApiModelProperty("重定向路径,一级菜单有值")
@Schema(description ="重定向路径,一级菜单有值")
private String redirect;
/**
* 排序值越小越靠前一级菜单有值
*/
@ApiModelProperty("排序,值越小越靠前,一级菜单有值")
@Schema(description ="排序,值越小越靠前,一级菜单有值")
private Integer orderNo;
/**
* 子菜单集
*/
@Column(ignore = true)
@ApiModelProperty("子菜单集")
@Schema(description ="子菜单集")
private List<MenuRouteVo> children;
/**
* 路由地址
*/
@ApiModelProperty("路由地址")
@Schema(description ="路由地址")
private String path;
/**
* 标题
*/
@ApiModelProperty("标题")
@Schema(description ="标题")
private String title;
/**
* 隐藏菜单
*/
@ApiModelProperty("隐藏菜单")
@Schema(description ="隐藏菜单")
private Boolean hideMenu;
/**
* 内部定义类
*/
@Column(ignore = true)
@ApiModelProperty("内部定义类")
@Schema(description ="内部定义类")
private Meta meta;
/**

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@ -18,100 +16,98 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(description = "菜单返回对象")
public class MenuVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "菜单返回对象")
public class MenuVo {
/**
* 菜单ID
*/
@ApiModelProperty(value = "菜单ID")
@Schema(description = "菜单ID")
private String id;
/**
* 父级菜单ID
*/
@ApiModelProperty(value = "父级菜单ID")
@Schema(description = "父级菜单ID")
private String parentMenu;
/**
* 菜单名称
*/
@ApiModelProperty(value = "菜单名称")
@Schema(description = "菜单名称")
private String name;
/**
* 菜单图标
*/
@ApiModelProperty(value = "菜单图标")
@Schema(description = "菜单图标")
private String icon;
/**
* 菜单路由父菜单为空
*/
@ApiModelProperty(value = "菜单路由,父菜单为空")
@Schema(description = "菜单路由,父菜单为空")
private String component;
/**
* 标记菜单的状态 0:禁用 1:启用根据权限正常显示
*/
@ApiModelProperty(value = "标记菜单的状态 0:禁用 1:启用(根据权限正常显示)")
@Schema(description = "标记菜单的状态 0:禁用 1:启用(根据权限正常显示)")
private Boolean status;
/**
* 权限
*/
@ApiModelProperty(value = "权限")
@Schema(description = "权限")
private String permission;
/**
* 重定向路径一级菜单有值
*/
@ApiModelProperty(value = "重定向路径,一级菜单有值")
@Schema(description = "重定向路径,一级菜单有值")
private String redirect;
/**
* 排序值越小越靠前一级菜单有值
*/
@ApiModelProperty(value = "排序,值越小越靠前,一级菜单有值")
@Schema(description = "排序,值越小越靠前,一级菜单有值")
private Integer orderNo;
/**
* 路由地址
*/
@ApiModelProperty(value = "路由地址")
@Schema(description = "路由地址")
private String path;
/**
* 标题
*/
@ApiModelProperty(value = "标题")
@Schema(description = "标题")
private String title;
/**
* 子菜单集
*/
@ApiModelProperty(value = "子菜单集")
@Schema(description = "子菜单集")
private List<MenuVo> children;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@ApiModelProperty(value = "更新时间")
@Schema(description = "更新时间")
private LocalDateTime updateTime;
/**
* 菜单类型0:目录1:菜单2:按钮
*/
@ApiModelProperty(value = "菜单类型0:目录1:菜单2:按钮")
@Schema(description = "菜单类型0:目录1:菜单2:按钮")
private Integer type;
/**
* 隐藏菜单
*/
@ApiModelProperty(value = "隐藏菜单")
@Schema(description = "隐藏菜单")
private Boolean hideMenu;
}

View File

@ -2,12 +2,10 @@ package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@ -19,58 +17,56 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Role分页返回对象")
public class RolePageVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "Role分页返回对象")
public class RolePageVo {
/**
* 主键
*/
@ApiModelProperty("主键")
@Schema(description ="主键")
private String id;
/**
* 角色名称
*/
@ApiModelProperty("角色名称")
@Schema(description ="角色名称")
private String roleName;
/**
* 角色值
*/
@ApiModelProperty("角色值")
@Schema(description ="角色值")
private String roleValue;
/**
* 状态
*/
@ApiModelProperty("状态")
@Schema(description ="状态")
private Boolean status;
/**
* 备注
*/
@ApiModelProperty("备注")
@Schema(description ="备注")
private String remark;
/**
* 排序
*/
@ApiModelProperty("排序")
@Schema(description ="排序")
private Integer orderNo;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@ApiModelProperty("更新时间")
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 角色所属菜单id集合
*/
@ApiModelProperty("角色所属菜单id集合")
@Schema(description ="角色所属菜单id集合")
@Column(ignore = true)
private List<String> menuIds;
}

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;
@ -18,63 +16,61 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "Task对象", description = "OAM-任务表")
public class TaskMonthStatisticsVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "OAM-任务表")
public class TaskMonthStatisticsVo {
/**
* 进行中
*/
@ApiModelProperty(value = "进行中")
@Schema(description = "进行中")
private Long inProgress = 0L;
/**
* 已完成
*/
@ApiModelProperty(value = "已完成")
@Schema(description = "已完成")
private Long haveCompleted = 0L;
/**
* 测试中
*/
@ApiModelProperty(value = "测试中")
@Schema(description = "测试中")
private Long inTest = 0L;
/**
* 已逾期
*/
@ApiModelProperty(value = "已逾期")
@Schema(description = "已逾期")
private Long overdue = 0L;
/**
* 当月绩点
*/
@ApiModelProperty(value = "当月绩点")
@Schema(description = "当月绩点")
private Long gpaOfTheMonth = 0L;
/**
* 月度数据统计对象集合
*/
@ApiModelProperty(value = "月度数据统计对象集合")
@Schema(description = "月度数据统计对象集合")
private List<DataStatisticsVo> vos;
@Data
@Accessors(chain = true)
@ApiModel(value = "月度数据统计对象", description = "OAM-任务表")
@Schema(description = "OAM-任务表")
public class DataStatisticsVo {
/**
* 日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "日期")
@Schema(description = "日期")
private LocalDate date;
/**
* 任务内容
*/
@ApiModelProperty(value = "任务内容")
@Schema(description = "任务内容")
private List<String> taskContents;
}
}

View File

@ -1,8 +1,7 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@ -15,37 +14,37 @@ import java.time.LocalDateTime;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TaskWorkOrderPageVo对象", description = "任务-工单-记录")
@Schema(description = "任务-工单-记录")
public class TaskWorkOrderPageVo {
/**
* 工单id
*/
@ApiModelProperty("工单id")
@Schema(description ="工单id")
private String id;
/**
* 任务内容
*/
@ApiModelProperty("任务内容")
@Schema(description ="任务内容")
private String taskContent;
/**
* 办结员工id
*/
@ApiModelProperty("办结员工id")
@Schema(description ="办结员工id")
private String finishStaffId;
/**
* 办结员工
*/
@ApiModelProperty("办结员工")
@Schema(description ="办结员工")
private String finishStaffName;
/**
* 办结时间
*/
@ApiModelProperty("办结时间")
@Schema(description ="办结时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime finishTime;

View File

@ -1,12 +1,10 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@ -17,75 +15,75 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "接收/处理/暂停中页面返回对象", description = "接收/处理/暂停中对象")
@Schema(description = "接收/处理/暂停中对象")
public class TaskWorkOrderReceiveDealPauseVo {
/**
* 待接收列表
*/
@ApiModelProperty(value = "待接收列表")
@Schema(description = "待接收列表")
private List<Receive> receiveList;
/**
* 处理中列表
*/
@ApiModelProperty(value = "处理中列表")
@Schema(description = "处理中列表")
private List<Deal> dealList;
/**
* 暂停中列表
*/
@ApiModelProperty(value = "暂停中列表")
@Schema(description = "暂停中列表")
private List<Pause> pauseList;
/**
* 接收
*/
@Data
@ApiModel("待接收")
@Schema(description = "待接收")
public static class Receive {
/**
* 工单id
*/
@ApiModelProperty(value = "工单id")
@Schema(description = "工单id")
private String id;
/**
* 机构/品牌
*/
@ApiModelProperty(value = "机构/品牌")
@Schema(description = "机构/品牌")
private String brandName;
/**
* 校区/店铺
*/
@ApiModelProperty(value = "校区/店铺")
@Schema(description = "校区/店铺")
private String storeName;
/**
* 问题描述
*/
@ApiModelProperty(value = "问题描述")
@Schema(description = "问题描述")
private String taskContent;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
@Schema(description = "手机号")
private String phoneNumber;
/**
* 提交人
*/
@ApiModelProperty(value = "提交人")
@Schema(description = "提交人")
private String recordStaffName;
/**
* 提交时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "提交时间")
@Schema(description = "提交时间")
private LocalDateTime createTime;
}
@ -94,69 +92,69 @@ public class TaskWorkOrderReceiveDealPauseVo {
* 接收
*/
@Data
@ApiModel("处理中")
@Schema(description = "处理中")
public static class Deal {
/**
* 工单id
*/
@ApiModelProperty(value = "工单id")
@Schema(description = "工单id")
private String id;
/**
* 机构/品牌
*/
@ApiModelProperty(value = "机构/品牌")
@Schema(description = "机构/品牌")
private String brandName;
/**
* 校区/店铺
*/
@ApiModelProperty(value = "校区/店铺")
@Schema(description = "校区/店铺")
private String storeName;
/**
* 问题描述
*/
@ApiModelProperty(value = "问题描述")
@Schema(description = "问题描述")
private String taskContent;
/**
* 提交人
*/
@ApiModelProperty(value = "提交人")
@Schema(description = "提交人")
private String recordStaffName;
/**
* 提交时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "提交时间")
@Schema(description = "提交时间")
private LocalDateTime createTime;
/**
* 接收人
*/
@ApiModelProperty(value = "接收人")
@Schema(description = "接收人")
private String responsibleStaffName;
/**
* 任务接收时间
*/
@ApiModelProperty(value = "任务接收时间")
@Schema(description = "任务接收时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime taskReceiptTime;
/**
* 任务接收用时/min
*/
@ApiModelProperty(value = "任务接收用时/min")
@Schema(description = "任务接收用时/min")
private Integer receivingTime;
/**
* 任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:待测试;5:暂停;7:接收超时;8:待部署;9:待归档;10:审核不通过)
*/
@ApiModelProperty(value = "任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:待测试;5:暂停;7:接收超时;8:待部署;9:待归档;10:审核不通过)")
@Schema(description = "任务状态(-1:失败;0:待审核;1:待接受;2:进行中;3:待测试;5:暂停;7:接收超时;8:待部署;9:待归档;10:审核不通过)")
private Integer taskStatus;
}
@ -165,70 +163,70 @@ public class TaskWorkOrderReceiveDealPauseVo {
* 暂停中
*/
@Data
@ApiModel("暂停中")
@Schema(description = "暂停中")
public static class Pause {
/**
* 工单id
*/
@ApiModelProperty(value = "工单id")
@Schema(description = "工单id")
private String id;
/**
* 机构/品牌
*/
@ApiModelProperty(value = "机构/品牌")
@Schema(description = "机构/品牌")
private String brandName;
/**
* 校区/店铺
*/
@ApiModelProperty(value = "校区/店铺")
@Schema(description = "校区/店铺")
private String storeName;
/**
* 问题描述
*/
@ApiModelProperty(value = "问题描述")
@Schema(description = "问题描述")
private String taskContent;
/**
* 提交人
*/
@ApiModelProperty(value = "提交人")
@Schema(description = "提交人")
private String recordStaffName;
/**
* 提交时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "提交时间")
@Schema(description = "提交时间")
private LocalDateTime createTime;
/**
* 接收人
*/
@ApiModelProperty(value = "接收人")
@Schema(description = "接收人")
private String responsibleStaffName;
/**
* 暂停员工
*/
@ApiModelProperty(value = "暂停员工")
@Schema(description = "暂停员工")
private String pauseStaffName;
/**
* 暂停记录时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "暂停记录时间")
@Schema(description = "暂停记录时间")
private LocalDateTime pauseRecordTime;
/**
* 暂停到期时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "暂停到期时间")
@Schema(description = "暂停到期时间")
private LocalDateTime pauseExpireTime;
}

View File

@ -1,8 +1,7 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@ -15,130 +14,130 @@ import java.time.LocalDateTime;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TaskWorkOrderStatPageVo对象", description = "工单统计")
@Schema(description = "工单统计")
public class TaskWorkOrderStatPageVo {
/**
* id
*/
@ApiModelProperty(value = "id")
@Schema(description = "id")
private String id;
/**
* 品牌
*/
@ApiModelProperty(value = "品牌")
@Schema(description = "品牌")
private String brandName;
/**
* 校区店铺
*/
@ApiModelProperty(value = "校区店铺")
@Schema(description = "校区店铺")
private String storeName;
/**
* 接收用时
*/
@ApiModelProperty(value = "接收用时")
@Schema(description = "接收用时")
private Integer receivingTime;
/**
* 任务内容
*/
@ApiModelProperty("任务内容")
@Schema(description ="任务内容")
private String taskContent;
/**
* 暂停员工id
*/
@ApiModelProperty("暂停员工id")
@Schema(description ="暂停员工id")
private String pauseStaffId;
/**
* 暂停员工
*/
@ApiModelProperty("暂停员工")
@Schema(description ="暂停员工")
private String pauseStaffName;
/**
* 暂停记录时间
*/
@ApiModelProperty("暂停记录时间")
@Schema(description ="暂停记录时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime pauseRecordTime;
/**
* 暂停到期时间
*/
@ApiModelProperty("暂停到期时间")
@Schema(description ="暂停到期时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime pauseExpireTime;
/**
* 办结员工id
*/
@ApiModelProperty("办结员工id")
@Schema(description ="办结员工id")
private String finishStaffId;
/**
* 办结员工
*/
@ApiModelProperty("办结员工")
@Schema(description ="办结员工")
private String finishStaffName;
/**
* 办结时间
*/
@ApiModelProperty("办结时间")
@Schema(description ="办结时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime finishTime;
/**
* 记录员工id
*/
@ApiModelProperty("记录员工id")
@Schema(description ="记录员工id")
private String recordStaffId;
/**
* 记录员工
*/
@ApiModelProperty("记录员工")
@Schema(description ="记录员工")
private String recordStaffName;
/**
* 主要负责员工id
*/
@ApiModelProperty("主要负责员工id")
@Schema(description ="主要负责员工id")
private String responsibleStaffId;
/**
* 主要负责员工
*/
@ApiModelProperty("主要负责员工")
@Schema(description ="主要负责员工")
private String responsibleStaffName;
/**
* 任务接收时间
*/
@ApiModelProperty("任务接收时间")
@Schema(description ="任务接收时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime taskReceiptTime;
/**
* 绩点
*/
@ApiModelProperty("绩点")
@Schema(description ="绩点")
private Integer gradePoint;
/**
* 备注
*/
@ApiModelProperty("备注")
@Schema(description ="备注")
private String remark;
/**
* 任务状态
*/
@ApiModelProperty("任务状态")
@Schema(description ="任务状态")
private Integer taskStatus;
}

View File

@ -1,9 +1,7 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Id;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@ -16,49 +14,49 @@ import java.time.LocalDateTime;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TechnologyToolPageVo对象", description = "TechnologyToolPageVo对象")
@Schema(description = "TechnologyToolPageVo对象")
public class TechnologyToolPageVo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
@Schema(description = "主键")
private String id;
/**
* 工具名
*/
@ApiModelProperty(value = "工具名")
@Schema(description = "工具名")
private String toolName;
/**
* 工具地址
*/
@ApiModelProperty(value = "工具地址")
@Schema(description = "工具地址")
private String toolUrl;
/**
* 工具介绍
*/
@ApiModelProperty(value = "工具介绍")
@Schema(description = "工具介绍")
private String toolDesc;
/**
* 工具类型(字典)
*/
@ApiModelProperty(value = "工具类型")
@Schema(description = "工具类型")
private String toolType;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
@Schema(description = "创建人")
private String createUser;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@ -2,8 +2,7 @@ package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.RelationOneToOne;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@ -17,39 +16,39 @@ import java.time.LocalDate;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "工单值班返回对象", description = "工单值班返回对象")
@Schema(description = "工单值班返回对象")
public class WorkOrderDutyVo {
/**
* 服务员工id
*/
@ApiModelProperty("服务员工id")
@Schema(description ="服务员工id")
private String serviceStaffId;
/**
* 服务员工名称
*/
@RelationOneToOne(selfField = "serviceStaffId", targetField = "id", targetTable = "cp_oam_staff", valueField = "name")
@ApiModelProperty("服务员工名称")
@Schema(description ="服务员工名称")
private String serviceStaffName;
/**
* 技术员工id
*/
@ApiModelProperty("技术员工id")
@Schema(description ="技术员工id")
private String technologyStaffId;
/**
* 技术员工名称
*/
@RelationOneToOne(selfField = "technologyStaffId", targetField = "id", targetTable = "cp_oam_staff", valueField = "name")
@ApiModelProperty("技术员工名称")
@Schema(description ="技术员工名称")
private String technologyStaffName;
/**
* 值班日期
*/
@ApiModelProperty("值班日期")
@Schema(description ="值班日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private LocalDate dutyDate;

View File

@ -1,6 +1,6 @@
package com.cpop.oam.business.vo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -18,12 +18,12 @@ public class WxCpLoginVo implements Serializable {
/**
* 用户名
*/
@ApiModelProperty("用户名")
@Schema(description = "用户名")
private String userName;
/**
* rsa密码
*/
@ApiModelProperty("rsa密码")
@Schema(description = "rsa密码")
private String rsaPassword;
}

View File

@ -1,14 +1,13 @@
package com.cpop.oam.business.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.cpop.common.utils.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* @author DB
@ -17,36 +16,35 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "OpenPlatformAuthorizerListVo拉取已授权的帐号信息")
@Schema(description = "OpenPlatformAuthorizerListVo拉取已授权的帐号信息")
public class WxOpenMiniVo implements Serializable {
/**
* 已授权帐号的 appid
*/
@JSONField(name = "authorizer_appid")
@ApiModelProperty("已授权帐号的 appid")
@Schema(description ="已授权帐号的 appid")
private String authorizerAppid;
/**
* 刷新令牌authorizer_refresh_token
*/
@JSONField(name = "refresh_token")
@ApiModelProperty("刷新令牌authorizer_refresh_token")
@Schema(description ="刷新令牌authorizer_refresh_token")
private String refreshToken;
/**
* 授权的时间
*/
@JSONField(name = "auth_time")
@ApiModelProperty("授权的时间")
@Schema(description ="授权的时间")
private String authTime;
public void setAuthTime(Integer authTime) {
Date date = new Date(authTime * 1000L);
this.authTime = DateUtils.format(date, "yyyy-MM-dd HH:mm:ss");
this.authTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}
/**
* 小程序名称
*/
@ApiModelProperty("小程序名称")
@Schema(description ="小程序名称")
private String nickName;
}

View File

@ -1,14 +1,13 @@
package com.cpop.oam.framework.config;
import com.cpop.system.framework.enums.InitRoleEnum;
import com.cpop.core.utils.SpringUtils;
import com.cpop.system.business.entity.Role;
import com.cpop.system.business.service.RoleService;
import com.cpop.system.framework.enums.InitRoleEnum;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* 初始化配置
* @author DB

View File

@ -2,6 +2,7 @@ package com.cpop.oam.framework.config.wxCp;
import com.cpop.oam.framework.handler.wxCp.*;
import com.google.common.collect.Maps;
import jakarta.annotation.PostConstruct;
import lombok.val;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.cp.api.WxCpService;
@ -13,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.stream.Collectors;

View File

@ -1,6 +1,6 @@
package com.cpop.oam.framework.config.wxCp;
import com.cpop.common.utils.JsonUtils;
import com.cpop.core.utils.JsonUtils;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

View File

@ -1,132 +0,0 @@
package com.cpop.oam.framework.config.wxMa;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import cn.binarywang.wx.miniapp.message.WxMaMessageHandler;
import cn.binarywang.wx.miniapp.message.WxMaMessageRouter;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.error.WxRuntimeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Slf4j
@Configuration
@EnableConfigurationProperties(WxMaProperties.class)
public class WxMaConfiguration {
private final WxMaProperties properties;
@Autowired
public WxMaConfiguration(WxMaProperties properties) {
this.properties = properties;
}
@Bean
public WxMaService wxMaService() {
List<WxMaProperties.Config> configs = this.properties.getConfigs();
if (configs == null) {
throw new WxRuntimeException("小程序相关信息配置错误");
}
WxMaService maService = new WxMaServiceImpl();
maService.setMultiConfigs(
configs.stream()
.map(a -> {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
//WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool());
// 使用上面的配置时需要同时引入jedis-lock的依赖否则会报类无法找到的异常
config.setAppid(a.getAppid());
config.setSecret(a.getSecret());
config.setToken(a.getToken());
config.setAesKey(a.getAesKey());
config.setMsgDataFormat(a.getMsgDataFormat());
return config;
}).collect(Collectors.toMap(WxMaDefaultConfigImpl::getAppid, a -> a, (o, n) -> o)));
return maService;
}
@Bean
public WxMaMessageRouter wxMaMessageRouter(WxMaService wxMaService) {
final WxMaMessageRouter router = new WxMaMessageRouter(wxMaService);
router
.rule().handler(logHandler).next()
.rule().async(false).content("订阅消息").handler(subscribeMsgHandler).end()
.rule().async(false).content("文本").handler(textHandler).end()
.rule().async(false).content("图片").handler(picHandler).end()
.rule().async(false).content("二维码").handler(qrcodeHandler).end();
return router;
}
private final WxMaMessageHandler subscribeMsgHandler = (wxMessage, context, service, sessionManager) -> {
service.getMsgService().sendSubscribeMsg(WxMaSubscribeMessage.builder()
.templateId("此处更换为自己的模板id")
.data(Lists.newArrayList(
new WxMaSubscribeMessage.MsgData("keyword1", "339208499")))
.toUser(wxMessage.getFromUser())
.build());
return null;
};
private final WxMaMessageHandler logHandler = (wxMessage, context, service, sessionManager) -> {
log.info("收到消息:" + wxMessage.toString());
service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("收到信息为:" + wxMessage.toJson())
.toUser(wxMessage.getFromUser()).build());
return null;
};
private final WxMaMessageHandler textHandler = (wxMessage, context, service, sessionManager) -> {
service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("回复文本消息")
.toUser(wxMessage.getFromUser()).build());
return null;
};
private final WxMaMessageHandler picHandler = (wxMessage, context, service, sessionManager) -> {
try {
WxMediaUploadResult uploadResult = service.getMediaService()
.uploadMedia("image", "png",
ClassLoader.getSystemResourceAsStream("tmp.png"));
service.getMsgService().sendKefuMsg(
WxMaKefuMessage
.newImageBuilder()
.mediaId(uploadResult.getMediaId())
.toUser(wxMessage.getFromUser())
.build());
} catch (WxErrorException e) {
e.printStackTrace();
}
return null;
};
private final WxMaMessageHandler qrcodeHandler = (wxMessage, context, service, sessionManager) -> {
try {
final File file = service.getQrcodeService().createQrcode("123", 430);
WxMediaUploadResult uploadResult = service.getMediaService().uploadMedia("image", file);
service.getMsgService().sendKefuMsg(
WxMaKefuMessage
.newImageBuilder()
.mediaId(uploadResult.getMediaId())
.toUser(wxMessage.getFromUser())
.build());
} catch (WxErrorException e) {
e.printStackTrace();
}
return null;
};
}

View File

@ -1,46 +0,0 @@
package com.cpop.oam.framework.config.wxMa;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import lombok.Data;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Data
@ConfigurationProperties(prefix = "wx.miniapp")
public class WxMaProperties {
private List<Config> configs;
@Data
public static class Config {
/**
* 设置微信小程序的appid
*/
private String appid;
/**
* 设置微信小程序的Secret
*/
private String secret;
/**
* 设置微信小程序消息服务器配置的token
*/
private String token;
/**
* 设置微信小程序消息服务器配置的EncodingAESKey
*/
private String aesKey;
/**
* 消息格式XML或者JSON
*/
private String msgDataFormat;
}
}

View File

@ -1,19 +1,16 @@
package com.cpop.oam.framework.config.wxOpen;
import lombok.Getter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author DB
* @createTime 2023/10/10 11:13
* @description
* @author <a href="https://github.com/007gzs">007</a>
*/
@Getter
@ConfigurationProperties(prefix = "wx.open")
public class WxOpenProperties {
private String openAppid;
public class WechatOpenProperties {
/**
* 设置微信三方平台的appid
*/
@ -35,58 +32,30 @@ public class WxOpenProperties {
private String componentAesKey;
/**
* 获取跳转页面URL
* 授权链接
*/
private String redirectUri;
private String authorizedLink;
public String getOpenAppid() {
return openAppid;
}
public void setOpenAppid(String openAppid) {
this.openAppid = openAppid;
}
public String getComponentAppId() {
return componentAppId;
public void setAuthorizedLink(String authorizedLink) {
this.authorizedLink = authorizedLink;
}
public void setComponentAppId(String componentAppId) {
this.componentAppId = componentAppId;
}
public String getComponentSecret() {
return componentSecret;
}
public void setComponentSecret(String componentSecret) {
this.componentSecret = componentSecret;
}
public String getComponentToken() {
return componentToken;
}
public void setComponentToken(String componentToken) {
this.componentToken = componentToken;
}
public String getComponentAesKey() {
return componentAesKey;
}
public void setComponentAesKey(String componentAesKey) {
this.componentAesKey = componentAesKey;
}
public String getRedirectUri() {
return redirectUri;
}
public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this,

View File

@ -0,0 +1,67 @@
package com.cpop.oam.framework.config.wxOpen;
import com.cpop.core.utils.StringUtils;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* 微信开放平台统一配置文件
* @author DB
* @version 1.0.0
* @since 2024-03-26 18:14
*/
@Data
@Configuration
@ConfigurationProperties(prefix = "wx.open.redis")
public class WxOpenRedisProperties {
/**
* 地址
*/
private String host;
/**
* 端口
*/
private Integer port;
/**
* 密码
*/
private String password;
/**
* 数据库
*/
private Integer database;
@Autowired
private RedisProperties redisProperties;
@Bean(name = "wxOpenRedisConnectionFactory")
public RedisConnectionFactory wxOpenRedisConnectionFactory() {
RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(host, port);
configuration.setDatabase(database);
if (StringUtils.isNotBlank(password)) {
configuration.setPassword(password);
}
return new JedisConnectionFactory(configuration);
}
@Bean(name = "wxOpenRedisTemplate")
public StringRedisTemplate wxOpenRedisTemplate(@Qualifier("wxOpenRedisConnectionFactory") RedisConnectionFactory redisConnectionFactory) {
StringRedisTemplate redisTemplate = new StringRedisTemplate();
redisTemplate.setConnectionFactory(redisConnectionFactory);
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new StringRedisSerializer());
return redisTemplate;
}
}

View File

@ -1,6 +1,6 @@
package com.cpop.oam.framework.enums;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.utils.StringUtils;
/**
* 系统配置枚举

View File

@ -1,6 +1,6 @@
package com.cpop.oam.framework.handler.wxCp;
import com.cpop.common.utils.JsonUtils;
import com.cpop.core.utils.JsonUtils;
import com.cpop.oam.business.service.StaffService;
import com.cpop.oam.framework.builder.wxCp.TextBuilder;
import com.cpop.oam.framework.constant.WxCpConstant;

View File

@ -1,6 +1,6 @@
package com.cpop.oam.framework.handler.wxCp;
import com.cpop.common.utils.JsonUtils;
import com.cpop.core.utils.JsonUtils;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;

View File

@ -1,6 +1,6 @@
package com.cpop.oam.framework.handler.wxCp;
import com.cpop.common.utils.JsonUtils;
import com.cpop.core.utils.JsonUtils;
import com.cpop.oam.framework.builder.wxCp.TextBuilder;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.session.WxSessionManager;

View File

@ -1,6 +1,7 @@
package com.cpop.oam.framework.handler.wxOpen;
import com.cpop.oam.framework.config.wxOpen.WxOpenProperties;
import com.cpop.oam.framework.config.wxOpen.WechatOpenProperties;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import me.chanjar.weixin.open.api.impl.WxOpenInRedisTemplateConfigStorage;
import me.chanjar.weixin.open.api.impl.WxOpenMessageRouter;
@ -12,21 +13,19 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* @author DB
* @createTime 2023/10/27 9:30
* @description
*/
@Service
@EnableConfigurationProperties({WxOpenProperties.class})
@EnableConfigurationProperties({WechatOpenProperties.class})
public class WxOpenService extends WxOpenServiceImpl {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private WxOpenProperties wxOpenProperties;
private WechatOpenProperties wxOpenProperties;
@Getter
private WxOpenMessageRouter wxOpenMessageRouter;

View File

@ -1,20 +1,8 @@
package com.cpop.oam.framework.strategy.cloud;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.bo.CloudUnionCallbackBo;
import com.cpop.system.business.entity.Brand;
import com.cpop.system.business.entity.Store;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.mybatisflex.core.row.Db;
import com.mybatisflex.core.row.DbChain;
import com.mybatisflex.core.row.Row;
import com.mybatisflex.core.row.RowKey;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
*
* @author DB
@ -32,7 +20,8 @@ public class CloudSyncBrandOrStoreCallbackStrategy implements CloudCallbackStrat
*/
@Override
public void callback(CloudUnionCallbackBo callback) {
SyncBrandAndStoreBo.BrandInfo brandInfo = callback.getSyncBrandAndStore().getBrandInfo();
//TODO回调策略
/*SyncBrandAndStoreBo.BrandInfo brandInfo = callback.getSyncBrandAndStore().getBrandInfo();
//查询品牌
Row brandExtend = DbChain.table("cp_j_brand_extend").where("brand_cloud_id = ?", brandInfo.getBrandCloudId()).one();
Brand brand;
@ -73,6 +62,6 @@ public class CloudSyncBrandOrStoreCallbackStrategy implements CloudCallbackStrat
//营业执照
StoreLicense storeLicense = BeanUtils.mapToClass(storeInfo, StoreLicense.class);
storeLicense.setStoreId(store.getId());
SpringUtils.getBean(StoreLicenseService.class).save(storeLicense);
SpringUtils.getBean(StoreLicenseService.class).save(storeLicense);*/
}
}

View File

@ -1,16 +1,13 @@
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;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysConfig;
import com.cpop.core.base.table.Config;
import com.cpop.core.service.ConfigService;
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.core.utils.StringUtils;
import com.cpop.core.utils.bean.BeanUtils;
import com.cpop.oam.business.entity.Clue;
import com.cpop.oam.business.entity.ClueRecord;
import com.cpop.oam.business.entity.DataImport;
@ -35,7 +32,6 @@ 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;
@ -115,7 +111,7 @@ public class OamScheduledTasks {
public void checkClue() {
log.info("==============开始检查线索数据===========");
RedisService redisService = SpringUtils.getBean(RedisService.class);
CoreService coreService = SpringUtils.getBean(CoreService.class);
ConfigService configService = SpringUtils.getBean(ConfigService.class);
CommonService commonService = SpringUtils.getBean(CommonService.class);
Map<String, String> configMap = new HashMap<>(8);
Arrays.asList(OamConfigKey.SIGN_GOAL).forEach(item -> {
@ -126,7 +122,7 @@ public class OamScheduledTasks {
configMap.put(sysConfigEnum.getField(), cacheInfo);
} else {
// 查询系统
SysConfig sysConfig = coreService.selectConfigByKey(item);
Config sysConfig = configService.getById(item);
if (null != sysConfig) {
// 获取枚举
OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item);
@ -268,7 +264,8 @@ public class OamScheduledTasks {
* @author DB
* @since 2024/4/12
*/
@Scheduled(cron = "0 40 1 * * *")
//TODO每天晚上1点40或前天校区活跃数
/*@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")));
@ -280,5 +277,5 @@ public class OamScheduledTasks {
SpringUtils.getBean(StoreActiveService.class).saveBatch(storeActives);
}
}
}*/
}

View File

@ -1,23 +1,18 @@
package com.cpop.oam.framework.tasks;
import com.cpop.common.utils.http.HttpHelper;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.entity.TaskWorkOrder;
import com.cpop.oam.business.service.TaskStaffGroupService;
import com.cpop.oam.business.service.TaskWorkOrderService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP;
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
import com.cpop.oam.business.service.TaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author DB

View File

@ -1,20 +1,29 @@
wx:
#微信支付
pay:
#微信公众号或者小程序等的appid
app-id: wx20853d18c455e874
#微信支付商户号
mch-id: 1618884922
#微信支付商户密钥
mch-key: JamBox20230919174000000000000002
api-v3-key: JamBox20230919174000000000000002
#服务id
service-id: 00003053000000169450961228104460
#分账服务商账号
sharing-account: 1618884922
sharing-account-name: 果酱盒子
#服务商appid
backstage-app-id: wx1eb0e5fb7dac3c05
# 后台普通支付商户号
backstage-mch-id: 1618436087
# 后台商户密钥
backstage-mch-key: JamBox20220329174000000000000002
# 后台证书路径
backstage-key-path: https://6265-beibeike-qy-b33k4-1302318474.tcb.qcloud.la/apiclient_cert.p12?sign=151cbcc241ad40403ad7b4731127554a&t=1661146932
# 服务商appid
service-app-id: wx1eb0e5fb7dac3c05
# 服务商商户号
service-mch-id: 1618884922
# 支付密钥文件地址
service-private-key-path: https://dataresource-1302318474.cos.accelerate.myqcloud.com/b7742a56babb4e08805da3eaac46aaf5.pem
# 支付密钥文件地址
service-private-cert-path: https://dataresource-1302318474.cos.accelerate.myqcloud.com/1a40dd000db44a9fb98f25fefaf4e519.pem
# 服务商apiV3密钥
service-api-v3-key: JamBox20230919174000000000000002
# 服务id
service-id: 00003053000000169450961228104460
# 分账服务商账号
sharing-account: 1618884922
# 分账账号名
sharing-account-name: 果酱盒子
logging:
level:
com.github.binarywang.wxpay: debug

View File

@ -0,0 +1,121 @@
package com.cpop.system.framework.config;
import cn.dev33.satoken.exception.SaTokenException;
import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.stp.StpLogic;
import cn.dev33.satoken.stp.StpUtil;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.constant.Constants;
import com.cpop.core.constant.HttpStatus;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Collections;
/**
* @author DB
* @Description: Security配置中心
* @since 2023-08-05 8:01
*/
@Configuration
@RequiredArgsConstructor
public class SaTokenConfigure implements WebMvcConfigurer {
/**
* 路径白名单
*/
@Value("${cpop.jwt.white-list}")
private String whiteList;
/**
* 上传路径url
*/
@Value("${cpop.profile}")
private String profile;
/**
* 注册 Sa-Token 拦截器打开注解式鉴权功能
*
* @param registry 拦截器注册
* @author DB
* @since 2024/3/20
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 注册 Sa-Token 拦截器打开注解式鉴权功能
registry.addInterceptor(new SaInterceptor(handle -> {
SaRouter.match("/**")
//基础接口不做处理
.notMatch("/backstage/getUserInfo", "/backstage/getPermCode", "/backstage/getMenuList","/backstage/index/getExtendList","/backstage/logout","/backstage/index/changeDistrict/*","/backstage/index/changeBackstageSystem")
.check(r -> {
StpUtil.checkLogin();
//检查登录账号是否过期
if (StpUtil.getSession().get("userType") == UserType.OAM_USER) {
LocalDate expireDate = (LocalDate) StpUtil.getSession().get("expireDate");
if (LocalDate.now().isAfter(expireDate)) {
throw new SaTokenException(HttpStatus.STORE_EXPIRE, "校区已过期");
}
}
});
SaRouter.match("/backstage/getUserInfo", "/backstage/getPermCode", "/backstage/getMenuList","/backstage/index/getExtendList","/backstage/logout","/backstage/index/changeDistrict/*","/backstage/index/changeBackstageSystem")
.check(r -> {
StpUtil.checkLogin();
});
}))
.addPathPatterns("/**")
.excludePathPatterns(Arrays.asList(whiteList.split(",")));
}
/**
* Sa-Token 整合 jwt (Simple 简单模式)
* @author DB
* @since 2024/3/20
* @return StpLogic
*/
@Bean
public StpLogic getStpLogicJwt() {
return new StpLogicJwtForSimple();
}
/**
* 配置跨源访问(CORS)
*/
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Collections.singletonList("*"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type"));
configuration.applyPermitDefaultValues();
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}
/**
* 资源映射
*
* @param registry 注册
* @author DB
* @since 2023/5/27 13:57
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//本地文件上传路径
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
.addResourceLocations("file:" + profile + "/");
}
}

View File

@ -203,12 +203,6 @@
<artifactId>weixin-java-cp</artifactId>
<version>${wxJava.version}</version>
</dependency>
<!--微信小程序-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
<version>${wxJava.version}</version>
</dependency>
</dependencies>
</dependencyManagement>