瀏覽代碼

feat:小程序接口补全-随访、健康记录、用药提醒

caoliqin 14 小時之前
父節點
當前提交
27b6250867

+ 70 - 0
java/fs-user-app/src/main/java/com/fs/app/controller/ChronicFollowPlanController.java

@@ -0,0 +1,70 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.chronic.domain.ChronicFollowPlan;
+import com.fs.chronic.service.IChronicFollowPlanService;
+import com.fs.common.core.domain.R;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 慢病随访计划接口
+ */
+@Api("慢病随访计划接口")
+@RestController
+@RequestMapping(value = "/app/chronicFollowPlan")
+public class ChronicFollowPlanController extends AppBaseController {
+
+    @Autowired
+    private IChronicFollowPlanService chronicFollowPlanService;
+
+    @Login
+    @ApiOperation("获取慢病随访计划列表")
+    @GetMapping("/list")
+    public R list(ChronicFollowPlan chronicFollowPlan) {
+        startPage();
+        List<ChronicFollowPlan> list = chronicFollowPlanService.selectChronicFollowPlanList(chronicFollowPlan);
+        PageInfo<ChronicFollowPlan> pageInfo = new PageInfo<>(list);
+        return R.ok().put("data", pageInfo);
+    }
+
+    @Login
+    @ApiOperation("获取慢病随访计划详情")
+    @GetMapping("/{id}")
+    public R getById(@PathVariable Long id) {
+        ChronicFollowPlan plan = chronicFollowPlanService.selectChronicFollowPlanById(id);
+        return R.ok().put("data", plan);
+    }
+
+    @Login
+    @ApiOperation("新增慢病随访计划")
+    @PostMapping
+    public R add(@Validated @RequestBody ChronicFollowPlan chronicFollowPlan) {
+        chronicFollowPlan.setCreateBy(getUserId());
+        int rows = chronicFollowPlanService.insertChronicFollowPlan(chronicFollowPlan);
+        return rows > 0 ? R.ok("新增成功") : R.error("新增失败");
+    }
+
+    @Login
+    @ApiOperation("修改慢病随访计划")
+    @PutMapping
+    public R edit(@Validated @RequestBody ChronicFollowPlan chronicFollowPlan) {
+        chronicFollowPlan.setUpdateBy(getUserId());
+        int rows = chronicFollowPlanService.updateChronicFollowPlan(chronicFollowPlan);
+        return rows > 0 ? R.ok("修改成功") : R.error("修改失败");
+    }
+
+    @Login
+    @ApiOperation("删除慢病随访计划")
+    @DeleteMapping("/{ids}")
+    public R remove(@PathVariable Long[] ids) {
+        int rows = chronicFollowPlanService.deleteChronicFollowPlanByIds(ids);
+        return rows > 0 ? R.ok("删除成功") : R.error("删除失败");
+    }
+}

+ 70 - 0
java/fs-user-app/src/main/java/com/fs/app/controller/HealthCheckRecordController.java

@@ -0,0 +1,70 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.chronic.domain.HealthCheckRecord;
+import com.fs.chronic.service.IHealthCheckRecordService;
+import com.fs.common.core.domain.R;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 健康检查记录(健康报告)接口
+ */
+@Api("健康检查记录接口")
+@RestController
+@RequestMapping(value = "/app/healthCheckRecord")
+public class HealthCheckRecordController extends AppBaseController {
+
+    @Autowired
+    private IHealthCheckRecordService healthCheckRecordService;
+
+    @Login
+    @ApiOperation("获取健康检查记录列表")
+    @GetMapping("/list")
+    public R list(HealthCheckRecord healthCheckRecord) {
+        startPage();
+        List<HealthCheckRecord> list = healthCheckRecordService.selectHealthCheckRecordList(healthCheckRecord);
+        PageInfo<HealthCheckRecord> pageInfo = new PageInfo<>(list);
+        return R.ok().put("data", pageInfo);
+    }
+
+    @Login
+    @ApiOperation("获取健康检查记录详情")
+    @GetMapping("/{id}")
+    public R getById(@PathVariable Long id) {
+        HealthCheckRecord record = healthCheckRecordService.selectHealthCheckRecordById(id);
+        return R.ok().put("data", record);
+    }
+
+    @Login
+    @ApiOperation("新增健康检查记录")
+    @PostMapping
+    public R add(@Validated @RequestBody HealthCheckRecord healthCheckRecord) {
+        healthCheckRecord.setCreateBy(getUserId());
+        int rows = healthCheckRecordService.insertHealthCheckRecord(healthCheckRecord);
+        return rows > 0 ? R.ok("新增成功") : R.error("新增失败");
+    }
+
+    @Login
+    @ApiOperation("修改健康检查记录")
+    @PutMapping
+    public R edit(@Validated @RequestBody HealthCheckRecord healthCheckRecord) {
+        healthCheckRecord.setUpdateBy(getUserId());
+        int rows = healthCheckRecordService.updateHealthCheckRecord(healthCheckRecord);
+        return rows > 0 ? R.ok("修改成功") : R.error("修改失败");
+    }
+
+    @Login
+    @ApiOperation("删除健康检查记录")
+    @DeleteMapping("/{ids}")
+    public R remove(@PathVariable Long[] ids) {
+        int rows = healthCheckRecordService.deleteHealthCheckRecordByIds(ids);
+        return rows > 0 ? R.ok("删除成功") : R.error("删除失败");
+    }
+}

+ 71 - 0
java/fs-user-app/src/main/java/com/fs/app/controller/MedicationReminderController.java

@@ -0,0 +1,71 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.chronic.domain.MedicationReminder;
+import com.fs.chronic.service.IMedicationReminderService;
+import com.fs.common.core.domain.R;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用药提醒接口
+ */
+@Api("用药提醒接口")
+@RestController
+@RequestMapping(value = "/app/medicationReminder")
+public class MedicationReminderController extends AppBaseController {
+
+    @Autowired
+    private IMedicationReminderService medicationReminderService;
+
+    @Login
+    @ApiOperation("获取用药提醒列表")
+    @GetMapping("/list")
+    public R list(MedicationReminder medicationReminder) {
+        startPage();
+        List<MedicationReminder> list = medicationReminderService.selectMedicationReminderList(medicationReminder);
+        PageInfo<MedicationReminder> pageInfo = new PageInfo<>(list);
+        return R.ok().put("data", pageInfo);
+    }
+
+    @Login
+    @ApiOperation("获取用药提醒详情")
+    @GetMapping("/{id}")
+    public R getById(@PathVariable Long id) {
+        MedicationReminder reminder = medicationReminderService.selectMedicationReminderById(id);
+        return R.ok().put("data", reminder);
+    }
+
+    @Login
+    @ApiOperation("新增用药提醒")
+    @PostMapping
+    public R add(@Validated @RequestBody MedicationReminder medicationReminder) {
+        medicationReminder.setCreateBy(getUserId());
+        int rows = medicationReminderService.insertMedicationReminder(medicationReminder);
+        return rows > 0 ? R.ok("新增成功") : R.error("新增失败");
+    }
+
+    @Login
+    @ApiOperation("修改用药提醒")
+    @PutMapping
+    public R edit(@Validated @RequestBody MedicationReminder medicationReminder) {
+        medicationReminder.setUpdateBy(getUserId());
+        int rows = medicationReminderService.updateMedicationReminder(medicationReminder);
+        return rows > 0 ? R.ok("修改成功") : R.error("修改失败");
+    }
+
+    @Login
+    @ApiOperation("删除用药提醒")
+    @DeleteMapping("/{ids}")
+    public R remove(@PathVariable Long[] ids) {
+        int rows = medicationReminderService.deleteMedicationReminderByIds(ids);
+        return rows > 0 ? R.ok("删除成功") : R.error("删除失败");
+    }
+}