Selaa lähdekoodia

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

humingfen 5 vuotta sitten
vanhempi
commit
225eb15d32

+ 51 - 12
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -3,8 +3,6 @@ package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.webkit.dom.CSSStyleRuleImpl;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -29,15 +27,11 @@ import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
@ -46,7 +40,6 @@ import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -56,7 +49,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.*;
/**
@ -131,6 +123,9 @@ public class YkyyEntranceService {
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    
    @Autowired
    private YkyyService ykyyService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -1524,7 +1519,51 @@ public class YkyyEntranceService {
        }
        return response1.getContent();
    }
    
    /**
     * 眼科通App消息推送接口
     * @param doctor
     * @param patient
     * @param orderType
     * @return
     */
    public String sendMesToYkt(String doctor, String patient, String orderType) throws Exception {
    
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String yktDoctor ="";
        if (doctorMappingDO!=null&&StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())){
            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
            JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
            if (jsonObject.getInteger("code")==200){
                JSONArray array1 = jsonObject.getJSONArray("data");
                if (array1!=null&&array1.size()!=0){
                    yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
                }
            }
        }else {
            throw new Exception("医生映射表不存在!");
        }
        
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        
        if(basePatientDO!=null){
            patient = basePatientDO.getUserId();
        }
        
        Map<String,Object> params = new HashedMap();
        params.put("doctorId",yktDoctor);
        params.put("patientId",patient);
        params.put("orderType",orderType);
        HttpResponse response = HttpUtils.doPost("http://www.yanketong.com:90/api/share/PushNotificationToDoctor",params);
    
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("code");
        if(status!=null&&status == 10000){
            return rs.getString("message");//推送失败原因
        }else{
            return "推送成功";
        }
    }
}

+ 0 - 74
common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyUserDO.java

@ -1,74 +0,0 @@
package com.yihu.jw.entity.iot.company;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/5/12
 */
@Entity
@Table(name = "iot_company_user")
public class IotCompanyUserDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "account")
    private String account;//账户
    @Column(name = "company_name")
    private String companyName;//公司名称
    @Column(name = "company_id")
    private String companyId;//企业id
    @Column(name = "del")
    private String del;//是否删除:1:删除 0:不删除',
    @Column(name = "company_status")
    private String companyStatus;//企业状态:0:待审核 1:通过 2:拒绝 3:未入驻',
    public String getAccount() {
        return account;
    }
    public void setAccount(String account) {
        this.account = account;
    }
    public String getCompanyName() {
        return companyName;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getCompanyId() {
        return companyId;
    }
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    public String getCompanyStatus() {
        return companyStatus;
    }
    public void setCompanyStatus(String companyStatus) {
        this.companyStatus = companyStatus;
    }
}

+ 1 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -81,8 +81,8 @@ public class IotRequestMapping {
        public static final String findAll = "findAll";
        public static final String enterType = "enterType";
        public static final String conditionQueryPage = "conditionQueryPage";
        public static final String saveUser = "saveUser";
        public static final String findUserCompanyStatus = "findUserCompanyStatus";
        public static final String findCompanyByAccount = "findCompanyByAccount";
        public static final String findCompanyCertPage = "findCompanyCertPage";
        public static final String findCompanyCertById = "findCompanyCertById";

+ 2 - 5
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -20,10 +20,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.Date;
@ -219,6 +216,6 @@ public class YkyyController extends EnvelopRestEndpoint {
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1"));//图文复诊数量
        return success("请求成功",result);
    }
    
    
}

+ 13 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -413,4 +413,17 @@ public class YkyyController extends EnvelopRestEndpoint {
        wxTemplateService.sendWxTemple(userName,senderName,idCard,phone,title,content,contentString,url);
        return success("操作成功");
    }
    
    
    @PostMapping(value = "/sendMesToYkt")
    @ApiOperation(value = "眼科通App消息推送接口")
    public Envelop sendMesToYkt(
            @ApiParam(name = "doctor", value = "医生code", required = true)
            @RequestParam(value = "doctor")String doctor,
            @ApiParam(name = "patient", value = "居民code", required = true)
            @RequestParam(value = "patient")String patient,
            @ApiParam(name = "orderType", value = "订单类型(1图文、2电话 3视频)", required = true)
            @RequestParam(value = "orderType")String orderType) throws Exception{
        return success(ykyyEntranceService.sendMesToYkt(doctor,patient,orderType));
    }
}

+ 5 - 25
svr/svr-iot/src/main/java/com/yihu/iot/controller/company/IotCompanyController.java

@ -2,11 +2,9 @@ package com.yihu.iot.controller.company;
import com.yihu.iot.service.company.IotCompanyCertificateService;
import com.yihu.iot.service.company.IotCompanyService;
import com.yihu.iot.service.company.IotCompanyUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.IotCompanyCertificateDO;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.company.IotCompanyUserDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.iot.company.IotCompanyCertificateVO;
@ -14,15 +12,10 @@ import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.recycler.Recycler;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -41,8 +34,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
    @Autowired
    private IotCompanyCertificateService iotCompanyCertificateService;
    @Autowired
    private IotCompanyUserService iotCompanyUserService;
    @Autowired
    private UserAgent userAgent;
@ -343,25 +335,14 @@ public class IotCompanyController extends EnvelopRestEndpoint {
    }
    @GetMapping(value = IotRequestMapping.Company.saveUser)
    @ApiOperation(value = "保存用户信息", notes = "保存用户信息")
    public MixEnvelop<IotCompanyUserDO,IotCompanyUserDO>saveUser(){
        try{
            return  iotCompanyUserService.saveUser();
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findUserCompanyStatus)
    @ApiOperation(value = "获取用户企业状态", notes = "获取用户企业状态")
    public MixEnvelop<IotCompanyUserDO,IotCompanyUserDO>findUserCompanyStatus(){
    @GetMapping(value = IotRequestMapping.Company.findCompanyByAccount)
    @ApiOperation(value = "根据账号查询企业状态", notes = "根据账号查询企业状态")
    public MixEnvelop<IotCompanyVO,IotCompanyVO>findCompanyByAccount(){
        try{
            return  iotCompanyUserService.findUserCompanyStatus();
            return  iotCompanyService.findCompanyByAccount();
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
@ -369,5 +350,4 @@ public class IotCompanyController extends EnvelopRestEndpoint {
    }
}

+ 24 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -282,4 +282,28 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @PostMapping(value = IotRequestMapping.Platform.findInterfaceLog)
    @ApiOperation(value = "根据接口名称分页查询接口日志信息", notes = "根据接口名称分页查询接口日志信息")
    public MixEnvelop<IotInterfaceLogVO, IotInterfaceLogVO> findInterfaceLog(@ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                                 @RequestParam(value = "page", required = false) Integer page,
                                                                             @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                                 @RequestParam(value = "size", required = false) Integer size,
                                                                             @ApiParam(name = "interfaceName", value = "接口名称", defaultValue = "")
                                                                                 @RequestParam(value = "interfaceName") String interfaceName) {
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, iotInterfaceLogService.findInterfaceLog(page,size,interfaceName));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 2 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyAppDao.java

@ -22,4 +22,6 @@ public interface IotCompanyAppDao extends PagingAndSortingRepository<IotCompanyA
        @Query("from IotCompanyAppDO w where w.id =?1 and w.del=1")
        IotCompanyAppDO findById(String appId);
        }

+ 3 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyDao.java

@ -25,4 +25,7 @@ public interface IotCompanyDao extends PagingAndSortingRepository<IotCompanyDO,
    @Query("from IotCompanyDO w where w.enterType =?1 and w.status=1 and w.del=1")
    List<IotCompanyDO> findByEnterType(String entryType);
    IotCompanyDO findByAccount(String account);
}

+ 0 - 23
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyUserDao.java

@ -1,23 +0,0 @@
package com.yihu.iot.dao.company;
import com.yihu.jw.entity.iot.company.IotCompanyTypeDO;
import com.yihu.jw.entity.iot.company.IotCompanyUserDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/5/12
 */
public interface IotCompanyUserDao extends PagingAndSortingRepository<IotCompanyUserDO, String>,
        JpaSpecificationExecutor<IotCompanyUserDO> {
    @Query("FROM IotCompanyUserDO w WHERE w.account=?1 and w.del=0")
    IotCompanyUserDO findByAccount(String s);
    @Query("FROM IotCompanyUserDO w WHERE w.companyId=?1 and w.del=0")
    IotCompanyUserDO findByCompanyId(String id);
}

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

@ -40,8 +40,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
    private IotCompanyAppDao iotCompanyAppDao;
    @Autowired
    private UserAgent userAgent;
    @Autowired
    private IotCompanyUserDao iotCompanyUserDao;
    /**
@ -368,11 +367,8 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
            iotCompanyAppDao.save(iotCompanyAppDO);
        }
        IotCompanyUserDO userDO = iotCompanyUserDao.findByAccount(userAgent.getUNAME());
        userDO.setCompanyName(iotCompany.getName());
        userDO.setCompanyId(iotCompany.getId());
        userDO.setCompanyStatus(iotCompany.getStatus());
        iotCompanyUserDao.save(userDO);
        iotCompany.setAccount(userAgent.getUNAME());
        iotCompany.setEhrUserId(userAgent.getUID());
        return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create,iotCompany);
    }
@ -606,10 +602,6 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        companyDO.setAuditName(uname);
        iotCompanyDao.save(companyDO);
        IotCompanyUserDO userDO = iotCompanyUserDao.findByCompanyId(id);
        userDO.setCompanyStatus(companyDO.getStatus());
        iotCompanyUserDao.save(userDO);
        return MixEnvelop.getSuccess("审核操作成功");
    }
@ -634,9 +626,6 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        companyDO.setAuditName(uname);
        iotCompanyDao.save(companyDO);
        IotCompanyUserDO userDO = iotCompanyUserDao.findByCompanyId(id);
        userDO.setCompanyStatus(companyDO.getStatus());
        iotCompanyUserDao.save(userDO);
        return MixEnvelop.getSuccess("审核操作成功");
    }
@ -679,4 +668,18 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        return iotCompanyDOS;
    }
    /**
     * 根据账号查询企业状态
     * @return
     */
    public MixEnvelop<IotCompanyVO, IotCompanyVO> findCompanyByAccount() {
        IotCompanyDO companyDO = iotCompanyDao.findByAccount(userAgent.getUNAME());
        if (companyDO==null){
            return MixEnvelop.getError("未入驻企业",-1);
        }
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,companyDO.getStatus());
    }
}

+ 0 - 66
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyUserService.java

@ -1,66 +0,0 @@
package com.yihu.iot.service.company;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.company.IotCompanyDao;
import com.yihu.iot.dao.company.IotCompanyUserDao;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.company.IotCompanyUserDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/5/13
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class IotCompanyUserService extends BaseJpaService<IotCompanyUserDO, IotCompanyUserDao> {
    @Autowired
    private IotCompanyUserDao iotCompanyUserDao;
    @Autowired
    private UserAgent userAgent;
    /**
     * 保存用户信息
     */
    public MixEnvelop<IotCompanyUserDO,IotCompanyUserDO> saveUser() {
        //查找用户是否存在
        IotCompanyUserDO userDO = iotCompanyUserDao.findByAccount(userAgent.getUNAME());
        if (userDO!=null){
            return MixEnvelop.getError("用户已注册",-1);
        }
        IotCompanyUserDO companyUserDO = new IotCompanyUserDO();
        companyUserDO.setAccount(userAgent.getUNAME());
        companyUserDO.setCompanyStatus("3");
        companyUserDO.setDel("0");
        iotCompanyUserDao.save(companyUserDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create);
    }
    /**
     * 查找公司用户的企业状态
     * @return
     */
    public MixEnvelop<IotCompanyUserDO, IotCompanyUserDO> findUserCompanyStatus() {
        IotCompanyUserDO userDO = iotCompanyUserDao.findByAccount(userAgent.getUNAME());
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,userDO.getCompanyStatus());
    }
    public static void main(String[] args) {
        String jsonString = JSONObject.toJSONString("15578008051");
        System.out.println(jsonString);
    }
}

+ 7 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java

@ -229,6 +229,7 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
     * @return
     */
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> queryPage(String status, String orderNo, String startTime, String endTime, Integer page, Integer size){
//        SELECT  b.* FROM (SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ORDER BY c.plan_time DESC ) b GROUP BY b.order_no;
        StringBuffer sql = new StringBuffer("SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ");
        List<Object> args = new ArrayList<>();
@ -248,8 +249,12 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
            sql.append(" and c.plan_time<=? ");
            args.add(endTime);
        }
        sql.append(" GROUP BY c.order_no ORDER BY c.plan_time DESC limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        sql.append(" ORDER BY c.plan_time DESC ");
//    "SELECT  b.* FROM ("+sql+")"+" b GROUP BY b.order_no limit ";
        StringBuffer sql1= new StringBuffer("SELECT  b.* FROM (");
        sql1.append(sql).append(") b GROUP BY b.order_no limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> list = jdbcTempalte.query(sql1.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        long count = list.size();
        //DO转VO