feat: 一些调整
This commit is contained in:
parent
1b68810732
commit
36b1d04197
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.itextpdf.html2pdf.ConverterProperties;
|
||||
import com.itextpdf.html2pdf.HtmlConverter;
|
||||
|
|
@ -14,10 +15,7 @@ import com.nflg.mobilebroken.common.pojo.dto.ChatMessageDTO;
|
|||
import com.nflg.mobilebroken.common.pojo.dto.SSEMessageDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.request.*;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.*;
|
||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.EecExcelUtil;
|
||||
import com.nflg.mobilebroken.common.util.PageUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.common.util.*;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||
|
|
@ -81,6 +79,12 @@ public class TicketController extends ControllerBase {
|
|||
@Resource
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
|
||||
@Resource
|
||||
private IDictionaryItemTranslateService dictionaryItemTranslateService;
|
||||
|
||||
@Resource
|
||||
private ITicketEvaluateService ticketEvaluateService;
|
||||
|
||||
/**
|
||||
* 获取问题类型
|
||||
* @return 问题类型列表
|
||||
|
|
@ -307,10 +311,51 @@ public class TicketController extends ControllerBase {
|
|||
.setCreateTime(ticket.getCreateTime())
|
||||
.setAreaName(appArea.getName())
|
||||
.setCompanyName(device.getCustomerName())
|
||||
.setHandle(handle);
|
||||
.setHandle(handle)
|
||||
.setEvaluate(getTicketEvaluate(ticket.getId()));
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
private TicketEvaluateVO getTicketEvaluate(Integer ticketId) {
|
||||
TicketEvaluate ticketEvaluate = ticketEvaluateService.getById(ticketId);
|
||||
if (Objects.isNull(ticketEvaluate)) {
|
||||
return null;
|
||||
}
|
||||
String language = MultilingualUtil.getLanguage();
|
||||
TicketEvaluateAddVO vo = dictionaryItemTranslateService.getTicketEvaluateSelect(language);
|
||||
vo.getServiceEvaluation().forEach(item -> {
|
||||
item.setSelected(Objects.equals(item.getId(), ticketEvaluate.getServiceEvaluation()));
|
||||
List<Integer> selectedIds = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(ticketEvaluate.getServiceEvaluationSelect())) {
|
||||
selectedIds = Arrays.stream(ticketEvaluate.getServiceEvaluationSelect().split(","))
|
||||
.map(Integer::parseInt).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(selectedIds) && CollectionUtil.isNotEmpty(item.getChildren())) {
|
||||
for (TicketEvaluateItemVO child : item.getChildren()) {
|
||||
child.setSelected(selectedIds.contains(child.getId()));
|
||||
}
|
||||
}
|
||||
});
|
||||
vo.getExperienceEvaluation().forEach(item -> {
|
||||
item.setSelected(Objects.equals(item.getId(), ticketEvaluate.getProductEvaluation()));
|
||||
List<Integer> selectedIds = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(ticketEvaluate.getProductEvaluationSelect())) {
|
||||
selectedIds = Arrays.stream(ticketEvaluate.getProductEvaluationSelect().split(","))
|
||||
.map(Integer::parseInt).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(selectedIds) && CollectionUtil.isNotEmpty(item.getChildren())) {
|
||||
for (TicketEvaluateItemVO child : item.getChildren()) {
|
||||
child.setSelected(selectedIds.contains(child.getId()));
|
||||
}
|
||||
}
|
||||
});
|
||||
return new TicketEvaluateVO()
|
||||
.setScore(ticketEvaluate.getScore())
|
||||
.setFeedback(ticketEvaluate.getFeedback())
|
||||
.setServiceEvaluation(vo.getServiceEvaluation())
|
||||
.setExperienceEvaluation(vo.getExperienceEvaluation());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工单聊天记录
|
||||
* @param ticketId 工单编号
|
||||
|
|
|
|||
|
|
@ -278,7 +278,6 @@ public class TiketController extends ControllerBase {
|
|||
|
||||
/**
|
||||
* 重启工单
|
||||
*
|
||||
* @param id 工单编号
|
||||
**/
|
||||
@GetMapping
|
||||
|
|
@ -291,14 +290,13 @@ public class TiketController extends ControllerBase {
|
|||
* 获取工单评价数据
|
||||
**/
|
||||
@GetMapping("getTicketEvaluateSelect")
|
||||
public ApiResult<TicketEvaluateVO> getTicketEvaluateSelect() {
|
||||
public ApiResult<TicketEvaluateAddVO> getTicketEvaluateSelect() {
|
||||
String language = MultilingualUtil.getLanguage();
|
||||
return ApiResult.success(dictionaryItemTranslateService.getTicketEvaluateSelect(language));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加工单评价
|
||||
*
|
||||
* @param request 请求信息
|
||||
**/
|
||||
@PostMapping("addTicketEvaluate")
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ public class UserController extends ControllerBase {
|
|||
|
||||
/**
|
||||
* 忘记密码
|
||||
*
|
||||
* @param email 邮件地址
|
||||
**/
|
||||
@Transactional
|
||||
|
|
@ -243,7 +242,6 @@ public class UserController extends ControllerBase {
|
|||
|
||||
/**
|
||||
* 根据code获取email
|
||||
*
|
||||
* @param code 代码
|
||||
* @return email
|
||||
*/
|
||||
|
|
@ -254,7 +252,6 @@ public class UserController extends ControllerBase {
|
|||
|
||||
/**
|
||||
* 激活用户
|
||||
*
|
||||
* @param request 请求信息
|
||||
**/
|
||||
@PostMapping("activateUser")
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ public class Constant {
|
|||
|
||||
public static final String DICTIONARY_TYPE_SERVICE_EVALUATION = "ServiceEvaluation";
|
||||
|
||||
public static final String DICTIONARY_TYPE_SERVICE_EVALUATION_SELECT = "ServiceEvaluationSelect";
|
||||
// public static final String DICTIONARY_TYPE_SERVICE_EVALUATION_SELECT = "ServiceEvaluationSelect";
|
||||
|
||||
public static final String DICTIONARY_TYPE_EXPERIENCE_EVALUATION = "ExperienceEvaluation";
|
||||
|
||||
public static final String DICTIONARY_TYPE_EXPERIENCE_EVALUATION_SELECT = "ExperienceEvaluationSelect";
|
||||
// public static final String DICTIONARY_TYPE_EXPERIENCE_EVALUATION_SELECT = "ExperienceEvaluationSelect";
|
||||
|
||||
public static final String DICTIONARY_TYPE_TITLE_CQM = "CQM";
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class AssignmentTicketRequest {
|
|||
|
||||
//工单id
|
||||
@NotNull
|
||||
private Integer tickerId;
|
||||
private Integer ticketId;
|
||||
|
||||
//紧急程度,0:非紧急;1:普通;2:紧急
|
||||
@NotNull
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public class PrimaryAppUserAddRequest {
|
|||
|
||||
//登录名
|
||||
@NotBlank
|
||||
@Email
|
||||
private String loginName;
|
||||
|
||||
//用户名
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.nflg.mobilebroken.common.pojo.request;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -15,18 +14,18 @@ public class TicketEvaluateAddRequest {
|
|||
private Integer ticketId;
|
||||
|
||||
//服务评价
|
||||
@NotBlank
|
||||
private String serviceEvaluation;
|
||||
@NotNull
|
||||
private Integer serviceEvaluationId;
|
||||
|
||||
//服务评价选择
|
||||
private List<String> serviceEvaluationSelect;
|
||||
private List<Integer> serviceEvaluationSelectIds;
|
||||
|
||||
//产品评价
|
||||
@NotBlank
|
||||
private String productEvaluation;
|
||||
@NotNull
|
||||
private Integer productEvaluationId;
|
||||
|
||||
//产品评价选择
|
||||
private List<String> productEvaluationSelect;
|
||||
private List<Integer> productEvaluationSelectIds;
|
||||
|
||||
//评分
|
||||
private BigDecimal score;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import java.util.List;
|
|||
@Accessors(chain = true)
|
||||
public class AppUserForAdminVO {
|
||||
|
||||
private String key;
|
||||
|
||||
//账号id
|
||||
private Integer id;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TicketEvaluateAddVO {
|
||||
|
||||
// 售后服务评价
|
||||
private List<TicketEvaluateItemVO> serviceEvaluation;
|
||||
|
||||
// 产品体验评价
|
||||
private List<TicketEvaluateItemVO> experienceEvaluation;
|
||||
}
|
||||
|
|
@ -2,12 +2,21 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TicketEvaluateItemVO {
|
||||
|
||||
//编码
|
||||
private Integer id;
|
||||
|
||||
private String code;
|
||||
|
||||
//描述
|
||||
private String desc;
|
||||
|
||||
//是否选中
|
||||
private Boolean selected;
|
||||
|
||||
//选择项列表
|
||||
private List<TicketEvaluateItemVO> children;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,24 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class TicketEvaluateVO {
|
||||
|
||||
// 售后服务评价
|
||||
private List<TicketEvaluateItemVO> serviceEvaluation;
|
||||
|
||||
// 售后服务评价选择项
|
||||
private List<TicketEvaluateItemVO> serviceEvaluationSelect;
|
||||
|
||||
// 产品体验评价
|
||||
private List<TicketEvaluateItemVO> experienceEvaluation;
|
||||
|
||||
// 产品体验评价选择项
|
||||
private List<TicketEvaluateItemVO> experienceEvaluationSelect;
|
||||
//评分
|
||||
private BigDecimal score;
|
||||
|
||||
//反馈
|
||||
private String feedback;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,7 @@ public class TicketInfoVO {
|
|||
|
||||
//附件
|
||||
private List<String> attachments;
|
||||
|
||||
//评价
|
||||
private TicketEvaluateVO evaluate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.nflg.mobilebroken.common.util;
|
||||
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
|
@ -16,7 +14,6 @@ public class AdminUserUtil {
|
|||
// return SaTokenAdminUtil.getLoginIdAsInt();
|
||||
// }
|
||||
// return 1;
|
||||
VUtils.trueThrow(!SaTokenAdminUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return SaTokenAdminUtil.getLoginIdAsInt();
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +22,6 @@ public class AdminUserUtil {
|
|||
// return (String) SaTokenAdminUtil.getExtra("name");
|
||||
// }
|
||||
// return "admin";
|
||||
VUtils.trueThrow(!SaTokenAdminUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (String) SaTokenAdminUtil.getExtra("name");
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +30,6 @@ public class AdminUserUtil {
|
|||
// return (List<String>) SaTokenAdminUtil.getExtra("roles");
|
||||
// }
|
||||
// return ListUtil.of("管理员");
|
||||
VUtils.trueThrow(!SaTokenAdminUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (List<String>) SaTokenAdminUtil.getExtra("roles");
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +38,6 @@ public class AdminUserUtil {
|
|||
// return (String) SaTokenAdminUtil.getExtra("code");
|
||||
// }
|
||||
// return "admin";
|
||||
VUtils.trueThrow(!SaTokenAdminUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (String) SaTokenAdminUtil.getExtra("code");
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +46,6 @@ public class AdminUserUtil {
|
|||
// return (String) SaTokenAdminUtil.getExtra("email");
|
||||
// }
|
||||
// return "aa@gmail.com";
|
||||
VUtils.trueThrow(!SaTokenAdminUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (String) SaTokenAdminUtil.getExtra("email");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.nflg.mobilebroken.common.util;
|
||||
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.UserDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -12,7 +11,6 @@ public class AppUserUtil {
|
|||
// return SaTokenAppUtil.getLoginIdAsInt();
|
||||
// }
|
||||
// return 1;
|
||||
VUtils.trueThrow(!SaTokenAppUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return SaTokenAppUtil.getLoginIdAsInt();
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +19,6 @@ public class AppUserUtil {
|
|||
// return (String) SaTokenAppUtil.getExtra("name");
|
||||
// }
|
||||
// return "admin";
|
||||
VUtils.trueThrow(!SaTokenAppUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (String) SaTokenAppUtil.getExtra("name");
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +27,6 @@ public class AppUserUtil {
|
|||
// return (String) SaTokenAppUtil.getExtra("email");
|
||||
// }
|
||||
// return "aa@gmail.com";
|
||||
VUtils.trueThrow(!SaTokenAppUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (String) SaTokenAppUtil.getExtra("email");
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +35,6 @@ public class AppUserUtil {
|
|||
// return (List<Integer>) SaTokenAppUtil.getExtra("companyIds");
|
||||
// }
|
||||
// return ListUtil.of(1);
|
||||
VUtils.trueThrow(!SaTokenAppUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
return (List<Integer>) SaTokenAppUtil.getExtra("companyIds");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
|
|
@ -37,7 +38,7 @@ public class TicketEvaluate implements Serializable {
|
|||
/**
|
||||
* 售后服务评价
|
||||
*/
|
||||
private String serviceEvaluation;
|
||||
private Integer serviceEvaluation;
|
||||
|
||||
/**
|
||||
* 售后服务评价选择
|
||||
|
|
@ -47,7 +48,7 @@ public class TicketEvaluate implements Serializable {
|
|||
/**
|
||||
* 产品体验评价
|
||||
*/
|
||||
private String productEvaluation;
|
||||
private Integer productEvaluation;
|
||||
|
||||
/**
|
||||
* 产品体验评价选择
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public interface IAppUserService extends IService<AppUser> {
|
|||
|
||||
AppUser getUser(String userName,String password);
|
||||
|
||||
void disable(Integer userId);
|
||||
void disable(Integer id);
|
||||
|
||||
String resetPassword(Integer id, String password);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.nflg.mobilebroken.repository.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.DictionaryItemTranslateDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DictionaryItemTranslateVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateAddVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TitleVO;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItemTranslate;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ public interface IDictionaryItemTranslateService extends IService<DictionaryItem
|
|||
|
||||
String getErrorMsg(String language, String errorCode);
|
||||
|
||||
TicketEvaluateVO getTicketEvaluateSelect(String language);
|
||||
TicketEvaluateAddVO getTicketEvaluateSelect(String language);
|
||||
|
||||
List<DictionaryItemTranslateVO> getAllByDictionaryCode(String code, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,15 +17,9 @@ import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
|||
import com.nflg.mobilebroken.common.util.AppUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.PageUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.AppArea;
|
||||
import com.nflg.mobilebroken.repository.entity.AppUser;
|
||||
import com.nflg.mobilebroken.repository.entity.AppUserApplyfor;
|
||||
import com.nflg.mobilebroken.repository.entity.TBaseCustomer;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.mapper.AppUserMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IAppAreaService;
|
||||
import com.nflg.mobilebroken.repository.service.IAppUserApplyforService;
|
||||
import com.nflg.mobilebroken.repository.service.IAppUserService;
|
||||
import com.nflg.mobilebroken.repository.service.ITBaseCustomerService;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -60,7 +54,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
private ITBaseCustomerService customerService;
|
||||
|
||||
@Resource
|
||||
private IAppUserService appUserService;
|
||||
private IAdminUserService adminUserService;
|
||||
|
||||
@Override
|
||||
public AppUser getUser(String userName, String password) {
|
||||
|
|
@ -74,11 +68,12 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void disable(Integer userId) {
|
||||
public void disable(Integer id) {
|
||||
AppUser user=new AppUser()
|
||||
.setId(userId)
|
||||
.setState(UserState.Disabled.getState())
|
||||
.setUpdateBy(AppUserUtil.getUserId())
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
.setUpdateTime(LocalDateTime.now())
|
||||
.setId(id);
|
||||
updateById(user);
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +91,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
|
||||
@Override
|
||||
public IPage<CompanyVO> search(UserSearchRequest request) {
|
||||
AppUser appUser = appUserService.getById(AppUserUtil.getUserId());
|
||||
AppUser appUser = getById(AppUserUtil.getUserId());
|
||||
// request.setCompanyIds(Arrays.stream(appUser.getCompanyId().split(",")).filter(StrUtil::isNotBlank).collect(Collectors.toList()));
|
||||
List<Integer> companyIds = Arrays.stream(appUser.getCompanyId().split(",")).filter(StrUtil::isNotBlank).map(Integer::parseInt).collect(Collectors.toList());
|
||||
List<CompanyVO> datas = new ArrayList<>();
|
||||
|
|
@ -133,7 +128,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
public void addPrimaryAppUser(PrimaryAppUserAddRequest request) {
|
||||
VUtils.trueThrowBusinessError(lambdaQuery().eq(AppUser::getLoginName, request.getLoginName()).exists())
|
||||
.throwMessage("登录名已存在");
|
||||
List<Integer> companyIds = appUserService.lambdaQuery()
|
||||
List<Integer> companyIds = lambdaQuery()
|
||||
.select(AppUser::getCompanyId)
|
||||
.eq(AppUser::getIsPrimary, true)
|
||||
.list()
|
||||
|
|
@ -214,7 +209,14 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
.page(new Page<>(request.getPage(), request.getPageSize()));
|
||||
return PageUtil.convert(page, d -> {
|
||||
AppArea area = appAreaService.getById(d.getAreaId());
|
||||
AppUser appUser = getById(d.getCreateBy());
|
||||
String createBy = "";
|
||||
if (d.getIsPrimary()) {
|
||||
AdminUser adminUser = adminUserService.getById(d.getCreateBy());
|
||||
createBy = adminUser.getUserName();
|
||||
} else {
|
||||
AppUser appUser = getById(d.getCreateBy());
|
||||
createBy = appUser.getName();
|
||||
}
|
||||
String updateBy = null;
|
||||
if (Objects.nonNull(d.getUpdateBy())) {
|
||||
updateBy = getById(d.getUpdateBy()).getName();
|
||||
|
|
@ -222,6 +224,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
List<Integer> companyIds = Arrays.stream(d.getCompanyId().split(",")).filter(StrUtil::isNotBlank).map(Integer::valueOf).collect(Collectors.toList());
|
||||
List<String> customers = customerService.listByIds(companyIds).stream().map(TBaseCustomer::getAgencyCompanyName).collect(Collectors.toList());
|
||||
return new AppUserForAdminVO()
|
||||
.setKey("u-" + d.getId())
|
||||
.setId(d.getId())
|
||||
.setAvatar(d.getAvatar())
|
||||
.setLoginName(d.getLoginName())
|
||||
|
|
@ -236,7 +239,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
.setAreaName(area.getName())
|
||||
.setUserState(d.getState())
|
||||
.setExpireTime(d.getExpireTime())
|
||||
.setCreateBy(appUser.getName())
|
||||
.setCreateBy(createBy)
|
||||
.setCreateTime(d.getCreateTime())
|
||||
.setUpdateBy(updateBy)
|
||||
.setPrimary(true)
|
||||
|
|
@ -296,6 +299,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
updateBy = getById(d.getUpdateBy()).getName();
|
||||
}
|
||||
return new AppUserForAdminVO()
|
||||
.setKey("u-" + d.getId())
|
||||
.setId(d.getId())
|
||||
.setAvatar(d.getAvatar())
|
||||
.setLoginName(d.getLoginName())
|
||||
|
|
@ -326,6 +330,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
AppArea area = appAreaService.getById(d.getAreaId());
|
||||
TBaseCustomer company = customerService.getById(d.getCompanyId());
|
||||
return new AppUserForAdminVO()
|
||||
.setKey("f-" + d.getId())
|
||||
.setId(d.getId())
|
||||
.setAvatar(d.getUserAvatar())
|
||||
.setLoginName(d.getUserEmail())
|
||||
|
|
@ -445,7 +450,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
LambdaQueryWrapper<AppUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AppUser::getIsPrimary, true);
|
||||
queryWrapper.apply("FIND_IN_SET({0}, company_id)>0", companyId);
|
||||
return appUserService.getBaseMapper().selectOne(queryWrapper);
|
||||
return getBaseMapper().selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
private List<AppUserVO> getByCompanyId(Long companyId) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.DictionaryItemTranslateDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DictionaryItemTranslateVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateAddVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateItemVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.TitleVO;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.Dictionary;
|
||||
|
|
@ -95,12 +96,20 @@ public class DictionaryItemTranslateServiceImpl extends ServiceImpl<DictionaryIt
|
|||
}
|
||||
|
||||
@Override
|
||||
public TicketEvaluateVO getTicketEvaluateSelect(String language) {
|
||||
TicketEvaluateVO vo = new TicketEvaluateVO();
|
||||
vo.setServiceEvaluation(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_SERVICE_EVALUATION, language));
|
||||
vo.setServiceEvaluationSelect(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_SERVICE_EVALUATION_SELECT, language));
|
||||
vo.setExperienceEvaluation(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_EXPERIENCE_EVALUATION, language));
|
||||
vo.setExperienceEvaluationSelect(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_EXPERIENCE_EVALUATION_SELECT, language));
|
||||
public TicketEvaluateAddVO getTicketEvaluateSelect(String language) {
|
||||
TicketEvaluateAddVO vo = new TicketEvaluateAddVO();
|
||||
List<TicketEvaluateItemVO> serviceEvaluation = baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_SERVICE_EVALUATION, language);
|
||||
serviceEvaluation.forEach(s -> {
|
||||
s.setChildren(baseMapper.getListByDictionaryCode(s.getCode(), language));
|
||||
});
|
||||
vo.setServiceEvaluation(serviceEvaluation);
|
||||
// vo.setServiceEvaluationSelect(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_SERVICE_EVALUATION_SELECT, language));
|
||||
List<TicketEvaluateItemVO> experienceEvaluation = baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_EXPERIENCE_EVALUATION, language);
|
||||
experienceEvaluation.forEach(s -> {
|
||||
s.setChildren(baseMapper.getListByDictionaryCode(s.getCode(), language));
|
||||
});
|
||||
vo.setExperienceEvaluation(experienceEvaluation);
|
||||
// vo.setExperienceEvaluationSelect(baseMapper.getListByDictionaryCode(Constant.DICTIONARY_TYPE_EXPERIENCE_EVALUATION_SELECT, language));
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public class TicketEvaluateServiceImpl extends ServiceImpl<TicketEvaluateMapper,
|
|||
&& !Objects.equals(ticket.getState(), TicketState.Closed.getState())).throwMessage("工单状态异常");
|
||||
TicketEvaluate ticketEvaluate = new TicketEvaluate()
|
||||
.setTicketId(request.getTicketId())
|
||||
.setServiceEvaluation(request.getServiceEvaluation())
|
||||
.setServiceEvaluationSelect(StrUtil.join(",", request.getServiceEvaluationSelect()))
|
||||
.setProductEvaluation(request.getProductEvaluation())
|
||||
.setProductEvaluationSelect(StrUtil.join(",", request.getProductEvaluationSelect()))
|
||||
.setServiceEvaluation(request.getServiceEvaluationId())
|
||||
.setServiceEvaluationSelect(StrUtil.join(",", request.getServiceEvaluationSelectIds()))
|
||||
.setProductEvaluation(request.getProductEvaluationId())
|
||||
.setProductEvaluationSelect(StrUtil.join(",", request.getProductEvaluationSelectIds()))
|
||||
.setScore(request.getScore())
|
||||
.setFeedback(request.getFeedback())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||
|
||||
@Override
|
||||
public void assignmentTicket(AssignmentTicketRequest request) {
|
||||
Ticket ticket = getById(request.getTickerId());
|
||||
Ticket ticket = getById(request.getTicketId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("未找到工单");
|
||||
VUtils.trueThrowBusinessError(ticket.getState() != TicketState.PendingProcessing.getState().byteValue()).throwMessage("工单状态异常");
|
||||
VUtils.trueThrowBusinessError(Objects.nonNull(ticket.getCqm()) && !Objects.equals(ticket.getCqm(), AdminUserUtil.getUserId()))
|
||||
|
|
@ -119,6 +119,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getCqm(), AdminUserUtil.getUserId()))
|
||||
.throwMessage("当前工单未归属当前CQM负责人");
|
||||
ticket.setState(TicketState.Closed.getState());
|
||||
ticket.setSolution(request.getSolution());
|
||||
ticket.setSolutionAttachments(StrUtil.join(",", request.getAttachments()));
|
||||
ticket.setSolveTime(LocalDateTime.now());
|
||||
updateById(ticket);
|
||||
|
|
|
|||
|
|
@ -56,19 +56,17 @@
|
|||
LEFT JOIN app_user uu ON u.update_by=uu.id
|
||||
LEFT JOIN t_base_position p ON u.title_id=p.id
|
||||
WHERE u.is_primary=false AND u.company_id=#{companyId}
|
||||
<where>
|
||||
<if test="state != null">
|
||||
AND u.state = #{state}
|
||||
</if>
|
||||
<if test="key != null and key != ''">
|
||||
AND
|
||||
(
|
||||
u.name LIKE concat('%', #{key}, '%')
|
||||
OR u.email LIKE concat('%', #{key}, '%')
|
||||
or u.phone LIKE concat('%', #{key}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
<if test="state != null">
|
||||
AND u.state = #{state}
|
||||
</if>
|
||||
<if test="key != null and key != ''">
|
||||
AND
|
||||
(
|
||||
u.login_name LIKE concat('%', #{key}, '%')
|
||||
OR u.email LIKE concat('%', #{key}, '%')
|
||||
or u.name LIKE concat('%', #{key}, '%')
|
||||
)
|
||||
</if>
|
||||
UNION
|
||||
SELECT u.id,u.user_phone AS 'phone',0 AS 'userState',u.title_id AS 'titleId',u.area_id AS 'areaId',u.company_id AS 'companyId',p.position_name AS 'title',null AS 'expireTime',c.agency_company_name AS 'companyName',u.user_email AS 'loginName',u.user_name AS 'name',u.user_email AS 'email',u.user_avatar AS 'avatar',a.`name` AS 'areaName',uc.`name` AS 'createBy',u.create_time AS 'createTime',null AS 'updateBy',null AS 'updateTime',null AS 'lastLoginTime',null AS 'expireTime',false AS 'isPrimary',0 AS 'state'
|
||||
FROM app_user_applyfor u
|
||||
|
|
@ -77,5 +75,15 @@
|
|||
LEFT JOIN app_user uc ON u.create_by=uc.id
|
||||
LEFT JOIN t_base_position p ON u.title_id=p.id
|
||||
WHERE u.company_id=#{companyId}
|
||||
<if test="state > 0">
|
||||
AND 1=2
|
||||
</if>
|
||||
<if test="key != null and key != ''">
|
||||
AND
|
||||
(
|
||||
u.user_email LIKE concat('%', #{key}, '%')
|
||||
OR u.user_name LIKE concat('%', #{key}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getListByDictionaryCode" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketEvaluateItemVO">
|
||||
SELECT di.`code`,IFNULL(dit.`value`,di.`name`) AS 'desc'
|
||||
SELECT di.id,di.`code`,IFNULL(dit.`value`,di.`name`) AS 'desc'
|
||||
FROM dictionary d
|
||||
INNER JOIN dictionary_item di ON d.id=di.dictionary_id
|
||||
LEFT JOIN dictionary_item_translate dit ON di.id=dit.dictionary_item_id AND dit.language_code=#{language}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
<sql id="adminSearchWhereCondition">
|
||||
<where>
|
||||
t.state!=4
|
||||
<if test="request.title!=null and request.title!=''">
|
||||
AND (t.title LIKE CONCAT('%', #{request.title}, '%') OR t.no LIKE CONCAT('%', #{request.title}, '%'))
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.nflg.mobilebroken.starter.advice;
|
||||
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
import com.nflg.mobilebroken.common.exception.NflgException;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
|
|
@ -49,4 +52,10 @@ public class GlobalRestControllerAdvice {
|
|||
});
|
||||
return ApiResult.error(STATE.ParamErr, "数据校验失败: " + StrUtil.join(",", errors));
|
||||
}
|
||||
|
||||
@ExceptionHandler(NotLoginException.class)
|
||||
@ResponseStatus(HttpStatus.UNAUTHORIZED) // 返回 401 状态码
|
||||
public String handleNotLoginException(NotLoginException e) {
|
||||
return "请重新登录";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue