Commit 951f5b55 by 杨伟程

长者绑定bug

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