瀏覽代碼

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

Sand 8 年之前
父節點
當前提交
12b9bcecb2

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -44,6 +44,9 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctorHealth = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorHealthPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 1 and a.status > 0")
	SignFamily findSsSignByDoctorPatient(String doctor, String patient);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/InspectionService.java

@ -60,14 +60,14 @@ public class InspectionService extends BaseService {
        JSONArray check = getChecking(strSSID, startNum, endNum);
        if (!check.isNull(0)) {
            JSONObject jsonObject = check.getJSONObject(0);
            if (!StringUtils.isEmpty(jsonObject.get("error"))) {
            if (jsonObject.has("error")) {
                return jsonObject.get("error").toString();
            }
        }
        JSONArray inspect = getInspection(strSSID, startNum, endNum);
        if (!inspect.isNull(0)) {
            JSONObject jsonObject = inspect.getJSONObject(0);
            if (!StringUtils.isEmpty(jsonObject.get("error"))) {
            if (jsonObject.has("error")) {
                return jsonObject.get("error").toString();
            }
        }

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

@ -157,10 +157,15 @@ public class ExpensesRemindService extends BaseService {
        try {
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            boolean mFlag = false;
            boolean wFlag = false;
            if (StringUtils.isNotEmpty(p.getMobile()) ) {
                smsService.sendMsg(p.getMobile(), "厦门市民健康系统】" + doc.getName() + "医生提醒您:为完成家庭医生签约," +
                int result = smsService.sendMsg(p.getMobile(), "厦门市民健康系统】" + doc.getName() + "医生提醒您:为完成家庭医生签约," +
                        "尽早为您提供家庭医生服务,请尽快到" + hos.getName() + "(地址:" + hos.getAddress() + ")缴费");
                if(result == 1){
                    mFlag = true;
                }
            }
            if(StringUtils.isNotEmpty(p.getOpenid())){
                // 微信提醒
@ -174,8 +179,12 @@ public class ExpensesRemindService extends BaseService {
                json.put("remark", "");
                // 添加到发送队列
                PushMsgTask.getInstance().putWxMsg(tokenUtils.getAccessToken(), 8, p.getOpenid(), p.getName(), json);
                wFlag = true;
            }
            if(wFlag || mFlag) {
                redisTemplate.opsForValue().set("expenses:remind:" + p.getCode(), df.format(new Date()));
            }
            redisTemplate.opsForValue().set("expenses:remind:" + p.getCode(), df.format(new Date()));
        } catch (Exception e) {
            e.printStackTrace();
        }

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

@ -232,7 +232,13 @@ public class FamilyContractService extends BaseService {
        json.put("expertise", d.getExpertise());
        json.put("level", d.getLevel());
        // 查询与当前医生的签约状态
        SignFamily sf = signFamilyDao.findByDoctorPatient(doctor, patient);
        SignFamily sf = null;
        if (d.getLevel() == 2) {
            sf = signFamilyDao.findByDoctorPatient(doctor, patient);
        }else if(d.getLevel() == 3){
            sf = signFamilyDao.findByDoctorHealthPatient(doctor, patient);
        }
        if (sf == null) {
            // 没有签约信息
            json.put("sign", -1);
@ -564,9 +570,20 @@ public class FamilyContractService extends BaseService {
     * @param doctor  医生标识
     * @return
     */
    public int unsign(String patient, String doctor) {
    public int unsign(String patient, String doctor) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        if(doc == null){
            throw new Exception("doctor info can not find");
        }
        //修改签约标识为无效
        SignFamily sf = signFamilyDao.findByDoctorPatient(doctor, patient);
        SignFamily sf = null;
        if(doc.getLevel() == 2){
            sf = signFamilyDao.findByDoctorPatient(doctor, patient);
        } else if(doc.getLevel() == 3){
            sf = signFamilyDao.findByDoctorHealthPatient(doctor, patient);
        }
        Message message = messageDao.findByPatient(patient, doctor);
        if (sf.getStatus() != 0 && sf.getStatus() != 2) {
            return -2;
@ -991,8 +1008,8 @@ public class FamilyContractService extends BaseService {
            //添加健康管理师
            DoctorTeamMember wlyyDoctorTeamDoctor = new DoctorTeamMember();
            wlyyDoctorTeamDoctor.setTeam(doctorTeamCode);
            wlyyDoctorTeamDoctor.setMemberCode(healthDoctor);
            wlyyDoctorTeamDoctor.setName(healthDoctorName);
            wlyyDoctorTeamDoctor.setMemberCode(sf.getDoctorHealth());
            wlyyDoctorTeamDoctor.setName(sf.getDoctorHealthName());
            wlyyDoctorTeamDoctor.setDel("1");
            wlyyDoctorTeamDoctor.setSignType("2");
@ -1528,7 +1545,7 @@ public class FamilyContractService extends BaseService {
     * @param healthDoctor 健康管理师code
     * @return
     */
    public JSONObject updateSignInfo(String patient, String healthDoctor,String doctor, String expensesType) {
    public JSONObject updateSignInfo(String patient, String healthDoctor, String doctor, String expensesType) {
        JSONObject result = new JSONObject();
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);

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

@ -48,6 +48,7 @@ public class SignWebService extends BaseService {
                "    a.code " +
                "    ,a.doctor " +
                "    ,b.code  as  patient" +
                "    ,b.idcard " +
                "    ,b.name " +
                "    ,b.province_name  as provinceName" +
                "    ,b.city_name  as cityName" +
@ -56,12 +57,12 @@ public class SignWebService extends BaseService {
                "    ,b.photo " +
                "    ,a.status " +
                "    ,a.id " +
                "    ,a.apply_date as applyDate" +
                (status == 1? "    ,a.patient_apply_date as applyDate ":"    ,a.expenses_time as applyDate ") +
                "    ,a.reason " +
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
                " from " +
                " ( select code,patient,doctor,status,id,apply_date,reason,begin from wlyy_sign_family where " + (doctorType == 2 ? "doctor" : "doctor_health") + " = ? and status = ? and type = 2 order by begin desc ) a " +
                " ( select code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where " + (doctorType == 2 ? "doctor" : "doctor_health") + " = ? and status = ? and type = 2 and expenses_status = '1' order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc ";
@ -71,6 +72,7 @@ public class SignWebService extends BaseService {
                "    ,a.doctor " +
                "    ,b.code  as  patient" +
                "    ,b.name " +
                "    ,b.idcard " +
                "    ,b.province_name  as provinceName" +
                "    ,b.city_name  as cityName" +
                "    ,b.town_name  as townName" +
@ -78,7 +80,7 @@ public class SignWebService extends BaseService {
                "    ,b.photo " +
                "    ,a.status " +
                "    ,a.id " +
                "    ,a.apply_date as applyDate" +
                "    ,a.apply_date as applyDate " +
                "    ,a.reason " +
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
@ -93,6 +95,7 @@ public class SignWebService extends BaseService {
                "    ,a.doctor " +
                "    ,b.code  as  patient" +
                "    ,b.name " +
                "    ,b.idcard " +
                "    ,b.province_name  as provinceName" +
                "    ,b.city_name  as cityName" +
                "    ,b.town_name  as townName" +
@ -100,12 +103,12 @@ public class SignWebService extends BaseService {
                "    ,b.photo " +
                "    ,a.status " +
                "    ,a.id " +
                "    ,a.apply_date as applyDate" +
                "    ,a.apply_unsign_date as applyDate" +
                "    ,a.reason " +
                "    ,b.street_name as streetName" +
                "    ,b.sex" +
                " from " +
                " ( select code,patient,doctor,status,id,apply_date,reason,begin from wlyy_sign_family where " + (doctorType == 2 ? "doctor" : "doctor_health") + " = ? and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ( select code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where " + (doctorType == 2 ? "doctor" : "doctor_health") + " = ? and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc ";

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java

@ -474,7 +474,7 @@ public class XMLUtil {
                    for (Element element : elements2) {
                        Map<String, Object> tempMap1 = new HashMap<String, Object>();
                        ele2map(tempMap1, element);
                        setAttributes(tempMap1,element);
                        setAttributes(tempMap1,element);//属性值设置
                        list.add(tempMap1);
                    }
@ -483,7 +483,7 @@ public class XMLUtil {
                    // 同名的数量不大于1则直接递归去
                    Map<String, Object> tempMap1 = new HashMap<String, Object>();
                    ele2map(tempMap1, elements2.get(0));
                    setAttributes(tempMap1,elements2.get(0));
                    setAttributes(tempMap1,elements2.get(0));//属性值设置
                    if (tempMap1.containsKey(string)) {
                        map.put(string, tempMap1.get(string));
                    }else {

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

@ -1,11 +1,9 @@
package com.yihu.wlyy.web.doctor.sign;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.yihu.wlyy.util.IdCardUtil;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -222,7 +220,7 @@ public class DoctorSignController extends BaseController {
                }
            }
            JSONObject data = new JSONObject();
            JSONArray jsonArray = new JSONArray();
            List<JSONObject> jsonArray = new ArrayList<>();
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            if (listSub != null) {
                for (Map<String, Object> temp : listSub) {
@ -234,6 +232,7 @@ public class DoctorSignController extends BaseController {
                    json.put("doctorCode", temp.get("doctor"));
                    json.put("patientCode", temp.get("patient"));
                    json.put("patientName", temp.get("name"));
                    json.put("age", IdCardUtil.getAgeForIdcard(String.valueOf(temp.get("idcard"))));
                    json.put("provinceName", temp.get("provinceName"));
                    json.put("cityName", temp.get("cityName"));
                    json.put("townName", temp.get("townName"));
@ -255,7 +254,6 @@ public class DoctorSignController extends BaseController {
                        case -4:
                            statusName = "已解约";
                            break;
                    }
                    json.put("statusName", statusName);
                    json.put("id", temp.get("id"));
@ -272,9 +270,27 @@ public class DoctorSignController extends BaseController {
                            json.put("expensesRemindStatus", df.format(new Date()).equals(epTime) ? 1 : 0);
                        }
                    }
                    jsonArray.put(json);
                    jsonArray.add(json);
                }
            }
            if (status == 5) {
                jsonArray.sort(new Comparator<JSONObject>() {
                    @Override
                    public int compare(JSONObject o1, JSONObject o2) {
                        if (o1.getInt("expensesRemindStatus") > o2.getInt("expensesRemindStatus")) {
                            return 1;
                        } else if (o1.getInt("expensesRemindStatus") < o2.getInt("expensesRemindStatus")) {
                            return -1;
                        } else if (o1.getInt("expensesRemindStatus") == o2.getInt("expensesRemindStatus")) {
                            return 0;
                        } else {
                            return 0;
                        }
                    }
                });
            }
            data.put("list", jsonArray);
            data.put("totalPage", totalPage);
            data.put("page", page);