Showing
3 changed files
with
13 additions
and
16 deletions
| ... | @@ -15,29 +15,26 @@ import java.util.List; | ... | @@ -15,29 +15,26 @@ import java.util.List; |
| 15 | @Repository | 15 | @Repository |
| 16 | public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, JpaRepository<SysUser, Long> { | 16 | public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, JpaRepository<SysUser, Long> { |
| 17 | 17 | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - @Query(nativeQuery = true, value = "select TOP 1 * from t_au_user where login_name = ?1 ") | ||
| 22 | - public SysUser findByLoginName(String loginName); | ||
| 23 | - | ||
| 24 | /** | 18 | /** |
| 25 | - * 根据用户登录名list查询用户列表信息 | 19 | + * 根据登录名本地账号用户信息 |
| 26 | * | 20 | * |
| 27 | - * @param loginNames | 21 | + * @param loginName |
| 28 | * @return | 22 | * @return |
| 29 | */ | 23 | */ |
| 30 | - @Query(nativeQuery = true, value = "select * from t_au_user where login_name IN (?1) ") | 24 | + @Query(nativeQuery = true, value = "select top 1 * from t_au_user a where a.login_name = ?1 " + |
| 31 | - public List<SysUser> findUserListByLoginNames(List loginNames); | 25 | + " and a.user_source_id in( " + |
| 26 | + " select id from dbo.T_BI_DICTIONARY_ENTRIES " + | ||
| 27 | + " where dict_code='userSourceCode' and code='LOCALUSER') ") | ||
| 28 | + public SysUser findUserByLoginName(String loginName); | ||
| 32 | 29 | ||
| 33 | /** | 30 | /** |
| 34 | - * 根据登录名查询单个用户信息 | 31 | + * 根据用户登录名list查询用户列表信息 |
| 35 | * | 32 | * |
| 36 | - * @param loginName | 33 | + * @param loginNames |
| 37 | * @return | 34 | * @return |
| 38 | */ | 35 | */ |
| 39 | - @Query(nativeQuery = true, value = "select * from t_au_user where login_name = ?1") | 36 | + @Query(nativeQuery = true, value = "select * from t_au_user where login_name IN (?1) ") |
| 40 | - public SysUser findUserByLoginName(String loginName); | 37 | + public List<SysUser> findUserListByLoginNames(List loginNames); |
| 41 | 38 | ||
| 42 | @Query(nativeQuery = true, value = "select * from t_au_user where username = ?1") | 39 | @Query(nativeQuery = true, value = "select * from t_au_user where username = ?1") |
| 43 | public List<SysUser> findByUserName(String userName); | 40 | public List<SysUser> findByUserName(String userName); |
| ... | @@ -74,5 +71,4 @@ public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, Jp | ... | @@ -74,5 +71,4 @@ public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, Jp |
| 74 | */ | 71 | */ |
| 75 | @Query(nativeQuery = true,value = "select ID from T_AU_USER where IS_VALID = 1 AND ORG_NAME = 'RDE' AND CONS_DISTRIBUTION = '2'") | 72 | @Query(nativeQuery = true,value = "select ID from T_AU_USER where IS_VALID = 1 AND ORG_NAME = 'RDE' AND CONS_DISTRIBUTION = '2'") |
| 76 | public List<BigDecimal> findByDistribution(); | 73 | public List<BigDecimal> findByDistribution(); |
| 77 | - | ||
| 78 | } | 74 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -294,6 +294,7 @@ public class ChmConsignmentService { | ... | @@ -294,6 +294,7 @@ public class ChmConsignmentService { |
| 294 | result.setUpdateTime(pushTime); | 294 | result.setUpdateTime(pushTime); |
| 295 | if (!creator.equals("IDE-ICLEAR-API")){ | 295 | if (!creator.equals("IDE-ICLEAR-API")){ |
| 296 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); | 296 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); |
| 297 | + | ||
| 297 | result.setCreatorId(sysUser); | 298 | result.setCreatorId(sysUser); |
| 298 | result.setCreator(sysUser.getLoginName()); | 299 | result.setCreator(sysUser.getLoginName()); |
| 299 | } | 300 | } |
| ... | @@ -513,7 +514,7 @@ public class ChmConsignmentService { | ... | @@ -513,7 +514,7 @@ public class ChmConsignmentService { |
| 513 | ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(chmConsignment.getConsignmentCode(), DateUtils.addDate(DateUtils.getCurrentDate(),-7)); | 514 | ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(chmConsignment.getConsignmentCode(), DateUtils.addDate(DateUtils.getCurrentDate(),-7)); |
| 514 | 515 | ||
| 515 | //获取用户账号信息 | 516 | //获取用户账号信息 |
| 516 | - SysUser sysUser = sysUserRepository.findByLoginName("CUSTOMS"); | 517 | + SysUser sysUser = sysUserRepository.findUserByLoginName("CUSTOMS"); |
| 517 | //设置当前运单创建人ID | 518 | //设置当前运单创建人ID |
| 518 | chmConsignment.setCreatorId(sysUser); | 519 | chmConsignment.setCreatorId(sysUser); |
| 519 | //设置创建人名称 | 520 | //设置创建人名称 | ... | ... |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment