소스 검색

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

yeshijie 7 년 전
부모
커밋
4f1eabe273

+ 3 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -1,7 +1,6 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
@ -22,4 +21,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode,Integer status);
    @Query(value = "select p.prescription_code from wlyy_prescription_pay p LEFT JOIN  wlyy_prescription a on a.code = p.prescription_code where p.trade_status = 1 and a.jw_pay_status = 0",nativeQuery = true)
    List<String> findCodesByPayStautsAndExecuteSickStatus();
}

+ 0 - 6
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionPayDao.java

@ -1,20 +1,14 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
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 chenweida on 2017/7/27.
 */
public interface PrescriptionPayDao extends PagingAndSortingRepository<PrescriptionPay, Long>, JpaSpecificationExecutor<PrescriptionPay> {
    @Query("from PrescriptionPay p where p.prescriptionCode=?1 ")
    PrescriptionPay findByPrescriptionPay(String prescriptionCode);
    @Query(value = "select p.prescription_code from wlyy_prescription_pay p LEFT JOIN  wlyy_prescription a on a.code = p.prescription_code where p.trade_status = 1 and a.jw_pay_status = 0")
    List<String> findCodesByPayStautsAndExecuteSickStatus();
}

+ 1 - 4
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -17,9 +17,6 @@ public class PrescriptionService extends BaseService {
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionPayDao prescriptionPayDao;
    /**
     *  获取处方信息
     * @param prescriptionCode 处方code
@ -35,7 +32,7 @@ public class PrescriptionService extends BaseService {
     *@date 2017/8/17 19:27
     */
    public List<String> findCodesByPayStautsAndExecuteSickStatus() {
        return prescriptionPayDao.findCodesByPayStautsAndExecuteSickStatus();
        return prescriptionDao.findCodesByPayStautsAndExecuteSickStatus();
    }
}

+ 19 - 5
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -1,9 +1,6 @@
package com.yihu.wlyy.web.quota;
import com.yihu.wlyy.job.FollowupPlanJob;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SFExpressJob;
import com.yihu.wlyy.job.ZyDictJob;
import com.yihu.wlyy.job.*;
import com.yihu.wlyy.job.consult.ConsultCleanerJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
@ -358,7 +355,7 @@ public class JobController extends BaseController {
     * @date 2017/8/12 15:35
     */
    @RequestMapping(value = "/reOrderExpress", method = RequestMethod.POST)
    @ApiOperation("添加超时咨询自动关闭任务")
    @ApiOperation("遍历顺丰快递下单失败的记录,重新下单")
    public String reOrderExpressJob() {
        try {
            quartzHelper.startNow(SFExpressJob.class, "SFEXPRESS-REORDER", null);
@ -390,5 +387,22 @@ public class JobController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
    /**
     *遍历长处方支付成功但是院内结算失败的记录,重新执行院内结算 --
     *@author huangwenjie
     *@date 2017/8/18 14:16
     */
    @RequestMapping(value = "/executeSickSettleJob", method = RequestMethod.POST)
    @ApiOperation("遍历长处方支付成功但是院内结算失败的记录,重新执行院内结算")
    public String executeSickSettleJob() {
        try {
            quartzHelper.startNow(PrescriptionExecuteSickSettleJob.class, "ZY-SICK-SETTLE", null);
            return write(200, "");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    //******************************长处方 end********************************
}

+ 22 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/GateWayInterceptor.java

@ -20,11 +20,13 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.web.context.HttpRequestResponseHolder;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver;
import javax.servlet.http.HttpServletRequest;
@ -58,10 +60,16 @@ public class GateWayInterceptor extends BaseInterceptor {
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
        String accesstoken = request.getParameter("accesstoken");
        String accesstoken = request.getHeader("accesstoken");
        String ip = NetworkUtil.getIpAddress(request);
        //********************************判断accesstoken********************************
        try {
            if (org.springframework.util.StringUtils.isEmpty(accesstoken)) {
                saveHttpLog(ip, JSONObject.fromObject(request.getParameterMap()).toString(), null, accesstoken, request.getRequestURI(), GcHttpLog.flagEm.error.getCode(), BaseResultModel.codeEm.token_null.getMessage());
                //没权限
                BaseResultModel baseResultModel = new BaseResultModel(BaseResultModel.codeEm.token_null.getCode(), BaseResultModel.codeEm.token_null.getMessage());
                response.getOutputStream().write(JSONObject.fromObject(baseResultModel).toString().getBytes());
            }
            GcToken gcToken = gcTokenDaoDao.findByToken(accesstoken);
            if (gcToken == null) {
                saveHttpLog(ip, JSONObject.fromObject(request.getParameterMap()).toString(), null, accesstoken, request.getRequestURI(), GcHttpLog.flagEm.error.getCode(), BaseResultModel.codeEm.token_no_power.getMessage());
@ -101,16 +109,7 @@ public class GateWayInterceptor extends BaseInterceptor {
     */
    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        //保存成功之后的日志
        String token = request.getParameter("token");
        String ip = NetworkUtil.getIpAddress(request);
        saveHttpLog(ip,
                JSONObject.fromObject(request.getParameterMap()).toString(),
                JSONObject.fromObject(modelAndView.getModelMap()).toString(),
                token,
                request.getRequestURI(),
                GcHttpLog.flagEm.success.getCode(),
                null);
    }
    /**
@ -125,9 +124,19 @@ public class GateWayInterceptor extends BaseInterceptor {
    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        String token = request.getParameter("token");
        String ip = NetworkUtil.getIpAddress(request);
        saveHttpLog(ip,
                JSONObject.fromObject(request.getParameterMap()).toString(),
                null,//JSONObject.fromObject(modelAndView.getModelMap()).toString()
                token,
                request.getRequestURI(),
                GcHttpLog.flagEm.success.getCode(),
                null);
    }
    @Transactional
    public void saveHttpLog(String ip, String input, String output, String token, String method, Integer flag, String message) {
        GcHttpLog gcHttpLog = new GcHttpLog();
        gcHttpLog.setCreateTime(new Date());
@ -137,6 +146,7 @@ public class GateWayInterceptor extends BaseInterceptor {
        gcHttpLog.setToken(token);
        gcHttpLog.setMethod(method);
        gcHttpLog.setFlag(flag);
        gcHttpLog.setMessage(message);
        httpLogDao.save(gcHttpLog);
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/gateway/GcTokenDao.java

@ -16,6 +16,6 @@ public interface GcTokenDao extends PagingAndSortingRepository<GcToken, Long>, J
    @Modifying
    void updateDel(String appid);
    @Query("from GcToken where token=?1")
    @Query("from GcToken where accesstoken=?1")
    GcToken findByToken(String token);
}

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -1495,7 +1495,8 @@ public class DoctorInfoService extends BaseService {
                    return jsonObject;
                }
            }else{
                throw new Exception(responseObject.getString("msg"));
                String error = msg.split("\\|\\|")[0].split(":")[2];
                throw new Exception(error);
            }
        }else{
            throw new Exception("null response.");

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -217,10 +217,10 @@ public class PrescriptionDispensaryCodeService extends BaseService {
        return sb.toString();
    }
    public Map<String, Object> getQrcode(String prescriptionCode ,String patientCode ,Integer type){
    public Map<String, Object> getQrcode(String prescriptionCode ,String patientCode ,Integer type) throws Exception {
        String sql = "select  p2.is_use as isUse,p2.code as dispensaryCode,p2.img_url,p3.hospital_name as hospitalName  from wlyy_prescription_dispensary_code p2 " +
                " left join  wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code " +
                " where p2.prescription_code=?  and p2.type=?  and p2.is_Use=0 ";
                " where p2.prescription_code=?  and p2.type=? ";
        if(type==2||type==3){
            sql +=" and p3.expressage_code=? ";
        }else{
@ -230,7 +230,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
        if(result.size()>0){
            return result.get(0);
        }
        return null;
        throw new Exception("二维码错误或者已过期!");
    }
    @Transactional

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

@ -119,6 +119,7 @@ public class PrescriptionExpressageService {
            case 3: {
                //判断是3 配送员(健管师)配送码
                // returnStatus = dispensaryCode_3(userCode, prescriptionDispensaryCode);
                returnStatus=0;
                break;
            }
            default: {

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

@ -124,7 +124,7 @@ public class PrescriptionCodeController extends BaseController{
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) {
        try{
            Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(prescriptionCode,getUID(),2);
            Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(prescriptionCode,getUID(),2);//xh1D2017031503333
//            map.put("code", Base64.encode(map.get("code").toString().getBytes()));
            return write(200, "获取配送员取药码成功!", "data", map);
        } catch (Exception e) {

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/gateway/vo/base/BaseResultModel.java

@ -35,7 +35,8 @@ public class BaseResultModel {
        error_AppSecret(-9001, "AppSecret不存在"),//AppSecret不存在
        token_out_effect(-9002, "无效的token"),//token无效
        token_no_power(-9003, "用户没权限"),// 没权限 包括未授权 或者uri错误
        token_out_time(-9004, "oken已过期"),//token无效
        token_out_time(-9004, "accesstoken已过期"),//token无效
        token_null(-9005, "accesstoken为空"),// 没权限 包括未授权 或者uri错误
        error_params(-10000, "请求失败 参数错误"),//请求失败 参数错误
        error_no_ip(-10010, "请求失败,获取IP失败"),//请求失败,获取IP失败