Commit 9e8b5712 by huangZW

111

parent 81e2e297
......@@ -12,8 +12,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.DepartmentService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult;
import com.gic.haoban.base.api.common.ServiceResponse;
......@@ -32,6 +39,7 @@ 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.gic.haoban.manage.web.vo.StaffVO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
......@@ -51,6 +59,10 @@ public class StaffController extends WebBaseController{
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private WxApplicationApiService wxApplicationApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private StoreService storeService;
@RequestMapping("staff-add")
public HaobanResponse staffAdd(StaffDTO staffDTO,String departmentIds){
......@@ -195,4 +207,44 @@ public class StaffController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("get-clerk-info")
public HaobanResponse getClerkInfo(String clerkId){
StaffVO staffVO = new StaffVO();
ClerkDTO clerk = clerkService.getClerkByClerkId(clerkId);
if(clerk != null) {
String storeId = clerk.getStoreId();
StoreDTO storeDTO = storeService.getStore(storeId);
staffVO.setStaffName(clerk.getClerkName());
staffVO.setNationCode(clerk.getNationcode());
staffVO.setPhoneNumber(clerk.getPhoneNumber());
staffVO.setPostion(clerk.getPositionName());
staffVO.setHeadImg(clerk.getHeadImgUrl());
staffVO.setDepartmentName(storeDTO==null?"":storeDTO.getStoreName());
}
return resultResponse(HaoBanErrCode.ERR_1,staffVO);
}
@RequestMapping("get-staff-info")
public HaobanResponse getStaffInfo(String staffId){
StaffVO staffVO = new StaffVO();
StaffDTO staff = staffApiService.selectById(staffId);
if(staff != null) {
List<StaffDepartmentRelatedDTO> list = staffDepartmentRelatedApiService.listByStaffId(staffId);
staffVO.setStaffName(staff.getStaffName());
staffVO.setNationCode(staff.getNationCode());
staffVO.setPhoneNumber(staff.getPhoneNumber());
staffVO.setPostion(staff.getPostion());
staffVO.setHeadImg(staff.getHeadImg());
if(CollectionUtil.isNotEmpty(list)){
String departmentId = list.get(0).getDepartmentId();
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
if(departmentDTO != null){
staffVO.setDepartmentName(departmentDTO.getDepartmentName());
}
}
}
return resultResponse(HaoBanErrCode.ERR_1,staffVO);
}
}
......@@ -21,6 +21,16 @@ public class StaffVO implements Serializable{
private String departmentName;
private String headImg;
public String getHeadImg() {
return headImg;
}
public void setHeadImg(String headImg) {
this.headImg = headImg;
}
public String getStaffName() {
return staffName;
}
......
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