Bladeren bron

文章查询顺丰物流更新修改

wangjun 4 jaren geleden
bovenliggende
commit
5701347c63

+ 8 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -5,6 +5,7 @@ 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 org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@ -26,8 +27,13 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    void updateCheckStatus(String id,Integer checkStatus,String reason,Integer status);
    @Modifying
    @Query("update WlyyPrescriptionDO p set p.status=?2 ,p.finishTime =?3 where p.id=?1")
    void updateStatus(String id, Integer status, Date date);
    @Query("update WlyyPrescriptionDO p set p.status=?1 ,p.finishTime =?2 where p.id=?3")
    void updateStatus(Integer status, Date date,String id);
    @Transactional
    @Modifying
    @Query("update WlyyPrescriptionDO p set p.status=?1 ,p.finishTime =?2 where p.outpatientId=?3")
    void updateStatusByOutPatientId(Integer status, Date date,String id);
    List<WlyyPrescriptionDO> findByOutpatientId(String outpatientId);

+ 11 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -411,7 +411,7 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
            //如果路由信息节点包含了"已收件"节点,这修改处方派送状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress_obj.getId(), 100,new Date());
                prescriptionDao.updateStatus( 100,new Date(),sfexpress_obj.getId());
                //保存门诊处方配送成功的日志
                WlyyOutpatientExpressageLogDO outpatiExpressLog = new WlyyOutpatientExpressageLogDO();
@ -486,6 +486,7 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        }
    }
    /**
     * 解析顺丰推送过来的路由信息,和本地数据匹配并进行增量更新)
     * @param waybillRoute
@ -591,7 +592,15 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
            //如果路由信息节点包含了"已收件"节点,则修改处方状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress.getOutpatientId(), 100,new Date());
                prescriptionDao.updateStatusByOutPatientId( 100,new Date(),sfexpress.getOutpatientId());
                /*List<WlyyPrescriptionDO> wlyyPrescriptionDOs = prescriptionDao.findByOutpatientId(sfexpress.getOutpatientId());
                if (wlyyPrescriptionDOs.size()>0){
                    WlyyPrescriptionDO wlyyPrescriptionDO=wlyyPrescriptionDOs.get(0);
                    wlyyPrescriptionDO.setStatus(100);
                    wlyyPrescriptionDO.setFinishTime(new Date());
                    prescriptionDao.save(wlyyPrescriptionDO);
                }*/
                //保存配送成功的日志
                WlyyOutpatientExpressageLogDO outpatiExpressLog = new WlyyOutpatientExpressageLogDO();

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

@ -7106,7 +7106,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public void updateStatus(String prescriptionId, Integer status) {
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        prescriptionDao.updateStatus(prescriptionId, status, new Date());
        prescriptionDao.updateStatus( status, new Date(),prescriptionId);
        prescriptionLogService.addPrescriptionLog(prescriptionId, status, 1, wlyyPrescriptionDO.getPatientCode(), wlyyPrescriptionDO.getPatientName(), null, new Date());
    }

+ 3 - 12
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -3,7 +3,6 @@ package com.yihu.jw.service.channel;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.job.QuartzJobLog;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
@ -43,7 +42,7 @@ public class PrescriptionStatusUpdateService {
    private static Logger logger = LoggerFactory.getLogger(PrescriptionStatusUpdateService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")
    @Value("${wechat.ids}")
    private String wechatId;
    @Value("${hlwyyEntrance.url}")
    private String hlwyyEntranceUrl;
@ -283,18 +282,16 @@ public class PrescriptionStatusUpdateService {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        QuartzJobLog quartzJobLog = new QuartzJobLog();
        //复诊记录状态状态安全锁,每天0~2点才允许触发,避免误调用
        //将所有的已接诊的处方记录
        if(i==0||i==1){
            List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus();
            if(outpatientDOs!=null&&outpatientDOs.size()>0){
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                    //结束门诊
                    outpatientDO.setStatus("3");
                    logger.info(outpatientDO.getId()+"的处方记录设置为结束");
                    String consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                    logger.info("consultCode"+consultCode);
                    if(StringUtils.isNoneBlank(consultCode)){
                        try {
                            imService.finish(consultCode,"admin",2);
@ -304,13 +301,7 @@ public class PrescriptionStatusUpdateService {
                        }
                       
                    }
                    //保存操作日志
                    quartzJobLog.setId(UUID.randomUUID().toString());
                    quartzJobLog.setJobName("setOutPatientOver");
                    quartzJobLog.setJobId("setOutPatientOver");
                    quartzJobLog.setJobContent(outpatientDO.getId()+"问诊执行自动结束"+outpatientDO.getStatus());
                    quartzJobLog.setJobStartTime(new Date());
                    quartzJobLogDao.save(quartzJobLog);
                    logger.info(outpatientDO.getId()+"的处方记录设置为结束");
                }
                outpatientDao.save(outpatientDOs);
                //退费

+ 10 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -335,22 +335,26 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
	//根据分类查询文章
	public MixEnvelop findArticleByCategoryAndName(String categoryFirst, String categorySecond, String keyWords, Integer page, Integer pageSize){
		MixEnvelop objEnvelop = new MixEnvelop();
		String sql = "select t.id as \"id\",t.title as \"title\", " +
		String sql = "select t.id as \"id\",t.title as \"title\",t.read_count as \"readCount\"," +
				"t.collection as \"collection\",t.fabulous as \"fabulous\",t.is_share as \"share\"," +
                " t.intro as \"intro\",t.category_first_name as \"categoryFirstName\"," +
                " t.category_second_name as \"categorySecondName\" ," +
                "t.content as \"content\",t.image as \"image\",t.create_user_name as \"createUserName\"," +
                "b.job_title_name as \"jobTitleName\",b.visit_hospital_name as \"visitHospitalName\" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                " on a.article_id = t.id left join base_doctor b on b.id = t.create_user where 1=1";
                "t.content as \"content\",t.image as \"image\",t.create_user_name as \"createUserName\",c.job_title_name as \"jobTitleName\"," +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                " on a.article_id = t.id left join base_doctor_hospital b on b.doctor_code = t.create_user" +
				" left join base_doctor c on c.id = t.create_user where 1=1 and t.del = 1";
		if (StringUtils.isNotBlank(categoryFirst)&&StringUtils.isNotBlank(categorySecond)){
		    sql+=" and t.category_first = '"+categoryFirst+"' and t.category_second ='"+categorySecond+"'";
        }
        if (StringUtils.isNotBlank(keyWords)){
            sql+=" and (t.create_user_name like '%"+keyWords+"%' or t.title like '%"+keyWords+"%' or t.content like '%"+keyWords+"%' or a.dept_name like '%"+keyWords+"%' )";
        }
		sql+=" group by t.id ,t.title ,t.intro,t.category_first_name ,t.category_second_name ,t.content ,t.image ,t.create_user_name ,b.job_title_name ,b.visit_hospital_name";
		sql+=" group by t.id ,t.title ,t.intro,t.category_first_name ,t.category_second_name ,c.job_title_name," +
				"t.read_count,t.collection,t.fabulous,t.is_share,t.content ,t.image ,t.create_user_name ,b.dept_name ,b.org_name order by t.create_time desc";
        List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> countList = hibenateUtils.createSQLQuery(sql);
        objEnvelop.setObj(result);
        objEnvelop.setTotalCount(result.size());
        objEnvelop.setTotalCount(countList.size());
        objEnvelop.setPageSize(pageSize);
        objEnvelop.setCurrPage(page);
        return objEnvelop;