Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 4 years ago
parent
commit
67bf50e3fc

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/lifeCare/LifeCareOrderDO.java

@ -254,6 +254,7 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
     * 服务机构
     */
    private String hospital;
    private String hospitalName;
    private Integer type;//发起工单类型(1本人发起 2家人待预约 3医生代预约)
    private String relationCode;//业务关联
@ -513,6 +514,15 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Transient
    public List<LifeCareFeeDetailDO> getFeeDetailList() {
        return feeDetailList;

+ 72 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/sign/CapacityAssessmentRecordDO.java

@ -30,6 +30,7 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
     * 性别,1男,2女
     */
    private Integer sex;
    private String sexName;
    /**
     * 手机号
@ -60,26 +61,31 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
     * 能力完好(0级) 轻度受损(1级) 中度受损(2级) 重度受损(3级)
     */
    private Integer livingAbility;
    private String livingAbilityName;
    /**
     * 认知能力
     * 能力完好(0级) 轻度受损(1级) 中度受损(2级) 重度受损(3级)
     */
    private Integer cognitiveAbility;
    private String cognitiveAbilityName;
    /**
     *精神状态与社会交流能力
     * 能力完好(0级) 轻度受损(1级) 中度受损(2级) 重度受损(3级)
     */
    private Integer socialAbility;
    private String socialAbilityName;
    /**
     * 能力总体评价
     * 能力完好(0级) 轻度失能(1级) 中度失能(2级) 重度失能(3级)
     */
    private Integer comprehensiveAbility;
    private String comprehensiveAbilityName;
    /**
     * 等级结论
     * 能力完好(0级) 轻度失能(1级) 中度失能(2级) 重度失能(3级)
     */
    private Integer levelConclusion;
    private String levelConclusionName;
    private String doctor;
    private String doctorName;
    private String orgCode;
@ -88,6 +94,7 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
     * 认可结果(0未认可,1已认可,2不认可)
     */
    private Integer status;
    private String statusName;
    /**
     * 签字结果图片url
     */
@ -100,6 +107,7 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
     * 是否分配服务包(0未分配,1已分配)
     */
    private Integer servicePackageStatus;
    private String servicePackageStatusName;
    /**
     * 年纪
@ -310,4 +318,68 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    @Transient
    public String getSexName() {
        return sexName;
    }
    public void setSexName(String sexName) {
        this.sexName = sexName;
    }
    @Transient
    public String getLivingAbilityName() {
        return livingAbilityName;
    }
    public void setLivingAbilityName(String livingAbilityName) {
        this.livingAbilityName = livingAbilityName;
    }
    @Transient
    public String getCognitiveAbilityName() {
        return cognitiveAbilityName;
    }
    public void setCognitiveAbilityName(String cognitiveAbilityName) {
        this.cognitiveAbilityName = cognitiveAbilityName;
    }
    @Transient
    public String getSocialAbilityName() {
        return socialAbilityName;
    }
    public void setSocialAbilityName(String socialAbilityName) {
        this.socialAbilityName = socialAbilityName;
    }
    @Transient
    public String getComprehensiveAbilityName() {
        return comprehensiveAbilityName;
    }
    public void setComprehensiveAbilityName(String comprehensiveAbilityName) {
        this.comprehensiveAbilityName = comprehensiveAbilityName;
    }
    @Transient
    public String getLevelConclusionName() {
        return levelConclusionName;
    }
    public void setLevelConclusionName(String levelConclusionName) {
        this.levelConclusionName = levelConclusionName;
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
    @Transient
    public String getServicePackageStatusName() {
        return servicePackageStatusName;
    }
    public void setServicePackageStatusName(String servicePackageStatusName) {
        this.servicePackageStatusName = servicePackageStatusName;
    }
}

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/sign/CapacityAssessmentRecordDao.java

@ -10,5 +10,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface CapacityAssessmentRecordDao extends PagingAndSortingRepository<CapacityAssessmentRecordDO, String>,
        JpaSpecificationExecutor<CapacityAssessmentRecordDO> {
    CapacityAssessmentRecordDO findByPatient(String patient);
}

+ 3 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/sign/ServicePackageRecordDao.java

@ -4,11 +4,13 @@ import com.yihu.jw.entity.base.servicePackage.ServicePackageRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2021/2/25.
 */
public interface ServicePackageRecordDao extends PagingAndSortingRepository<ServicePackageRecordDO, String>, JpaSpecificationExecutor<ServicePackageRecordDO> {
    List<ServicePackageRecordDO> findBySignId(String signId);
}

+ 14 - 7
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -10,7 +10,6 @@ import com.yihu.jw.care.service.sign.ServicePackageService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
@ -18,7 +17,6 @@ import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.common.IdCardUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -197,11 +195,7 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "id", value = "评估id", required = true)
            @RequestParam String id)  {
        try{
            CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findOne(id);
            BasePatientDO basePatientDO = patientDao.findById(recordDO.getPatient());
            recordDO.setAge(IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
            recordDO.setPhoto(basePatientDO.getPhoto());
            return ObjEnvelop.getSuccess("查询成功",recordDO);
            return ObjEnvelop.getSuccess("查询成功",capacityAssessmentRecordService.findAssessmentById(id));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
@ -368,6 +362,19 @@ public class SignEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getArchiveTopNum")
    @ApiOperation(value = "档案管理-获取签约/未签约总数")
    public ObjEnvelop getArchiveTopNum(
            @ApiParam(name = "doctorId", value = "医生id", required = true)
            @RequestParam String doctorId) {
        try{
            return ObjEnvelop.getSuccess("查询成功",archiveService.getArchiveTopNum(doctorId));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "archiveList")
    @ApiOperation(value = "获取档案分页")
    public PageEnvelop<List<Map<String,Object>>> archiveList (

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -44,7 +44,7 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @return
     */
    public Map<String,Object> doctorInfo(String doctorId,String isRole){
        String sql = "SELECT d.id,d.name,d.level,d.photo,d.introduce,d.mobile,d.idcard,d.sex,h.dept_code deptCode,h.dept_name deptName,d.job_title_code jobTitleCode,d.job_title_name jobTitleName ";
        String sql = "SELECT d.id,d.name,d.level,d.photo,d.introduce,d.expertise,d.mobile,d.idcard,d.sex,h.dept_code deptCode,h.dept_name deptName,d.job_title_code jobTitleCode,d.job_title_name jobTitleName ";
        sql += " ,h.org_code orgCode,org.address orgAddress,h.org_name orgName from base_doctor d left join base_doctor_hospital h on d.id = h.doctor_code  and h.del = 1" +
                " LEFT JOIN base_org org on h.org_code = org.`code`  WHERE d.id = '"+doctorId+"' limit 1 ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -179,6 +179,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
                "  o.number as number, " +
                "  o.patient_expected_serve_time as serveTime, o.doctor, o.doctor_name as doctorName, " +
                "  o.serve_address as address, " +
                "  o.type as type, " +
                "  o.serve_lon as lon, " +
                "  o.serve_lat as lat, " +
                "  o.`status` as status " +

+ 18 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -1,5 +1,6 @@
package com.yihu.jw.care.service.sign;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.sign.ArchiveDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -58,6 +59,23 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }
    public JSONObject getArchiveTopNum(String doctorId){
        JSONObject json = new JSONObject();
        json.put("signTotal",0);
        json.put("unSignTotal",0);
        String sql = " SELECT COUNT(*) num,CAST(sign_status as char) sign_status  from wlyy_archive WHERE doctor_code =  '"+doctorId+"'GROUP BY sign_status";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:list){
            if("1".equals(String.valueOf(map.get("sign_status")))){
                json.put("signTotal",map.get("num"));
            }
            if("0".equals(String.valueOf(map.get("sign_status")))){
                json.put("unSignTotal",map.get("num"));
            }
        }
        return json;
    }
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus,String name){
        String sql = "SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id ";
        String countSql = "SELECT count(*) ";

+ 33 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java

@ -76,6 +76,35 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    /**
     * 按id查找评估明细
     * @param id
     * @return
     */
    public CapacityAssessmentRecordDO findAssessmentByPatientId(String patient)  {
        return capacityAssessmentRecordDao.findByPatient(patient);
    }
    /**
     * 按id查找评估明细
     * @param id
     * @return
     */
    public CapacityAssessmentRecordDO findAssessmentById(String id)  {
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findOne(id);
        BasePatientDO basePatientDO = patientDao.findById(recordDO.getPatient());
        recordDO.setAge(IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        recordDO.setPhoto(basePatientDO.getPhoto());
        recordDO.setSexName(dictService.fingByNameAndCode(ConstantUtil.DICT_SEX,String.valueOf(recordDO.getSex())));
        recordDO.setServicePackageStatusName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICEPACKAGESTATUS,String.valueOf(recordDO.getServicePackageStatus())));
        recordDO.setStatusName(dictService.fingByNameAndCode(ConstantUtil.DICT_CAPACITY_AGREE_STATUS,String.valueOf(recordDO.getStatus())));
        recordDO.setLevelConclusionName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLevelConclusion())));
        recordDO.setLivingAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLivingAbility())));
        recordDO.setCognitiveAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getCognitiveAbility())));
        recordDO.setComprehensiveAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getComprehensiveAbility())));
        recordDO.setSocialAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getSocialAbility())));
        return recordDO;
    }
    /**
     * 获取居民统计
@ -146,6 +175,9 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
            String idcard = map.get("idcard").toString();
            map.put("assessmentTime", map.get("assessment_time").toString().substring(0,19));
            map.put("age", IdCardUtil.getAgeForIdcard(idcard));
            map.put("levelConclusionName",dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(map.get("levelConclusion"))));
            map.put("servicePackageStatusName",dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICEPACKAGESTATUS,String.valueOf(map.get("servicePackageStatus"))));
            map.put("statusName",dictService.fingByNameAndCode(ConstantUtil.DICT_CAPACITY_AGREE_STATUS,String.valueOf(map.get("status"))));
        }
        Long count = jdbcTemplate.queryForObject(countSql+filters,Long.class);
        return PageEnvelop.getSuccessListWithPage("success",list,page,size,count);
@ -173,7 +205,7 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    public JSONObject capacityAssessment(String jsonData,String doctorId) throws Exception{
        JSONObject result = new JSONObject();
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        CapacityAssessmentRecordDO recordDO = objectMapper.readValue(jsonObject.getJSONObject("assessment").toJSONString(), CapacityAssessmentRecordDO.class);
        CapacityAssessmentRecordDO recordDO = JSONObject.parseObject(jsonObject.getJSONObject("assessment").toJSONString(), CapacityAssessmentRecordDO.class);
        if(isCapacityAssessment(recordDO.getPatient())==0){
            String year = DateUtil.getNowYear()+"";

+ 24 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageRecordDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
import com.yihu.jw.restmodel.web.PageEnvelop;
@ -29,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
 *
@ -44,7 +46,8 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    private ServicePackageDao servicePackageDao;
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private CapacityAssessmentRecordService capacityAssessmentRecordService;
    @Autowired
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
    @Autowired
@ -115,7 +118,9 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            redisTemplate.delete(key);
        }
        List<String> res = fingServiceItemsCodeByPatientId(patientId);
        redisTemplate.opsForList().leftPushAll(key,res);
        if(res!=null&&res.size()>0){
            redisTemplate.opsForList().leftPushAll(key,res);
        }
    }
@ -263,8 +268,10 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    @Transactional(rollbackFor = Exception.class)
    public ServicePackageSignRecordDO servicePackageSign(String jsonData,String doctorId,String patientId) throws Exception{
        ServicePackageSignRecordDO signRecordDO = objectMapper.readValue(jsonData, ServicePackageSignRecordDO.class);
        signRecordDO.setPatient(patientId);
        List<ServicePackageRecordDO> recordDOList = signRecordDO.getRecordDOList();
        String signId = signRecordDO.getId();
        List<String> idList = new ArrayList<>();
        if(StringUtil.isEmpty(signId)){
            List<ServicePackageSignRecordDO> signRecordDOs = servicePackageSignRecordDao.findByStatusAndPatient(1,signRecordDO.getPatient());
            if(signRecordDOs.size()==0){
@ -281,19 +288,32 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
                signId = signRecordDO.getId();
                //建档状态修改
                ArchiveDO archiveDO = archiveDao.findByPatientAndDoctorCode(signRecordDO.getPatient(),doctorId);
                ArchiveDO archiveDO = archiveDao.findByPatientAndDoctorCode(patientId,doctorId);
                if(archiveDO!=null){
                    archiveDO.setSignStatus(1);
                    archiveDao.save(archiveDO);
                }
            }else{
                signId = signRecordDOs.get(0).getId();
                List<ServicePackageRecordDO> existList = servicePackageRecordDao.findBySignId(signId);
                idList = existList.stream().map(ServicePackageRecordDO::getServicePackageId).collect(Collectors.toList());
            }
        }
        for (ServicePackageRecordDO recordDO:recordDOList){
        Iterator<ServicePackageRecordDO> iterator = recordDOList.iterator();
        while (iterator.hasNext()) {
            ServicePackageRecordDO recordDO = iterator.next();
            recordDO.setPatient(patientId);
            recordDO.setSignId(signId);
            if (idList.contains(recordDO.getServicePackageId())) {
                iterator.remove();//使用迭代器的删除方法删除
            }
        }
        if(recordDOList.size()>0){
            CapacityAssessmentRecordDO capacityAssessmentRecordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patientId);
            capacityAssessmentRecordDO.setServicePackageStatus(1);
            capacityAssessmentRecordService.save(capacityAssessmentRecordDO);
        }
        servicePackageRecordDao.save(recordDOList);
        return signRecordDO;

+ 6 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/ConstantUtil.java

@ -34,6 +34,9 @@ public class ConstantUtil {
     service_type 服务类型
     label_type 标签类型
     level_conclusion 评估结果
     servicePackageStatus 是否分配服务包
     capacity_agree_status 能力评估认可状态
     sex 性别
     */
    public static final String DICT_ARCHIVETYPE = "archiveType";
    public static final String DICT_ARCHIVESTATUS = "archiveStatus";
@ -46,6 +49,9 @@ public class ConstantUtil {
    public static final String DICT_SERVICE_TYPE = "service_type";
    public static final String DICT_LABEL_TYPE = "label_type";
    public static final String DICT_LEVEL_CONCLUSION = "level_conclusion";
    public static final String DICT_SERVICEPACKAGESTATUS= "servicePackageStatus";
    public static final String DICT_CAPACITY_AGREE_STATUS= "capacity_agree_status";
    public static final String DICT_SEX= "sex";
}