Ver código fonte

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

ysj 5 anos atrás
pai
commit
3c7e6baaaa
90 arquivos alterados com 845 adições e 171 exclusões
  1. 2 2
      app/public-health-server/src/main/java/com/yihu/health/security/core/EhrWebAuthenticationProvider.java
  2. 2 2
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java
  3. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java
  4. 21 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java
  5. 6 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java
  6. 206 15
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  7. 39 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  8. 136 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  9. 1 1
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxTemplateDao.java
  10. 69 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionCheckDO.java
  11. 10 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java
  13. 3 3
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/RoleVO.java
  14. 19 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/dict/IotSystemDictVO.java
  15. 0 19
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/MixEnvelop.java
  16. 1 1
      gateway/ag-basic/src/main/resources/application.yml
  17. 1 1
      gateway/ag-basic/src/main/resources/bootstrap.yml
  18. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  19. 1 1
      server/svr-configuration/src/main/resources/bootstrap.yml
  20. 1 1
      svr/figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/FigureLabelJpa.java
  21. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDoctorDutyDao.java
  22. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictHospitalDeptDao.java
  23. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java
  24. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleDao.java
  25. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/function/FunctionDao.java
  26. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgDao.java
  27. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasDefaultModuleFunctionDao.java
  28. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasModuleFunctionDao.java
  29. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/version/AppVersionDao.java
  30. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxGraphicMessageDao.java
  31. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/function/FunctionService.java
  32. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientFamilyMemberService.java
  33. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasDefaultModuleFunctionService.java
  34. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasModuleFunctionService.java
  35. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/version/AppVersionService.java
  36. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxAccessTokenService.java
  37. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxGraphicMessageService.java
  38. 5 5
      svr/svr-base/src/main/resources/application.yml
  39. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  40. 1 1
      svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/config/jpa/WlyyHouseJpa.java
  41. 1 1
      svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/facility/FacilityServerRelationDao.java
  42. 1 1
      svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/user/FacilityUsedRecordDao.java
  43. 5 1
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java
  44. 4 3
      svr/svr-internet-hospital-entrance/src/main/resources/application.yml
  45. 10 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java
  46. 109 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  47. 25 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java
  48. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceDao.java
  49. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceQualityInspectionPlanDao.java
  50. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceSimDao.java
  51. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotPatientDeviceDao.java
  52. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotSystemDictDao.java
  53. 1 2
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/DeviceQualityPlanService.java
  54. 3 14
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotDeviceQualityInspectionPlanService.java
  55. 5 5
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotDeviceSimService.java
  56. 2 3
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/SimBalanceService.java
  57. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/SimSetMealService.java
  58. 2 4
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotSystemDictService.java
  59. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  60. 1 1
      svr/svr-iot/readme.MD
  61. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/config/jpa/IotJpa.java
  62. 16 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java
  63. 5 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceInventoryController.java
  64. 1 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceSimController.java
  65. 3 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java
  66. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/iotMessage/IotMessageController.java
  67. 3 4
      svr/svr-iot/src/main/java/com/yihu/iot/controller/workType/IotWorkTypeController.java
  68. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/workType/IotWorkTypeDao.java
  69. 10 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java
  70. 7 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceInventoryService.java
  71. 6 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java
  72. 2 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java
  73. 4 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  74. 16 4
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotSystemDictService.java
  75. 7 11
      svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java
  76. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java
  77. 17 6
      svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java
  78. 1 1
      svr/svr-statistics/src/main/java/com/yihu/wlyy/statistics/config/jpa/WlyyJpa.java
  79. 1 1
      svr/svr-wlyy-archives/src/main/java/com/yihu/jw/config/jpa/WlyyArchivesJpa.java
  80. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/AccountDao.java
  81. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/ActiveRecordDao.java
  82. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/ExchangeGoodsDao.java
  83. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskDao.java
  84. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskGoodsDao.java
  85. 1 1
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskRuleDao.java
  86. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelDao.java
  87. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelInfoDao.java
  88. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistArticleDao.java
  89. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistConsultDao.java
  90. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistDao.java

+ 2 - 2
app/public-health-server/src/main/java/com/yihu/health/security/core/EhrWebAuthenticationProvider.java

@ -157,8 +157,8 @@ public class EhrWebAuthenticationProvider extends AbstractUserDetailsAuthenticat
//import org.springframework.security.authentication.BadCredentialsException;
//import org.springframework.security.authentication.InternalAuthenticationServiceException;
//import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
//import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
//import org.springframework.security.authentication.dao.SaltSource;
//import org.springframework.security.authentication.dict.AbstractUserDetailsAuthenticationProvider;
//import org.springframework.security.authentication.dict.SaltSource;
//import org.springframework.security.authentication.encoding.PasswordEncoder;
//import org.springframework.security.authentication.encoding.PlaintextPasswordEncoder;
//import org.springframework.security.core.AuthenticationException;

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -1,8 +1,8 @@
//package com.yihu.jw.doctor.service;
//
//import com.alibaba.fastjson.JSON;
//import com.yihu.jw.doctor.dao.BaseDoctorDao;
//import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
//import com.yihu.jw.doctor.dict.BaseDoctorDao;
//import com.yihu.jw.doctor.dict.DoctorSpecialDiseaseDao;
//import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
//import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
//import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java

@ -13,4 +13,6 @@ public interface PatientMappingDao extends PagingAndSortingRepository<PatientMap
    PatientMappingDO findByMappingCodeAndSource(String mappingCode,String source);
    PatientMappingDO findByPatient(String patient);
    PatientMappingDO findByMappingCode(String mappingCode);
}

+ 21 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionCheckDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by wangzhinan on 2020/5/18
 */
public interface PrescriptionCheckDao extends PagingAndSortingRepository<WlyyPrescriptionCheckDO, String>, JpaSpecificationExecutor<WlyyPrescriptionCheckDO> {
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByPrescriptionId(String prescriptionId);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java

@ -2,9 +2,11 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -16,4 +18,8 @@ public interface PrescriptionExpressageDao extends PagingAndSortingRepository<Wl
    WlyyPrescriptionExpressageDO findByPrescriptionExpressMailno(String mailno);
    List<WlyyPrescriptionExpressageDO> findByOutpatientId(String outpatientId);
    @Modifying
    @Query("update WlyyPrescriptionExpressageDO p set p.mailno=?2  where p.id=?1")
    void updateMailNoById(String id, String mailno);
}

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

@ -54,6 +54,7 @@ import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
@ -179,6 +180,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private YkyyService ykyyService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private PrescriptionCheckDao prescriptionCheckDao;
    @Value("${demo.flag}")
@ -2292,7 +2295,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size) {
    public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size,String wxId) {
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " FROM " +
@ -2305,18 +2308,28 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            totalSql += " AND p.status in(" + status + ")";
        }
        if (StringUtils.isNotBlank(oneselfPickupFlg)) {
            totalSql += " AND e.oneself_pickup_flg =" + oneselfPickupFlg;
            totalSql += " AND e.oneself_pickup_flg = " + oneselfPickupFlg;
        }
        if (StringUtils.isNotBlank(nameKey)) {
            totalSql += " AND e.name like '%" + nameKey + "%'";
        }
        if (StringUtils.isNotBlank(startTime)) {
            totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotBlank(endTime)) {
            totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            }
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
@ -2347,14 +2360,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql += " AND e.name like '%" + nameKey + "%'";
        }
        if (StringUtils.isNotBlank(startTime)) {
            sql += " AND e.create_time >='" + startTime + " 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotBlank(endTime)) {
            sql += " AND e.create_time <='" + endTime + " 23:59:59'";
        }
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            }
        sql += " LIMIT " + (page - 1) * size + "," + size + "";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        }
 /*       sql += " LIMIT " + (page - 1) * size + "," + size + "";*/
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql,page,size);
        for (Map<String,Object> map:list){
            List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(map.get("prescriptionId").toString());
            map.put("info",wlyyPrescriptionInfoDOS);
        }
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
@ -4176,7 +4202,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param realOrder 处方号
     * @return
     */
    public Object getSFExpressInfo(String admNo,String realOrder)throws Exception {
    public Object getSFExpressInfo(String admNo,String realOrder,String wxId)throws Exception {
    
        //根据门诊唯一号取就诊记录
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
@ -4214,12 +4240,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    sfJsonObject.put("mailno", sfexpress_obj.getMailno());
                    sfJsonObject.put("mailtype", "标准快递");
                    sfJsonObject.put("destcode", "592");
                    sfJsonObject.put("j_name", "厦门大学附属中山医院");
                    if(wxId.equalsIgnoreCase("xm_zsyy_wx")){
                        sfJsonObject.put("j_name", "厦门大学附属中山医院");
                        sfJsonObject.put("j_phone", "4003008888");
                        sfJsonObject.put("j_townName", "思明区");
                        sfJsonObject.put("j_address", "湖滨南路201-209号");
                    }else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                        sfJsonObject.put("j_name", "厦门大学附属中山医院");
                        sfJsonObject.put("j_phone", "4003008888");
                        sfJsonObject.put("j_townName", "思明区");
                        sfJsonObject.put("j_address", "湖滨南路201-209号");
                    }
                    sfJsonObject.put("j_provinceName", "福建省");
                    sfJsonObject.put("j_cityName", "厦门市");
                    sfJsonObject.put("j_townName", "思明区");
                    sfJsonObject.put("j_address", "湖滨南路201-209号");
                    sfJsonObject.put("j_phone", "4003008888");
                    sfJsonObject.put("d_name", sfexpress_obj.getName());
                    sfJsonObject.put("d_provinceName", sfexpress_obj.getProvinceName());
                    sfJsonObject.put("d_cityName", sfexpress_obj.getCityName());
@ -5171,4 +5205,161 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        logger.info(sql);
        return hibenateUtils.createSQLQuery(sql,params,page,pagesize);
    }
    public List<Map<String,Object>> selectByCondition(String hospital, String dept, String status, String startTime, String endTime, String nameInfo, Integer page, Integer pagesize, String wxId){
        List<Map<String,Object>> maps = new ArrayList<>();
        String sql = "SELECT\n" +
                "\tp.doctor as \"doctor\",\n" +
                "\tp.id as \"id\",\n" +
                "\tp.doctor_name as \"doctorName\",\n" +
                "\tp.dept as \"dept\",\n" +
                "\tp.dept_name as \"deptName\",\n" +
                "\tp.hospital as \"hospital\",\n" +
                "\tp.hospital_name as \"hospitalName\",\n" +
                "\tp.patient_code as \"patientCode\",\n" +
                "\tp.patient_name as \"patientName\",\n" +
                "\tp.idcard as \"idcard\",\n" +
                "\tp.ssc as \"ssc\",\n";
        if("xm_ykyy_wx".equals(wxId)){
            sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
        }else{
            sql = sql + "date_format(p.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"createTime\",";
        }
                sql +="\tp.`status` as \"status\"\n" +
                "FROM\n" +
                "\twlyy_prescription P\n" +
                "WHERE\n" +
                "\t1 = 1  ";
        Map<String,Object> params = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)){
            sql +=" and p.hospital =:hospital";
            params.put("hospital",hospital);
        }
        if (StringUtils.isNoneBlank(dept)){
            sql +=" and p.dept =:dept";
            params.put("dept",dept);
        }
        if (StringUtils.isNoneBlank(status)){
            sql +=" and p.status =:status";
            params.put("status",status);
        }
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and p.create_time >=:startTime";
            params.put("startTime",DateUtil.stringToDate(startTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and p.create_time <=:endTime";
            params.put("endTime",DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(nameInfo)){
            sql +=" and (p.patient_name like '%"+nameInfo+"%' or p.doctor_name like '%"+nameInfo+"%')";
        }
        sql +=" order by p.create_time desc";
        List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql,params,page,pagesize);
        String sqlTotal = "select COUNT(1) AS \"total\" from wlyy_prescription p where 1=1  ";
        Map<String,Object> params1 = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)){
            sqlTotal +=" and p.hospital =:hospital";
            params1.put("hospital",hospital);
        }
        if (StringUtils.isNoneBlank(dept)){
            sqlTotal +=" and p.dept =:dept";
            params1.put("dept",dept);
        }
        if (StringUtils.isNoneBlank(status)){
            sqlTotal +=" and p.status =:status";
            params1.put("status",status);
        }
        if (StringUtils.isNoneBlank(startTime)){
            sqlTotal +=" and p.create_time >=:startTime";
            params1.put("startTime",DateUtil.stringToDate(startTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(endTime)){
            sqlTotal +=" and p.create_time <=:endTime";
            params1.put("endTime",DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(nameInfo)){
            sqlTotal +=" and (p.patient_name like '%"+nameInfo+"%' or p.doctor_name like '%"+nameInfo+"%')";
        }
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params1);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        Map<String,Object> map = new HashedMap();
        map.put("count",count);
        map.put("list",mapList);
        maps.add(map);
        return maps;
    }
    /**
     * 修改处方状态
     * @param prescriptionId
     * @param status
     */
    public void updateStatus(String prescriptionId,Integer status){
        prescriptionDao.updateStatus(prescriptionId,status,new Date());
    }
    /**
     *  更改订单号
     *
     * @param id
     * @param mailNo
     */
    public void updateMailNoById(String id,String mailNo){
        prescriptionExpressageDao.updateMailNoById(id,mailNo);
    }
    /**
     * 审方
     * @param operate
     * @param operateName
     * @param reason
     * @param status
     * @param prescriptionId
     * @return
     */
    public WlyyPrescriptionCheckDO saveCheck(String operate,String operateName,String reason,Integer status,String prescriptionId){
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        prescriptionCheckDO.setCreateTime(new Date());
        prescriptionCheckDO.setOperate(operate);
        prescriptionCheckDO.setOperateName(operateName);
        prescriptionCheckDO.setUpdateTime(new Date());
        prescriptionCheckDO.setCreateUser(operate);
        prescriptionCheckDO.setCreateUserName(operateName);
        prescriptionCheckDO.setReason(reason);
        prescriptionCheckDO.setStatus(status);
        prescriptionCheckDO = prescriptionCheckDao.save(prescriptionCheckDO);
        if (status==4){
            prescriptionDao.updateStatus(prescriptionId,12);
        }else{
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
            wlyyPrescriptionDO.setMkTime(new Date());
            wlyyPrescriptionDO.setMkFailReason(reason);
            wlyyPrescriptionDO.setStatus(11);
            prescriptionDao.save(wlyyPrescriptionDO);
        }
        return prescriptionCheckDO;
    }
    /**
     * 查询审批记录
     * @param prescriptionId
     * @return
     */
    public List<WlyyPrescriptionCheckDO> findPrescriptionCheck(String prescriptionId){
        return  prescriptionCheckDao.findByPrescriptionId(prescriptionId);
    }
}

+ 39 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -108,6 +108,45 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    /**
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String realOrder,String admNo,boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        //BS16017(String REGISTER_SN,String realOrder,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
        logger.info("findOriginPrescriptionList: registerSn:"+registerSn+" patient"+patient+" patNo:"+patNo+" realOrder:"+realOrder+" admNo:"+admNo);
        return ykyyEntranceService.findV_MSDD01And02(admNo);
    }
    /**
     * 获取居民就诊记录接口
     * @param patient
     * @return
     * @throws Exception
     */
    public  WlyyOutpatientVO findOutpatientInfo(String patient,String conNo, boolean demoFlag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        logger.info("findOutpatientList patNo "+patNo);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo,conNo,null,null,demoFlag);
        if (wlyyOutpatientVOS!=null&&wlyyOutpatientVOS.size()!=0){
            WlyyOutpatientVO outpatientVO = wlyyOutpatientVOS.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            return outpatientVO;
        }
       return null;
    }
    /**
     * 发起图文和视频复诊
     *

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

@ -34,6 +34,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
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.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
@ -46,6 +47,7 @@ import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +55,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.security.acl.LastOwnerException;
import java.util.*;
/**
@ -201,6 +204,7 @@ public class YkyyEntranceService {
        return "success";
    }
    /**
     * 患者门诊就诊记录
     * 使用时间查询的话,很可能会超时。时间没有索引,所以超时时间需要加长
@ -334,6 +338,138 @@ public class YkyyEntranceService {
        return new JSONArray();
    }
    /**
     * HIS处方记录
     * @throws Exception
     */
    public List<WlyyPrescriptionVO> findV_MSDD01And02(String admNo) throws Exception{
        List<WlyyPrescriptionVO> wlyyPrescriptionVOList = new ArrayList<>();
        //处方数据
        String msd01 = "SELECT\n" +
                "\td.CFSB AS \"cfsb\",\n" +
                "\td.CFHM AS \"cfhm\",\n" +
                "\td.FKZT as \"fkzt\",\n" +
                "\td.CFLX as \"cflx\",\n" +
                "\td.KFRQ as \"kfrq\",\n" +
                "\td.SCDDH as \"scddh\",\n" +
                "\td.BRID as \"brid\",\n" +
                "\td.BRXM as \"brxm\",\n" +
                "\td.KSDM as \"ksdm\",\n" +
                "\td.YSDM as \"ysdm\",\n" +
                "\td.JZXH as \"jzxh\",\n" +
                "\td.GUID as \"guid\",\n" +
                "\td.JZKH as \"jzkh\"\n" +
                "FROM\n" +
                "\tV_MS_DD01 d\n" +
                "WHERE\n" +
                "\td.JZXH = '"+admNo+"'";
        Map<String,Object> params = new HashedMap();
        params.put("sql",msd01);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array =rs.getJSONArray("detailModelList");
            logger.info("precription:"+rs.getJSONArray("detailModelList"));
            for (int j=0;j<array.size();j++){
                WlyyPrescriptionVO wlyyPrescriptionVO = new WlyyPrescriptionVO();
                JSONObject object = array.getJSONObject(j);
                wlyyPrescriptionVO.setType(object.getInteger("cflx"));
                wlyyPrescriptionVO.setOrderNo(object.getString("scddh"));
                wlyyPrescriptionVO.setPayStatus(object.getInteger("fkzt"));
                wlyyPrescriptionVO.setPatientName(object.getString("brxm"));
                String brid = object.getString("brid");
                if (StringUtils.isNoneBlank(brid)){
                    PatientMappingDO mappingDO = patientMappingDao.findByMappingCode(brid);
                    if (mappingDO!=null){
                        wlyyPrescriptionVO.setPatientCode(mappingDO.getPatient());
                    }
                }
                wlyyPrescriptionVO.setSsc(object.getString("jzkh"));
                wlyyPrescriptionVO.setOrderId(object.getString("guid"));
                wlyyPrescriptionVO.setAdmNo(object.getString("jzxh"));
                wlyyPrescriptionVO.setRealOrder(object.getString("cfsb"));
                wlyyPrescriptionVO.setDept(object.getString("ksdm"));
                wlyyPrescriptionVO.setOriginRealOrder(object.getString("cfhm"));
                String msd02 = "SELECT\n" +
                        "\td.CFSB AS \"cfsb\",\n" +
                        "\td.YPXH as \"ypxh\",\n" +
                        "\td.YPCD as \"ypcd\",\n" +
                        "\td.YPSL as \"ypsl\",\n" +
                        "\td.YPDJ as \"ypdj\",\n" +
                        "\td.HJJE as \"hjje\",\n" +
                        "\td.YFDW as \"yfdw\",\n" +
                        "\td.MRCS as \"mrcs\",\n" +
                        "\td.YFBZ as \"yfbz\",\n" +
                        "\td.YPYF as \"ypyf\",\n" +
                        "\td.GYTJ as \"gytj\",\n" +
                        "\td.YCJL as \"ycjl\",\n" +
                        "\td.SBXH as \"sbxh\",\n" +
                        "\td.YFGG as \"yfgg\"\n" +
                        "FROM\n" +
                        "\tV_MS_DD02 d\n" +
                        "WHERE\n" +
                        "\td.cfsb = '"+wlyyPrescriptionVO.getRealOrder()+"'";
                Map<String,Object> params1 = new HashedMap();
                params1.put("sql",msd02);
                HttpResponse response1 = HttpUtils.doGet(url,params1);
                String content1 = response1.getContent();
                logger.info("response:"+content);
                JSONObject rs1 = JSON.parseObject(content1);
                Integer status1 = rs1.getInteger("status");
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                if(status1!=null&&status1 == 200){
                    JSONArray array1 =  rs1.getJSONArray("detailModelList");
                    logger.info("info"+rs1.getJSONArray("detailModelList"));
                    for (int i =0;i<array1.size();i++){
                        JSONObject object1 = array1.getJSONObject(i);
                        WlyyPrescriptionInfoVO prescriptionInfoVO = new WlyyPrescriptionInfoVO();
                        prescriptionInfoVO.setDrugNo(object1.getString("ypxh"));
                        prescriptionInfoVO.setDrugPlace(object1.getString("ypcd"));
                        prescriptionInfoVO.setQuantity(object1.getString("ypsl"));
                        prescriptionInfoVO.setPackRetprice(object1.getDouble("ypdj"));
                        prescriptionInfoVO.setPackUnitName(object1.getString("yfdw"));
                        prescriptionInfoVO.setDosage(object1.getString("mrcs"));
                        prescriptionInfoVO.setPackQuantity(object1.getInteger("yfbz"));
                        prescriptionInfoVO.setUsageCode(object1.getString("ypyf"));
                        prescriptionInfoVO.setYpyf(object1.getInteger("ypyf"));
                        prescriptionInfoVO.setHisCode(object1.getInteger("sbxh"));
                        prescriptionInfoVO.setSpecification(object1.getString("yfgg"));
                        wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                    }
                }
                wlyyPrescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                List<WlyyPrescriptionDiagnosisVO> diagnosisVOS = new ArrayList<>();
                String mz = "SELECT ICD AS \"icd\",MSZD AS \"mszd\",JZXH AS \"jzxh\" FROM v_hlwys_mz_jbzd WHERE jzxh = '"+admNo+"'";
                Map<String,Object> params2 = new HashedMap();
                params2.put("sql",mz);
                HttpResponse response2 = HttpUtils.doGet(url,params2);
                String content2 = response2.getContent();
                logger.info("response:"+content2);
                JSONObject rs2 = JSON.parseObject(content2);
                Integer status2 = rs2.getInteger("status");
                if(status2!=null&&status2 == 200){
                    JSONArray array2 = rs2.getJSONArray("detailModelList");
                    for (int i=0;i<array2.size();i++){
                        JSONObject object2 = array2.getJSONObject(i);
                        WlyyPrescriptionDiagnosisVO diagnosisVO = new WlyyPrescriptionDiagnosisVO();
                        diagnosisVO.setCode(object2.getString("icd"));
                        diagnosisVO.setName(object2.getString("mszd"));
                        diagnosisVOS.add(diagnosisVO);
                    }
                }
                wlyyPrescriptionVO.setDiagnosisVOs(diagnosisVOS);
                wlyyPrescriptionVOList.add(wlyyPrescriptionVO);
            }
        }
        return wlyyPrescriptionVOList;
    }
    public String updateYkyyDoctor()throws Exception{
        String sql ="select y.code AS \"code\",y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard is not null";
        Map<String,Object> params = new HashedMap();

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxTemplateDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.wechat.dao;//package com.yihu.jw.business.wx.dao;
package com.yihu.jw.wechat.dao;//package com.yihu.jw.business.wx.dict;
import com.yihu.jw.entity.base.wx.WxTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 69 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionCheckDO.java

@ -0,0 +1,69 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 在线处方审核
*
* @author wangzhinan 20200518
*
*/
@Entity
@Table(name = "wlyy_prescription_check")
public class WlyyPrescriptionCheckDO extends UuidIdentityEntityWithOperator {
    private String prescriptionId;
    private Integer status;
    private String reason;
    private String operate;
    private String operateName;
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getOperate() {
        return operate;
    }
    public void setOperate(String operate) {
        this.operate = operate;
    }
    public String getOperateName() {
        return operateName;
    }
    public void setOperateName(String operateName) {
        this.operateName = operateName;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 10 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -387,6 +387,16 @@ public class BaseHospitalRequestMapping {
        public static final String selectOrderStatus="/selectOrderStatus";
        public static final String selectPrescriptionList = "/selectPrescriptionList";
        public static final String updateStatus  = "/updateStatus";
        public static final String updateMailNoById = "/updateMailNoById";
        public static final  String prescriptionCheck = "/prescriptionCheck";
        public static final  String prescriptionCheckList = "/prescriptionCheckList";
    }

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

@ -50,6 +50,7 @@ public class IotRequestMapping {
        public static final String findDictByCode = "findDictByCode";
        public static final String createDict = "createDict";
        public static final String getListByParentCode = "getListByParentCode";
        public static final String findByDictName = "findByDictName";
    }
    /**
@ -201,6 +202,7 @@ public class IotRequestMapping {
        public static final String api_update = "updateDeviceDict";
        public static final String api_queryPage = "queryDeviceDictPage";
        public static final String api_getList = "getDeviceDictList";
        public static final String api_findByDictName = "api_findByDictName";
        public static final String message_success_update = "deviceDict update success";
        public static final String message_success_delete = "deviceDict delete success";
@ -262,6 +264,7 @@ public class IotRequestMapping {
        public static final String conditionQueryPage = "conditionQueryPage";
        public static final String findAllSim = "findAllSim";
        public static final String remind = "remind";
        public static final String findRemind = "findRemind";
        public static final String message_success_add = "sim add success";
        public static final String message_success_edit = "sim edit success";
@ -448,4 +451,7 @@ public class IotRequestMapping {
        public static final String message_success_create = "hospital create success";
        public static final String message_success_delete = "hospital delete success";
    }
}

+ 3 - 3
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/RoleVO.java

@ -20,7 +20,7 @@ public class RoleVO extends UuidIdentityVOWithOperator {
	@ApiModelProperty(value = "角色代码", example = "1")
	private String code;
	@ApiModelProperty(value = "1.系统管理员,2.saas管理员,3.机构管理员", example = "1")
	private String type;
	private Integer type;
	@ApiModelProperty(value = "sassId", example = "1")
	private String saasId;
	@ApiModelProperty(value =  "状态: -1 删除,1有效.", example = "1")
@ -58,11 +58,11 @@ public class RoleVO extends UuidIdentityVOWithOperator {
		this.code = code;
	}
	public String getType() {
	public Integer getType() {
		return type;
	}
	public void setType(String type) {
	public void setType(Integer type) {
		this.type = type;
	}

+ 19 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/dict/IotSystemDictVO.java

@ -18,6 +18,10 @@ public class IotSystemDictVO implements Serializable {
    private String code;//
    @ApiModelProperty("字典项值")
    private String value;//
    @ApiModelProperty("字典时间")
    private String time;
    @ApiModelProperty("字典状态")
    private Integer status;
    public String getCode() {
        return code;
@ -35,4 +39,19 @@ public class IotSystemDictVO implements Serializable {
        this.value = value;
    }
    public String getTime() {
        return time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 0 - 19
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/MixEnvelop.java

@ -44,19 +44,10 @@ public class MixEnvelop<T, J> extends Envelop {
    @ApiModelProperty(value = "列表内容")
    private List<T> detailModelList = new ArrayList<>(0);
    @ApiModelProperty(value = "列表内容")
    private Map<T,T> detailModelMap = new HashMap<>(0);
    @ApiModelProperty(value = "实体内容")
    private J obj = (J)new HashMap<>(0);
    public Map<T, T> getDetailModelMap() {
        return detailModelMap;
    }
    public void setDetailModelMap(Map<T, T> detailModelMap) {
        this.detailModelMap = detailModelMap;
    }
    public int getCurrPage() {
        return currPage;
@ -145,16 +136,6 @@ public class MixEnvelop<T, J> extends Envelop {
        envelop.setTotalCount(count.intValue());
        return envelop;
    }
    public static MixEnvelop getSuccessMapWithPage(String message, Map detailModelMap, int page, int size, Long count) {
        MixEnvelop envelop = new MixEnvelop();
        envelop.setMessage(message);
        envelop.setPageSize(size);
        envelop.setDetailModelMap(detailModelMap);
        envelop.setCurrPage(page);
        envelop.setStatus(200);
        envelop.setTotalCount(count.intValue());
        return envelop;
    }
    public static MixEnvelop getError(String message, int errorCode) {
        MixEnvelop envelop = new MixEnvelop();

+ 1 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -182,7 +182,7 @@ spring:
spring:
  profiles: iotprod
  datasource:
     url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     username: wlyy
     password: jkzlehr@123
  redis:

+ 1 - 1
gateway/ag-basic/src/main/resources/bootstrap.yml

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

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

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

+ 1 - 1
server/svr-configuration/src/main/resources/bootstrap.yml

@ -137,6 +137,6 @@ spring:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: ${wlyy.spring.config.git.uri:http://192.168.120.216:10010/jkzl/config.git}
          uri: ${wlyy.spring.config.git.uri:http://127.0.0.1:10010/jkzl/config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:master}

+ 1 - 1
svr/figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/FigureLabelJpa.java

@ -33,7 +33,7 @@ import java.util.Properties;
@EnableJpaRepositories(
        entityManagerFactoryRef = "EntityManagerFactory",
        transactionManagerRef = "TransactionManager",
        basePackages = {"com.yihu.wlyy.figure.label.dao"})   //设置Repository所在位置
        basePackages = {"com.yihu.wlyy.figure.label.dict"})   //设置Repository所在位置
public class FigureLabelJpa {
    @Autowired

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDoctorDutyDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.dict;
//package com.yihu.jw.base.dict.dict;
//
//import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictHospitalDeptDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.dict;
//package com.yihu.jw.base.dict.dict;
//
//import com.yihu.jw.entity.base.dict.DictDiseaseDO;
//import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.doctor;
//package com.yihu.jw.base.dict.doctor;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.doctor;
//package com.yihu.jw.base.dict.doctor;
//
//import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/function/FunctionDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.function;
//package com.yihu.jw.base.dict.function;
//
//import com.yihu.jw.entity.base.function.FunctionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.org;
//package com.yihu.jw.base.dict.org;
//
//import com.yihu.jw.entity.base.org.BaseOrgDO;
//import org.springframework.data.domain.Pageable;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasDefaultModuleFunctionDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.saas;
//package com.yihu.jw.base.dict.saas;
//
//import com.yihu.jw.entity.base.saas.SaasDO;
//import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasModuleFunctionDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.saas;
//package com.yihu.jw.base.dict.saas;
//
//import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/version/AppVersionDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.base.dao.version;
//package com.yihu.jw.base.dict.version;
//
//import com.yihu.jw.entity.base.version.AppVersionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxGraphicMessageDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.wx;//package com.yihu.jw.business.wx.dao;
package com.yihu.jw.base.dao.wx;//package com.yihu.jw.business.wx.dict;
import com.yihu.jw.entity.base.wx.WxGraphicMessageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/function/FunctionService.java

@ -1,6 +1,6 @@
//package com.yihu.jw.base.service.function;
//
//import com.yihu.jw.base.dao.function.FunctionDao;
//import com.yihu.jw.base.dict.function.FunctionDao;
//import com.yihu.jw.entity.base.function.FunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.stereotype.Service;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientFamilyMemberService.java

@ -1,9 +1,9 @@
//package com.yihu.jw.base.service.patient;
//
//import com.yihu.jw.base.dao.patient.BasePatientFamilyMemberDao;
//import com.yihu.jw.base.dict.patient.BasePatientFamilyMemberDao;
//import com.yihu.jw.entity.base.patient.BasePatientDO;
//import com.yihu.jw.entity.base.patient.BasePatientFamilyMemberDO;
//import com.yihu.jw.patient.dao.BasePatientDao;
//import com.yihu.jw.patient.dict.BasePatientDao;
//import com.yihu.jw.restmodel.web.Envelop;
//import com.yihu.jw.util.idcard.IdCardUtil;
//import com.yihu.mysql.query.BaseJpaService;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasDefaultModuleFunctionService.java

@ -1,7 +1,7 @@
//package com.yihu.jw.base.service.saas;
//
//import com.yihu.jw.base.dao.saas.SaasDefaultModuleFunctionDao;
//import com.yihu.jw.base.dao.saas.SaasTypeDictDao;
//import com.yihu.jw.base.dict.saas.SaasDefaultModuleFunctionDao;
//import com.yihu.jw.base.dict.saas.SaasTypeDictDao;
//import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasModuleFunctionService.java

@ -1,6 +1,6 @@
//package com.yihu.jw.base.service.saas;
//
//import com.yihu.jw.base.dao.saas.SaasModuleFunctionDao;
//import com.yihu.jw.base.dict.saas.SaasModuleFunctionDao;
//import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.stereotype.Service;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/version/AppVersionService.java

@ -1,6 +1,6 @@
//package com.yihu.jw.base.service.version;
//
//import com.yihu.jw.base.dao.version.AppVersionDao;
//import com.yihu.jw.base.dict.version.AppVersionDao;
//import com.yihu.jw.entity.base.version.AppVersionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.stereotype.Service;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxAccessTokenService.java

@ -5,8 +5,8 @@
//import com.yihu.jw.exception.ApiException;
//import com.yihu.jw.exception.code.ExceptionCode;
//import com.yihu.jw.rm.base.WechatRequestMapping;
//import com.yihu.jw.wechat.dao.WechatDao;
//import com.yihu.jw.wechat.dao.WxAccessTokenDao;
//import com.yihu.jw.wechat.dict.WechatDao;
//import com.yihu.jw.wechat.dict.WxAccessTokenDao;
//import com.yihu.mysql.query.BaseJpaService;
//import com.yihu.utils.network.HttpUtils;
//import org.json.JSONObject;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxGraphicMessageService.java

@ -1,7 +1,7 @@
package com.yihu.jw.base.service.wx;//package com.yihu.jw.business.wx.service;
//
//import com.yihu.jw.base.wx.WxGraphicMessageDO;
//import com.yihu.jw.business.wx.dao.WxGraphicMessageDao;
//import com.yihu.jw.business.wx.dict.WxGraphicMessageDao;
//import com.yihu.jw.exception.ApiException;
//import com.yihu.jw.exception.code.ExceptionCode;
//import com.yihu.base.mysql.query.BaseJpaService;

+ 5 - 5
svr/svr-base/src/main/resources/application.yml

@ -292,7 +292,7 @@ testPattern:
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
@ -300,10 +300,10 @@ spring:
#    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 59.61.92.90:20010,59.61.92.90:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.2:20010,10.90.32.2:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://59.61.92.90:20009,http://59.61.92.90:20011
      uris: http://10.90.32.2:20009,http://10.90.32.2:20011
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
@ -311,8 +311,8 @@ spring:
    user: admin
    password: admin
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    host: 10.90.32.2 # Redis server host.
    port: 20008  # Redis server port.
    password: jkzlehr
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

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

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

+ 1 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/config/jpa/WlyyHouseJpa.java

@ -25,7 +25,7 @@
//@EnableJpaRepositories(
//        entityManagerFactoryRef = "wlyyHouseEntityManagerFactory",
//        transactionManagerRef = "wlyyHouseTransactionManager",
//        basePackages = {"com.yihu.jw.healthyhouse.dao"})   //设置Repository所在位置
//        basePackages = {"com.yihu.jw.healthyhouse.dict"})   //设置Repository所在位置
//public class WlyyHouseJpa {
//
//    @Autowired

+ 1 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/facility/FacilityServerRelationDao.java

@ -7,7 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
import java.util.List;
/**
 * 设施与服务关系 dao
 * 设施与服务关系 dict
 * @author zdm
 * @version 1.0
 * @created 2018.09.20

+ 1 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/user/FacilityUsedRecordDao.java

@ -4,7 +4,7 @@ import com.yihu.jw.healthyhouse.model.user.FacilityUsedRecord;
import org.springframework.data.jpa.repository.JpaRepository;
/**
 * 用户导航记录 dao
 * 用户导航记录 dict
 * @author zdm
 * @version 1.0
 * @created 2018.09.21

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java


+ 4 - 3
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -156,7 +156,8 @@ testPattern:
  sign: 0
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
@ -239,7 +240,7 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
#心脏中心前置机配置
@ -273,4 +274,4 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段

+ 10 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java

@ -13,6 +13,7 @@ import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -70,7 +71,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM)
    @ApiOperation(value = "文件流上传文件", notes = "文件流上传文件")
    public ObjEnvelop<UploadVO> uploadStream(@ApiParam(value = "文件", required = true)
                                                 @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
                                                 @RequestParam(value = "file", required = true) MultipartFile file,
                                             @ApiParam(value = "文件", required = true)
                                             @RequestParam(value = "filename", required = false) String filename) throws Exception{
        UploadVO uploadVO = new UploadVO();
        if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
@ -85,6 +88,12 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
        }else {
            // 得到文件的完整名称  xxx.txt
            String originalFilename = file.getOriginalFilename();
            
            //判断文件名称是否有包含后缀,及前端是否有传后缀名称,有的话拼接图片后缀
            if(originalFilename.lastIndexOf(".") == 0 && StringUtils.isNotEmpty(filename)){
                originalFilename = originalFilename +"."+filename;
            }
            
            InputStream inputStream = file.getInputStream();
            uploadVO = fileUploadService.uploadStream(inputStream,originalFilename,fastdfs_file_url);
        }

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

@ -402,7 +402,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "page", required = false)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = false)Integer size) {
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size);
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size,wxId);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.setMailno)
@ -427,7 +427,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                                    @RequestParam(value = "endTime", required = false)String endTime,
                                    HttpServletResponse response) throws Exception{
        MixEnvelop expressages = prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,1,10000);
        MixEnvelop expressages = prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,1,10000,wxId);
        List<Map<String,Object>> list = expressages.getDetailModelList();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
@ -1192,4 +1192,111 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.selectPrescriptionList)
    @ApiOperation(value = "查询处方列表")
    public ListEnvelop findPrescriptionList(@ApiParam(name = "hospital", value = "医院code")
                                                  @RequestParam(value = "hospital",required = false)String hospital,
                                                  @ApiParam(name = "dept", value = "科室code")
                                                  @RequestParam(value = "dept",required = false)String dept,
                                                  @ApiParam(name = "status", value = "状态")
                                                  @RequestParam(value = "status",required = false)String status,
                                                  @ApiParam(name = "startTime", value = "开始时间")
                                                  @RequestParam(value = "startTime",required = false)String startTime,
                                                  @ApiParam(name = "endTime", value = "结束时间")
                                                  @RequestParam(value = "endTime",required = false)String endTime,
                                                  @ApiParam(name = "nameinfo", value = "医生名字/患者名字")
                                                  @RequestParam(value = "nameinfo",required = false)String nameinfo,
                                                  @ApiParam(name = "page", value = "第几页")
                                                  @RequestParam(value = "page",required = false)Integer page,
                                                  @ApiParam(name = "pagesize", value = "每页大小")
                                                  @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.selectByCondition(hospital,dept,status,startTime,endTime,nameinfo,page,pagesize,wxId));
    }
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateStatus)
    @ApiOperation("完成自取")
    public ObjEnvelop updateStatus(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId,
            @ApiParam(name = "status", value = "status", required = true)
            @RequestParam(required = true)Integer status) throws Exception {
        try {
            prescriptionService.updateStatus(prescriptionId,status);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 更改单号
     * @param id
     * @param mailNo
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateMailNoById)
    @ApiOperation("更改单号")
    public ObjEnvelop updateMailNoById(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(required = true)String id,
            @ApiParam(name = "mailNo", value = "mailNo", required = true)
            @RequestParam(required = true)String mailNo) throws Exception {
        try {
            prescriptionService.updateMailNoById(id,mailNo);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 处方-- 审方
     *
     * @param operate
     * @param operateName
     * @param reason
     * @param status
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheck)
    @ApiOperation("处方-审方")
    public ObjEnvelop prescriptionCheck(
            @ApiParam(name = "operate", value = "operate", required = true)
            @RequestParam(required = true)String operate,
            @ApiParam(name = "operateName", value = "operateName", required = true)
            @RequestParam(required = true)String operateName,
            @ApiParam(name = "reason", value = "reason", required = true)
            @RequestParam(required = true)String reason,
            @ApiParam(name = "status", value = "status", required = true)
            @RequestParam(required = true)Integer status,
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheckList)
    @ApiOperation("查询审核历史记录")
    public ObjEnvelop prescriptionCheckList(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.findPrescriptionCheck(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 25 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -67,6 +67,31 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(vos);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientInfo)
    @ApiOperation(value = " 查询单条门诊就诊记录")
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民id")
                                         @RequestParam(value = "patient",required = false) String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数")
                                         @RequestParam(value = "conNo",required = false) String conNo)throws Exception{
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag);
        return success(obj);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
    @ApiOperation(value = "门诊下所有处方信息")
    public ListEnvelop findOriginPrescriptionList(
            @ApiParam(name = "registerSn", value = "流水号")
            @RequestParam(value = "registerSn",required = false) String registerSn,
            @ApiParam(name = "patNo", value = "病人id")
            @RequestParam(value = "patNo",required = false) String patNo,
            @ApiParam(name = "admNo", value = "住院唯一号")
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号")
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        return success(obj);
    }
    @PostMapping(value = BaseHospitalRequestMapping.YkyyPrescription.appointmentRevisit)
    @ApiOperation(value = "居民发起复诊", notes = "居民发起复诊")

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.repository.dao;
package com.yihu.jw.repository.device;
import com.yihu.jw.entity.iot.device.IotDeviceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceQualityInspectionPlanDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.repository.dao;
package com.yihu.jw.repository.device;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotDeviceSimDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.repository.dao;
package com.yihu.jw.repository.device;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotPatientDeviceDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.repository.dao;
package com.yihu.jw.repository.device;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import org.springframework.data.domain.Pageable;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/dao/IotSystemDictDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.repository.dao;
package com.yihu.jw.repository.dict;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 2
svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/DeviceQualityPlanService.java

@ -4,9 +4,8 @@ package com.yihu.jw.service.device;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import com.yihu.jw.repository.dao.IotSystemDictDao;
import com.yihu.jw.repository.dict.IotSystemDictDao;
import com.yihu.jw.repository.message.IotMessageDao;
import com.yihu.jw.repository.service.IotDeviceQualityInspectionPlanService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 14
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotDeviceQualityInspectionPlanService.java

@ -1,17 +1,7 @@
package com.yihu.jw.repository.service;
import com.alibaba.fastjson.JSONObject;
package com.yihu.jw.service.device;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.iot.device.IotOrderPurchaseDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.repository.dao.IotDeviceDao;
import com.yihu.jw.repository.dao.IotDeviceQualityInspectionPlanDao;
import com.yihu.jw.repository.dao.IotSystemDictDao;
import com.yihu.jw.restmodel.iot.device.IotDeviceQualityInspectionPlanVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.repository.device.IotDeviceQualityInspectionPlanDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,7 +12,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @author yeshijie on 2017/12/8.
@ -44,7 +33,7 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
     */
    public List<IotDeviceQualityInspectionPlanDO>  findListAll(String time){
        StringBuffer sql = new StringBuffer("SELECT c.* FROM  iot_device_quality_inspection_plan c WHERE del=1");
        StringBuffer sql = new StringBuffer("SELECT c.* FROM  iot_device_quality_inspection_plan c WHERE del=1 and c.status=1 ");
        List<Object> args = new ArrayList<>();
        if (StringUtils.isNotBlank(time)){

+ 5 - 5
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotDeviceSimService.java

@ -1,14 +1,14 @@
package com.yihu.jw.repository.service;
package com.yihu.jw.service.device;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.iot.device.IotDeviceDO;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.repository.dao.IotDeviceDao;
import com.yihu.jw.repository.dao.IotDeviceSimDao;
import com.yihu.jw.repository.dao.IotPatientDeviceDao;
import com.yihu.jw.repository.dao.IotSystemDictDao;
import com.yihu.jw.repository.device.IotDeviceDao;
import com.yihu.jw.repository.device.IotDeviceSimDao;
import com.yihu.jw.repository.device.IotPatientDeviceDao;
import com.yihu.jw.repository.dict.IotSystemDictDao;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;

+ 2 - 3
svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/SimBalanceService.java

@ -4,10 +4,9 @@ package com.yihu.jw.service.device;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import com.yihu.jw.repository.dao.IotDeviceSimDao;
import com.yihu.jw.repository.dao.IotSystemDictDao;
import com.yihu.jw.repository.device.IotDeviceSimDao;
import com.yihu.jw.repository.dict.IotSystemDictDao;
import com.yihu.jw.repository.message.IotMessageDao;
import com.yihu.jw.repository.service.IotDeviceSimService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/SimSetMealService.java

@ -2,7 +2,7 @@ package com.yihu.jw.service.device;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.repository.dao.IotDeviceSimDao;
import com.yihu.jw.repository.device.IotDeviceSimDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 4
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/service/IotSystemDictService.java

@ -1,12 +1,10 @@
package com.yihu.jw.repository.service;
package com.yihu.jw.service.dict;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.repository.dao.IotSystemDictDao;
import com.yihu.jw.repository.dict.IotSystemDictDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.stereotype.Service;

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -76,7 +76,7 @@ public class JobController extends BaseController {
    @RequestMapping(value = "unSettledHISPrescription", method = RequestMethod.GET)
    public String unSettledHISPrescription() {
        try {
            simSetMealService.autoPush();
            deviceQualityPlanService.autoPush();
            return success("成功!");
        } catch (Exception e) {
            error(e);

+ 1 - 1
svr/svr-iot/readme.MD

@ -3,7 +3,7 @@ Internet of things  物联网平台
filters 字符串拼接规则
         * like:使用"?"来表示,如:name?'%医'
         * like:使用"?"来表示,如:name?医
         * in:使用"="来表示并用","逗号对值进行分隔,如:status=2,3,4,5
         * not in:使用"<>"来表示并用","逗号对值进行分隔,如:status=2,3,4,5
         * =:使用"="来表示,如:status=2

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/config/jpa/IotJpa.java

@ -26,7 +26,7 @@
//@EnableJpaRepositories(
//        entityManagerFactoryRef = "iotEntityManagerFactory",
//        transactionManagerRef = "iotTransactionManager",
//        basePackages = {"com.yihu.iot.dao","com.yihu.iot.datainput.dao"})   //设置Repository所在位置
//        basePackages = {"com.yihu.iot.dict","com.yihu.iot.datainput.dict"})   //设置Repository所在位置
//public class IotJpa {
//
//    @Autowired

+ 16 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java

@ -3,6 +3,7 @@ package com.yihu.iot.controller.common;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -56,4 +57,19 @@ public class IotSystemDictController extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = IotRequestMapping.System.findByDictName)
    @ApiOperation(value = "根据字典名称获取字典信息",notes = "根据字典名称获取字典信息")
    public MixEnvelop<IotSystemDictVO,IotSystemDictVO> findDict(@ApiParam(name = "dictName", value = "字典名称")
                                                                 @RequestParam(value = "dictName", required = false) String dictName){
        try {
            List<IotSystemDictVO> systemDictVOS = iotSystemDictService.findDict(dictName);
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,systemDictVOS);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 5 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceInventoryController.java

@ -62,6 +62,10 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
                                                                                              @RequestParam(value = "name", required = false) String name,
                                                                                              @ApiParam(name = "categoryCode", value = "设备类型标识")
                                                                                              @RequestParam(value = "categoryCode", required = false) String categoryCode,
                                                                                              @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                                                                  @RequestParam(value = "hospital", required = false) String hospital,
                                                                                              @ApiParam(name = "productId", value = "产品id")
                                                                                                  @RequestParam(value = "productId", required = false) String productId,
                                                                                              @ApiParam(name = "type", value = "调拨类型(1入库 2设备调拨出库 3核销出库)")
                                                                                              @RequestParam(value = "type", required = false) Integer type,
                                                                                              @ApiParam(name = "page", value = "第几页", defaultValue = "1")
@ -69,7 +73,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
                                                                                              @ApiParam(name = "pageSize", value = "每页记录数")
                                                                                              @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        try {
            return deviceInventoryService.getDeviceInventoryLog(name, categoryCode, type, page, pageSize);
            return deviceInventoryService.getDeviceInventoryLog(name, categoryCode,hospital, productId, type, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());

+ 1 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceSimController.java

@ -6,6 +6,7 @@ import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -139,6 +140,4 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
    }
}

+ 3 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -2,6 +2,7 @@ package com.yihu.iot.controller.dict;
import com.yihu.iot.service.dict.IotDeviceDictService;
import com.yihu.jw.entity.iot.dict.IotDeviceDictDO;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -54,4 +55,6 @@ public class IotDeviceDictController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/iotMessage/IotMessageController.java

@ -48,7 +48,7 @@ public class IotMessageController extends EnvelopRestEndpoint {
    }
    @GetMapping(value = IotRequestMapping.Message.markRead)
    @ApiOperation(value = "分页查找消息列表", notes = "分页查找消息列表")
    @ApiOperation(value = "设置消息已读", notes = "设置消息已读")
    public MixEnvelop<IotMessageDO,IotMessageDO> markRead(@ApiParam(name = "id", value = "消息ID", defaultValue = "")
                                                         @RequestParam(value = "id", required = false) String id){

+ 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);
}

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

@ -494,7 +494,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
                list.add(vo);
            });
        }
        company.setAppList(appList);
        company.setAppList(list);
    }
    /**
@ -798,7 +798,15 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        if (companyDO==null){
            return MixEnvelop.getSuccess("未入驻企业",-1);
        }
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,companyDO.getStatus());
        if (companyDO.getAccountType().equalsIgnoreCase("0")){
            List<IotCompanyAppDO> appDOList = iotCompanyAppDao.findByCompanyId(companyDO.getId());
            companyDO.setAppList(appDOList);
        }
        if (companyDO.getAccountType().equalsIgnoreCase("1")){
            findType(companyDO);
        }
        IotCompanyVO companyVO = convertToModelVO(companyDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,companyVO);
    }

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

@ -149,7 +149,7 @@ public class IotDeviceInventoryService extends BaseJpaService<IotDeviceInventory
        return deviceDOList.size();
    }
    public MixEnvelop<IotDeviceInventoryLogVO, IotDeviceInventoryLogVO> getDeviceInventoryLog(String name, String categoryCode, Integer type, Integer page, Integer pageSize) {
    public MixEnvelop<IotDeviceInventoryLogVO, IotDeviceInventoryLogVO> getDeviceInventoryLog(String name, String categoryCode, String hospital, String productId, Integer type, Integer page, Integer pageSize) {
        String sql = "SELECT l.*, count(d.id) num FROM `iot_device_inventory_log` l LEFT JOIN iot_device d on l.id = d.inventory_log_id where 1=1 ";
        if (StringUtils.isNotBlank(name)) {
            sql += "and l.name like '%" + name + "%' ";
@ -157,6 +157,12 @@ public class IotDeviceInventoryService extends BaseJpaService<IotDeviceInventory
        if (StringUtils.isNotBlank(categoryCode)) {
            sql += "and l.category_code = '" + categoryCode + "' ";
        }
        if (StringUtils.isNotBlank(productId)) {
            sql += "and l.product_id = '" + productId + "' ";
        }
        if (StringUtils.isNotBlank(hospital)) {
            sql += "and l.hospital = '" + hospital + "' ";
        }
        if (type != null) {
            sql += "and l.type = '" + type + "' ";
        }

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

@ -304,7 +304,12 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
     */
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO>  findPlanTimeByOrderNo(String orderNo,Integer page,Integer size) {
        List<IotDeviceQualityInspectionPlanDO> listOrderNo = iotDeviceQualityInspectionPlanDao.findByOrderNo(orderNo);
//        List<IotDeviceQualityInspectionPlanDO> listOrderNo = iotDeviceQualityInspectionPlanDao.findByOrderNo(orderNo);
        StringBuffer sql = new StringBuffer("SELECT c.* FROM  iot_device_quality_inspection_plan c WHERE del=1");
        sql.append(" and c.order_no = ").append(orderNo);
        sql.append("  ORDER BY c.plan_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> listOrderNo = jdbcTempalte.query(sql.toString(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        List<IotDeviceQualityInspectionPlanVO> list = transforList(listOrderNo);
        long count = list.size();
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,list,page,size,count);

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

@ -14,6 +14,7 @@ import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.http.HttpClientUtil;
@ -215,4 +216,5 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
    }
}

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

@ -96,13 +96,13 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        }
        //更新SIM管理的SIM卡信息
        IotDeviceSimDO sim = iotDeviceSimDao.findBySim(patientDevice.getSim());
       /* IotDeviceSimDO sim = iotDeviceSimDao.findBySim(patientDevice.getSim());
        sim.setDeviceName(patientDevice.getDeviceName());
        sim.setDeviceSn(patientDevice.getDeviceSn());
        sim.setContactsName(patientDevice.getPatientName());
        sim.setContactsMobile(patientDevice.getMobile());
        sim.setDel("0");
        iotDeviceSimDao.save(sim);
        iotDeviceSimDao.save(sim);*/
        return patientDeviceDO;
@ -442,6 +442,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        if(StringUtils.isNotBlank(patientName)){
            sql += "and d.patient_name like '%" + patientName + "%' ";
        }
        sql += "order by o.update_time desc ";
        //判断是否需要分页
        if (page != null && pageSize != null) {
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
@ -474,6 +475,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        if(StringUtils.isNotBlank(hospitalName)){
            sql += "and d.hospital_name like '%" + hospitalName + "%' ";
        }
        sql += "order by d.update_time desc ";
        //判断是否需要分页
        if (page != null && pageSize != null) {
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());

+ 16 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotSystemDictService.java

@ -4,17 +4,18 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.dict.IotSystemDictDao;
import com.yihu.iot.service.common.MyJdbcTemplate;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.restmodel.iot.dict.IotSystemDictVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
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 java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * @author yeshijie on 2018/1/16.
@ -108,4 +109,15 @@ public class IotSystemDictService extends BaseJpaService<IotSystemDictDO,IotSyst
        List<JSONObject> list = myJdbcTemplate.queryJson(sql,new Object[]{});
        return list;
    }
    /**
     * 获取字典信息
     * @param dictName
     * @return
     */
    public  List<IotSystemDictVO> findDict(String dictName) {
        List<IotSystemDictDO> listDO = iotSystemDictDao.findByDictName(dictName);
        List<IotSystemDictVO> iotSystemDictVOS = convertToModels(listDO, new ArrayList<>(listDO.size()), IotSystemDictVO.class);
        return iotSystemDictVOS;
    }
}

+ 7 - 11
svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java

@ -48,22 +48,18 @@ public class IotMessageService  extends BaseJpaService<IotMessageDO, IotMessageD
     */
    public MixEnvelop<IotMessageDO, IotMessageDO> findAll(Integer page, Integer size) throws ParseException {
        String sqlunRead="SELECT * FROM iot_message WHERE read_msg=0 ORDER BY create_time DESC;";
        String sqlRead="SELECT * FROM iot_message WHERE read_msg=1 ORDER BY create_time DESC;";
        StringBuffer sql= new StringBuffer("SELECT * FROM iot_message");
        List<IotMessageDO> unlist = jdbcTemplate.query(sqlunRead, new BeanPropertyRowMapper<>(IotMessageDO.class));
        List<IotMessageDO> list = jdbcTemplate.query(sqlRead, new BeanPropertyRowMapper<>(IotMessageDO.class));
        sql.append("  ORDER BY read_msg, create_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        Map<String, List> listMap = new HashMap<>();
        listMap.put("unread",unlist);
        listMap.put("read",list);
        List<IotMessageDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(IotMessageDO.class));
        long size2 = unlist.size();
        long size1 = list.size();
        long count = list.size();
        long count =size1+size2;
        return MixEnvelop.getSuccessMapWithPage(IotRequestMapping.Company.message_success_find_functions,listMap, page, size,count);
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,list, page, size,count);
    }
    /**

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java

@ -171,10 +171,10 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        StringBuffer sql = new StringBuffer("select c.* FROM iot_company_app c WHERE c.del=1 ");
        if(StringUtils.isNotBlank(name)){
            sql.append("and c.`name` like '%").append(name).append("%' OR c.company_name  LIKE  '%").append(name).append("%'");
            sql.append("and ( c.`name` like '%").append(name).append("%' OR c.company_name  LIKE  '%").append(name).append("%')");
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        sql.append(" order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyAppDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotCompanyAppDO.class));

+ 17 - 6
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);
    }
    /**
@ -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();

+ 1 - 1
svr/svr-statistics/src/main/java/com/yihu/wlyy/statistics/config/jpa/WlyyJpa.java

@ -26,7 +26,7 @@ import javax.sql.DataSource;
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyEntityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager",
        basePackages = {"com.yihu.wlyy.statistics.dao"})   //设置Repository所在位置
        basePackages = {"com.yihu.wlyy.statistics.dict"})   //设置Repository所在位置
public class WlyyJpa {
    @Autowired

+ 1 - 1
svr/svr-wlyy-archives/src/main/java/com/yihu/jw/config/jpa/WlyyArchivesJpa.java

@ -25,7 +25,7 @@ import java.util.Properties;
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyArchivesEntityManagerFactory",
        transactionManagerRef = "wlyyArchivesTransactionManager",
        basePackages = {"com.yihu.jw.dao"})   //设置Repository所在位置
        basePackages = {"com.yihu.jw.dict"})   //设置Repository所在位置
public class WlyyArchivesJpa {
    @Autowired

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/AccountDao.java

@ -11,7 +11,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author wangzhinan
 * @create 2018-05-10 11:15
 * @desc health bank account dao
 * @desc health bank account dict
 **/
public interface AccountDao extends PagingAndSortingRepository<AccountDO,String>,JpaSpecificationExecutor<AccountDO> {
    @Query("select t from AccountDO t where t.patientId=?1 and t.status=1")

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/ActiveRecordDao.java

@ -9,7 +9,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author wangzhinan
 * @create 2018-05-10 11:15
 * @desc health bank account dao
 * @desc health bank account dict
 **/
public interface ActiveRecordDao extends PagingAndSortingRepository<ActiveRecordDO,String>,JpaSpecificationExecutor<ActiveRecordDO> {

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/ExchangeGoodsDao.java

@ -11,7 +11,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author wangzhinan
 * @create 2018-05-03 15:28
 * @desc exchange goods dao
 * @desc exchange goods dict
 **/
public interface ExchangeGoodsDao extends PagingAndSortingRepository<ExchangeGoodsDO,String>,JpaSpecificationExecutor<ExchangeGoodsDO> {
    @Query("select t from ExchangeGoodsDO t where t.activityGoodsId = ?1 and t.patientId = ?2")

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskDao.java

@ -14,7 +14,7 @@ import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-05-10 11:17
 * @desc health bank task dao
 * @desc health bank task dict
 **/
public interface TaskDao extends PagingAndSortingRepository<TaskDO,String>,JpaSpecificationExecutor<TaskDO> {
    @Query("select t from TaskDO t where t.transactionId = ?1 and t.type='ACTIVITY_TASK'")

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskGoodsDao.java

@ -14,7 +14,7 @@ import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-06-08 15:28
 * @desc 商品 dao
 * @desc 商品 dict
 **/
public interface TaskGoodsDao extends PagingAndSortingRepository<TaskGoodsDO,String>,JpaSpecificationExecutor<TaskGoodsDO> {

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/TaskRuleDao.java

@ -11,7 +11,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author wangzhinan
 * @create 2018-05-10 11:17
 * @desc health bank task dao
 * @desc health bank task dict
 **/
public interface TaskRuleDao extends PagingAndSortingRepository<TaskRuleDO,String>,JpaSpecificationExecutor<TaskRuleDO> {
    @Query("select t from TaskRuleDO t where t.id = ?1 and t.status=1")

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.dao;
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.PatientLabelDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelInfoDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.dao;
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.PatientLabelDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistArticleDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.dao;
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistArticleDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistConsultDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.dao;
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistConsultDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistDao.java

@ -1,4 +1,4 @@
//package com.yihu.jw.dao;
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;