Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 3 years ago
parent
commit
b556be2799

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

@ -17,8 +17,8 @@ public interface BaseNatAppointmentDao extends PagingAndSortingRepository<BaseNa
    List<BaseNatAppointmentDO> findPayStatusByPatientId(String patientId);
    @Query("from BaseNatAppointmentDO t where t.payStatus = 1 or t.payStatus = 0 and t.isSuccess=1 and t.patientId=?1")
    List<BaseNatAppointmentDO> findPayStatusByPatientIdTASY(String patientId);
    @Query("from BaseNatAppointmentDO t where t.patientId=?1 and t.payStatus in (0,1) and t.isSuccess=1 ")
    List<BaseNatAppointmentDO> findByTasy(String patientId);
    @Query("select a from BaseNatAppointmentDO a where  a.realOrder =?1 ")

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

@ -11777,7 +11777,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setCardNo(cardNo);
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                //baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                //baseNatAppointmentDO.setOderNum(orderNum);
                baseNatAppointmentDO.setCityName(cityName);
                baseNatAppointmentDO.setFirstJobCode(firstJobCode);
@ -11805,6 +11805,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setDoctorId(staffNo);
                baseNatAppointmentDO.setConsumer(consumer);
                baseNatAppointmentDO.setDoctorName(staffName);
                baseNatAppointmentDO.setAppointmentTime(new Date());
                baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
                logger.info("BaseNatAppointmentDO保存结束"+baseNatAppointmentDO.getId());
                //添加订单
@ -12065,9 +12066,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
                "t.charge_amount as \"chargeAmount\"," +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
                "t.charge_amount as \"chargeAmount\"," ;
        if ("xm_tasy_wx".equalsIgnoreCase(wechatId)){
            sql+=" date_format(t.appointment_time ,'%Y-%m-%d' ) as \"appointmentTime\" ";
        }else {
            sql+=" t.appointment_time as \"appointmentTime\"";
        }
        sql+=  " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                sql+=" and t.consumer ='"+patientId+"'";

+ 96 - 25
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TasyNatService.java

@ -618,7 +618,7 @@ public class TasyNatService {
            key1.put("color",wxTemplateConfigDO1.getKeyword6());
            key2.put("value",baseNatAppointmentD0.getInspectionName());
            key2.put("color",wxTemplateConfigDO1.getKeyword6());
            key3.put("value",DateUtil.formatDate(baseNatAppointmentD0.getAppointmentTime(),"yyyy-MM-dd HH:mm:ss"));
            key3.put("value",wxTemplateConfigDO1.getKeyword3());//DateUtil.formatDate(baseNatAppointmentD0.getAppointmentTime(),"yyyy-MM-dd")
            key3.put("color",wxTemplateConfigDO1.getKeyword6());
            key4.put("value",wxTemplateConfigDO1.getKeyword4());
            key4.put("color",wxTemplateConfigDO1.getKeyword6());
@ -804,37 +804,108 @@ public class TasyNatService {
    }
    public void savePayStatusByHis(String patientId) throws Exception {
        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientIdTASY(patientId);
        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findByTasy(patientId);
        for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){
            System.out.println("baseNatAppointmentDO==="+baseNatAppointmentDO.getName());
                String res = QueryApplyInfo(baseNatAppointmentDO.getRealOrder());
                JSONObject jsonObject = JSON.parseObject(res);
                if (jsonObject!=null){
                    if (jsonObject.getString("ReturnCode").equalsIgnoreCase("1")){
                        String voucherNo = jsonObject.getString("ApplyNo");
                        baseNatAppointmentDO.setVoucherNo(voucherNo);
                        if ("已扣费".equalsIgnoreCase(jsonObject.getString("Status"))){
                            baseNatAppointmentDO.setPayStatus("1");
                            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                            if (businessOrderDO!=null){
                                businessOrderDO.setStatus(1);
                                businessOrderDao.save(businessOrderDO);
                            }
                        }else if ("已退费".equalsIgnoreCase(jsonObject.getString("Status"))){
                            logger.info("进入退费订单同步");
                            baseNatAppointmentDO.setPayStatus("-1");
                            baseNatAppointmentDO.setIsSuccess("-1");
                            baseNatAppointmentDO.setCancelReson("患者本人线下取消");
                            baseNatAppointmentDO.setCancelTime(new Date());
                            baseNatAppointmentDO.setCancelBy(patientId);
                            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                            if (businessOrderDO!=null){
                                businessOrderDO.setStatus(-1);
                                businessOrderDao.save(businessOrderDO);
                        String applyinfo = jsonObject.getString("applyinfo");
                        if (StringUtils.isNoneBlank(applyinfo)){
                            if (applyinfo.contains("[")){
                                JSONArray jsonArray = JSON.parseArray(applyinfo);
                                if (jsonArray!=null&&jsonArray.size()>0) {
                                    if (StringUtils.isNoneBlank(baseNatAppointmentDO.getVoucherNo())) {
                                        for (int i = 0; i < jsonArray.size(); i++) {
                                            JSONObject child = jsonArray.getJSONObject(i);
                                            System.out.println("数组" + child.getString("ApplyNo"));
                                            if (child.getString("ApplyNo").equalsIgnoreCase(baseNatAppointmentDO.getVoucherNo())) {
                                                if ("已扣费".equalsIgnoreCase(child.getString("Status"))) {
                                                    baseNatAppointmentDO.setPayStatus("1");
                                                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                                    if (businessOrderDO != null) {
                                                        businessOrderDO.setStatus(1);
                                                        businessOrderDao.save(businessOrderDO);
                                                    }
                                                } else if ("已退费".equalsIgnoreCase(child.getString("Status"))) {
                                                    logger.info("进入退费订单同步");
                                                    baseNatAppointmentDO.setPayStatus("-1");
                                                    baseNatAppointmentDO.setIsSuccess("-1");
                                                    baseNatAppointmentDO.setCancelReson("患者本人线下取消");
                                                    baseNatAppointmentDO.setCancelTime(new Date());
                                                    baseNatAppointmentDO.setCancelBy(patientId);
                                                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                                    if (businessOrderDO != null) {
                                                        businessOrderDO.setStatus(-1);
                                                        businessOrderDao.save(businessOrderDO);
                                                    }
                                                    //取消号源
                                                    //cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                                                }
                                                baseNatAppointmentDao.save(baseNatAppointmentDO);
                                            }
                                        }
                                    }else {
                                        JSONObject child = jsonArray.getJSONObject(jsonArray.size()-1);
                                        System.out.println("数组" + child.getString("ApplyNo"));
                                        if (child.getString("ApplyNo").equalsIgnoreCase(baseNatAppointmentDO.getVoucherNo())) {
                                            if ("已扣费".equalsIgnoreCase(child.getString("Status"))) {
                                                baseNatAppointmentDO.setPayStatus("1");
                                                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                                if (businessOrderDO != null) {
                                                    businessOrderDO.setStatus(1);
                                                    businessOrderDao.save(businessOrderDO);
                                                }
                                            } else if ("已退费".equalsIgnoreCase(child.getString("Status"))) {
                                                logger.info("进入退费订单同步");
                                                baseNatAppointmentDO.setPayStatus("-1");
                                                baseNatAppointmentDO.setIsSuccess("-1");
                                                baseNatAppointmentDO.setCancelReson("患者本人线下取消");
                                                baseNatAppointmentDO.setCancelTime(new Date());
                                                baseNatAppointmentDO.setCancelBy(patientId);
                                                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                                if (businessOrderDO != null) {
                                                    businessOrderDO.setStatus(-1);
                                                    businessOrderDao.save(businessOrderDO);
                                                }
                                                //取消号源
                                                //cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                                            }
                                            baseNatAppointmentDO.setVoucherNo(child.getString("ApplyNo"));
                                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                                        }
                                    }
                                }
                            }else {
                                JSONObject jsonObject1 = JSONObject.parseObject(applyinfo);
                                System.out.println("单条"+jsonObject1.getString("ApplyNo"));
                                if ("已扣费".equalsIgnoreCase(jsonObject1.getString("Status"))){
                                    baseNatAppointmentDO.setPayStatus("1");
                                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                    if (businessOrderDO!=null){
                                        businessOrderDO.setStatus(1);
                                        businessOrderDao.save(businessOrderDO);
                                    }
                                }else if ("已退费".equalsIgnoreCase(jsonObject1.getString("Status"))){
                                    logger.info("进入退费订单同步");
                                    baseNatAppointmentDO.setPayStatus("-1");
                                    baseNatAppointmentDO.setIsSuccess("-1");
                                    baseNatAppointmentDO.setCancelReson("患者本人线下取消");
                                    baseNatAppointmentDO.setCancelTime(new Date());
                                    baseNatAppointmentDO.setCancelBy(patientId);
                                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
                                    if (businessOrderDO!=null){
                                        businessOrderDO.setStatus(-1);
                                        businessOrderDao.save(businessOrderDO);
                                    }
                                    //取消号源
                                    //cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                                }
                                baseNatAppointmentDO.setVoucherNo(jsonObject1.getString("ApplyNo"));
                                baseNatAppointmentDao.save(baseNatAppointmentDO);
                            }
                            //取消号源
                            //cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                        }
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                    }
                }
            }

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -74,6 +74,8 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            oldDO.setDel(servicePackageDO.getDel());
            oldDO.setType(servicePackageDO.getType());
            oldDO.setIntroduce(servicePackageDO.getIntroduce());
            oldDO.setOrgCode(servicePackageDO.getOrgCode());
            oldDO.setOrgName(servicePackageDO.getOrgName());
            servicePackageDO= servicePackageDao.save(oldDO);
            servicePackageItemDao.deleteByServicePackageId(oldDO.getId());
        }

+ 32 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/lifeCare/PatientLifeCareEndpoint.java

@ -94,6 +94,38 @@ public class PatientLifeCareEndpoint  extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "infoCount")
    @ApiOperation(value = "查询工单数量")
    public ObjEnvelop infoCount(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient) {
        try {
            JSONObject allResult = lifeCareOrderService.queryInfoList(patient, null, 1, 5);
            if (allResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(allResult.getString(ResponseContant.resultMsg), -1);
            }
            int allCount = allResult.getIntValue(ResponseContant.count);
            JSONObject object = new JSONObject();
            object.put("allCount",allCount);
            JSONObject qxResult = lifeCareOrderService.queryInfoList(patient, -1, 1, 5);
            if (qxResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(qxResult.getString(ResponseContant.resultMsg), -1);
            }
            int qxCount = qxResult.getIntValue(ResponseContant.count);
            object.put("qxCount",qxCount);
            JSONObject wcResult = lifeCareOrderService.queryInfoList(patient, 2, 1, 5);
            if (wcResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(wcResult.getString(ResponseContant.resultMsg), -1);
            }
            int wcCount = wcResult.getIntValue(ResponseContant.count);
            object.put("wcCount",wcCount);
            return ObjEnvelop.getSuccess("查询成功",object);
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "findItemDict")
    @ApiOperation(value = "查找服务项字典")
    public ListEnvelop findItemDict() {