tangzy
2021-11-12 dc7f4a0007e746fab860d3b85f45d6dfe7b15829
1.许可
2 files modified
256 ■■■■ changed files
src/main/java/org/springblade/modules/permit/controller/PermitController.java 132 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 124 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -140,72 +140,72 @@
    @ApiOperation(value = "修改", notes = "传入permit")
    public R update(@Valid @RequestBody Permit permit) {
        //审核通过
        if (permit.getType().equals("0")) {
            //新增组织机构和单位信息
            Information information =new Information();
            information.setCreditcode(permit.getCreditcode());
            information.setEnterprisename(permit.getEnterprisename());
            information.setRepresentative(permit.getRepresentative());
            information.setEstablishtime(permit.getEstablishtime());
            information.setRegisteredcapital(permit.getRegisteredcapital());
            information.setOrganizationcode(permit.getOrganizationcode());
            information.setRegistrationnumber(permit.getRegistrationnumber());
            information.setEnterprises(permit.getEnterprises());
            information.setAddress(permit.getAddress());
            information.setBusiness(permit.getBusiness());
            information.setRegion(permit.getRegion());
            information.setRegistration(permit.getRegistration());
            information.setIndustry(permit.getIndustry());
            information.setRepresentativecell(permit.getRepresentativecell());
            information.setContacts(permit.getContacts());
            information.setContactscell(permit.getContactscell());
            Dept dept = new Dept();
            //本市公司
            if (permit.getPtype().equals("0")){
                Long i = 1413470343230877697L;
                dept.setParentId(i);
                dept.setAncestors("0,1413470343230877697");
            }
            //培训公司
            else if (permit.getPtype().equals("1")){
                Long i = 1418458374477549569L;
                dept.setParentId(i);
                dept.setAncestors("0,1418458374477549569");
            }
            else{
                Long i = 1420222961377357825L;
                dept.setParentId(i);
                dept.setAncestors("0,1420222961377357825");
            }
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setDeptCategory(1);
            if (iDeptService.submit(dept)) {
                CacheUtil.clear(SYS_CACHE);
                // 返回懒加载树更新节点所需字段
                Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
                    .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
                String id = kv.get("id").toString();
                information.setDepartmentid(id);
            }
            informationService.save(information);
            //注册用户
            User user = new User();
            user.setAccount(permit.getEnterprisename());
            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
            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() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
        else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" +",approve = " + "'" + permit.getApprove() + "'"+
                " " +"where id = " + "'" + permit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
//        if (permit.getType().equals("0")) {
//            //新增组织机构和单位信息
//            Information information =new Information();
//            information.setCreditcode(permit.getCreditcode());
//            information.setEnterprisename(permit.getEnterprisename());
//            information.setRepresentative(permit.getRepresentative());
//            information.setEstablishtime(permit.getEstablishtime());
//            information.setRegisteredcapital(permit.getRegisteredcapital());
//            information.setOrganizationcode(permit.getOrganizationcode());
//            information.setRegistrationnumber(permit.getRegistrationnumber());
//            information.setEnterprises(permit.getEnterprises());
//            information.setAddress(permit.getAddress());
//            information.setBusiness(permit.getBusiness());
//            information.setRegion(permit.getRegion());
//            information.setRegistration(permit.getRegistration());
//            information.setIndustry(permit.getIndustry());
//            information.setRepresentativecell(permit.getRepresentativecell());
//            information.setContacts(permit.getContacts());
//            information.setContactscell(permit.getContactscell());
//            Dept dept = new Dept();
//            //本市公司
//            if (permit.getPtype().equals("0")){
//                Long i = 1413470343230877697L;
//                dept.setParentId(i);
//                dept.setAncestors("0,1413470343230877697");
//            }
//            //培训公司
//            else if (permit.getPtype().equals("1")){
//                Long i = 1418458374477549569L;
//                dept.setParentId(i);
//                dept.setAncestors("0,1418458374477549569");
//            }
//            else{
//                Long i = 1420222961377357825L;
//                dept.setParentId(i);
//                dept.setAncestors("0,1420222961377357825");
//            }
//            dept.setTenantId("000000");
//            dept.setDeptName(information.getEnterprisename());
//            dept.setDeptCategory(1);
//            if (iDeptService.submit(dept)) {
//                CacheUtil.clear(SYS_CACHE);
//                // 返回懒加载树更新节点所需字段
//                Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
//                    .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
//                String id = kv.get("id").toString();
//                information.setDepartmentid(id);
//            }
//            informationService.save(information);
//            //注册用户
//            User user = new User();
//            user.setAccount(permit.getEnterprisename());
//            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
//            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() + "'";
//            FtpUtil.sqlFileUpload(s1);
    //    }
//        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));
    }
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -136,68 +136,68 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入record")
    public R update(@Valid @RequestBody Record record) {
        //审核通过
        if (record.getType().equals("0")) {
            //新增组织机构和单位信息
            Information information =new Information();
            information.setCreditcode(record.getCreditcode());
            information.setEnterprisename(record.getEnterprisename());
            information.setRepresentative(record.getRepresentative());
            information.setEstablishtime(record.getEstablishtime());
            information.setRegisteredcapital(record.getRegisteredcapital());
            information.setOrganizationcode(record.getOrganizationcode());
            information.setRegistrationnumber(record.getRegistrationnumber());
            information.setEnterprises(record.getEnterprises());
            information.setAddress(record.getAddress());
            information.setBusiness(record.getBusiness());
            information.setRegion(record.getRegion());
            information.setRegistration(record.getRegistration());
            information.setIndustry(record.getIndustry());
            information.setRepresentativecell(record.getRepresentativecell());
            information.setContacts(record.getContacts());
            information.setContactscell(record.getContactscell());
            Dept dept = new Dept();
            //本市公司
            if (record.getPtype().equals("2")){
                Long i = 1425366663452196865L;
                dept.setParentId(i);
                dept.setAncestors("0,1425366663452196865");
            }
            //培训公司
            else {
                Long i = 1420222768149966850L;
                dept.setParentId(i);
                dept.setAncestors("0,1420222768149966850");
            }
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setDeptCategory(1);
            if (iDeptService.submit(dept)) {
                CacheUtil.clear(SYS_CACHE);
                // 返回懒加载树更新节点所需字段
                Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
                    .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
                String id = kv.get("id").toString();
                information.setDepartmentid(id);
            }
            informationService.save(information);
            //注册用户
            User user = new User();
            user.setAccount(record.getEnterprisename());
            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
            user.setPassword(initPassword);
            userService.saveOrUpdate(user);
            //把附件添加单位id
            attachService.updat(information.getDepartmentid(),record.getCardid());
            String s1 = "update sys_permit set type = " + "'" + 0 + "'" +",approve = " + "'" + record.getApprove() + "'"+
                " " +"where id = " + "'" + record.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
        else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" +",approve = " + "'" + record.getApprove() + "'"+
                " " +"where id = " + "'" + record.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
//        //审核通过
//        if (record.getType().equals("0")) {
//            //新增组织机构和单位信息
//            Information information =new Information();
//            information.setCreditcode(record.getCreditcode());
//            information.setEnterprisename(record.getEnterprisename());
//            information.setRepresentative(record.getRepresentative());
//            information.setEstablishtime(record.getEstablishtime());
//            information.setRegisteredcapital(record.getRegisteredcapital());
//            information.setOrganizationcode(record.getOrganizationcode());
//            information.setRegistrationnumber(record.getRegistrationnumber());
//            information.setEnterprises(record.getEnterprises());
//            information.setAddress(record.getAddress());
//            information.setBusiness(record.getBusiness());
//            information.setRegion(record.getRegion());
//            information.setRegistration(record.getRegistration());
//            information.setIndustry(record.getIndustry());
//            information.setRepresentativecell(record.getRepresentativecell());
//            information.setContacts(record.getContacts());
//            information.setContactscell(record.getContactscell());
//            Dept dept = new Dept();
//            //本市公司
//            if (record.getPtype().equals("2")){
//                Long i = 1425366663452196865L;
//                dept.setParentId(i);
//                dept.setAncestors("0,1425366663452196865");
//            }
//            //培训公司
//            else {
//                Long i = 1420222768149966850L;
//                dept.setParentId(i);
//                dept.setAncestors("0,1420222768149966850");
//            }
//            dept.setTenantId("000000");
//            dept.setDeptName(information.getEnterprisename());
//            dept.setDeptCategory(1);
//            if (iDeptService.submit(dept)) {
//                CacheUtil.clear(SYS_CACHE);
//                // 返回懒加载树更新节点所需字段
//                Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
//                    .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
//                String id = kv.get("id").toString();
//                information.setDepartmentid(id);
//            }
//            informationService.save(information);
//            //注册用户
//            User user = new User();
//            user.setAccount(record.getEnterprisename());
//            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
//            user.setPassword(initPassword);
//            userService.saveOrUpdate(user);
//            //把附件添加单位id
//            attachService.updat(information.getDepartmentid(),record.getCardid());
//            String s1 = "update sys_permit set type = " + "'" + 0 + "'" +",approve = " + "'" + record.getApprove() + "'"+
//                " " +"where id = " + "'" + record.getId() + "'";
//            FtpUtil.sqlFileUpload(s1);
//        }
//        else {
//            String s1 = "update sys_permit set type = " + "'" + 1 + "'" +",approve = " + "'" + record.getApprove() + "'"+
//                " " +"where id = " + "'" + record.getId() + "'";
//            FtpUtil.sqlFileUpload(s1);
//        }
        return R.status(recordService.updateById(record));
    }