Browse Source

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

wangzhinan 5 years ago
parent
commit
1bbcc3ca75

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

@ -970,22 +970,22 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        List<Map<String,Object>>  data = imService.doctorUpcomingList(doctorCode, type);
        if (data != null) {
            for (Map<String,Object> consult : data) {
                Integer consultType =  Integer.parseInt(consult.get("type").toString());
                if("1,15".equals(consultType)){//专家咨询
                if("1,15".equals(type)){//专家咨询
                    Integer consultType =  Integer.parseInt(consult.get("type").toString());
                    if(1 == consultType){//专家咨询
                        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("9".equals(consultType)){//图文复诊
                }else if("9".equals(type)){//图文复诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_9");
                    consult.put("type",consultType);
                }else if("16".equals(consultType)){//视频复诊
                    consult.put("type",type);
                }else if("16".equals(type)){//视频复诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_16");
                    consult.put("type",consultType);
                    consult.put("type",type);
                }else if("12".equals(type)){//协同门诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_12");
                    consult.put("type",consultType);
                    consult.put("type",type);
                }else{}
            
                array.add(consult);

+ 3 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/workType/IotWorkTypeController.java

@ -32,8 +32,8 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
                                                           @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotWorkTypeService.addType(json);
            return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_add);
            return iotWorkTypeService.addType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
@ -48,8 +48,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
                                                            @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotWorkTypeService.editType(json);
            return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_edit);
           return iotWorkTypeService.editType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/workType/IotWorkTypeDao.java

@ -18,5 +18,5 @@ public interface IotWorkTypeDao extends PagingAndSortingRepository<IotWorkTypeDO
    IotWorkTypeDO findById(String id);
    @Query("from IotWorkTypeDO w where w.name=?1 and w.del=0")
    List<IotWorkTypeDO> findByName(String name);
    IotWorkTypeDO findByName(String name);
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -288,7 +288,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        //判断账户是否重复
        IotCompanyDO account = iotCompanyDao.findByEhrUserId(userAgent.getUID());
        if (account==null){
        if (account!=null){
            return MixEnvelop.getSuccess("账户已注册",-1);
        }

+ 2 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOverhaulService.java

@ -6,6 +6,7 @@ import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@ -15,6 +16,7 @@ import java.util.List;
 * create by hmf on 2020.5.7
 */
@Service
@Transactional
public class IotDeviceOverhaulService extends BaseJpaService<IotDeviceOverhaulDO, IotDeviceOverhaulDao> {
    @Autowired
    private IotDeviceOverhaulDao deviceOverhaulDao;

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

@ -58,7 +58,7 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
    @Autowired
    private HttpClientUtil httpClientUtil;
    private final static String jobUrl = "http://localhost:10031/job/reStartById?taskId=data_sim_Balance_remind_job";
    private final static String jobUrl = "http://172.26.0.109:10031/job/reStartById?taskId=data_sim_Balance_remind_job";
    /**
     * 增加SIM卡管理
@ -122,11 +122,15 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
     */
    public MixEnvelop<IotDeviceSimDO, IotDeviceSimDO> conditionQueryPage(Integer page, Integer size, String status, String sim, String sn){
        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_sim c WHERE del=0 ");
        StringBuffer sqlCount = new StringBuffer("SELECT COUNT(c.id) count from iot_device_sim c  WHERE del=0 ");
//        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_sim c WHERE del=0 ");
        StringBuffer sql = new StringBuffer("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 ");
        StringBuffer sqlCount = new StringBuffer("SELECT  COUNT(c.id) count  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 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(status)){
            sql.append(" and c.status=? ");
            sql.append(" and c.status=").append(status);
            sqlCount.append("and c.status='").append(status).append("' ");
            args.add(status);
        }
@ -140,7 +144,30 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceSimDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceSimDO.class));
//        List<IotDeviceSimDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceSimDO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql.toString());
        ArrayList<IotDeviceSimDO> list = new ArrayList<>();
        mapList.forEach(one->{
            IotDeviceSimDO iotDeviceSimDO = JSONObject.parseObject(JSONObject.toJSONString(one), IotDeviceSimDO.class);
            if (one.get("patient_name")!=null){
                iotDeviceSimDO.setContactsName(one.get("patient_name").toString());
            }
            if (one.get("mobile")!=null){
                iotDeviceSimDO.setContactsMobile(one.get("mobile").toString());
            }
            if (one.get("sn")!=null){
                iotDeviceSimDO.setDeviceSn(one.get("sn").toString());
            }
            if (one.get("name")!=null){
                iotDeviceSimDO.setDeviceName(one.get("name").toString());
            }
            //更新表中数据
            iotDeviceSimDao.save(iotDeviceSimDO);
            list.add(iotDeviceSimDO);
        });
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());

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

@ -77,7 +77,7 @@ public class MonitorPlatformService  {
                    jsonObject.put("page",page);
                    jsonObject.put("size",size);
                    List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                    figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                    //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                    envelop.getDetailModelList().addAll(locationDataVOList);
                }
            }
@ -98,8 +98,8 @@ public class MonitorPlatformService  {
            jsonObject.put("page",page);
            jsonObject.put("size",size);
            List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
            figureLabelSerachService.getFigureLabelByList(locationDataVOList);
            //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
            envelop.getDetailModelList().addAll(locationDataVOList);
            envelop.setTotalCount(iotPatientDeviceService.getESCount(jsonObject.toString()));
            return envelop;
        }

+ 18 - 7
svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java

@ -34,10 +34,15 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     * 增加业务类型
     * @param json
     */
    public void addType(String json) {
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> addType(String json) {
        IotWorkTypeDO iotWorkTypeDO = JSONObject.parseObject(json, IotWorkTypeDO.class);
        IotWorkTypeDO workTypeDO = iotWorkTypeDao.findByName(iotWorkTypeDO.getName());
        if (workTypeDO!=null){
            return MixEnvelop.getError("该业务类型已存在");
        }
        iotWorkTypeDO.setDel("0");
        iotWorkTypeDao.save(iotWorkTypeDO);
        return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_add);
    }
@ -45,14 +50,18 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     * 编辑业务类型
     * @param json
     */
    public void editType(String json) {
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> editType(String json) {
        IotWorkTypeDO newType = JSONObject.parseObject(json, IotWorkTypeDO.class);
        IotWorkTypeDO old = iotWorkTypeDao.findOne(newType.getId());
        IotWorkTypeDO workTypeDO = iotWorkTypeDao.findByName(newType.getName());
        if (workTypeDO!=null&&(workTypeDO.getId().equalsIgnoreCase(newType.getId())==false)){
            return MixEnvelop.getError("该业务类型已存在");
        }
        old.setName(newType.getName());
        old.setExplanation(newType.getExplanation());
        old.setDel("0");
        old.setId(old.getId());
        iotWorkTypeDao.save(old);
        return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_edit);
    }
    /**
@ -62,7 +71,7 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> deleteType(String id) {
        IotWorkTypeDO type = iotWorkTypeDao.findOne(id);
        if(type.getDel().equalsIgnoreCase("1")){
            return MixEnvelop.getError("该企业已删除,请勿重复删除");
            return MixEnvelop.getError("该业务类型已删除,请勿重复删除");
        }
        type.setDel("1");
        iotWorkTypeDao.save(type);
@ -83,7 +92,7 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
    /**
     * 分页查询日志信息
     * 分页查询
     * @param page
     * @param size
     * @return
@ -91,9 +100,11 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     */
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> findAll(Integer page, Integer size) throws ParseException {
        String sql = "select * from iot_work_type w where w.del=0;";
        StringBuffer sql = new StringBuffer("select * from iot_work_type w where w.del=0 ") ;
        sql.append("order by w.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(IotWorkTypeDO.class));
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        long count =list.size();

+ 2 - 2
svr/svr-iot/src/main/resources/application.yml

@ -194,9 +194,9 @@ spring:
    password: jkzlehr@123
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 10.90.32.2:20010,10.90.32.2:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.2:20011,10.90.32.2:20011 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://10.90.32.2:20009,http://10.90.32.2:20011
      uris: http://10.90.32.2:20011,http://10.90.32.2:20012
  wlyy:
    url: http://www.xmtyw.cn/wlyytest/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62

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

@ -95,5 +95,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      uri: ${wlyy.pring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}