| | |
| | | import org.springblade.core.tool.utils.*; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.FTP.Monitor; |
| | | import org.springblade.modules.FTP.Result; |
| | | import org.springblade.modules.accreditation.entity.AccreditationRecords; |
| | | import org.springblade.modules.accreditation.service.AccreditationRecordsService; |
| | | import org.springblade.modules.dispatcher.entity.Dispatcher; |
| | |
| | | user.setDispatch("1"); |
| | | user.setExaminationType("0"); |
| | | user.setAccount(user.getCardid()); |
| | | user.setStatus(1); |
| | | |
| | | User user1 = new User(); |
| | | user1.setIsDeleted(0); |
| | |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | user.setDispatch("1"); |
| | | user.setExaminationType("0"); |
| | | user.setAccount(user.getCardid()); |
| | | user.setAccount(user.getRealName()); |
| | | |
| | | //密码加密 |
| | | if (Func.isNotEmpty(user.getCardid())) { |
| | |
| | | myAsyncService.FTPObject(map); |
| | | |
| | | int count = 0; |
| | | boolean flag = false; |
| | | R result = new R(); |
| | | int flag = 1; |
| | | Result result = new Result(); |
| | | //调用ftp获取返回数据 |
| | | while (true){ |
| | | Thread.sleep(1000); |
| | |
| | | result = Monitor.isFTPFileExist(uuid); |
| | | //如果返回true,就退处 |
| | | if (result.getCode()==200){ |
| | | flag = true; |
| | | flag = 1; |
| | | break; |
| | | }else if (result.getCode()==201){ |
| | | flag = 2; |
| | | break; |
| | | }else if (result.getCode()==202){ |
| | | flag = 3; |
| | | break; |
| | | }else { |
| | | //计数 |
| | |
| | | } |
| | | } |
| | | } |
| | | if (flag) { |
| | | if (flag==1 || flag==2) { |
| | | //返回 |
| | | return R.data(200, null, "新增成功!"); |
| | | }else if (flag==3){ |
| | | throw new ServiceException(result.getMsg()); |
| | | }else { |
| | | //返回 |
| | | return R.data(400, null, "新增失败!"); |