160 changed files with 5516 additions and 270 deletions
@ -0,0 +1,110 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class IcPublicServiceOrgDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* AGENCY_ID的pids |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 1:实有单位;2:社会服务组织3:志愿团队 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contact; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 中心位置经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 中心位置纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList; |
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 公共服务组织服务事项(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class IcPublicServiceOrgServiceMatterDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@JsonIgnore |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
@JsonIgnore |
|||
private String customerId; |
|||
|
|||
/** |
|||
* ic_public_service_org.ID |
|||
*/ |
|||
@JsonIgnore |
|||
private String orgId; |
|||
|
|||
/** |
|||
* ic_service_item_dict.ID |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 服务事项编码ic_service_item_dict.CATEGORY_CODE |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
@JsonIgnore |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
@JsonIgnore |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
@JsonIgnore |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@JsonIgnore |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
@JsonIgnore |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@JsonIgnore |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 详情页面显示 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
} |
|||
@ -0,0 +1,133 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2023/2/3 15:04 |
|||
*/ |
|||
@Data |
|||
public class IcPublicServiceOrgFormDTO { |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
public interface UpdateUserInternalGroup { |
|||
} |
|||
|
|||
public interface UpdateUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@NotBlank(message = "id为空", groups = UpdateUserInternalGroup.class) |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
@NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
@NotBlank(message = "agencyId不能为空",groups =UpdateUserInternalGroup.class ) |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* AGENCY_ID的pids |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
@Length(max = 100, groups = AddUserShowGroup.class, message = "最多输入100字") |
|||
@NotBlank(message = "名称不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) |
|||
private String name; |
|||
|
|||
/** |
|||
* 1:实有单位;2:社会服务组织3:志愿团队 |
|||
*/ |
|||
@NotBlank(message = "类别不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) |
|||
private String type; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
@NotBlank(message = "联系人不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) |
|||
private String contact; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
@NotBlank(message = "地址不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) |
|||
private String address; |
|||
|
|||
/** |
|||
* 中心位置经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 中心位置纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@Length(max = 500,message = "最多输入500字",groups ={UpdateUserShowGroup.class,AddUserShowGroup.class} ) |
|||
private String remark; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList; |
|||
} |
|||
|
|||
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2023/2/3 16:02 |
|||
*/ |
|||
@Data |
|||
public class IcPublicServiceOrgPageFormDTO extends PageFormDTO { |
|||
private String customerId; |
|||
private String agencyId; |
|||
private String name; |
|||
private List<String> categoryIds; |
|||
private String type; |
|||
private String contact; |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 工作端当前登录人员 |
|||
*/ |
|||
private String currentStaffId; |
|||
} |
|||
|
|||
@ -0,0 +1,87 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2023/2/3 15:52 |
|||
*/ |
|||
@Data |
|||
public class IcPublicServiceOrgDetailResDTO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
|
|||
private String agencyName; |
|||
|
|||
/** |
|||
* AGENCY_ID的pids |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 1:实有单位;2:社会服务组织3:志愿团队 |
|||
*/ |
|||
private String type; |
|||
|
|||
private String typeName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contact; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 中心位置经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 中心位置纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
/** |
|||
* 服务事项名称 |
|||
* 多个,按照英文逗号隔开 |
|||
*/ |
|||
private String serviceMatterName; |
|||
|
|||
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList; |
|||
} |
|||
|
|||
@ -0,0 +1,101 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.constant.AppClientConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.IcPublicServiceOrgFormDTO; |
|||
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; |
|||
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; |
|||
import com.epmet.service.IcPublicServiceOrgService; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icPublicServiceOrg") |
|||
public class IcPublicServiceOrgController { |
|||
|
|||
@Autowired |
|||
private IcPublicServiceOrgService icPublicServiceOrgService; |
|||
|
|||
/** |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@RequestMapping("page") |
|||
public Result<PageData<IcPublicServiceOrgDetailResDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgPageFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
//工作端调用的话,赋值当前登录用户id
|
|||
if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ |
|||
formDTO.setCurrentStaffId(tokenDto.getUserId()); |
|||
} |
|||
PageData<IcPublicServiceOrgDetailResDTO> page = icPublicServiceOrgService.page(formDTO); |
|||
return new Result<PageData<IcPublicServiceOrgDetailResDTO>>().ok(page); |
|||
} |
|||
|
|||
@PostMapping("detail/{id}") |
|||
public Result<IcPublicServiceOrgDetailResDTO> get(@PathVariable("id") String id){ |
|||
IcPublicServiceOrgDetailResDTO data = icPublicServiceOrgService.get(id); |
|||
return new Result<IcPublicServiceOrgDetailResDTO>().ok(data); |
|||
} |
|||
|
|||
/** |
|||
* 新增;名称组织下唯一 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgFormDTO formDTO){ |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setCreatedBy(tokenDto.getUserId()); |
|||
ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.AddUserShowGroup.class, IcPublicServiceOrgFormDTO.AddUserInternalGroup.class); |
|||
icPublicServiceOrgService.save(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcPublicServiceOrgFormDTO formDTO){ |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setCreatedBy(tokenDto.getUserId()); |
|||
ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.UpdateUserShowGroup.class, IcPublicServiceOrgFormDTO.UpdateUserInternalGroup.class); |
|||
icPublicServiceOrgService.update(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 同时删除服务事项表 |
|||
* @param ids |
|||
* @return |
|||
*/ |
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody List<String> ids){ |
|||
if(CollectionUtils.isNotEmpty(ids)){ |
|||
icPublicServiceOrgService.delete(ids); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; |
|||
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; |
|||
import com.epmet.entity.IcPublicServiceOrgEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Mapper |
|||
public interface IcPublicServiceOrgDao extends BaseDao<IcPublicServiceOrgEntity> { |
|||
|
|||
List<IcPublicServiceOrgDetailResDTO> pageList(IcPublicServiceOrgPageFormDTO formDTO); |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; |
|||
import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 公共服务组织服务事项(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Mapper |
|||
public interface IcPublicServiceOrgServiceMatterDao extends BaseDao<IcPublicServiceOrgServiceMatterEntity> { |
|||
|
|||
List<IcPublicServiceOrgServiceMatterDTO> selectServiceMatter(String orgId); |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_public_service_org") |
|||
public class IcPublicServiceOrgEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* AGENCY_ID的pids |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 1:实有单位;2:社会服务组织3:志愿团队 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contact; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 中心位置经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 中心位置纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 公共服务组织服务事项(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_public_service_org_service_matter") |
|||
public class IcPublicServiceOrgServiceMatterEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* ic_public_service_org.ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* ic_service_item_dict.ID |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 服务事项编码ic_service_item_dict.CATEGORY_CODE |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.form.IcPublicServiceOrgFormDTO; |
|||
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; |
|||
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; |
|||
import com.epmet.entity.IcPublicServiceOrgEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
public interface IcPublicServiceOrgService extends BaseService<IcPublicServiceOrgEntity> { |
|||
|
|||
/** |
|||
* 公共服务组织 |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
String save(IcPublicServiceOrgFormDTO dto); |
|||
|
|||
String update(IcPublicServiceOrgFormDTO formDTO); |
|||
|
|||
void delete(List<String> orgIds); |
|||
|
|||
IcPublicServiceOrgDetailResDTO get(String id); |
|||
|
|||
PageData<IcPublicServiceOrgDetailResDTO> page(IcPublicServiceOrgPageFormDTO formDTO); |
|||
} |
|||
@ -0,0 +1,171 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.constant.StrConstant; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.dao.IcPublicServiceOrgDao; |
|||
import com.epmet.dao.IcPublicServiceOrgServiceMatterDao; |
|||
import com.epmet.dto.form.IcPublicServiceOrgFormDTO; |
|||
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; |
|||
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; |
|||
import com.epmet.entity.IcPublicServiceOrgEntity; |
|||
import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; |
|||
import com.epmet.service.IcPublicServiceOrgService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 公共服务组织管理(烟台需求) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Service |
|||
public class IcPublicServiceOrgServiceImpl extends BaseServiceImpl<IcPublicServiceOrgDao, IcPublicServiceOrgEntity> implements IcPublicServiceOrgService { |
|||
@Autowired |
|||
private IcPublicServiceOrgServiceMatterDao icPublicServiceOrgServiceMatterDao; |
|||
|
|||
|
|||
@Transactional(rollbackFor = EpmetException.class) |
|||
@Override |
|||
public String save(IcPublicServiceOrgFormDTO formDto) { |
|||
CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(formDto.getCustomerId(),formDto.getCreatedBy()); |
|||
if(null==staffInfo|| StringUtils.isBlank(staffInfo.getAgencyId())){ |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode()); |
|||
} |
|||
checkUnqiueName(formDto.getName(),staffInfo.getAgencyId(),null); |
|||
formDto.setAgencyId(staffInfo.getAgencyId()); |
|||
formDto.setPids(staffInfo.getAgencyPIds()); |
|||
IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDto,IcPublicServiceOrgEntity.class); |
|||
baseDao.insert(entity); |
|||
if(CollectionUtils.isNotEmpty(formDto.getServiceMatterList())){ |
|||
formDto.getServiceMatterList().forEach(dto->{ |
|||
IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); |
|||
serviceOrgServiceMatterEntity.setOrgId(entity.getId()); |
|||
serviceOrgServiceMatterEntity.setCustomerId(formDto.getCustomerId()); |
|||
icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); |
|||
}); |
|||
} |
|||
return entity.getId(); |
|||
} |
|||
|
|||
/** |
|||
* |
|||
* @param name |
|||
* @param agencyId |
|||
* @param id |
|||
*/ |
|||
private void checkUnqiueName(String name, String agencyId, String id) { |
|||
LambdaQueryWrapper<IcPublicServiceOrgEntity> queryWrapper=new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(IcPublicServiceOrgEntity::getName,name) |
|||
.eq(IcPublicServiceOrgEntity::getAgencyId,agencyId) |
|||
.ne(StringUtils.isNotBlank(id),IcPublicServiceOrgEntity::getId,id); |
|||
int count=baseDao.selectCount(queryWrapper); |
|||
if(count>0){ |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"名称已存在","名称已存在"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = EpmetException.class) |
|||
@Override |
|||
public String update(IcPublicServiceOrgFormDTO formDTO) { |
|||
checkUnqiueName(formDTO.getName(),formDTO.getAgencyId(),formDTO.getId()); |
|||
IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDTO,IcPublicServiceOrgEntity.class); |
|||
baseDao.updateById(entity); |
|||
//先删除
|
|||
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>(); |
|||
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId()); |
|||
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); |
|||
if(CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())){ |
|||
formDTO.getServiceMatterList().forEach(dto->{ |
|||
IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); |
|||
serviceOrgServiceMatterEntity.setOrgId(entity.getId()); |
|||
serviceOrgServiceMatterEntity.setCustomerId(formDTO.getCustomerId()); |
|||
icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); |
|||
}); |
|||
} |
|||
return entity.getId(); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = EpmetException.class) |
|||
@Override |
|||
public void delete(List<String> orgIds) { |
|||
orgIds.forEach(orgId->{ |
|||
baseDao.deleteById(orgId); |
|||
//先删除
|
|||
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>(); |
|||
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,orgId); |
|||
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); |
|||
}); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public IcPublicServiceOrgDetailResDTO get(String id) { |
|||
IcPublicServiceOrgEntity entity = baseDao.selectById(id); |
|||
if (null == entity) { |
|||
return null; |
|||
} |
|||
IcPublicServiceOrgDetailResDTO result = ConvertUtils.sourceToTarget(entity, IcPublicServiceOrgDetailResDTO.class); |
|||
// 1:实有单位;2:社会服务组织3:志愿团队
|
|||
if(NumConstant.ONE_STR.equals(result.getType())){ |
|||
result.setTypeName("实有单位"); |
|||
}else if(NumConstant.TWO_STR.equals(result.getType())){ |
|||
result.setTypeName("社会服务组织"); |
|||
}else if(NumConstant.THREE_STR.equals(result.getType())){ |
|||
result.setTypeName("志愿团队"); |
|||
} |
|||
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(result.getAgencyId()); |
|||
if (null != agencyInfoCache) { |
|||
result.setAgencyName(agencyInfoCache.getOrganizationName()); |
|||
} |
|||
result.setServiceMatterList(icPublicServiceOrgServiceMatterDao.selectServiceMatter(id)); |
|||
List<String> nameList=result.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); |
|||
if(CollectionUtils.isNotEmpty(nameList)){ |
|||
result.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
|
|||
|
|||
@Override |
|||
public PageData<IcPublicServiceOrgDetailResDTO> page(IcPublicServiceOrgPageFormDTO formDTO) { |
|||
if (StringUtils.isNotBlank(formDTO.getCurrentStaffId()) && StringUtils.isBlank(formDTO.getAgencyId())) { |
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); |
|||
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|||
} |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|||
List<IcPublicServiceOrgDetailResDTO> list = baseDao.pageList(formDTO); |
|||
PageInfo<IcPublicServiceOrgDetailResDTO> pageInfo = new PageInfo<>(list); |
|||
list.forEach(item -> { |
|||
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(item.getAgencyId()); |
|||
item.setAgencyName(null != agencyInfoCache ? agencyInfoCache.getOrganizationName() : StrConstant.EPMETY_STR); |
|||
List<String> nameList=item.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); |
|||
if(CollectionUtils.isNotEmpty(nameList)){ |
|||
item.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); |
|||
} |
|||
}); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
CREATE TABLE `ic_public_service_org` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
|||
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', |
|||
`PIDS` varchar(255) NOT NULL COMMENT 'AGENCY_ID的pids', |
|||
`NAME` varchar(128) NOT NULL COMMENT '名称', |
|||
`TYPE` varchar(64) NOT NULL COMMENT '1:实有单位;2:社会服务组织3:志愿团队', |
|||
`CONTACT` varchar(32) NOT NULL COMMENT '联系人', |
|||
`CONTACT_MOBILE` varchar(32) NOT NULL COMMENT '联系电话', |
|||
`ADDRESS` varchar(255) NOT NULL COMMENT '地址', |
|||
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置经度', |
|||
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置纬度', |
|||
`REMARK` varchar(512) DEFAULT NULL COMMENT '备注', |
|||
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', |
|||
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织管理(烟台需求)'; |
|||
|
|||
|
|||
|
|||
CREATE TABLE `ic_public_service_org_service_matter` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
|||
`ORG_ID` varchar(64) NOT NULL COMMENT 'ic_public_service_org.ID', |
|||
`CATEGORY_ID` varchar(64) NOT NULL COMMENT 'ic_service_item_dict.ID', |
|||
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '服务事项编码ic_service_item_dict.CATEGORY_CODE', |
|||
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', |
|||
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织服务事项(烟台需求)'; |
|||
@ -0,0 +1,81 @@ |
|||
<?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.epmet.dao.IcPublicServiceOrgDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IcPublicServiceOrgEntity" id="icPublicServiceOrgMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="type" column="TYPE"/> |
|||
<result property="contact" column="CONTACT"/> |
|||
<result property="contactMobile" column="CONTACT_MOBILE"/> |
|||
<result property="address" column="ADDRESS"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<resultMap id="IcPublicServiceOrgDetailResDTOMap" type="com.epmet.dto.result.IcPublicServiceOrgDetailResDTO"> |
|||
<result property="id" column="ID"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="type" column="TYPE"/> |
|||
<result property="typeName" column="typeName"/> |
|||
<result property="contact" column="CONTACT"/> |
|||
<result property="contactMobile" column="CONTACT_MOBILE"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<collection property="serviceMatterList" ofType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO" |
|||
select="com.epmet.dao.IcPublicServiceOrgServiceMatterDao.selectServiceMatter" column="ID"> |
|||
</collection> |
|||
</resultMap> |
|||
|
|||
<select id="pageList" parameterType="com.epmet.dto.form.IcPublicServiceOrgPageFormDTO" resultMap="IcPublicServiceOrgDetailResDTOMap"> |
|||
SELECT |
|||
distinct o.ID, |
|||
o.`NAME`, |
|||
o.AGENCY_ID, |
|||
o.TYPE, |
|||
( CASE WHEN o.type = '1' THEN '实有单位' WHEN o.type = '2' THEN '社会服务组织' WHEN o.type = '3' THEN '志愿团队' end) AS typeName, |
|||
o.CONTACT, |
|||
o.CONTACT_MOBILE, |
|||
o.REMARK |
|||
FROM |
|||
ic_public_service_org o |
|||
LEFT JOIN ic_public_service_org_service_matter m ON ( o.id = m.ORG_ID and m.del_flag='0') |
|||
LEFT JOIN ic_service_item_dict d ON ( m.CATEGORY_ID = d.ID and m.CUSTOMER_ID=d.CUSTOMER_ID) |
|||
WHERE |
|||
o.DEL_FLAG = '0' |
|||
and o.CUSTOMER_ID=#{customerId} |
|||
<if test='null != agencyId and "" != agencyId'> |
|||
AND ( o.AGENCY_ID = #{agencyId} OR o.PIDS LIKE concat( '%', #{agencyId}, '%' )) |
|||
</if> |
|||
<if test='null != name and "" != name'> |
|||
AND o.`NAME` LIKE concat( '%', #{name}, '%' ) |
|||
</if> |
|||
<if test="null != categoryIds and categoryIds.size() > 0"> |
|||
<foreach collection="categoryIds" item="categoryId" open="AND (" separator="or" close=")"> |
|||
m.CATEGORY_ID = #{categoryId} |
|||
</foreach> |
|||
</if> |
|||
<if test='null != type and "" != type'> |
|||
AND o.TYPE = #{type} |
|||
</if> |
|||
<if test='null != contact and "" != contact'> |
|||
AND o.CONTACT LIKE concat( '%', #{contact}, '%' ) |
|||
</if> |
|||
<if test='null != contactMobile and "" != contactMobile'> |
|||
AND o.CONTACT_MOBILE like concat( '%', #{contactMobile}, '%' ) |
|||
</if> |
|||
ORDER BY |
|||
o.CREATED_TIME DESC |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,30 @@ |
|||
<?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.epmet.dao.IcPublicServiceOrgServiceMatterDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IcPublicServiceOrgServiceMatterEntity" id="icPublicServiceOrgServiceMatterMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgId" column="ORG_ID"/> |
|||
<result property="categoryId" column="CATEGORY_ID"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="selectServiceMatter" parameterType="java.lang.String" resultType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO"> |
|||
SELECT |
|||
m.*, |
|||
i.CATEGORY_NAME |
|||
FROM |
|||
ic_public_service_org_service_matter m |
|||
LEFT JOIN ic_service_item_dict i ON ( m.CATEGORY_ID = i.ID ) |
|||
WHERE m.del_flag='0' |
|||
and m.ORG_ID = #{orgId} |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,112 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class ThirdAppManageDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
@NotBlank(message = "应用名称不能为空") |
|||
private String name; |
|||
|
|||
/** |
|||
* 应用链接 |
|||
*/ |
|||
@NotBlank(message = "应用链接不能为空") |
|||
private String link; |
|||
|
|||
/** |
|||
* 账号 |
|||
*/ |
|||
@NotBlank(message = "测试账号不能为空") |
|||
private String account; |
|||
|
|||
/** |
|||
* 密码 |
|||
*/ |
|||
@NotBlank(message = "测试密码不能为空") |
|||
private String password; |
|||
|
|||
/** |
|||
* 应用介绍 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
@NotBlank(message = "联系人不能为空") |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空") |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除 1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.service.ThirdAppManageService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("thirdAppManage") |
|||
public class ThirdAppManageController { |
|||
|
|||
@Autowired |
|||
private ThirdAppManageService thirdAppManageService; |
|||
|
|||
@PostMapping("page") |
|||
public Result<PageData<ThirdAppManageDTO>> page(@RequestBody ThirdAppManageFormDTO formDTO){ |
|||
PageData<ThirdAppManageDTO> page = thirdAppManageService.page(formDTO); |
|||
return new Result<PageData<ThirdAppManageDTO>>().ok(page); |
|||
} |
|||
|
|||
@PostMapping("detail/{id}") |
|||
public Result<ThirdAppManageDTO> get(@PathVariable("id") String id){ |
|||
ThirdAppManageDTO data = thirdAppManageService.get(id); |
|||
return new Result<ThirdAppManageDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
thirdAppManageService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @Param dto |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:18 |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("audit") |
|||
public Result audit(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
thirdAppManageService.audit(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @Param dto |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:18 |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("release") |
|||
public Result release(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
thirdAppManageService.release(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Mapper |
|||
public interface ThirdAppManageDao extends BaseDao<ThirdAppManageEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("third_app_manage") |
|||
public class ThirdAppManageEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 应用链接 |
|||
*/ |
|||
private String link; |
|||
|
|||
/** |
|||
* 账号 |
|||
*/ |
|||
private String account; |
|||
|
|||
/** |
|||
* 密码 |
|||
*/ |
|||
private String password; |
|||
|
|||
/** |
|||
* 应用介绍 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
|
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
public interface ThirdAppManageService extends BaseService<ThirdAppManageEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param formDTO |
|||
* @return PageData<ThirdAppManageDTO> |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ThirdAppManageDTO |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
ThirdAppManageDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
void save(ThirdAppManageDTO dto); |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
void audit(ThirdAppManageDTO dto); |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
void release(ThirdAppManageDTO dto); |
|||
} |
|||
@ -0,0 +1,112 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.dao.ThirdAppManageDao; |
|||
import com.epmet.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
import com.epmet.service.ThirdAppManageService; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.github.pagehelper.page.PageMethod; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Service |
|||
public class ThirdAppManageServiceImpl extends BaseServiceImpl<ThirdAppManageDao, ThirdAppManageEntity> implements ThirdAppManageService { |
|||
|
|||
@Override |
|||
public PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO) { |
|||
PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|||
LambdaQueryWrapper<ThirdAppManageEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile()); |
|||
wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus()); |
|||
wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime); |
|||
List<ThirdAppManageEntity> list = baseDao.selectList(wrapper); |
|||
PageInfo<ThirdAppManageEntity> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public ThirdAppManageDTO get(String id) { |
|||
ThirdAppManageEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @param dto |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
@Override |
|||
public void audit(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity info = baseDao.selectById(dto.getId()); |
|||
if (!NumConstant.ZERO_STR.equals(info.getStatus())) { |
|||
String errorMsg = "应用已审核"; |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|||
} |
|||
|
|||
ThirdAppManageEntity entity = new ThirdAppManageEntity(); |
|||
entity.setId(dto.getId()); |
|||
entity.setStatus(dto.getStatus()); |
|||
baseDao.updateById(entity); |
|||
} |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @param dto |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
@Override |
|||
public void release(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity info = baseDao.selectById(dto.getId()); |
|||
if (NumConstant.ZERO_STR.equals(info.getStatus())) { |
|||
String errorMsg = "应用未审核,请先审核"; |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|||
} else if (NumConstant.ONE_STR.equals(info.getStatus())) { |
|||
String errorMsg = "应用审核不通过,不能发布"; |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|||
} else if (NumConstant.THREE_STR.equals(info.getStatus())) { |
|||
String errorMsg = "应用已发布"; |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|||
} |
|||
|
|||
ThirdAppManageEntity entity = new ThirdAppManageEntity(); |
|||
entity.setId(dto.getId()); |
|||
entity.setStatus(NumConstant.THREE_STR); |
|||
baseDao.updateById(entity); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
CREATE TABLE `third_app_manage` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'id', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`NAME` varchar(64) NOT NULL COMMENT '应用名称', |
|||
`LINK` varchar(128) NOT NULL COMMENT '应用链接', |
|||
`ACCOUNT` varchar(64) NOT NULL COMMENT '账号', |
|||
`PASSWORD` varchar(64) NOT NULL COMMENT '密码', |
|||
`REMARK` text COMMENT '应用介绍', |
|||
`COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名', |
|||
`CONTACTS` varchar(64) NOT NULL COMMENT '联系人', |
|||
`MOBILE` varchar(32) NOT NULL COMMENT '联系电话', |
|||
`STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】', |
|||
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', |
|||
`DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', |
|||
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', |
|||
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', |
|||
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理'; |
|||
@ -0,0 +1,27 @@ |
|||
<?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.epmet.dao.ThirdAppManageDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.ThirdAppManageEntity" id="thirdAppManageMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="link" column="LINK"/> |
|||
<result property="account" column="ACCOUNT"/> |
|||
<result property="password" column="PASSWORD"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="companyName" column="COMPANY_NAME"/> |
|||
<result property="contacts" column="CONTACTS"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,100 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Data |
|||
public class IssueCommentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 评论内容至多200字 |
|||
*/ |
|||
@Length(max = 200,message = "评论内容最多输入200字",groups = AddUserShowGroup.class) |
|||
@NotBlank(message = "content不能为空",groups = AddUserInternalGroup.class) |
|||
private String content; |
|||
|
|||
/** |
|||
* 评论用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 头像 |
|||
*/ |
|||
private String headPhoto; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
private String commentId; |
|||
|
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2023/2/2 13:45 |
|||
*/ |
|||
@Data |
|||
public class IssueCommentPageFormDTO extends PageFormDTO { |
|||
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) |
|||
private String issueId; |
|||
} |
|||
|
|||
@ -0,0 +1,61 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.IssueCommentDTO; |
|||
import com.epmet.dto.form.IssueCommentPageFormDTO; |
|||
import com.epmet.service.IssueCommentService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* 目前只有烟台客户,钉钉居民端,议事厅,可以发表评论 |
|||
* 产品没有此功能 |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("issuecomment") |
|||
public class IssueCommentController { |
|||
|
|||
@Autowired |
|||
private IssueCommentService issueCommentService; |
|||
|
|||
/** |
|||
* 议题评论列表 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@RequestMapping("page") |
|||
public Result<PageData<IssueCommentDTO>> page(@RequestBody IssueCommentPageFormDTO formDTO){ |
|||
PageData<IssueCommentDTO> page = issueCommentService.page(formDTO); |
|||
return new Result<PageData<IssueCommentDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* 议题评论 |
|||
* @param tokenDto |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IssueCommentDTO dto){ |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
ValidatorUtils.validateEntity(dto,IssueCommentDTO.AddUserShowGroup.class,IssueCommentDTO.AddUserInternalGroup.class); |
|||
issueCommentService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.IssueCommentDTO; |
|||
import com.epmet.entity.IssueCommentEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Mapper |
|||
public interface IssueCommentDao extends BaseDao<IssueCommentEntity> { |
|||
|
|||
List<IssueCommentDTO> selectCommentList(String issueId); |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("issue_comment") |
|||
public class IssueCommentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 评论内容至多200字 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 评论用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 头像 |
|||
*/ |
|||
private String headPhoto; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.IssueCommentDTO; |
|||
import com.epmet.dto.form.IssueCommentPageFormDTO; |
|||
import com.epmet.entity.IssueCommentEntity; |
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
public interface IssueCommentService extends BaseService<IssueCommentEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param formDTO |
|||
* @return PageData<IssueCommentDTO> |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO); |
|||
|
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
void save(IssueCommentDTO dto); |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dao.IssueCommentDao; |
|||
import com.epmet.dto.IssueCommentDTO; |
|||
import com.epmet.dto.form.IssueCommentPageFormDTO; |
|||
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|||
import com.epmet.entity.IssueCommentEntity; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.service.IssueCommentService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 议题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class IssueCommentServiceImpl extends BaseServiceImpl<IssueCommentDao, IssueCommentEntity> implements IssueCommentService { |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient userOpenFeignClient; |
|||
|
|||
/** |
|||
* 议题评论列表 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|||
List<IssueCommentDTO> list = baseDao.selectCommentList(formDTO.getIssueId()); |
|||
PageInfo<IssueCommentDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* 议题评论 |
|||
* 需求来源于烟台:https://modao.cc/app/Uz9nPVerhvcupzLnhoiY#screen=sl8mfpxd863xmb5
|
|||
* @param dto |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IssueCommentDTO dto) { |
|||
//查询用户信息
|
|||
List<String> userIdList=new ArrayList<>(); |
|||
userIdList.add(dto.getUserId()); |
|||
Result<List<UserBaseInfoResultDTO>> userInfoRes= userOpenFeignClient.queryUserBaseInfo(userIdList); |
|||
if(!userInfoRes.success()|| CollectionUtils.isEmpty(userInfoRes.getData())){ |
|||
log.error("议题评论查询用户信息异常userId: "+dto.getUserId()); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询用户信息异常userId:"+dto.getUserId(),"查询用户信息异常"); |
|||
} |
|||
IssueCommentEntity entity = ConvertUtils.sourceToTarget(dto, IssueCommentEntity.class); |
|||
entity.setHeadPhoto(userInfoRes.getData().get(NumConstant.ZERO).getHeadImgUrl()); |
|||
entity.setUserName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); |
|||
insert(entity); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
CREATE TABLE `issue_comment` ( |
|||
`ID` varchar(32) NOT NULL COMMENT '主键ID', |
|||
`ISSUE_ID` varchar(32) NOT NULL COMMENT '议题ID', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`CONTENT` varchar(255) NOT NULL COMMENT '评论内容至多200字', |
|||
`USER_ID` varchar(64) NOT NULL COMMENT '评论用户id', |
|||
`USER_NAME` varchar(64) DEFAULT NULL COMMENT '姓名', |
|||
`HEAD_PHOTO` varchar(255) DEFAULT NULL COMMENT '头像', |
|||
`DEL_FLAG` varchar(2) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='议题评论表'; |
|||
@ -0,0 +1,36 @@ |
|||
<?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.epmet.dao.IssueCommentDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IssueCommentEntity" id="issueCommentMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="issueId" column="ISSUE_ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="content" column="CONTENT"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="userName" column="USER_NAME"/> |
|||
<result property="headPhoto" column="HEAD_PHOTO"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
<select id="selectCommentList" parameterType="java.lang.String" resultType="com.epmet.dto.IssueCommentDTO"> |
|||
SELECT |
|||
ic.id as commentId, |
|||
ic.* |
|||
FROM |
|||
issue_comment ic |
|||
WHERE |
|||
ic.DEL_FLAG = '0' |
|||
AND ic.ISSUE_ID = #{issueId} |
|||
ORDER BY |
|||
ic.CREATED_TIME DESC |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,8 @@ |
|||
alter table ic_property_management add COLUMN `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户id' after NAME; |
|||
|
|||
|
|||
update ic_property_management p,ic_neighbor_hood_property pr,ic_neighbor_hood h |
|||
set p.CUSTOMER_ID=h.CUSTOMER_ID |
|||
where p.DEL_FLAG='0' |
|||
and p.id=pr.PROPERTY_ID |
|||
and pr.NEIGHBOR_HOOD_ID=h.id; |
|||
@ -0,0 +1,2 @@ |
|||
ALTER TABLE `epmet_gov_org`.`customer_agency` |
|||
ADD COLUMN `REMARK` varchar(512) NULL COMMENT '备注说明' AFTER `REVISION`; |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Mapper |
|||
public interface GuideReaderDao extends BaseDao<GuideReaderEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("guide_reader") |
|||
public class GuideReaderEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 办事指南id |
|||
*/ |
|||
private String guideId; |
|||
|
|||
/** |
|||
* 用户id;进入过办事指南详情就算是已读 |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 工作端:gov;居民端:resi |
|||
*/ |
|||
private String userType; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
public interface GuideReaderService extends BaseService<GuideReaderEntity> { |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param guideId |
|||
* @param userId |
|||
* @return GuideReaderDTO |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
GuideReaderEntity get(String guideId,String userId); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2023-02-02 |
|||
*/ |
|||
void save(GuideReaderEntity dto); |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.dao.GuideReaderDao; |
|||
import com.epmet.entity.GuideReaderEntity; |
|||
import com.epmet.service.GuideReaderService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
/** |
|||
* 办事指南阅读记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-02 |
|||
*/ |
|||
@Service |
|||
public class GuideReaderServiceImpl extends BaseServiceImpl<GuideReaderDao, GuideReaderEntity> implements GuideReaderService { |
|||
|
|||
@Override |
|||
public GuideReaderEntity get(String guideId,String userId) { |
|||
LambdaQueryWrapper<GuideReaderEntity> queryWrapper=new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(GuideReaderEntity::getGuideId,guideId) |
|||
.eq(GuideReaderEntity::getUserId,userId); |
|||
GuideReaderEntity entity = baseDao.selectOne(queryWrapper); |
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(GuideReaderEntity entity) { |
|||
insert(entity); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
CREATE TABLE `guide_reader` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'ID', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南id', |
|||
`USER_ID` varchar(64) NOT NULL COMMENT '用户id;进入过办事指南详情就算是已读', |
|||
`USER_TYPE` varchar(10) NOT NULL COMMENT '工作端:gov;居民端:resi', |
|||
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='办事指南阅读记录'; |
|||
@ -0,0 +1,21 @@ |
|||
<?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.epmet.dao.GuideReaderDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.GuideReaderEntity" id="guideReaderMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="guideId" column="GUIDE_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="userType" column="USER_TYPE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,95 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,关联resi_topic的id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,109 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String topicCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,来自resi_topic |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 评论状态:讨论中:discussing;已屏蔽 :hidden |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人,评论人Id,来自user |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,125 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 关闭状态:已解决 resolved,未解决 unresolved |
|||
*/ |
|||
private String closedStatus; |
|||
|
|||
/** |
|||
* 省 |
|||
*/ |
|||
private String province; |
|||
|
|||
/** |
|||
* 市 |
|||
*/ |
|||
private String city; |
|||
|
|||
/** |
|||
* 区 |
|||
*/ |
|||
private String area; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 定位地址 |
|||
*/ |
|||
private String locateAddress; |
|||
|
|||
/** |
|||
* 定位经度 |
|||
*/ |
|||
private String locateLongitude; |
|||
|
|||
/** |
|||
* 定位维度 |
|||
*/ |
|||
private String locateLatitude; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人,发布人Id来源于user |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 话题表决记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicVoteDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题ID |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 态度 - opposition(反对)support(赞成) |
|||
*/ |
|||
private String attitude; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:17 |
|||
*/ |
|||
@Data |
|||
public class CreateYtTopicFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
@NotBlank(message = "customerId不能为空",groups =AddUserInternalGroup.class ) |
|||
private String customerId; |
|||
|
|||
@NotBlank(message ="网格不能为空",groups =AddUserShowGroup.class ) |
|||
private String gridId; |
|||
|
|||
@Length(max=3000,message ="话题内容最多输入3000字",groups =AddUserShowGroup.class ) |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 经度 |
|||
* */ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
* */ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 地址 |
|||
* */ |
|||
@NotBlank(message = "地址信息不能为空") |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
* */ |
|||
private String locateLongitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
* */ |
|||
private String locateLatitude; |
|||
|
|||
/** |
|||
* 地址 |
|||
* */ |
|||
private String locateAddress; |
|||
|
|||
/** |
|||
* 省份 |
|||
* */ |
|||
private String province; |
|||
|
|||
/** |
|||
* 城市 |
|||
* */ |
|||
private String city; |
|||
|
|||
/** |
|||
* 地区 |
|||
* */ |
|||
private String area; |
|||
|
|||
/** |
|||
* 图片附件 |
|||
*/ |
|||
private List<String> imageList; |
|||
// /**
|
|||
// * 文件附件
|
|||
// */
|
|||
// private List<FileDTO> docList;
|
|||
/** |
|||
* 语音附件 |
|||
*/ |
|||
private List<FileDTO> voiceList; |
|||
// /**
|
|||
// * 视频附件
|
|||
// */
|
|||
// private List<FileDTO> videoList;
|
|||
/** |
|||
* tokenDto.getUserId |
|||
*/ |
|||
@NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class ) |
|||
private String userId; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiPublishCommentFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.31 17:32 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "话题Id不能为空") |
|||
private String topicId; |
|||
|
|||
//@NotBlank(message = "评论内容不能为空")
|
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 图片附件集合 |
|||
*/ |
|||
private List<NoticeFileDTO> imageList; |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiTopicDetailFormDTO |
|||
* @Author wangc |
|||
* @date 2020.04.07 09:07 |
|||
*/ |
|||
@Data |
|||
public class YtTopicDetailFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
@NotBlank(message = "话题Id不能为空",groups = AddUserShowGroup.class) |
|||
private String topicId; |
|||
|
|||
/** |
|||
* tokenDto.getUserId |
|||
*/ |
|||
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class ) |
|||
private String userId; |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicPageFormDTO extends PageFormDTO implements Serializable{ |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 组织Id |
|||
* */ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格Id,source是居民端时必填 |
|||
* */ |
|||
@NotBlank(message = "网格Id不能为空") |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 搜索时可以带状态的查询,也可以不带 |
|||
* */ |
|||
private String status; |
|||
|
|||
/** |
|||
* 用户Id |
|||
* */ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 请求来源0 居民端,1 PC端 |
|||
* */ |
|||
private String source; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
* */ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题发表人 |
|||
* */ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
* */ |
|||
private String startDate; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
* */ |
|||
private String endDate; |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiPublishCommentFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.31 17:32 |
|||
*/ |
|||
@Data |
|||
public class YtTopicVoteFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "话题Id不能为空") |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 态度opposition(反对)support(赞成) |
|||
*/ |
|||
@NotBlank(message = "投票结果不能为空") |
|||
private String attitude; |
|||
|
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiCommentResultDTO |
|||
* @Author wangc |
|||
* @date 2020.04.01 17:07 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 评论Id |
|||
* */ |
|||
private String commentId; |
|||
|
|||
/** |
|||
* 评论内容 |
|||
* */ |
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 评论者头像 |
|||
* */ |
|||
private String commentUserHeadPhoto; |
|||
|
|||
/** |
|||
* 评论者姓名 |
|||
* */ |
|||
private String commentUserName; |
|||
|
|||
/** |
|||
* 用户Id 评论者Id |
|||
* */ |
|||
@JsonIgnore |
|||
private String userId; |
|||
|
|||
/** |
|||
* 评论时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
@JSONField(format="yyyy-MM-dd HH:mm") |
|||
private Date commentTime; |
|||
|
|||
/** |
|||
* 评论状态 |
|||
* */ |
|||
private String commentStatus; |
|||
|
|||
/** |
|||
* 图片附件集合 |
|||
*/ |
|||
private List<CommentFileDTO> imageList = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.epmet.resi.group.dto.topic.form.FileDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicDetailResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -6790536784979922200L; |
|||
|
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
private String topicId; |
|||
|
|||
|
|||
/** |
|||
* 发布人名称 |
|||
* */ |
|||
private String releaseUserName; |
|||
|
|||
/** |
|||
* 发布人头像 |
|||
* */ |
|||
private String releaseUserHeadPhoto; |
|||
|
|||
/** |
|||
* 发布时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
private String releaseTime; |
|||
|
|||
/** |
|||
* 发布地址 |
|||
* */ |
|||
private String releaseAddress; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
* */ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态 |
|||
* */ |
|||
private String topicStatus; |
|||
|
|||
/** |
|||
* 图片访问地址 |
|||
* */ |
|||
private List<String> topicImages; |
|||
|
|||
/** |
|||
* 话题语音详情 |
|||
* */ |
|||
private List<FileDTO> topicVoices; |
|||
|
|||
/** |
|||
* 本人投票状态opposition(反对)support(赞成) none(未投票) |
|||
* */ |
|||
private String voteStatus; |
|||
/** |
|||
* 投票支持数 |
|||
* */ |
|||
private String supportCount; |
|||
/** |
|||
* 投票反对数 |
|||
* */ |
|||
private String oppositionCount; |
|||
private String userName; |
|||
private String gridName; |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7029232911456325417L; |
|||
|
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 用户Id 话题发布人 |
|||
* */ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 发布人名称 |
|||
* */ |
|||
private String releaseUserName; |
|||
private String userName; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格名 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 发布人头像 |
|||
* */ |
|||
private String releaseUserHeadPhoto; |
|||
|
|||
/** |
|||
* 发布时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
@JSONField(format="yyyy-MM-dd HH:mm") |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
* */ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态 讨论中 已关闭 |
|||
* */ |
|||
private String status; |
|||
|
|||
/** |
|||
* 是否本人 me other |
|||
* */ |
|||
private String releaseUserFlag; |
|||
|
|||
/** |
|||
* 第一张图片 |
|||
* */ |
|||
private List<String> imageList; |
|||
|
|||
} |
|||
@ -0,0 +1,142 @@ |
|||
package com.epmet.modules.topic.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.annotation.MaskResponse; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.modules.topic.service.YtTopicService; |
|||
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.form.*; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("ytTopic") |
|||
public class YtTopicController { |
|||
|
|||
@Autowired |
|||
private YtTopicService ytTopicService; |
|||
|
|||
/** |
|||
* 发布话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:32 |
|||
*/ |
|||
@PostMapping("createTopic") |
|||
@NoRepeatSubmit |
|||
public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateYtTopicFormDTO formDTO) { |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO,CreateYtTopicFormDTO.AddUserShowGroup.class,CreateYtTopicFormDTO.AddUserInternalGroup.class); |
|||
ytTopicService.createTopic(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 话题详情 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicDetailFormDTO |
|||
* @Return {@link Result< YtTopicDetailResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:39 |
|||
*/ |
|||
@PostMapping("topicDetail") |
|||
public Result<YtTopicDetailResultDTO> getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO topicDetailFormDTO) { |
|||
topicDetailFormDTO.setUserId(tokenDto.getUserId()); |
|||
ValidatorUtils.validateEntity(topicDetailFormDTO,YtTopicDetailFormDTO.AddUserShowGroup.class,YtTopicDetailFormDTO.AddUserInternalGroup.class); |
|||
return new Result<YtTopicDetailResultDTO>().ok(ytTopicService.getTopicDetail(topicDetailFormDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 话题列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicPageFormDTO |
|||
* @Return {@link Result< PageData< YtTopicInfoResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:55 |
|||
*/ |
|||
@PostMapping("topicList") |
|||
@MaskResponse(fieldNames = "userName", fieldsMaskType = {MaskResponse.MASK_TYPE_CHINESE_NAME}) |
|||
public Result<PageData<YtTopicInfoResultDTO>> getTopicList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicPageFormDTO topicPageFormDTO) { |
|||
topicPageFormDTO.setUserId(tokenDto.getUserId()); |
|||
if (NumConstant.ZERO_STR.equals(topicPageFormDTO.getSource())) { |
|||
ValidatorUtils.validateEntity(topicPageFormDTO); |
|||
} |
|||
return new Result<PageData<YtTopicInfoResultDTO>>().ok(ytTopicService.getTopicList(tokenDto, topicPageFormDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 话题详情评论列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param queryCommentFormDTO |
|||
* @Return {@link Result<List<ResiCommentResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:57 |
|||
*/ |
|||
@PostMapping("topicCommentList") |
|||
public Result<PageData<YtTopicCommentResultDTO>> getTopiCommentList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
return new Result<PageData<YtTopicCommentResultDTO>>().ok(ytTopicService.getTopicCommentList(tokenDto, formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 评论话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:06 |
|||
*/ |
|||
@PostMapping("topicComment") |
|||
@NoRepeatSubmit |
|||
public Result topiComment(@LoginUser TokenDto tokenDto, @RequestBody YtTopicCommentFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
ytTopicService.topicComment(tokenDto, formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 话题投票 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:08 |
|||
*/ |
|||
@PostMapping("topicVote") |
|||
@NoRepeatSubmit |
|||
public Result topicVote(@LoginUser TokenDto tokenDto, @RequestBody YtTopicVoteFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
ytTopicService.topicVote(tokenDto, formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicAttachmentEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 烟台话题附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicAttachmentDao extends BaseDao<YtTopicAttachmentEntity> { |
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue