Commit 3301838e by 陶光胜

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0 into developer

parents fbe90090 0edebaa1
......@@ -23,7 +23,10 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.StaffEditJsonQO;
import com.gic.haoban.manage.web.vo.LoginVO;
import com.google.gson.JsonArray;
import com.squareup.moshi.Json;
@RestController
......@@ -34,6 +37,8 @@ public class StaffController extends WebBaseController{
private StaffApiService staffApiService;
@Autowired
private DepartmentApiService departmentApiService;
@Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@RequestMapping("staff-add")
public HaobanResponse staffAdd(StaffDTO staffDTO,String departmentIds){
......@@ -123,5 +128,21 @@ public class StaffController extends WebBaseController{
}
@RequestMapping("staff-batch-edit-department")
public HaobanResponse staffBatchEditDepartment(String params){
List<StaffEditJsonQO> list = JSON.parseArray(params, StaffEditJsonQO.class);
for (StaffEditJsonQO staffEditJsonQO : list) {
String staffDepartmentRelatedId = staffEditJsonQO.getStaffDepartmentRelatedId();
String departmentIds = staffEditJsonQO.getCurrDepartmentIds();
StaffDepartmentRelatedDTO related = staffDepartmentRelatedApiService.getByStaffDepartmentRelatedId(staffDepartmentRelatedId);
if(related != null) {
StaffDTO staff = staffApiService.selectById(related.getStaffId());
if(staff != null) {
staffApiService.staffEdit(staff, departmentIds);
}
}
}
return resultResponse(HaoBanErrCode.ERR_1);
}
}
package com.gic.haoban.manage.web.qo;
import java.io.Serializable;
public class StaffEditJsonQO implements Serializable{
private String staffDepartmentRelatedId;
private String currDepartmentIds;
public String getStaffDepartmentRelatedId() {
return staffDepartmentRelatedId;
}
public void setStaffDepartmentRelatedId(String staffDepartmentRelatedId) {
this.staffDepartmentRelatedId = staffDepartmentRelatedId;
}
public String getCurrDepartmentIds() {
return currDepartmentIds;
}
public void setCurrDepartmentIds(String currDepartmentIds) {
this.currDepartmentIds = currDepartmentIds;
}
}
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