Browse Source

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

# Conflicts:
#	svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentPeopleDao.java
yeshijie 3 years ago
parent
commit
2efbefafa6

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

@ -227,9 +227,11 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "signYear", value = "签约时长 0长期 1 1年 2 2年", required = true)
            @RequestParam String signYear,
            @ApiParam(name = "doctorId", value = "医生id", required = true)
            @RequestParam String doctorId) {
            @RequestParam String doctorId,
            @ApiParam(name = "labelCode", value = "能力评估结论", required = true)
            @RequestParam String labelCode) {
        try{
           JSONObject result  = servicePackageService.servicePackageSign(jsonData,doctorId,patientId,signYear);
           JSONObject result  = servicePackageService.servicePackageSign(jsonData,doctorId,patientId,signYear,labelCode);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return Envelop.getError(result.getString(ResponseContant.resultMsg));
            }

+ 3 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/label/PatientLableService.java

@ -37,10 +37,9 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy
        String sql = "SELECT COUNT(a.id) num,dict.dict_code labelCode,dict.dict_value labelName " +
                " from wlyy_hospital_sys_dict dict " +
                "LEFT JOIN (SELECT DISTINCT l.id,l.label_code  " +
                "from base_service_package_sign_record sr,base_service_package_record r,  " +
                "                base_service_package_item i,base_patient p,wlyy_patient_label l " +
                "                WHERE sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id  " +
                "                and i.del = 1 and i.team_code = '"+teamCode+"' " +
                "from base_service_package_sign_record sr,base_service_package_record r  " +
                "                ,base_patient p,wlyy_patient_label l " +
                "                WHERE sr.id = r.sign_id and sr.status=1 and r.team_code = '"+teamCode+"' " +
                "                and sr.patient = p.id and p.id = l.patient and l.label_type = 1) " +
                "a on dict.dict_code = a.label_code  " +
                "where dict.dict_name = '"+ConstantUtil.DICT_SERVICE_TYPE+"' and dict_code<>5  " +

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

@ -3,7 +3,10 @@ package com.yihu.jw.care.service.sign;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.dao.sign.*;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.util.ConstantUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
@ -14,6 +17,7 @@ import com.yihu.jw.entity.base.servicePackage.ServicePackageRecordDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
@ -73,6 +77,10 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    private PatientBedApplyDao bedApplyDao;
    @Autowired
    private ImUtil imUtil;
    @Autowired
    private WlyyPatientLabelDao patientLabelDao;
    @Autowired
    private DictService dictService;
    /**
     * 查找签约机构
@ -268,7 +276,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
     * @param doctorId
     */
    @Transactional(rollbackFor = Exception.class)
    public JSONObject servicePackageSign(String jsonData,String doctorId,String patientId,String signYear) throws Exception{
    public JSONObject servicePackageSign(String jsonData,String doctorId,String patientId,String signYear,String lableCode) throws Exception{
        BasePatientDO patientDO = patientDao.findById(patientId);
        JSONObject result = new JSONObject();
        ServicePackageSignRecordDO signRecordDO = objectMapper.readValue(jsonData, ServicePackageSignRecordDO.class);
@ -324,6 +332,15 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            result.put(ResponseContant.resultMsg,"请勿重复签约");
            return result;
        }
        //生成居民标签
        patientLabelDao.deleteByPatientAndLabelType(patientId,"1");
        WlyyPatientLabelDO patientLabelDO = new WlyyPatientLabelDO();
        patientLabelDO.setCzrq(new Date());
        patientLabelDO.setLabelType("1");
        patientLabelDO.setPatient(patientId);
        patientLabelDO.setLabelCode(lableCode);
        patientLabelDO.setLabelName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICE_TYPE,lableCode));
        patientLabelDao.save(patientLabelDO);
        //服务项目 emergencyAssistance 只能签约一个
        String sqlItem = "select item.`code`,item.name from base_service_package_item item INNER JOIN base_service_package_record pr on item.service_package_id = pr.service_package_id\n" +