| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.model.TBanner; |
| | | import com.ruoyi.system.model.TDeliberationVote; |
| | | import com.ruoyi.system.model.TDeliberationVoteOption; |
| | | import com.ruoyi.system.query.AppUserListQuery; |
| | | import com.ruoyi.system.query.BannerListQuery; |
| | | import com.ruoyi.system.service.TBannerService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | @Log(title = "轮播图管理-删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "轮播图管理-删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam String ids) { |
| | | List<Integer> res = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList()); |
| | | // 转换成Integer |
| | | bannerService.removeBatchByIds(res); |
| | | public R delete(@RequestParam String id) { |
| | | bannerService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看轮播图管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看轮播图管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TBanner> getDetailById(@RequestParam String id) { |
| | | TBanner banner = bannerService.getById(id); |
| | | return R.ok(banner); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | courseOrderVO.setCourseCover(course.getCourseCover()); |
| | | courseOrderVO.setCourseType(course.getCourseType()); |
| | | courseOrderVO.setReleaseTime(course.getCreateTime()); |
| | | courseOrderVO.setPeopleLimit(course.getPeopleLimit()); |
| | | return R.ok(courseOrderVO); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.THtmlConfigDTO; |
| | | import com.ruoyi.system.model.THtmlConfig; |
| | | import com.ruoyi.system.service.THtmlConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 修改系统配置-协议管理 |
| | | */ |
| | | @Log(title = "系统配置-协议管理", businessType = BusinessType.UPDATE) |
| | | @Log(title = "系统配置-协议管理-修改", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改系统配置-协议管理管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody THtmlConfig dto) { |
| | |
| | | .last("LIMIT 1")); |
| | | sysConfig.setContent(dto.getContent()); |
| | | return R.ok(htmlConfigService.updateById(sysConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 修改系统配置-协议管理 |
| | | */ |
| | | @Log(title = "系统配置-协议管理-批量修改", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "批量修改系统配置-协议管理管理") |
| | | @PostMapping(value = "/updateBatch") |
| | | public R<Boolean> updateBatch(@RequestBody THtmlConfigDTO dto) { |
| | | List<THtmlConfig> htmlConfigs = dto.getHtmlConfigs(); |
| | | List<Integer> types = htmlConfigs.stream().map(THtmlConfig::getConfigType).collect(Collectors.toList()); |
| | | List<THtmlConfig> sysConfigs = htmlConfigService.list(Wrappers.<THtmlConfig>lambdaQuery().in(THtmlConfig::getConfigType, types)); |
| | | for (THtmlConfig sysConfig : sysConfigs) { |
| | | List<THtmlConfig> htmlConfigList = htmlConfigs.stream().filter(htmlConfig -> htmlConfig.getConfigType().equals(sysConfig.getConfigType())).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(htmlConfigList)) { |
| | | sysConfig.setContent(htmlConfigList.get(0).getContent()); |
| | | } |
| | | } |
| | | htmlConfigService.updateBatchById(htmlConfigs); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(sysConfig); |
| | | } |
| | | |
| | | /** |
| | | * 查看系统配置-协议管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看系统配置-协议管理列表",notes = "配置类型 类型 1=托育服务 2=阅芽计划 3=办事指南图文指引 4=暖心服务图片 5=注册协议 6=隐私政策 7=学习申请书 8=安全告知书 9=购买支付说明 10=微心愿风险提示 11=群众诉求服务说明 12=随手拍说明 13=康年年图文介绍 14=社区地图 15=社区概况") |
| | | @GetMapping(value = "/list") |
| | | public R<List<THtmlConfig>> list() { |
| | | List<THtmlConfig> sysConfigs = htmlConfigService.list(); |
| | | return R.ok(sysConfigs); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.query.TMerchantQuery; |
| | | import com.ruoyi.system.service.TMerchantService; |
| | | import com.ruoyi.system.service.TMerchantTypeService; |
| | | import com.ruoyi.system.vo.TMerchantVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | @ApiOperation(value = "获取商户信息管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TMerchant>> pageList(@RequestBody TMerchantQuery query) { |
| | | public R<PageInfo<TMerchantVO>> pageList(@RequestBody TMerchantQuery query) { |
| | | return R.ok(merchantService.pageList(query)); |
| | | } |
| | | |
| New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.THtmlConfig; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "系统配置-协议管理DTO") |
| | | public class THtmlConfigDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "协议集合") |
| | | private List<THtmlConfig> htmlConfigs; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TMerchant; |
| | | import com.ruoyi.system.query.TMerchantQuery; |
| | | import com.ruoyi.system.vo.TMerchantVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | /** |
| | | * 获取商户信息管理分页列表 |
| | | */ |
| | | List<TMerchant> pageList(@Param("query") TMerchantQuery query, @Param("pageInfo")PageInfo<TMerchant> pageInfo); |
| | | List<TMerchantVO> pageList(@Param("query") TMerchantQuery query, @Param("pageInfo")PageInfo<TMerchantVO> pageInfo); |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TMerchant; |
| | | import com.ruoyi.system.query.TMerchantQuery; |
| | | import com.ruoyi.system.vo.TMerchantVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TMerchant> pageList(TMerchantQuery query); |
| | | PageInfo<TMerchantVO> pageList(TMerchantQuery query); |
| | | } |
| | |
| | | import com.ruoyi.system.model.TMerchant; |
| | | import com.ruoyi.system.query.TMerchantQuery; |
| | | import com.ruoyi.system.service.TMerchantService; |
| | | import com.ruoyi.system.vo.TMerchantVO; |
| | | import com.ruoyi.system.vo.TPartyBuildingVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TMerchant> pageList(TMerchantQuery query) { |
| | | PageInfo<TMerchant> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TMerchant> list = this.baseMapper.pageList(query,pageInfo); |
| | | public PageInfo<TMerchantVO> pageList(TMerchantQuery query) { |
| | | PageInfo<TMerchantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TMerchantVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime releaseTime; |
| | | |
| | | @ApiModelProperty(value = "人数限制") |
| | | private Integer peopleLimit; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TMerchant; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TMerchantVO对象", description = "商户信息") |
| | | public class TMerchantVO extends TMerchant { |
| | | |
| | | @ApiModelProperty(value = "商户分类名称") |
| | | private String typeName; |
| | | |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, merchant_name, merchant_phone, type_id, merchant_logo, address, merchant_detail, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.TMerchant"> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TMerchantVO"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM t_merchant |
| | | tm.id, tm.merchant_name, tm.merchant_phone, tm.type_id, tm.merchant_logo, tm.address, tm.merchant_detail, |
| | | tm.create_time, tm.update_time, tm.create_by, tm.update_by, tm.disabled, tmt.type_name |
| | | FROM t_merchant tm |
| | | left join t_merchant_type tmt on tm.type_id = tmt.id |
| | | <where> |
| | | <if test="query.merchantName != null and query.merchantName != ''"> |
| | | AND merchant_name LIKE CONCAT('%',#{query.merchantName},'%') |
| | | AND tm.merchant_name LIKE CONCAT('%',#{query.merchantName},'%') |
| | | </if> |
| | | <if test="query.merchantPhone != null and query.merchantPhone != ''"> |
| | | AND merchant_phone LIKE CONCAT('%',#{query.merchantPhone},'%') |
| | | AND tm.merchant_phone LIKE CONCAT('%',#{query.merchantPhone},'%') |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | AND tm.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | ORDER BY tm.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |