Showing
3 changed files
with
27 additions
and
2 deletions
| ... | @@ -76,7 +76,12 @@ public class CustomsDataInterface { | ... | @@ -76,7 +76,12 @@ public class CustomsDataInterface { |
| 76 | String appKey=(String) request.getHeader("Appkey"); | 76 | String appKey=(String) request.getHeader("Appkey"); |
| 77 | String timeStamp=(String) request.getHeader("TimeStamp"); | 77 | String timeStamp=(String) request.getHeader("TimeStamp"); |
| 78 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp)))); | 78 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp)))); |
| 79 | - | 79 | + String checkUser = mawbService.checkUser(appId); |
| 80 | + if (!StringUtil.isEmpty(checkUser)){ | ||
| 81 | + result.setCode(ErrorCodeEnum.ERROR_30003.getCode()); | ||
| 82 | + result.setMsg(checkUser); | ||
| 83 | + return result; | ||
| 84 | + } | ||
| 80 | mawb.setAppId(appId); | 85 | mawb.setAppId(appId); |
| 81 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 86 | if(!Objects.equals(saveIClearApiLogResult,null)){ |
| 82 | log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId()); | 87 | log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId()); | ... | ... |
| ... | @@ -166,7 +166,12 @@ public class FedexDataInterface { | ... | @@ -166,7 +166,12 @@ public class FedexDataInterface { |
| 166 | String appKey=(String) request.getHeader("Appkey"); | 166 | String appKey=(String) request.getHeader("Appkey"); |
| 167 | String timeStamp=(String) request.getHeader("TimeStamp"); | 167 | String timeStamp=(String) request.getHeader("TimeStamp"); |
| 168 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLogC(fedexc,appId,appKey,new Date(Long.valueOf(timeStamp)))); | 168 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLogC(fedexc,appId,appKey,new Date(Long.valueOf(timeStamp)))); |
| 169 | - | 169 | + String checkUser = mawbService.checkUser(appId); |
| 170 | + if (!StringUtil.isEmpty(checkUser)){ | ||
| 171 | + result.setCode(ErrorCodeEnum.ERROR_30003.getCode()); | ||
| 172 | + result.setMsg(checkUser); | ||
| 173 | + return result; | ||
| 174 | + } | ||
| 170 | fedexc.setAppId(appId); | 175 | fedexc.setAppId(appId); |
| 171 | FedexMawb saveMawbFedexResult = null; | 176 | FedexMawb saveMawbFedexResult = null; |
| 172 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 177 | if(!Objects.equals(saveIClearApiLogResult,null)){ | ... | ... |
| ... | @@ -10,9 +10,11 @@ import com.erry.iclear.dateInterface.common.Constant; | ... | @@ -10,9 +10,11 @@ import com.erry.iclear.dateInterface.common.Constant; |
| 10 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 10 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 11 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 11 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 12 | import com.erry.iclear.dateInterface.entity.DictionaryEntries; | 12 | import com.erry.iclear.dateInterface.entity.DictionaryEntries; |
| 13 | +import com.erry.iclear.dateInterface.entity.SysUser; | ||
| 13 | import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | 14 | import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; |
| 14 | import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; | 15 | import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; |
| 15 | import com.erry.iclear.dateInterface.repository.MawbRepository; | 16 | import com.erry.iclear.dateInterface.repository.MawbRepository; |
| 17 | +import com.erry.iclear.dateInterface.repository.SysUserRepository; | ||
| 16 | import com.erry.iclear.dateInterface.util.HttpUtils; | 18 | import com.erry.iclear.dateInterface.util.HttpUtils; |
| 17 | import com.erry.iclear.dateInterface.util.JsonToJava; | 19 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 18 | import com.erry.iclear.dateInterface.util.StringUtil; | 20 | import com.erry.iclear.dateInterface.util.StringUtil; |
| ... | @@ -49,6 +51,9 @@ public class MawbService { | ... | @@ -49,6 +51,9 @@ public class MawbService { |
| 49 | @Autowired | 51 | @Autowired |
| 50 | private DictionaryEntriesRepository dictionaryEntriesRepository; | 52 | private DictionaryEntriesRepository dictionaryEntriesRepository; |
| 51 | 53 | ||
| 54 | + @Autowired | ||
| 55 | + private SysUserRepository sysUserRepository; | ||
| 56 | + | ||
| 52 | /** | 57 | /** |
| 53 | * 保存主单Request | 58 | * 保存主单Request |
| 54 | * @param mawb | 59 | * @param mawb |
| ... | @@ -69,6 +74,16 @@ public class MawbService { | ... | @@ -69,6 +74,16 @@ public class MawbService { |
| 69 | return map; | 74 | return map; |
| 70 | } | 75 | } |
| 71 | 76 | ||
| 77 | + public String checkUser(String loginName){ | ||
| 78 | + String result = null; | ||
| 79 | + SysUser sysUser = sysUserRepository.findUserByLoginName(loginName); | ||
| 80 | + if (sysUser == null){ | ||
| 81 | + result = "该用户不存在"; | ||
| 82 | + return result; | ||
| 83 | + } | ||
| 84 | + return result; | ||
| 85 | + } | ||
| 86 | + | ||
| 72 | 87 | ||
| 73 | public String checkMawbBaseInfo(Mawb mawb){ | 88 | public String checkMawbBaseInfo(Mawb mawb){ |
| 74 | 89 | ... | ... |
-
Please register or login to post a comment