Commit ba06d02c by qwmqiuwenmin

fix

parent 994dd35a
......@@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -45,10 +46,12 @@ import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.DepartmentAddQO;
import com.gic.haoban.manage.web.qo.DepartmentEditQO;
import com.gic.haoban.manage.web.qo.SyncDepartmentQO;
import com.gic.haoban.manage.web.thread.SyncDepartmentThread;
import com.gic.haoban.manage.web.vo.DepartmentVO;
import com.gic.haoban.manage.web.vo.LoginVO;
import com.gic.haoban.manage.web.vo.StoreVo;
import com.gic.haoban.operation.api.args.SaveOrUpdateEnterpriseAuthenticationArgs;
import com.gic.redis.data.util.RedisUtil;
import okhttp3.internal.http2.ErrorCode;
......@@ -247,19 +250,18 @@ public class DepartmentContoller extends WebBaseController{
}
@RequestMapping("department-batch-sync")
public HaobanResponse departmentBatchSync(String editDepartment,String delDepartmentIds,String addDepartment,String paramsData) {
public HaobanResponse departmentBatchSync(String editDepartment,String delDepartmentIds,String addDepartment,@RequestBody SyncDepartmentQO paramsData) {
LoginVO login = (LoginVO) AuthRequestUtil.getSessionUser();
String wxEnterpriseId = login.getWxEnterpriseId();
String key = "haoban-sync-department-" + wxEnterpriseId;
if(RedisUtil.getCache(key) != null){
return resultResponse(HaoBanErrCode.ERR_10011);
}
RedisUtil.setCache(key,1,3600l);
if(StringUtils.isNotBlank(paramsData)){
JSONObject json = JSONObject.parseObject(paramsData);
editDepartment = json.getString(editDepartment);
addDepartment = json.getString(addDepartment);
if(paramsData != null){
editDepartment = paramsData.getEditDepartment();
addDepartment = paramsData.getAddDepartment();
}
RedisUtil.setCache(key,1,3600l);
new SyncDepartmentThread(this,editDepartment,delDepartmentIds,addDepartment,key).start();
// if(StringUtils.isNotBlank(addDepartment)) {
// List<DepartmentAddQO> list = JSONArray.parseArray(addDepartment, DepartmentAddQO.class);
......
package com.gic.haoban.manage.web.qo;
import java.io.Serializable;
public class SyncDepartmentQO implements Serializable{
private String editDepartment;
private String addDepartment;
public String getEditDepartment() {
return editDepartment;
}
public void setEditDepartment(String editDepartment) {
this.editDepartment = editDepartment;
}
public String getAddDepartment() {
return addDepartment;
}
public void setAddDepartment(String addDepartment) {
this.addDepartment = addDepartment;
}
}
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