tangzy
2021-07-29 9461224833a70927fe602f678d5622a9f2e42e84
1.单位接口调整
7 files modified
86 ■■■■ changed files
src/main/java/org/springblade/common/utils/arg.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 71 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/performance/entity/Performance.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/utils/arg.java
@@ -19,7 +19,7 @@
import java.util.Set;
public class arg {
    public static String url = "http://192.168.0.114:80";
    public static String url = "http://192.168.0.109:80";
    public static String test01(String path, Object obj) throws Exception {
        CloseableHttpClient httpClient = HttpClients.createDefault();
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -46,7 +46,7 @@
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
 *  控制器
 * 控制器
 *
 * @author BladeX
 * @since 2021-07-07
@@ -101,13 +101,43 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入information")
    public R save(@Valid @RequestBody Information information) throws Exception {
        Dept dept= new Dept();
        Long i = 1413470343230877697L;
        dept.setParentId(i);
        dept.setTenantId("000000");
        dept.setDeptName(information.getEnterprisename());
        dept.setAncestors("0,1413470343230877697");
        dept.setDeptCategory(1);
        Dept dept = new Dept();
        //自招保安公司
        if (information.getStats().equals("0")) {
            Long i = 1420222768149966850L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setAncestors("0,1420222768149966850");
            dept.setDeptCategory(1);
        }
        //保安培训公司
        if (information.getStats().equals("1")) {
            Long i = 1418458374477549569L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setAncestors("0,1418458374477549569");
            dept.setDeptCategory(1);
        }
        //保安服务公司
        if (information.getStats().equals("2")) {
            Long i = 1413470343230877697L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setAncestors("0,1413470343230877697");
            dept.setDeptCategory(1);
        }
        //武装守押公司
        if (information.getStats().equals("3")) {
            Long i = 1420222961377357825L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setAncestors("0,1420222961377357825");
            dept.setDeptCategory(1);
        }
        if (iDeptService.submit(dept)) {
            CacheUtil.clear(SYS_CACHE);
            // 返回懒加载树更新节点所需字段
@@ -116,7 +146,7 @@
            String id = kv.get("id").toString();
            information.setDepartmentid(id);
        }
        arg.test01(arg.url+"/information/save",information);
        arg.test01(arg.url + "/information/save", information);
        return R.status(informationService.save(information));
    }
@@ -127,7 +157,7 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入information")
    public R update(@Valid @RequestBody Information information) throws Exception {
        arg.test01(arg.url+"/information/update",information);
        arg.test01(arg.url + "/information/update", information);
        return R.status(informationService.updateById(information));
    }
@@ -148,11 +178,22 @@
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(String creditcode) throws Exception {
        informationService.deleteIn(creditcode);
        informationService.deleteSh(creditcode);
        informationService.deleteMe(creditcode);
        arg.sendPostRemoveByIds(arg.url+"/information/remove",creditcode);
    public R remove(String creditcode, String departmentid) throws Exception {
        String[] strArray = creditcode.split(",");
        String[] strArrays = departmentid.split(",");
        for (int i = 0; i < strArray.length; i++) {
            informationService.deleteIn(strArray[i]);
            informationService.deleteSh(strArray[i]);
            informationService.deleteMe(strArray[i]);
            arg.sendPostRemoveByIds(arg.url + "/information/remove", strArray[i]);
        }
        for (int j = 0; j < strArrays.length; j++) {
            //机构删除
            informationService.deleteDept(strArrays[j]);
            arg.sendPostRemoveByIds(arg.url + "/information/deleteDept", strArrays[j]);
        }
        return R.success("删除成功");
    }
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -45,4 +45,5 @@
    void deleteMe(String creditcode);
    Map selectCount(String departmentid);
    List<Map<Object,String>> selectInCount();
    void deleteDept(String departmentid);
}
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -92,4 +92,9 @@
        GROUP BY u.dept_id, d.dept_name
    </select>
    <delete id="deleteDept">
        delete from  blade_dept where id=#{departmentid}
    </delete>
</mapper>
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -45,4 +45,5 @@
    void deleteMe(String creditCode);
    Map selectCount(String departmentid);
    List<Map<Object,String>> selectInCount();
    void deleteDept(String departmentid);
}
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -66,4 +66,9 @@
        return baseMapper.selectInCount();
    }
    @Override
    public void deleteDept(String departmentid) {
        baseMapper.deleteDept(departmentid);
    }
}
src/main/java/org/springblade/modules/performance/entity/Performance.java
@@ -88,5 +88,6 @@
     */
    @TableField("department_name")
    private String departmentName;
    private String jurisdiction;
}