Преглед изворни кода

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

wangjun пре 4 година
родитељ
комит
8759cbc378

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

@ -380,14 +380,17 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                if(jsonObject1.get("MEDICALCARD")!=null){
                                    List<PatientMedicareCardDO> patientMedicareCardDOS =  basePatientMedicareCardDao.findByPatientCode(patientDO.getId());
                                    boolean flag = false;
                                    PatientMedicareCardDO patientMedicareCardDO1 = new PatientMedicareCardDO();
                                    for (PatientMedicareCardDO medicareCardDO:patientMedicareCardDOS){
                                        if (medicareCardDO.getParentType().equalsIgnoreCase("A_01")){
                                        if (medicareCardDO.getType().equalsIgnoreCase("A_01")){
                                            flag=true;
                                            patientMedicareCardDO1=medicareCardDO;
                                            break;
                                        }
                                    }
                                    System.out.println("flag"+flag);
                                    PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(jsonObject1.getString("MEDICALCARD"));
                                    if (patientMedicareCardDO==null&&!flag){
                                    if (patientMedicareCardDO==null&&flag==false){
                                        patientMedicareCardDO = new PatientMedicareCardDO();
                                        patientMedicareCardDO.setCode(jsonObject1.getString("MEDICALCARD"));
                                        patientMedicareCardDO.setParentType("A");
@ -395,13 +398,13 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                        patientMedicareCardDO.setPatientCode(patientDO.getId());
                                        patientMedicareCardDO.setDel("1");
                                        basePatientMedicareCardDao.save(patientMedicareCardDO);
                                    }else if (patientMedicareCardDO!=null&&flag){
                                        patientMedicareCardDO.setCode(jsonObject1.getString("MEDICALCARD"));
                                        patientMedicareCardDO.setParentType("A");
                                        patientMedicareCardDO.setType("A_01");
                                        patientMedicareCardDO.setPatientCode(patientDO.getId());
                                        patientMedicareCardDO.setDel("1");
                                        basePatientMedicareCardDao.save(patientMedicareCardDO);
                                    }else if (patientMedicareCardDO!=null&&flag==true&&patientMedicareCardDO1!=null){
                                        patientMedicareCardDO1.setCode(jsonObject1.getString("MEDICALCARD"));
                                        patientMedicareCardDO1.setParentType("A");
                                        patientMedicareCardDO1.setType("A_01");
                                        patientMedicareCardDO1.setPatientCode(patientDO.getId());
                                        patientMedicareCardDO1.setDel("1");
                                        basePatientMedicareCardDao.save(patientMedicareCardDO1);
                                    }
                                }

+ 14 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -878,11 +878,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
        if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        if(doctorDO!=null){
            if (StringUtils.isNoneBlank(doctorDO.getChargeType())){
                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeType(doctorDO.getChargeType());
                if (chargeDictDO!=null){
                    price = chargeDictDO.getReqFee();
                }else {
                    price = Double.parseDouble(hospitalSysDictDO.getDictValue());
                }
            }
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }
        /*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }*/
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
        } else {

+ 37 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -17,7 +17,9 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
@ -26,6 +28,8 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
@ -102,8 +106,6 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
@ -111,6 +113,12 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private BaseDoctorRoleDao doctorRoleDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private WlyyChargeDictDao wlyyChargeDictDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private BaseDoctorDao doctorDao;
@ -317,7 +325,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        //1.保存就诊实体
        WlyyOutpatientDO outpatientDO = objectMapper.readValue(outpatientJson, WlyyOutpatientDO.class);
        BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        outpatientDO.setMjz("mz");
        outpatientDO.setStatus("0");
        outpatientDO.setCreateTime(new Date());
@ -365,6 +373,32 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                businessOrderDO.setOrderCategory("3");
            }
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
        if(doctorDO!=null){
            if (StringUtils.isNoneBlank(doctorDO.getChargeType())){
                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeType(doctorDO.getChargeType());
                if (chargeDictDO!=null){
                    price = chargeDictDO.getReqFee();
                }else {
                    price = Double.parseDouble(hospitalSysDictDO.getDictValue());
                }
            }
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }
        /*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }*/
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
        } else {
            outpatientDO.setPayStatus(0);
        }
        businessOrderDO.setPayPrice(price*100);
        if (!flag){

+ 7 - 5
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -254,17 +254,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            businessOrderDO.setPcCallbackUrl("https://intel.yanketong.com/ims-web/#/yk/consult/record?outpatientId="+businessOrderDO.getRelationCode()+"&verifyCode=");
        }
        List<WlyyHospitalSysDictDO> hospitalSysDictDOS = hospitalSysDictDao.findByDictName("WX_MONEY");
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        String totalFee = null;
        if (hospitalSysDictDOS!=null&&hospitalSysDictDOS.size()!=0){
            totalFee= hospitalSysDictDOS.get(0).getDictValue();
        if (businessOrderDO!=null&&businessOrderDO.getPayPrice()==null){
            String totalFee = null;
            if (hospitalSysDictDOS!=null&&hospitalSysDictDOS.size()!=0){
                totalFee= hospitalSysDictDOS.get(0).getDictValue();
            }
            businessOrderDO.setPayPrice(StringUtils.isNoneBlank(totalFee)?Double.parseDouble(totalFee):0.0);
        }
        businessOrderDO.setPayPrice(StringUtils.isNoneBlank(totalFee)?Double.parseDouble(totalFee):0.0);
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        String patient = businessOrderDO.getPatient();
        BasePatientDO basePatientDO = patientDao.findById(patient);
        String orderNo = businessOrderDO.getOrderNo();
        String patientId = "";
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        if (StringUtils.isNoneBlank(basePatientDO.getYktId())){
            patientId = basePatientDO.getYktId();
        }else {

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
   /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 36 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1756,9 +1756,11 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                if (familyJson.getString("code").equalsIgnoreCase("200")){
                                    JSONObject object1 = familyJson.getJSONObject("data");
                                    JSONArray list = object1.getJSONArray("list");
                                    List<String> iliness = new ArrayList<>();
                                    if (list!=null&&list.size()!=0){
                                        for (int i=0;i<list.size();i++){
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                            if (family.getString("ILLNESS").equalsIgnoreCase("本人")||tel.equalsIgnoreCase(family.getString("TEL"))){
                                                basePatientDO.setDel("1");
                                                basePatientDO.setName(family.getString("NAME"));
@ -1808,11 +1810,45 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                        basePatientDO.setPatientStatus("1");
                                        basePatientDao.save(basePatientDO);
                                    }
                                    String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                    }
                                }
                            }else {
                                BasePatientDO basePatientDO1 = basePatientDOS.get(0);
                                basePatientDO1.setUserId(userId);
                                basePatientDao.save(basePatientDO1);
                                String familyList = ykyyService.getFamilyList(null,userId);
                                JSONObject familyJson = JSONObject.parseObject(familyList);
                                if (familyJson.getString("code").equalsIgnoreCase("200")){
                                    JSONObject object1 = familyJson.getJSONObject("data");
                                    JSONArray list = object1.getJSONArray("list");
                                    List<String> iliness = new ArrayList<>();
                                    if (list!=null&&list.size()!=0){
                                        for (int i=0;i<list.size();i++) {
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                        }
                                    }
                                    String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO1.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO1.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                    }
                                }
                            }
                        }
                    }

+ 2 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -137,6 +137,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "endTime",required = false) String endTime,
                                          @ApiParam(name = "ksdm", value = "科室代码")
                                              @RequestParam(value = "ksdm",required = false) String ksdm) throws Exception {
        startTime = startTime+" 00:00:00";
        endTime =endTime+" 23:59:59";
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm);
        return success(vos);
    }

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

@ -217,7 +217,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                pageSize = 20;
            }
            return MixEnvelop.getSuccess("查询成功",monitorPlatformService.warningInformationAlarm_new(page,pageSize,startTime,endTime,deviceType,area,hospital,deviceName));
            return MixEnvelop.getSuccess("查询成功",monitorPlatformService.warningInformationAlarm_new(page,pageSize,startTime,endTime,deviceType,area,hospital,monitorPlatformService.getDeviceNameByRequestParam(deviceName)));
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError("查询失败");
@ -485,7 +485,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            if(pageSize==null){
                pageSize = 10;
            }
            return monitorPlatformService.findDeviceLocations(diseaseCondition,page,pageSize,type,deviceType,deviceName);
            return monitorPlatformService.findDeviceLocations(diseaseCondition,page,pageSize,type,deviceType,monitorPlatformService.getDeviceNameByRequestParam(deviceName));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
@ -772,7 +772,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                                          @RequestParam(value = "showLevel",defaultValue = "0")
                                          @ApiParam(name="showLevel",value ="下转层次,默认0设备大类,1设备类型,2设备品牌") String showLevel){
        return success(monitorPlatformService.getEquipmentStatistics(deviceType, deviceName, showLevel));
        return success(monitorPlatformService.getEquipmentStatistics(deviceType, monitorPlatformService.getDeviceNameByRequestParam(deviceName), showLevel));
    }
    @ApiOperation("大屏应用服务")
    @RequestMapping(value = "/getAppService" , method = RequestMethod.GET)

+ 37 - 8
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -1131,7 +1131,7 @@ public class MonitorPlatformService  {
            String sql  = "select count(DISTINCT A.device_name) as total,A.device_name,A.manufacturer from (\n" +
                    "select pd.device_name,wd.manufacturer from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
                    "where pd.device_sn = wd.device_code and pd.del=0 \n" +
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>''\n" +
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机'  \n" +
                    "GROUP BY wd.manufacturer_code,pd.device_name\n" +
                    "UNION\n" +
                    "select '健康小屋' device_name,manufacturer from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
@ -1145,7 +1145,7 @@ public class MonitorPlatformService  {
            sql = "select count(DISTINCT A.device_name)from (\n" +
                    "select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
                    "where pd.device_sn = wd.device_code and pd.del=0 \n" +
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>''\n" +
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
                    "GROUP BY wd.manufacturer_code,pd.device_name\n" +
                    "UNION\n" +
                    "select '健康小屋' device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
@ -1443,7 +1443,8 @@ public class MonitorPlatformService  {
            StringBuffer sql = new StringBuffer("select DISTINCT A.device_name from (\n" +
                    "select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
                    "where pd.device_sn = wd.device_code and pd.del=0 \n" +
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' ");
                    "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' " +
                    "and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' ");
            if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType)){
                sql.append("and pd.category_code in ('").append(deviceType.replace(",","','")).append("') ");
            }
@ -1453,8 +1454,20 @@ public class MonitorPlatformService  {
            }
            sql.append(")A");
            List<String> list = jdbcTemplate.queryForList(sql.toString(),String.class);
            List<String> reList = new ArrayList<>();
            int i=0;
            for(String tmp:list){
                if ("三诺血糖仪".equals(tmp)||"血糖仪-三诺亲智".equals(tmp)||"三诺亲智".equals(tmp)||"健康之路亲智血糖仪".equals(tmp)||"血糖仪".equals(tmp)||"血糖仪-健康之路亲智血糖仪".equals(tmp)){
                    i=1;
                    continue;
                }
                reList.add(tmp);
            }
            if (i==1){//上面去除的元素统一返回为三诺血糖仪
                reList.add("三诺血糖仪");
            }
            JSONObject result = new JSONObject();
            result.put("brands",list);
            result.put("brands",reList);
            return result;
        }catch (Exception e){
            e.printStackTrace();
@ -1486,13 +1499,17 @@ public class MonitorPlatformService  {
        Integer ee = jdbcTemplate.queryForObject(cabinCount,Integer.class);
        object.put("medicalInstitutionIquipment",ee);
        //小屋体征数据
        String cabinSignData = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d, device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.del=1 and p.type>2";
        String cabinSignData = "SELECT count(1) FROM xmiot.wlyy_iot_m ";
        Integer ff = jdbcTemplate.queryForObject(cabinSignData,Integer.class);
        object.put("medicalPhysicalSignData",ff);
        //小屋异常体征数据
        String abnormalSignDataOfCabin = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d,device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.`status`=1 and p.del=1 and p.type>2";
        String abnormalSignDataOfCabin = "select count(1)\n" +
                "from  xmiot.wlyy_iot_d d \n" +
                "where d.type='BloodPressure'\n" +
                "and  (\n" +
                "(d.`code`='HighPressure' and (d.`value` not BETWEEN 90.0 and 140))\n" +
                "or (d.`code`='LowPressure' and (d.`value` not BETWEEN 60.0 and 90))\n" +
                ");";
        Integer gg = jdbcTemplate.queryForObject(abnormalSignDataOfCabin,Integer.class);
        object.put("medicalAbnormalSignData",gg);
        return object;
@ -1583,4 +1600,16 @@ public class MonitorPlatformService  {
        return result;
    }
    /**
     * deviceName处理
     * @param deviceName
     * @return
     */
    public String getDeviceNameByRequestParam(String deviceName){
        if (deviceName.contains("三诺血糖仪")){
            return deviceName.replace("三诺血糖仪","三诺血糖仪,血糖仪-三诺亲智,三诺亲智,健康之路亲智血糖仪,血糖仪,血糖仪-健康之路亲智血糖仪");
        }
        return deviceName;
    }
}