jsk 体检
This commit is contained in:
parent
a745172a60
commit
3dda3ec2ee
|
|
@ -2,6 +2,9 @@ package com.bonus.canteen.core.health.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonInfo;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.health.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -55,7 +58,7 @@ public class HealthMedicalReportTemplateController extends BaseController {
|
|||
@ApiOperation(value = "导出体检报告模板列表")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:template:export")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出体检报告模板")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.EXPORT, logType = 1,module = "健康管理->导出体检报告模板")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HealthMedicalReportTemplate healthMedicalReportTemplate) {
|
||||
List<HealthMedicalReportTemplate> list = healthMedicalReportTemplateService.selectHealthMedicalReportTemplateList(healthMedicalReportTemplate);
|
||||
|
|
@ -72,14 +75,28 @@ public class HealthMedicalReportTemplateController extends BaseController {
|
|||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(healthMedicalReportTemplateService.selectHealthMedicalReportTemplateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取体检报告模板列表
|
||||
*/
|
||||
@ApiOperation(value = "获取体检报告模板列表")
|
||||
//@RequiresPermissions("health:template:query")
|
||||
@GetMapping(value = "/getModelList")
|
||||
public AjaxResult getModelList() {
|
||||
return success(healthMedicalReportTemplateService.getModelList());
|
||||
}
|
||||
@ApiOperation(value = "获取体检报告模板详细信息")
|
||||
//@RequiresPermissions("health:info:query")
|
||||
@PostMapping({"/getModelById"})
|
||||
public AjaxResult getModelById(@RequestBody HealthMedicalReportDetails vo) {
|
||||
return success(healthMedicalReportTemplateService.getModelById(vo));
|
||||
}
|
||||
/**
|
||||
* 新增体检报告模板
|
||||
*/
|
||||
@ApiOperation(value = "新增体检报告模板")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:template:add")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增体检报告模板")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.INSERT, logType = 1,module = "健康管理->新增体检报告模板")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HealthMedicalReportTemplate healthMedicalReportTemplate) {
|
||||
try {
|
||||
|
|
@ -95,7 +112,7 @@ public class HealthMedicalReportTemplateController extends BaseController {
|
|||
@ApiOperation(value = "修改体检报告模板")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:template:edit")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改体检报告模板")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.UPDATE, logType = 1,module = "健康管理->修改体检报告模板")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody HealthMedicalReportTemplate healthMedicalReportTemplate) {
|
||||
try {
|
||||
|
|
@ -111,7 +128,7 @@ public class HealthMedicalReportTemplateController extends BaseController {
|
|||
@ApiOperation(value = "删除体检报告模板")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:template:remove")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除体检报告模板")
|
||||
@SysLog(title = "体检报告模板", businessType = OperaType.DELETE, logType = 1,module = "健康管理->删除体检报告模板")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(healthMedicalReportTemplateService.deleteHealthMedicalReportTemplateByIds(ids));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ package com.bonus.canteen.core.health.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthChronic;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.health.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -49,13 +53,38 @@ public class HealthPersonMedicalReportController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询人员体检报告列表")
|
||||
//@RequiresPermissions("health:report:list")
|
||||
@PostMapping("/getReportList")
|
||||
public AjaxResult getReportList(@RequestBody HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
System.out.println("userId========="+healthPersonMedicalReport.getUserId());
|
||||
List<HealthPersonMedicalReport> list = this.healthPersonMedicalReportService.selectHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除人员体检报告")
|
||||
//@RequiresPermissions("health:report:list")
|
||||
@PostMapping("/delReportList")
|
||||
public AjaxResult delReportList(@RequestBody HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
System.out.println("userId========="+healthPersonMedicalReport.getUserId());
|
||||
healthPersonMedicalReportService.delHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取体检报告详细信息")
|
||||
//@RequiresPermissions("health:info:query")
|
||||
@PostMapping({"/getReportById"})
|
||||
public AjaxResult getReportById(@RequestBody HealthMedicalReportDetails vo) {
|
||||
return success(healthPersonMedicalReportService.getReportById(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人员体检报告列表
|
||||
*/
|
||||
@ApiOperation(value = "导出人员体检报告列表")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:report:export")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出人员体检报告")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.EXPORT, logType = 1,module = "健康管理->导出人员体检报告")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
List<HealthPersonMedicalReport> list = healthPersonMedicalReportService.selectHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
|
|
@ -79,7 +108,7 @@ public class HealthPersonMedicalReportController extends BaseController {
|
|||
@ApiOperation(value = "新增人员体检报告")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:report:add")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增人员体检报告")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.INSERT, logType = 1,module = "健康管理->新增人员体检报告")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
try {
|
||||
|
|
@ -88,6 +117,21 @@ public class HealthPersonMedicalReportController extends BaseController {
|
|||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
@ApiOperation(value = "新增人员体检报告")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:report:add")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.INSERT, logType = 1,module = "健康管理->新增人员体检报告")
|
||||
@PostMapping({"/addReport"})
|
||||
public AjaxResult addReport(@RequestBody HealthPersonMedicalReportDetails healthPersonMedicalReport) {
|
||||
System.out.println("healthPersonMedicalReport==========="+healthPersonMedicalReport.getMedicalTemplateId());
|
||||
System.out.println(healthPersonMedicalReport.getReportDatas().get(0).getMedicalProjectId());
|
||||
System.out.println(healthPersonMedicalReport.getReportDatas().get(0).getHealthMedicalReportDetails().get(0).getMedicalProjectDetailName());
|
||||
try {
|
||||
return toAjax(healthPersonMedicalReportService.insertHealthPersonMedicalReports(healthPersonMedicalReport));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员体检报告
|
||||
|
|
@ -95,7 +139,7 @@ public class HealthPersonMedicalReportController extends BaseController {
|
|||
@ApiOperation(value = "修改人员体检报告")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:report:edit")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改人员体检报告")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.UPDATE, logType = 1,module = "健康管理->修改人员体检报告")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
try {
|
||||
|
|
@ -111,7 +155,7 @@ public class HealthPersonMedicalReportController extends BaseController {
|
|||
@ApiOperation(value = "删除人员体检报告")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:report:remove")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除人员体检报告")
|
||||
@SysLog(title = "人员体检报告", businessType = OperaType.DELETE, logType = 1,module = "健康管理->删除人员体检报告")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(healthPersonMedicalReportService.deleteHealthPersonMedicalReportByIds(ids));
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ public class HealthMedicalReportDetail extends BaseEntity {
|
|||
@Excel(name = "体检项目id")
|
||||
@ApiModelProperty(value = "体检项目id")
|
||||
private Long medicalProjectId;
|
||||
|
||||
/** 体检id */
|
||||
@Excel(name = "体检id")
|
||||
@ApiModelProperty(value = "体检id")
|
||||
private Long medicalId;
|
||||
/** 体检项目明细id */
|
||||
@Excel(name = "体检项目明细id")
|
||||
@ApiModelProperty(value = "体检项目明细id")
|
||||
|
|
@ -47,5 +50,9 @@ public class HealthMedicalReportDetail extends BaseEntity {
|
|||
@ApiModelProperty(value = "参考值范围")
|
||||
private String medicalProjectDetailReference;
|
||||
|
||||
@Excel(name = "检查结果")
|
||||
@ApiModelProperty(value = "检查结果")
|
||||
private String result;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.canteen.core.health.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体检报告项目明细对象 health_medical_report_detail
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class HealthMedicalReportDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增 */
|
||||
private Long id;
|
||||
|
||||
/** 体检项目id */
|
||||
@Excel(name = "体检项目id")
|
||||
@ApiModelProperty(value = "体检项目id")
|
||||
private Long medicalProjectId;
|
||||
/** 体检id */
|
||||
@Excel(name = "体检id")
|
||||
@ApiModelProperty(value = "体检id")
|
||||
private Long medicalId;
|
||||
/** 体检模板id */
|
||||
@Excel(name = "体检模板id")
|
||||
@ApiModelProperty(value = "体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
|
||||
/** 体检项目名称 */
|
||||
@Excel(name = "体检项目名称")
|
||||
@ApiModelProperty(value = "体检项目名称")
|
||||
private String medicalProjectName;
|
||||
|
||||
private List<HealthMedicalReportDetail> healthMedicalReportDetails;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.canteen.core.health.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员体检报告项目明细对象 health_person_medical_report_detail
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class HealthPersonMedicalReportDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增 */
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 体检id */
|
||||
@Excel(name = "体检id")
|
||||
@ApiModelProperty(value = "体检id")
|
||||
private Long medicalId;
|
||||
|
||||
/** 人员id */
|
||||
@Excel(name = "人员id")
|
||||
@ApiModelProperty(value = "人员id")
|
||||
private Long userId;
|
||||
|
||||
/** 体检日期 */
|
||||
@ApiModelProperty(value = "体检日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "体检日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date medicalDate;
|
||||
|
||||
/** 体检机构 */
|
||||
@Excel(name = "体检机构")
|
||||
@ApiModelProperty(value = "体检机构")
|
||||
private String medicalMechanism;
|
||||
|
||||
/** 体检模板id */
|
||||
@Excel(name = "体检模板id")
|
||||
@ApiModelProperty(value = "体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
|
||||
private List<HealthMedicalReportDetails> reportDatas;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.canteen.core.health.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportTemplate;
|
||||
|
||||
/**
|
||||
|
|
@ -57,4 +60,10 @@ public interface HealthMedicalReportTemplateMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthMedicalReportTemplateByIds(Long[] ids);
|
||||
|
||||
List<HealthMedicalReportTemplate> getModelList();
|
||||
|
||||
List<HealthMedicalReportDetails> getModelById(HealthMedicalReportDetails vo);
|
||||
|
||||
List<HealthMedicalReportDetail> getModelDetailById(HealthMedicalReportDetails vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.canteen.core.health.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails;
|
||||
|
||||
/**
|
||||
* 人员体检报告Mapper接口
|
||||
|
|
@ -34,6 +38,11 @@ public interface HealthPersonMedicalReportMapper {
|
|||
*/
|
||||
public int insertHealthPersonMedicalReport(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
|
||||
public int insertPersonReport(HealthPersonMedicalReportDetails healthPersonMedicalReport);
|
||||
int updatePersonReport(HealthPersonMedicalReportDetails healthPersonMedicalReport);
|
||||
int delHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
int insertPersonReportProject(HealthMedicalReportDetails vo);
|
||||
int insertPersonReportDetail(HealthMedicalReportDetail vo);
|
||||
/**
|
||||
* 修改人员体检报告
|
||||
*
|
||||
|
|
@ -57,4 +66,8 @@ public interface HealthPersonMedicalReportMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthPersonMedicalReportByIds(Long[] ids);
|
||||
|
||||
List<HealthMedicalReportDetails> getReportById(HealthMedicalReportDetails vo);
|
||||
|
||||
List<HealthMedicalReportDetail> getReportDetailById(HealthMedicalReportDetails vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.canteen.core.health.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportTemplate;
|
||||
|
||||
/**
|
||||
|
|
@ -57,4 +59,8 @@ public interface IHealthMedicalReportTemplateService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthMedicalReportTemplateById(Long id);
|
||||
|
||||
public List<HealthMedicalReportTemplate> getModelList();
|
||||
|
||||
public List<HealthMedicalReportDetails> getModelById(HealthMedicalReportDetails vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.bonus.canteen.core.health.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails;
|
||||
|
||||
/**
|
||||
* 人员体检报告Service接口
|
||||
|
|
@ -26,6 +29,7 @@ public interface IHealthPersonMedicalReportService {
|
|||
*/
|
||||
public List<HealthPersonMedicalReport> selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
|
||||
|
||||
/**
|
||||
* 新增人员体检报告
|
||||
*
|
||||
|
|
@ -34,6 +38,8 @@ public interface IHealthPersonMedicalReportService {
|
|||
*/
|
||||
public int insertHealthPersonMedicalReport(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
|
||||
public int insertHealthPersonMedicalReports(HealthPersonMedicalReportDetails healthPersonMedicalReport);
|
||||
int delHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
/**
|
||||
* 修改人员体检报告
|
||||
*
|
||||
|
|
@ -57,4 +63,6 @@ public interface IHealthPersonMedicalReportService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthPersonMedicalReportById(Long id);
|
||||
|
||||
public List<HealthMedicalReportDetails> getReportById(HealthMedicalReportDetails vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.bonus.canteen.core.health.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -95,4 +99,29 @@ public class HealthMedicalReportTemplateServiceImpl implements IHealthMedicalRep
|
|||
public int deleteHealthMedicalReportTemplateById(Long id) {
|
||||
return healthMedicalReportTemplateMapper.deleteHealthMedicalReportTemplateById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthMedicalReportTemplate> getModelList() {
|
||||
return healthMedicalReportTemplateMapper.getModelList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthMedicalReportDetails> getModelById(HealthMedicalReportDetails vo) {
|
||||
List<HealthMedicalReportDetails> detailsVos=new ArrayList<>();
|
||||
try{
|
||||
detailsVos=healthMedicalReportTemplateMapper.getModelById(vo);
|
||||
System.out.println("edicalTemplateId=============="+vo.getMedicalTemplateId());
|
||||
System.out.println("detailsVos=============="+detailsVos.size());
|
||||
for(HealthMedicalReportDetails bean:detailsVos){
|
||||
List<HealthMedicalReportDetail> details=new ArrayList<>();
|
||||
System.out.println("medicalProjectId=============="+bean.getMedicalProjectId());
|
||||
details=healthMedicalReportTemplateMapper.getModelDetailById(bean);
|
||||
System.out.println("details=============="+details.size());
|
||||
bean.setHealthMedicalReportDetails(details);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return detailsVos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
package com.bonus.canteen.core.health.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail;
|
||||
import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -57,6 +62,43 @@ public class HealthPersonMedicalReportServiceImpl implements IHealthPersonMedica
|
|||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int insertHealthPersonMedicalReports(HealthPersonMedicalReportDetails healthPersonMedicalReport) {
|
||||
healthPersonMedicalReport.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
healthPersonMedicalReport.setMedicalId(System.currentTimeMillis());
|
||||
healthPersonMedicalReportMapper.insertPersonReport(healthPersonMedicalReport);
|
||||
healthPersonMedicalReportMapper.updatePersonReport(healthPersonMedicalReport);
|
||||
List<HealthMedicalReportDetails> reportDatas=healthPersonMedicalReport.getReportDatas();
|
||||
if(reportDatas!=null&&reportDatas.size()>0){
|
||||
for(HealthMedicalReportDetails vo:reportDatas){
|
||||
List<HealthMedicalReportDetail> details=vo.getHealthMedicalReportDetails();
|
||||
vo.setMedicalId(healthPersonMedicalReport.getMedicalId());
|
||||
healthPersonMedicalReportMapper.insertPersonReportProject(vo);
|
||||
if(details!=null&&details.size()>0){
|
||||
for(HealthMedicalReportDetail vo1:details){
|
||||
vo1.setMedicalId(healthPersonMedicalReport.getMedicalId());
|
||||
vo1.setMedicalProjectDetailId(vo1.getMedicalProjectId());
|
||||
vo1.setMedicalProjectId(vo.getMedicalProjectId());
|
||||
healthPersonMedicalReportMapper.insertPersonReportDetail(vo1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int delHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
try{
|
||||
healthPersonMedicalReportMapper.delHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员体检报告
|
||||
|
|
@ -95,4 +137,24 @@ public class HealthPersonMedicalReportServiceImpl implements IHealthPersonMedica
|
|||
public int deleteHealthPersonMedicalReportById(Long id) {
|
||||
return healthPersonMedicalReportMapper.deleteHealthPersonMedicalReportById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthMedicalReportDetails> getReportById(HealthMedicalReportDetails vo) {
|
||||
List<HealthMedicalReportDetails> detailsVos=new ArrayList<>();
|
||||
try{
|
||||
System.out.println("getMedicalId=============="+vo.getMedicalId());
|
||||
detailsVos=healthPersonMedicalReportMapper.getReportById(vo);
|
||||
System.out.println("detailsVos=============="+detailsVos.size());
|
||||
for(HealthMedicalReportDetails bean:detailsVos){
|
||||
List<HealthMedicalReportDetail> details=new ArrayList<>();
|
||||
System.out.println("medicalProjectId=============="+bean.getMedicalProjectId());
|
||||
details=healthPersonMedicalReportMapper.getReportDetailById(bean);
|
||||
System.out.println("details=============="+details.size());
|
||||
bean.setHealthMedicalReportDetails(details);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return detailsVos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getModelList" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportTemplate" resultMap="HealthMedicalReportTemplateResult">
|
||||
<include refid="selectHealthMedicalReportTemplateVo"/>
|
||||
</select>
|
||||
<select id="getModelById" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails" resultType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails">
|
||||
select medical_project_id as medicalprojectid,medical_project_name as medicalprojectname
|
||||
from health_medical_report_project a
|
||||
where medical_template_id = #{medicalTemplateId}
|
||||
ORDER BY create_time ASC
|
||||
</select>
|
||||
<select id="getModelDetailById" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails" resultType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetail">
|
||||
select medical_project_id as medicalprojectid,medical_project_detail_name as medicalprojectdetailname,medical_project_detail_unit as medicalprojectdetailunit
|
||||
from health_medical_report_detail a
|
||||
where medical_project_id = #{medicalProjectId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -61,7 +61,73 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertPersonReport" parameterType="com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into health_person_medical_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">medical_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="medicalDate != null">medical_date,</if>
|
||||
<if test="medicalMechanism != null and medicalMechanism != ''">medical_mechanism,</if>
|
||||
<if test="medicalTemplateId != null">medical_template_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">#{medicalId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="medicalDate != null">#{medicalDate},</if>
|
||||
<if test="medicalMechanism != null and medicalMechanism != ''">#{medicalMechanism},</if>
|
||||
<if test="medicalTemplateId != null">#{medicalTemplateId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertPersonReportProject" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into health_person_medical_report_project
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">medical_id,</if>
|
||||
<if test="medicalProjectId != null">medical_project_id,</if>
|
||||
<if test="medicalProjectName != null">medical_project_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">#{medicalId},</if>
|
||||
<if test="medicalProjectId != null">#{medicalProjectId},</if>
|
||||
<if test="medicalProjectName != null">#{medicalProjectName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertPersonReportDetail" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into health_person_medical_report_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">medical_id,</if>
|
||||
<if test="medicalProjectId != null">medical_project_id,</if>
|
||||
<if test="medicalProjectDetailId != null">medical_project_detail_id,</if>
|
||||
<if test="medicalProjectDetailName != null">medical_project_detail_name,</if>
|
||||
<if test="result != null">result,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="medicalId != null">#{medicalId},</if>
|
||||
<if test="medicalProjectId != null">#{medicalProjectId},</if>
|
||||
<if test="medicalProjectDetailId != null">#{medicalProjectDetailId},</if>
|
||||
<if test="medicalProjectDetailName != null">#{medicalProjectDetailName},</if>
|
||||
<if test="result != null">#{result},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePersonReport" parameterType="com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails">
|
||||
update health_person_medical_report
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="medicalId != null">medical_id = #{medicalId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="delHealthPersonMedicalReportList" parameterType="com.bonus.canteen.core.health.domain.HealthPersonMedicalReport">
|
||||
delete from health_person_medical_report
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateHealthPersonMedicalReport" parameterType="com.bonus.canteen.core.health.domain.HealthPersonMedicalReport">
|
||||
update health_person_medical_report
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -88,4 +154,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getReportById" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails" resultType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails">
|
||||
select medical_project_id as medicalprojectid,medical_project_name as medicalprojectname,medical_id as medicalid
|
||||
from health_person_medical_report_project a
|
||||
where medical_id = #{medicalId}
|
||||
ORDER BY create_time ASC
|
||||
</select>
|
||||
<select id="getReportDetailById" parameterType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetails" resultType="com.bonus.canteen.core.health.domain.HealthMedicalReportDetail">
|
||||
select medical_project_id as medicalprojectid,medical_project_detail_name as medicalprojectdetailname,medical_project_detail_unit as medicalprojectdetailunit
|
||||
,result
|
||||
from health_person_medical_report_detail a
|
||||
where medical_project_id = #{medicalProjectId} and medical_id = #{medicalId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue