瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 年之前
父節點
當前提交
225cf06fe5

+ 6 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionAdjustService.java

@ -21,6 +21,8 @@ public class PrescriptionAdjustService extends BaseService {
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    /**
     * 线下调整处方
@ -48,19 +50,20 @@ public class PrescriptionAdjustService extends BaseService {
                        prescriptionDao.save(prescription);
                        //添加日志
                        prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),1,2);
                    }else {
                        //请求失败
                        prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),0,2);
                    }
                }else {
                    //调整请求失败
                    prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),0,2);
                }
            }else{
                //请求报错
                prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),0,2);
            }

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

@ -1,6 +1,5 @@
package com.yihu.wlyy.service.app.sign;
import com.sun.corba.se.spi.activation.Server;
import com.yihu.wlyy.entity.address.Country;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
@ -33,7 +32,6 @@ import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import org.apache.commons.lang3.StringUtils;
@ -47,9 +45,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.sql.*;
import java.util.*;
import java.util.Date;
/**
 * 网络签约业务处理类
@ -2489,4 +2485,33 @@ public class SignWebService extends BaseService {
        String sql = "select w.openid from wlyy_sign_family w ,dm_hospital d where w.hospital=d.`code` and d.town='" + town + "' and w.openid is not null and w.openid !=''";
        return jdbcTemplate.queryForList(sql, String.class);
    }
    /**
     * 获取居民服务类型
     * @param patient
     * @return
     */
    public JSONObject getPatientFamilyServer(String patient){
        JSONObject json = new JSONObject();
        SignFamily signFamily = signFamilyDao.findByPatient(patient);
        if(signFamily==null){
            json.put("msg","该居民未签约");
            return json;
        }
        List<SignFamilyServer> list = signFamilyServerDao.findBySignCodeAndType(signFamily.getCode());
        JSONArray ja = new JSONArray();
        if(list!=null&&list.size()>0){
            json.put("slowDiseasePatient",1);
            for (SignFamilyServer server:list){
                JSONObject js = new JSONObject();
                js.put("name",server.getServerTypeName());
                js.put("code",server.getServerType());
                ja.put(js);
            }
        }else {
            json.put("slowDiseasePatient",0);
        }
        json.put("signFamilyServer",ja);
        return json;
    }
}

+ 17 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -1,12 +1,7 @@
package com.yihu.wlyy.web.doctor.sign;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.address.Country;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.address.StreetDao;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.sign.SignWebService;
@ -17,6 +12,7 @@ import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,6 +51,22 @@ public class DoctorSignController extends WeixinBaseController {
    @Autowired
    private PatientService patientService;
    @RequestMapping(value = "getPatientFamilyServer",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取居民慢病服务类型")
    public String getPatientFamilyServer(@ApiParam(name = "patient", value = "居民code") @RequestParam(required = true) String patient){
        try {
            JSONObject json = signWebService.getPatientFamilyServer(patient);
            if(json.has("msg")){
                return error(-1,json.getString("msg"));
            }
            return write(200,"获取成功","data",json);
        }catch (Exception e){
            error(e);
            return error(-1,"请求失败");
        }
    }
    /**
     * 三师签约列表查询
     *