Browse Source

拉代码

recovery
wang1007152140 5 years ago
parent
commit
9d65dc8aab
  1. 4
      tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java
  2. 43
      tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java
  3. 25
      tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java
  4. 15
      tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java
  5. 5
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  6. 4
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  7. 40
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  8. 4
      tcm/src/main/resources/application.yml
  9. 13
      tcm/src/main/resources/mapper_dao/PatientDao.xml
  10. 1
      util/src/main/java/com/ccsens/util/CodeEnum.java

4
tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java

@ -29,12 +29,12 @@ import javax.annotation.Resource;
public class ConferenceRecordsController {
@Resource
private IPatientService patientService;
// @MustLogin
@MustLogin
@ApiOperation(value = "查询会议记录", notes = "w:根据会议记录查询条件查询会议记录")
@RequestMapping(value = "/selConRec", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<ConRecVo.SelConRecVo>> selConRec(@ApiParam @Validated @RequestBody QueryDto<ConRecDto.SelConRecDto> params) {
log.info("查询会议记录相关信息:{}",params);
PageInfo<ConRecVo.SelConRecVo> selConRecVoPageInfo= patientService.selConRec(params.getParam(),0L);
PageInfo<ConRecVo.SelConRecVo> selConRecVoPageInfo= patientService.selConRec(params.getParam(),params.getUserId());
log.info("查询会议记录基本信息成功");
return JsonResponse.newInstance().ok(selConRecVoPageInfo);
}

43
tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java

@ -0,0 +1,43 @@
package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import com.ccsens.tcm.service.IPatientService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author wang
*/
@Api(tags = "统计分析相关接口")
@RestController
@RequestMapping("/statistics")
@Slf4j
public class StatisticalAnalysisController {
@Resource
private IPatientService patientService;
@MustLogin
@ApiOperation(value = "每日病例统计", notes = "w:每日病例统计")
@RequestMapping(value = "/countCase", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<StatisticVo.SelCountS> countCase(@ApiParam @Validated @RequestBody QueryDto<StatisticDto.SelCount> params) {
log.info("统计每日病例请求参数:{}",params);
StatisticVo.SelCountS countCase= patientService.countCase(params.getParam(),params.getUserId());
log.info("统计每日病例调用完成");
return JsonResponse.newInstance().ok(countCase);
}
}

25
tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java

@ -0,0 +1,25 @@
package com.ccsens.tcm.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class StatisticDto {
@Data
public static class SelCount{
@ApiModelProperty("主治大夫id")
private Long userId;
@ApiModelProperty("医院id")
private Long hospitalId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("开始时间")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("结束时间")
private Date endDate;
}
}

15
tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java

@ -0,0 +1,15 @@
package com.ccsens.tcm.bean.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StatisticVo {
@Data
public static class SelCountS{
@ApiModelProperty("新建的病例")
private Integer newNums;
@ApiModelProperty("已完成的病例")
private Integer overNums;
}
}

5
tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java

@ -2,8 +2,11 @@ package com.ccsens.tcm.persist.dao;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -18,4 +21,6 @@ public interface PatientDao {
List<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param);
List<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param);
Integer countCase(@Param("param") StatisticDto.SelCount param,@Param("inputStatus") byte inputStatus);
}

4
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -2,9 +2,11 @@ package com.ccsens.tcm.service;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.QuestionVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import com.github.pagehelper.PageInfo;
import java.util.List;
@ -24,4 +26,6 @@ public interface IPatientService {
List<QuestionVo.ReportCodeVo> selSearchCriteriaList();
PageInfo<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param, Long userId);
StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId);
}

40
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -1,8 +1,10 @@
package com.ccsens.tcm.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.po.PatientInformation;
import com.ccsens.tcm.bean.po.PatientRecord;
import com.ccsens.tcm.bean.po.PatientRecordExample;
@ -10,12 +12,15 @@ import com.ccsens.tcm.bean.po.ReportCode;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.QuestionVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import com.ccsens.tcm.persist.dao.PatientDao;
import com.ccsens.tcm.persist.mapper.PatientInformationMapper;
import com.ccsens.tcm.persist.mapper.PatientRecordMapper;
import com.ccsens.tcm.persist.mapper.ReportCodeMapper;
import com.ccsens.tcm.uitl.Constant;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -79,7 +84,7 @@ public class PatientService implements IPatientService {
PatientInformation patientInformation = patientInformationMapper.selectByPrimaryKey(param.getPatientId());
onsetTime=patientInformation.getCreatedAt();
}
//试题只需要记录3次的 9 和30 算分界限 <9 =0 ;<30 =14 ; >30 =90
//试题只需要记录3次的 9 和30 算分界限 <9 =0 ;<30 =14 ; >30 =90 记录2次的 270 算分界线 <270 算180 ,>270 算365
int one=9;
int two=30;
int oneFront=0;
@ -172,21 +177,25 @@ public class PatientService implements IPatientService {
@Override
public List<QuestionVo.ReportCodeVo> selSearchCriteriaList() {
List<QuestionVo.ReportCodeVo> reportCodeVos=null;
List<Object> objects = redisUtil.lGet(Constant.Redis.CODE_QUESTION, 0, -1);
List<QuestionVo.ReportCodeVo> reportCodeVos = (List<QuestionVo.ReportCodeVo>)objects.get(0);
for (int i = 0; i < reportCodeVos.size(); i++) {
List<QuestionVo.CodeQuestionVo> codeQuestionVoList= reportCodeVos.get(i).getQuestionVos();
for (int i1 = 0; i1 < codeQuestionVoList.size(); i1++) {
if(codeQuestionVoList.get(i1).getSearchCriteria()==(byte)0){
codeQuestionVoList.remove(i1);
if(i1==0){
i1=0;
}else {
i1--;
if (CollectionUtil.isEmpty(reportCodeVos)){
throw new BaseException(CodeEnum.MESSAGEISNULL);
}
reportCodeVos = (List<QuestionVo.ReportCodeVo>)objects.get(0);
for (int i = 0; i < reportCodeVos.size(); i++) {
List<QuestionVo.CodeQuestionVo> codeQuestionVoList = reportCodeVos.get(i).getQuestionVos();
for (int i1 = 0; i1 < codeQuestionVoList.size(); i1++) {
if (codeQuestionVoList.get(i1).getSearchCriteria() == (byte) 0) {
codeQuestionVoList.remove(i1);
if (i1 == 0) {
i1 = 0;
} else {
i1--;
}
}
}
}
}
return reportCodeVos;
}
@ -197,6 +206,13 @@ public class PatientService implements IPatientService {
return new PageInfo<>(selPatientList);
}
@Override
public StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId) {
StatisticVo.SelCountS selCountS=new StatisticVo.SelCountS();
selCountS.setNewNums(patientDao.countCase(param,(byte)0));
return selCountS;
}
/**
* 换算时间差 返回两个时间 之间差几天要是小于1天按照1的算要是大于1的话小于2的话说的是秒啊按照2的算,进一法啊
* @param bigDate 大时间

4
tcm/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

13
tcm/src/main/resources/mapper_dao/PatientDao.xml

@ -107,4 +107,17 @@
</if>
</if>
</select>
<select id="countCase" resultType="java.lang.Integer">
select count(*) as nums from t_patient_information tpi
where tpi.rec_status=0
<if test="param.userId!=null">
and tpi.user_id=#{param.userId}
</if>
<if test="param.hospitalId!=null">
and tpi.hospital_id=#{param.hospitalId}
</if>
<if test="inputStatus!=null">
and tpi.input_status=#{inputStatus}
</if>
</select>
</mapper>

1
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -180,6 +180,7 @@ public enum CodeEnum {
ALREADY_JOIN_PROJECT_DEL(149,"取消报名后可删除",true),
ALREADY_UPLOAD_VIDEO(150,"您已经上传了视频,请勿重复提交",true),
ALREADY_UPLOAD_FORM(151,"请勿重复提交信息",true),
MESSAGEISNULL(152,"数据为空",true),
;

Loading…
Cancel
Save