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