|
@ -1,5 +1,6 @@
|
|
package com.yihu.iot.service.device;
|
|
package com.yihu.iot.service.device;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.elasticsearch.ElasticSearchHelper;
|
|
import com.yihu.elasticsearch.ElasticSearchHelper;
|
|
import com.yihu.iot.dao.company.IotCompanyDao;
|
|
import com.yihu.iot.dao.company.IotCompanyDao;
|
|
@ -509,7 +510,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
list.forEach(one->{
|
|
list.forEach(one->{
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
|
|
|
|
|
|
one.setPatientName(AesEncryptUtils.DHFGF(one.getPatientName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
@ -548,10 +549,10 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
}
|
|
}
|
|
|
|
|
|
//数据权限过滤
|
|
//数据权限过滤
|
|
List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
|
|
|
|
if(!orgList.contains(userAgent.commonHospital)){
|
|
|
|
sql += " and p.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
|
|
|
|
}
|
|
|
|
|
|
// List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
|
|
|
|
// if(!orgList.contains(userAgent.commonHospital)){
|
|
|
|
// sql += " and p.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
|
|
|
|
// }
|
|
|
|
|
|
sql +=" GROUP BY p.device_sn ORDER BY p.update_time desc ";
|
|
sql +=" GROUP BY p.device_sn ORDER BY p.update_time desc ";
|
|
if (page != null && pageSize != null) {
|
|
if (page != null && pageSize != null) {
|
|
@ -561,7 +562,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
list.forEach(one->{
|
|
list.forEach(one->{
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
|
|
|
|
|
|
one.setPatientName(AesEncryptUtils.DHFGF(one.getPatientName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
@ -573,7 +574,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
list.forEach(one->{
|
|
list.forEach(one->{
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
|
|
one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
|
|
|
|
|
|
one.setPatientName(AesEncryptUtils.DHFGF(one.getPatientName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
|
|
@ -582,6 +583,39 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_find, list);
|
|
return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_find, list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
String str = "wfL8T2aAmlBnZv2S8QwZXQ==,BFPvVzBHgwa7plBHhkcOQw==,BD4ExdUzPKini5xns11z6Q==,IJOA+Ug/mjvF+L64a/Dq5g==";
|
|
|
|
char searchChar = ',';
|
|
|
|
int count = 0;
|
|
|
|
char[] charArray = str.toCharArray();
|
|
|
|
|
|
|
|
for (char item : charArray) {
|
|
|
|
if (item == searchChar) {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
String[] ss = new String[count];
|
|
|
|
if (count == 0){
|
|
|
|
sb.append(AesEncryptUtils.decrypt(str)); ;
|
|
|
|
}else {
|
|
|
|
for (int i=0;i<count;i++){
|
|
|
|
ss = str.split(",") ;
|
|
|
|
}
|
|
|
|
List<String>list = new ArrayList<String>();
|
|
|
|
Collections.addAll(list,ss);
|
|
|
|
for (int j=0;j<list.size();j++){
|
|
|
|
str = AesEncryptUtils.decrypt(list.get(j));
|
|
|
|
sb.append(str);
|
|
|
|
if (j == (list.size()-1)){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sb.append(",");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
System.out.println(sb.toString());
|
|
|
|
}
|
|
|
|
|
|
public void deleteRepairDevice(String deviceSn) {
|
|
public void deleteRepairDevice(String deviceSn) {
|
|
List<IotPatientDeviceDO> patientDeviceDOList = iotPatientDeviceDao.findAllByDeviceSn(deviceSn);
|
|
List<IotPatientDeviceDO> patientDeviceDOList = iotPatientDeviceDao.findAllByDeviceSn(deviceSn);
|
|
for(IotPatientDeviceDO patientDeviceDO : patientDeviceDOList){
|
|
for(IotPatientDeviceDO patientDeviceDO : patientDeviceDOList){
|