Parcourir la source

Merge branch 'dev' of suhaiwen/wlyy2.0 into dev

叶仕杰 il y a 4 ans
Parent
commit
243105ac15

+ 20 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/DictDeptDescDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictDiseaseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/6/18
 */
public interface DictDeptDescDao extends PagingAndSortingRepository<DictDeptDescDO, String>, JpaSpecificationExecutor<DictDeptDescDO> {
    DictDeptDescDO findByDeptCodeAndOrgCode(String deptCode,String orgCode);
    List<DictDeptDescDO> findByOrgCode(String orgCode);
}

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

@ -2,11 +2,13 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorPatientDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
@ -238,6 +240,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    @Autowired
    private DictDeptDescDao dictDeptDescDao;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -1038,6 +1043,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return rs;
    }
    /**
     * 获取医生列表.
     *
@ -6940,4 +6949,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,openid);
    }
    /**
     * 查询科室简介
     * @param orgCode
     * @param deptCode
     * @return
     */
    public MixEnvelop findDeptDesc(String orgCode, String deptCode) {
        DictDeptDescDO deptDescDO = dictDeptDescDao.findByDeptCodeAndOrgCode(deptCode, orgCode);
        if (deptDescDO!=null){
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,deptDescDO);
        }else {
            return MixEnvelop.getError("无该科室简介");
        }
    }
    /**
     * 查询机构科室
     * @param orgCode
     * @return
     */
    public MixEnvelop findDeptByOrgCode(String orgCode) {
        List<DictDeptDescDO> deptDescDOList = dictDeptDescDao.findByOrgCode(orgCode);
        if (deptDescDOList==null || deptDescDOList.size()==0){
            return MixEnvelop.getError("无科室信息");
        }
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,deptDescDOList);
    }
}

+ 19 - 9
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -850,6 +850,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    }
    public List<BusinessOrderDO> selectListStatus(String relationCode){
        List<BusinessOrderDO> businessOrderDOList = businessOrderDao.selectListByRelationCode(relationCode);
        return businessOrderDOList;
    }
    /**
     * 易联众退款
     * @param wechatId
@ -1159,16 +1166,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @return
     * @throws Exception
     */
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId) throws Exception {
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patientId);
        BusinessOrderDO businessOrderDO = new BusinessOrderDO();
        businessOrderDO.setPatient(patientId);
        businessOrderDO.setPatientName(patientDO.getName());
        businessOrderDO.setCreateTime(DateUtil.getNowDate());
        businessOrderDO.setOrderCategory("5");
        businessOrderDO.setDescription("眼科就诊卡充值");
        businessOrderDO.setDescription("就诊卡充值");
        businessOrderDO.setPayPrice(jkje);
        businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        businessOrderDO.setRelationCode(mzhm);
        businessOrderDO.setRelationName("就诊卡充值");
        businessOrderDO.setStatus(0);
        if (paymentType==1){
            businessOrderDO.setPayType(2);
        }
@ -1181,31 +1191,31 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (type==1){
            businessOrderDO.setOrderType(11);
        }
        Map<String,Object> map=null;
        Map<String,Object> map= new HashMap<>();
        String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), hospitalId);
        logger.info("眼科获取充值订单接口调用结果:"+rs);
        Map<String,Object> rsMap = JSONObject.parseObject(rs, Map.class);
        if ("10000".equalsIgnoreCase(rsMap.get("code").toString())){
            businessOrderDO.setYkOrderNo(rsMap.get("value").toString());
        }else {
            map.put("error","眼科接口调用失败");
            logger.info("error="+"眼科接口调用失败");
            return map;
            logger.info("error=眼科接口调用失败");
            return rsMap;
        }
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
        if (patientWechatDoList.isEmpty()){
        if (patientWechatDoList==null || patientWechatDoList.size()==0){
            map.put("error","无openId");
            logger.info("error="+"无openId");
            logger.info("error=无openId");
            return map;
        }
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        String url = wxWechatDO.getBaseUrl();
        String notifyUrl =url;
        String price = (int)(businessOrderDO.getPayPrice()*100)+"";
        map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,WeChatConfig.TRADE_TYPE_JSAPI,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl);
        map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,wxPayType,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl);
        logger.info("success="+JSONObject.toJSONString(map));
        return map;
    }

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/order/dao/BusinessOrderDao.java

@ -22,6 +22,10 @@ public interface BusinessOrderDao extends PagingAndSortingRepository<BusinessOrd
    BusinessOrderDO selectByRelationCode(String relationCode);
    @Query("from BusinessOrderDO w where w.relationCode = ?1 order by createTime desc ")
    List<BusinessOrderDO> selectListByRelationCode(String relationCode);
    @Query("from BusinessOrderDO w where w.traceNo = ?1 ")
    BusinessOrderDO selectByTraceNo(String traceNo);

+ 63 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDeptDescDO.java

@ -0,0 +1,63 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.aspectj.weaver.ast.Test;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/6/18
 */
@Entity
@Table(name = "dict_dept_desc")
@SequenceGenerator(name="id_generated", sequenceName="DICT_HOSPITAL_DEPT_SEQ")
public class DictDeptDescDO extends UuidIdentityEntityWithOperator {
    @Column(name = "org_code")
    private String orgCode;
    @Column(name = "dept_code")
    private String deptCode;
    @Column(name = "dept_name")
    private String deptName;
    @Column(name = "dept_description")
    private String deptDescription;
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    public String getDeptDescription() {
        return deptDescription;
    }
    public void setDeptDescription(String deptDescription) {
        this.deptDescription = deptDescription;
    }
}

+ 13 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -109,6 +109,18 @@ public class BaseHospitalRequestMapping {
         * 查询机构底下部门
         */
        public static final String findDeptByHospital ="/findDeptByHospital";
        /**
         * 查询机构底下部门
         */
        public static final String findDeptDescByDeptCodeAndOrgCode ="/findDeptDescByDeptCodeAndOrgCode";
        /**
         * 查询机构底下部门
         */
        public static final String findDeptByOrgCode ="/findDeptByOrgCode";
    
        /**
         * 查询有所有已开放的科室
@ -423,6 +435,7 @@ public class BaseHospitalRequestMapping {
        public static final String tradeQuery= "/tradeQuery";
        public static final String selectOrderStatus="/selectOrderStatus";
        public static final String selectOrderListStatus="/selectOrderListStatus";
        public static final String selectPrescriptionList = "/selectPrescriptionList";

+ 42 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -37,6 +37,7 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -267,6 +268,24 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptDescByDeptCodeAndOrgCode)
    @ApiOperation(value = "查询科室介绍", notes = "查询科室介绍")
    public MixEnvelop findDeptDesc(@ApiParam(name = "orgCode", value = "机构code")
                                          @RequestParam(value = "orgCode", required = true)String orgCode,
                                          @ApiParam(name = "deptCode", value = "部门code")
                                          @RequestParam(value = "deptCode", required = true)String deptCode) {
        return prescriptionService.findDeptDesc(orgCode,deptCode);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByOrgCode)
    @ApiOperation(value = "查询机构下所有科室", notes = "查询机构下所有科室")
    public MixEnvelop findDeptByOrgCode(@ApiParam(name = "orgCode", value = "机构code")
                                   @RequestParam(value = "orgCode", required = true)String orgCode) {
        return prescriptionService.findDeptByOrgCode(orgCode);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByKeyWord)
    @ApiOperation(value = "查询有所有已开放的科室", notes = "查询有所有已开放的科室")
@ -1274,9 +1293,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "patientId", value = "居民Ccode", required = true)
            @RequestParam(required = true)String patientId,
            @ApiParam(name = "hospitalId", value = "医院Ccode", required = true)
            @RequestParam(required = true)String hospitalId) throws Exception {
            @RequestParam(required = true)String hospitalId,
            @ApiParam(name = "wxPayType", value = "微信交易类型 公众号支付:JSAPI  原生扫码支付:NATIVE", required = true)
            @RequestParam(required = true)String wxPayType) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId));
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId,wxPayType));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
@ -1300,7 +1321,25 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 查询支付info
     * @param relationCode
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.selectOrderListStatus)
    @ApiOperation("查询支付info")
    public ObjEnvelop selectOrderListStatus(
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectListStatus(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 易联众统一退款