Showing
14 changed files
with
68 additions
and
204 deletions
| ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; | ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; |
| 6 | import com.fedex.connect.common.dependencies.util.GsonUtils; | 6 | import com.fedex.connect.common.dependencies.util.GsonUtils; |
| 7 | import com.fedex.connect.common.dependencies.util.StringExtUtil; | 7 | import com.fedex.connect.common.dependencies.util.StringExtUtil; |
| 8 | import com.fedex.connect.common.dependencies.util.Utils; | 8 | import com.fedex.connect.common.dependencies.util.Utils; |
| 9 | +import com.fedex.connect.common.model.sys.User; | ||
| 9 | import com.fedex.connect.manager.common.enums.FCLSessionInfoEnum; | 10 | import com.fedex.connect.manager.common.enums.FCLSessionInfoEnum; |
| 10 | import com.fedex.connect.manager.controller.AbstractEtController; | 11 | import com.fedex.connect.manager.controller.AbstractEtController; |
| 11 | import com.fedex.connect.manager.controller.system.ISysAuthController; | 12 | import com.fedex.connect.manager.controller.system.ISysAuthController; |
| ... | @@ -128,7 +129,7 @@ public class SysAuthControllerImpl extends AbstractEtController implements ISysA | ... | @@ -128,7 +129,7 @@ public class SysAuthControllerImpl extends AbstractEtController implements ISysA |
| 128 | } else { | 129 | } else { |
| 129 | loginUser.setUserName(StringUtils.trimToEmpty(fcl_contactname)); | 130 | loginUser.setUserName(StringUtils.trimToEmpty(fcl_contactname)); |
| 130 | } | 131 | } |
| 131 | - loginUser.setUpdateTime(new Date()); | 132 | + loginUser.setModifyTime(new Date()); |
| 132 | sysUserService.update(loginUser); | 133 | sysUserService.update(loginUser); |
| 133 | } | 134 | } |
| 134 | } | 135 | } | ... | ... |
| ... | @@ -2,14 +2,10 @@ package com.fedex.connect.manager.data.dto; | ... | @@ -2,14 +2,10 @@ package com.fedex.connect.manager.data.dto; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnore; | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 4 | import com.fedex.connect.common.dependencies.contants.DatabaseConstants; | 4 | import com.fedex.connect.common.dependencies.contants.DatabaseConstants; |
| 5 | -import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; | ||
| 6 | -import com.fedex.connect.common.dependencies.enums.ResponseCode; | ||
| 7 | -import com.fedex.connect.common.dependencies.util.BytesUtils; | ||
| 8 | -import com.fedex.connect.common.dependencies.util.StringExtUtil; | ||
| 9 | import com.fedex.connect.common.dependencies.util.Utils; | 5 | import com.fedex.connect.common.dependencies.util.Utils; |
| 6 | +import com.fedex.connect.common.model.sys.User; | ||
| 10 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
| 11 | import org.apache.commons.lang3.StringUtils; | 8 | import org.apache.commons.lang3.StringUtils; |
| 12 | -import org.apache.commons.lang3.math.NumberUtils; | ||
| 13 | 9 | ||
| 14 | import java.util.Date; | 10 | import java.util.Date; |
| 15 | 11 | ||
| ... | @@ -19,119 +15,6 @@ import java.util.Date; | ... | @@ -19,119 +15,6 @@ import java.util.Date; |
| 19 | @ApiModel(value = "用户相关DTO") | 15 | @ApiModel(value = "用户相关DTO") |
| 20 | public class SysUserDto { | 16 | public class SysUserDto { |
| 21 | 17 | ||
| 22 | - public static SysUserDto dataProcessing(SysUserDto dto){ | ||
| 23 | - dto.setAccNo(Utils.trim(dto.getAccNo())); | ||
| 24 | - dto.setUserName(Utils.trim(dto.getUserName())); | ||
| 25 | - dto.setPassword(Utils.trim(dto.getPassword())); | ||
| 26 | - dto.setPassword2(Utils.trim(dto.getPassword2())); | ||
| 27 | - dto.setFedexAccNo(Utils.trim(dto.getFedexAccNo())); | ||
| 28 | - dto.setFedexAccNo2(Utils.trim(dto.getFedexAccNo2())); | ||
| 29 | - //邮箱@后面转小写处理 | ||
| 30 | - dto.setEmail(StringExtUtil.emailSuffixDispose(Utils.trim(dto.getEmail()))); | ||
| 31 | - dto.setPhone(Utils.trim(dto.getPhone())); | ||
| 32 | - dto.setCompanyName(Utils.trim(dto.getCompanyName())); | ||
| 33 | - dto.setUnifiedBusinessNum(Utils.trim(dto.getUnifiedBusinessNum())); | ||
| 34 | - dto.setCustomsSerialNum(Utils.trim(dto.getCustomsSerialNum())); | ||
| 35 | - dto.setUserSource(DatabaseConstants.USER_SOURCE_TW); | ||
| 36 | - dto.setTypeCode(DatabaseConstants.DICT_USER_DEFAULT_CODE); | ||
| 37 | - return dto; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * dto的校验方法 | ||
| 42 | - * @param dto | ||
| 43 | - * @return | ||
| 44 | - */ | ||
| 45 | - public static ResponseResultVo validatedDto(SysUserDto dto){ | ||
| 46 | - if (dto == null){ | ||
| 47 | - ResponseResultVo.fail(ResponseCode.REQUEST_PARAM_NULL.getMsg()); | ||
| 48 | - } | ||
| 49 | - //必填校验 | ||
| 50 | - if (StringUtils.isBlank(dto.getAccNo())){ | ||
| 51 | - ResponseResultVo.fail("dto_vali_user_accno_null"); | ||
| 52 | - } | ||
| 53 | - if (BytesUtils.getStrUTF8ByteLength(dto.getAccNo()) > 200){ | ||
| 54 | - ResponseResultVo.fail("dto_vali_user_accno_max"); | ||
| 55 | - } | ||
| 56 | - if (StringUtils.isBlank(dto.getUserName())){ | ||
| 57 | - ResponseResultVo.fail("dto_vali_user_name_null"); | ||
| 58 | - } | ||
| 59 | - if (BytesUtils.getStrUTF8ByteLength(dto.getUserName()) > 200){ | ||
| 60 | - ResponseResultVo.fail("dto_vali_user_name_max"); | ||
| 61 | - } | ||
| 62 | - if (StringUtils.isBlank(dto.getPassword())){ | ||
| 63 | - ResponseResultVo.fail("dto_vali_user_pwd_null"); | ||
| 64 | - } | ||
| 65 | - if (BytesUtils.getStrUTF8ByteLength(dto.getPassword()) > 255){ | ||
| 66 | - ResponseResultVo.fail("dto_vali_user_pwd_max"); | ||
| 67 | - } | ||
| 68 | - if (StringUtils.isBlank(dto.getPassword2())){ | ||
| 69 | - ResponseResultVo.fail("dto_vali_user_pwd2_null"); | ||
| 70 | - } | ||
| 71 | - if (StringUtils.equals(dto.getPassword(),dto.getPassword2())){ | ||
| 72 | - ResponseResultVo.fail("dto_vali_user_pwd3_null"); | ||
| 73 | - } | ||
| 74 | - if (StringUtils.isBlank(dto.getFedexAccNo())){ | ||
| 75 | - ResponseResultVo.fail("dto_vali_user_fed_no_null"); | ||
| 76 | - } | ||
| 77 | - if (BytesUtils.getStrUTF8ByteLength(dto.getFedexAccNo()) > 200){ | ||
| 78 | - ResponseResultVo.fail("dto_vali_user_fed_no_max"); | ||
| 79 | - } | ||
| 80 | - if (!NumberUtils.isDigits(dto.getFedexAccNo()) || dto.getFedexAccNo().length() != 9){ | ||
| 81 | - ResponseResultVo.fail("dto_vali_user_fed_no_num"); | ||
| 82 | - } | ||
| 83 | - if (StringUtils.isBlank(dto.getFedexAccNo2())){ | ||
| 84 | - ResponseResultVo.fail("dto_vali_user_fed_no_null"); | ||
| 85 | - } | ||
| 86 | - if (!NumberUtils.isDigits(dto.getFedexAccNo2()) || dto.getFedexAccNo2().length() != 9){ | ||
| 87 | - ResponseResultVo.fail("dto_vali_user_fed_no_num"); | ||
| 88 | - } | ||
| 89 | - if (StringUtils.equals(dto.getFedexAccNo(),dto.getFedexAccNo2())){ | ||
| 90 | - ResponseResultVo.fail("dto_vali_user_fed_no3_null"); | ||
| 91 | - } | ||
| 92 | - if (StringUtils.isBlank(dto.getEmail())){ | ||
| 93 | - ResponseResultVo.fail("dto_vali_user_email_null"); | ||
| 94 | - } | ||
| 95 | - if (BytesUtils.getStrUTF8ByteLength(dto.getEmail()) > 100){ | ||
| 96 | - ResponseResultVo.fail("dto_vali_user_email_max"); | ||
| 97 | - } | ||
| 98 | - if (!StringExtUtil.isEmail(dto.getEmail())){ | ||
| 99 | - ResponseResultVo.fail("dto_vali_user_email_final"); | ||
| 100 | - } | ||
| 101 | - if (StringUtils.isBlank(dto.getPhone())){ | ||
| 102 | - ResponseResultVo.fail("dto_vali_user_phone_null"); | ||
| 103 | - } | ||
| 104 | - if (BytesUtils.getStrUTF8ByteLength(dto.getPhone()) > 20){ | ||
| 105 | - ResponseResultVo.fail("dto_vali_user_phone_max"); | ||
| 106 | - } | ||
| 107 | - if (StringUtils.isBlank(dto.getCompanyName())){ | ||
| 108 | - ResponseResultVo.fail("dto_vali_user_com_name_null"); | ||
| 109 | - } | ||
| 110 | - if (BytesUtils.getStrUTF8ByteLength(dto.getCompanyName()) > 255){ | ||
| 111 | - ResponseResultVo.fail("dto_vali_user_com_name_max"); | ||
| 112 | - } | ||
| 113 | - if (StringUtils.isBlank(dto.getUnifiedBusinessNum())){ | ||
| 114 | - ResponseResultVo.fail("dto_vali_user_no_null"); | ||
| 115 | - } | ||
| 116 | - if (BytesUtils.getStrUTF8ByteLength(dto.getUnifiedBusinessNum()) > 30){ | ||
| 117 | - ResponseResultVo.fail("dto_vali_user_no_max"); | ||
| 118 | - } | ||
| 119 | - if (!StringUtils.isBlank(dto.getCustomsSerialNum()) && | ||
| 120 | - BytesUtils.getStrUTF8ByteLength(dto.getUnifiedBusinessNum()) > 30){ | ||
| 121 | - ResponseResultVo.fail("dto_vali_serlai_max"); | ||
| 122 | - } | ||
| 123 | - if (!NumberUtils.isDigits(dto.getUnifiedBusinessNum())){ | ||
| 124 | - ResponseResultVo.fail("dto_vali_user_no_final"); | ||
| 125 | - } | ||
| 126 | - if (!dto.isPolicyFlag()){ | ||
| 127 | - ResponseResultVo.fail("dto_vali_user_no_policy"); | ||
| 128 | - } | ||
| 129 | - if (!dto.isClauseFlag()){ | ||
| 130 | - ResponseResultVo.fail("dto_vali_user_no_clause"); | ||
| 131 | - } | ||
| 132 | - return ResponseResultVo.succ(null); | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | /** | 18 | /** |
| 136 | * dto 转 dao | 19 | * dto 转 dao |
| 137 | * @return | 20 | * @return |
| ... | @@ -144,22 +27,21 @@ public class SysUserDto { | ... | @@ -144,22 +27,21 @@ public class SysUserDto { |
| 144 | if (dto.getId() != null && dto.getId() != 0){ | 27 | if (dto.getId() != null && dto.getId() != 0){ |
| 145 | user.setId(dto.getId()); | 28 | user.setId(dto.getId()); |
| 146 | } | 29 | } |
| 147 | - user.setAccNo(dto.getAccNo()); | 30 | + user.setLoginName(dto.getLoginName()); |
| 148 | user.setUserName(dto.getUserName()); | 31 | user.setUserName(dto.getUserName()); |
| 149 | user.setPassword(dto.getPassword()); | 32 | user.setPassword(dto.getPassword()); |
| 150 | - user.setFedexAccNo(dto.getFedexAccNo()); | 33 | + user.setAccountNo(dto.getAccountNo()); |
| 151 | user.setEmail(dto.getEmail()); | 34 | user.setEmail(dto.getEmail()); |
| 152 | user.setPhone(dto.getPhone()); | 35 | user.setPhone(dto.getPhone()); |
| 153 | user.setCompanyName(dto.getCompanyName()); | 36 | user.setCompanyName(dto.getCompanyName()); |
| 154 | user.setUnifiedBusinessNum(dto.getUnifiedBusinessNum()); | 37 | user.setUnifiedBusinessNum(dto.getUnifiedBusinessNum()); |
| 155 | user.setCustomsSerialNum(dto.getCustomsSerialNum()); | 38 | user.setCustomsSerialNum(dto.getCustomsSerialNum()); |
| 156 | user.setCreateTime(new Date()); | 39 | user.setCreateTime(new Date()); |
| 157 | - user.setUpdateTime(new Date()); | 40 | + user.setModifyTime(new Date()); |
| 158 | - user.setPwdLastUpdTime(null); | ||
| 159 | user.setTypeId(0L); | 41 | user.setTypeId(0L); |
| 160 | user.setStatus(DatabaseConstants.GLOBAL_STATUS_VALID); | 42 | user.setStatus(DatabaseConstants.GLOBAL_STATUS_VALID); |
| 161 | user.setRemark(dto.getRemark()); | 43 | user.setRemark(dto.getRemark()); |
| 162 | - user.setUserSource(dto.getUserSource()); | 44 | + user.setTypeId(dto.getTypeId()); |
| 163 | return user; | 45 | return user; |
| 164 | } | 46 | } |
| 165 | 47 | ||
| ... | @@ -167,7 +49,7 @@ public class SysUserDto { | ... | @@ -167,7 +49,7 @@ public class SysUserDto { |
| 167 | String fcl_acc_no = DatabaseConstants.FCL_PREFIX + "_" + uuid; | 49 | String fcl_acc_no = DatabaseConstants.FCL_PREFIX + "_" + uuid; |
| 168 | String fcl_pwd = DatabaseConstants.FCL_PREFIX + "_" + uuid + "_pwd"; | 50 | String fcl_pwd = DatabaseConstants.FCL_PREFIX + "_" + uuid + "_pwd"; |
| 169 | 51 | ||
| 170 | - this.accNo = uuid; | 52 | + this.loginName = uuid; |
| 171 | if (Utils.isNotEmpty(contactname)){ | 53 | if (Utils.isNotEmpty(contactname)){ |
| 172 | this.userName = StringUtils.trimToEmpty(contactname); | 54 | this.userName = StringUtils.trimToEmpty(contactname); |
| 173 | } else { | 55 | } else { |
| ... | @@ -175,13 +57,12 @@ public class SysUserDto { | ... | @@ -175,13 +57,12 @@ public class SysUserDto { |
| 175 | } | 57 | } |
| 176 | 58 | ||
| 177 | this.password = fcl_pwd; | 59 | this.password = fcl_pwd; |
| 178 | - this.fedexAccNo = uuid; | 60 | + this.loginName = uuid; |
| 179 | this.email = null; | 61 | this.email = null; |
| 180 | this.phone = null; | 62 | this.phone = null; |
| 181 | this.companyName = null; | 63 | this.companyName = null; |
| 182 | this.unifiedBusinessNum = null; | 64 | this.unifiedBusinessNum = null; |
| 183 | this.customsSerialNum = null; | 65 | this.customsSerialNum = null; |
| 184 | - this.userSource = DatabaseConstants.USER_SOURCE_FCL; | ||
| 185 | this.typeCode = DatabaseConstants.DICT_USER_FEDEX_CODE; | 66 | this.typeCode = DatabaseConstants.DICT_USER_FEDEX_CODE; |
| 186 | } | 67 | } |
| 187 | 68 | ||
| ... | @@ -193,7 +74,7 @@ public class SysUserDto { | ... | @@ -193,7 +74,7 @@ public class SysUserDto { |
| 193 | /** | 74 | /** |
| 194 | * 用户账号 | 75 | * 用户账号 |
| 195 | */ | 76 | */ |
| 196 | - private String accNo; | 77 | + private String loginName; |
| 197 | 78 | ||
| 198 | /** | 79 | /** |
| 199 | * 姓名 | 80 | * 姓名 |
| ... | @@ -213,7 +94,7 @@ public class SysUserDto { | ... | @@ -213,7 +94,7 @@ public class SysUserDto { |
| 213 | /** | 94 | /** |
| 214 | * FedEx账户 | 95 | * FedEx账户 |
| 215 | */ | 96 | */ |
| 216 | - private String fedexAccNo; | 97 | + private String accountNo; |
| 217 | 98 | ||
| 218 | /** | 99 | /** |
| 219 | * FedEx账户 | 100 | * FedEx账户 |
| ... | @@ -277,12 +158,6 @@ public class SysUserDto { | ... | @@ -277,12 +158,6 @@ public class SysUserDto { |
| 277 | @JsonIgnore | 158 | @JsonIgnore |
| 278 | private String remark; | 159 | private String remark; |
| 279 | 160 | ||
| 280 | - /** | ||
| 281 | - * 用户信息来源。1:台湾项目注册。2:FCL | ||
| 282 | - */ | ||
| 283 | - @JsonIgnore | ||
| 284 | - private Long userSource; | ||
| 285 | - | ||
| 286 | public Long getId() { | 161 | public Long getId() { |
| 287 | return id; | 162 | return id; |
| 288 | } | 163 | } |
| ... | @@ -291,12 +166,12 @@ public class SysUserDto { | ... | @@ -291,12 +166,12 @@ public class SysUserDto { |
| 291 | this.id = id; | 166 | this.id = id; |
| 292 | } | 167 | } |
| 293 | 168 | ||
| 294 | - public String getAccNo() { | 169 | + public String getLoginName() { |
| 295 | - return accNo; | 170 | + return loginName; |
| 296 | } | 171 | } |
| 297 | 172 | ||
| 298 | - public void setAccNo(String accNo) { | 173 | + public void setLoginName(String loginName) { |
| 299 | - this.accNo = accNo; | 174 | + this.loginName = loginName; |
| 300 | } | 175 | } |
| 301 | 176 | ||
| 302 | public String getUserName() { | 177 | public String getUserName() { |
| ... | @@ -315,12 +190,28 @@ public class SysUserDto { | ... | @@ -315,12 +190,28 @@ public class SysUserDto { |
| 315 | this.password = password; | 190 | this.password = password; |
| 316 | } | 191 | } |
| 317 | 192 | ||
| 318 | - public String getFedexAccNo() { | 193 | + public String getPassword2() { |
| 319 | - return fedexAccNo; | 194 | + return password2; |
| 195 | + } | ||
| 196 | + | ||
| 197 | + public void setPassword2(String password2) { | ||
| 198 | + this.password2 = password2; | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + public String getAccountNo() { | ||
| 202 | + return accountNo; | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + public void setAccountNo(String accountNo) { | ||
| 206 | + this.accountNo = accountNo; | ||
| 320 | } | 207 | } |
| 321 | 208 | ||
| 322 | - public void setFedexAccNo(String fedexAccNo) { | 209 | + public String getFedexAccNo2() { |
| 323 | - this.fedexAccNo = fedexAccNo; | 210 | + return fedexAccNo2; |
| 211 | + } | ||
| 212 | + | ||
| 213 | + public void setFedexAccNo2(String fedexAccNo2) { | ||
| 214 | + this.fedexAccNo2 = fedexAccNo2; | ||
| 324 | } | 215 | } |
| 325 | 216 | ||
| 326 | public String getEmail() { | 217 | public String getEmail() { |
| ... | @@ -371,28 +262,20 @@ public class SysUserDto { | ... | @@ -371,28 +262,20 @@ public class SysUserDto { |
| 371 | this.typeId = typeId; | 262 | this.typeId = typeId; |
| 372 | } | 263 | } |
| 373 | 264 | ||
| 374 | - public Long getStatus() { | 265 | + public String getTypeCode() { |
| 375 | - return status; | 266 | + return typeCode; |
| 376 | - } | ||
| 377 | - | ||
| 378 | - public void setStatus(Long status) { | ||
| 379 | - this.status = status; | ||
| 380 | - } | ||
| 381 | - | ||
| 382 | - public String getPassword2() { | ||
| 383 | - return password2; | ||
| 384 | } | 267 | } |
| 385 | 268 | ||
| 386 | - public void setPassword2(String password2) { | 269 | + public void setTypeCode(String typeCode) { |
| 387 | - this.password2 = password2; | 270 | + this.typeCode = typeCode; |
| 388 | } | 271 | } |
| 389 | 272 | ||
| 390 | - public String getFedexAccNo2() { | 273 | + public Long getStatus() { |
| 391 | - return fedexAccNo2; | 274 | + return status; |
| 392 | } | 275 | } |
| 393 | 276 | ||
| 394 | - public void setFedexAccNo2(String fedexAccNo2) { | 277 | + public void setStatus(Long status) { |
| 395 | - this.fedexAccNo2 = fedexAccNo2; | 278 | + this.status = status; |
| 396 | } | 279 | } |
| 397 | 280 | ||
| 398 | public boolean isPolicyFlag() { | 281 | public boolean isPolicyFlag() { |
| ... | @@ -418,45 +301,4 @@ public class SysUserDto { | ... | @@ -418,45 +301,4 @@ public class SysUserDto { |
| 418 | public void setRemark(String remark) { | 301 | public void setRemark(String remark) { |
| 419 | this.remark = remark; | 302 | this.remark = remark; |
| 420 | } | 303 | } |
| 421 | - | ||
| 422 | - public Long getUserSource() { | ||
| 423 | - return userSource; | ||
| 424 | - } | ||
| 425 | - | ||
| 426 | - public void setUserSource(Long userSource) { | ||
| 427 | - this.userSource = userSource; | ||
| 428 | - } | ||
| 429 | - | ||
| 430 | - public String getTypeCode() { | ||
| 431 | - return typeCode; | ||
| 432 | - } | ||
| 433 | - | ||
| 434 | - public void setTypeCode(String typeCode) { | ||
| 435 | - this.typeCode = typeCode; | ||
| 436 | - } | ||
| 437 | - | ||
| 438 | - public SysUserDto() { | ||
| 439 | - } | ||
| 440 | - | ||
| 441 | - public SysUserDto(Long id, String accNo, String userName, String password, String password2, String fedexAccNo, String fedexAccNo2, String email, String phone, String companyName, String unifiedBusinessNum, String customsSerialNum, Long typeId, String typeCode, Long status, boolean policyFlag, boolean clauseFlag, String remark, Long userSource) { | ||
| 442 | - this.id = id; | ||
| 443 | - this.accNo = accNo; | ||
| 444 | - this.userName = userName; | ||
| 445 | - this.password = password; | ||
| 446 | - this.password2 = password2; | ||
| 447 | - this.fedexAccNo = fedexAccNo; | ||
| 448 | - this.fedexAccNo2 = fedexAccNo2; | ||
| 449 | - this.email = email; | ||
| 450 | - this.phone = phone; | ||
| 451 | - this.companyName = companyName; | ||
| 452 | - this.unifiedBusinessNum = unifiedBusinessNum; | ||
| 453 | - this.customsSerialNum = customsSerialNum; | ||
| 454 | - this.typeId = typeId; | ||
| 455 | - this.typeCode = typeCode; | ||
| 456 | - this.status = status; | ||
| 457 | - this.policyFlag = policyFlag; | ||
| 458 | - this.clauseFlag = clauseFlag; | ||
| 459 | - this.remark = remark; | ||
| 460 | - this.userSource = userSource; | ||
| 461 | - } | ||
| 462 | } | 304 | } | ... | ... |
| ... | @@ -4,6 +4,8 @@ import com.fedex.connect.common.dao.bi.DictionaryEntriesMapper; | ... | @@ -4,6 +4,8 @@ import com.fedex.connect.common.dao.bi.DictionaryEntriesMapper; |
| 4 | import com.fedex.connect.common.dao.log.UserLoginInfoMapper; | 4 | import com.fedex.connect.common.dao.log.UserLoginInfoMapper; |
| 5 | import com.fedex.connect.common.dao.sys.RedisSlabMapper; | 5 | import com.fedex.connect.common.dao.sys.RedisSlabMapper; |
| 6 | import com.fedex.connect.common.dao.sys.RoleMapper; | 6 | import com.fedex.connect.common.dao.sys.RoleMapper; |
| 7 | +import com.fedex.connect.common.dao.sys.UserMapper; | ||
| 8 | +import com.fedex.connect.common.dao.sys.UserRoleMapper; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 10 | ||
| 9 | public class BaseDao { | 11 | public class BaseDao { | ... | ... |
| 1 | package com.fedex.connect.manager.repository.repo.sys; | 1 | package com.fedex.connect.manager.repository.repo.sys; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.sys.User; | ||
| 4 | +import com.fedex.connect.common.model.sys.UserExample; | ||
| 5 | + | ||
| 3 | import java.util.List; | 6 | import java.util.List; |
| 4 | 7 | ||
| 5 | public interface IUserRepository { | 8 | public interface IUserRepository { | ... | ... |
| 1 | package com.fedex.connect.manager.repository.repo.sys; | 1 | package com.fedex.connect.manager.repository.repo.sys; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.sys.UserRole; | ||
| 4 | +import com.fedex.connect.common.model.sys.UserRoleExample; | ||
| 5 | + | ||
| 3 | import java.util.List; | 6 | import java.util.List; |
| 4 | 7 | ||
| 5 | public interface IUserRoleRepository { | 8 | public interface IUserRoleRepository { | ... | ... |
| 1 | package com.fedex.connect.manager.repository.repo.sys.impl; | 1 | package com.fedex.connect.manager.repository.repo.sys.impl; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.sys.User; | ||
| 4 | +import com.fedex.connect.common.model.sys.UserExample; | ||
| 3 | import com.fedex.connect.manager.repository.base.BaseDao; | 5 | import com.fedex.connect.manager.repository.base.BaseDao; |
| 4 | import com.fedex.connect.manager.repository.repo.sys.IUserRepository; | 6 | import com.fedex.connect.manager.repository.repo.sys.IUserRepository; |
| 5 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; | ... | ... |
| 1 | package com.fedex.connect.manager.repository.repo.sys.impl; | 1 | package com.fedex.connect.manager.repository.repo.sys.impl; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.sys.UserRole; | ||
| 4 | +import com.fedex.connect.common.model.sys.UserRoleExample; | ||
| 3 | import com.fedex.connect.manager.repository.base.BaseDao; | 5 | import com.fedex.connect.manager.repository.base.BaseDao; |
| 4 | import com.fedex.connect.manager.repository.repo.sys.IUserRoleRepository; | 6 | import com.fedex.connect.manager.repository.repo.sys.IUserRoleRepository; |
| 5 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; | ... | ... |
| ... | @@ -3,6 +3,8 @@ package com.fedex.connect.manager.service.base; | ... | @@ -3,6 +3,8 @@ package com.fedex.connect.manager.service.base; |
| 3 | 3 | ||
| 4 | import com.fedex.connect.common.dao.log.UserLoginInfoMapper; | 4 | import com.fedex.connect.common.dao.log.UserLoginInfoMapper; |
| 5 | import com.fedex.connect.common.dao.sys.RoleMapper; | 5 | import com.fedex.connect.common.dao.sys.RoleMapper; |
| 6 | +import com.fedex.connect.common.dao.sys.UserMapper; | ||
| 7 | +import com.fedex.connect.common.dao.sys.UserRoleMapper; | ||
| 6 | import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; | 8 | import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; |
| 7 | import com.fedex.connect.manager.repository.repo.log.IUserLoginLogRepository; | 9 | import com.fedex.connect.manager.repository.repo.log.IUserLoginLogRepository; |
| 8 | import com.fedex.connect.manager.repository.repo.sys.*; | 10 | import com.fedex.connect.manager.repository.repo.sys.*; | ... | ... |
| 1 | package com.fedex.connect.manager.service.sys; | 1 | package com.fedex.connect.manager.service.sys; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; | 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; |
| 4 | +import com.fedex.connect.common.model.sys.User; | ||
| 4 | import com.fedex.connect.manager.data.dto.LoginRequest; | 5 | import com.fedex.connect.manager.data.dto.LoginRequest; |
| 5 | import com.google.gson.JsonObject; | 6 | import com.google.gson.JsonObject; |
| 6 | 7 | ... | ... |
| 1 | package com.fedex.connect.manager.service.sys; | 1 | package com.fedex.connect.manager.service.sys; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.sys.User; | ||
| 3 | import com.fedex.connect.manager.data.dto.SysUserDto; | 4 | import com.fedex.connect.manager.data.dto.SysUserDto; |
| 4 | 5 | ||
| 5 | public interface ISysUserService { | 6 | public interface ISysUserService { | ... | ... |
| ... | @@ -9,6 +9,7 @@ import com.fedex.connect.common.dependencies.util.GsonUtils; | ... | @@ -9,6 +9,7 @@ import com.fedex.connect.common.dependencies.util.GsonUtils; |
| 9 | import com.fedex.connect.common.dependencies.util.JwtTokenUtils; | 9 | import com.fedex.connect.common.dependencies.util.JwtTokenUtils; |
| 10 | import com.fedex.connect.common.model.sys.RedisSlab; | 10 | import com.fedex.connect.common.model.sys.RedisSlab; |
| 11 | import com.fedex.connect.common.model.sys.Role; | 11 | import com.fedex.connect.common.model.sys.Role; |
| 12 | +import com.fedex.connect.common.model.sys.User; | ||
| 12 | import com.fedex.connect.manager.data.dto.LoginRequest; | 13 | import com.fedex.connect.manager.data.dto.LoginRequest; |
| 13 | import com.fedex.connect.manager.service.base.AbstractEtService; | 14 | import com.fedex.connect.manager.service.base.AbstractEtService; |
| 14 | import com.fedex.connect.manager.service.sys.IRedisUtilService; | 15 | import com.fedex.connect.manager.service.sys.IRedisUtilService; |
| ... | @@ -58,7 +59,7 @@ public class SysAuthServiceImpl extends AbstractEtService implements ISysAuthSer | ... | @@ -58,7 +59,7 @@ public class SysAuthServiceImpl extends AbstractEtService implements ISysAuthSer |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | //存进redis的token,8小时有效期 | 61 | //存进redis的token,8小时有效期 |
| 61 | - String token = JwtTokenUtils.createAccessToken(user.getAccNo(), user.getId().toString(), roleCodeList, loginRequest.getRememberMe()); | 62 | + String token = JwtTokenUtils.createAccessToken(user.getLoginName(), user.getId().toString(), roleCodeList, loginRequest.getRememberMe()); |
| 62 | try { | 63 | try { |
| 63 | int redisExpireTime = loginRequest.getRememberMe() ? 8 : 2; | 64 | int redisExpireTime = loginRequest.getRememberMe() ? 8 : 2; |
| 64 | redisUtilService.set(RedisConstants.REDIS_KEY_TOKEN + user.getId(), token, redisExpireTime); | 65 | redisUtilService.set(RedisConstants.REDIS_KEY_TOKEN + user.getId(), token, redisExpireTime); | ... | ... |
| ... | @@ -6,6 +6,8 @@ import com.fedex.connect.common.dependencies.util.Utils; | ... | @@ -6,6 +6,8 @@ import com.fedex.connect.common.dependencies.util.Utils; |
| 6 | import com.fedex.connect.common.model.bi.DictionaryEntries; | 6 | import com.fedex.connect.common.model.bi.DictionaryEntries; |
| 7 | import com.fedex.connect.common.model.sys.Role; | 7 | import com.fedex.connect.common.model.sys.Role; |
| 8 | import com.fedex.connect.common.model.sys.RoleExample; | 8 | import com.fedex.connect.common.model.sys.RoleExample; |
| 9 | +import com.fedex.connect.common.model.sys.UserRole; | ||
| 10 | +import com.fedex.connect.common.model.sys.UserRoleExample; | ||
| 9 | import com.fedex.connect.manager.data.model.LogShowModel; | 11 | import com.fedex.connect.manager.data.model.LogShowModel; |
| 10 | import com.fedex.connect.manager.service.base.AbstractEtService; | 12 | import com.fedex.connect.manager.service.base.AbstractEtService; |
| 11 | import com.fedex.connect.manager.service.sys.ISysRoleService; | 13 | import com.fedex.connect.manager.service.sys.ISysRoleService; | ... | ... |
| 1 | package com.fedex.connect.manager.service.sys.impl; | 1 | package com.fedex.connect.manager.service.sys.impl; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.contants.DatabaseConstants; | 3 | import com.fedex.connect.common.dependencies.contants.DatabaseConstants; |
| 4 | +import com.fedex.connect.common.model.sys.UserRole; | ||
| 4 | import com.fedex.connect.manager.data.model.LogShowModel; | 5 | import com.fedex.connect.manager.data.model.LogShowModel; |
| 5 | import com.fedex.connect.manager.service.base.AbstractEtService; | 6 | import com.fedex.connect.manager.service.base.AbstractEtService; |
| 6 | import com.fedex.connect.manager.service.sys.ISysUserRoleService; | 7 | import com.fedex.connect.manager.service.sys.ISysUserRoleService; |
| ... | @@ -34,7 +35,7 @@ public class SysUserRoleServiceImpl extends AbstractEtService implements ISysUse | ... | @@ -34,7 +35,7 @@ public class SysUserRoleServiceImpl extends AbstractEtService implements ISysUse |
| 34 | userRole.setRoleId(roleId); | 35 | userRole.setRoleId(roleId); |
| 35 | userRole.setStatus(DatabaseConstants.GLOBAL_STATUS_VALID); | 36 | userRole.setStatus(DatabaseConstants.GLOBAL_STATUS_VALID); |
| 36 | userRole.setCreateTime(new Date()); | 37 | userRole.setCreateTime(new Date()); |
| 37 | - userRole.setUpdateTime(new Date()); | 38 | + userRole.setModifyTime(new Date()); |
| 38 | return userRoleRepository.insert(userRole); | 39 | return userRoleRepository.insert(userRole); |
| 39 | } catch (Exception e){ | 40 | } catch (Exception e){ |
| 40 | log.error(LogShowModel.showException("Exception",e)); | 41 | log.error(LogShowModel.showException("Exception",e)); | ... | ... |
| ... | @@ -7,6 +7,8 @@ import com.fedex.connect.common.dependencies.contants.DatabaseConstants; | ... | @@ -7,6 +7,8 @@ import com.fedex.connect.common.dependencies.contants.DatabaseConstants; |
| 7 | import com.fedex.connect.common.dependencies.util.Utils; | 7 | import com.fedex.connect.common.dependencies.util.Utils; |
| 8 | import com.fedex.connect.common.model.bi.DictionaryEntries; | 8 | import com.fedex.connect.common.model.bi.DictionaryEntries; |
| 9 | import com.fedex.connect.common.model.sys.Role; | 9 | import com.fedex.connect.common.model.sys.Role; |
| 10 | +import com.fedex.connect.common.model.sys.User; | ||
| 11 | +import com.fedex.connect.common.model.sys.UserExample; | ||
| 10 | import com.fedex.connect.manager.data.dto.SysUserDto; | 12 | import com.fedex.connect.manager.data.dto.SysUserDto; |
| 11 | import com.fedex.connect.manager.data.model.LogShowModel; | 13 | import com.fedex.connect.manager.data.model.LogShowModel; |
| 12 | import com.fedex.connect.manager.service.base.AbstractEtService; | 14 | import com.fedex.connect.manager.service.base.AbstractEtService; |
| ... | @@ -58,8 +60,7 @@ public class SysUserServiceImpl extends AbstractEtService implements ISysUserSer | ... | @@ -58,8 +60,7 @@ public class SysUserServiceImpl extends AbstractEtService implements ISysUserSer |
| 58 | UserExample example = new UserExample(); | 60 | UserExample example = new UserExample(); |
| 59 | UserExample.Criteria criteria = example.createCriteria(); | 61 | UserExample.Criteria criteria = example.createCriteria(); |
| 60 | criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID); | 62 | criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID); |
| 61 | - criteria.andUserSourceEqualTo(DatabaseConstants.USER_SOURCE_FCL); | 63 | + criteria.andLoginNameEqualTo(fclUuid); |
| 62 | - criteria.andAccNoEqualTo(fclUuid); | ||
| 63 | //criteria.andFedexAccNoEqualTo(fclUuid); | 64 | //criteria.andFedexAccNoEqualTo(fclUuid); |
| 64 | example.setOrderByClause("ID DESC"); | 65 | example.setOrderByClause("ID DESC"); |
| 65 | 66 | ... | ... |
-
Please register or login to post a comment