diff --git a/tcm/src/main/java/com/ccsens/tcm/api/InpatientController.java b/tcm/src/main/java/com/ccsens/tcm/api/InpatientController.java index 82613157..2e45a37b 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/InpatientController.java +++ b/tcm/src/main/java/com/ccsens/tcm/api/InpatientController.java @@ -35,6 +35,14 @@ public class InpatientController { @ApiImplicitParams({}) @RequestMapping(value="/query",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) public JsonResponse> queryInpatient() throws Exception { + List inpatientInfos = inpatientService.queryAllInpatient(); + return JsonResponse.newInstance().ok(inpatientInfos); + } + + @ApiOperation(value = "查询启用的对照组的信息",notes = "") + @ApiImplicitParams({}) + @RequestMapping(value="/queryEnable",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) + public JsonResponse> queryEnable() throws Exception { List inpatientInfos = inpatientService.queryInpatient(); return JsonResponse.newInstance().ok(inpatientInfos); } diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/InpatientDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/InpatientDao.java new file mode 100644 index 00000000..4b37841a --- /dev/null +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/InpatientDao.java @@ -0,0 +1,25 @@ +package com.ccsens.tcm.persist.dao; + +import com.ccsens.tcm.bean.vo.InpatientVo; +import com.ccsens.tcm.persist.mapper.InpatientMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author whj + */ +public interface InpatientDao extends InpatientMapper { + /** + * 查询全部对照组(含禁用) + * @return + */ + List queryAllInpatient(); + + /** + * 根据ID查询对象(含禁用) + * @param id + * @return + */ + InpatientVo.InpatientInfo getAllById(@Param("id") Long id); +} diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java index 4c92491c..b0681dd2 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/IInpatientService.java @@ -10,9 +10,14 @@ import java.util.List; public interface IInpatientService { /** - * 查看所有对照组 + * 查看有效对照组 * @return 返回对照组信息 */ List queryInpatient(); + /** + * 查询全部对照组 + * @return + */ + List queryAllInpatient(); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java index 3c2d8cd3..f3e6e5cb 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/InpatientService.java @@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import com.ccsens.tcm.bean.po.Inpatient; import com.ccsens.tcm.bean.po.InpatientExample; import com.ccsens.tcm.bean.vo.InpatientVo; -import com.ccsens.tcm.persist.mapper.InpatientMapper; +import com.ccsens.tcm.persist.dao.InpatientDao; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -25,7 +25,7 @@ import java.util.List; @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public class InpatientService implements IInpatientService{ @Resource - private InpatientMapper inpatientMapper; + private InpatientDao inpatientDao; @Override public List queryInpatient() { @@ -33,7 +33,8 @@ public class InpatientService implements IInpatientService{ InpatientExample inpatientExample = new InpatientExample(); inpatientExample.clear(); - List inpatients = inpatientMapper.selectByExample(inpatientExample); + inpatientExample.setOrderByClause("code"); + List inpatients = inpatientDao.selectByExample(inpatientExample); inpatients.forEach(inpatient -> { InpatientVo.InpatientInfo inpatientInfo = new InpatientVo.InpatientInfo(); BeanUtil.copyProperties(inpatient,inpatientInfo); @@ -41,4 +42,9 @@ public class InpatientService implements IInpatientService{ }); return inpatientInfos; } + + @Override + public List queryAllInpatient() { + return inpatientDao.queryAllInpatient(); + } } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java index 0b2f0fa1..ee7a2222 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java @@ -10,11 +10,13 @@ import com.ccsens.tcm.bean.dto.StatisticDto; import com.ccsens.tcm.bean.po.*; import com.ccsens.tcm.bean.vo.*; import com.ccsens.tcm.persist.dao.DoctorDao; +import com.ccsens.tcm.persist.dao.InpatientDao; import com.ccsens.tcm.persist.dao.PatientDao; import com.ccsens.tcm.persist.mapper.*; import com.ccsens.tcm.uitl.Constant; import com.ccsens.util.CodeEnum; import com.ccsens.util.RedisUtil; +import com.ccsens.util.WebConstant; import com.ccsens.util.exception.BaseException; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -47,7 +49,7 @@ public class PatientService implements IPatientService { @Resource private BiologicalSamplesMapper biologicalSamplesMapper; @Resource - private InpatientMapper inpatientMapper; + private InpatientDao inpatientDao; @Resource private HospitalMapper hospitalMapper; @Resource @@ -73,7 +75,7 @@ public class PatientService implements IPatientService { @Override public void savePatient(PatientDto.SavePatient param, Long userId) { Hospital hospital = selUserIdToHosId(userId); - Inpatient inpatient = inpatientMapper.selectByPrimaryKey(param.getInpatientId()); + Inpatient inpatient = inpatientDao.selectByPrimaryKey(param.getInpatientId()); if (inpatient == null) { throw new BaseException(CodeEnum.PARAM_ERROR); } @@ -310,7 +312,7 @@ public class PatientService implements IPatientService { } for (int i = 0; i < param.getInpatientId().length; i++) { StatisticVo.SelGroupNum selGroupNum =new StatisticVo.SelGroupNum(); - selGroupNum.setName(inpatientMapper.selectByPrimaryKey(param.getInpatientId()[i]).getName()); + selGroupNum.setName(inpatientDao.getAllById(param.getInpatientId()[i]).getName()); List selGroupList= patientDao.countAnalysis(param.getConditionList(),param.getConditionListDate(), param.getReportParams(),param.getInpatientId()[i],param.getTestQuestionsId(),param.getHospitalization(),param.getInputStatus(),param.getHospitalId()); selGroupNum.setInpatientId(param.getInpatientId()[i]); selGroupNum.setList(selGroupList); @@ -467,6 +469,8 @@ public class PatientService implements IPatientService { patientInformation.setCheckId(userId); } else if (param.getInputStatus() == Constant.Patient.STATUS_CLOSE) { patientInformation.setPassId(userId); + } else if (param.getInputStatus() == Constant.Patient.STATUS_DISABLE) { + patientInformation.setRecStatus(WebConstant.REC_STATUS.Disabled.value); } patientInformationMapper.updateByExampleSelective(patientInformation,patientInformationExample); } diff --git a/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java b/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java index bed16ecd..1ac35761 100644 --- a/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java +++ b/tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java @@ -47,6 +47,8 @@ public class Constant { public static class Patient { + /**废弃*/ + public final static byte STATUS_DISABLE = 4; /**审核通过*/ public final static byte STATUS_PASS = 5; /**已完结*/ diff --git a/tcm/src/main/resources/application.yml b/tcm/src/main/resources/application.yml index 4ecd13fd..b9b264a7 100644 --- a/tcm/src/main/resources/application.yml +++ b/tcm/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: dev - include: common, util-dev + active: prod + include: common, util-prod diff --git a/tcm/src/main/resources/mapper_dao/InpatientDao.xml b/tcm/src/main/resources/mapper_dao/InpatientDao.xml new file mode 100644 index 00000000..a0fb9baa --- /dev/null +++ b/tcm/src/main/resources/mapper_dao/InpatientDao.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/tcm/src/main/resources/mapper_dao/PatientDao.xml b/tcm/src/main/resources/mapper_dao/PatientDao.xml index d0f3e78d..5a36531f 100644 --- a/tcm/src/main/resources/mapper_dao/PatientDao.xml +++ b/tcm/src/main/resources/mapper_dao/PatientDao.xml @@ -246,7 +246,7 @@ count(distinct tpr.patient_id) as nums from t_patient_information tpi left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0 and tpr.contents_type =0 - left join t_inpatient ti on ti.id=tpi.inpatient_id and ti.rec_status = 0 + left join t_inpatient ti on ti.id=tpi.inpatient_id and ti.rec_status in (0,1) where tpi.rec_status=0