Commit 83770ef1 authored by zuoyh's avatar zuoyh

Merge branch 'master-customer-management' of...

Merge branch 'master-customer-management' of http://113.105.137.151:22280//youjj/cloud-platform into master-customer-management
parents 6ddb5cb6 08baac0c
...@@ -19,7 +19,7 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> { ...@@ -19,7 +19,7 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
public List<AppStaffUser> getAll(Integer id) { public List<AppStaffUser> getAll(Integer id) {
Example example = new Example(AppStaffUser.class); Example example = new Example(AppStaffUser.class);
example.createCriteria().andEqualTo("suId",id).andEqualTo("isdel",0); example.createCriteria().andEqualTo("suId",id).andEqualTo("isDel",0);
return selectByExample(example); return selectByExample(example);
} }
...@@ -40,14 +40,19 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> { ...@@ -40,14 +40,19 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
public AppStaffUser findOne(AppStaffUser appStaffUser) { public AppStaffUser findOne(AppStaffUser appStaffUser) {
Example example= new Example(AppStaffUser.class); Example example= new Example(AppStaffUser.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
if (appStaffUser.getId()!=null) { if (appStaffUser.getId()!=null) {
criteria.andEqualTo("id",appStaffUser.getId()); criteria.andEqualTo("id",appStaffUser.getId());
return mapper.selectOneByExample(example);
} }
if (appStaffUser.getPhone()!=null){ if (appStaffUser.getPhone()!=null){
criteria.andEqualTo("phone",appStaffUser.getPhone()); criteria.andEqualTo("phone",appStaffUser.getPhone());
return mapper.selectOneByExample(example);
} }
return mapper.selectOneByExample(example);
return null;
} }
} }
...@@ -6,8 +6,8 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; ...@@ -6,8 +6,8 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -22,6 +22,7 @@ import java.util.List; ...@@ -22,6 +22,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/staff") @RequestMapping("/staff")
@RequiredArgsConstructor(onConstructor_ = {@Autowired}) @RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"员工客户管理"})
public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppStaffUser> { public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppStaffUser> {
private final UserAuthConfig authConfig; private final UserAuthConfig authConfig;
private final HttpServletRequest request; private final HttpServletRequest request;
...@@ -38,7 +39,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -38,7 +39,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
public List<AppStaffUser> all() throws Exception { public List<AppStaffUser> all() throws Exception {
AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData(); AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData();
if (POSITION_NAME.equals(userDTO.getPositionName())) { if (POSITION_NAME.equals(userDTO.getPositionName())) {
baseBiz.getAll(userDTO.getId()) ; return baseBiz.getAll(userDTO.getUserid()) ;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -55,7 +56,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -55,7 +56,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
@ApiOperation("查询一条") @ApiOperation("查询一条")
@PostMapping(value = "one") @PostMapping(value = "one")
public ObjectRestResponse<AppStaffUser> findOne(@RequestParam AppStaffUser appStaffUser) { public ObjectRestResponse<AppStaffUser> findOne(AppStaffUser appStaffUser) {
AppStaffUser staffUser = baseBiz.findOne(appStaffUser); AppStaffUser staffUser = baseBiz.findOne(appStaffUser);
if (staffUser!=null) { if (staffUser!=null) {
return ObjectRestResponse.succ(staffUser); return ObjectRestResponse.succ(staffUser);
...@@ -63,13 +64,13 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -63,13 +64,13 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
@ApiOperation("查询一条") @ApiOperation("删除")
@DeleteMapping(value = "delete/{id}") @DeleteMapping(value = "delete/{id}")
public ObjectRestResponse<AppStaffUser> delete(@PathVariable Integer id) { public ObjectRestResponse<AppStaffUser> delete(@PathVariable Integer id) {
AppStaffUser staffUser = new AppStaffUser(); AppStaffUser staffUser = new AppStaffUser();
staffUser.setId(id); staffUser.setId(id);
staffUser.setIsDel(1); staffUser.setIsDel(1);
baseBiz.updateById(staffUser); baseBiz.updateSelectiveById(staffUser);
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
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