Browse Source

Merge branch 'develop' of gitadmin/tuoheng_qmhh into release

tags/V1.6.0
xuziqing 1 year ago
parent
commit
6b7336b13f
5 changed files with 249 additions and 51 deletions
  1. +140
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Tenant.java
  2. +16
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/TenantMapper.java
  3. +15
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/ITenantService.java
  4. +57
    -51
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/FeedbackServiceImpl.java
  5. +21
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/TenantServiceImpl.java

+ 140
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Tenant.java View File

@@ -0,0 +1,140 @@
package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
* <p>
* 企业管理表
* </p>
*
* @author 拓恒
* @since 2022-07-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_tenant")
public class Tenant extends BaseEntity implements Serializable {

private static final long serialVersionUID = 1L;

/**
* 租户名称
*/
private String name;

/**
* 租户编号
*/
private String code;

/**
* 租户账号
*/
private String username;

/**
* 租户LOGO
*/
private String logo;

/**
* 上级ID
*/
private Integer pid;

/**
* 租户类型:1政府 2企业 3组织
*/
private Integer type;

/**
* 租户电话
*/
private String phone;

/**
* 租户邮箱
*/
private String email;

/**
* 省份编号
*/
private String provinceCode;

/**
* 省份名称
*/
private String provinceName;

/**
* 市区编号
*/
private String cityCode;

/**
* 市区名称
*/
private String cityName;

/**
* 区县编号
*/
private String districtCode;

/**
* 区县名称
*/
private String districtName;

/**
* 平台名称
*/
private String platformName;

/**
* 机场平台url
*/
private String airportUrl;

/**
* 详细地址
*/
private String address;

/**
* 租户简介
*/
private String intro;

/**
* 状态:1正常 2禁用
*/
private Integer status;

/**
* 备注
*/
private String note;

/**
* 排序号
*/
private Integer sort;
/**
* 租户头像url
*/
private String portraitUrl;

private String password;

private Integer roleId;

}

+ 16
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/TenantMapper.java View File

@@ -0,0 +1,16 @@
package com.tuoheng.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.api.entity.domain.Tenant;

/**
* <p>
* 企业管理表 Mapper 接口
* </p>
*
* @author 拓恒
* @since 2022-07-15
*/
public interface TenantMapper extends BaseMapper<Tenant> {

}

+ 15
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/ITenantService.java View File

@@ -0,0 +1,15 @@
package com.tuoheng.api.service;

import com.tuoheng.api.entity.domain.Tenant;
import com.tuoheng.common.common.IBaseService;

/**
* <p>
* 企业管理表 服务类
* </p>
*
* @author 拓恒
* @since 2022-07-15
*/
public interface ITenantService extends IBaseService<Tenant> {
}

+ 57
- 51
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/FeedbackServiceImpl.java View File

@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.api.entity.domain.Feedback;
import com.tuoheng.api.entity.domain.Stream;
import com.tuoheng.api.entity.domain.Tenant;
import com.tuoheng.api.entity.domain.User;
import com.tuoheng.api.entity.request.FeedbackQuery;
import com.tuoheng.api.mapper.FeedbackMapper;
import com.tuoheng.api.mapper.StreamMapper;
import com.tuoheng.api.mapper.TenantMapper;
import com.tuoheng.api.mapper.UserMapper;
import com.tuoheng.api.service.IFeedbackService;
import com.tuoheng.common.common.BaseServiceImpl;
@@ -41,22 +43,24 @@ public class FeedbackServiceImpl extends BaseServiceImpl<FeedbackMapper, Feedbac

@Autowired
private UserMapper userMapper;
@Autowired
private TenantMapper tenantMapper;


@Override
public JsonResult submit(Feedback feedback) {
if(StringUtils.isEmpty(feedback.getOpenid())){
if (StringUtils.isEmpty(feedback.getOpenid())) {
return JsonResult.error("openid为空");
}
Stream stream = streamMapper.selectById(feedback.getStreamId());

if(ObjectUtil.isNotNull(stream)){
if (ObjectUtil.isNotNull(stream)) {
feedback.setTenantId(stream.getTenantId());
feedback.setStreamName(stream.getName());
feedback.setStreamAdminId(stream.getStreamAdminId());
feedback.setStreamAdminName(stream.getStreamAdminName());
feedback.setType(1);
}else {
} else {
return JsonResult.error("河流信息不存在");
}
return super.add(feedback);
@@ -64,10 +68,10 @@ public class FeedbackServiceImpl extends BaseServiceImpl<FeedbackMapper, Feedbac

@Override
public JsonResult my(FeedbackQuery query) {
if(null == query.getPage() || null == query.getLimit()){
if (null == query.getPage() || null == query.getLimit()) {
return JsonResult.error("分页数据为空");
}
if(StringUtils.isEmpty(query.getOpenid())){
if (StringUtils.isEmpty(query.getOpenid())) {
return JsonResult.error("openid为空");
}

@@ -76,62 +80,64 @@ public class FeedbackServiceImpl extends BaseServiceImpl<FeedbackMapper, Feedbac
IPage<Feedback> pageData = feedbackMapper.selectPage(page, new LambdaQueryWrapper<Feedback>()
.eq(Feedback::getMark, 1)
.eq(Feedback::getOpenid, query.getOpenid())
.eq(Feedback::getType,1)
.eq(Feedback::getType, 1)
.orderByDesc(Feedback::getCreateTime));
pageData.getRecords().stream().map(vo -> {
Stream stream = streamMapper.selectById(vo.getStreamId());
if(StringUtils.isNotNull(stream)){
vo.setStreamImage(CommonUtils.getImageURL(stream.getImage()));
}
if (StringUtils.isNotNull(vo.getStatus())){
if(vo.getStatus()==4){
User user = userMapper.selectById(vo.getStreamAdminId());
//判空
if(StringUtils.isNull(user)){
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"当前反馈问题id"+vo.getId()+"查询不到对应责任河湖长");
Stream stream = streamMapper.selectById(vo.getStreamId());
if (StringUtils.isNotNull(stream)) {
vo.setStreamImage(CommonUtils.getImageURL(stream.getImage()));
}
vo.setRealname(user.getRealname());
}
if(vo.getStatus()==3){
User user = userMapper.selectById(Integer.parseInt(vo.getUpdateUser().toString()));
//判空
if(StringUtils.isNull(user)){
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"当前反馈问题id"+vo.getId()+"查询不到对应责任河湖长");
if (StringUtils.isNotNull(vo.getStatus())) {
if (vo.getStatus() == 4) {
User user = userMapper.selectById(vo.getStreamAdminId());
//判空
if (StringUtils.isNull(user)) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "当前反馈问题id" + vo.getId() + "查询不到对应责任河湖长");
}
vo.setRealname(user.getRealname());
}
if (vo.getStatus() == 3) {
User user = userMapper.selectById(Integer.parseInt(vo.getUpdateUser().toString()));
//判空
if (StringUtils.isNull(user)) {
Tenant tenant = tenantMapper.selectById(Integer.parseInt(vo.getUpdateUser().toString()));
vo.setRealname(tenant.getName());
} else {
vo.setRealname(user.getRealname());
}
} else if (vo.getStatus() == 1 || vo.getStatus() == 2) {
vo.setHandleTime(null);
}
}
vo.setRealname(user.getRealname());
}else if(vo.getStatus()==1 || vo.getStatus()==2){
vo.setHandleTime(null);
}
}
//反馈图片地址
if(StringUtils.isNotEmpty(vo.getFeedbackUrl())){
String[] feedbackUrls = vo.getFeedbackUrl().split(",");
if(StringUtils.isNotEmpty(feedbackUrls)){
for (int i = 0; i < feedbackUrls.length; i++) {
if(StringUtils.isNotEmpty(feedbackUrls[i])){
feedbackUrls[i] = CommonConfig.imageURL + feedbackUrls[i];
//反馈图片地址
if (StringUtils.isNotEmpty(vo.getFeedbackUrl())) {
String[] feedbackUrls = vo.getFeedbackUrl().split(",");
if (StringUtils.isNotEmpty(feedbackUrls)) {
for (int i = 0; i < feedbackUrls.length; i++) {
if (StringUtils.isNotEmpty(feedbackUrls[i])) {
feedbackUrls[i] = CommonConfig.imageURL + feedbackUrls[i];
}
}
}
//反馈图片封面地址,取第一张图
vo.setFeedbackCover(feedbackUrls[0]);
vo.setFeedbackUrl(StringUtils.join(feedbackUrls, ","));
}
}
//反馈图片封面地址,取第一张图
vo.setFeedbackCover(feedbackUrls[0]);
vo.setFeedbackUrl(StringUtils.join(feedbackUrls, ","));
}

//处理图片地址
if(StringUtils.isNotEmpty(vo.getHandleUrl())){
String[] handleUrls = vo.getHandleUrl().split(",");
if(StringUtils.isNotEmpty(handleUrls)){
for (int i = 0; i < handleUrls.length; i++) {
if(StringUtils.isNotEmpty(handleUrls[i])){
handleUrls[i] = CommonConfig.imageURL + handleUrls[i];
//处理图片地址
if (StringUtils.isNotEmpty(vo.getHandleUrl())) {
String[] handleUrls = vo.getHandleUrl().split(",");
if (StringUtils.isNotEmpty(handleUrls)) {
for (int i = 0; i < handleUrls.length; i++) {
if (StringUtils.isNotEmpty(handleUrls[i])) {
handleUrls[i] = CommonConfig.imageURL + handleUrls[i];
}
}
}
vo.setHandleUrl(StringUtils.join(handleUrls, ","));
}
}
vo.setHandleUrl(StringUtils.join(handleUrls, ","));
}

return vo;
return vo;
}
).collect(Collectors.toList());
return JsonResult.success(pageData);

+ 21
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/TenantServiceImpl.java View File

@@ -0,0 +1,21 @@
package com.tuoheng.api.service.impl;

import com.tuoheng.api.entity.domain.Tenant;
import com.tuoheng.api.mapper.TenantMapper;
import com.tuoheng.api.service.ITenantService;
import com.tuoheng.common.common.BaseServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 企业管理表 服务实现类
* </p>
*
* @author 拓恒
* @since 2022-07-15
*/
@Service
public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> implements ITenantService {


}

Loading…
Cancel
Save