Commit 29fad707 by 翁国栋

一、审批流程内的表单设计正文编辑框添加office编辑框(可以插入图片、表格功能。

五、新建审批的流程基础内的“谁可以发起这个审批-部分-部门添加”功能无法使用。(已注释)
parent f2b3025b
...@@ -5,11 +5,9 @@ import java.util.Date; ...@@ -5,11 +5,9 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.persistence.Entity; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import cn.timer.api.bean.yggl.YgglMainEmp;
import com.alibaba.druid.sql.ast.expr.SQLCaseExpr.Item; import com.alibaba.druid.sql.ast.expr.SQLCaseExpr.Item;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -79,6 +77,11 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> { ...@@ -79,6 +77,11 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> {
@ApiModelProperty(value = "创建时间 ", example = "2019-10-01") @ApiModelProperty(value = "创建时间 ", example = "2019-10-01")
private Date createTime; private Date createTime;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "员工列表")
private List<YgglMainEmp> userList;
// 遍历,获取旗下所有子部门和岗位id // 遍历,获取旗下所有子部门和岗位id
public static void getupDepts(ArrayList<Integer> list, Integer objId, List<ZzglBmgwM> objs) { public static void getupDepts(ArrayList<Integer> list, Integer objId, List<ZzglBmgwM> objs) {
if (objId != null) { if (objId != null) {
...@@ -115,7 +118,7 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> { ...@@ -115,7 +118,7 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> {
} }
} }
} }
} }
\ No newline at end of file
...@@ -316,10 +316,10 @@ public class HtzzController { ...@@ -316,10 +316,10 @@ public class HtzzController {
try { try {
zipUrl = oss.createZip(url); zipUrl = oss.createZip(url);
return ResultUtil.data(zipUrl); return ResultUtil.data(zipUrl);
} catch (Exception e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error("操作失败");
} }
return ResultUtil.error("操作失败");
} }
@GetMapping(value = "/exportContract") @GetMapping(value = "/exportContract")
......
...@@ -167,4 +167,13 @@ public class OSSController { ...@@ -167,4 +167,13 @@ public class OSSController {
// return ResultUtil.success("删除成功"); // return ResultUtil.success("删除成功");
// } // }
@PostMapping(value = "/uploadOss")
@ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明")
@ResponseBody
public Result<String> uploadOss(@CurrentUser UserBean userBean, @RequestParam(required = false) String moudle, @Param("file") MultipartFile file) throws Exception {
Result<String> data = ossService.upload(userBean.getOrgCode(), moudle, file);
return data;
}
} }
...@@ -68,22 +68,22 @@ public class ZzglController { ...@@ -68,22 +68,22 @@ public class ZzglController {
@Autowired @Autowired
ZzglBmgwMService zzglBmgwMService; ZzglBmgwMService zzglBmgwMService;
@Autowired @Autowired
ZzglBmgwMMapper zzglBmgwMMapper; ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired @Autowired
ZzglPostMenuMapper zzglPostMenuMapper; ZzglPostMenuMapper zzglPostMenuMapper;
@Autowired @Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper; ZzglLogDgjlMapper zzglLogDgjlMapper;
@Autowired @Autowired
YgglMainEmpMapper ygglMainEmpMapper; YgglMainEmpMapper ygglMainEmpMapper;
/** /**
* 架构树/架构图/导出 * 架构树/架构图/导出
* *
* @param * @param
* @return * @return
*/ */
...@@ -95,10 +95,10 @@ public class ZzglController { ...@@ -95,10 +95,10 @@ public class ZzglController {
.eq(ZzglBmgwM::getOrgCode, orgCode).list(); .eq(ZzglBmgwM::getOrgCode, orgCode).list();
return ResultUtil.data(zzglBmgwMs); return ResultUtil.data(zzglBmgwMs);
} }
/** /**
* 获取部门岗位-升级版 * 获取部门岗位-升级版
* *
* @param * @param
* @return * @return
*/ */
...@@ -109,13 +109,13 @@ public class ZzglController { ...@@ -109,13 +109,13 @@ public class ZzglController {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper) List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list(); .eq(ZzglBmgwM::getOrgCode, orgCode).list();
// 构建node列表 // 构建node列表
// List<TreeNode<String>> nodeList = CollUtil.newArrayList(); // List<TreeNode<String>> nodeList = CollUtil.newArrayList();
// zzglBmgwMs.forEach(z -> { // zzglBmgwMs.forEach(z -> {
// nodeList.add(new TreeNode<>(Convert.toStr(z.getId()), Convert.toStr(z.getUpId()), z.getName(), 0)); // nodeList.add(new TreeNode<>(Convert.toStr(z.getId()), Convert.toStr(z.getUpId()), z.getName(), 0));
// }); // });
//配置 //配置
TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
// 自定义属性名 都要默认值的 // 自定义属性名 都要默认值的
...@@ -136,16 +136,29 @@ public class ZzglController { ...@@ -136,16 +136,29 @@ public class ZzglController {
tree.putExtra("type", treeNode.getType()); tree.putExtra("type", treeNode.getType());
// tree.putExtra("other", new Object()); // tree.putExtra("other", new Object());
}); });
// System.out.println(treeNodes); // System.out.println(treeNodes);
// System.out.println(treeNodes.size()); // System.out.println(treeNodes.size());
// System.out.println(deep2(treeNodes)); // System.out.println(deep2(treeNodes));
return ResultUtil.data(treeNodes); return ResultUtil.data(treeNodes);
} }
@GetMapping(value = "/deptlist_ultra")
@ApiOperation(value = "获取部门岗位", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglBmgwM>> deptlist_plusUltra(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
zzglBmgwMs.forEach(z->{
if(z.getType()==1){
z.setUserList(new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getBmgwId,z.getId()).list());
}
});
return ResultUtil.data(zzglBmgwMs);
}
// 非递归,利用树的层次遍历 // 非递归,利用树的层次遍历
// public static int deep2(List<Tree<String>> treeNodes) { // public static int deep2(List<Tree<String>> treeNodes) {
// if(treeNodes == null) // if(treeNodes == null)
...@@ -164,13 +177,13 @@ public class ZzglController { ...@@ -164,13 +177,13 @@ public class ZzglController {
// System.out.println("temp = "+ temp); // System.out.println("temp = "+ temp);
// } // }
// } // }
// //
// return depth; // return depth;
// } // }
/** /**
* 获取部门 * 获取部门
* *
* @param * @param
* @return * @return
*/ */
...@@ -183,7 +196,7 @@ public class ZzglController { ...@@ -183,7 +196,7 @@ public class ZzglController {
.eq(ZzglBmgwM::getOrgCode, orgCode).list(); .eq(ZzglBmgwM::getOrgCode, orgCode).list();
if (CollectionUtil.isNotEmpty(zzglBmgwMs)) { if (CollectionUtil.isNotEmpty(zzglBmgwMs)) {
zzglBmgwMs = zzglBmgwMs.stream().filter(z -> z.getType() == 0).collect(Collectors.toList()); zzglBmgwMs = zzglBmgwMs.stream().filter(z -> z.getType() == 0).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(zzglBmgwMs)) { if (CollectionUtil.isNotEmpty(zzglBmgwMs)) {
//配置 //配置
TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
...@@ -200,17 +213,17 @@ public class ZzglController { ...@@ -200,17 +213,17 @@ public class ZzglController {
// 扩展属性 ... // 扩展属性 ...
tree.putExtra("leader", treeNode.getLeader()); tree.putExtra("leader", treeNode.getLeader());
tree.putExtra("type", treeNode.getType()); tree.putExtra("type", treeNode.getType());
}); });
return ResultUtil.data(treeNodes); return ResultUtil.data(treeNodes);
} }
} }
return ResultUtil.success(); return ResultUtil.success();
} }
@GetMapping(value = "/depts") @GetMapping(value = "/depts")
@ApiOperation(value = "2.获取部门", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "2.获取部门", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
...@@ -225,7 +238,7 @@ public class ZzglController { ...@@ -225,7 +238,7 @@ public class ZzglController {
/** /**
* 岗位成员 * 岗位成员
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
...@@ -260,7 +273,7 @@ public class ZzglController { ...@@ -260,7 +273,7 @@ public class ZzglController {
/** /**
* 获取调岗记录(weng) * 获取调岗记录(weng)
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
...@@ -292,7 +305,7 @@ public class ZzglController { ...@@ -292,7 +305,7 @@ public class ZzglController {
/** /**
* 未设置岗位的成员 * 未设置岗位的成员
* *
* @return * @return
*/ */
@GetMapping(value = "/listent") @GetMapping(value = "/listent")
...@@ -315,7 +328,7 @@ public class ZzglController { ...@@ -315,7 +328,7 @@ public class ZzglController {
/** /**
* 添加/修改部门岗位 * 添加/修改部门岗位
* *
* @param * @param
* @return * @return
*/ */
...@@ -323,7 +336,7 @@ public class ZzglController { ...@@ -323,7 +336,7 @@ public class ZzglController {
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
@Log(title = "添加/修改-部门", businessType = BusinessType.INSERT_UPDATE) @Log(title = "添加/修改-部门", businessType = BusinessType.INSERT_UPDATE)
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) { public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) {
Integer count = zzglBmgwMMapper.selectCount(new QueryWrapper<ZzglBmgwM>().lambda() Integer count = zzglBmgwMMapper.selectCount(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())); .eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()));
if (count <= 0) { if (count <= 0) {
...@@ -336,15 +349,15 @@ public class ZzglController { ...@@ -336,15 +349,15 @@ public class ZzglController {
return ResultUtil.error("部门名称上级不能为岗位"); return ResultUtil.error("部门名称上级不能为岗位");
} }
} }
if (zzglBmgwM.getLeader() == null && StrUtil.length(StrUtil.trim(zzglBmgwM.getName())) == 0) if (zzglBmgwM.getLeader() == null && StrUtil.length(StrUtil.trim(zzglBmgwM.getName())) == 0)
return ResultUtil.error("部门名称不能为空"); return ResultUtil.error("部门名称不能为空");
Boolean notId = zzglBmgwM.getId() == null; Boolean notId = zzglBmgwM.getId() == null;
if (notId && zzglBmgwM.getType() == null) if (notId && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0); zzglBmgwM.setType((Integer) 0);
zzglBmgwM.setOrgCode(userBean.getOrgCode()); zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate(); zzglBmgwM.insertOrUpdate();
return notId ? ResultUtil.data(zzglBmgwM) : ResultUtil.success(); return notId ? ResultUtil.data(zzglBmgwM) : ResultUtil.success();
} }
/** /**
...@@ -377,7 +390,7 @@ public class ZzglController { ...@@ -377,7 +390,7 @@ public class ZzglController {
/** /**
* 删除部门岗位 * 删除部门岗位
* *
* @param 部门岗位ids [1,2,3,4] * @param 部门岗位ids [1,2,3,4]
* @return * @return
*/ */
...@@ -386,7 +399,7 @@ public class ZzglController { ...@@ -386,7 +399,7 @@ public class ZzglController {
@Log(title = "删除-部门岗位", businessType = BusinessType.DELETE) @Log(title = "删除-部门岗位", businessType = BusinessType.DELETE)
public Result<Integer> deldepts(@CurrentUser UserBean userBean, @RequestBody List<Integer> ids) { public Result<Integer> deldepts(@CurrentUser UserBean userBean, @RequestBody List<Integer> ids) {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build(); YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
zzglLogDgjlMapper.insertbydeldept(ids, userBean.getEmpNum()); zzglLogDgjlMapper.insertbydeldept(ids, userBean.getEmpNum());
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda() ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
.set(YgglMainEmp::getBmgwId, null) .set(YgglMainEmp::getBmgwId, null)
...@@ -398,7 +411,7 @@ public class ZzglController { ...@@ -398,7 +411,7 @@ public class ZzglController {
/** /**
* 批量修改/删除员工部门 * 批量修改/删除员工部门
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
...@@ -418,7 +431,7 @@ public class ZzglController { ...@@ -418,7 +431,7 @@ public class ZzglController {
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()) .eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
.in(ZzglBmgwM::getLeader, empNums)); .in(ZzglBmgwM::getLeader, empNums));
} }
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda() ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
.set(YgglMainEmp::getBmgwId, dpetId).set(YgglMainEmp::getBmgwName, upEmpDeptDto.getDept()) .set(YgglMainEmp::getBmgwId, dpetId).set(YgglMainEmp::getBmgwName, upEmpDeptDto.getDept())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getEmpNum, empNums)); .eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getEmpNum, empNums));
...@@ -431,10 +444,10 @@ public class ZzglController { ...@@ -431,10 +444,10 @@ public class ZzglController {
} }
return ResultUtil.success(); return ResultUtil.success();
} }
/** /**
* 岗位权限 * 岗位权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
...@@ -453,9 +466,9 @@ public class ZzglController { ...@@ -453,9 +466,9 @@ public class ZzglController {
wp.select(ZzglAuth::getMenuId, ZzglAuth::getBmgwId).eq(ZzglAuth::getOrgCode, orgCode) wp.select(ZzglAuth::getMenuId, ZzglAuth::getBmgwId).eq(ZzglAuth::getOrgCode, orgCode)
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray())); .and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp); List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
List<MenuStructureDto> mestrs = new ArrayList<MenuStructureDto>(); List<MenuStructureDto> mestrs = new ArrayList<MenuStructureDto>();
List<QyzxAdminMenu> qyme = QyzxAdminMenu.builder().build().selectList(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()).orderByAsc(QyzxAdminMenu::getSortNumber)); List<QyzxAdminMenu> qyme = QyzxAdminMenu.builder().build().selectList(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()).orderByAsc(QyzxAdminMenu::getSortNumber));
String[] zdy = new String[qyme.size()]; String[] zdy = new String[qyme.size()];
...@@ -470,11 +483,11 @@ public class ZzglController { ...@@ -470,11 +483,11 @@ public class ZzglController {
mestrs.add(metr); mestrs.add(metr);
zdy[i] = me.getMenuCode(); zdy[i] = me.getMenuCode();
i++; i++;
} }
// //
List<AdminMenuTemplate> adtes = AdminMenuTemplate.builder().build().selectList(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getEnable, 1).orderByAsc(AdminMenuTemplate::getSortNumber)); List<AdminMenuTemplate> adtes = AdminMenuTemplate.builder().build().selectList(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getEnable, 1).orderByAsc(AdminMenuTemplate::getSortNumber));
for(AdminMenuTemplate adm : adtes) { for(AdminMenuTemplate adm : adtes) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(zdy), adm.getMenuCode())) { if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(zdy), adm.getMenuCode())) {
if(adm.getDistribution() == 0 && userBean.getOrgCode() == 3) { if(adm.getDistribution() == 0 && userBean.getOrgCode() == 3) {
MenuStructureDto metr = MenuStructureDto.builder().build(); MenuStructureDto metr = MenuStructureDto.builder().build();
...@@ -493,7 +506,7 @@ public class ZzglController { ...@@ -493,7 +506,7 @@ public class ZzglController {
} }
} }
} }
List<ZzglAuth> zas_ = new ArrayList<ZzglAuth>(); List<ZzglAuth> zas_ = new ArrayList<ZzglAuth>();
String[] qhf = new String[mestrs.size()]; String[] qhf = new String[mestrs.size()];
int y = 0; int y = 0;
...@@ -506,11 +519,11 @@ public class ZzglController { ...@@ -506,11 +519,11 @@ public class ZzglController {
zas_.add(zd); zas_.add(zd);
qhf[y] = zg.getMenuId(); qhf[y] = zg.getMenuId();
y++; y++;
break; break;
} }
} }
} }
for(ZzglAuth zg : zas) { for(ZzglAuth zg : zas) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull2(qhf), zg.getMenuId())) { if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull2(qhf), zg.getMenuId())) {
ZzglAuth zd = ZzglAuth.builder().build(); ZzglAuth zd = ZzglAuth.builder().build();
...@@ -519,15 +532,15 @@ public class ZzglController { ...@@ -519,15 +532,15 @@ public class ZzglController {
zas_.add(zd); zas_.add(zd);
} }
} }
return ResultUtil.data(zas_); return ResultUtil.data(zas_);
} }
} }
/** /**
* 批量修改/删除岗位权限 * 批量修改/删除岗位权限
* *
* @param 部门岗位id * @param 部门岗位id
* @param 菜单ids * @param 菜单ids
* @return * @return
...@@ -547,35 +560,35 @@ public class ZzglController { ...@@ -547,35 +560,35 @@ public class ZzglController {
}); });
return ResultUtil.success(); return ResultUtil.success();
} }
@Autowired @Autowired
private ZzglMenuMapper zzglMenuMapper; private ZzglMenuMapper zzglMenuMapper;
/** /**
* 获取-菜单权限列表 * 获取-菜单权限列表
* *
* @return * @return
*/ */
@GetMapping(value = "/menu") @GetMapping(value = "/menu")
@ApiOperation(value = "获取-菜单权限列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取-菜单权限列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<ZzglMenu>> selectMenu(@CurrentUser UserBean userBean) { public Result<List<ZzglMenu>> selectMenu(@CurrentUser UserBean userBean) {
List<ZzglMenu> list = zzglMenuMapper.selectList(null); List<ZzglMenu> list = zzglMenuMapper.selectList(null);
return ResultUtil.data(list); return ResultUtil.data(list);
} }
/** /**
* 获取-菜单权限-搜索 * 获取-菜单权限-搜索
* *
* @return * @return
*/ */
// @PostMapping(value = "/querymenu") // @PostMapping(value = "/querymenu")
// @ApiOperation(value = "获取-菜单权限-搜索", httpMethod = "POST", notes = "接口发布说明") // @ApiOperation(value = "获取-菜单权限-搜索", httpMethod = "POST", notes = "接口发布说明")
// public Result<List<Tree<String>>> queryMenu(@CurrentUser UserBean userBean,@RequestBody ZzglMenuQueryDto zzglMenuQueryDto) { // public Result<List<Tree<String>>> queryMenu(@CurrentUser UserBean userBean,@RequestBody ZzglMenuQueryDto zzglMenuQueryDto) {
// //
// List<ZzglMenu> list = zzglMenuMapper.queryList(zzglMenuQueryDto); // List<ZzglMenu> list = zzglMenuMapper.queryList(zzglMenuQueryDto);
// //
// //配置 // //配置
// TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); // TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
// // 自定义属性名 都要默认值的 // // 自定义属性名 都要默认值的
...@@ -603,104 +616,104 @@ public class ZzglController { ...@@ -603,104 +616,104 @@ public class ZzglController {
// tree.putExtra("visible", treeNode.getVisible()); // tree.putExtra("visible", treeNode.getVisible());
//// tree.putExtra("other", new Object()); //// tree.putExtra("other", new Object());
// }); // });
// //
// return ResultUtil.data(treeNodes); // return ResultUtil.data(treeNodes);
// } // }
/** /**
* 新增-菜单权限 * 新增-菜单权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
@PostMapping(value = "/menu") @PostMapping(value = "/menu")
@ApiOperation(value = "新增-菜单权限", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "新增-菜单权限", httpMethod = "POST", notes = "接口发布说明")
public Result<List<ZzglMenu>> insertPostMenus(@Validated @RequestBody ZzglMenu zzglMenu) { public Result<List<ZzglMenu>> insertPostMenus(@Validated @RequestBody ZzglMenu zzglMenu) {
Integer conut = zzglMenuMapper.selectCount(new QueryWrapper<ZzglMenu>().lambda() Integer conut = zzglMenuMapper.selectCount(new QueryWrapper<ZzglMenu>().lambda()
.eq(ZzglMenu::getMenuId, zzglMenu.getParentId())); .eq(ZzglMenu::getMenuId, zzglMenu.getParentId()));
if (conut <= 0) { if (conut <= 0) {
return ResultUtil.error("上级权限不存在!"); return ResultUtil.error("上级权限不存在!");
} }
return zzglMenu.insert() ? ResultUtil.success() : ResultUtil.error(); return zzglMenu.insert() ? ResultUtil.success() : ResultUtil.error();
} }
/** /**
* 删除-菜单权限 * 删除-菜单权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
@DeleteMapping(value = "/menu/{id}") @DeleteMapping(value = "/menu/{id}")
@ApiOperation(value = "删除-菜单权限", httpMethod = "DELETE", notes = "接口发布说明") @ApiOperation(value = "删除-菜单权限", httpMethod = "DELETE", notes = "接口发布说明")
public Result<List<ZzglMenu>> deletePostMenus(@Validated @RequestBody Integer id) { public Result<List<ZzglMenu>> deletePostMenus(@Validated @RequestBody Integer id) {
return zzglMenuMapper.deleteById(id) > 0 ? ResultUtil.success() : ResultUtil.error(); return zzglMenuMapper.deleteById(id) > 0 ? ResultUtil.success() : ResultUtil.error();
} }
/** /**
* 修改-菜单权限 * 修改-菜单权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
@PutMapping(value = "/menu/{id}") @PutMapping(value = "/menu/{id}")
@ApiOperation(value = "修改-菜单权限", httpMethod = "PUT", notes = "接口发布说明") @ApiOperation(value = "修改-菜单权限", httpMethod = "PUT", notes = "接口发布说明")
public Result<List<ZzglMenu>> updatePostMenus(@Validated @RequestBody ZzglMenu zzglMenu) { public Result<List<ZzglMenu>> updatePostMenus(@Validated @RequestBody ZzglMenu zzglMenu) {
return zzglMenu.updateById() ? ResultUtil.success() : ResultUtil.error(); return zzglMenu.updateById() ? ResultUtil.success() : ResultUtil.error();
} }
/** /**
* 获取-该岗位的菜单权限 * 获取-该岗位的菜单权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
@GetMapping(value = "/menu/{id}") @GetMapping(value = "/menu/{id}")
@ApiOperation(value = "获取-该岗位的菜单权限", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取-该岗位的菜单权限", httpMethod = "GET", notes = "接口发布说明")
public Result<List<Integer>> selectMenuByPostId(@CurrentUser UserBean userBean,@PathVariable Integer id) { public Result<List<Integer>> selectMenuByPostId(@CurrentUser UserBean userBean,@PathVariable Integer id) {
return ResultUtil.data(zzglBmgwMService.selectMenuByPostId(id)); return ResultUtil.data(zzglBmgwMService.selectMenuByPostId(id));
} }
/** /**
* 修改-该岗位的菜单权限 * 修改-该岗位的菜单权限
* *
* @param 部门岗位id * @param 部门岗位id
* @return * @return
*/ */
@PutMapping(value = "/post_menu") @PutMapping(value = "/post_menu")
@ApiOperation(value = "修改-该岗位的菜单权限", httpMethod = "PUT", notes = "接口发布说明") @ApiOperation(value = "修改-该岗位的菜单权限", httpMethod = "PUT", notes = "接口发布说明")
public Result<List<ZzglMenu>> updatePostMenus(@CurrentUser UserBean userBean,@RequestBody ZzglPostMenuDto zzglPostMenuDto) { public Result<List<ZzglMenu>> updatePostMenus(@CurrentUser UserBean userBean,@RequestBody ZzglPostMenuDto zzglPostMenuDto) {
Integer delCount = zzglPostMenuMapper.delete(new QueryWrapper<ZzglPostMenu>().lambda() Integer delCount = zzglPostMenuMapper.delete(new QueryWrapper<ZzglPostMenu>().lambda()
.eq(ZzglPostMenu::getBmgwId, zzglPostMenuDto.getId())); .eq(ZzglPostMenu::getBmgwId, zzglPostMenuDto.getId()));
Integer updateCount = zzglPostMenuMapper.insertPostMenus(zzglPostMenuDto.getId(),zzglPostMenuDto.getMenus()); Integer updateCount = zzglPostMenuMapper.insertPostMenus(zzglPostMenuDto.getId(),zzglPostMenuDto.getMenus());
return ResultUtil.success(); return ResultUtil.success();
} }
@GetMapping(value = "/appdeptlist") @GetMapping(value = "/appdeptlist")
@ApiOperation(value = "APP获取部门岗位", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "APP获取部门岗位", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> selectapplistdept(@CurrentUser UserBean userBean) { public Result<Object> selectapplistdept(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
List<ObtainDepartmentDto> tmen = new ArrayList<ObtainDepartmentDto>(); List<ObtainDepartmentDto> tmen = new ArrayList<ObtainDepartmentDto>();
List<ZzglBmgwM> zzglbmgwms = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper) List<ZzglBmgwM> zzglbmgwms = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()).eq(ZzglBmgwM::getType, 0).list(); .eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()).eq(ZzglBmgwM::getType, 0).list();
for(ZzglBmgwM gw : zzglbmgwms) { for(ZzglBmgwM gw : zzglbmgwms) {
ObtainDepartmentDto tm = ObtainDepartmentDto.builder().build(); ObtainDepartmentDto tm = ObtainDepartmentDto.builder().build();
BeanUtil.copyProperties(gw, tm); BeanUtil.copyProperties(gw, tm);
List<DepartmentStaffDto> destff = ygglMainEmpMapper.DepartmentStaff(orgCode,gw.getId()); List<DepartmentStaffDto> destff = ygglMainEmpMapper.DepartmentStaff(orgCode,gw.getId());
tm.setUser(destff); tm.setUser(destff);
tmen.add(tm); tmen.add(tm);
} }
return ResultUtil.data(tmen); return ResultUtil.data(tmen);
} }
} }
...@@ -584,7 +584,7 @@ public class OSSUtil { ...@@ -584,7 +584,7 @@ public class OSSUtil {
* @Description 创建zip * @Description 创建zip
* @Date 2021/12/2 18:06 * @Date 2021/12/2 18:06
**/ **/
public String createZip(Map<String, String> urlMap) throws Exception { public String createZip(Map<String, String> urlMap) throws IOException {
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String fileName = dateFormat.format(new Date()) + ".zip"; String fileName = dateFormat.format(new Date()) + ".zip";
FileOutputStream fos = null; FileOutputStream fos = null;
...@@ -613,12 +613,12 @@ public class OSSUtil { ...@@ -613,12 +613,12 @@ public class OSSUtil {
zos.write(buffer, 0, nNumber); zos.write(buffer, 0, nNumber);
} }
} catch (IOException e) { } catch (IOException e) {
throw new Exception("写入失败");//TODO 应作为自定义异常 throw new IOException("写入失败");//TODO 应作为自定义异常
} finally { } finally {
try { try {
inputStream.close(); inputStream.close();
} catch (IOException e) { } catch (IOException e) {
throw new Exception("关闭失败");//TODO 应作为自定义异常 throw new IOException("关闭失败");//TODO 应作为自定义异常
} }
} }
} }
...@@ -636,7 +636,7 @@ public class OSSUtil { ...@@ -636,7 +636,7 @@ public class OSSUtil {
fos.close(); fos.close();
} }
} catch (IOException e) { } catch (IOException e) {
throw new Exception("关闭失败");//TODO 应作为自定义异常 throw new IOException("关闭失败");//TODO 应作为自定义异常
} }
} }
return fileName; return fileName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment