Procházet zdrojové kódy

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

wangjun před 4 roky
rodič
revize
e252efb86b
16 změnil soubory, kde provedl 225 přidání a 74 odebrání
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 6 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  3. 13 3
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  4. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  5. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  6. 41 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java
  7. 63 4
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  8. 12 0
      svr/svr-base/src/main/resources/application.yml
  9. 9 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java
  10. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  11. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/common/OrgUserService.java
  12. 23 19
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java
  13. 43 27
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java
  14. 4 4
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java
  15. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceTransfersService.java
  16. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

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

@ -4583,7 +4583,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 2 GROUP BY doctor ) a on a.doctor = d.id ";
                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 3 GROUP BY doctor ) a on a.doctor = d.id ";
        if ("1".equalsIgnoreCase(isAttention)) {
            sql += " join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient ='" + patientid + "' ";

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

@ -1312,6 +1312,7 @@ public class XzzxEntranceService{
        WlyyOutpatientVO outpatientVO = new WlyyOutpatientVO();
        JSONArray array = new JSONArray();
        String response="";
        BasePatientDO patientDO = patientDao.findById(patient);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if (patientMappingDO!=null){
            patient = patientMappingDO.getMappingCode();
@ -1347,6 +1348,10 @@ public class XzzxEntranceService{
                outpatientVO.setCreateTime(DateUtil.strToDate(object.getString("CREATETIME")));
                outpatientVO.setStatus(isEmty(object.getString("STATUS")));
                outpatientVO.setConNo(isEmty(object.getString("VISITNUM")));
                outpatientVO.setHospitalName("厦门大学附属心血管病医院");
                outpatientVO.setHospital("350211A5010");
                outpatientVO.setSex(patientDO.getSex()+"");
                outpatientVO.setBirthday(patientDO.getBirthday());
            }
        }
        return outpatientVO;
@ -1571,7 +1576,7 @@ public class XzzxEntranceService{
                        prescriptionInfoVO.setPackRetprice(isEmty(infoJson.getString("PACKRETPRICE"))==null?0.0:infoJson.getDouble("PACKRETPRICE"));
                        prescriptionInfoVO.setHerbalCount(isEmty(infoJson.getString("HERBALCOUNT")));
                        prescriptionInfoVO.setPostCount(isEmty(infoJson.getString("POSTCOUNT")));
                        prescriptionInfoVO.setDel(infoJson.getInteger("DEL"));
                        prescriptionInfoVO.setDel(isEmty(infoJson.getString("DEL"))==null?1:infoJson.getInteger("DEL"));
                        prescriptionInfoVO.setComm(infoJson.getString("COMM"));
                        wlyyPrescriptionInfoVOList.add(prescriptionInfoVO);
                        wlyyPrescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOList);

+ 13 - 3
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -2236,8 +2236,18 @@ public class ImService {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc ";
		
		return hibenateUtils.createSQLQuery(sql,page,pagesize);
		List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql,page,pagesize);
		for (Map<String,Object> map:mapList){
			if (map.get("patientIdcard")!=null){
				String idcard = map.get("patientIdcard").toString();
				Integer age = IdCardUtil.getAgeForIdcard(idcard);
				map.put("age",age);
			}else {
				map.put("age",null);
			}
		}
		return mapList;
	}
	
	/**
@ -2928,7 +2938,7 @@ public class ImService {
	 */
	public List<Map<String,Object>> doctorUpcomingList(String doctorCode, String type) {
		String sql = "";
		if("1,15".equals(type)) {
		if("1,15,17".equals(type)) {
			sql = "SELECT " +
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +

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

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    /*@GeneratedValue(generator = "generator")
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)*/
    @Column(name = "id", unique = true, nullable = false)
//==========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;

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

@ -166,6 +166,7 @@ public class BaseRequestMapping {
        public static final String orgTreeInfo = "/orgTreeInfo";
        public static final String userInfoList = "/userInfoList";
        public static final String lockOrUnlock = "/lockOrUnlock";
        public static final String orgChoiceInfo = "/orgChoiceInfo";
    }
    /**

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 41 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java


+ 63 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -8,10 +8,7 @@ import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.service.org.BaseOrgSaasService;
import com.yihu.jw.base.service.org.BaseOrgUserService;
import com.yihu.jw.base.service.org.OrgTree;
import com.yihu.jw.base.service.org.OrgTreeService;
import com.yihu.jw.base.service.org.*;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.base.org.BaseOrgUserDO;
@ -486,6 +483,42 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        return result;
    }
    /**
     * 租户只能给用户归属到自己租户底下的机构
     * 机构管理员只能属于一个租户,增加社区树
     * @param saasid
     * @param userId
     * @return
     */
    public JSONObject orgChoiceInfo(String saasid,String userId,String roleId) throws IOException {
        JSONObject result = new JSONObject();
        List<OrgTree> orgList = new ArrayList<>();
        // 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
            StringBuilder sql = new StringBuilder("SELECT tree.*  FROM org_tree tree, base_org org, base_org_saas saas WHERE org.code = saas.org_code and 'null'= '{saasid}';");
 //           StringBuilder sql = new StringBuilder("SELECT tree.* FROM base_org base , org_tree tree WHERE base.`code` = tree.code ");
            orgList = jdbcTemplate.query(sql.toString().replace("{saasid}","null"),new BeanPropertyRowMapper(OrgTree.class));
        }
        if(!StringUtils.isEmpty(userId)){// 用户不为空表示修改,需要筛选出用户已经选择过的机构,设置checked为true
            Set<String> codeSet = baseOrgUserService.findorgCodeListByUserId(userId);
            orgList.forEach( one -> {
                if(codeSet.contains(one.getCode())){
                    one.setChecked(true);
                }
            });
        }
        if(!CollectionUtils.isEmpty(orgList)){
            String tree = orgTreeService.makeTree(orgList,false,true);
            result.put("msg",objectMapper.readValue(tree,JSONArray.class));
        }else{
            result.put("msg",orgList);
        }
        result.put("response", ConstantUtils.SUCCESS);
        return result;
    }
    /**
     * 用户修改密码
     * @param userId
@ -620,6 +653,32 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        return result;
    }
    /**
     * 生效或失效单个用户
     * @param userId
     * @param lock
     * @return
     */
    public JSONObject enableOrDisable(String userId,boolean lock){
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(userId) || StringUtils.isEmpty(lock)){
            result.put("msg","parameter id or del is null");
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        UserDO user = userDao.findOne(userId);
        if( null == user ){
            result.put("msg","user not exist for id:" + userId);
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        user.setEnabled(lock);
        this.save(user);
        result.put("response",ConstantUtils.SUCCESS);
        return result;
    }
    /**
     * 用户信息列表
     * @param name

+ 12 - 0
svr/svr-base/src/main/resources/application.yml

@ -209,6 +209,12 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040
  flag: false
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
pay:
  flag: false
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
@ -435,6 +441,12 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040
  flag: false
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
pay:
  flag: false
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 1

+ 9 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java

@ -1,19 +1,19 @@
package com.yihu.jw.hospital.endpoint.Xzyy;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by Trick on 2020/1/19.
 */
@ -107,7 +107,7 @@ public class XzyyController extends EnvelopRestEndpoint {
     */
    @GetMapping(value = "/getOriginPrescriptionList")
    @ApiOperation(value = "获取门诊下所有处方信息", notes = "获取门诊下所有处方信息")
    public ObjEnvelop getOriginPrescriptionList(@ApiParam(name = "registerSn", value = "流水号", required = false)
    public MixEnvelop getOriginPrescriptionList(@ApiParam(name = "registerSn", value = "流水号", required = false)
                                                @RequestParam(value = "registerSn",required = false)String registerSn,
                                                @ApiParam(name = "patNo", value = "病人id", required = false)
                                                @RequestParam(value = "patNo",required = false)String patNo,
@ -115,7 +115,10 @@ public class XzyyController extends EnvelopRestEndpoint {
                                                @RequestParam(value = "admNo",required = false)String admNo,
                                                @ApiParam(name = "realOrder", value = "处方号", required = false)
                                                @RequestParam(value = "realOrder",required = false)String realOrder)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.selectPrescriptionList(registerSn,patNo,admNo,realOrder,null,null));
        MixEnvelop envelop = new MixEnvelop();
        List<WlyyPrescriptionVO> list = xzzxEntranceService.selectPrescriptionList(registerSn,patNo,admNo,realOrder,null,null);
        envelop.setDetailModelList(list);
        return envelop;
    }

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

@ -1150,7 +1150,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                        consult.put("session_id", consult.get("patientId").toString()+"_"+ consult.get("doctorCode").toString()+"_1");
                    }else if(15 == consultType){//家医求助
                        consult.put("session_id", consult.get("patientId").toString()+"_"+ consult.get("generalDoctor").toString()+"_"+ consult.get("doctorCode").toString()+"_15");
                    }else{}
                    }else if (17==consultType){//视频咨询
                        consult.put("session_id", consult.get("patientId").toString()+"_"+ consult.get("doctorCode").toString()+"_17");
                    }
                }else if("9".equals(type)){//图文复诊
                    consult.put("session_id", consult.get("patientId").toString()+"_"+consult.get("outpatientId").toString()+"_9");

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/common/OrgUserService.java

@ -47,7 +47,7 @@ public class OrgUserService {
        if(res.length()==1){
            res +="'";
        }else{
            res = res.substring(0,res.length()-3);
            res = res.substring(0,res.length()-2);
        }
        return res;
    }

+ 23 - 19
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java

@ -234,34 +234,39 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
     * @throws ParseException
     */
    public MixEnvelop<IotDeviceOrderVO, IotDeviceOrderVO> queryPage(Integer page, Integer size, String name) throws ParseException {
        String filters = "";
        String semicolon = "";
        if(StringUtils.isNotBlank(name)){
            filters = "supplierName?"+name+" g1;purchaserName?"+name+" g1";
            semicolon = ";";
        }
        if(StringUtils.isBlank(filters)){
            filters+= semicolon + "del=1";
        }
        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_order c  WHERE c.del=1 ");
        StringBuffer sqlCount = new StringBuffer("SELECT COUNT(c.id) count from iot_device_order c  WHERE c.del=1 ");
        List<Object> args = new ArrayList<>();
        if("company".equals(userAgent.getROLEID())){
            //仅展示本商家的订单数据
            IotCompanyDO companyDO = iotCompanyDao.findByEhrUserId(userAgent.getUID());
            if(companyDO!=null){
                filters+= ";supplier_id="+companyDO.getId();
                sql.append(" and c.supplier_id = ? ");
                sqlCount.append(" and c.supplier_id = '").append(companyDO.getId()).append("'");
                args.add(companyDO.getId());
            }
        }
        if(StringUtils.isNotBlank(name)){
            name = "%"+name+"%";
            sql.append(" and (c.supplier_name like ? or c.purchaser_name like ?)");
            sqlCount.append(" and (c.supplier_name like '").append(name).append("' or c.purchaser_name like '").append(name).append("')");
            args.add(name);
            args.add(name);
        }
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            filters += " ;purchaseUnitCode ="+orgUserService.getUserOrg2(orgList);
            sql.append(" and c.purchase_unit_code in (").append(orgUserService.getUserOrg(orgList)).append(") ");
            sqlCount.append(" and c.purchase_unit_code in (").append(orgUserService.getUserOrg(orgList)).append(") ");
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        String sorts = "-updateTime";
        //得到list数据
        List<IotDeviceOrderDO> list = search(null, filters, sorts, page, size);
        //获取总数
        long count = getCount(filters);
        List<IotDeviceOrderDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceOrderDO.class));
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
        //DO转VO
        List<IotDeviceOrderVO> iotDeviceOrderVOList = new ArrayList<>();
@ -326,9 +331,8 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql.append(" and c.purchase_unit_code in (?) ");
            sql.append(" and c.purchase_unit_code in(").append(orgUserService.getUserOrg(orgList)).append(") ");
            sqlCount.append(" and c.purchase_unit_code in(").append(orgUserService.getUserOrg(orgList)).append(") ");
            args.add(orgUserService.getUserOrg(orgList));
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);

+ 43 - 27
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -218,56 +218,72 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
     * @return
     */
    public MixEnvelop<IotDeviceVO, IotDeviceVO> queryPage(String sn, String hospital, String hospitalName,String orderId, String purcharseId, String productId, String name, String categoryCode, String manufacturerId, Integer page, Integer size) throws Exception{
        String filters = "del=1;";
        String semicolon = "";
        StringBuffer sql = new StringBuffer("SELECT DISTINCT c.* from iot_device c  WHERE c.del=1 ");
        StringBuffer sqlCount = new StringBuffer("SELECT COUNT(DISTINCT c.id) count from iot_device c  WHERE c.del=1 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(orderId)){
            filters += semicolon +"orderId="+orderId;
            semicolon = ";";
            sql.append(" and c.order_id = ? ");
            sqlCount.append(" and c.order_id = '").append(orderId).append("'");
            args.add(orderId);
        }
        if(StringUtils.isNotBlank(purcharseId)){
            filters += semicolon +"purchaseId="+purcharseId;
            semicolon = ";";
            sql.append(" and c.purchase_id = ? ");
            sqlCount.append(" and c.purchase_id = '").append(purcharseId).append("'");
            args.add(purcharseId);
        }
        if(StringUtils.isNotBlank(hospital)){
            filters += semicolon +"hospital="+hospital;
            semicolon = ";";
            sql.append(" and c.hospital = ? ");
            sqlCount.append(" and c.hospital = '").append(hospital).append("'");
            args.add(hospital);
        }
        if(StringUtils.isNotBlank(sn)){
            filters += semicolon + "deviceSn?"+sn+" g1;simNo?" + sn + " g1";
            semicolon = ";";
            sn = "%"+sn+"%";
            sql.append(" and (c.device_sn like ? or c.sim_no like ?)");
            sqlCount.append(" and (c.device_sn like '").append(sn).append("' or c.sim_no like '").append(sn).append("')");
            args.add(sn);
            args.add(sn);
        }
        if(StringUtils.isNotBlank(productId)){
            filters += semicolon +"productId="+productId;
            semicolon = ";";
            sql.append(" and c.product_id = ? ");
            sqlCount.append(" and c.product_id = '").append(productId).append("'");
            args.add(productId);
        }
        if(StringUtils.isNotBlank(name)){
            filters += semicolon + "name?"+name+"";
            semicolon = ";";
            name = "%"+name+"%";
            sql.append(" and c.name like ?");
            sqlCount.append(" and c.name like '").append(name).append("'");
            args.add(name);
        }
        if(StringUtils.isNotBlank(categoryCode)){
            filters += semicolon +"categoryCode="+categoryCode;
            semicolon = ";";
            sql.append(" and c.category_code = ? ");
            sqlCount.append(" and c.category_code = '").append(categoryCode).append("'");
            args.add(categoryCode);
        }
        if(StringUtils.isNotBlank(manufacturerId)){
            filters += semicolon +"manufacturerId="+manufacturerId;
            semicolon = ";";
            sql.append(" and c.manufacturer_id = ? ");
            sqlCount.append(" and c.manufacturer_id = '").append(manufacturerId).append("'");
            args.add(manufacturerId);
        }
        if(StringUtils.isNotBlank(hospitalName)){
            filters += semicolon + "hospitalName?"+hospitalName+"";
            semicolon = ";";
            hospitalName = "%"+hospitalName+"%";
            sql.append(" and c.hospital_name like ?");
            sqlCount.append(" and c.hospital_name like '").append(hospitalName).append("'");
            args.add(hospitalName);
        }
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            filters +=  semicolon +" hospital ="+orgUserService.getUserOrg2(orgList);
            semicolon = ";";
            sql.append(" and c.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
            sqlCount.append(" and c.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
        }
        String sorts = "-updateTime";
        //得到list数据
        List<IotDeviceDO> list = search(null, filters, sorts, page, size);
        //获取总数
        long count = getCount(filters);
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceDO.class));
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
        //DO转VO
        List<IotDeviceVO> iotDeviceVOList = convertToModels(list,new ArrayList<>(list.size()),IotDeviceVO.class);

+ 4 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java

@ -126,10 +126,10 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
//        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_sim c WHERE del=0 ");
        StringBuffer sql = new StringBuffer("SELECT c.* FROM " +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name,d.hospital   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " WHERE  c.del=0 ");
        StringBuffer sqlCount = new StringBuffer("SELECT  COUNT(c.id) count FROM " +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " (SELECT c.*,d.patient_name,d.mobile,w.device_sn sn,w.name,d.hospital   FROM iot_device_sim c LEFT JOIN iot_patient_device d ON c.del=0 AND d.del=1 AND c.sim=d.sim LEFT JOIN iot_device w ON c.del = 0 AND w.del = 1 AND c.sim=w.sim_no) c" +
                " WHERE  c.del=0 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(status)){
@ -149,8 +149,8 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql.append(" and d.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
            sqlCount.append(" and d.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
            sql.append(" and c.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
            sqlCount.append(" and c.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
        }
        sql.append(" order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceTransfersService.java

@ -56,7 +56,7 @@ public class IotDeviceTransfersService extends BaseJpaService<IotDeviceTransfers
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql += " and d.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
            sql += " and t.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
        }
        sql += "ORDER BY t.update_time desc ";

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

@ -53,7 +53,7 @@ public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospita
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql += " h.hospital in ("+orgUserService.getUserOrg(orgList)+")";
            sql += " and h.saas_id in ("+orgUserService.getUserOrg(orgList)+")";
        }
        if(page != null && pageSize != null){