From 41c49b0b352ed32517874a0312e09344ef0ab20f Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Mon, 15 Jul 2024 16:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=20Applyform=20=E7=9B=B8=E5=85=B3=E5=86=85?= =?UTF-8?q?=E5=AE=B9=20=E6=96=B0=E5=A2=9E=E7=9B=B8=E5=85=B3=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/applyform/ApplyformController.java | 52 ++++++++++++++++++- .../admin/applyform/devicevo/deviceupVO.java | 3 ++ .../service/applyform/ApplyformService.java | 10 +++- .../applyform/ApplyformServiceImpl.java | 12 +++-- 4 files changed, 71 insertions(+), 6 deletions(-) diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java index bba1cd5d9..087608772 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devi import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO; import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO; import cn.iocoder.yudao.module.applyregistration.service.applyform.device.DeviceService; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; @@ -118,7 +119,7 @@ public class ApplyformController { @Operation(summary = "分检更新") @Parameter(name = "id", description = "ID", required = true, example = "1024") @Parameter(name = "device", description = "设备", required = true,example = "12121") - @PreAuthorize("@ss.hasPermission('applyregistration:applyform:query')") + @PreAuthorize("@ss.hasPermission('applyregistration:applyform:update')") public CommonResult updateFJApplyform(@Valid @RequestBody deviceupVO deviceVO) { if (deviceVO==null) @@ -138,6 +139,7 @@ public class ApplyformController { updateReqVO.setDeviceId(result[1]); updateReqVO.setSortDate(dateTime); updateReqVO.setExamStatus("未检查"); + updateReqVO.setSortDoctor(deviceVO.getSortDoctor());//分检医生 applyformService.updateApplyform(updateReqVO); return success(true); } @@ -170,4 +172,52 @@ public class ApplyformController { List devicelist = DeviceService.getDevicelist(orgId); return success(BeanUtils.toBean(devicelist, DeviceVO.class)); } + + @PostMapping("/batchupdateFJ") + @Operation(summary = "批量分检更新") + @Parameter(name = "id", description = "机构ID", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('applyregistration:applyform:update')") + public CommonResult batchupdateFJApplyform( @RequestBody List deviceVOList) { + + if (!deviceVOList.isEmpty()) + { + //最终提交的数据 + List doList=new ArrayList<>(); + + //当前时间 + LocalDateTime dateTime= LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + //循环传递进来的参数 赋值 + for (deviceupVO s : deviceVOList) { + //新增对象 + ApplyformDO applyformDO=new ApplyformDO(); + applyformDO.setId(s.getID()); + String[] result = s.getDevice().split("\\|"); + applyformDO.setDeviceName(result[0]); + applyformDO.setDeviceId(result[1]); + applyformDO.setSortDate(dateTime); + applyformDO.setExamStatus("未检查"); + applyformDO.setSortDoctor(s.getSortDoctor());//分检医生 + doList.add(applyformDO); + } + if (!doList.isEmpty()) + { + boolean bol= applyformService.updateBatchById(doList); + return success(true); + } + else + { + return success(false); + } + } + else + { + + log.error("批量分检更新方法参数为空"); + return success(false); + } + + + } + } \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/devicevo/deviceupVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/devicevo/deviceupVO.java index afa27bb7c..230c6b29d 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/devicevo/deviceupVO.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/devicevo/deviceupVO.java @@ -14,4 +14,7 @@ public class deviceupVO { @Schema(description = "设备内容") private String device; + + @Schema(description = "分检医生") + private String sortDoctor; } diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java index d5d9b7bbe..d8b62b5a9 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java @@ -1,10 +1,13 @@ package cn.iocoder.yudao.module.applyregistration.service.applyform; - +import java.util.List; import java.util.*; + +import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO; import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*; import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import com.baomidou.mybatisplus.extension.service.IService; import javax.validation.Valid; @@ -13,7 +16,9 @@ import javax.validation.Valid; * * @author 李晓东 */ -public interface ApplyformService { +// +public interface ApplyformService extends IService{ + /** * 创建申请登记记录 @@ -53,4 +58,5 @@ public interface ApplyformService { */ PageResult getApplyformPage(ApplyformPageReqVO pageReqVO); + } \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java index a8ea03313..6d3779ed0 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java @@ -1,16 +1,20 @@ package cn.iocoder.yudao.module.applyregistration.service.applyform; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.function.Function; + import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*; import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.applyregistration.dal.mysql.applyform.ApplyformMapper; @@ -26,7 +30,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU */ @Service @Validated -public class ApplyformServiceImpl implements ApplyformService { +public class ApplyformServiceImpl extends ServiceImpl implements ApplyformService { @Resource private ApplyformMapper applyformMapper; @@ -73,4 +77,6 @@ public class ApplyformServiceImpl implements ApplyformService { return applyformMapper.selectPage(pageReqVO); } + + } \ No newline at end of file