瀏覽代碼

Merge remote-tracking branch 'origin/master_179_20250814' into master_179_20250814

xgb 2 周之前
父節點
當前提交
13900239e0

+ 155 - 0
fs-admin/src/main/java/com/fs/medical/MeasurementUnitController.java

@@ -0,0 +1,155 @@
+package com.fs.medical;
+
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.medical.domain.MeasurementUnit;
+import com.fs.medical.param.MeasurementUnitQueryDto;
+import com.fs.medical.service.MeasurementUnitService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 计量单位Controller
+ *
+ * @author fs
+ * @date 2024
+ */
+@Api("计量单位")
+@RestController
+@RequestMapping("/admin/medical/unit")
+public class MeasurementUnitController extends BaseController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private MeasurementUnitService measurementUnitService;
+
+    /**
+     * 查询所有计量单位
+     */
+    @ApiOperation("查询所有计量单位")
+    @GetMapping("/listAll")
+    public R listAll() {
+        try {
+            List<MeasurementUnit> list = measurementUnitService.listAll();
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("查询计量单位失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 分页查询计量单位列表(带筛选)
+     */
+    @ApiOperation("分页查询计量单位列表")
+    @GetMapping("/page")
+    public R page(MeasurementUnitQueryDto queryDto) {
+        try {
+            PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
+            List<MeasurementUnit> list = measurementUnitService.selectPageList(queryDto);
+            PageInfo<MeasurementUnit> pageInfo = new PageInfo<>(list);
+            return R.ok().put("data", pageInfo);
+        } catch (Exception e) {
+            logger.error("分页查询计量单位失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据单位类型查询计量单位
+     */
+    @ApiOperation("根据单位类型查询计量单位")
+    @GetMapping("/listByType")
+    public R listByType(@RequestParam String unitType) {
+        try {
+            List<MeasurementUnit> list = measurementUnitService.listByType(unitType);
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("根据类型查询计量单位失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据ID查询计量单位详情
+     */
+    @ApiOperation("根据ID查询计量单位详情")
+    @GetMapping("/{unitId}")
+    public R getById(@PathVariable("unitId") Long unitId) {
+        try {
+            MeasurementUnit unit = measurementUnitService.getById(unitId);
+            return R.ok().put("data",unit);
+        } catch (Exception e) {
+            logger.error("查询计量单位详情失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 新增计量单位
+     */
+    @RepeatSubmit
+    @ApiOperation("新增计量单位")
+    @PostMapping("/add")
+    public R add(@RequestBody MeasurementUnit unit) {
+        try {
+            boolean result = measurementUnitService.save(unit);
+            if (result) {
+                return R.ok("新增成功");
+            } else {
+                return R.error("新增失败");
+            }
+        } catch (Exception e) {
+            logger.error("新增计量单位失败", e);
+            return R.error("新增失败");
+        }
+    }
+
+    /**
+     * 更新计量单位
+     */
+    @RepeatSubmit
+    @ApiOperation("更新计量单位")
+    @PutMapping("/update")
+    public R update(@RequestBody MeasurementUnit unit) {
+        try {
+            boolean result = measurementUnitService.update(unit);
+            if (result) {
+                return R.ok("更新成功");
+            } else {
+                return R.error("更新失败");
+            }
+        } catch (Exception e) {
+            logger.error("更新计量单位失败", e);
+            return R.error("更新失败");
+        }
+    }
+
+    /**
+     * 删除计量单位
+     */
+    @ApiOperation("删除计量单位")
+    @DeleteMapping("/{unitId}")
+    public R delete(@PathVariable("unitId") Long unitId) {
+        try {
+            boolean result = measurementUnitService.deleteById(unitId);
+            if (result) {
+                return R.ok("删除成功");
+            } else {
+                return R.error("删除失败");
+            }
+        } catch (Exception e) {
+            logger.error("删除计量单位失败", e);
+            return R.error("删除失败");
+        }
+    }
+}

+ 157 - 0
fs-admin/src/main/java/com/fs/medical/MedicalIndicatorController.java

@@ -0,0 +1,157 @@
+package com.fs.medical;
+
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.medical.domain.MedicalIndicator;
+import com.fs.medical.param.MedicalIndicatorQueryDto;
+import com.fs.medical.service.MedicalIndicatorService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 医疗指标Controller
+ *
+ * @author fs
+ * @date 2024
+ */
+@Slf4j
+@Api("医疗指标")
+@RestController
+@RequestMapping("/admin/medical/indicator")
+public class MedicalIndicatorController extends BaseController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private MedicalIndicatorService medicalIndicatorService;
+
+    /**
+     * 查询所有启用的指标
+     */
+    @ApiOperation("查询所有启用的指标")
+    @GetMapping("/listEnabled")
+    public R listAllEnabled() {
+        try {
+            List<MedicalIndicator> list = medicalIndicatorService.listAllEnabled();
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("查询启用指标失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 分页查询医疗指标列表(带筛选)
+     */
+    @ApiOperation("分页查询医疗指标列表")
+    @GetMapping("/page")
+    public R page(MedicalIndicatorQueryDto queryDto) {
+        try {
+            PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
+            List<MedicalIndicator> list = medicalIndicatorService.selectPageList(queryDto);
+            PageInfo<MedicalIndicator> pageInfo = new PageInfo<>(list);
+            return R.ok().put("data", pageInfo);
+        } catch (Exception e) {
+            logger.error("分页查询医疗指标失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据分类查询指标
+     */
+    @ApiOperation("根据分类查询指标")
+    @GetMapping("/listByCategory")
+    public R listByCategory(@RequestParam String category) {
+        try {
+            List<MedicalIndicator> list = medicalIndicatorService.listByCategory(category);
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("根据分类查询指标失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据ID查询指标详情
+     */
+    @ApiOperation("根据ID查询指标详情")
+    @GetMapping("/{indicatorId}")
+    public R getById(@PathVariable("indicatorId") Long indicatorId) {
+        try {
+            MedicalIndicator indicator = medicalIndicatorService.getById(indicatorId);
+            return R.ok().put("data",indicator);
+        } catch (Exception e) {
+            logger.error("查询指标详情失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 新增指标
+     */
+    @RepeatSubmit
+    @ApiOperation("新增指标")
+    @PostMapping("/add")
+    public R add(@RequestBody MedicalIndicator indicator) {
+        try {
+            boolean result = medicalIndicatorService.save(indicator);
+            if (result) {
+                return R.ok("新增成功");
+            } else {
+                return R.error("新增失败");
+            }
+        } catch (Exception e) {
+            logger.error("新增指标失败", e);
+            return R.error("新增失败");
+        }
+    }
+
+    /**
+     * 更新指标
+     */
+    @RepeatSubmit
+    @ApiOperation("更新指标")
+    @PutMapping("/update")
+    public R update(@RequestBody MedicalIndicator indicator) {
+        try {
+            boolean result = medicalIndicatorService.update(indicator);
+            if (result) {
+                return R.ok("更新成功");
+            } else {
+                return R.error("更新失败");
+            }
+        } catch (Exception e) {
+            logger.error("更新指标失败", e);
+            return R.error("更新失败");
+        }
+    }
+
+    /**
+     * 删除指标
+     */
+    @ApiOperation("删除指标")
+    @DeleteMapping("/{indicatorId}")
+    public R delete(@PathVariable("indicatorId") Long indicatorId) {
+        try {
+            boolean result = medicalIndicatorService.deleteById(indicatorId);
+            if (result) {
+                return R.ok("删除成功");
+            } else {
+                return R.error("删除失败");
+            }
+        } catch (Exception e) {
+            logger.error("删除指标失败", e);
+            return R.error("删除失败");
+        }
+    }
+}

+ 159 - 0
fs-admin/src/main/java/com/fs/medical/PhysicalExamReportController.java

@@ -0,0 +1,159 @@
+package com.fs.medical;
+
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.medical.domain.PhysicalExamReport;
+import com.fs.medical.param.PhysicalExamReportQueryDto;
+import com.fs.medical.service.PhysicalExamReportService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 体检报告Controller
+ *
+ * @author fs
+ * @date 2024
+ */
+@Api("体检报告")
+@RestController
+@RequestMapping("/admin/medical/report")
+public class PhysicalExamReportController extends BaseController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private PhysicalExamReportService physicalExamReportService;
+
+    /**
+     * 根据用户ID查询体检报告列表
+     */
+    @ApiOperation("查询用户体检报告列表")
+    @GetMapping("/listByUser/{userId}")
+    public R listByUserId(@PathVariable("userId") Long userId) {
+        try {
+            List<PhysicalExamReport> list = physicalExamReportService.listByUserId(userId);
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("查询用户体检报告失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 分页查询体检报告列表(带筛选)
+     */
+    @ApiOperation("分页查询体检报告列表")
+    @GetMapping("/page")
+    public R page(PhysicalExamReportQueryDto queryDto) {
+        try {
+            PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
+            List<PhysicalExamReport> list = physicalExamReportService.selectPageList(queryDto);
+            PageInfo<PhysicalExamReport> pageInfo = new PageInfo<>(list);
+            return R.ok().put("data", pageInfo);
+        } catch (Exception e) {
+            logger.error("分页查询体检报告失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据用户ID和体检日期查询体检报告
+     */
+    @ApiOperation("根据用户ID和体检日期查询体检报告")
+    @GetMapping("/getByUserAndDate")
+    public R getByUserIdAndDate(
+            @RequestParam Long userId,
+            @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date examDate) {
+        try {
+            PhysicalExamReport report = physicalExamReportService.getByUserIdAndDate(userId, examDate);
+            return R.ok().put("data",report);
+        } catch (Exception e) {
+            logger.error("根据用户ID和日期查询体检报告失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据ID查询体检报告详情
+     */
+    @ApiOperation("查询体检报告详情")
+    @GetMapping("/{reportId}")
+    public R getById(@PathVariable("reportId") Long reportId) {
+        try {
+            PhysicalExamReport report = physicalExamReportService.getById(reportId);
+            return R.ok().put("data",report);
+        } catch (Exception e) {
+            logger.error("查询体检报告详情失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 新增体检报告
+     */
+    @RepeatSubmit
+    @ApiOperation("新增体检报告")
+    @PostMapping("/add")
+    public R add(@RequestBody PhysicalExamReport report) {
+        try {
+            boolean result = physicalExamReportService.save(report);
+            if (result) {
+                return R.ok("新增成功");
+            } else {
+                return R.error("新增失败");
+            }
+        } catch (Exception e) {
+            logger.error("新增体检报告失败", e);
+            return R.error("新增失败");
+        }
+    }
+
+    /**
+     * 更新体检报告
+     */
+    @RepeatSubmit
+    @ApiOperation("更新体检报告")
+    @PutMapping("/update")
+    public R update(@RequestBody PhysicalExamReport report) {
+        try {
+            boolean result = physicalExamReportService.update(report);
+            if (result) {
+                return R.ok("更新成功");
+            } else {
+                return R.error("更新失败");
+            }
+        } catch (Exception e) {
+            logger.error("更新体检报告失败", e);
+            return R.error("更新失败");
+        }
+    }
+
+    /**
+     * 删除体检报告
+     */
+    @ApiOperation("删除体检报告")
+    @DeleteMapping("/{reportId}")
+    public R delete(@PathVariable("reportId") Long reportId) {
+        try {
+            boolean result = physicalExamReportService.deleteById(reportId);
+            if (result) {
+                return R.ok("删除成功");
+            } else {
+                return R.error("删除失败");
+            }
+        } catch (Exception e) {
+            logger.error("删除体检报告失败", e);
+            return R.error("删除失败");
+        }
+    }
+}

+ 180 - 0
fs-admin/src/main/java/com/fs/medical/ReportIndicatorResultController.java

@@ -0,0 +1,180 @@
+package com.fs.medical;
+
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.medical.domain.ReportIndicatorResult;
+import com.fs.medical.param.ReportIndicatorResultQueryDto;
+import com.fs.medical.service.ReportIndicatorResultService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 报告指标检查Controller
+ *
+ * @author fs
+ * @date 2024
+ */
+@Api("报告指标检查")
+@RestController
+@RequestMapping("/admin/medical/result")
+public class ReportIndicatorResultController extends BaseController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private ReportIndicatorResultService reportIndicatorResultService;
+
+    /**
+     * 根据报告ID查询所有指标结果
+     */
+    @ApiOperation("根据报告ID查询所有指标结果")
+    @GetMapping("/listByReport/{reportId}")
+    public R listByReportId(@PathVariable("reportId") Long reportId) {
+        try {
+            List<ReportIndicatorResult> list = reportIndicatorResultService.listByReportId(reportId);
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("根据报告ID查询指标结果失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 分页查询报告指标检查结果列表(带筛选)
+     */
+    @ApiOperation("分页查询报告指标检查结果列表")
+    @GetMapping("/page")
+    public R page(ReportIndicatorResultQueryDto queryDto) {
+        try {
+            PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
+            List<ReportIndicatorResult> list = reportIndicatorResultService.selectPageList(queryDto);
+            PageInfo<ReportIndicatorResult> pageInfo = new PageInfo<>(list);
+            return R.ok().put("data", pageInfo);
+        } catch (Exception e) {
+            logger.error("分页查询报告指标检查结果失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据指标ID查询所有结果
+     */
+    @ApiOperation("根据指标ID查询所有结果")
+    @GetMapping("/listByIndicator/{indicatorId}")
+    public R listByIndicatorId(@PathVariable("indicatorId") Long indicatorId) {
+        try {
+            List<ReportIndicatorResult> list = reportIndicatorResultService.listByIndicatorId(indicatorId);
+            return R.ok().put("data",list);
+        } catch (Exception e) {
+            logger.error("根据指标ID查询结果失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 根据ID查询检查结果详情
+     */
+    @ApiOperation("查询检查结果详情")
+    @GetMapping("/{resultId}")
+    public R getById(@PathVariable("resultId") Long resultId) {
+        try {
+            ReportIndicatorResult result = reportIndicatorResultService.getById(resultId);
+            return R.ok().put("data",result);
+        } catch (Exception e) {
+            logger.error("查询检查结果详情失败", e);
+            return R.error("查询失败");
+        }
+    }
+
+    /**
+     * 新增检查结果
+     */
+    @RepeatSubmit
+    @ApiOperation("新增检查结果")
+    @PostMapping("/add")
+    public R add(@RequestBody ReportIndicatorResult result) {
+        try {
+            boolean success = reportIndicatorResultService.save(result);
+            if (success) {
+                return R.ok("新增成功");
+            } else {
+                return R.error("新增失败");
+            }
+        } catch (Exception e) {
+            logger.error("新增检查结果失败", e);
+            return R.error("新增失败");
+        }
+    }
+
+    /**
+     * 批量新增检查结果
+     */
+    @RepeatSubmit
+    @ApiOperation("批量新增检查结果")
+    @PostMapping("/batchAdd")
+    public R batchAdd(@RequestBody List<ReportIndicatorResult> results) {
+        try {
+            int successCount = 0;
+            for (ReportIndicatorResult result : results) {
+                if (reportIndicatorResultService.save(result)) {
+                    successCount++;
+                }
+            }
+            if (successCount == results.size()) {
+                return R.ok("批量新增成功");
+            } else {
+                return R.ok("部分新增成功,成功" + successCount + "条");
+            }
+        } catch (Exception e) {
+            logger.error("批量新增检查结果失败", e);
+            return R.error("批量新增失败");
+        }
+    }
+
+    /**
+     * 更新检查结果
+     */
+    @RepeatSubmit
+    @ApiOperation("更新检查结果")
+    @PutMapping("/update")
+    public R update(@RequestBody ReportIndicatorResult result) {
+        try {
+            boolean success = reportIndicatorResultService.update(result);
+            if (success) {
+                return R.ok("更新成功");
+            } else {
+                return R.error("更新失败");
+            }
+        } catch (Exception e) {
+            logger.error("更新检查结果失败", e);
+            return R.error("更新失败");
+        }
+    }
+
+    /**
+     * 删除检查结果
+     */
+    @ApiOperation("删除检查结果")
+    @DeleteMapping("/{resultId}")
+    public R delete(@PathVariable("resultId") Long resultId) {
+        try {
+            boolean success = reportIndicatorResultService.deleteById(resultId);
+            if (success) {
+                return R.ok("删除成功");
+            } else {
+                return R.error("删除失败");
+            }
+        } catch (Exception e) {
+            logger.error("删除检查结果失败", e);
+            return R.error("删除失败");
+        }
+    }
+}

+ 3 - 0
fs-service/src/main/java/com/fs/complaint/domain/FsComplaintCategory.java

@@ -25,6 +25,9 @@ public class FsComplaintCategory implements Serializable {
      */
     private String categoryName;
 
+    private Long userId;
+    private Long companyUserId;
+
     /**
      * 分类编码
      */

+ 1 - 0
fs-service/src/main/java/com/fs/complaint/dto/ComplaintQueryDTO.java

@@ -10,6 +10,7 @@ public class ComplaintQueryDTO {
 
     private String complaintNo;
     private Long categoryId;
+    private String categoryName;
     private Integer status;
     private String contactPhone;
     private String startTime;

+ 8 - 2
fs-service/src/main/java/com/fs/complaint/mapper/FsComplaintMapper.java

@@ -39,8 +39,8 @@ public interface FsComplaintMapper {
     /**
      * 插入投诉信息
      */
-    @Insert("INSERT INTO fs_complaint(complaint_no, category_id, content, contact_phone, contact_email, status, create_time, update_time) " +
-            "VALUES(#{complaintNo}, #{categoryId}, #{content}, #{contactPhone}, #{contactEmail}, #{status}, #{createTime}, #{updateTime})")
+    @Insert("INSERT INTO fs_complaint(complaint_no, category_id, category_name, content, contact_phone, contact_email, status, create_time, update_time) " +
+            "VALUES(#{complaintNo}, #{categoryId}, #{categoryName}, #{content}, #{contactPhone}, #{contactEmail}, #{status}, #{createTime}, #{updateTime})")
     @Options(useGeneratedKeys = true, keyProperty = "id")
     int insert(FsComplaint complaint);
 
@@ -77,6 +77,9 @@ public interface FsComplaintMapper {
             if (complaint.getCategoryId() != null) {
                 sql.append(", category_id = #{categoryId}");
             }
+            if (complaint.getCategoryName() != null) {
+                sql.append(", category_name = #{categoryName}");
+            }
             if (complaint.getContent() != null) {
                 sql.append(", content = #{content}");
             }
@@ -104,6 +107,9 @@ public interface FsComplaintMapper {
             if (queryDTO.getCategoryId() != null) {
                 where.append(" AND category_id = #{categoryId}");
             }
+            if (queryDTO.getCategoryName() != null && !queryDTO.getCategoryName().trim().isEmpty()) {
+                where.append(" AND category_name LIKE CONCAT('%', #{categoryName}, '%')");
+            }
             if (queryDTO.getStatus() != null) {
                 where.append(" AND status = #{status}");
             }

+ 9 - 0
fs-service/src/main/java/com/fs/medical/domain/PhysicalExamReport.java

@@ -26,7 +26,16 @@ public class PhysicalExamReport {
      * 用户ID
      */
     private Long userId;
+    /**
+     * 用户名
+     */
+    private String userName;
+
     private Long companyUserId;
+    /**
+     * 销售名称
+     */
+    private String companyUserName;
 
     /**
      * 体检日期

+ 1 - 1
fs-service/src/main/java/com/fs/medical/mapper/PhysicalExamReportMapper.java

@@ -15,7 +15,7 @@ public interface PhysicalExamReportMapper {
     /**
      * 根据ID查询体检报告
      */
-    @Select("SELECT * FROM fs_physical_exam_report WHERE report_id = #{reportId} AND report_status = 1")
+    @Select("SELECT * FROM fs_physical_exam_report WHERE report_id = #{reportId}")
     PhysicalExamReport getById(@Param("reportId") Long reportId);
 
     /**

+ 28 - 1
fs-service/src/main/java/com/fs/medical/service/impl/PhysicalExamReportServiceImpl.java

@@ -1,5 +1,8 @@
 package com.fs.medical.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.company.cache.ICompanyUserCacheService;
 import com.fs.common.utils.date.DateUtil;
 import com.fs.his.domain.FsAttachment;
 import com.fs.his.service.IFsAttachmentService;
@@ -7,6 +10,7 @@ import com.fs.medical.domain.PhysicalExamReport;
 import com.fs.medical.mapper.PhysicalExamReportMapper;
 import com.fs.medical.param.PhysicalExamReportQueryDto;
 import com.fs.medical.service.PhysicalExamReportService;
+import com.fs.store.service.cache.IFsUserCacheService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -26,6 +30,12 @@ public class PhysicalExamReportServiceImpl implements PhysicalExamReportService
     @Autowired
     private IFsAttachmentService attachmentService;
 
+    @Autowired
+    private IFsUserCacheService fsUserCacheService;
+
+    @Autowired
+    private ICompanyUserCacheService companyUserCacheService;
+
     @Override
     public PhysicalExamReport getById(Long reportId) {
         return physicalExamReportMapper.getById(reportId);
@@ -104,8 +114,25 @@ public class PhysicalExamReportServiceImpl implements PhysicalExamReportService
         return flag;
     }
 
+
     @Override
     public List<PhysicalExamReport> selectPageList(PhysicalExamReportQueryDto queryDto) {
-        return physicalExamReportMapper.selectPageList(queryDto);
+        List<PhysicalExamReport> physicalExamReports = physicalExamReportMapper.selectPageList(queryDto);
+        for (PhysicalExamReport physicalExamReport : physicalExamReports) {
+            if(ObjectUtils.isNotNull(physicalExamReport.getUserId())) {
+                String userNameById = fsUserCacheService.selectUserNameById(physicalExamReport.getUserId());
+                if(StringUtils.isNotBlank(userNameById)) {
+                    physicalExamReport.setUserName(userNameById);
+                }
+            }
+            if(ObjectUtils.isNotNull(physicalExamReport.getCompanyUserId())) {
+                String userNameById = companyUserCacheService.selectCompanyUserNameUserById(physicalExamReport.getCompanyUserId());
+                if(StringUtils.isNotBlank(userNameById)) {
+                    physicalExamReport.setCompanyUserName(userNameById);
+                }
+            }
+        }
+        return physicalExamReports;
     }
 }
+

+ 2 - 2
fs-service/src/main/resources/application-config-dev.yml

@@ -26,8 +26,8 @@ wx:
 #        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
 #        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
 #        msgDataFormat: JSON
-      - appid: wxd70f99287830cb51  #中康智慧商城APP
-        secret: 51129ad15e25fb63b4e6c025df56a541
+      - appid: wxd56333375d59f1b8  #中康智慧商城APP
+        secret: b39f8b0f078032b285c0dee23fd53278
         token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON

+ 42 - 1
fs-user-app/src/main/java/com/fs/app/controller/FsComplaintController.java

@@ -1,11 +1,16 @@
 package com.fs.app.controller;
 
 import com.fs.common.core.domain.R;
+import com.fs.complaint.domain.FsComplaint;
 import com.fs.complaint.domain.FsComplaintCategory;
+import com.fs.complaint.dto.ComplaintQueryDTO;
 import com.fs.complaint.dto.SubmitComplaintDTO;
+import com.fs.complaint.dto.UpdateComplaintDTO;
 import com.fs.complaint.mapper.FsComplaintCategoryMapper;
 import com.fs.complaint.service.FsComplaintService;
+import com.fs.complaint.vo.ComplaintVO;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -40,5 +45,41 @@ public class FsComplaintController {
         fsComplaintService.submitComplaint(dto);
         return R.ok();
     }
-
+    
+    /**
+     * 分页查询投诉列表
+     * @param queryDTO 查询条件
+     * @return 投诉列表
+     */
+    @ApiOperation("分页查询投诉列表")
+    @PostMapping("/list")
+    public R getComplaintList(@RequestBody ComplaintQueryDTO queryDTO) {
+        List<FsComplaint> list = fsComplaintService.getComplaintPage(queryDTO);
+        return R.ok().put("data", list);
+    }
+    
+    /**
+     * 获取投诉详情
+     * @param id 投诉ID
+     * @return 投诉详情
+     */
+    @ApiOperation("获取投诉详情")
+    @GetMapping("/{id}")
+    public R getComplaintDetail(@PathVariable Long id) {
+        ComplaintVO complaint = fsComplaintService.getComplaintById(id);
+        return R.ok().put("data", complaint);
+    }
+    
+    /**
+     * 修改投诉信息
+     * @param id 投诉ID
+     * @param dto 修改参数
+     * @return 结果
+     */
+    @ApiOperation("修改投诉信息")
+    @PutMapping("/{id}")
+    public R updateComplaint(@PathVariable Long id, @RequestBody UpdateComplaintDTO dto) {
+        fsComplaintService.updateComplaint(id, dto);
+        return R.ok();
+    }
 }