소스 검색

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 년 전
부모
커밋
55e5251ec9

+ 14 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -4,6 +4,7 @@ import com.yihu.wlyy.interceptors.DoctorInterceptor;
import com.yihu.wlyy.interceptors.GateWayInterceptor;
import com.yihu.wlyy.interceptors.PatientInterceptor;
import com.yihu.wlyy.interceptors.UserAgentFilter;
import com.yihu.wlyy.util.SystemConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -11,14 +12,16 @@ import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
@Profile({"test", "prod"})
//@Profile({"test", "prod"})
public class MvcConfig extends WebMvcConfigurerAdapter {
    private Logger logger = LoggerFactory.getLogger(MvcConfig.class);
@ -77,4 +80,14 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
//        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
//        converters.add(mappingJackson2HttpMessageConverter);
//    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String tempPath = SystemConf.getInstance().getTempPath() ;
        registry.addResourceHandler(tempPath+"/**").addResourceLocations("file:F:"+tempPath+"/");
        super.addResourceHandlers(registry);
    }
}

+ 0 - 41
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/UploadImagConfig.java

@ -1,41 +0,0 @@
package com.yihu.wlyy.config;
import com.yihu.wlyy.util.SystemConf;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.io.File;
/**
 * Created by chenweida on 2017/9/9.
 * 生产者配置
 */
@EnableJms
@Configuration
@Profile({"dev", "devtest", "prod", "test"})
public class UploadImagConfig extends WebMvcConfigurerAdapter {
//    @Value("${activemq.username}")
//    private String username;
//    @Value("${activemq.password}")
//    private String password;
//    @Value("${activemq.url}")
//    private String url;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
        registry.addResourceHandler(tempPath+"**").addResourceLocations("F:/"+tempPath);
        super.addResourceHandlers(registry);
    }
}

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java

@ -19,6 +19,7 @@ public interface PrescriptionDispensaryCodeDao extends PagingAndSortingRepositor
    @Query(nativeQuery = true, value = "select * from wlyy_prescription_dispensary_code  where code=?1 order by create_time desc limit 0,1 ")
    PrescriptionDispensaryCode finByCode(String code);
    List<PrescriptionDispensaryCode> findByPrescriptionCode(String prescriptionCode);
    //    @Query("select  count(1) from wlyy_prescription_dispensary_code p1 \n" +
//            "LEFT JOIN wlyy_prescription p2 on p1.prescription_Code = p2.code where p2.status in(21,20,100) and p2.patient =?1 ")
//    int dispensaryCodeCount(String patientCode);

+ 25 - 25
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -566,22 +566,22 @@ public class PrescriptionExpressageService extends BaseService {
            try {
                //更新二维码(isUse)
                PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeDao.finByCode(prescriptionCode);
                if(prescriptionDispensaryCode!=null){
                List<PrescriptionDispensaryCode> list = prescriptionDispensaryCodeDao.findByPrescriptionCode(prescriptionCode);
                if(list!=null&&list.size()>0){
                    //修改取药码code为已经使用
                    prescriptionDispensaryCode.setIsUse(1);
                    prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
                    //更新配送信息
                    PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
                    if(prescriptionExpressage!=null){
                        prescriptionExpressage.setHospitalDoctor(d.getName());
                        prescriptionExpressage.setHospitalDoctorCode(doctor);
                        prescriptionExpressage.setFetchingMedicineTime(new Date());
                        prescriptionExpressageDao.save(prescriptionExpressage);
                    for(PrescriptionDispensaryCode prescriptionDispensaryCode:list){
                        prescriptionDispensaryCode.setIsUse(1);
                        prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
                    }
                }
                //更新配送信息
                PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionCode);
                if(prescriptionExpressage!=null){
                    prescriptionExpressage.setHospitalDoctor(d.getName());
                    prescriptionExpressage.setHospitalDoctorCode(doctor);
                    prescriptionExpressage.setFetchingMedicineTime(new Date());
                    prescriptionExpressageDao.save(prescriptionExpressage);
                }
            }catch (Exception e){
                logger.info("更新二维码(isUse),更新配送信息 异常:"+e.getMessage());
            }
@ -665,7 +665,7 @@ public class PrescriptionExpressageService extends BaseService {
                " p.hospital = '"+d.getHospital()+"' ";
        sql = setSQL( sql,keyWord,state,type,startDate,endDate,operator,flag);
        sql +=  " AND p.`status`>=50 " +
                " ORDER BY py.create_time DESC " +
                " ORDER BY py.charge_time DESC " +
                " LIMIT " + start + "," + pageSize;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
@ -702,14 +702,14 @@ public class PrescriptionExpressageService extends BaseService {
        }
        if(StringUtils.isNotBlank(startDate)){
            startDate +=" 00:00:00";
            sql += " AND py.create_time >='"+startDate+"' ";
            sql += " AND py.charge_time >='"+startDate+"' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            endDate +=" 23:59:59";
            sql += " AND py.create_time <='"+endDate+"' ";
            sql += " AND py.charge_time <='"+endDate+"' ";
        }
        if(StringUtils.isNotBlank(operator)){
            sql += " AND p.drug_delivery_operator ='"+operator+"' ";
            sql += " AND e.hospital_doctor_code ='"+operator+"' ";
        }
        if(StringUtils.isNotBlank(flag)){
            sql += " AND p.drug_delivery_flag ="+flag+" ";
@ -720,16 +720,16 @@ public class PrescriptionExpressageService extends BaseService {
    public List<Map<String,Object>> getHospitalOperator(String doctor){
        Doctor d = doctorDao.findByCode(doctor);
        String sql = "SELECT " +
                " p.drug_delivery_operator AS operator, " +
                " p.drug_delivery_operator_name AS operatorName " +
                " p.hospital_doctor_code AS operator, " +
                " p.hospital_doctor AS operatorName " +
                " FROM " +
                " wlyy_prescription p " +
                " wlyy_prescription_expressage p " +
                " WHERE " +
                " p.hospital = '"+d.getHospital()+"' " +
                " AND p.drug_delivery_operator IS NOT NULL" +
                " AND p.drug_delivery_operator <>'' " +
                " p.hospital_code = '"+d.getHospital()+"' " +
                " AND p.hospital_doctor_code IS NOT NULL" +
                " AND p.hospital_doctor_code <>'' " +
                " GROUP BY " +
                " p.drug_delivery_operator ";
                " p.hospital_doctor_code ";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
@ -822,7 +822,7 @@ public class PrescriptionExpressageService extends BaseService {
            sql += " AND e.fetching_medicine_time <='"+endDate+"' ";
        }
        if(StringUtils.isNotBlank(operator)){
            sql += " AND p.drug_delivery_operator ='"+operator+"' ";
            sql += " AND e.hospital_doctor_code ='"+operator+"' ";
        }
        if(StringUtils.isNotBlank(flag)){
            sql += " AND p.drug_delivery_flag ="+flag+" ";

+ 9 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -248,11 +248,16 @@ public class StatisticsESService {
//            levelTemp = lowLevel;
//        }
        List<SaveModel> list = null;
        if (StringUtils.isNotEmpty(level2_type)) {
        if("2016".equals(year)&&("4".equals(index)||"5".equals(index)||"27".equals(index))){
            //2016年度数据特殊处理 因为2016年度的数据即2017-06-30号的数据只有增量
            list = elasticsearchUtil.findListDateQuotaLevel0(null, endDate, area, level, index, SaveModel.timeLevel_ZL, lowLevel);
        }else{
            if (StringUtils.isNotEmpty(level2_type)) {
            list = elasticsearchUtil.findListDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel, level2_type);
        } else {
            list = elasticsearchUtil.findListDateQuotaLevel0(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
                list = elasticsearchUtil.findListDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel, level2_type);
            } else {
                list = elasticsearchUtil.findListDateQuotaLevel0(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
            }
        }
        if (org.springframework.util.StringUtils.isEmpty(year)) {
            year = Constant.getNowYear();

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -105,7 +105,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page, pagesize, "xh1D2017031502222",firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel,articleTitle,sendTimeStart,sendTimeEnd);
            List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page, pagesize, getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel,articleTitle,sendTimeStart,sendTimeEnd);
//            Long count = jmJkEduArticleService.pushArticleListCount(getUID(),2);
            return new ResultPageListModel(
                    page,

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java

@ -154,8 +154,7 @@ public class PrescriptionExpressageController extends WeixinBaseController {
                                   @ApiParam(name = "flag", value = "1为异常出药,0为正常") @RequestParam(required = false)String flag,
                                   @ApiParam(name = "page", value = "页面") @RequestParam(required = true)Integer page,
                                   @ApiParam(name = "pageSize", value = "页面大小") @RequestParam(required = true)Integer pageSize){
        try {
            return write(200, "获取成功", "data", expressageService.getPresEsList(getUID(),keyWord,state,type,startDate,endDate,operator,flag,page,pageSize));
        try {return write(200, "获取成功", "data", expressageService.getPresEsList(getUID(),keyWord,state,type,startDate,endDate,operator,flag,page,pageSize));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败");