Pārlūkot izejas kodu

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 8 gadi atpakaļ
vecāks
revīzija
b766bcb655

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/address/CountryDao.java

@ -11,4 +11,6 @@ import java.util.List;
public interface CountryDao extends PagingAndSortingRepository<Country, Long> {
    List<Country> findByStreet(String street);
    Country findByCode(String code);
}

+ 8 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -866,7 +866,7 @@ public class FamilyContractService extends BaseService {
                                         String emerMobile, String images,
                                         String healthLabel, String customLabel, String disease,
                                         String expenses, String signDoctorCode,
                                         String signDoctorName, String signDoctorLevel, long adminTeamCode,String sevId) throws Exception {
                                         String signDoctorName, String signDoctorLevel, long adminTeamCode,String sevId,String countryCode) throws Exception {
        // 查询是否有家庭签约
        SignFamily sc = signFamilyDao.findByIdcard(idcard);
        if (sc != null) {
@ -1074,7 +1074,9 @@ public class FamilyContractService extends BaseService {
                patient.getName(), healthLabel, disease, customLabel, sf.getDoctor(), signDoctorCode) == 1)) {
            throw new Exception("patient sign label settting error:" + patient.getIdcard());
        }
        //1.3.5新增居委会字段
        signWebService.setPatientCountryFamily(countryCode,sf);
        //保存签约信息
        SignFamily temp = signFamilyDao.save(sf);
        //设置基卫标识1.3.3.2版本更新
@ -3328,7 +3330,7 @@ public class FamilyContractService extends BaseService {
     * @return
     */
    @Transactional
    public int signRenewOverdue(String doctor,String healthDoctor, String patient, String reason) throws Exception {
    public int signRenewOverdue(String doctor,String healthDoctor, String patient, String reason,String countryCode) throws Exception {
        Patient p = patientDao.findByCode(patient);
        if (p == null) {
            return -1;
@ -3473,6 +3475,9 @@ public class FamilyContractService extends BaseService {
        if(StringUtils.isNotBlank(reason)){
            sf.setRenewChangeReason(reason);
        }
       //1.3.5新增居委会字段
        signWebService.setPatientCountryFamily(countryCode,sf);
        SignFamily temp = signFamilyDao.save(sf);
        if (temp != null) {

+ 57 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -2383,7 +2383,7 @@ public class SignWebService extends BaseService {
        }
        return -1;
    }
    //1.3.5居委会相关接口---
    public JSONArray getTownList(){
        List<Town> towns = townDao.findByCityCode(city);
        return new JSONArray(towns);
@ -2397,6 +2397,61 @@ public class SignWebService extends BaseService {
        return new JSONArray(countrys);
    }
    //1.3.5居委会相关接口---
    /**
     * 保存居委会字段
     * @param countryCode 居委会Code
     * @param patientCode 患者Code
     * @return
     */
    public int setPatientCountry(String countryCode,String patientCode){
        if(StringUtils.isBlank(countryCode)){
            return -1;
        }
        Country country = countryDao.findByCode(countryCode);
        if(country!=null){
            return -1;
        }
        Patient patient = patientService.findByCode(countryCode);
        if(patient!=null){
            return -1;
        }
        patient.setSickVillage(countryCode);
        patient.setSickVillageName(country.getName());
        patientService.save(patient);
        SignFamily signFamily = signFamilyDao.findByPatientCodeStatus(patientCode,0);
        if(signFamily!=null){
            signFamily.setSickVillage(countryCode);
            signFamily.setSickVillageName(country.getName());
            signFamilyDao.save(signFamily);
        }
        return 1;
    }
    /**
     * 设置居委会字段
     * @param countryCode
     * @param signFamily
     * @return
     */
    public int setPatientCountryFamily(String countryCode,SignFamily signFamily){
        if(StringUtils.isBlank(countryCode)){
            return -1;
        }
        Country country = countryDao.findByCode(countryCode);
        if(country!=null){
            return -1;
        }
        Patient patient = patientService.findByCode(countryCode);
        if(patient!=null){
            return -1;
        }
        patient.setSickVillage(countryCode);
        patient.setSickVillageName(country.getName());
        patientService.save(patient);
        signFamily.setSickVillage(countryCode);
        signFamily.setSickVillageName(country.getName());
        return 1;
    }
}

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -974,4 +974,8 @@ public class PatientService extends TokenService {
        }
        return new JSONArray(listTree);
    }
    public void save(Patient patient){
        patientDao.save(patient);
    }
}

+ 4 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -420,7 +420,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            @RequestParam(required = false) String signDoctorName,//簽約人銘
            @RequestParam(required = false) String signDoctorLevel,//簽約人等级
            @RequestParam(required = false) long adminTeamCode, //行政团队
            @RequestParam(required = false) String sevId) {
            @RequestParam(required = false) String sevId,
            @RequestParam(required = false) String countryCode) {
        try {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "请输入身份证号!");
@ -476,10 +477,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            //}
            /**end**/
            Doctor cDoctor = doctorService.findDoctorByCode(getUID());
            //1.3.5 新增居委会字段countryCode
            SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
                    healthDoctor, healthDoctorName, cDoctor.getHospital(), cDoctor.getHospitalName(),
                    idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, adminTeamCode, sevId);
                    idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, adminTeamCode, sevId,countryCode);
            if (sf == null) {
                return error(-1, "代理签约失败!");
            } else {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -498,7 +498,8 @@ public class FamilyContractController extends BaseController {
    public String signRenew(@RequestParam(required = true) String doctor,
                            @RequestParam(required = false) String healthDoctor,
                            @RequestParam(required = false) String patient,
                            @RequestParam(required = false) String reason) {
                            @RequestParam(required = false) String reason,
                            @RequestParam(required = false) String countryCode) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "签约医生不能为空");
@ -509,7 +510,8 @@ public class FamilyContractController extends BaseController {
            if(month<7){
                result = familyContractService.signRenew(doctor,healthDoctor,patient,reason);
            }else{
                result = familyContractService.signRenewOverdue(doctor,healthDoctor,patient,reason);
                //1.3.5新增居委会字段
                result = familyContractService.signRenewOverdue(doctor,healthDoctor,patient,reason,countryCode);
            }