web: 添加处置计划相关功能
parent
ba61e59b6f
commit
726448fef2
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【vp_treatment_plan_record(处置计划记录表)】的数据库操作Mapper
|
||||
* @createDate 2023-12-06 16:43:24
|
||||
* @Entity com.supervision.model.TreatmentPlanRecord
|
||||
*/
|
||||
public interface TreatmentPlanRecordMapper extends BaseMapper<TreatmentPlanRecord> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【vp_treatment_plan_record(处置计划记录表)】的数据库操作Service
|
||||
* @createDate 2023-12-06 16:43:24
|
||||
*/
|
||||
public interface TreatmentPlanRecordService extends IService<TreatmentPlanRecord> {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
import com.supervision.service.TreatmentPlanRecordService;
|
||||
import com.supervision.mapper.TreatmentPlanRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【vp_treatment_plan_record(处置计划记录表)】的数据库操作Service实现
|
||||
* @createDate 2023-12-06 16:43:24
|
||||
*/
|
||||
@Service
|
||||
public class TreatmentPlanRecordServiceImpl extends ServiceImpl<TreatmentPlanRecordMapper, TreatmentPlanRecord>
|
||||
implements TreatmentPlanRecordService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.TreatmentPlanRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.model.TreatmentPlanRecord">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="processId" column="process_id" jdbcType="VARCHAR"/>
|
||||
<result property="disposalMethod" column="disposal_method" jdbcType="INTEGER"/>
|
||||
<result property="disposalPlan" column="disposal_plan" jdbcType="INTEGER"/>
|
||||
<result property="firstMeasures" column="first_measures" jdbcType="VARCHAR"/>
|
||||
<result property="drugId" column="drug_id" jdbcType="VARCHAR"/>
|
||||
<result property="drugName" column="drug_name" jdbcType="VARCHAR"/>
|
||||
<result property="drugRoute" column="drug_route" jdbcType="INTEGER"/>
|
||||
<result property="intervalDay" column="interval_day" jdbcType="INTEGER"/>
|
||||
<result property="intervalHour" column="interval_hour" jdbcType="DOUBLE"/>
|
||||
<result property="explain" column="explain" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,process_id,disposal_method,
|
||||
disposal_plan,first_measures,drug_id,
|
||||
drug_name,drug_route,interval_day,
|
||||
interval_hour,explain,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,58 @@
|
||||
package com.supervision.controller;
|
||||
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
import com.supervision.service.TreatmentPlanService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "处置计划")
|
||||
@RestController
|
||||
@RequestMapping("treatmentPlan")
|
||||
@RequiredArgsConstructor
|
||||
public class TreatmentPlanController {
|
||||
|
||||
|
||||
private final TreatmentPlanService treatmentPlanService;
|
||||
|
||||
@ApiOperation("新增处置计划记录")
|
||||
@PostMapping("/record/save")
|
||||
public boolean saveTreatmentPlanRecord(@RequestBody TreatmentPlanRecord treatmentPlanRecord) {
|
||||
|
||||
return treatmentPlanService.saveTreatmentPlanRecord(treatmentPlanRecord);
|
||||
}
|
||||
|
||||
@ApiOperation("修改处置计划记录")
|
||||
@PutMapping("/record/update")
|
||||
public boolean updateTreatmentPlanRecord(@RequestBody TreatmentPlanRecord treatmentPlanRecord) {
|
||||
|
||||
return treatmentPlanService.updateTreatmentPlanRecord(treatmentPlanRecord);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除处置计划记录")
|
||||
@DeleteMapping("/record/delete")
|
||||
public boolean deleteTreatmentPlanRecord(@Param("记录主键id") @RequestParam String id) {
|
||||
|
||||
return treatmentPlanService.deleteTreatmentPlanRecord(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询处置计划记录列表")
|
||||
@GetMapping("/record/queryRecord")
|
||||
public List<TreatmentPlanRecord> queryTreatmentPlanRecord(@ApiParam("流程实例id") @RequestParam("processId") String processId,
|
||||
@ApiParam("处置计划类型 药物:0 其他:1") String disposalPlanType) {
|
||||
|
||||
return treatmentPlanService.queryTreatmentPlanRecord(processId, disposalPlanType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TreatmentPlanService {
|
||||
boolean saveTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord);
|
||||
|
||||
List<TreatmentPlanRecord> queryTreatmentPlanRecord(String processId, String disposalPlanType);
|
||||
|
||||
boolean updateTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord);
|
||||
|
||||
boolean deleteTreatmentPlanRecord(String id);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.supervision.model.TreatmentPlanRecord;
|
||||
import com.supervision.service.TreatmentPlanRecordService;
|
||||
import com.supervision.service.TreatmentPlanService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TreatmentPlanServiceImpl implements TreatmentPlanService {
|
||||
|
||||
|
||||
private final TreatmentPlanRecordService treatmentPlanRecordService;
|
||||
@Override
|
||||
public boolean saveTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord) {
|
||||
|
||||
assertSaveTreatmentPlanRecord(treatmentPlanRecord);
|
||||
|
||||
return treatmentPlanRecordService.save(treatmentPlanRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreatmentPlanRecord> queryTreatmentPlanRecord(String processId, String disposalPlanType) {
|
||||
|
||||
Assert.notEmpty(processId,"流程id不允许为空");
|
||||
|
||||
return treatmentPlanRecordService.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId)
|
||||
.eq("0".equals(disposalPlanType), TreatmentPlanRecord::getDisposalPlan, "2")
|
||||
.in("1".equals(disposalPlanType), TreatmentPlanRecord::getDisposalPlan,
|
||||
CollUtil.newArrayList("1","3","4","5","6","7")).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord) {
|
||||
|
||||
Assert.notEmpty(treatmentPlanRecord.getId(),"主键不能为空");
|
||||
assertSaveTreatmentPlanRecord(treatmentPlanRecord);
|
||||
|
||||
return treatmentPlanRecordService.updateById(treatmentPlanRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteTreatmentPlanRecord(String id) {
|
||||
|
||||
Assert.notEmpty("主键id不能为空");
|
||||
|
||||
return treatmentPlanRecordService.removeById(id);
|
||||
}
|
||||
|
||||
private void assertSaveTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord){
|
||||
Assert.notEmpty(treatmentPlanRecord.getProcessId(),"流程id不能为空");
|
||||
Assert.notNull(treatmentPlanRecord.getDisposalMethod(),"处置方式不能为为空");
|
||||
Assert.notNull(treatmentPlanRecord.getDisposalPlan(),"处置计划不能为空");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue