修改超声保存方法 重置选中图片状态

This commit is contained in:
lxd 2025-04-03 16:03:56 +08:00
parent 5cafa7c6ac
commit 5e1dc8b042
4 changed files with 18 additions and 11 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo
yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom

View File

@ -75,13 +75,6 @@ public class CommonResult<T> implements Serializable {
return result;
}
public static <T> CommonResult<T> success( String msg) {
CommonResult<T> result = new CommonResult<>();
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
result.data = null;
result.msg = msg;
return result;
}
public static boolean isSuccess(Integer code) {
return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode());
}

View File

@ -280,6 +280,7 @@ public class ultrasonicController {
//如果他是选择 则先进行更新成0 在进行更新1 会存在多次保存 审核只有一次
demedicalimgDO.setRegId(updateReqVO.get(0).getRegid());
demedicalimgDO.setSelected("0");
demedicalimgDO.setId(s.getId());
}
if(demedicalimgDO.getRegId()!=null)
{
@ -290,7 +291,8 @@ public class ultrasonicController {
}
//先进行更新
if (!dedoList.isEmpty()) {
medicalimgService.updateBatchById(dedoList);
// medicalimgService.updateBatchById(dedoList);
medicalimgService.updateimageselect(dedoList.get(0).getRegId());
}
if (!doList.isEmpty()) {

View File

@ -21,4 +21,8 @@ public interface medicalimgService extends IService<medicalimgDO> {
int insimage(medicalimgDO medicalimgDO);
String GetImagevideo(String orgId,String regId);
/*
* 更新患者的所有图片选中标识 置为0
* */
void updateimageselect(String regid);
}

View File

@ -4,15 +4,13 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.medicalimgVO;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg.medicalimgDO;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg.medicalimgMapper;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicMapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
@Service
@Validated
@ -43,4 +41,14 @@ public class medicalimgServiceImpl extends ServiceImpl<medicalimgMapper, medical
public String GetImagevideo(String orgId,String regId) {
return medicalimgMapper.GetImageVideo(orgId,regId);
}
@Override
public void updateimageselect(String regid){
// 创建 UpdateWrapper 对象
UpdateWrapper<medicalimgDO> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("regid", regid) // 设置更新条件
.set("selected", "0"); // 设置要更新的字段
// 执行更新操作
medicalimgMapper.update(null, updateWrapper);
}
}