fix: 修复一些问题
This commit is contained in:
parent
c165d91f99
commit
b42f3fe529
|
|
@ -13,6 +13,7 @@ import com.nflg.mobilebroken.common.pojo.ApiResult;
|
|||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
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.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.AppUser;
|
||||
import com.nflg.mobilebroken.repository.entity.AppUserApplyfor;
|
||||
|
|
@ -195,6 +196,7 @@ public class AppUserController extends ControllerBase {
|
|||
.setAreaId(request.getAreaId())
|
||||
.setTitleId(request.getTitleId())
|
||||
.setCompanyId(StrUtil.join(",", request.getCompanyIds()))
|
||||
.setUpdateBy(AdminUserUtil.getUserName())
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
if (!Objects.equals(user.getState(), UserState.ToBeActivated.getState()) && Objects.nonNull(request.getEnable())) {
|
||||
user.setState(request.getEnable() ? UserState.Activated.getState() : UserState.Disabled.getState());
|
||||
|
|
@ -248,9 +250,9 @@ public class AppUserController extends ControllerBase {
|
|||
.setSalesUserName(request.getSalesUserName())
|
||||
.setPhone(request.getPhone())
|
||||
.setLanguageCode(request.getLanguageCode())
|
||||
.setAreaId(request.getAreaId())
|
||||
.setTitleId(request.getTitleId())
|
||||
.setCompanyId(StrUtil.join(",", request.getCompanyIds()))
|
||||
.setUpdateBy(AdminUserUtil.getUserName())
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
if (!Objects.equals(user.getState(), UserState.ToBeActivated.getState()) && Objects.nonNull(request.getEnable())) {
|
||||
user.setState(request.getEnable() ? UserState.Activated.getState() : UserState.Disabled.getState());
|
||||
|
|
|
|||
|
|
@ -499,10 +499,10 @@ public class TicketController extends ControllerBase {
|
|||
public ApiResult<TicketInfoVO> getTicket(@Valid @RequestParam @NotNull Integer id) {
|
||||
Ticket ticket = ticketService.getById(id);
|
||||
AppUser user = appUserService.getById(ticket.getUserId());
|
||||
String areaName;
|
||||
String areaName = "";
|
||||
if (user.getIsPrimary()){
|
||||
areaName=adminAreaService.getById(user.getAreaId()).getAreaName();
|
||||
}else {
|
||||
}else if (Objects.nonNull(user.getAreaId())){
|
||||
areaName = appAreaService.getById(user.getAreaId()).getName();
|
||||
}
|
||||
// TBaseCustomer company = customerService.getById(Integer.valueOf(user.getCompanyId()));
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.nflg.mobilebroken.common.pojo.request;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class AppUserUpdateRequest extends PrimaryAppUserAddRequest {
|
||||
|
|
@ -15,6 +13,5 @@ public class AppUserUpdateRequest extends PrimaryAppUserAddRequest {
|
|||
private Boolean enable;
|
||||
|
||||
//区域id
|
||||
@NotNull
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ public class AppUserForAdminVO {
|
|||
private String areaName;
|
||||
|
||||
public String getAreaName(){
|
||||
if (StrUtil.isBlank(areaName)){
|
||||
return areaName;
|
||||
}
|
||||
return StrUtil.join(",",Arrays.stream(areaName.split(",")).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,32 +102,32 @@
|
|||
LEFT JOIN app_area aa ON au.area_id=aa.id
|
||||
LEFT JOIN app_user_applyfor aua ON aua.user_id=au.id AND aua.state=0
|
||||
LEFT JOIN t_base_position p ON au.title_id=p.id
|
||||
<where>
|
||||
<if test="loginName!=null and loginName!=''">
|
||||
AND au.login_name LIKE concat('%', #{loginName}, '%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
AND au.`name` LIKE concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="companyName!=null and companyName!=''">
|
||||
AND fun_getUserCompanys(au.company_id) LIKE concat('%', #{companyName}, '%')
|
||||
</if>
|
||||
<if test="userState!=null">
|
||||
AND au.state=#{userState}
|
||||
</if>
|
||||
<if test="state==0">
|
||||
AND aua.id IS NOT NULL
|
||||
</if>
|
||||
<if test="state==1">
|
||||
AND aua.id IS NULL AND CONVERT_TZ(NOW(), @@session.time_zone, '+00:00') < au.expire_time
|
||||
</if>
|
||||
<if test="state==2">
|
||||
AND aua.id IS NULL AND CONVERT_TZ(NOW(), @@session.time_zone, '+00:00') >= au.expire_time
|
||||
</if>
|
||||
</where>
|
||||
WHERE au.is_del=0
|
||||
<if test="loginName!=null and loginName!=''">
|
||||
AND au.login_name LIKE concat('%', #{loginName}, '%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
AND au.`name` LIKE concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="companyName!=null and companyName!=''">
|
||||
AND fun_getUserCompanys(au.company_id) LIKE concat('%', #{companyName}, '%')
|
||||
</if>
|
||||
<if test="userState!=null">
|
||||
AND au.state=#{userState}
|
||||
</if>
|
||||
<if test="state==0">
|
||||
AND aua.id IS NOT NULL
|
||||
</if>
|
||||
<if test="state==1">
|
||||
AND aua.id IS NULL AND CONVERT_TZ(NOW(), @@session.time_zone, '+00:00') < au.expire_time
|
||||
</if>
|
||||
<if test="state==2">
|
||||
AND aua.id IS NULL AND CONVERT_TZ(NOW(), @@session.time_zone, '+00:00') >= au.expire_time
|
||||
</if>
|
||||
UNION
|
||||
SELECT CONCAT('f-',aua.id) AS 'key',aua.id,aua.user_avatar AS 'avatar',aua.user_email AS 'loginName',aua.`user_name` AS 'userName',fun_getUserCompanys(aua.company_id) AS 'companyName',aua.user_name AS 'name',aua.user_email AS 'email',aua.sales_user_name,IF(aua.is_primary,fun_getPrimaryUserArea(aua.company_id),aa.`name`) AS 'areaName',0 AS 'userState',null AS 'expireTime',0 AS 'state',aua.create_by,aua.create_time,null AS 'updateBy',null AS 'updateTime',null AS 'lastLoginTime',aua.is_primary,aua.company_id,aua.user_phone AS 'phone',aua.area_id,aua.language_code,p.position_name AS 'title',aua.title_id
|
||||
SELECT CONCAT('f-',aua.id) AS 'key',aua.id,aua.user_avatar AS 'avatar',aua.user_email AS 'loginName',aua.`user_name` AS 'userName',fun_getUserCompanys(aua.company_id) AS 'companyName',aua.user_name AS 'name',aua.user_email AS 'email',aua.sales_user_name,IF(aua.is_primary,fun_getPrimaryUserArea(aua.company_id),aa.`name`) AS 'areaName',0 AS 'userState',null AS 'expireTime',0 AS 'state',au.name AS 'createBy',aua.create_time,null AS 'updateBy',null AS 'updateTime',null AS 'lastLoginTime',aua.is_primary,aua.company_id,aua.user_phone AS 'phone',aua.area_id,aua.language_code,p.position_name AS 'title',aua.title_id
|
||||
FROM app_user_applyfor aua
|
||||
LEFT JOIN app_user au ON au.id=aua.create_by
|
||||
LEFT JOIN app_area aa ON aua.area_id=aa.id
|
||||
LEFT JOIN t_base_position p ON aua.title_id=p.id
|
||||
WHERE aua.type=0 AND aua.state=0
|
||||
|
|
|
|||
Loading…
Reference in New Issue