Commit b20e7577 authored by hanfeng's avatar hanfeng

客户管理

parent 1c5deca6
package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Administrator
* @Auther: Administrator
* @Date: 2019/12/12 09:52
* @Description:
*/
@Data
public class AppStaffUserVo extends AppStaffUser {
@ApiModelProperty("员工姓名")
private String employeeName;
@ApiModelProperty("员工手机号")
private String employeePhone;
}
......@@ -2,8 +2,13 @@ package com.github.wxiaoqi.security.admin.biz;
import com.alibaba.druid.sql.visitor.functions.If;
import com.github.wxiaoqi.security.admin.entity.AppStaffUser;
import com.github.wxiaoqi.security.admin.entity.AppStaffUserVo;
import com.github.wxiaoqi.security.admin.mapper.AppStaffUserMapper;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
......@@ -14,7 +19,10 @@ import java.util.List;
* @author Administrator
*/
@Service
@RequiredArgsConstructor(onConstructor_={@Autowired})
public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
private final AppUserLoginBiz appUserLoginBiz;
private final AppUserDetailBiz appUserDetailBiz;
public List<AppStaffUser> getAll(Integer id) {
......@@ -48,7 +56,18 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
if (appStaffUser.getPhone()!=null){
criteria.andEqualTo("phone",appStaffUser.getPhone());
return mapper.selectOneByExample(example);
AppStaffUser staffUser = mapper.selectOneByExample(example);
if (staffUser!=null) {
AppStaffUserVo appStaffUserVo = new AppStaffUserVo();
BeanUtils.copyProperties(staffUser,appStaffUserVo);
Integer suId = staffUser.getSuId();
AppUserVo userInfoById = appUserDetailBiz.getUserInfoById(suId);
appStaffUserVo.setEmployeeName(userInfoById.getRealname());
appStaffUserVo.setEmployeePhone(userInfoById.getUsername());
return appStaffUserVo;
}
}
return null;
......
......@@ -58,6 +58,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
@GetMapping(value = "one")
public ObjectRestResponse<AppStaffUser> findOne(AppStaffUser appStaffUser) {
AppStaffUser staffUser = baseBiz.findOne(appStaffUser);
if (staffUser!=null) {
return ObjectRestResponse.succ(staffUser);
}
......
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