|
@@ -1,7 +1,5 @@
|
|
|
package com.usky.dxtop.controller.web.business;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.dxtop.common.core.domain.ApiResult;
|
|
|
import com.usky.dxtop.common.core.page.CommonPage;
|
|
|
import com.usky.dxtop.common.exception.CustomException;
|
|
@@ -123,11 +121,8 @@ public class StaffController {
|
|
|
public ApiResult<Void> update(@RequestBody Staff staff){
|
|
|
Staff one = staffService.one(staff.getId(), null, staff.getCardId());
|
|
|
Optional.ofNullable(one).map(s -> {
|
|
|
- LambdaUpdateWrapper<Staff> updateWrapper = Wrappers.lambdaUpdate();
|
|
|
- updateWrapper
|
|
|
- .set(Staff::getOpenId,staff.getOpenId())
|
|
|
- .eq(Staff::getSId,s.getSId());
|
|
|
- return staffService.update(updateWrapper);
|
|
|
+ s.setOpenId(staff.getOpenId());
|
|
|
+ return staffService.updateById(s);
|
|
|
}).orElseThrow(() -> new CustomException("用户信息不存在"));
|
|
|
return ApiResult.success();
|
|
|
}
|