Browse Source

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

yeshijie 4 years ago
parent
commit
f567abaa4b

+ 35 - 1
common/common-entity/sql记录

@ -607,4 +607,38 @@ CREATE TABLE `base_business_sys_dict` (
    `ext2` varchar(50) DEFAULT NULL COMMENT '备用字段2 ',
  PRIMARY KEY (`id`),
  KEY `dict_name` (`dict_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='托育业务字典表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='托育业务字典表';
CREATE TABLE `wlyy_devices` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `apply_date` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '申请日期',
  `org_name` varchar(255) DEFAULT NULL COMMENT '机构名称',
  `linkman` varchar(255) DEFAULT NULL COMMENT '联系人',
  `tel` varchar(255) DEFAULT NULL COMMENT '联系电话',
  `server_ip` varchar(255) DEFAULT NULL COMMENT '服务IP地址',
  `device_name` varchar(255) DEFAULT NULL COMMENT '设备名称',
  `device_model` varchar(255) DEFAULT NULL COMMENT '型号',
  `device_code` varchar(255) DEFAULT NULL COMMENT '设备唯一标识',
  `manufacturer_code` varchar(255) DEFAULT NULL COMMENT '厂商代码',
  `manufacturer` varchar(255) DEFAULT NULL COMMENT '厂家名称',
  `address` varchar(255) DEFAULT NULL COMMENT '厂家地址',
  `representative` varchar(255) DEFAULT NULL COMMENT '法人代表',
  `applicant_name` varchar(255) DEFAULT NULL COMMENT '申请注册人',
  `applicant_identity` varchar(255) DEFAULT NULL COMMENT '申请人身份证号',
  `applicant_tel` varchar(255) DEFAULT NULL COMMENT '申请人手机',
  `applicant_mail` varchar(255) DEFAULT NULL COMMENT '申请人邮箱',
  `sim` varchar(50) DEFAULT NULL COMMENT 'sim卡号',
  `manufacturer_id` varchar(50) DEFAULT NULL COMMENT '厂商id',
  `is_grant` int(2) DEFAULT '0' COMMENT '是否发放(0否1是)',
  `grant_admin_team` varchar(50) DEFAULT NULL COMMENT '发放的患者所在团队',
  `grant_org_code` varchar(50) DEFAULT NULL COMMENT '发放所在机构',
  `is_binding` int(2) DEFAULT '0' COMMENT '是否绑定(0否 1 是)',
  `binding_count` varchar(50) DEFAULT NULL COMMENT '绑定次数({"1":"0", "2":"0"})',
  `grant_time` datetime DEFAULT NULL COMMENT '发放时间',
  `grant_doctor` varchar(50) DEFAULT NULL COMMENT '发放医生code',
  `grant_doctor_name` varchar(50) DEFAULT NULL COMMENT '发放医生姓名',
  `neighborhood_committee_code` varchar(12) DEFAULT NULL COMMENT '居委会code',
  `neighborhood_committee_name` varchar(100) DEFAULT NULL COMMENT '居委会名称',
  PRIMARY KEY (`id`),
  KEY `idx_device_code` (`device_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='厦门设备信息表';

+ 5 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java

@ -45,12 +45,16 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<DevicePatie
    //管理员解绑居民设备
    @Modifying
    @Query("update DevicePatientDevice t set t.del = 1  where t.deviceSn = ?1 ")
    @Query("update DevicePatientDevice t set t.del = 1  where t.deviceSn = ?1 and t.del =0  ")
    int updatePatientDevice(String deviceSN);
    @Query("select a from DevicePatientDevice a")
    List<DevicePatientDevice> findAll();
    @Modifying
    @Query("delete DevicePatientDevice a where a.deviceSn = ?1")
    int deleteByDeviceSn(String deviceSN);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.del=0")
    List<DevicePatientDevice> findAllByUser(String user);

+ 4 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -99,7 +99,8 @@ public class PadDeviceController extends BaseController {
    @RequestMapping(value = "SavePatientDevice", method = RequestMethod.POST)
    public String saveDevice(@ApiParam(name = "json", value = "设备数据json", defaultValue = "{     \"deviceId\":\"3\",     \"deviceName\":\"血压计-优瑞恩\",     \"deviceSn\":\"7052169111\",     \"categoryCode\":\"7\",     \"userType\":\"-1\", \"sosAddress\":\"福建省厦门市思明区望海路55号之1\" }")
                             @RequestParam(value = "json", required = true) String json,
                             @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patientCode
                             @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patientCode,
                             @ApiParam(name = "doctorCode", value = "管理员code") @RequestParam(value = "doctorCode", required = false) String doctorCode
                             ) {
        try {
            DevicePatientDevice device = objectMapper.readValue(json, DevicePatientDevice.class);
@ -113,8 +114,8 @@ public class PadDeviceController extends BaseController {
                return write(-1,"设备不存在或者数据存在错误!");
            }
            BaseDoctorDO doctor = baseDoctorDao.findById(getUID());
            device.setAgent(getUID());
            BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
            device.setAgent(doctorCode);
            device.setAgentName(doctor.getName());
            String sn = device.getDeviceSn();
            synchronized (sn.intern()){

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -159,7 +159,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        //校验sn码是否被使用
        if (needVerify) {
            DevicePatientDevice device = patientDeviceDao.findByDeviceSnAndUserType(sn, userType);
            if (device != null && !device.getId().equals(devicePatientDevice.getId())) {
            if (device != null && !device.getId().equals(devicePatientDevice.getId()) && device.getDel() == 0) {
                throw new Exception("sn码" + sn + "已被使用!");
            }
        }
@ -183,7 +183,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        String sql = "select * from wlyy_patient_device where del = 0 and device_sn = '"+deviceSn+"'";
        List<Map<String , Object>> list = jdbcTemplate.queryForList(sql);
        if (list.size() > 0){
            return patientDeviceDao.updatePatientDevice(deviceSn);
            return patientDeviceDao.deleteByDeviceSn(deviceSn);
        }else {
            return 0;
        }
@ -252,7 +252,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    public List<Map<String , Object>> findDeviceFromAdmin(String patientName, int page, int pageSize) {
        String sql = "select p.id,p.`name`,dd.photo,pd.device_id deviceId,pd.category_code categoryCode,pd.device_name deviceName,pd.device_sn deviceSn,pd.czrq,pd.doctor,\n" +
                "pd.doctor_name doctorName,pd.agent,pd.agent_name agentName from wlyy_patient_device pd,base_patient p,dm_device dd where p.id = pd.`user` and pd.category_code = dd.category_code";
                "pd.doctor_name doctorName,pd.agent,pd.agent_name agentName from wlyy_patient_device pd,base_patient p,dm_device dd where p.id = pd.`user` and pd.del = 0 and pd.category_code = dd.category_code";
        if (StringUtils.isNotBlank(patientName)){
            sql += " AND (p.`name` LIKE '%" + patientName +"%' or  p.idcard LIKE '%" + patientName + "%') ";
        }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -414,7 +414,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        JSONObject jsonObjectParam;
        try {
            jsonObjectParam = JSONObject.parseObject(jsonData);
            if (jsonObjectParam.getJSONObject("order").getInteger("type")==1||jsonObjectParam.getInteger("type")==2){
            if (jsonObjectParam.getJSONObject("order").getInteger("type")==1||jsonObjectParam.getJSONObject("order").getInteger("type")==2){
                //本人或家人代发起
                BasePatientDO patientDO = patientDao.findById(proxyPatient);
                jsonObjectParam.put("proxyPatient",proxyPatient);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -451,7 +451,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    }
    public List<Map<String,Object>> serviceItemByPackageId(String packageId){
        String sql ="select it.code,it.name,count(it.code)count,pack.introduce,pack.type,pack.`name` from base_service_package_item it " +
        String sql ="select it.code,it.name,count(it.code)count,pack.introduce,pack.type,pack.`name` packageName from base_service_package_item it " +
                "INNER JOIN base_service_package pack on it.service_package_id = pack.id  where it.service_package_id='"+packageId+"' and pack.del=1 group by it.code ";
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        return result;

+ 1 - 1
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -142,7 +142,7 @@ public class DeviceService {
                }
                if (json != null) {
                    logDO.setSosLat(json.get("lat").toString());
                    logDO.setSosLon(json.get("lat").toString());
                    logDO.setSosLon(json.get("lon").toString());
                }
            }
            //发送紧急救助