| | |
| | | package org.springblade.modules.system.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import net.sf.json.JSONObject; |
| | | import org.springblade.common.utils.HttpClientUtils; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.FTP.Result; |
| | | import org.springblade.modules.system.dto.UserDTO; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | import static org.springblade.common.config.FtpConfig.qfqkBaseApiUrl; |
| | | import static org.springblade.modules.FTP.DataHandler.handlerUserInfo; |
| | | |
| | | @Service |
| | | public class MyAsyncService { |
| | |
| | | userDTO.setPhone(user.getPhone()); |
| | | userDTO.setIsDeleted(user.getIsDeleted()); |
| | | userDTO.setRealName(user.getRealName()); |
| | | userDTO.setSecurityId(user.getId().toString()); |
| | | //装换为 json |
| | | JSONObject jsonObject = JSONObject.fromObject(userDTO); |
| | | //发送请求 |
| | | try { |
| | | System.out.println("发起异步推送qfqk----用户新增"); |
| | | HttpClientUtils.httpPostWithjson(requestUrl,jsonObject.toString()); |
| | | System.out.println("用户新增请求已发送...."); |
| | | } catch (IOException e) { |
| | |
| | | userDTO.setSex(user.getSex()); |
| | | userDTO.setAvatar(user.getAvatar()); |
| | | userDTO.setExamination_type(user.getExaminationType()); |
| | | userDTO.setSecurityId(user.getId().toString()); |
| | | //装换为 json |
| | | JSONObject jsonObject = JSONObject.fromObject(userDTO); |
| | | //发送请求 |
| | | try { |
| | | System.out.println("发起异步推送qfqk----用户更新"); |
| | | HttpClientUtils.httpPostWithjson(requestUrl,jsonObject.toString()); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | /** |
| | | * 用户审查FTP |
| | | * @param user |
| | | */ |
| | | @Async |
| | | public void userExamineFTP(User user) { |
| | | FtpUtil.sqlFileUploadUserExamine(user); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * test |
| | | * @param user |
| | | */ |
| | |
| | | userDTO.setPhone(user.getPhone()); |
| | | userDTO.setIsDeleted(user.getIsDeleted()); |
| | | userDTO.setRealName(user.getRealName()); |
| | | userDTO.setSecurityId(user.getId().toString()); |
| | | //装换为 json |
| | | JSONObject jsonObject = JSONObject.fromObject(userDTO); |
| | | //发送请求 |
| | |
| | | public void FTPObjectList(Map<String, Object> map) { |
| | | FtpUtil.objectFileUploadList(map); |
| | | } |
| | | |
| | | /** |
| | | * 存入集合 |
| | | * @param map |
| | | */ |
| | | public void FTPObjectListUserId(Map<String, Object> map) { |
| | | FtpUtil.objectFileUploadListUserId(map); |
| | | } |
| | | |
| | | /** |
| | | * 查询保安员证编号位数 |
| | | * @param map |
| | | */ |
| | | public void FTPSecurityNumberBit(Map<String, Object> map) { |
| | | FtpUtil.getSecurityNumberBit(map); |
| | | } |
| | | |
| | | /** |
| | | * 考试实操成绩推送内网导入 |
| | | * @param map |
| | | */ |
| | | public void FTPObjectExamScore(Map<String, Object> map) { |
| | | FtpUtil.objectFileUploadExamScore(map); |
| | | } |
| | | |
| | | /** |
| | | * 管理员导入保安人员并创建保安证编号 |
| | | * @param map |
| | | */ |
| | | public void FTPSecurityPaperAndUserImport(Map<String, Object> map) { |
| | | FtpUtil.getSecurityPaperAndUserImport(map); |
| | | } |
| | | } |