Merge branch 'develop' into feature/ticket-add-solution
This commit is contained in:
commit
7dc106237c
|
|
@ -23,6 +23,7 @@ import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||||
import com.nflg.mobilebroken.starter.service.EmailService;
|
import com.nflg.mobilebroken.starter.service.EmailService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -45,6 +46,7 @@ import java.util.stream.Collectors;
|
||||||
* @author 曹鹏飞
|
* @author 曹鹏飞
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@RefreshScope
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/appuser")
|
@RequestMapping("/appuser")
|
||||||
public class AppUserController extends ControllerBase {
|
public class AppUserController extends ControllerBase {
|
||||||
|
|
@ -157,6 +159,7 @@ public class AppUserController extends ControllerBase {
|
||||||
@ApiMark(moduleName = "代理商管理", apiName = "更新代理商账号")
|
@ApiMark(moduleName = "代理商管理", apiName = "更新代理商账号")
|
||||||
public ApiResult<Void> updateAppUser(@Valid @RequestBody AppUserUpdateRequest request) throws MessagingException {
|
public ApiResult<Void> updateAppUser(@Valid @RequestBody AppUserUpdateRequest request) throws MessagingException {
|
||||||
AppUser user=appUserService.getById(request.getId());
|
AppUser user=appUserService.getById(request.getId());
|
||||||
|
user.setExpireTime(user.getExpireTime().plusDays(1));
|
||||||
if (user.getIsPrimary()){
|
if (user.getIsPrimary()){
|
||||||
updatePrimaryAppUser(user,request);
|
updatePrimaryAppUser(user,request);
|
||||||
}else {
|
}else {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import lombok.Data;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备管理编辑参数
|
* 设备管理编辑参数
|
||||||
|
|
@ -88,6 +88,13 @@ public class DeviceDTO {
|
||||||
@NotNull(message = "发货日期 不能为空")
|
@NotNull(message = "发货日期 不能为空")
|
||||||
private LocalDate shipmentDate;
|
private LocalDate shipmentDate;
|
||||||
|
|
||||||
|
public LocalDate getShipmentDate() {
|
||||||
|
if (Objects.isNull(shipmentDate)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return shipmentDate.plusDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质保状态-来自字典
|
* 质保状态-来自字典
|
||||||
*/
|
*/
|
||||||
|
|
@ -100,6 +107,13 @@ public class DeviceDTO {
|
||||||
@NotNull(message = "开始质保日期不能为空")
|
@NotNull(message = "开始质保日期不能为空")
|
||||||
private LocalDate startWarrantyDate;
|
private LocalDate startWarrantyDate;
|
||||||
|
|
||||||
|
public LocalDate getStartWarrantyDate() {
|
||||||
|
if (Objects.isNull(startWarrantyDate)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return startWarrantyDate.plusDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质保期(月)
|
* 质保期(月)
|
||||||
*/
|
*/
|
||||||
|
|
@ -121,25 +135,25 @@ public class DeviceDTO {
|
||||||
*/
|
*/
|
||||||
private Integer sourceFrom= DeviceSourceFromEnum.MANUAL_ADD.getSourceKey();
|
private Integer sourceFrom= DeviceSourceFromEnum.MANUAL_ADD.getSourceKey();
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 创建人
|
// * 创建人
|
||||||
*/
|
// */
|
||||||
private String createBy;
|
// private String createBy;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 创建时间
|
// * 创建时间
|
||||||
*/
|
// */
|
||||||
private LocalDateTime createTime;
|
// private LocalDateTime createTime;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 最后更新人
|
// * 最后更新人
|
||||||
*/
|
// */
|
||||||
private String updateBy;
|
// private String updateBy;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 最后更新时间
|
// * 最后更新时间
|
||||||
*/
|
// */
|
||||||
private LocalDateTime updateTime;
|
// private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ public class AdminDeviceService {
|
||||||
device.setSourceFrom(DeviceSourceFromEnum.MANUAL_ADD.getSourceKey());
|
device.setSourceFrom(DeviceSourceFromEnum.MANUAL_ADD.getSourceKey());
|
||||||
device.setCreateBy(AdminUserUtil.getUserName());
|
device.setCreateBy(AdminUserUtil.getUserName());
|
||||||
device.setCreateTime(LocalDateTime.now());
|
device.setCreateTime(LocalDateTime.now());
|
||||||
device.setUpdateBy(AdminUserUtil.getUserName());
|
// device.setUpdateBy(AdminUserUtil.getUserName());
|
||||||
device.setUpdateTime(LocalDateTime.now());
|
// device.setUpdateTime(LocalDateTime.now());
|
||||||
deviceService.save(device);
|
deviceService.save(device);
|
||||||
//将设备类型放入-设备类型表维护客户质量管理人
|
//将设备类型放入-设备类型表维护客户质量管理人
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@ package com.nflg.mobilebroken.common.util;
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -16,4 +19,22 @@ public class DateTimeUtil {
|
||||||
}
|
}
|
||||||
return dateTime.format(FORMATTER);
|
return dateTime.format(FORMATTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LocalDate asSystemDate(LocalDate date){
|
||||||
|
if (Objects.isNull(date)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return date.atStartOfDay(ZoneOffset.UTC)
|
||||||
|
.withZoneSameInstant(ZoneId.systemDefault())
|
||||||
|
.toLocalDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalDateTime asSystemDateTime(LocalDateTime datetime){
|
||||||
|
if (Objects.isNull(datetime)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return datetime.atZone(ZoneOffset.UTC)
|
||||||
|
.withZoneSameInstant(ZoneId.systemDefault())
|
||||||
|
.toLocalDateTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
||||||
.setUpdateBy(AdminUserUtil.getUserName())
|
.setUpdateBy(AdminUserUtil.getUserName())
|
||||||
.setUpdateTime(LocalDateTime.now())
|
.setUpdateTime(LocalDateTime.now())
|
||||||
.setState(UserState.ToBeActivated.getState())
|
.setState(UserState.ToBeActivated.getState())
|
||||||
.setExpireTime(LocalDateTime.of(LocalDateTime.now().getYear(), 12, 31, 8, 0, 0).toLocalDate());
|
.setExpireTime(LocalDate.of(LocalDateTime.now().getYear() + 1, 1, 1));
|
||||||
updateById(user);
|
updateById(user);
|
||||||
}else {
|
}else {
|
||||||
user = new AppUser()
|
user = new AppUser()
|
||||||
|
|
@ -189,7 +189,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
||||||
.setCreateBy(AdminUserUtil.getUserName())
|
.setCreateBy(AdminUserUtil.getUserName())
|
||||||
.setCreateTime(LocalDateTime.now())
|
.setCreateTime(LocalDateTime.now())
|
||||||
.setState(UserState.ToBeActivated.getState())
|
.setState(UserState.ToBeActivated.getState())
|
||||||
.setExpireTime(LocalDateTime.of(LocalDateTime.now().getYear(), 12, 31, 8, 0, 0).toLocalDate());
|
.setExpireTime(LocalDate.of(LocalDateTime.now().getYear() + 1, 1, 1));
|
||||||
save(user);
|
save(user);
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
<if test="userState!=null">
|
<if test="userState!=null">
|
||||||
AND 0=#{userState}
|
AND 0=#{userState}
|
||||||
</if>
|
</if>
|
||||||
<if test="state!=null">
|
<if test="state!=null and state!=0">
|
||||||
AND 1=2
|
AND 1=2
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue