Commit 08baac0c authored by hanfeng's avatar hanfeng

客户管理

parent 8d4043b2
...@@ -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;
} }
} }
...@@ -39,7 +39,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -39,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<>();
} }
...@@ -56,7 +56,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -56,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);
...@@ -70,7 +70,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -70,7 +70,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
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