| | |
| | | Map map = licetuserService.liceIn(licetuser.getUserid(),licetuser.getPtype()); |
| | | if (map==null){ |
| | | licetuserService.save(licetuser); |
| | | String url = ""; |
| | | String[] split = licetuser.getLinks().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | String[] splits = split[i].split("/"); |
| | | url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | licetuser.setLinks(substring); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_licetuser(id,userid,ptype,templateid,links) " + |
| | | "values(" + "'" + licetuser.getId() + "'" + "," + |
| | | "'" + licetuser.getUserid() + "'" + "," + |
| | | "'" + licetuser.getPtype() + "'" + "," + |
| | | "'" + licetuser.getTemplateid() + "'" + "," + |
| | | "'" + licetuser.getLinks() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | // String url = ""; |
| | | // String[] split = licetuser.getLinks().split(","); |
| | | // for (int i = 0; i < split.length; i++) { |
| | | // String s = split[i].substring(26, split[i].length()); |
| | | // String[] splits = split[i].split("/"); |
| | | // url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | // } |
| | | // String substring = url.substring(0, url.length() - 1); |
| | | // licetuser.setLinks(substring); |
| | | // //数据同步 |
| | | // String s1 = |
| | | // "insert into sys_licetuser(id,userid,ptype,templateid,links) " + |
| | | // "values(" + "'" + licetuser.getId() + "'" + "," + |
| | | // "'" + licetuser.getUserid() + "'" + "," + |
| | | // "'" + licetuser.getPtype() + "'" + "," + |
| | | // "'" + licetuser.getTemplateid() + "'" + "," + |
| | | // "'" + licetuser.getLinks() + "'" + ")"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | else { |
| | | String id = map.get("id").toString(); |
| | | Integer a= Integer.parseInt(id); |
| | | licetuser.setId(a); |
| | | licetuserService.updateById(licetuser); |
| | | String url = ""; |
| | | String[] split = licetuser.getLinks().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | String[] splits = split[i].split("/"); |
| | | url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | licetuser.setLinks(substring); |
| | | String s1 = "update sys_licetuser set userid = " + "'" + licetuser.getUserid() + "'" + |
| | | ",ptype = " + "'" + licetuser.getPtype() + "'" + |
| | | ",templateid = " + "'" + licetuser.getTemplateid() + "'" + |
| | | ",links = " + "'" + licetuser.getLinks() + "'" + |
| | | " " + "where id = " + "'" + licetuser.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | // String url = ""; |
| | | // String[] split = licetuser.getLinks().split(","); |
| | | // for (int i = 0; i < split.length; i++) { |
| | | // String s = split[i].substring(26, split[i].length()); |
| | | // String[] splits = split[i].split("/"); |
| | | // url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | // } |
| | | // String substring = url.substring(0, url.length() - 1); |
| | | // licetuser.setLinks(substring); |
| | | // String s1 = "update sys_licetuser set userid = " + "'" + licetuser.getUserid() + "'" + |
| | | // ",ptype = " + "'" + licetuser.getPtype() + "'" + |
| | | // ",templateid = " + "'" + licetuser.getTemplateid() + "'" + |
| | | // ",links = " + "'" + licetuser.getLinks() + "'" + |
| | | // " " + "where id = " + "'" + licetuser.getId() + "'"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | return R.data("成功"); |
| | | } |