修改id js精度丢失

master
xiaoning 1 month ago
parent 1d86ef3d03
commit 53a13352cd

@ -248,7 +248,7 @@
<module>ruoyi-quartz</module> <module>ruoyi-quartz</module>
<module>ruoyi-generator</module> <module>ruoyi-generator</module>
<module>ruoyi-common</module> <module>ruoyi-common</module>
<module>ruoyi-mall</module> <!-- <module>ruoyi-mall</module>-->
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>

@ -91,11 +91,11 @@
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.ruoyi</groupId> <!-- <groupId>com.ruoyi</groupId>-->
<artifactId>ruoyi-mall</artifactId> <!-- <artifactId>ruoyi-mall</artifactId>-->
<version>${ruoyi.version}</version> <!-- <version>${ruoyi.version}</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.junit.vintage</groupId> <groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId> <artifactId>junit-vintage-engine</artifactId>

@ -1,6 +1,8 @@
package cn.xluobo.business.sc.student.domain.resp; package cn.xluobo.business.sc.student.domain.resp;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -19,6 +21,7 @@ public class RespSearchStudent implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long studentId; private Long studentId;
private Long schoolId; private Long schoolId;

@ -1,10 +1,9 @@
package cn.xluobo.business.sc.student.repo.model; package cn.xluobo.business.sc.student.repo.model;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@ -34,7 +33,8 @@ public class ScStudent implements Serializable {
/** /**
* id * id
*/ */
@TableId(value = "student_id") @TableId(value = "student_id", type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class)
private Long studentId; private Long studentId;
/** /**

@ -122,6 +122,7 @@ public class BusinessScStudentService {
if (null != contactList && contactList.size() > 0) { if (null != contactList && contactList.size() > 0) {
scStudent.setPhone(contactList.get(0).getContactPhone()); scStudent.setPhone(contactList.get(0).getContactPhone());
} }
scStudent.setTenantId(SecurityUtils.getLoginUser().getNowTenantId());
scStudent.setCreateUser(loginUser.getUserId()); scStudent.setCreateUser(loginUser.getUserId());
scStudentService.save(scStudent); scStudentService.save(scStudent);
@ -141,7 +142,7 @@ public class BusinessScStudentService {
scStudent.setPhone(contactList.get(0).getContactPhone()); scStudent.setPhone(contactList.get(0).getContactPhone());
} }
return APIResponse.toOkResponse(); return APIResponse.toAPIResponse(scStudent.getStudentId().toString());
} }
/** /**

@ -1,11 +1,11 @@
package cn.xluobo.business.sys.address; package cn.xluobo.business.sys.address;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.xluobo.core.page.RespPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cyl.manager.ums.domain.entity.Address;
import com.cyl.manager.ums.mapper.AddressMapper;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.page.RespPage;
import com.ruoyi.mall.domain.Address;
import com.ruoyi.mall.mapper.AddressMapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;

@ -12,6 +12,7 @@ import com.google.common.collect.Lists;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.mapper.SysDeptMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -30,6 +31,9 @@ public class BusinessSysDeptService {
@Autowired @Autowired
private ISysDeptService sysDeptService; private ISysDeptService sysDeptService;
@Autowired
private SysDeptMapper deptMapper;
@Autowired @Autowired
private ISysUserDeptService userDeptService; private ISysUserDeptService userDeptService;
@Autowired @Autowired
@ -180,8 +184,9 @@ public class BusinessSysDeptService {
// sysDept.setDeptType("2"); // sysDept.setDeptType("2");
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
sysDept.setTenantId(loginUser.getNowTenantId()); sysDept.setTenantId(loginUser.getNowTenantId());
QueryWrapper<SysDept> qw = new QueryWrapper<>(sysDept); // QueryWrapper<SysDept> qw = new QueryWrapper<>(sysDept);
List<SysDept> list = sysDeptService.list(qw); // List<SysDept> list = sysDeptService.list(qw);
List<SysDept> list = deptMapper.selectDeptList(sysDept);
return list.stream().map(RespTreeSelect::new).collect(Collectors.toList()); return list.stream().map(RespTreeSelect::new).collect(Collectors.toList());
} }

@ -1,8 +1,11 @@
package com.ruoyi; package com.ruoyi;
import cn.xluobo.config.properties.AddressProperties;
import cn.xluobo.config.properties.UploadConfigProperties;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
@ -14,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
exclude = {DataSourceAutoConfiguration.class}, exclude = {DataSourceAutoConfiguration.class},
scanBasePackages = {"com.ruoyi","cn.xluobo"} scanBasePackages = {"com.ruoyi","cn.xluobo"}
) )
@EnableConfigurationProperties({UploadConfigProperties.class, AddressProperties.class})
@EnableScheduling @EnableScheduling
public class RuoYiApplication { public class RuoYiApplication {
public static void main(String[] args) { public static void main(String[] args) {

@ -40,11 +40,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
{ {
SysUser user = userService.selectUserByUserName(username); SysUser user = userService.selectUserByUserName(username);
SysTenant tenant=tenantService.getById(user.getTenantId());
if (ObjectUtil.isEmpty(tenant) || !tenant.getInUse().equals("0") || !DateUtil.date().before(tenant.getEndTime()) ){
log.info("用户所属租户:{} 异常.", tenant.getTenantName());
throw new ServiceException("用户所属租户:" + tenant.getTenantName() + " 异常");
}
if (StringUtils.isNull(user)) if (StringUtils.isNull(user))
{ {
log.info("登录用户:{} 不存在.", username); log.info("登录用户:{} 不存在.", username);
@ -60,6 +55,11 @@ public class UserDetailsServiceImpl implements UserDetailsService
log.info("登录用户:{} 已被停用.", username); log.info("登录用户:{} 已被停用.", username);
throw new ServiceException("对不起,您的账号:" + username + " 已停用"); throw new ServiceException("对不起,您的账号:" + username + " 已停用");
} }
SysTenant tenant=tenantService.getById(user.getTenantId());
if (ObjectUtil.isEmpty(tenant) || !tenant.getInUse().equals("0") || !DateUtil.date().before(tenant.getEndTime()) ){
log.info("用户所属租户:{} 异常.", tenant.getTenantName());
throw new ServiceException("用户所属租户:" + tenant.getTenantName() + " 异常");
}
return createLoginUser(user); return createLoginUser(user);
} }

Loading…
Cancel
Save