use of com.ikoori.vip.common.persistence.model.Dept in project vip by guangdada.
the class DeptTest method addDeptTest.
@Test
public void addDeptTest() {
Dept dept = new Dept();
dept.setFullname("测试fullname");
dept.setNum(5);
dept.setPid(1);
dept.setSimplename("测试");
dept.setTips("测试tips");
dept.setVersion(1);
Integer insert = deptMapper.insert(dept);
assertEquals(insert, new Integer(1));
}
use of com.ikoori.vip.common.persistence.model.Dept in project vip by guangdada.
the class DeptTest method deleteTest.
@Test
public void deleteTest() {
Dept dept = this.deptMapper.selectById(24);
Integer integer = deptMapper.deleteById(dept);
assertTrue(integer > 0);
}
use of com.ikoori.vip.common.persistence.model.Dept in project vip by guangdada.
the class DeptServiceImpl method deleteDept.
@Override
public void deleteDept(Integer deptId) {
Dept dept = deptMapper.selectById(deptId);
Wrapper<Dept> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pids", "%[" + dept.getId() + "]%");
List<Dept> subDepts = deptMapper.selectList(wrapper);
for (Dept temp : subDepts) {
temp.deleteById();
}
dept.deleteById();
}
use of com.ikoori.vip.common.persistence.model.Dept in project vip by guangdada.
the class DeptController method deptUpdate.
/**
* 跳转到修改部门
*/
@Permission
@RequestMapping("/dept_update/{deptId}")
public String deptUpdate(@PathVariable Integer deptId, Model model) {
Dept dept = deptMapper.selectById(deptId);
model.addAttribute(dept);
model.addAttribute("pName", ConstantFactory.me().getDeptName(dept.getPid()));
LogObjectHolder.me().set(dept);
return PREFIX + "dept_edit.html";
}
use of com.ikoori.vip.common.persistence.model.Dept in project vip by guangdada.
the class DeptController method deptSetPids.
private void deptSetPids(Dept dept) {
if (ToolUtil.isEmpty(dept.getPid()) || dept.getPid().equals("0")) {
dept.setPid(0);
dept.setPids("[0],");
} else {
int pid = dept.getPid();
Dept temp = deptMapper.selectById(pid);
String pids = temp.getPids();
dept.setPid(pid);
dept.setPids(pids + "[" + pid + "],");
}
}
Aggregations