Browse Source

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

wangzhinan 4 years ago
parent
commit
bfff258dac

+ 13 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.family.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
@ -11,14 +12,18 @@ import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.management.MXBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -68,8 +73,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
            if (null!=jsonObject.get("Patient_Id")){
                familyId = jsonObject.getString("Patient_Id");
                String Pat_name = jsonObject.getString("Pat_Name");
                if (null!=jsonObject.get("Phone_Number_Home")){
                    String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Home").toString();
                if (null!=jsonObject.get("Phone_Number_Business")){
                    String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Business").toString();
                    if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
@ -135,8 +140,10 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    //根据患者id查询关联家属
    public List<Map<String,Object>> findFamilyByPatientId(String patientId) throws ParseException {
        String sql = "select t.id as \"id\",t.card_type as \"cardType\", t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
                "b.birthday as\"birthday\",b.idcard as \"idcard\",t.family_member as \"familyMember\",c.relation_name as \"relationName\" " +
        String sql = "select t.id as \"id\",t.card_type as \"cardType\", " +
                "t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\","+
                "b.birthday as\"birthday\",b.idcard as \"idcard\"," +
                "t.family_member as \"familyMember\",c.relation_name as \"relationName\" "+
                " from wlyy_patient_family_member t left join base_patient b" +
                " on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id where 1=1";
        if (StringUtils.isNotBlank(patientId)){
@ -192,7 +199,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    }
    //获取单个亲属详细信息
    public List<Map<String,Object>>  findMemberById(String id) throws ParseException {
        String sql="select t.id as \"id\",t.card_type as \"cardType\",t.family_member as \"familyMember\",t.patient as \"patient\"," +
        String sql="select t.id as \"id\",t.card_type as \"cardType\"," +
                "t.family_member as \"familyMember\",t.patient as \"patient\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\"," +
                "c.relation_name \"relationName\",b.birthday as\"birthday\",b.sex as\"sex\"" +
                " from wlyy_patient_family_member t left join base_patient b" +

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -2644,7 +2644,7 @@ public class EntranceService {
                sbs.append(" and Patient_Id = '" + patientId + "' ");
            }
            if (StringUtils.isNotBlank(phoneNum)) {
                sbs.append(" and Next_Of_Kin_Phone = '" + phoneNum + "' ");
                sbs.append(" and Phone_Number_Business = '" + phoneNum + "' ");
            }
            if (StringUtils.isNotBlank(patientName)) {
                sbs.append(" and Pat_Name = '" + patientName + "' ");

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -1644,7 +1644,7 @@ public class YkyyEntranceService {
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);
            synPrecriptionHis(prescriptionVO,code);
            //同步检查检验
            synInspect(inspectionDOS);
            //synInspect(inspectionDOS);
        }
        return wlyyPrescriptionDOs.toString();

+ 17 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/equipment/IotEquipmentDetailDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.iot.equipment;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -11,67 +12,83 @@ public class IotEquipmentDetailDO extends UuidIdentityEntityWithOperator {
    /*
     *设备名称
     */
    @Column(name = "device_name")
    private String deviceName;
    /*
     *设备型号
     */
    @Column(name = "device_model")
    private String deviceModel;
    /*
     *设备编码
     */
    @Column(name = "device_code")
    private String deviceCode;
    /*
     *品牌
     */
    @Column(name = "manufacturer_code")
    private String manufacturerCode;
    /*
     *厂商名称
     */
    @Column(name = "manufacturer")
    private String manufacturer;
    /*
     *厂商地址
     */
    @Column(name = "address")
    private String address;
    /*
     *代表人
     */
    @Column(name = "representative")
    private String representative;
    /*
     *申请人
     */
    @Column(name = "applicant_name")
    private String applicantName;
    /*
     *申请人电话
     */
    @Column(name = "applicant_tel")
    private String applicantTel;
    /*
     *'所属居委会编码
     */
    @Column(name = "neighborhood_committee_code")
    private String neighborhoodCommitteeCode;
    /*
     *所属居委会名称
     */
    @Column(name = "neighborhood_committee_name")
    private String neighborhoodCommitteeName;
    /*
     *地址
     */
    @Column(name = "local_add")
    private String localAdd;
    /*
     *所属区域code
     */
    @Column(name = "belong_are_code")
    private String belongAreCode;
    /*
     *所属区域
     */
    @Column(name = "belong_are")
    private String belongAre;
    /*
     *经度
     */
    @Column(name = "longitude")
    private String longitude;
    /*
     *纬度
     */
    @Column(name = "latitude")
    private String latitude;

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1129,6 +1129,7 @@ public class BaseHospitalRequestMapping {
        public static final String setAllCode  = "/setAllCode";
        public static final String findArticleByCategoryAndName  = "/findArticleByCategoryAndName";
        public static final String getArticleGroup  = "/getArticleGroup";
        public static final String findPatientFavorite  = "/findPatientFavorite";
    }
    /**

+ 27 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java

@ -0,0 +1,27 @@
package com.yihu.jw.base.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.*;
/**
 * Created by liub on 2020/9/8.
 */
@Configuration
public class MultipartConfig {
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        File tmpFile = new File("/data/apps/temp");
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();
        }
        factory.setLocation("/data/apps/temp");
        return factory.createMultipartConfig();
    }
}

+ 18 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -8,6 +8,7 @@ import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleDao;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.service.consult.BasePatientBusinessService;
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
@ -23,12 +24,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.lang.StringUtils;
import org.jboss.netty.handler.codec.http.multipart.MixedAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@ -54,6 +57,8 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	private KnowledgeArticleUserService knowledgeArticleUserService;
	@Autowired
	private KnowledgeArticleUserDao knowledgeArticleUserDao;
	@Autowired
	private KnowledgeArticleDao knowledgeArticleDao;
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
	@ApiOperation(value = "获取文章列表")
@ -358,7 +363,6 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
		}
		List<KnowledgeArticleUserDO> list  = knowledgeArticleUserService.search(fields,filters,sorts,page,pageSize);
		for (KnowledgeArticleUserDO knowledgeArticleUserDO:list){
			Integer type = knowledgeArticleUserDO.getRelationType();
			if (type==1){
@ -374,7 +378,6 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			}
		}
		List<KnowledgeArticleUserDO> totals  = knowledgeArticleUserService.search(fields,filters,sorts);
		JSONObject result = new JSONObject();
		result.put("total",totals.size());
		result.put("detailModelList",list);
@ -405,4 +408,17 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
		return envelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findPatientFavorite)
	@ApiOperation(value = "查询收藏文章")
	public Envelop findPatientFavorite(@ApiParam(name = "patient", value = "病人id")
												   @RequestParam(value = "patient",required = false)String patient,
												   @ApiParam(name = "page", value = "当前页")
												   @RequestParam(value = "page",required = false)Integer page,
												   @ApiParam(name = "pageSize", value = "分页大小)")
												   @RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
		return success(knowledgeArticleService.findPatientFavorite(patient,page,pageSize));
	}
}

+ 39 - 18
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -64,27 +64,48 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        MixEnvelop mixEnvelop = new MixEnvelop();
        JSONObject obj = JSONObject.parseObject(jsonData);
        String client_id = obj.getString("client_id");
        String username = obj.getString("phoneNum");
        String phoneNum = obj.getString("phoneNum");
        String idCard = obj.getString("idCard");
        String familyName = obj.getString("familyName");
        //JSONArray jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
        JSONArray jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
        if(jsonArray!=null&&jsonArray.size()>0){
            net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
            String familyId="";
            if (null!=jsonObject.get("Patient_Id")){
                String Pat_name = jsonObject.getString("Pat_Name");
                if (null!=jsonObject.get("Phone_Number_Business")){
                    String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Business").toString();
                    if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
                        return mixEnvelop;
                    }
                }
                if(!Pat_name.equalsIgnoreCase(familyName)){
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属的名称有误,无法添加");
                    return mixEnvelop;
                }
            }
        }
        if (StringUtils.isEmpty(client_id)) {
            mixEnvelop.setStatus(468);
            mixEnvelop.setMessage("client_id不能为空");
            return mixEnvelop;
        }
        if (StringUtils.isEmpty(username)) {
        if (StringUtils.isEmpty(phoneNum)) {
            mixEnvelop.setStatus(468);
            mixEnvelop.setMessage("username不能为空");
            mixEnvelop.setMessage("电话号不能为空");
            return mixEnvelop;
        }
        if (username.length() > 12) {
        if (phoneNum.length() > 12) {
            mixEnvelop.setStatus(468);
            mixEnvelop.setMessage("请输入正确的手机号");
            return mixEnvelop;
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!this.isIntervalTimeout(client_id, username)) {
        if (!this.isIntervalTimeout(client_id, phoneNum)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
            //发送短信获取验证码
        }
@ -92,35 +113,35 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            System.out.println("发送眼科验证码开始");
            ResultMsg result= null;
            /*if (jsonArray.size() > 0) {*/
                result = ykyySMSService.ykyySendSMS(username, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
            if (null!=jsonArray&&jsonArray.size() > 0) {
                result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                if (result.isSuccess()){
                    this.store(client_id, username, captcha, 120);
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            /*}else {
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            }*/
            }
        }else {
            System.out.println("发送中山验证码开始");
            int result = 1;
            /*if (jsonArray.size() > 0) {*/
                result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
           /* } else {
            if (null!=jsonArray&&jsonArray.size() > 0) {
                result = zhongShanSMSService.ZhongShangSendSMS(phoneNum, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
            } else {
                result = 2;
            }*/
            }
            if (0 == result) {
                this.store(client_id, username, captcha, 120);
                this.store(client_id, phoneNum, captcha, 120);
                mixEnvelop.setMessage("验证码发送成功");
            } /*else if (2 == result) {
            } else if (2 == result) {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            }*/ else {
            } else {
                mixEnvelop.setMessage("验证码发送失败");
                mixEnvelop.setStatus(500);
            }

+ 46 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -3,7 +3,9 @@ package com.yihu.jw.hospital.service.consult;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDeptDO;
@ -19,6 +21,7 @@ import com.yihu.jw.hospital.survey.dao.SurveyTemplateDao;
import com.yihu.jw.hospital.survey.dao.SurveyUserDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientBusinessDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.utils.EntityUtils;
@ -53,6 +56,8 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
	@Autowired
	private KnowledgeArticleUserDao knowledgeArticleUserDao;
	@Autowired
	private BaseDoctorHospitalDao doctorHospitalDao;
	@Autowired
	private BaseDoctorDao doctorDao;
	@Autowired
	private ImUtil imUtil;
@ -71,8 +76,10 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
		String[] split = id.split(",|,");
		String ids = StringUtils.join(split, ",");
		String sql = "update wlyy_knowledge_article a set a.del = 0 where a.id in(" + ids + ")";
		String sqlUser = "update wlyy_knowledge_article_user a set a.del = 0 where a.relation_code in(" + ids + ")";
		int update = jdbcTemplate.update(sql);
		if (update > 0) {
		int updateUser = jdbcTemplate.update(sqlUser);
		if (update > 0&&updateUser>0) {
			return true;
		}
		return false;
@ -363,5 +370,42 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        return objEnvelop;
	}
	//查询患者收藏的文章列表
	public JSONObject findPatientFavorite(String patient,Integer page,Integer pageSize){
		String sql = "select t.id as \"id\",t.user_code as \"user\",t.user_name as \"userName\"," +
				"t.relation_code as \"relationCode\"," +
				"t.relation_type as \"relationType\"," +
				"t.relation_name as \"relationName\"," +
				"t.is_read as \"isRead\",t.fabulous as \"fabulous\"," +
				"t.is_share as \"share\"," +
				"t.collection as \"collection\",t.used as \"used\",t.del as \"del\"";
		sql+=" from wlyy_knowledge_article_user t left join wlyy_knowledge_article a" +
				" on t.relation_code = a.id where 1=1 and a.del=1 and a.collection=1 ";
		if (StringUtils.isNotEmpty(patient)){
			sql+=" and t.user_code = '"+patient+"'";
		}
		List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
		if(list!=null&&list.size()>0){
			for (Map<String,Object> map:list){
				String relationCode = map.get("relationCode").toString();
				String type =  map.get("relationType").toString();
				if ("1".equalsIgnoreCase(type)){
					KnowledgeArticleDO knowledgeArticleDO = this.selectById(relationCode);
					if (knowledgeArticleDO!=null){
						List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
						if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
							knowledgeArticleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
							knowledgeArticleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
						}
					}
					map.put("KnowledgeArticleUserDO",knowledgeArticleDO);
				}
			}
		}
		List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
		JSONObject result = new JSONObject();
		result.put("total",listCount.size());
		result.put("detailModelList",list);
		return result;
	}
}

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -665,6 +665,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        return success( iotEqtDetailService.getHosptital(name, code, town,city));
    }
    @GetMapping(value = IotRequestMapping.Common.getNameAndCode)
    @ApiOperation(value = "查询idcard")
    public Envelop getByIdCard(

+ 3 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -969,7 +969,9 @@ public class MonitorPlatformService  {
        try {
            IotEquipmentDetailDO iotEquipmentDetailDO= iotEquipmentDetailDao.findByDeviceCode(deviceSn);
            JSONObject obj = (JSONObject)JSONObject.toJSON(iotEquipmentDetailDO);
            obj.put("deviceSn",iotEquipmentDetailDO.getDeviceCode());
            if(iotEquipmentDetailDO!=null){
                obj.put("deviceSn",iotEquipmentDetailDO.getDeviceCode());
            }
            return obj;
        }catch (Exception e){
            e.printStackTrace();

+ 1 - 1
svr/svr-iot/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-iot-lb
    name:  svr-iot
  cloud:
    config:
      failFast: true