Commit 601e8d93 authored by liwei's avatar liwei

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	sql/cust.sql
parents 1373652f b005cf50
......@@ -102,7 +102,7 @@ cy:
- "/common/getKSA"
- "/office/getFile"
- "/office/callback"
- "/**/**"
- "/app/open/**"
permitStatic: [ "/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.js", "/**/*.css","/swagger-ui/*" ]
logoutSuccessUrl: "/login"
loginPage: "/login"
......@@ -181,23 +181,17 @@ global:
code:
admin: ROLE_1001
resetPassword: 123456
oss:
request: "https://"
endpoint: "oss-cn-beijing.aliyuncs.com"
putAcessKey:
putSecretKey:
logging:
config: ./config/logback-spring.xml
level:
root: info
com.alibaba.nacos: info
path: D:\working\test
oss:
request: "https://"
endpoint: "oss-cn-beijing.aliyuncs.com"
bucket: "catarc-res"
regionId: "cn-beijing"
put:
acess_key: ENC(tbI3V/L3rXALTOW7DZByISDc68laCea8fsTyvgYbobWMsQ0TGkedn01SeAT1uXlQjr8EgqrM06Po6CRH0OCFBA==)
secret_key: ENC(nF9aH+p4P+ZQPal7mMh3aDgNJP1hwzwDrv+GGyjZUPRkt9gLsXGCOQ9Q77kIMDY/5WttzyqNQdX+bR6TACpBmw==)
ram: "acs:ram::1372579886118191:role/catarc-put-role"
read:
acess_key: ENC(WubSHSvpRIFL9U3T+ZIG+Kmo7ts4VKyROdA9idt5C8bqogJpYCQNz7sREwHCZ40EhvKMihcf8VYhwVR85HVSLg==)
secret_key: ENC(dvdFA7j1A2D6l9+2CUpYR0c3Us76nXyu/crr6s2mo7EDmKnCadWn9UFkYC9YYl9dUycFZsm+Wn0El4Kkau5+Xg==)
read_time: 1800000 #读取超时时间
......@@ -166,8 +166,16 @@ global:
code:
admin: ROLE_1001
resetPassword: 123456
oss:
request: "https://"
endpoint: "oss-cn-beijing.aliyuncs.com"
putAcessKey:
putSecretKey:
logging:
config: /data/config/logback-spring.xml
level:
root: info
com.alibaba.nacos: info
path: \working\test
......@@ -166,8 +166,16 @@ global:
code:
admin: ROLE_1001
resetPassword: 123456
oss:
request: "https://"
endpoint: "oss-cn-beijing.aliyuncs.com"
putAcessKey:
putSecretKey:
logging:
config: /data/config/logback-spring.xml
level:
root: info
com.alibaba.nacos: info
path: \working\test
......@@ -47,7 +47,7 @@ cy:
decryptParam: false
decryptKey: cyKey
# sm4
decryptSm4Param: false
decryptSm4Param: true
decryptSm4Secret: 'FFFAAA333777EEEB'
# 文件存储
fileStorage:
......@@ -69,8 +69,8 @@ cy:
code:
enable: true
author: cy
dbType: sqlserver
database: rcisoft
dbType: mysql
database: cy
basePackage: org.rcisoft.sys
rejectRepeatSubmit:
enable: false
......
......@@ -165,7 +165,15 @@ global:
code:
admin: ROLE_1001
resetPassword: 123456
oss:
request: "https://"
endpoint: "oss-cn-beijing.aliyuncs.com"
putAcessKey:
putSecretKey:
logging:
config: /data/config/logback-spring.xml
level:
root: info
com.alibaba.nacos: info
path: \working\test
......@@ -2,6 +2,7 @@
<configuration>
<springProperty scope="context" name="LOG_PATH" source="logging.path"/>
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
......@@ -31,7 +32,7 @@
<!--滚动策略-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--路径-->
<fileNamePattern>/working/test/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- <fileNamePattern>/Users/lyl/Downloads/tea_resource/info.%d{yyyy-MM-dd}.log</fileNamePattern>-->
</rollingPolicy>
</appender>
......@@ -53,7 +54,7 @@
<!--滚动策略-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--路径-->
<fileNamePattern>/working/test/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- <fileNamePattern>/Users/lyl/Downloads/tea_resource/error.%d{yyyy-MM-dd}.log</fileNamePattern>-->
</rollingPolicy>
</appender>
......
......@@ -47,8 +47,7 @@
<dependency>
<groupId>org.91isoft</groupId>
<artifactId>91isoft_spbt</artifactId>
<version>3.3.0_core_alpha1</version>
<scope>compile</scope>
<version>3.3.0_core_alpha2</version>
<!-- <version>3.0.0_nlt.25</version>-->
<!-- 排除oracle12的驱动,此处代码不能提交,测试使用的是12,生产为11 -->
</dependency>
......
package org.rcisoft.app.appMemInfo.controller;
/*固定导入*/
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.servlet.http.HttpServletResponse;
import org.rcisoft.business.memInfo.entity.MemInfo;
import org.rcisoft.business.memInfo.service.MemInfoService;
import org.rcisoft.core.anno.CyEncryptSm4Anno;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.core.util.CyResultGenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* Created by cy on 2024年12月20日 下午3:35:34.
*/
@RestController
@RequestMapping("/app")
public class AppMemInfoController extends CyPaginationController<MemInfo> {
@Autowired
private MemInfoService memInfoServiceImpl;
// @PreAuthorize("@cyPerm.hasPerm('mem:info:add')")
@CyOpeLogAnno(title = "system-会员表管理-新增会员表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary="添加会员表", description="添加会员表")
@PostMapping(value = "/open/memInfo/add")
@CyEncryptSm4Anno
public CyResult add( MemInfo memInfo) {
CyPersistModel data = memInfoServiceImpl.persist(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfo);
}
@CyOpeLogAnno(title = "system-会员表管理-校验手机号", businessType = CyLogTypeEnum.OTHER)
@Operation(summary="校验手机号", description="校验手机号")
@PostMapping(value = "/open/memInfo/checkInfo")
@CyEncryptSm4Anno
public CyResult checkInfo(@Valid MemInfo memInfo) {
return CyResultGenUtil.genSuccessResult(memInfoServiceImpl.checkInfo(memInfo));
}
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="查询单一会员表", description="查询单一会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@GetMapping("/open/memInfo/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfoServiceImpl.findById(businessId));
}
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="分页查询会员表集合", description="分页查询会员表集合")
@GetMapping(value = "/open/memInfo/list")
@CyEncryptSm4Anno
public CyGridModel listByPagination(MemInfo memInfo) {
memInfoServiceImpl.findAllByPagination(getPaginationUtility(), memInfo);
return getGridModelResponse();
}
}
......@@ -22,83 +22,133 @@ import java.util.Date;
public class CmsActivity extends CyIdIncreEntity<CmsActivity> {
/**
* @desc 标题
* @column title
* @desc 创建人
* @column create_by
* @default
*/
@Excel(name = "标题")
private String title;
@Excel(name = "创建人")
@TableField("create_by")
private String createBy;
/**
* @desc 摘要
* @column summary
* @desc 创建时间
* @column create_date
* @default
*/
@Excel(name = "摘要")
private String summary;
@Excel(name = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("create_date")
private Date createDate;
/**
* @desc 封面
* @column picture_id
* @desc 更新人
* @column update_by
* @default
*/
@Excel(name = "封面")
private String pictureId;
@Excel(name = "更新人")
@TableField("update_by")
private String updateBy;
/**
* @desc 是否置顶
* @column is_top
* @desc 更新时间
* @column update_date
* @default
*/
@Excel(name = "是否置顶")
private Integer isTop;
@Excel(name = "更新时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("update_date")
private Date updateDate;
/**
* @desc 启动状态(0禁用、1启动)
* @column flag
* @default
*/
@Excel(name = "启动状态(0禁用、1启动)")
@TableField("flag")
private String flag;
/**
* @desc 是否推荐
* @column is_recommended
* @desc 删除标志(0删除,1已删除)
* @column del_flag
* @default
*/
@Excel(name = "是否推荐")
private Integer isRecommended;
@Excel(name = "删除标志(0删除,1已删除)")
@TableField("del_flag")
private String delFlag;
/**
* @desc 备注
* @column remarks
* @default
*/
@JsonIgnore
@Excel(name = "备注")
@TableField("remarks")
private String remarks;
/**
* @desc 活动标题
* @column title
* @default
*/
@Excel(name = "活动标题")
private String title;
/**
* @desc 报名人数
* @column participant_count
* @desc 内容
* @column details
* @default
*/
@Excel(name = "报名人数")
private String participantCount;
@Excel(name = "内容", orderNum = "11", width = 20)
private String details;
/**
* @desc 是否需要报名
* @column is_registration
* @desc 权重(排序)
* @column weight
* @default
*/
@Excel(name = "是否需要报名")
private Integer isRegistration;
@Excel(name = "权重(排序)")
private Integer weight;
/**
* @desc 是否需要实名认证
* @column is_authentication
* @desc 封面
* @column picture_id
* @default
*/
@Excel(name = "是否需要实名认证")
private Integer isAuthentication;
@Excel(name = "封面")
private Integer pictureId;
/**
* @desc 报名所需费用
* @column registration_fee
* @desc 男生数量
* @column male_count
* @default
*/
@Excel(name = "报名所需费用")
private BigDecimal registrationFee;
@Excel(name = "男生数量")
private Integer maleCount;
/**
* @desc 排序
* @column weight
* @desc 女生数量
* @column female_count
* @default
*/
@Excel(name = "排序")
private Integer weight;
@Excel(name = "女生数量")
private Integer femaleCount;
/**
* @desc 报名人数
* @column application_count
* @default
*/
@Excel(name = "报名人数")
private String applicationCount;
/**
* @desc 报名所需费用
* @column application_fee
* @default
*/
@Excel(name = "报名所需费用")
private BigDecimal applicationFee;
/**
* @desc 发布日期
......@@ -110,43 +160,77 @@ public class CmsActivity extends CyIdIncreEntity<CmsActivity> {
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date publishDate;
/**
* @desc 发布状态(1启用、0禁用)
* @column publish_status
* @default
*/
@Excel(name = "发布状态(1启用、0禁用)", orderNum = "11", width = 20)
private String publishStatus;
/**
* @desc 内容
* @column details
* @desc 是否置顶
* @column is_top
* @default
*/
@Excel(name = "内容", orderNum = "11", width = 20)
private String details;
@Excel(name = "是否置顶")
private Integer isTop;
/**
* @desc 发布状态(1启用、0禁用)
* @column publish_status
* @desc 是否推荐
* @column is_recommended
* @default
*/
@Excel(name = "发布状态(1启用、0禁用)", orderNum = "11", width = 20)
private String publishStatus;
@Excel(name = "是否推荐")
private Integer isRecommended;
/**
* @desc 备注
* @column remarks
* @desc 是否需要报名
* @column is_application
* @default
*/
@Excel(name = "备注", orderNum = "11", width = 20)
private String remarks;
@Excel(name = "是否需要报名")
private Integer isApplication;
/**
* @desc 是否需要实名认证
* @column is_authentication
* @default
*/
@Excel(name = "是否需要实名认证")
private Integer isAuthentication;
/**
* 开始时间
* start_time
*/
@JsonIgnore
@TableField(exist = false)
private String beginTime;
private Date startTime;
/**
* 结束时间
* end_time
*/
@JsonIgnore
@TableField(exist = false)
private String endTime;
private Date endTime;
/*
*//**
* 开始时间
*//*
@JsonIgnore
@TableField(exist = false)
private String beginTime;
*//**
* 结束时间
*//*
@JsonIgnore
@TableField(exist = false)
private String endTime;*/
@TableField(exist = false)
private String nickName;
......
......@@ -44,9 +44,9 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
//增加操作
cmsActivity.setDelFlag("0");
//当图片字段没有时增加默认1
if (ObjectUtil.isNull(cmsActivity.getPictureId())) {
/* if (ObjectUtil.isNull(cmsActivity.getPictureId())) {
cmsActivity.setPictureId(global.getDEFAULT_NEWS_LOCATION());
}
}*/
CmsActivity check = baseMapper.checkWeight(cmsActivity.getWeight());
if (ObjectUtil.isNotNull(check)) {
throw new CyServiceException(500, "权重已存在");
......
......@@ -16,7 +16,7 @@ import java.util.Date;
/**
* Created with cy on 2024年3月25日 下午1:42:40.
*
* @author llp
* @author
*/
@Data
@TableName("cms_application")
......
......@@ -17,11 +17,11 @@ public class CmsBanner extends CyIdIncreEntity<CmsBanner> {
/**
* @desc 图片
* @column banner_picture
* @column picture_id
* @default
*/
@Excel(name = "图片", orderNum = "0", width = 20)
private String bannerPicture;
private Integer pictureId;
/**
* @desc banner名字
......
......@@ -15,12 +15,78 @@ import java.util.Date;
/**
* Created with cy on 2024年3月25日 下午1:42:40.
*
* @author wangFeilong
* @author
*/
@Data
@TableName("cms_notice")
public class CmsNotice extends CyIdIncreEntity<CmsNotice> {
/**
* @desc 创建人
* @column create_by
* @default
*/
@Excel(name = "创建人")
@TableField("create_by")
private String createBy;
/**
* @desc 创建时间
* @column create_date
* @default
*/
@Excel(name = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("create_date")
private Date createDate;
/**
* @desc 更新人
* @column update_by
* @default
*/
@Excel(name = "更新人")
@TableField("update_by")
private String updateBy;
/**
* @desc 更新时间
* @column update_date
* @default
*/
@Excel(name = "更新时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("update_date")
private Date updateDate;
/**
* @desc 备注
* @column remarks
* @default
*/
@JsonIgnore
@Excel(name = "备注")
@TableField("remarks")
private String remarks;
/**
* @desc 启动状态(0禁用、1启动)
* @column flag
* @default
*/
@Excel(name = "启动状态(0禁用、1启动)")
@TableField("flag")
private String flag;
/**
* @desc 删除标志(0删除,1已删除)
* @column del_flag
* @default
*/
@Excel(name = "删除标志(0删除,1已删除)")
@TableField("del_flag")
private String delFlag;
/**
* @desc 标题
......@@ -30,20 +96,13 @@ public class CmsNotice extends CyIdIncreEntity<CmsNotice> {
@Excel(name = "标题")
private String title;
/**
* @desc 摘要
* @column summary
* @default
*/
@Excel(name = "摘要")
private String summary;
/**
* @desc 封面
* @column picture_id
* @default
*/
@Excel(name = "封面")
private String pictureId;
private Integer pictureId;
/**
* @desc 是否置顶
......@@ -85,7 +144,7 @@ public class CmsNotice extends CyIdIncreEntity<CmsNotice> {
* @column details
* @default
*/
@Excel(name = "内容", orderNum = "11", width = 20)
@Excel(name = "内容")
private String details;
......
......@@ -44,9 +44,9 @@ public class CmsNoticeServiceImpl extends ServiceImpl<CmsNoticeRepository, CmsNo
//增加操作
cmsNotice.setDelFlag("0");
//当图片字段没有时增加默认1
if (ObjectUtil.isNull(cmsNotice.getPictureId())) {
/* if (ObjectUtil.isNull(cmsNotice.getPictureId())) {
cmsNotice.setPictureId(global.getDEFAULT_NEWS_LOCATION());
}
}*/
CmsNotice check = baseMapper.checkWeight(cmsNotice.getWeight());
if (ObjectUtil.isNotNull(check)) {
throw new CyServiceException(500, "权重已存在");
......
package org.rcisoft.business.memInfo.controller;
/*固定导入*/
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import org.rcisoft.core.anno.CyEncryptSm4Anno;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException;
import jakarta.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.rcisoft.business.memInfo.entity.MemInfo;
import org.rcisoft.business.memInfo.service.MemInfoService;
import java.util.List;
/**
* Created by cy on 2024年12月20日 下午3:35:34.
*/
@RestController
@RequestMapping("/memInfo")
public class MemInfoController extends CyPaginationController<MemInfo> {
@Autowired
private MemInfoService memInfoServiceImpl;
@PreAuthorize("@cyPerm.hasPerm('mem:info:add')")
@CyOpeLogAnno(title = "system-会员表管理-新增会员表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary="添加会员表", description="添加会员表")
@PostMapping(value = "/add")
@CyEncryptSm4Anno
public CyResult add(@Valid MemInfo memInfo, BindingResult bindingResult) {
CyPersistModel data = memInfoServiceImpl.persist(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfo);
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:delete')")
@CyOpeLogAnno(title = "system-会员表管理-删除会员表", businessType = CyLogTypeEnum.DELETE)
@Operation(summary="逻辑删除会员表", description="逻辑删除会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@DeleteMapping("/deleteLogical/{businessId:\\w+}")
public CyResult deleteLogical(@PathVariable int businessId,MemInfo memInfo) {
memInfo.setBusinessId(businessId);
CyPersistModel data = memInfoServiceImpl.removeLogical(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:delete')")
@CyOpeLogAnno(title = "system-会员表管理-删除会员表", businessType = CyLogTypeEnum.DELETE)
@Operation(summary="删除会员表", description="删除会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId,MemInfo memInfo) {
memInfo.setBusinessId(businessId);
CyPersistModel data = memInfoServiceImpl.remove(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:update')")
@CyOpeLogAnno(title = "system-会员表管理-修改会员表", businessType = CyLogTypeEnum.UPDATE)
@Operation(summary="修改会员表", description="修改会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = false, schema = @Schema(type = "string"))})
@PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable int businessId, @Valid MemInfo memInfo, BindingResult bindingResult) {
memInfo.setBusinessId(businessId);
CyPersistModel data = memInfoServiceImpl.merge(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfo);
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:query')")
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="查询单一会员表", description="查询单一会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfoServiceImpl.findById(businessId));
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:list')")
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="查询会员表集合", description="查询会员表集合")
@GetMapping(value = "/listAll")
public CyResult listAll(MemInfo memInfo) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfoServiceImpl.findAll(memInfo));
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:list')")
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="分页查询会员表集合", description="分页查询会员表集合")
@GetMapping(value = "/list")
public CyGridModel listByPagination(MemInfo memInfo) {
memInfoServiceImpl.findAllByPagination(getPaginationUtility(), memInfo);
return getGridModelResponse();
}
@PreAuthorize("@cyPerm.hasPerm('mem:info:export')")
@CyOpeLogAnno(title = "system-会员表管理-查询会员表", businessType = CyLogTypeEnum.EXPORT)
@Operation(summary = "导出会员表信息", description = "导出会员表信息")
@GetMapping(value = "/export")
public void outMemInfo(HttpServletResponse response,MemInfo memInfo,@PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName="";
switch(excelId){
case "0": excelName="会员表信息.xls";break;
case "1": excelName="会员表信息.xlsx";break;
case "2": excelName="会员表信息.csv";break;
}
List<MemInfo> memInfoList = memInfoServiceImpl.export(memInfo);
CyEpExcelUtil.exportExcel(memInfoList, "会员表信息", "会员表信息", MemInfo.class, excelName, response);
}
@CyOpeLogAnno(title = "system-会员表管理-校验手机号", businessType = CyLogTypeEnum.INSERT)
@Operation(summary="校验手机号", description="校验手机号")
@PostMapping(value = "/checkInfo")
@CyEncryptSm4Anno
public CyResult checkInfo(@Valid MemInfo memInfo) {
return CyResultGenUtil.genSuccessResult(memInfoServiceImpl.checkInfo(memInfo));
}
}
package org.rcisoft.business.memInfo.dao;
import org.rcisoft.core.mapper.CyBaseMapper;
import org.rcisoft.business.memInfo.entity.MemInfo;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.sys.rbac.user.dto.SysUserRbacDTO;
import org.springframework.stereotype.Repository;
import org.rcisoft.core.model.CyPageInfo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* Created with cy on 2024年12月20日 下午3:35:34.
*/
public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
List<MemInfo> queryMemInfos(@Param("entity") MemInfo memInfo);
/**
* 分页查询 memInfo
*
*/
IPage<MemInfo> queryMemInfosPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
/**
* 根据roleKey查询角色
* @param roleKey
* @return
*/
List<Integer> selectRoleByKey(@Param("roleKey")String roleKey);
//校验手机号是否重复
SysUserRbacDTO checkPhoneRepeat(@Param("userId")Integer userId, @Param("phone")String phone);
//校验身份证是否重复
SysUserRbacDTO checkIdcardRepeat(@Param("userId")Integer userId, @Param("Idcard")String Idcard);
/**
* 查询详情
* @param id
* @return
*/
MemInfo selectDetailById(@Param("businessId")int businessId);
}
package org.rcisoft.business.memInfo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* Created with cy on 2024年12月20日 下午3:35:34.
*/
@Data
@TableName("mem_info")
public class MemInfo extends CyIdIncreEntity<MemInfo> {
/**
* @desc 用户id
* @column user_id
* @default
*/
@Excel(name = "用户id", orderNum = "0", width = 20)
private Integer userId;
/**
* @desc 会员号
* @column mem_code
* @default
*/
@Excel(name = "会员号", orderNum = "1", width = 20)
private String memCode;
/**
* @desc 用户性别(0男 1女 2未知)
* @column mem_sex
* @default
*/
@Excel(name = "用户性别(0男 1女 2未知)", orderNum = "2", width = 20)
private String memSex;
/**
* @desc 生日,格式:xxxx-01-01
* @column mem_birthday
* @default
*/
@Excel(name = "生日,格式:xxxx-01-01", orderNum = "3", width = 20)
private String memBirthday;
/**
* @desc 星座,1-12 水瓶-摩羯 ,根据birthday,自动带入
* @column mem_constellation
* @default
*/
@Excel(name = "星座,1-12 水瓶-摩羯 ,根据birthday,自动带入", orderNum = "4", width = 20)
private String memConstellation;
/**
* @desc 身高
* @column mem_height
* @default
*/
@Excel(name = "身高", orderNum = "5", width = 20)
private BigDecimal memHeight;
/**
* @desc 体重 kg
* @column mem_weight
* @default
*/
@Excel(name = "体重 kg", orderNum = "6", width = 20)
private BigDecimal memWeight;
/**
* @desc 大专以下 1,大专 2,本科 3,硕士,4,博士 5,博士后 6,其他 0
* @column mem_max_education
* @default
*/
@Excel(name = "大专以下 1,大专 2,本科 3,硕士,4,博士 5,博士后 6,其他 0", orderNum = "7", width = 20)
private String memMaxEducation;
/**
* @desc 毕业院校
* @column mem_college
* @default
*/
@Excel(name = "毕业院校", orderNum = "8", width = 20)
private String memCollege;
/**
* @desc 职业
* @column mem_career
* @default
*/
@Excel(name = "职业", orderNum = "9", width = 20)
private String memCareer;
/**
* @desc 年收入,单位 k
* @column mem_year_income
* @default
*/
@Excel(name = "年收入,单位 k", orderNum = "10", width = 20)
private BigDecimal memYearIncome;
/**
* @desc 工作单位
* @column mem_work_place
* @default
*/
@Excel(name = "工作单位", orderNum = "11", width = 20)
private String memWorkPlace;
/**
* @desc 居住地省份
* @column mem_residence_province
* @default
*/
@Excel(name = "居住地省份", orderNum = "12", width = 20)
private String memResidenceProvince;
/**
* @desc 居住地市
* @column mem_residence_city
* @default
*/
@Excel(name = "居住地市", orderNum = "13", width = 20)
private String memResidenceCity;
/**
* @desc 籍贯省份
* @column mem_native_province
* @default
*/
@Excel(name = "籍贯省份", orderNum = "14", width = 20)
private String memNativeProvince;
/**
* @desc 籍贯市
* @column mem_native_city
* @default
*/
@Excel(name = "籍贯市", orderNum = "15", width = 20)
private String memNativeCity;
/**
* @desc 自我介绍
* @column mem_introduce
* @default
*/
@Excel(name = "自我介绍", orderNum = "16", width = 20)
private String memIntroduce;
/**
* @desc 兴趣爱好
* @column mem_hobby
* @default
*/
@Excel(name = "兴趣爱好", orderNum = "17", width = 20)
private String memHobby;
/**
* @desc 未来规划
* @column mem_future_plan
* @default
*/
@Excel(name = "未来规划", orderNum = "18", width = 20)
private String memFuturePlan;
/**
* @desc 期待
* @column mem_half_desire
* @default
*/
@Excel(name = "期待", orderNum = "19", width = 20)
private String memHalfDesire;
/**
* @desc 婚姻状况:0 其他 ,1 未婚,2 已婚,3 离异
* @column mem_marriage
* @default
*/
@Excel(name = "婚姻状况:0 其他 ,1 未婚,2 已婚,3 离异", orderNum = "20", width = 20)
private String memMarriage;
/**
* @desc 婚姻状况备注
* @column mem_marriage_remarks
* @default
*/
@Excel(name = "婚姻状况备注", orderNum = "21", width = 20)
private String memMarriageRemarks;
/**
* @desc 16型人格
* @column mem_mbti
* @default
*/
@Excel(name = "16型人格", orderNum = "22", width = 20)
private String memMbti;
/**
* @desc wx 号
* @column mem_wx_code
* @default
*/
@Excel(name = "wx 号", orderNum = "23", width = 20)
private String memWxCode;
/**
* @desc 真实姓名
* @column mem_real_name
* @default
*/
@Excel(name = "真实姓名", orderNum = "24", width = 20)
private String memRealName;
/**
* @desc 电话
* @column mem_phone
* @default
*/
@Excel(name = "电话", orderNum = "25", width = 20)
private String memPhone;
/**
* @desc 证件号
* @column mem_idcard
* @default
*/
@Excel(name = "证件号", orderNum = "26", width = 20)
private String memIdcard;
/**
* @desc 1 已实名,0 未实名
* @column mem_real_authen
* @default
*/
@Excel(name = "1 已实名,0 未实名", orderNum = "27", width = 20)
private String memRealAuthen;
/**
* @desc 实名时间
* @column mem_real_authen_date
* @default
*/
@JsonFormat(
pattern = "yyyy-MM-dd"
)
@Excel(name = "实名时间", orderNum = "28", width = 20, format = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date memRealAuthenDate;
/**
* @desc 会员等级 0 无
* @column mem_level
* @default
*/
@Excel(name = "会员等级 0 无", orderNum = "29", width = 20)
private Integer memLevel;
/**
* @desc 会员开始时间
* @column mem_level_begin_date
* @default
*/
@JsonFormat(
pattern = "yyyy-MM-dd"
)
@Excel(name = "会员开始时间", orderNum = "30", width = 20, format = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date memLevelBeginDate;
/**
* @desc 会员结束时间
* @column mem_level_end_date
* @default
*/
@JsonFormat(
pattern = "yyyy-MM-dd"
)
@Excel(name = "会员结束时间", orderNum = "31", width = 20, format = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date memLevelEndDate;
/**
* @desc 昵称
* @column mem_nick_name
* @default
*/
@Excel(name = "昵称", orderNum = "32", width = 20)
private String memNickName;
/**
* @desc 昵称
* @column mem_code_level
* @default
*/
// @Excel(name = "昵称", orderNum = "32", width = 20)
private String memCodeLevel;
/**
* 开始时间
*/
@JsonIgnore
@TableField(exist = false)
private String beginTime;
/**
* 结束时间
*/
@JsonIgnore
@TableField(exist = false)
private String endTime;
/**
* 生日开始时间
*/
@JsonIgnore
@TableField(exist = false)
private String beginBirthday;
/**
* 生日结束时间
*/
@JsonIgnore
@TableField(exist = false)
private String endBirthday;
/**
* 最小身高
*/
@TableField(exist = false)
private BigDecimal minHeight;
/**
* 最大身高
*/
@TableField(exist = false)
private BigDecimal maxHeight;
/**
* 最小体重
*/
@TableField(exist = false)
private BigDecimal minWeight;
/**
* 最大体重
*/
@TableField(exist = false)
private BigDecimal maxWeight;
/**
* 学历
*/
@TableField(exist = false)
private String educations;
/**
* 最小年收入
*/
@TableField(exist = false)
private BigDecimal minYearIncome;
/**
* 最大年收入
*/
@TableField(exist = false)
private BigDecimal maxYearIncome;
/**
* 实名开始时间
*/
@JsonIgnore
@TableField(exist = false)
private String authenBeginTime;
/**
* 实名结束时间
*/
@JsonIgnore
@TableField(exist = false)
private String authenEndTime;
/**
* 开始时间
*/
@JsonIgnore
@TableField(exist = false)
private String memLevelBeginTime;
/**
* 结束时间
*/
@JsonIgnore
@TableField(exist = false)
private String memLevelEndTime;
}
package org.rcisoft.business.memInfo.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.rcisoft.business.memInfo.entity.MemInfo;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.aop.CyPageUtilAsp;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
/**
* Created by cy on 2024年12月20日 下午3:35:34.
*/
public interface MemInfoService {
/**
* 保存 会员表
* @param memInfo
* @return
*/
CyPersistModel persist(MemInfo memInfo);
/**
* 删除 会员表
* @param memInfo
* @return
*/
CyPersistModel remove(MemInfo memInfo);
/**
* 逻辑删除 会员表
* @param memInfo
* @return
*/
CyPersistModel removeLogical(MemInfo memInfo);
/**
* 修改 会员表
* @param memInfo
* @return
*/
CyPersistModel merge(MemInfo memInfo);
/**
* 根据id查询 会员表
* @param id
* @return
*/
MemInfo findById(int id);
/**
* 分页查询 会员表
* @param memInfo
* @return
*/
IPage<MemInfo> findAllByPagination(CyPageInfo<MemInfo> paginationUtility,
MemInfo memInfo);
/**
* 查询list 会员表
* @param memInfo
* @return
*/
List<MemInfo> findAll(MemInfo memInfo);
/**
* 导出会员表
* @return
*/
List<MemInfo> export(MemInfo memInfo);
/**
* 校验会员信息
* @param memInfo
* @return
*/
Boolean checkInfo(MemInfo memInfo);
}
package org.rcisoft.business.memInfo.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.core.constant.CyDelStaCons;
import org.rcisoft.core.constant.CyFlagStaCons;
import org.rcisoft.core.exception.CyServiceException;
import org.rcisoft.core.util.CyAESUtils;
import org.rcisoft.core.util.CyIdGenUtil;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.aop.CyPageUtilAsp;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.business.memInfo.dao.MemInfoRepository;
import org.rcisoft.business.memInfo.entity.MemInfo;
import org.rcisoft.business.memInfo.service.MemInfoService;
import org.rcisoft.core.service.CyBaseService;
import org.rcisoft.sys.constant.CyUserCons;
import org.rcisoft.sys.rbac.user.dao.SysUserRbacRepository;
import org.rcisoft.sys.rbac.user.dto.SysUserRbacDTO;
import org.rcisoft.sys.rbac.user.entity.SysUserRbac;
import org.rcisoft.sys.rbac.user.enums.UserInfoExceptionEnums;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import lombok.extern.slf4j.Slf4j;
/**
* Created by cy on 2024年12月20日 下午3:35:34.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> implements MemInfoService {
// 定义允许的字符集
private static final String CHAR_POOL = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
private static final Random RANDOM = new Random();
private static final Set<String> generatedNicknames = new HashSet<>();
@Autowired
private SysUserRbacRepository sysUserRbacRepository;
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired
CyIdGenUtil cyIdGenUtil;
@Value("${cy.init.password}")
private String password;
/**
* 保存 会员表
* @param memInfo
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(MemInfo memInfo){
//手机号、身份证存储加密
if (StringUtils.isNotBlank(memInfo.getMemPhone()))
memInfo.setMemPhone(CyAESUtils.encrypt(memInfo.getMemPhone()));
if (StringUtils.isNotBlank(memInfo.getMemIdcard()))
memInfo.setMemIdcard(CyAESUtils.encrypt(memInfo.getMemIdcard()));
//身份证、手机号验重
SysUserRbacDTO sysUserRbacDTO = baseMapper.checkPhoneRepeat(null,memInfo.getMemPhone());
if (sysUserRbacDTO != null) {
throw new CyServiceException(UserInfoExceptionEnums.PHONE_EXISTS);
}
sysUserRbacDTO = baseMapper.checkIdcardRepeat(null,memInfo.getMemIdcard());
if (sysUserRbacDTO != null) {
throw new CyServiceException(UserInfoExceptionEnums.ID_NUMBER_EXISTS);
}
//添加sys_user
SysUserRbac userRbac = new SysUserRbac();
userRbac.setUsername(this.generateRandomName());
userRbac.setUserType(CyUserCons.USER_TYPE_COMMON);
userRbac.setPhone(memInfo.getMemPhone());
userRbac.setSex(memInfo.getMemSex());
userRbac.setPassword(passwordEncoder.encode(password));
userRbac.setIdNumber(memInfo.getMemIdcard());
userRbac.setUserIdentity("10");
userRbac.setFlag(CyFlagStaCons.NORMAL.getStatus());
userRbac.setDelFlag(CyDelStaCons.NORMAL.getStatus());
sysUserRbacRepository.insert(userRbac);
//查询会员角色
List<Integer> roleIds = baseMapper.selectRoleByKey("member");
//插入角色
if (!roleIds.isEmpty()) {
sysUserRbacRepository.insertUserRole(userRbac.getBusinessId(), roleIds);
}
//生成会员号
memInfo.setMemCode("11");
//增加操作
memInfo.setUserId(userRbac.getBusinessId());
int line = baseMapper.insert(memInfo);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
memInfo.getBusinessId()+"的会员表信息");
return new CyPersistModel(line);
}
/**
* 删除 会员表
* @param memInfo
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(MemInfo memInfo){
int line = baseMapper.realDelete(memInfo);
log.debug(CyUserUtil.getAuthenUsername()+"删除了ID为"+
memInfo.getBusinessId()+"的会员表信息");
return new CyPersistModel(line);
}
/**
* 逻辑删除 会员表
* @param memInfo
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel removeLogical(MemInfo memInfo){
memInfo.setDeleted();
int line = baseMapper.deleteById(memInfo);
log.debug(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
memInfo.getBusinessId()+"的会员表信息");
return new CyPersistModel(line);
}
/**
* 修改 会员表
* @param memInfo
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(MemInfo memInfo){
int line = baseMapper.updateById(memInfo);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ memInfo.getBusinessId()+"的会员表信息");
return new CyPersistModel(line);
}
/**
* 根据id查询 会员表
* @param id
* @return
*/
@Override
public MemInfo findById(int id){
return baseMapper.selectDetailById(id);
}
/**
* 分页查询 会员表
* @param memInfo
* @return
*/
@Override
public IPage<MemInfo> findAllByPagination(CyPageInfo<MemInfo> paginationUtility,
MemInfo memInfo){
return baseMapper.queryMemInfosPaged(paginationUtility,memInfo);
}
/**
* 查询list 会员表
* @param memInfo
* @return
*/
@Override
public List<MemInfo> findAll(MemInfo memInfo){
return baseMapper.queryMemInfos(memInfo);
}
/**
* 导出会员表
* @return
*/
@Override
public List<MemInfo> export(MemInfo memInfo) {
List<MemInfo> memInfoList = baseMapper.queryMemInfos(memInfo);
return memInfoList;
}
private String generateRandomName() {
StringBuilder nickname;
int length = 10;
do {
nickname = new StringBuilder(length);
for (int i = 0; i < length; i++) {
int index = RANDOM.nextInt(CHAR_POOL.length());
nickname.append(CHAR_POOL.charAt(index));
}
} while (generatedNicknames.contains(nickname.toString()));
// 存储生成的昵称
generatedNicknames.add(nickname.toString());
return "wx_" + nickname.toString();
}
/**
* 校验会员信息
* @param memInfo
* @return
*/
@Override
public Boolean checkInfo(MemInfo memInfo) {
//手机号、身份证存储加密
if (StringUtils.isNotBlank(memInfo.getMemPhone()))
memInfo.setMemPhone(CyAESUtils.encrypt(memInfo.getMemPhone()));
if (StringUtils.isNotBlank(memInfo.getMemIdcard()))
memInfo.setMemIdcard(CyAESUtils.encrypt(memInfo.getMemIdcard()));
//身份证、手机号验重
SysUserRbacDTO sysUserRbacDTO = baseMapper.checkPhoneRepeat(memInfo.getUserId(),memInfo.getMemPhone());
if (sysUserRbacDTO != null) {
throw new CyServiceException(UserInfoExceptionEnums.PHONE_EXISTS);
}
sysUserRbacDTO = baseMapper.checkIdcardRepeat(null,memInfo.getMemIdcard());
if (sysUserRbacDTO != null) {
throw new CyServiceException(UserInfoExceptionEnums.ID_NUMBER_EXISTS);
}
return true;
}
}
package org.rcisoft.common.component;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @author Liushuaiyang
*/
@Component
@Data
public class OssGlobal {
// oss-request
@Value("${oss.request}")
private String request;
// oss-endpoint
@Value("${oss.endpoint}")
private String endpoint;
// oss-bucket
@Value("${oss.bucket}")
private String bucket;
// oss-regionId
@Value("${oss.regionId}")
private String regionId;
// oss-put-acess_key
@Value("${oss.put.acess_key}")
private String putAcessKey;
// oss-put-secret_key
@Value("${oss.put.secret_key}")
private String putSecretKey;
// oss-put-ran
@Value("${oss.put.ram}")
private String putRam;
// oss-read-acess_key
@Value("${oss.read.acess_key}")
private String readAcessKey;
// oss-read-secret_key
@Value("${oss.read.secret_key}")
private String readSecretKey;
// oss-read-read_time
@Value("${oss.read.read_time}")
private Integer readTime;
}
......@@ -3,54 +3,62 @@
<mapper namespace="org.rcisoft.business.cmsActivity.dao.CmsActivityRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.cmsActivity.entity.CmsActivity">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="summary" jdbcType="VARCHAR" property="summary"/>
<result column="publish_date" jdbcType="DATE" property="publishDate"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="create_date" jdbcType="DATE" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="DATE" property="updateDate"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="details" jdbcType="VARCHAR" property="details"/>
<result column="weight" jdbcType="INTEGER" property="weight"/>
<result column="picture_id" jdbcType="VARCHAR" property="pictureId"/>
<result column="is_recommended" jdbcType="INTEGER" property="isRecommended"/>
<result column="picture_id" jdbcType="INTEGER" property="pictureId"/>
<result column="maleCount" jdbcType="INTEGER" property="maleCount"/>
<result column="female_count" jdbcType="INTEGER" property="femaleCount"/>
<result column="application_count" jdbcType="VARCHAR" property="applicationCount"/>
<result column="application_fee" jdbcType="FLOAT" property="applicationFee"/>
<result column="publish_date" jdbcType="DATE" property="publishDate"/>
<result column="publish_status" jdbcType="VARCHAR" property="publishStatus"/>
<result column="is_top" jdbcType="INTEGER" property="isTop"/>
<result column="participant_count" jdbcType="VARCHAR" property="participantCount"/>
<result column="is_registration" jdbcType="INTEGER" property="isRegistration"/>
<result column="is_recommended" jdbcType="INTEGER" property="isRecommended"/>
<result column="is_application" jdbcType="INTEGER" property="isApplication"/>
<result column="is_authentication" jdbcType="INTEGER" property="isAuthentication"/>
<result column="registration_fee" jdbcType="FLOAT" property="registrationFee"/>
<result column="start_time" jdbcType="DATE" property="startTime"/>
<result column="end_time" jdbcType="DATE" property="endTime"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryCmsActivity" resultMap="BaseResultMap">
select * from cms_activity
where 1=1
<if test="entity.beginTime !=null and entity.beginTime != '' ">
<!-- <if test="entity.beginTime !=null and entity.beginTime != '' ">
and publish_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and publish_date &lt;= #{entity.endTime}
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and create_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and create_date &lt;= #{entity.endTime}
</if>-->
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.createDate !=null and entity.createDate != '' ">
and create_date = #{entity.createDate}
</if>
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and update_date &gt;= #{entity.beginTime}
<if test="entity.updateDate !=null and entity.updateDate != '' ">
and update_date = #{entity.updateDate}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and update_date &lt;= #{entity.endTime}
<if test="entity.remarks !=null and entity.remarks != '' ">
and remarks like concat('%',#{entity.remarks},'%')
</if>
<if test="entity.title !=null and entity.title != '' ">
and title like concat('%',#{entity.title},'%')
......@@ -58,14 +66,16 @@
<if test="entity.details !=null and entity.details != '' ">
and details like concat('%',#{entity.details},'%')
</if>
<if test="entity.registrationFee !=null and entity.registrationFee != '' ">
and registration_fee like concat('%',#{entity.registrationFee},'%')
</if>
<if test="entity.weight !=null and entity.weight != '' ">
and weight like concat('%',#{entity.weight},'%')
</if>
<if test="entity.applicationFee !=null and entity.applicationFee != '' ">
and application_fee like concat('%',#{entity.applicationFee},'%')
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and picture_id like concat('%',#{entity.pictureId},'%')
and picture_id = #{entity.pictureId}
</if>
ORDER BY business_id DESC
</select>
......@@ -76,35 +86,39 @@
ca.create_by,
ca.create_date,
ca.update_by,
ca.update_date,
ca.del_flag,
ca.flag,
ca.summary,
ca.title,
ca.details,
ca.weight,
ca.picture_id,
applicationList.application_count,
ca.application_fee,
ca.publish_status,
ca.is_recommended,
applicationList.participant_count,
ca.is_top,
ca.is_registration,
ca.is_application,
ca.is_authentication,
ca.registration_fee,
ca.start_time,
ca.end_time,
su.nick_name as nickName,
oi.path
FROM cms_activity ca
LEFT JOIN
(SELECT activity_id, COUNT(*) AS participant_count
(SELECT activity_id, COUNT(*) AS application_count
FROM cms_application
GROUP BY activity_id) AS applicationList
ON ca.business_id = applicationList.activity_id
LEFT JOIN oss_info oi on oi.business_id = ca.picture_id
LEFT JOIN oss_info oi on ca.picture_id = oi.business_id
LEFT JOIN sys_user su on su.business_id = ca.create_by
where ca.del_flag='0'
<if test="entity.beginTime !=null and entity.beginTime != '' ">
<!-- <if test="entity.beginTime !=null and entity.beginTime != '' ">
and publish_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and publish_date &lt;= #{entity.endTime}
</if>
</if>-->
<if test="entity.flag!=null and entity.flag != '' ">
and ca.flag = #{entity.flag}
</if>
......@@ -112,26 +126,26 @@
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.beginTime !=null ">
<!-- <if test="entity.beginTime !=null ">
and ca.publish_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null ">
and ca.publish_date &lt;= #{entity.endTime}
</if>
</if>-->
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.title !=null and entity.title != '' ">
and title like concat('%',#{entity.title},'%')
</if>
<if test="entity.registrationFee !=null and entity.registrationFee != '' ">
and registration_fee = #{entity.registrationFee}
<if test="entity.applicationFee !=null and entity.applicationFee != '' ">
and application_fee = #{entity.applicationFee}
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and picture_id like concat('%',#{entity.pictureId},'%')
and picture_id = #{entity.pictureId}
</if>
<if test="entity.isRegistration !=null and entity.isRegistration != '' ">
and is_registration = #{entity.isRegistration}
<if test="entity.isApplication !=null and entity.isApplication != '' ">
and is_application = #{entity.isApplication}
</if>
<if test="entity.isAuthentication !=null and entity.isAuthentication != '' ">
and is_authentication = #{entity.isAuthentication}
......
......@@ -91,25 +91,25 @@
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.createDate != null and entity.createDate != '' ">
and create_date >= #{entity.createDate}
and create_date = #{entity.createDate}
</if>
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.updateDate !=null and entity.updateDate != '' ">
and update_date &lt;= #{entity.updateDate}
and update_date = #{entity.updateDate}
</if>
<if test="entity.flag !=null and entity.flag != '' ">
and flag &lt;= #{entity.flag}
and flag = #{entity.flag}
</if>
<if test="entity.delFlag !=null and entity.delFlag != '' ">
and del_flag &lt;= #{entity.delFlag}
and del_flag = #{entity.delFlag}
</if>
<if test="entity.userId !=null and entity.userId != '' ">
and user_id &lt;= #{entity.userId}
and user_id = #{entity.userId}
</if>
<if test="entity.activityId !=null and entity.activityId != '' ">
and activity_id &lt;= #{entity.activityId}
and activity_id = #{entity.activityId}
</if>
<if test="entity.name !=null and entity.name != '' ">
and name like concat('%',#{entity.name},'%')
......@@ -118,10 +118,10 @@
and phone like concat('%',#{entity.phone},'%')
</if>
<if test="entity.status !=null and entity.status != '' ">
and status &lt;= #{entity.status}
and status = #{entity.status}
</if>
<if test="entity.applicationFee != null">
and application_fee &lt;= #{entity.applicationFee}
and application_fee = #{entity.applicationFee}
</if>
<if test="entity.remarks !=null and entity.remarks != '' ">
and remarks like concat('%',#{entity.remarks},'%')
......
......@@ -3,7 +3,6 @@
<mapper namespace="org.rcisoft.business.cmsNotice.dao.CmsNoticeRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.cmsNotice.entity.CmsNotice">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="summary" jdbcType="VARCHAR" property="summary"/>
<result column="publish_date" jdbcType="DATE" property="publishDate"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
......@@ -15,7 +14,7 @@
<result column="details" jdbcType="VARCHAR" property="details"/>
<result column="weight" jdbcType="INTEGER" property="weight"/>
<result column="picture_id" jdbcType="VARCHAR" property="pictureId"/>
<result column="picture_id" jdbcType="INTEGER" property="pictureId"/>
<result column="is_recommended" jdbcType="INTEGER" property="isRecommended"/>
<result column="is_top" jdbcType="INTEGER" property="isTop"/>
</resultMap>
......@@ -59,7 +58,7 @@
and weight like concat('%',#{entity.weight},'%')
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and picture_id like concat('%',#{entity.pictureId},'%')
and picture_id = #{entity.pictureId}
</if>
ORDER BY business_id DESC
</select>
......@@ -72,7 +71,6 @@
cn.update_by,
cn.del_flag,
cn.flag,
cn.summary,
cn.title,
cn.weight,
cn.picture_id,
......@@ -81,7 +79,7 @@
su.nick_name as nickName,
oi.path
FROM cms_notice cn
LEFT JOIN oss_info oi on oi.business_id = cn.picture_id
LEFT JOIN oss_info oi on cn.picture_id = oi.business_id
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
<if test="entity.beginTime !=null and entity.beginTime != '' ">
......@@ -109,7 +107,7 @@
and title like concat('%',#{entity.title},'%')
</if>
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and picture_id like concat('%',#{entity.pictureId},'%')
and picture_id = #{entity.pictureId}
</if>
<if test="entity.isRecommended !=null and entity.isRecommended != '' ">
and is_recommended = #{entity.isRecommended}
......
......@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="org.rcisoft.business.cmsBanner.entity.CmsBanner">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="banner_picture" jdbcType="VARCHAR" property="bannerPicture"/>
<result column="picture_id" jdbcType="INTEGER" property="pictureId"/>
<result column="banner_name" jdbcType="VARCHAR" property="bannerName"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="weight" jdbcType="INTEGER" property="weight"/>
......@@ -26,8 +26,8 @@
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
<if test="entity.bannerPicture !=null and entity.bannerPicture != '' ">
and banner_picture like concat('%',#{entity.bannerPicture},'%')
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and picture_id = #{entity.pictureId}
</if>
<if test="entity.bannerName !=null and entity.bannerName != '' ">
and banner_name like concat('%',#{entity.bannerName},'%')
......@@ -43,14 +43,14 @@
<select id="queryCmsBannersPaged" resultMap="BaseResultMap">
select smb.*,oi.url from cms_banner smb
left join oss_info oi on smb.banner_picture = oi.business_id
left join oss_info oi on smb.picture_id = oi.business_id
where 1=1
and smb.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and smb.flag = #{entity.flag}
</if>
<if test="entity.bannerPicture !=null and entity.bannerPicture != '' ">
and smb.banner_picture like concat('%',#{entity.bannerPicture},'%')
<if test="entity.pictureId !=null and entity.pictureId != '' ">
and smb.picture_id = #{entity.pictureId}
</if>
<if test="entity.bannerName !=null and entity.bannerName != '' ">
and smb.banner_name like concat('%',#{entity.bannerName},'%')
......@@ -67,7 +67,7 @@
SELECT smb.*,
oi.url
FROM cms_banner smb
LEFT JOIN oss_info oi ON oi.business_id = smb.banner_picture
LEFT JOIN oss_info oi ON oi.business_id = smb.picture_id
where 1 = 1
and smb.del_flag = '0'
and smb.business_id = #{businessId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment