智慧保安后台管理-外网
tangzy
2021-09-14 98fbc479e2077cec65ead7885f70653da9d34d3f
1.ftp
4 files modified
89 ■■■■ changed files
src/main/java/org/springblade/common/constant/FtpConstant.java 32 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/FtpUtil.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 40 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -8,22 +8,22 @@
    /**
     * sql connect
     */
    String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    //String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    /**
     * sql connect
     */
    //String sql_connect_dev = "jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    String sql_connect_dev = "jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    /**
     * ftp服务器IP地址
     */
    String ftpHost_dev = "192.168.0.110";
    //String ftpHost_dev = "192.168.0.112";
    /**
     * ftp服务器IP地址
     */
    //String ftpHost_dev = "172.19.1.30";
    String ftpHost_dev = "172.19.1.30";
    /**
     * ftp服务器端口
@@ -33,33 +33,33 @@
    /**
     * ftp服务器用户名
     */
    //String ftpUserName = "yly";
    String ftpUserName = "anonymous";
    String ftpUserName = "yly";
    //String ftpUserName = "anonymous";
    /**
     * ftp服务器密码
     */
    //String ftpPassword = "Yly@123";
    String ftpPassword = "";
    String ftpPassword = "Yly@123";
    //String ftpPassword = "";
    /**
     * ftp服务器路径
     */
    //String ftpPath = "yly/anbao/";
    String ftpPath = "anbao/";
    String ftpPath = "yly/anbao/";
    //String ftpPath = "anbao/";
    /**
     * 本地路径
     */
    //String localPath = "/home/zhongsong/anbao/";
    String localPath = "D:\\anbao\\";
    String localPath = "/home/zhongsong/anbao/";
    //String localPath = "D:\\anbao\\";
    //minio内网ip
    //String ip = "http://47.49.21.216:9000";
    String ip = "http://223.82.109.183:2081";
    String ip = "http://47.49.21.216:9000";
    //String ip = "http://223.82.109.183:2081";
    //String jsonUrl = "/home/zhongsong/anbao/";
    String jsonUrl = "D:\\anbao\\";
    String jsonUrl = "/home/zhongsong/anbao/";
    //String jsonUrl = "D:\\anbao\\";
}
src/main/java/org/springblade/modules/FTP/FtpUtil.java
@@ -305,6 +305,7 @@
            e.printStackTrace();
        }
        FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "w"+response1+".json", in1);
        MysqlCenlint.deletess("w"+response1+".json");
    }
}
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -186,8 +186,8 @@
        informationService.save(information);
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getEstablishtime());
        //Integer id = information.getId();
        String s = "insert into sys_information(id,creditcode,enterprisename,representative,establishtime," +
            "registeredcapital,organizationcode,registrationnumber, enterprises, address," +
        String s = "insert into sys_information(id,creditCode,enterpriseName,representative,establishTime," +
            "registeredCapital,organizationCode,registrationNumber, enterprises, address," +
            " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell,contacts,contactscell) " +
            "values(" + "'" + information.getId() + "'" + "," + "'" + information.getCreditcode() + "'" + "," + "'" + information.getEnterprisename() + "'" + "," + "'" + information.getRepresentative() + "'" + "," +
            "'" + formatStr + "'" + "," + "'" + information.getRegisteredcapital() + "'" + "," + "'" + information.getOrganizationcode() + "'" + "," + "'" + information.getRegistrationnumber() + "'" + "," + "'" + information.getEnterprises() + "'" + "," + "'" +
@@ -222,13 +222,12 @@
             format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
        }
        //内网同步
        String s1 = "update sys_information set creditcode = " + "'" + information.getCreditcode() + "'" +
            ",enterprisename = " + "'" + information.getEnterprisename() + "'" +
        String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
            ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
            ",representative = " + "'" + information.getRepresentative() + "'" +
            ",establishtime = " + "'" + format + "'" +
            ",registeredcapital = " + "'" + information.getRegisteredcapital() + "'" +
            ",organizationcode = " + "'" + information.getOrganizationcode() + "'" +
            ",registrationnumber = " + "'" + information.getRegistrationnumber() + "'" +
            ",establishTime = " + "'" + format + "'" +
            ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
            ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
            ",enterprises = " + "'" + information.getEnterprises() + "'" +
            ",address = " + "'" + information.getAddress() + "'" +
            ",business = " + "'" + information.getBusiness() + "'" +
@@ -237,7 +236,6 @@
            ",industry = " + "'" + information.getIndustry() + "'" +
            ",departmentid = " + "'" + information.getDepartmentid() + "'" +
            ",stats = " + "'" + information.getStats() + "'" +
            ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
            ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
            ",contacts = " + "'" + information.getContacts() + "'" +
            ",contactscell = " + "'" + information.getContactscell() + "'" +
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -137,7 +137,7 @@
    public R save(@Valid @RequestBody Permit permit) throws FileNotFoundException {
        String cardid = permit.getCardid();
        String type = permit.getPtype();
        Map map = permitService.selectIn(cardid,type);
        Map map = permitService.selectIn(cardid, type);
        if (map != null) {
            String id = map.get("id").toString();
            permitService.removeByIds(Func.toLongList(id));
@@ -151,18 +151,18 @@
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid)" +
            "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'"
            + permit.getRepresentative() + "'" + "," +"'" + permit.getRegisteredcapital() + "'" + "," + "'"
            + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'"
            + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," +
            "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" +
            permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" +
            permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry()+ "'" + "," + "'"
            permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry() + "'" + "," + "'"
            + permit.getType() + "'" + "," +
            "'" + pertime + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," +
            "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
            + permit.getContactscell() + "'"+"," + "'" + permit.getJurisdiction() + "'"+
            "," + "'" + permit.getCardid() + "'"+")" ;
            + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
            "," + "'" + permit.getCardid() + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        return R.success("新增成功");
        return R.success("许可提交成功");
    }
    /**
@@ -173,7 +173,7 @@
    public R storage(@Valid @RequestBody Permit permit) {
        String cardid = permit.getCardid();
        String type = permit.getPtype();
        Map map = permitService.selectIn(cardid,type);
        Map map = permitService.selectIn(cardid, type);
        if (map != null) {
            permit.setStorage("0");
            permitService.updateById(permit);
@@ -187,8 +187,8 @@
    @PostMapping("/selectIn")
    public R selectIn(String cardid ,String type) {
        Map map = permitService.selectIn(cardid,type);
    public R selectIn(String cardid, String type) {
        Map map = permitService.selectIn(cardid, type);
        return R.data(map);
    }
@@ -202,7 +202,7 @@
        //审核通过
        if (permit.getType().equals("0")) {
            //新增组织机构和单位信息
            Information information =new Information();
            Information information = new Information();
            information.setCreditcode(permit.getCreditcode());
            information.setEnterprisename(permit.getEnterprisename());
            information.setRepresentative(permit.getRepresentative());
@@ -221,18 +221,17 @@
            information.setContactscell(permit.getContactscell());
            Dept dept = new Dept();
            //本市公司
            if (permit.getPtype().equals("0")){
            if (permit.getPtype().equals("0")) {
                Long i = 1413470343230877697L;
                dept.setParentId(i);
                dept.setAncestors("0,1413470343230877697");
            }
            //培训公司
            else if (permit.getPtype().equals("1")){
            else if (permit.getPtype().equals("1")) {
                Long i = 1418458374477549569L;
                dept.setParentId(i);
                dept.setAncestors("0,1418458374477549569");
            }
            else{
            } else {
                Long i = 1420222961377357825L;
                dept.setParentId(i);
                dept.setAncestors("0,1420222961377357825");
@@ -256,14 +255,13 @@
            user.setPassword(initPassword);
            userService.saveOrUpdate(user);
            //把附件添加单位id
            attachService.updat(information.getDepartmentid(),permit.getCardid());
            String s1 = "update sys_permit set type = " + "'" + 0 + "'" +",approve = " + "'" + permit.getApprove() + "'"+
                " " +"where id = " + "'" + permit.getId() + "'";
            attachService.updat(information.getDepartmentid(), permit.getCardid());
            String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
        else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" +",approve = " + "'" + permit.getApprove() + "'"+
                " " +"where id = " + "'" + permit.getId() + "'";
        } else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
        return R.status(permitService.updateById(permit));