Commit 73e346d4 by qwmqiuwenmin

fix

parent 363d409e
......@@ -52,6 +52,7 @@ 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.DepartmentChainVO;
import com.gic.haoban.manage.web.vo.DepartmentVO;
import com.gic.haoban.manage.web.vo.LoginVO;
import com.gic.haoban.manage.web.vo.StoreVo;
......@@ -395,6 +396,38 @@ public class DepartmentContoller extends WebBaseController{
}
@RequestMapping("department-chain")
public HaobanResponse departmentChain(String departmentId) {
if(StringUtils.isBlank(departmentId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
DepartmentDTO department = departmentApiService.selectById(departmentId);
if(department == null){
return resultResponse(HaoBanErrCode.ERR_10003);
}
String chainId = department.getChainId();
String[] chainIdArr = chainId.split(Constant.ID_SEPARATOR);
DepartmentChainVO chainVO = new DepartmentChainVO();
for (String string : chainIdArr) {
if("0".equals(string)){
continue;
}
DepartmentDTO son = departmentApiService.selectById(string);
DepartmentChainVO chain = EntityUtil.changeEntityByJSON(DepartmentChainVO.class, son);
if(chainVO != null){
DepartmentChainVO diguiChian = null;
while(diguiChian.getSonDepartment() != null){
diguiChian = chainVO.getSonDepartment();
}
diguiChian.setSonDepartment(chain);
}else{
chainVO = chain;
}
}
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("department-batch-sync-success")
public HaobanResponse syncSuccess(String syncKey) {
if(RedisUtil.getCache(syncKey) == null){
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
public class DepartmentChainVO implements Serializable{
private String departmentId;
private String departmentName;
private String parentDepartmentId;
private String relatedId;
private Integer isStore;
private String wxDepartmentId;
private Integer level;
private Integer sort;
private String wxEnterpriseId;
private Integer type;
private Integer bindFlag;
private String gicEnterpriseName;
private Boolean hasSonNode;
private String enterpriseId;
private String relatedCode;
private DepartmentChainVO sonDepartment;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getParentDepartmentId() {
return parentDepartmentId;
}
public void setParentDepartmentId(String parentDepartmentId) {
this.parentDepartmentId = parentDepartmentId;
}
public String getRelatedId() {
return relatedId;
}
public void setRelatedId(String relatedId) {
this.relatedId = relatedId;
}
public Integer getIsStore() {
return isStore;
}
public void setIsStore(Integer isStore) {
this.isStore = isStore;
}
public String getWxDepartmentId() {
return wxDepartmentId;
}
public void setWxDepartmentId(String wxDepartmentId) {
this.wxDepartmentId = wxDepartmentId;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getBindFlag() {
return bindFlag;
}
public void setBindFlag(Integer bindFlag) {
this.bindFlag = bindFlag;
}
public String getGicEnterpriseName() {
return gicEnterpriseName;
}
public void setGicEnterpriseName(String gicEnterpriseName) {
this.gicEnterpriseName = gicEnterpriseName;
}
public Boolean getHasSonNode() {
return hasSonNode;
}
public void setHasSonNode(Boolean hasSonNode) {
this.hasSonNode = hasSonNode;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getRelatedCode() {
return relatedCode;
}
public void setRelatedCode(String relatedCode) {
this.relatedCode = relatedCode;
}
public DepartmentChainVO getSonDepartment() {
return sonDepartment;
}
public void setSonDepartment(DepartmentChainVO sonDepartment) {
this.sonDepartment = sonDepartment;
}
}
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