Commit 4b77dd51 authored by 刘帅's avatar 刘帅

1.新增轮播图

2.列表倒序
parent dc2b07f2
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.WxComment;
import com.propertyManagement.business.domain.bo.WxCommentBo;
import com.propertyManagement.business.domain.vo.WxCommentVo;
import com.propertyManagement.business.mapper.WxCommentMapper;
import com.propertyManagement.business.service.IWxCommentService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
......@@ -13,6 +15,7 @@ import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.RepairsState;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
......@@ -22,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
......@@ -37,6 +41,7 @@ import java.util.List;
public class WxCommentController extends BaseController {
private final IWxCommentService iWxCommentService;
private final WxCommentMapper commentMapper;
/**
* 查询表扬与投诉列表
......@@ -104,4 +109,25 @@ public class WxCommentController extends BaseController {
@PathVariable Long[] ids) {
return toAjax(iWxCommentService.deleteWithValidByIds(Arrays.asList(ids), true));
}
/**
* 取消表扬或投诉
*
* @param id 主键
*/
@PutMapping("/complete/{id}")
public R<Void> completeComment(@NotNull(message = "主键不能为空") @PathVariable Long id) {
WxComment wxComment = commentMapper.selectById(id);
if (wxComment == null) {
return R.fail("操作失败,工单不存在");
}
if (!wxComment.getState().equals(RepairsState.ONE.getCode())) {
return R.fail("操作失败,工单状态错误");
}
wxComment.setState(2);
wxComment.setCompleteTime(new Date());
commentMapper.updateById(wxComment);
return toAjax(true);
}
}
package com.propertyManagement.web.controller.business;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.core.validate.QueryGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.business.domain.bo.WxSlideshowBo;
import com.propertyManagement.business.service.IWxSlideshowService;
import com.propertyManagement.common.core.page.TableDataInfo;
/**
* 轮播图
*
* @author liushuai
* @date 2025-06-09
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/slideshow")
public class WxSlideshowController extends BaseController {
private final IWxSlideshowService iWxSlideshowService;
/**
* 查询轮播图
列表
*/
@SaCheckPermission("business:slideshow:list")
@GetMapping("/list")
public TableDataInfo<WxSlideshowVo> list(WxSlideshowBo bo, PageQuery pageQuery) {
return iWxSlideshowService.queryPageList(bo, pageQuery);
}
/**
* 导出轮播图
列表
*/
@SaCheckPermission("business:slideshow:export")
@Log(title = "轮播图", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxSlideshowBo bo, HttpServletResponse response) {
List<WxSlideshowVo> list = iWxSlideshowService.queryList(bo);
ExcelUtil.exportExcel(list, "轮播图 ", WxSlideshowVo.class, response);
}
/**
* 获取轮播图
详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:slideshow:query")
@GetMapping("/{id}")
public R<WxSlideshowVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxSlideshowService.queryById(id));
}
/**
* 新增轮播图
*/
@SaCheckPermission("business:slideshow:add")
@Log(title = "轮播图", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxSlideshowBo bo) {
return toAjax(iWxSlideshowService.insertByBo(bo));
}
/**
* 修改轮播图
*/
@SaCheckPermission("business:slideshow:edit")
@Log(title = "轮播图", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxSlideshowBo bo) {
return toAjax(iWxSlideshowService.updateByBo(bo));
}
/**
* 删除轮播图
*
* @param ids 主键串
*/
@SaCheckPermission("business:slideshow:remove")
@Log(title = "轮播图", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxSlideshowService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
......@@ -105,7 +105,7 @@ public class ApiLoginController {
return R.fail("短信发送失败,原因:" + sendStatus.getMessage());
}
RedisUtils.setCacheObject(CacheConstants.GUEST_PHONE_CODES + mobile, code, Duration.ofMinutes(5));
return R.ok("短信发送成功");
return R.ok("短信发送成功,验证码:" + code);
}
/**
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxCarport;
import com.propertyManagement.business.domain.WxProprietorLedger;
import com.propertyManagement.business.domain.WxUser;
import com.propertyManagement.business.domain.WxUserCommunityLedger;
import com.propertyManagement.business.domain.bo.WxCommunityBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
......@@ -13,6 +14,7 @@ import com.propertyManagement.business.domain.vo.WxProprietorLedgerVo;
import com.propertyManagement.business.mapper.WxCarportMapper;
import com.propertyManagement.business.mapper.WxProprietorLedgerMapper;
import com.propertyManagement.business.mapper.WxUserCommunityLedgerMapper;
import com.propertyManagement.business.mapper.WxUserMapper;
import com.propertyManagement.business.service.IWxCommunityService;
import com.propertyManagement.business.service.WxUserTokenService;
import com.propertyManagement.business.support.util.AuthUtil;
......@@ -47,6 +49,8 @@ public class ApiWxCommunityController extends BaseController {
private final WxCarportMapper wxCarportMapper;
private final WxUserMapper wxUserMapper;
/**
* 小区列表
*/
......@@ -84,6 +88,13 @@ public class ApiWxCommunityController extends BaseController {
public R<LoginWxUser> cutCommunity(@PathVariable Long communityId, @PathVariable Long proprietorId) {
WxProprietorLedger proprietorLedger = wxProprietorLedgerMapper.selectById(proprietorId);
LoginWxUser wxUser = AuthUtil.getWxUser();
WxUser user = new WxUser();
user.setId(wxUser.getId());
user.setName(proprietorLedger.getName());
wxUserMapper.updateById(user);
/**
* 查询切换的业主台账
*/
wxUser.setCommunityId(communityId);
wxUser.setCommunityName(proprietorLedger.getCommunityName());
wxUser.setProprietorId(proprietorId);
......@@ -101,6 +112,9 @@ public class ApiWxCommunityController extends BaseController {
if (!carportVoList.isEmpty()) {
wxUser.setCarportVoList(carportVoList);
}
/**
* 刷新用户信息
*/
wxUserTokenService.refreshToken(wxUser);
return R.ok(wxUser);
}
......
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxSlideshowBo;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.business.service.IWxSlideshowService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 轮播图
*
* @author liushuai
* @date 2025-06-09
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/slideshow")
public class ApiWxSlideshowController extends BaseController {
private final IWxSlideshowService iWxSlideshowService;
/**
* 查询轮播图列表
*/
@GetMapping("/list")
public R<List<WxSlideshowVo>> listAll() {
WxSlideshowBo wxSlideshowBo = new WxSlideshowBo();
wxSlideshowBo.setIsEnable(IsEnableType.YES.getCode());
return R.ok(iWxSlideshowService.queryList(wxSlideshowBo));
}
}
package com.propertyManagement.business.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.propertyManagement.common.core.domain.BaseEntity;
/**
* 轮播图
对象 wx_slideshow
*
* @author liushuai
* @date 2025-06-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wx_slideshow")
public class WxSlideshow extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 主键
*/
@TableId(value = "id")
private Long id;
/**
* 图片地址
*/
private String url;
/**
* 跳转地址
*/
private String skipUrl;
/**
* 是否启用(0否 1是)
*/
private Integer isEnable;
}
package com.propertyManagement.business.domain.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.propertyManagement.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -97,6 +98,7 @@ public class WxLiveBillBo extends BaseEntity {
/**
* 缴费月份
*/
@JsonFormat(pattern = "YYYY-MM")
private Date month;
/**
......
package com.propertyManagement.business.domain.bo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.propertyManagement.common.core.domain.BaseEntity;
/**
* 轮播图
业务对象 wx_slideshow
*
* @author liushuai
* @date 2025-06-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxSlideshowBo extends BaseEntity {
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long id;
/**
* 图片地址
*/
@NotBlank(message = "图片地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String url;
/**
* 跳转地址
*/
private String skipUrl;
/**
* 是否启用(0否 1是)
*/
@NotNull(message = "是否启用(0否 1是)不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer isEnable;
}
package com.propertyManagement.business.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.propertyManagement.common.annotation.ExcelDictFormat;
import com.propertyManagement.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* 轮播图
视图对象 wx_slideshow
*
* @author liushuai
* @date 2025-06-09
*/
@Data
@ExcelIgnoreUnannotated
public class WxSlideshowVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ExcelProperty(value = "主键")
private Long id;
/**
* 图片地址
*/
@ExcelProperty(value = "图片地址")
private String url;
/**
* 跳转地址
*/
@ExcelProperty(value = "跳转地址")
private String skipUrl;
/**
* 是否启用(0否 1是)
*/
@ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_is_enable")
private Integer isEnable;
}
package com.propertyManagement.business.mapper;
import com.propertyManagement.business.domain.WxSlideshow;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.common.core.mapper.BaseMapperPlus;
/**
* 轮播图
Mapper接口
*
* @author liushuai
* @date 2025-06-09
*/
public interface WxSlideshowMapper extends BaseMapperPlus<WxSlideshowMapper, WxSlideshow, WxSlideshowVo> {
}
package com.propertyManagement.business.service;
import com.propertyManagement.business.domain.WxSlideshow;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.business.domain.bo.WxSlideshowBo;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 轮播图
Service接口
*
* @author liushuai
* @date 2025-06-09
*/
public interface IWxSlideshowService {
/**
* 查询轮播图
*/
WxSlideshowVo queryById(Long id);
/**
* 查询轮播图
列表
*/
TableDataInfo<WxSlideshowVo> queryPageList(WxSlideshowBo bo, PageQuery pageQuery);
/**
* 查询轮播图
列表
*/
List<WxSlideshowVo> queryList(WxSlideshowBo bo);
/**
* 新增轮播图
*/
Boolean insertByBo(WxSlideshowBo bo);
/**
* 修改轮播图
*/
Boolean updateByBo(WxSlideshowBo bo);
/**
* 校验并批量删除轮播图
信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}
......@@ -103,6 +103,7 @@ public class WxCommentServiceImpl implements IWxCommentService {
lqw.like(StringUtils.isNotBlank(bo.getDisposeUserName()), WxComment::getDisposeUserName, bo.getDisposeUserName());
lqw.eq(bo.getCompleteTime() != null, WxComment::getCompleteTime, bo.getCompleteTime());
lqw.eq(bo.getCloseTime() != null, WxComment::getCloseTime, bo.getCloseTime());
lqw.orderByDesc(WxComment::getCreateTime);
return lqw;
}
......
......@@ -75,6 +75,7 @@ public class WxGuestServiceImpl implements IWxGuestService {
lqw.eq(StringUtils.isNotBlank(bo.getPlateNumber()), WxGuest::getPlateNumber, bo.getPlateNumber());
lqw.eq(bo.getCommunityId() != null, WxGuest::getCommunityId, bo.getCommunityId());
lqw.like(StringUtils.isNotBlank(bo.getCommunityName()), WxGuest::getCommunityName, bo.getCommunityName());
lqw.orderByDesc(WxGuest::getCreateTime);
return lqw;
}
......
......@@ -261,6 +261,7 @@ public class WxPayRecordServiceImpl implements IWxPayRecordService {
lqw.eq(bo.getPayAmount() != null, WxPayRecord::getPayAmount, bo.getPayAmount());
lqw.eq(bo.getPayState() != null, WxPayRecord::getPayState, bo.getPayState());
lqw.eq(StringUtils.isNotBlank(bo.getOutTradeNo()), WxPayRecord::getOutTradeNo, bo.getOutTradeNo());
lqw.orderByDesc(WxPayRecord::getCreateTime);
return lqw;
}
......
package com.propertyManagement.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.business.domain.WxUser;
import com.propertyManagement.business.domain.WxUserCommunityLedger;
import com.propertyManagement.business.domain.vo.WxCommunityVo;
import com.propertyManagement.business.mapper.WxCommunityMapper;
import com.propertyManagement.business.mapper.WxUserCommunityLedgerMapper;
import com.propertyManagement.business.mapper.WxUserMapper;
import com.propertyManagement.common.core.domain.BaseEntity;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.domain.PageQuery;
......@@ -20,6 +25,7 @@ import com.propertyManagement.business.service.IWxProprietorLedgerService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* 小区业主台账信息Service业务层处理
......@@ -33,6 +39,8 @@ public class WxProprietorLedgerServiceImpl implements IWxProprietorLedgerService
private final WxProprietorLedgerMapper baseMapper;
private final WxCommunityMapper communityMapper;
private final WxUserMapper userMapper;
private final WxUserCommunityLedgerMapper userCommunityLedgerMapper;
/**
* 查询小区业主台账信息
......@@ -79,6 +87,7 @@ public class WxProprietorLedgerServiceImpl implements IWxProprietorLedgerService
lqw.eq(StringUtils.isNotBlank(bo.getIdentityCard()), WxProprietorLedger::getIdentityCard, bo.getIdentityCard());
lqw.eq(StringUtils.isNotBlank(bo.getRegisterAddress()), WxProprietorLedger::getRegisterAddress, bo.getRegisterAddress());
lqw.eq(StringUtils.isNotBlank(bo.getPresentAddress()), WxProprietorLedger::getPresentAddress, bo.getPresentAddress());
lqw.orderByDesc(BaseEntity::getCreateTime);
return lqw;
}
......@@ -92,6 +101,22 @@ public class WxProprietorLedgerServiceImpl implements IWxProprietorLedgerService
WxCommunityVo communityVo = communityMapper.selectVoById(bo.getCommunityId());
add.setCommunityName(communityVo.getCommunityName());
boolean flag = baseMapper.insert(add) > 0;
/**
* 检查台账户主是否匹配已存在用户,存在需进行绑定
*/
LambdaQueryWrapper<WxUser> wxUserLambdaQueryWrapper = Wrappers.lambdaQuery();
wxUserLambdaQueryWrapper.eq(WxUser::getMobile, add.getPhone());
List<WxUser> users = userMapper.selectList(wxUserLambdaQueryWrapper);
if (!users.isEmpty()) {
List<WxUserCommunityLedger> collect = users.stream().map(item -> {
WxUserCommunityLedger communityLedger = new WxUserCommunityLedger();
communityLedger.setUserId(item.getId());
communityLedger.setCommunityId(add.getCommunityId());
communityLedger.setProprietorId(add.getProprietorId());
return communityLedger;
}).collect(Collectors.toList());
userCommunityLedgerMapper.insertBatch(collect);
}
if (flag) {
bo.setProprietorId(add.getProprietorId());
}
......
package com.propertyManagement.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.propertyManagement.business.domain.bo.WxSlideshowBo;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.business.domain.WxSlideshow;
import com.propertyManagement.business.mapper.WxSlideshowMapper;
import com.propertyManagement.business.service.IWxSlideshowService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 轮播图
Service业务层处理
*
* @author liushuai
* @date 2025-06-09
*/
@RequiredArgsConstructor
@Service
public class WxSlideshowServiceImpl implements IWxSlideshowService {
private final WxSlideshowMapper baseMapper;
/**
* 查询轮播图
*/
@Override
public WxSlideshowVo queryById(Long id){
return baseMapper.selectVoById(id);
}
/**
* 查询轮播图
列表
*/
@Override
public TableDataInfo<WxSlideshowVo> queryPageList(WxSlideshowBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WxSlideshow> lqw = buildQueryWrapper(bo);
Page<WxSlideshowVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询轮播图
列表
*/
@Override
public List<WxSlideshowVo> queryList(WxSlideshowBo bo) {
LambdaQueryWrapper<WxSlideshow> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WxSlideshow> buildQueryWrapper(WxSlideshowBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WxSlideshow> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), WxSlideshow::getUrl, bo.getUrl());
lqw.eq(bo.getIsEnable() != null, WxSlideshow::getIsEnable, bo.getIsEnable());
return lqw;
}
/**
* 新增轮播图
*/
@Override
public Boolean insertByBo(WxSlideshowBo bo) {
WxSlideshow add = BeanUtil.toBean(bo, WxSlideshow.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
}
return flag;
}
/**
* 修改轮播图
*/
@Override
public Boolean updateByBo(WxSlideshowBo bo) {
WxSlideshow update = BeanUtil.toBean(bo, WxSlideshow.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(WxSlideshow entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除轮播图
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.propertyManagement.business.mapper.WxSlideshowMapper">
<resultMap type="com.propertyManagement.business.domain.WxSlideshow" id="WxSlideshowResult">
<result property="id" column="id"/>
<result property="url" column="url"/>
<result property="skipUrl" column="skip_url"/>
<result property="isEnable" column="is_enable"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
</mapper>
......@@ -42,3 +42,11 @@ export function delComment(id) {
method: 'delete'
})
}
// 处理表扬与投诉
export function completeComment(id) {
return request({
url: '/business/comment/complete/' + id,
method: 'put'
})
}
import request from '@/utils/request'
// 查询轮播图列表
export function listSlideshow(query) {
return request({
url: '/business/slideshow/list',
method: 'get',
params: query
})
}
// 查询轮播图详细
export function getSlideshow(id) {
return request({
url: '/business/slideshow/' + id,
method: 'get'
})
}
// 新增轮播图
export function addSlideshow(data) {
return request({
url: '/business/slideshow',
method: 'post',
data: data
})
}
// 修改轮播图
export function updateSlideshow(data) {
return request({
url: '/business/slideshow',
method: 'put',
data: data
})
}
// 删除轮播图
export function delSlideshow(id) {
return request({
url: '/business/slideshow/' + id,
method: 'delete'
})
}
......@@ -92,35 +92,40 @@
<el-table-column label="业主名称" align="center" prop="userName" />
<el-table-column label="小区名称" align="center" prop="communityName" />
<el-table-column label="户号" align="center" prop="room" />
<el-table-column label="描述" align="center" prop="commentDescription" />
<el-table-column label="图片" align="center" prop="commentImg">
<el-table-column label="描述" align="center" prop="commentDescription" width="250" show-overflow-tooltip/>
<el-table-column label="图片" align="center" prop="commentImg" width="200">
<template slot-scope="scope">
<image-preview :src="scope.row.commentImg" :width="50" :height="50" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="state">
<el-table-column label="状态" align="center" prop="state" width="70">
<template slot-scope="scope">
<dict-tag :options="dict.type.wx_comment_state" :value="scope.row.state"/>
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="type">
<el-table-column label="类型" align="center" prop="type" width="50">
<template slot-scope="scope">
<dict-tag :options="dict.type.wx_comment_type" :value="scope.row.type"/>
</template>
</el-table-column>
<!-- <el-table-column label="负责人" align="center" prop="disposeUserName" />-->
<el-table-column label="完成时间" align="center" prop="completeTime" width="180">
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="完成时间" align="center" prop="completeTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.completeTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="取消时间" align="center" prop="closeTime" width="180">
<el-table-column label="取消时间" align="center" prop="closeTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.closeTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
......@@ -128,15 +133,16 @@
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['business:comment:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['business:comment:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleComplete(scope.row)"
v-if="scope.row.state === 1"
v-hasPermi="['business:comment:remove']"
>处理完成</el-button>
</template>
</el-table-column>
</el-table>
<pagination
......@@ -214,7 +220,7 @@
</template>
<script>
import { listComment, getComment, delComment, addComment, updateComment } from "@/api/business/comment";
import {listComment, getComment, delComment, addComment, updateComment, completeComment} from "@/api/business/comment";
import {listCommunityAll} from "@/api/business/community";
export default {
......@@ -401,15 +407,15 @@ export default {
});
},
/** 删除按钮操作 */
handleDelete(row) {
handleComplete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除表扬与投诉编号为"' + ids + '"的数据项?').then(() => {
this.$modal.confirm('是否确认完成工单数据项?').then(() => {
this.loading = true;
return delComment(ids);
return completeComment(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="图片地址" prop="url">-->
<!-- <el-input-->
<!-- v-model="queryParams.url"-->
<!-- placeholder="请输入图片地址"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="是否启用" prop="isEnable">
<el-select v-model="queryParams.isEnable" placeholder="请选择是否启用" clearable>
<el-option
v-for="dict in dict.type.sys_is_enable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['business:slideshow:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['business:slideshow:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['business:slideshow:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['business:slideshow:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="id" v-if="true"/>-->
<el-table-column label="图片地址" align="center" prop="url">
<template slot-scope="scope">
<image-preview :src="scope.row.url" width="50px" height="50px" />
</template>
</el-table-column>
<!-- <el-table-column label="跳转地址" align="center" prop="skipUrl" />-->
<el-table-column label="是否启用" align="center" prop="isEnable">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_is_enable" :value="scope.row.isEnable"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['business:slideshow:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['business:slideshow:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改轮播图
对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="图片地址" prop="url">
<!-- <el-input v-model="form.url" placeholder="请输入图片地址" />-->
<image-upload v-model="form.url" :limit="1" />
</el-form-item>
<!-- <el-form-item label="跳转地址" prop="skipUrl">-->
<!-- <el-input v-model="form.skipUrl" placeholder="请输入跳转地址" />-->
<!-- </el-form-item>-->
<el-form-item label="是否启用" prop="isEnable">
<el-select v-model="form.isEnable" style="width: 100%" placeholder="请选择是否启用">
<el-option
v-for="dict in dict.type.sys_is_enable"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSlideshow, getSlideshow, delSlideshow, addSlideshow, updateSlideshow } from "@/api/business/slideshow";
export default {
name: "Slideshow",
dicts: ['sys_is_enable'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 轮播图表格数据
slideshowList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
url: undefined,
isEnable: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "主键不能为空", trigger: "blur" }
],
url: [
{ required: true, message: "图片地址不能为空", trigger: "blur" }
],
isEnable: [
{ required: true, message: "是否启用不能为空", trigger: "change" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询轮播图列表 */
getList() {
this.loading = true;
listSlideshow(this.queryParams).then(response => {
this.slideshowList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
url: undefined,
skipUrl: undefined,
isEnable: 1,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加轮播图";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getSlideshow(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改轮播图";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateSlideshow(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addSlideshow(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除轮播图编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delSlideshow(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('business/slideshow/export', {
...this.queryParams
}, `slideshow_${new Date().getTime()}.xlsx`)
}
}
};
</script>
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