소스 검색

眼科医院处方物流

ysj 5 년 전
부모
커밋
03cdafcc74

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

@ -157,6 +157,25 @@ public class YkyyEntranceService {
        return "success";
    }
    /**
     * 查找眼科his 已审核未付款的处方
     * @throws Exception
     */
    public JSONArray getUnsettledPrescription() throws Exception{
        String sql = "SELECT h.BRID,h.CFSB from HLW_CF01 h WHERE h.SPZT = 1 and h.FKZT = 0";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        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){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    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();

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxPushLogDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxPushLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2020/4/27.
 */
public interface WxPushLogDao extends PagingAndSortingRepository<WxPushLogDO, String>, JpaSpecificationExecutor<WxPushLogDO> {
}

+ 5 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPushLogDO.java

@ -3,12 +3,16 @@ package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2018/8/21.
 */
public class WxPushLogDO extends UuidIdentityEntity {
@Entity
@Table(name = "wx_push_log")
public class WxPushLogDO extends UuidIdentityEntity implements java.io.Serializable{
    private String wechatId;//推送类型
    private String tempName;//模板名称

+ 42 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnSettledHISPrescriptionJob.java

@ -0,0 +1,42 @@
package com.yihu.jw.job.ykyy;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
import com.yihu.jw.wechat.service.WxTemplateService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 定时查询HIS的01表中的审方状态,如果已审方,且未结算,则推送一条模板消息给居民,让居民进行支付结算。
 * Created by yeshijie on 2020/4/26.
 *
 * @author yeshijie.
 */
public class UnSettledHISPrescriptionJob implements Job{
    private static final Logger logger = LoggerFactory.getLogger(UnSettledHISPrescriptionJob.class);
    @Autowired
    private WxTemplateService wxTemplateService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========UnSettledHISPrescriptionJob========");
        try {
            wxTemplateService.unSettledHISPrescription();
            logger.info("END========UnSettledHISPrescriptionJob 执行结束========");
        }catch (Exception e){
            e.printStackTrace();
            logger.error("END===ERROE===UnSettledHISPrescriptionJob,message:"+e.getMessage());
        }
    }
}

+ 30 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -7,11 +7,13 @@ import com.yihu.jw.internet.service.InternetCommonService;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.web.BaseController;
import com.yihu.jw.wechat.service.WxTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.LoggerFactory;
@ -53,6 +55,8 @@ public class JobController extends BaseController {
    @Autowired
    private InternetCommonService internetCommonService;
    @Autowired
    private WxTemplateService wxTemplateService;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
@ -60,6 +64,21 @@ public class JobController extends BaseController {
        this.quartzHelper = quartzHelper;
    }
    /**
     * 测试方法
     * @return
     */
    @RequestMapping(value = "unSettledHISPrescription", method = RequestMethod.GET)
    public String unSettledHISPrescription() {
        try {
            wxTemplateService.unSettledHISPrescription();
            return success("成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "removeJob", method = RequestMethod.GET)
    public String removeJob(String taskId) {
@ -145,6 +164,17 @@ public class JobController extends BaseController {
                        logger.info("data_common_upload_job  job exist");
                    }
                    break;
                case "unsettled_prescription_notice_job" :
                    //互联网医院 待结算消息推送
                    if (!quartzHelper.isExistJob("unsettled_prescription_notice_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("unsettled_prescription_notice_job");
                        quartzHelper.addJob(UnSettledHISPrescriptionJob.class, trigger, "unsettled_prescription_notice_job", new HashMap<String, Object>());
                        logger.info("unsettled_prescription_notice_job  job success");
                    } else {
                        logger.info("unsettled_prescription_notice_job  job exist");
                    }
                    break;
                default :
            }

+ 2 - 2
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -155,7 +155,7 @@ fastDFS:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
@ -192,7 +192,7 @@ fastDFS:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---

+ 2 - 1
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -11,7 +11,8 @@ data_upload_job=0 0 2 * * ?
#-------------------------中山医院end-----------------------------#
#-------------------------眼科医院-----------------------------#
data_ykupload_job=0 0 0 * * ?
#每间隔1分钟触发
unsettled_prescription_notice_job=0 */1 * * * ?
#-------------------------眼科医院end-----------------------------#
#-------------------------监管平台通用医院-----------------------------#
data_common_upload_job=0 0 0 * * ?