Commit 951f5b55 by 杨伟程

长者绑定bug

parent 4481a1eb
......@@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -37,14 +38,14 @@ public class PlatElderChildrenInfoChildrenController {
@ApiOperation("绑定")
@PostMapping("bind")
public ApiResponseEntity<?> bind(PlatElderIdDTO dto) {
public ApiResponseEntity<?> bind(@RequestBody PlatElderIdDTO dto) {
platElderChildrenInfoService.bind(dto.getElderId());
return ApiResponseUtils.success();
}
@ApiOperation("解绑")
@PostMapping("unbind")
public ApiResponseEntity<?> unbind(PlatElderIdDTO dto) {
public ApiResponseEntity<?> unbind(@RequestBody PlatElderIdDTO dto) {
platElderChildrenInfoService.unbind(dto.getElderId());
return ApiResponseUtils.success();
}
......
package com.makeit.entity.platform.elder;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -21,6 +23,7 @@ public class PlatElderChildrenInfo extends BaseBusEntity {
private static final long serialVersionUID = 1L;
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "长者id")
private String elderId;
......
......@@ -167,7 +167,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>(list);
linkedHashSet.add(elderId);
childrenInfo.setElderId(StreamUtil.join(new ArrayList<>(list), Function.identity()));
childrenInfo.setElderId(StreamUtil.join(new ArrayList<>(linkedHashSet), Function.identity()));
updateById(childrenInfo);
......@@ -185,7 +185,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>(list);
linkedHashSet.remove(elderId);
childrenInfo.setElderId(StreamUtil.join(new ArrayList<>(list), Function.identity()));
childrenInfo.setElderId(StreamUtil.join(new ArrayList<>(linkedHashSet), Function.identity()));
if (linkedHashSet.isEmpty()) {
childrenInfo.setElderId(null);
......
......@@ -29,6 +29,7 @@ import com.makeit.enums.CommonEnum;
import com.makeit.enums.FileSuffixEnum;
import com.makeit.enums.id.TreeConst;
import com.makeit.exception.BusinessException;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.mapper.platform.elder.PlatElderMapper;
import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.elder.*;
......@@ -809,6 +810,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
return platRoomBedDeviceService.getFallDevice(platElder.getBedId());
}
//@TenantIdIgnore
@Override
public List<PlatElderWechatSimpleVO> listMy() {
PlatElderChildrenInfoWechatVO childrenInfo = platElderChildrenInfoService.view();
......
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 sign in to comment