huangwenjie 7 سال پیش
والد
کامیت
b922f6d0dd

+ 7 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -1,12 +1,15 @@
package com.yihu.wlyy.service.controller;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.entity.prescription.Prescription;
import com.yihu.wlyy.service.entity.prescription.PrescriptionPay;
import com.yihu.wlyy.service.service.prescription.PrescriptionCAService;
import com.yihu.wlyy.service.service.prescription.PrescriptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -193,12 +196,12 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "executeSickSettle",method = RequestMethod.POST)
	@ApiOperation("院内结算确认接口")
	public Result executeSickSettle(@ApiParam(name="json",value="json",defaultValue = "{}")
									@RequestParam(value = "json",required = true) String json)
	public Result executeSickSettle(
			@ApiParam(name="prescriptionCode",value="长处方单号",defaultValue = "")
			@RequestParam(value = "prescriptionCode",required = true) String prescriptionCode)
	{
		try {
			String re = prescriptionService.executeSickSettle(JSONObject.fromObject(json),null,null);
			String re = prescriptionService.executeSickSettle(prescriptionCode,null,null);
			return Result.success("院内结算确认接口!",re);
		} catch (Exception ex) {
			ex.printStackTrace();

+ 4 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionPayService.java

@ -0,0 +1,4 @@
package com.yihu.wlyy.service.service.prescription;
public class PrescriptionPayService {
}

+ 37 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.service.service.prescription;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.common.util.StringUtil;
import com.yihu.wlyy.service.dao.DoctorMappingDao;
import com.yihu.wlyy.service.dao.HospitalDao;
import com.yihu.wlyy.service.dao.PatientDao;
@ -59,6 +60,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private PrescriptionExpressageDao prescriptionExpressageDao;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private PrescriptionPayDao prescriptionPayDao;
    @Value("${redisChannel.prescription}")
    private String channelTopic;
@ -478,7 +481,7 @@ public class PrescriptionService extends ZysoftBaseService{
     * @return
     * @throws Exception
     */
    public String executeSickSettle(JSONObject json, String hospital, String licence)  throws Exception
    public String executeSickSettle(String prescriptionCode, String hospital, String licence)  throws Exception
    {
        if(hospital==null){
            String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
@ -490,6 +493,39 @@ public class PrescriptionService extends ZysoftBaseService{
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        if(prescription == null){
            throw new Exception("未找到该处方!");
        }
        if(StringUtils.isBlank(prescription.getVisitNo())){
            throw new Exception("处方为挂号成功");
        }
        PrescriptionPay prescriptionPay = prescriptionPayDao.findByPrescriptionPay(prescriptionCode);
        if(prescriptionPay == null){
            throw new Exception("支付失败,无法结算,请重新支付!");
        }
        //拼接结算参数
        JSONObject json = new JSONObject();
        json.put("cardNo",prescription.getSsc());// "cardNo": "病人卡号",
//            "saveDept": "开单科室编码",
//            "REGISTER_TYPE": "挂号类型编码",
//            "RATE_TYPE": "费别类型编码",
        json.put("settleDept","结算科室编码");//结算科室编码------待处理
        String jwdoctor = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(prescription.getDoctor(),hospital);
        json.put("saveOperator",jwdoctor);// "saveOperator": "开单人员编码",
        json.put("visitNo",prescription.getVisitNo());// "院内挂号号,取费用列表中最小的院内挂号号
        //医保支付需要组装一下参数
        if (1 == prescriptionPay.getType()){
            JSONObject insurResult = new JSONObject();
//            insurResult.put("zhzfe0",prescriptionPay.get)
            json.put("insurResult",insurResult);
        }
        String response = postSecond("executeSickSettle","院内结算确认接口",null,json,header,false,2);
        return response;

+ 10 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -17,6 +18,9 @@ public class PrescriptionService extends BaseService {
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    /**
     *  获取处方信息
     * @param prescriptionCode 处方code
@ -32,18 +36,18 @@ public class PrescriptionService extends BaseService {
     */
    public void dispensingComplete(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
    }
    /**
     * 返回支付信息
     * @param code
     * @param cardNo 病人卡号(社保卡号)
     * @param visitNo 挂号号
     * @return
     */
    public JSONObject getPayInfo(String code){
    public JSONObject getPayInfo(String cardNo,String visitNo) throws Exception {
        String result = jwPrescriptionService.getDispUnSettleFeeInfoList(cardNo,visitNo);
        JSONObject json = new JSONObject();
        //处方主信息{"yyksbm":"医生科室编号","bcsfcs":"本次收费次数","yszjhm":"医生证件号码","ysxm00":"医生姓名","mzlb00":"门诊类别","sfydgh":"是否药店挂号",
        // "bcghcs":"本次挂号次数","ghksmc":"挂号科室名称","cfxms0":"明细上传数量","mzlsh0":"医保挂号流水号 如果为空,将自动医保挂号并收费","ghfy00":"挂号费用",

+ 14 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -1,6 +1,12 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionPayDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
@ -118,13 +124,17 @@ public class JwPrescriptionService {
        return response;
    }
    public String executeSickSettle(String dictName) throws Exception{
    /**
     * 院内结算确认接口
     * @param prescriptionCode 处方CODE
     * @return
     * @throws Exception
     */
    public String executeSickSettle(String prescriptionCode) throws Exception{
        String url = jwUrl + "/third/prescription/executeSickSettle";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }