Commit 965c095c by qwmqiuwenmin

fix

parent 6fac16f3
......@@ -44,6 +44,8 @@ public class DepartmentDTO implements Serializable {
private Integer bindFlag;
private String relatedCode;
private String gicEnterpriseName;
private static final long serialVersionUID = 1L;
......@@ -206,6 +208,14 @@ public class DepartmentDTO implements Serializable {
public void setRelatedCode(String relatedCode) {
this.relatedCode = relatedCode;
}
public String getGicEnterpriseName() {
return gicEnterpriseName;
}
public void setGicEnterpriseName(String gicEnterpriseName) {
this.gicEnterpriseName = gicEnterpriseName;
}
......
......@@ -16,8 +16,11 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.gic.api.base.commons.Page;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.GicTreeDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
......@@ -52,6 +55,9 @@ public class DepartmentContoller extends WebBaseController{
private StoreService storeService;
@Autowired
private StaffApiService staffApiService;
@Autowired
private EnterpriseService enterpriseService;
@RequestMapping("department-list")
public HaobanResponse departmentList(String parentId,BasePageInfo pageInfo,String keyWord) {
LoginVO login = (LoginVO) AuthRequestUtil.getSessionUser();
......@@ -102,9 +108,28 @@ public class DepartmentContoller extends WebBaseController{
list.add(dto);
}
for (DepartmentDTO departmentDTO : list) {
if(StringUtils.isBlank(departmentDTO.getRelatedId())){
String relatedId = departmentDTO.getRelatedId();
if(StringUtils.isBlank(relatedId)){
departmentDTO.setBindFlag(0);
}else{
String gicEnterpriseName = "";
String gicEnterpriseId = "";
if(departmentDTO.getIsStore() == 1){
StoreDTO store = storeService.getStore(relatedId);
if(store != null){
gicEnterpriseId = store.getEnterpriseId();
}
}else{
StoreGroupDTO department = storeGroupService.getStoreGroupById(relatedId);
if(department != null){
gicEnterpriseId = department.getEnterpriseId();
}
}
EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(gicEnterpriseId);
if(enterprise != null){
gicEnterpriseName = enterprise.getEnterpriseName();
}
departmentDTO.setGicEnterpriseName(gicEnterpriseName);
departmentDTO.setBindFlag(1);
}
}
......
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