Commit 00ae6d52 authored by 赵啸非's avatar 赵啸非

修改用户等

parent 5cff1e01
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -26,10 +27,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -26,10 +27,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -61,11 +59,14 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ ...@@ -61,11 +59,14 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
this.addDict(model, "staffType", paramService.getParamBySecondOrganize("Staff", "staffType")); this.addDict(model, "staffType", paramService.getParamBySecondOrganize("Staff", "staffType"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Staff", "status")); this.addDict(model, "status", paramService.getParamBySecondOrganize("Staff", "status"));
this.addDict(model, "positionId", jobService.queryPositionName(new JobQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getJobName(), (o, n) -> n))); this.addDict(model, "positionId", jobService.queryPositionName(new JobQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getJobName(), (o, n) -> n)));
List<DeptEntity> list = deptService.find(new DeptQuery());
DeptQuery deptQuery = new DeptQuery();
deptQuery.setOrderColList(Arrays.asList(new OrderCol("deptName")));
List<DeptEntity> list = deptService.find(deptQuery);
List<DeptTreeSelect> treeSelects = deptService.buildDeptTreeSelect(list); List<DeptTreeSelect> treeSelects = deptService.buildDeptTreeSelect(list);
this.addDict(model, "deptPerson", treeSelects); this.addDict(model, "deptPerson", treeSelects);
this.addDict(model, "deptId", deptService.find(new DeptQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeptName()))); this.addDict(model, "deptId", deptService.find(deptQuery).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeptName())));
super.init(model, context); super.init(model, context);
......
package com.mortals.xhx.module.workman.web; package com.mortals.xhx.module.workman.web;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
...@@ -14,6 +15,7 @@ import org.springframework.util.ObjectUtils; ...@@ -14,6 +15,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -43,7 +45,9 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -43,7 +45,9 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
//this.addDict(model, "positionId",deptService .find(new DeptQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getDeptName(),(o, n)->n))); //this.addDict(model, "positionId",deptService .find(new DeptQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getDeptName(),(o, n)->n)));
List<DeptEntity> list = deptService.find(new DeptQuery()); DeptQuery deptQuery = new DeptQuery();
deptQuery.setOrderColList(Arrays.asList(new OrderCol("deptName")));
List<DeptEntity> list = deptService.find(deptQuery);
List<DeptTreeSelect> treeSelects = deptService.buildDeptTreeSelect(list); List<DeptTreeSelect> treeSelects = deptService.buildDeptTreeSelect(list);
this.addDict(model, "deptId",treeSelects); this.addDict(model, "deptId",treeSelects);
super.init(model, context); super.init(model, context);
......
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