Ver código fonte

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

yeshijie 7 anos atrás
pai
commit
4ebb2d3792

+ 11 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/PrescriptionPayOverdueJob.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@ -23,7 +24,16 @@ public class PrescriptionPayOverdueJob implements Job {
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            logger.info("Prescription_Pay_Overdue_Job_start");
            StringBuffer sql = new StringBuffer("UPDATE wlyy_prescription SET status = -3 WHERE TIMESTAMPDIFF(second,create_time,NOW())>=172800");
            StringBuffer sql = new StringBuffer("UPDATE wlyy_prescription " +
                    " JOIN wlyy_prescription_reviewed ON wlyy_prescription_reviewed.prescription_code = wlyy_prescription. CODE " +
                    " SET wlyy_prescription.`status` = -3 " +
                    " WHERE " +
                    " wlyy_prescription.`status` = " + PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue() +
                    " AND TIMESTAMPDIFF( " +
                    " SECOND, " +
                    " wlyy_prescription_reviewed.reviewed_time, " +
                    " NOW() " +
                    " ) >= 86400");
            jdbcTemplate.execute(sql.toString());
            logger.info("Prescription_Pay_Overdue_Job_end");
        }catch (Exception e){

+ 19 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/GateWayInterceptor.java

@ -25,6 +25,7 @@ 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.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver;
@ -39,7 +40,7 @@ import java.util.Map;
 * 对外的请求拦截
 */
@Component
public class GateWayInterceptor extends BaseInterceptor {
public class GateWayInterceptor implements HandlerInterceptor {
    private Logger logger = LoggerFactory.getLogger(GateWayInterceptor.class);
    @Autowired
@ -109,7 +110,23 @@ public class GateWayInterceptor extends BaseInterceptor {
     */
    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        String output = "";
        if (modelAndView != null) {
            output = JSONObject.fromObject(modelAndView.getModelMap()).toString();
        }
        HandlerMethod handlerMethod= (HandlerMethod) handler;
        String token = request.getHeader("accesstoken");
        String ip = NetworkUtil.getIpAddress(request);
        saveHttpLog(ip,
                JSONObject.fromObject(request.getParameterMap()).toString(),
                output,
                token,
                request.getRequestURI(),
                GcHttpLog.flagEm.success.getCode(),
                null);
    }
    /**
@ -124,17 +141,8 @@ 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);
        HandlerMethod handlerMethod= (HandlerMethod) handler;
        saveHttpLog(ip,
                JSONObject.fromObject(request.getParameterMap()).toString(),
                null,//JSONObject.fromObject(modelAndView.getModelMap()).toString()
                token,
                request.getRequestURI(),
                GcHttpLog.flagEm.success.getCode(),
                null);
    }
    public void saveHttpLog(String ip, String input, String output, String token, String method, Integer flag, String message) {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -317,7 +317,7 @@ public class PrescriptionInfoService extends BaseService {
        if (prescription!=null&&reviewed != null && prescription.getStatus() == PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue()&&reviewed.getReviewedTime()!=null) {
            Long s = (new Date().getTime()-reviewed.getReviewedTime().getTime()) / 1000;
            //rs.put("time",s);
            if (s > 172800) {
            if (s > 86400) {
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue());
                prescriptionDao.save(prescription);
            }
@ -814,7 +814,7 @@ public class PrescriptionInfoService extends BaseService {
            if (state != null && state == 1) {
                prescriptionNoticesService.sendMessages(prescription.getPatient(), prescription.getDoctorName(), null, 1, 1, "prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode() + "&toName=" + p.getName() + "&code=" + prescription.getCode());
            } else {
                prescriptionNoticesService.sendMessages(prescription.getPatient(), prescription.getDoctorName(), null, 1, 2, "prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode() + "&toName=" + p.getName() + "&code=" + prescription.getCode());
                prescriptionNoticesService.sendMessages(prescription.getPatient(), prescription.getDoctorName(), null, 1, 0, "prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode() + "&toName=" + p.getName() + "&code=" + prescription.getCode());
            }
            return 1;
        } catch (Exception e) {

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -1873,7 +1873,7 @@ public class StatisticsService extends BaseService {
        //1.统计签约数据
        //查找团队签约
        String sign_sql = "SELECT COUNT(1) signCount FROM wlyy_sign_family t WHERE t.admin_team_code =" + id + " AND t.czrq >='" + startDate + "' AND t.czrq<='" + endDate + "' AND t.status >0 AND t.expenses_status ='1'";
        String sign_sql = "SELECT COUNT(1) signCount FROM wlyy_sign_family t WHERE t.admin_team_code =" + id + " AND t.czrq >='" + startDate + "' AND t.czrq<='" + endDate + "' AND t.status >0 AND  t.expenses_status ='1'";
        //查找续签表未转移的记录
        String renew_sql = "SELECT COUNT(1) renewCount FROM wlyy_sign_family_renew t WHERE t.admin_team_code =" + id + " AND t.czrq >='" + startDate + "' AND t.czrq<='" + endDate + "' AND t.status =1 AND t.expenses_status ='1' AND t.is_valid =0";
@ -2044,6 +2044,7 @@ public class StatisticsService extends BaseService {
                "  d.id = p.participant_id " +
                " AND c.consult = t.id " +
                " AND c.patient = s.id " +
                " AND c.type = 2 " +
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
@ -2066,6 +2067,7 @@ public class StatisticsService extends BaseService {
                "  d.id = p.participant_id " +
                " AND c.consult = t.id " +
                " AND c.patient = s.id " +
                " AND c.type = 2 " +
                " AND t. STATUS <> 10 " +
                " AND t.`reply` = 0 " +
                " AND p.session_id = t.session_id " +

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -66,7 +66,7 @@ public class PatientService extends TokenService {
    private Clock clock = Clock.DEFAULT;
    //可续签月份
    private int[] canRenewMonth = {4, 5, 6, 7};
    private int[] canRenewMonth = {1,2,3,4,5,6,7,8,9,10,11,12};
    public void setClock(Clock clock) {
        this.clock = clock;

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.adapter.PresModeAdapter;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
@ -11,6 +12,7 @@ import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.web.BaseController;
@ -44,6 +46,8 @@ public class PrescriptionInfoController extends BaseController {
    private PresModeAdapter adapter;
    @Autowired
    private ZyDictService zyDictService;
    @Autowired
    private AdminTeamService adminTeamService;
    @RequestMapping(value = "/getPrescriptionFilter", method = RequestMethod.GET)
@ -171,9 +175,11 @@ public class PrescriptionInfoController extends BaseController {
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
           JSONObject jo = new JSONObject();
            JSONObject jo = new JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            AdminTeam adminTeam = adminTeamService.getTeam(prescription.getAdminTeamId());
            //获取处方药品信息
            List<PrescriptionInfo> prescriptionInfos = prescriptionInfoService.getPrescriptionInfo(prescriptionCode);
            //获取付款信息
@ -183,6 +189,7 @@ public class PrescriptionInfoController extends BaseController {
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionExpressage", prescriptionExpressage);
            jo.put("leadCode", adminTeam.getLeaderCode());//团队长code
            if (prescription != null) {
                jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
                jo.put("dispensaryDispensaryType", prescription.getDispensaryType());//处方配送方式
@ -331,7 +338,7 @@ public class PrescriptionInfoController extends BaseController {
             @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor") String
                     healthDoctor) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.distributionHealthDoctor(codes, healthDoctor,getUID()));
            return write(200, "操作成功!", "data", prescriptionInfoService.distributionHealthDoctor(codes, healthDoctor, getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -453,6 +460,7 @@ public class PrescriptionInfoController extends BaseController {
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPhysicMinDose", method = RequestMethod.GET)
    @ApiOperation(value = "获取药品最小用量")
    public String getPhysicMinDose(String code) {

+ 13 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -366,7 +366,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/teams/{hospital}", method = RequestMethod.GET)
    @ApiOperation(value = "查询机构下的团队")
    @ApiOperation(value = "查询机构下的团队(翻译名称)")
    public String getHospitalTeams(@PathVariable  String hospital){
        try{
            List<AdminTeam> teams =  teamService.findHospitalTeams(hospital);
@ -378,4 +378,16 @@ public class AdminTeamController extends BaseController {
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "/teams/{hospital}/noTranslateAdminTeamLeaderName", method = RequestMethod.GET)
    @ApiOperation(value = "查询机构下的团队(不翻译名称)")
    public String getHospitalTeamsNoTranslateAdminTeamLeaderName(@PathVariable  String hospital){
        try{
            List<AdminTeam> teams =  teamService.findHospitalTeams(hospital);
            return write(200,"查询成功","data",teams);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
}