完善申请单记录 Applyform 相关内容 新增相关后端代码
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
lxd 2024-07-15 16:17:12 +08:00
parent f03c9566f3
commit 41c49b0b35
4 changed files with 71 additions and 6 deletions

View File

@ -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<Boolean> 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<DeviceDO> 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<Boolean> batchupdateFJApplyform( @RequestBody List<deviceupVO> deviceVOList) {
if (!deviceVOList.isEmpty())
{
//最终提交的数据
List<ApplyformDO> 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);
}
}
}

View File

@ -14,4 +14,7 @@ public class deviceupVO {
@Schema(description = "设备内容")
private String device;
@Schema(description = "分检医生")
private String sortDoctor;
}

View File

@ -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<ApplyformDO>{
/**
* 创建申请登记记录
@ -53,4 +58,5 @@ public interface ApplyformService {
*/
PageResult<ApplyformDO> getApplyformPage(ApplyformPageReqVO pageReqVO);
}

View File

@ -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<ApplyformMapper,ApplyformDO> implements ApplyformService {
@Resource
private ApplyformMapper applyformMapper;
@ -73,4 +77,6 @@ public class ApplyformServiceImpl implements ApplyformService {
return applyformMapper.selectPage(pageReqVO);
}
}