Просмотр исходного кода

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

chenweida 8 лет назад
Родитель
Сommit
e2395825a3

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

@ -29,7 +29,7 @@ import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.*;
import org.apache.commons.beanutils.converters.IntegerConverter;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -52,9 +52,6 @@ import org.springside.modules.persistence.SearchFilter.Operator;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdcardInfoExtractor;
import com.yihu.wlyy.util.MessageType;
/**
 * 家庭签约业务处理类
@ -1722,12 +1719,12 @@ public class FamilyContractService extends BaseService {
        return result;
    }
    public JSONArray findNoHealthSignFamilyHealthByParams(String doctorCode, String patientAddr, String patientName) {
    public JSONArray findNoHealthSignFamilyHealthByParams(String doctorCode, String patientAddr, String patientName) throws Exception {
        JSONArray returnMap = new JSONArray();
        String sql = "select a.signcode,a.name,a.address,a.code,a.hasopenid,a.idcard from( SELECT " +
                "  sf.CODE signcode, " +
                "  p.name name, " +
                "  p.name address, " +
                "  p.address address, " +
                "  p.code code, " +
                "  CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
                "  p.idcard idcard " +
@ -1748,12 +1745,19 @@ public class FamilyContractService extends BaseService {
        List<Map<String, Object>> datas =  jdbcTemplate.queryForList(sql, doctorCode );
        if(datas!=null&&datas.size()>0){
            for(Map<String, Object> map:datas){
                returnMap.put(new JSONObject(map));
                JSONObject jo=new JSONObject();
                jo.put("signcode",map.get("signcode"));
                jo.put("name",map.get("name"));
                jo.put("code",map.get("code"));
                jo.put("hasopenid",map.get("hasopenid"));
                jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                returnMap.put(jo);
            }
        }
        return returnMap;
    }
    public JSONObject findNoHealthSignFamilyHealth(String doctorCode, String labelType, String patientName) {
    public JSONObject findNoHealthSignFamilyHealth(String doctorCode, String labelType, String patientName) throws  Exception{
        JSONObject returnMap = new JSONObject();
        //健康管理师
        String sql = "SELECT " +
@ -1786,7 +1790,13 @@ public class FamilyContractService extends BaseService {
            }
            if (datas != null && datas.size() > 0) {
                for (Map<String, Object> map : datas) {
                    JSONObject jo = new JSONObject(map);
                    JSONObject jo=new JSONObject();
                    jo.put("signcode",map.get("signcode"));
                    jo.put("name",map.get("name"));
                    jo.put("code",map.get("code"));
                    jo.put("hasopenid",map.get("hasopenid"));
                    jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                    jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                    JSONArray jr = returnMap.getJSONArray(jo.get("labelname").toString());
                    //判断是否为空
                    if (jr == null) {
@ -2095,7 +2105,7 @@ public class FamilyContractService extends BaseService {
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode, doctorCode);
        } else {
            throw new Exception("参数错误");
            throw new Exception("参数错误!");
        }
        //根据类别查找标签
        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatus(labelType, 1);
@ -2105,7 +2115,13 @@ public class FamilyContractService extends BaseService {
            }
            if (datas != null && datas.size() > 0) {
                for (Map<String, Object> map : datas) {
                    JSONObject jo = new JSONObject(map);
                    JSONObject jo=new JSONObject();
                    jo.put("signcode",map.get("signcode"));
                    jo.put("name",map.get("name"));
                    jo.put("code",map.get("code"));
                    jo.put("hasopenid",map.get("hasopenid"));
                    jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                    jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                    //判断name是否为空 为空就是未标注
                    //把患者添加到对应的组
                    JSONArray jr = returnMap.getJSONArray(jo.get("labelname").toString());