Browse Source

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

Trick 5 years ago
parent
commit
bdf1d504bd

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

@ -220,6 +220,12 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
                mailno = e.attributeValue("mailno");
                destCode = e.attributeValue("destcode");
            }
            if(StringUtils.isNotBlank(filter_result) && "1".equals(filter_result)){
                logger.info("顺丰快递下订单失败:派送地址需人工审核,门诊编号:"+sfexpress_obj.getOutpatientId());
                throw new Exception("顺丰快递下订单失败:派送地址需人工审核");
            }
            if(StringUtils.isNotBlank(filter_result) && "3".equals(filter_result)){
                logger.info("顺丰快递下订单失败:派送地址不可派送,门诊编号:"+sfexpress_obj.getOutpatientId());
                throw new Exception("顺丰快递下订单失败:派送地址不可派送");
@ -539,10 +545,10 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
            if("福建省".equals(d_province)){
                end_address_name = "省内";
            }else{
                end_address_name = d_province;
                end_address_name = "%"+d_province.replaceAll("省","")+"%";
            }
        }
        end_address_name = "%"+end_address_name.replaceAll("省","").replaceAll("市","")+"%";
//        end_address_name = "%"+end_address_name.replaceAll("省","").replaceAll("市","")+"%";
        WlyyExpressagePriceDO sfprice =  expressagePriceDao.getExprePriceByIdAndEndAdressName("shunfeng",end_address_name);
        return sfprice;
    }
@ -591,6 +597,11 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
                    return true;
                }
                if(StringUtils.isNotBlank(filter_result) && "1".equals(filter_result)){
                    logger.info("顺丰快递下订单失败:派送地址需人工审核,处方编号:"+sfexpress_obj.getOutpatientId());
                    return true;
                }
                if(StringUtils.isNotBlank(filter_result) && "3".equals(filter_result)){
                    logger.info("顺丰快递下订单失败:派送地址不可派送,处方编号:"+sfexpress_obj.getOutpatientId());
                    return true;

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

@ -3267,7 +3267,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public String getSFExpressInfo(String admNo,String realOrder)throws Exception {
    
        //根据门诊唯一号取就诊记录
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctor(admNo);
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
        
        String result = "";
        
@ -3310,10 +3310,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    sfJsonObject.put("d_name", sfexpress_obj.getName());
                    sfJsonObject.put("d_provinceName", sfexpress_obj.getProvinceName());
                    sfJsonObject.put("d_cityName", sfexpress_obj.getCityName());
                    sfJsonObject.put("d_townName", sfexpress_obj.getTownName());
                    sfJsonObject.put("d_address", sfexpress_obj.getAddress());
                    sfJsonObject.put("d_phone",sfexpress_obj.getMobile());
                    sfJsonObject.put("express_type",11);
                    sfJsonObject.put("pay_method",2);
                    sfJsonObject.put("receive_time","");
                    sfJsonObject.put("dispensaryType",2);
                    result = sfJsonObject.toJSONString();
                }

+ 27 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/config/BeanConfig.java

@ -0,0 +1,27 @@
package com.yihu.jw.entrance.config;
import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class BeanConfig {
    //顺丰快递接口请求地址
    @Value("${express.sf_url}")
    private String sf_url;
    //顺丰快递接口接入编码
    @Value("${express.sf_code}")
    private String sf_code;
    //顺丰快递接口checkword
    @Value("${express.sf_check_word}")
    private String sf_check_word;
    @Bean(name = "prescriptionExpressageService")
    PrescriptionExpressageService prescriptionExpressageService(){
        return new PrescriptionExpressageService(sf_url,sf_code,sf_check_word);
    }
}

File diff suppressed because it is too large
+ 8 - 4
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java


+ 53 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/SfRoutePushController.java

@ -0,0 +1,53 @@
package com.yihu.jw.entrance.controller.third;
import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.net.URLDecoder;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/11/7
 */
@RestController
@RequestMapping(value ="/openRoutePush")
@Api(value = "顺丰路由推送", description = "顺丰路由推送", tags = {"hospital-entrance顺丰路由推送"})
public class SfRoutePushController extends EnvelopRestEndpoint {
    private static Logger logger = LoggerFactory.getLogger(SfRoutePushController.class);
    @Autowired
    private PrescriptionExpressageService sfexpressService;
    private String successxml = "<Response service='RoutePushService'><Head>OK</Head></Response>";
    private String failedxml = "<Response service='RoutePushService'><Head>ERR</Head><ERROR code='-1'>系统发生数据错误或运行时异常</ERROR></Response>";
    @RequestMapping(value="/routepushservice",method = RequestMethod.POST)
    @ApiOperation("顺丰路由信息推送")
    public Envelop SFRoutePushService (
            @ApiParam(name="content", value="入参报文") @RequestParam(value = "content",required = true) String content){
        try {
            content = URLDecoder.decode(content,"utf-8");
            logger.info("顺丰路由信息推送,xml="+content);
            sfexpressService.SFRoutePushService(content);
            return success(successxml);
        }catch (Exception e){
            logger.error("接收顺丰路由信息推送失败,入参xml:"+content);
            //日志文件中记录异常信息
            //返回接口异常信息处理结果
            return failed(failedxml);
        }
    }
}

+ 7 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -279,10 +279,15 @@ public class PrescriptionStatusUpdateService {
                    //结束门诊
                    outpatientDO.setStatus("2");
    
                    //TODO:结束咨询
                    String consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                    if(StringUtils.isNoneBlank(consultCode)){
                        imService.finish(consultCode,"admin",2);
                        try {
                            imService.finish(consultCode,"admin",2);
                        }catch(Exception e)  {
                            e.printStackTrace();
                            logger.info("自动结束咨询报错 consultCode: "+consultCode);
                        }
                       
                    }
                }
                outpatientDao.save(outpatientDOs);

+ 2 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/expressage/ExpressageEndpoint.java

@ -32,8 +32,6 @@ public class ExpressageEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PrescriptionExpressageService sfexpressService;
    @Autowired
    private OutpatientDao outpatientDao;
    private String successxml = "<Response service='RoutePushService'><Head>OK</Head></Response>";
    private String failedxml = "<Response service='RoutePushService'><Head>ERR</Head><ERROR code='-1'>系统发生数据错误或运行时异常</ERROR></Response>";
@ -89,7 +87,7 @@ public class ExpressageEndpoint extends EnvelopRestEndpoint {
            return success(expreprice);
        }catch (Exception e){
            //返回接口异常信息处理结果
            return failed("获取快递费用,"+e.getMessage());
            return failed("获取快递费用失败,"+e.getMessage());
        }
    }
@ -106,7 +104,7 @@ public class ExpressageEndpoint extends EnvelopRestEndpoint {
            if(result){
                return success("地址可派送!");
            }else{
                return failed("地址不可派送!");
                return failed("地址需要人工审核或不可派送!");
            }
        }catch (Exception e){