Commit 8cad4b40 authored by 冷玲鹏's avatar 冷玲鹏

新增报名表-增删改、其他模块加summary摘要字段

parent 0d080bd4
......@@ -102,6 +102,14 @@ public class CmsActivity extends CyIdIncreEntity<CmsActivity> {
@Excel(name = "内容")
private String details;
/**
* @desc 摘要
* @column summary
* @default
*/
@Excel(name = "摘要")
private String summary;
/**
* @desc 权重(排序)
* @column weight
......
......@@ -36,6 +36,46 @@ public class CmsApplicationController extends CyPaginationController<CmsApplicat
@Autowired
private CmsApplicationService cmsApplicationServiceImpl;
@PreAuthorize("@cyPerm.hasPerm('cms:application:increase')")
@CyOpeLogAnno(title = "system-报名表管理-新增报名表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary = "添加报名表", description = "添加报名表")
@PostMapping(value = "/add")
public CyResult add(@Valid CmsApplication cmsApplication, BindingResult bindingResult) {
CyPersistModel data = cmsApplicationServiceImpl.persist(cmsApplication);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
cmsApplication);
}
@PreAuthorize("@cyPerm.hasPerm('cms:activity:removing')")
@CyOpeLogAnno(title = "system-报名表管理-删除报名表", businessType = CyLogTypeEnum.DELETE)
@Operation(summary = "删除报名表", description = "删除报名表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true)})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable Integer businessId, CmsApplication cmsApplication) {
cmsApplication.setBusinessId(businessId);
CyPersistModel data = cmsApplicationServiceImpl.remove(cmsApplication);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
@PreAuthorize("@cyPerm.hasPerm('cms:activity:modifications')")
@CyOpeLogAnno(title = "system-报名表管理-修改报名表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary = "修改报名表", description = "修改报名表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = false)})
@PostMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable Integer businessId, @Valid CmsApplication cmsApplication, BindingResult bindingResult) {
cmsApplication.setBusinessId(businessId);
CyPersistModel data = cmsApplicationServiceImpl.merge(cmsApplication);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
cmsApplication);
}
@PreAuthorize("@cyPerm.hasPerm('cms:application:singleSearch')")
@CyOpeLogAnno(title = "system-报名管理-查询报名", businessType = CyLogTypeEnum.QUERY)
@Operation(summary = "查询单一报名", description = "查询单一报名")
......
......@@ -17,6 +17,11 @@ import java.util.List;
public interface CmsApplicationRepository extends CyBaseMapper<CmsApplication> {
//根据id逻辑删除
int deleteCmsApplication(@Param("businessId")Integer businessId);
//修改状态
int updateStatus(@Param("entity") CmsActivity cmsActivity);
CmsApplication findByBusinessId(@Param("businessId") Integer businessId);
List<CmsApplication> queryCmsApplication(@Param("entity") CmsApplication cmsApplication);
......
......@@ -2,7 +2,9 @@ package org.rcisoft.business.cmsApplication.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.rcisoft.business.cmsApplication.entity.CmsApplication;
import org.rcisoft.business.cmsApplication.entity.CmsApplication;
import org.rcisoft.core.model.CyPageInfo;
import org.rcisoft.core.model.CyPersistModel;
import java.util.List;
......@@ -11,6 +13,27 @@ import java.util.List;
*/
public interface CmsApplicationService {
/**
* 保存 活动
* @param cmsApplication
* @return
*/
CyPersistModel persist(CmsApplication cmsApplication);
/**
* 删除 活动
* @param cmsApplication
* @return
*/
CyPersistModel remove(CmsApplication cmsApplication);
/**
* 修改 活动
* @param cmsApplication
* @return
*/
CyPersistModel merge(CmsApplication cmsApplication);
/**
* 根据id查询 报名表
* @param id
......
......@@ -3,8 +3,8 @@ package org.rcisoft.business.cmsApplication.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.cmsApplication.dao.CmsApplicationRepository;
import org.rcisoft.business.cmsApplication.entity.CmsApplication;
import org.rcisoft.business.cmsApplication.dao.CmsApplicationRepository;
import org.rcisoft.business.cmsApplication.service.CmsApplicationService;
import org.rcisoft.common.component.Global;
import org.rcisoft.core.model.CyPageInfo;
......@@ -12,6 +12,7 @@ import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
......@@ -28,7 +29,48 @@ public class CmsApplicationServiceImpl extends ServiceImpl<CmsApplicationReposit
@Autowired
private Global global;
/**
* 保存 活动
*
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(CmsApplication cmsApplication) {
int line = baseMapper.insert(cmsApplication);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
cmsApplication.getBusinessId()+"的报名表信息");
return new CyPersistModel(line);
}
/**
* 删除 活动
*
* @param cmsApplication
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(CmsApplication cmsApplication) {
int line = baseMapper.deleteCmsApplication(cmsApplication.getBusinessId());
log.debug(CyUserUtil.getAuthenUsername() + "删除了ID为" +
cmsApplication.getBusinessId() + "的活动信息");
return new CyPersistModel(line);
}
/**
* 修改 活动
*
* @param cmsApplication
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(CmsApplication cmsApplication) {
int line = baseMapper.updateById(cmsApplication);
log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + cmsApplication.getBusinessId() + "的活动信息");
return new CyPersistModel(line);
}
/**
* 根据id查询 报名表
......
......@@ -147,7 +147,13 @@ public class CmsNotice extends CyIdIncreEntity<CmsNotice> {
@Excel(name = "内容")
private String details;
/**
* @desc 摘要
* @column summary
* @default
*/
@Excel(name = "摘要")
private String summary;
/**
* 开始时间
......
......@@ -29,6 +29,7 @@
<result column="start_time" jdbcType="DATE" property="startTime"/>
<result column="end_time" jdbcType="DATE" property="endTime"/>
<result column="max_application_count" jdbcType="VARCHAR" property="maxApplicationCount"/>
<result column="summary" jdbcType="VARCHAR" property="summary"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......@@ -71,6 +72,9 @@
<if test="entity.details !=null and entity.details != '' ">
and details like concat('%',#{entity.details},'%')
</if>
<if test="entity.summary !=null and entity.summary != '' ">
and summary like concat('%',#{entity.summary},'%')
</if>
<if test="entity.weight !=null and entity.weight != '' ">
and weight = #{entity.weight}
</if>
......@@ -112,14 +116,21 @@
ca.is_authentication,
ca.start_time,
ca.end_time,
ca.summary,
ca.max_application_count,
su.nick_name as nickName,
oi.path
FROM cms_activity ca
LEFT JOIN
(SELECT activity_id, COUNT(*) AS application_count
FROM cms_application
GROUP BY activity_id) AS applicationList
(SELECT
activity_id,
COUNT(*) AS application_count
FROM
cms_application
WHERE
status = '1'
GROUP BY
activity_id) AS applicationList
ON ca.business_id = applicationList.activity_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
......@@ -146,6 +157,9 @@
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and ca.update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.summary !=null and entity.summary != '' ">
and summary like concat('%',#{entity.summary},'%')
</if>
<if test="entity.title !=null and entity.title != '' ">
and ca.title like concat('%',#{entity.title},'%')
</if>
......
......@@ -128,4 +128,15 @@
</if>
ORDER BY business_id DESC
</select>
<update id="deleteCmsApplication" parameterType="java.lang.Integer">
update cms_application
set del_flag = '1'
where business_id = #{businessId}
</update>
<update id="updateStatus" parameterType="org.rcisoft.business.cmsApplication.entity.CmsApplication">
update cms_application
set flag = #{ entity.flag}
where business_id = #{entity.businessId}
</update>
</mapper>
......@@ -17,6 +17,7 @@
<result column="picture_id" jdbcType="INTEGER" property="pictureId"/>
<result column="is_recommended" jdbcType="INTEGER" property="isRecommended"/>
<result column="is_top" jdbcType="INTEGER" property="isTop"/>
<result column="summary" jdbcType="VARCHAR" property="summary"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......@@ -29,6 +30,9 @@
<if test="entity.endTime !=null and entity.endTime != '' ">
and publish_date &lt;= #{entity.endTime}
</if>
<if test="entity.summary !=null and entity.summary != '' ">
and summary like concat('%',#{entity.summary},'%')
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
......@@ -74,6 +78,7 @@
cn.title,
cn.weight,
cn.picture_id,
cn.summary,
cn.is_recommended,
cn.is_top,
su.nick_name as nickName,
......@@ -91,6 +96,9 @@
<if test="entity.flag!=null and entity.flag != '' ">
and cn.flag = #{entity.flag}
</if>
<if test="entity.summary !=null and entity.summary != '' ">
and summary like concat('%',#{entity.summary},'%')
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
......
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