| | |
| | | Map map = JSON.parseObject(json, Map.class); |
| | | //获取结果 |
| | | Object o = map.get(uuid); |
| | | System.out.println("o = " + o); |
| | | if (null== o || o.equals("")){ |
| | | return new Result(400,null,"uuid 不匹配",null); |
| | | }else { |
| | | //转换 |
| | | List<Result> results = JSON.parseArray(o.toString(), Result.class); |
| | | return new Result(200,"成功响应数据",results); |
| | | Result result = JSON.parseObject(o.toString(), Result.class); |
| | | System.out.println("result = " + result); |
| | | return result; |
| | | } |
| | | } |
| | | |
| | |
| | | public static void objectFileUploadList(Map<String, Object> map) { |
| | | String json1 = JSON.toJSONString(map); |
| | | String response1 = String.valueOf((new Date()).getTime()); |
| | | OutJson.createJsonFile(json1, localPath, "ol"+response1); |
| | | OutJson.createJsonFile(json1, localPath, "l"+response1); |
| | | FileInputStream in1 = null; |
| | | try { |
| | | in1 = new FileInputStream(new File(localPath + "ol"+response1+".json")); |
| | | in1 = new FileInputStream(new File(localPath + "l"+response1+".json")); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "ol"+response1+".json", in1); |
| | | MysqlCenlint.deletess("ol"+response1+".json"); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "l"+response1+".json", in1); |
| | | MysqlCenlint.deletess("l"+response1+".json"); |
| | | } |
| | | } |
| | |
| | | String s = OutJson.TestJson(fileName); |
| | | //数据处理 |
| | | Result result = DataHandler.handlerList(s,uuid); |
| | | //删除本地文件 |
| | | MysqlCenlint.deletess(fileName); |
| | | //删除 ftp 文件 |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, fileName); |
| | | //匹配上了删除文件 |
| | | if (result.getCode()==200) { |
| | | //删除本地文件 |
| | | MysqlCenlint.deletess(fileName); |
| | | //删除 ftp 文件 |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, fileName); |
| | | //返回 |
| | | return new Result(200,"成功响应数据",result.getData()); |
| | | return result; |
| | | } |
| | | is.close(); |
| | | ftp.completePendingCommand(); |
| | |
| | | |
| | | private User user; |
| | | |
| | | private Result result; |
| | | |
| | | private List<Result> data; |
| | | |
| | | public Result(Integer code, String msg, List<Result> data) { |
| | |
| | | this.data = data; |
| | | } |
| | | |
| | | public Result(Integer code, String msg, Result result) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.result = result; |
| | | } |
| | | |
| | | public Result() { |
| | | } |
| | | |
| | |
| | | * @param updateList |
| | | * @return |
| | | */ |
| | | @SqlParser(filter = true) |
| | | void batchUpdateUserList(@Param("list") List<User> updateList); |
| | | } |
| | |
| | | |
| | | <!-- 批量更新用户数据 --> |
| | | <update id="batchUpdateUserList" parameterType="java.util.List"> |
| | | <foreach collection="list" item="user" index="index" open="" close="" separator=";"> |
| | | update blade_user |
| | | <set> |
| | | account=${user.account} |
| | | </set> |
| | | <set> |
| | | password=${user.password} |
| | | </set> |
| | | <set> |
| | | real_name=${user.realName} |
| | | </set> |
| | | <set> |
| | | phone=${user.phone} |
| | | </set> |
| | | <set> |
| | | registered=${user.registered} |
| | | </set> |
| | | <set> |
| | | securitynumber=${user.securitynumber} |
| | | </set> |
| | | <set> |
| | | hold=${user.hold} |
| | | </set> |
| | | where id = ${user.id} |
| | | <foreach collection="list" item="user" index="index" separator=";"> |
| | | update blade_user |
| | | set account = #{user.account}, |
| | | PASSWORD = #{user.password}, |
| | | real_name = #{user.realName}, |
| | | phone = #{user.registered}, |
| | | registered = #{user.registered}, |
| | | securitynumber = #{user.securitynumber}, |
| | | hold = #{user.hold} where id = #{user.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | |
| | | Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | |
| | | if (null!=user.getSecuritynumber() && !user.getSecuritynumber().equals("")){ |
| | | user.setHold("1"); |
| | | }else { |
| | | user.setHold("2"); |
| | | } |
| | | |
| | | //性别 |
| | | if (null != userExcel.getSex()) { |
| | | if (userExcel.getSex().equals("男")) { |
| | |
| | | //设置账号 |
| | | user.setAccount(user.getRealName()); |
| | | //加密 |
| | | if (Func.isNotEmpty(user.getPassword())) { |
| | | user.setPassword(DigestUtil.encrypt(user.getCardid().substring(user.getCardid().length() - 6))); |
| | | } |
| | | user.setPassword(DigestUtil.encrypt(user.getCardid().substring(user.getCardid().length() - 6))); |
| | | user.setCreateTime(new Date()); |
| | | user.setUpdateTime(new Date()); |
| | | user.setDispatch("1"); |
| | | user.setExaminationType("0"); |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | //调用ftp获取返回数据 |
| | | result = Monitor.getFtpDataByUuidList(null); |
| | | result = Monitor.getFtpDataByUuidList(uuid); |
| | | //如果返回true,就退处 |
| | | if (result.getCode() == 200) { |
| | | break; |
| | |
| | | User user = handlerUserInfo(uuid); |
| | | if (result1.getCode()==200){ |
| | | user.setId(result1.getUserId()); |
| | | this.save(user); |
| | | //加入新增集合 |
| | | addList.add(user); |
| | | // addList.add(user); |
| | | } |
| | | if (result1.getCode()==201){ |
| | | user.setId(result1.getUserId()); |
| | | user.setCreateTime(null); |
| | | this.updateById(user); |
| | | //加入更新集合 |
| | | updateList.add(user); |
| | | // updateList.add(user); |
| | | } |
| | | if (result1.getCode()==202){ |
| | | status.set(false); |