Browse Source

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

wsl 2 years ago
parent
commit
80aa3068fe

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicailRelationDao.java

@ -21,6 +21,9 @@ public interface YlzMedicailRelationDao extends PagingAndSortingRepository<YlzMe
    @Query("from YlzMedicalRelationDO a where   a.relationCode = ?1 and a.state=1 ")
    List<YlzMedicalRelationDO> findByOutpatientStatus(String outpatientId);
    @Query("from YlzMedicalRelationDO a where   a.relationCode = ?1 and a.state=1 and a.pageCode=?2 ")
    YlzMedicalRelationDO findByOutpatientPageCode(String outpatientId,String code);
    @Query("from YlzMedicalRelationDO a where a.logNo = ?1 ")
    YlzMedicalRelationDO findByLog_no(String logNo);

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

@ -14422,6 +14422,25 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("获取患者待结算信息开始!");
            YlzMedicalRelationDO ylzMedicalRelationDO = new YlzMedicalRelationDO();
            ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            if (ylzMedicalRelationDO!=null&&StringUtils.isNoneBlank(ylzMedicalRelationDO.getPageCode())){
                String result = confirmSettlementInfo(outpatientId,ylzMedicalRelationDO.getPageCode());
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(result);
                if (jsonObject.getString("flag").equalsIgnoreCase("1")){
                    com.alibaba.fastjson.JSONObject object1 = jsonObject.getJSONObject("encrypt_data");
                    BigDecimal b1 = new BigDecimal(object1.getString("tcjj_pay"));
                    BigDecimal b2 = new BigDecimal(object1.getString("sbjj_pay"));
                    BigDecimal b3 = new BigDecimal(object1.getString("gwy_pay"));
                    BigDecimal b4 = new BigDecimal(object1.getString("jzfp_pay"));
                    BigDecimal b5 = new BigDecimal(object1.getString("yljz_pay"));
                    BigDecimal b6 = new BigDecimal(object1.getString("other_pay"));
                    BigDecimal b7 = new BigDecimal(object1.getString("enterprise_supplement"));
                    Double price = b1.add(b2).add(b3).add(b4).add(b5).add(b6).add(b7).doubleValue();
                    if (Double.parseDouble(ylzMedicalRelationDO.getMedicalPrice())==price){
                        ylzMedicalRelationDO.setStatus(1);
                        ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                    }
                }
            }
            if (ylzMedicalRelationDO!=null&&ylzMedicalRelationDO.getStatus()==1){
                //医保已结算直接返回数据
                List<YlzMedicalMxDO> mxDOList = ylzMedicailMxDao.findByMedicalId(ylzMedicalRelationDO.getId());
@ -14545,7 +14564,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("医保结算结果获取start!");
            result = healthCareService.getSettlementResult(code);
            logger.info("医保结算结果获取end!");
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        }/*else{
            logger.info("医保结算页面start!");
            String registerNo = outpatientDO.getRegisterNo();

+ 34 - 20
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -481,21 +481,23 @@ public class ImService {
     * @param wechat_appid 微信公众号appid
     * @return
     */
    public List<String> append(String consult, String content, Integer type, Integer times, String patientcode, String wechat_appid, String agent) throws Exception {
    public List<String> append(String consult, String content, Integer type, Integer times, String patientcode, String wechat_appid, String agent,String sessionType) throws Exception {
        List<ConsultTeamLogDo> logs = new ArrayList<ConsultTeamLogDo>();
        ConsultTeamDo consultModel = consultTeamDao.findByConsult(consult);
        if (consultModel == null) {
            throw new Exception("咨询记录不存在!");
        }
        try {
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                prescriptionService.wxTempalteJPush("consult_remind_doctor", null, consultModel, content, "", "", "");
        if ("1".equals(sessionType)) {
            ConsultTeamDo consultModel = consultTeamDao.findByConsult(consult);
            if (consultModel == null) {
                throw new Exception("咨询记录不存在!");
            }
            try {
                if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                    prescriptionService.wxTempalteJPush("consult_remind_doctor", null, consultModel, content, "", "", "");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (consultModel.getEndMsgId() != null) {
                throw new Exception("咨询已结束!");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (consultModel.getEndMsgId() != null) {
            throw new Exception("咨询已结束!");
        }
        String[] arr = null;
@ -537,14 +539,26 @@ public class ImService {
        List<String> failed = new ArrayList<>();
        for (ConsultTeamLogDo log : logs) {
            String response = imUtil.sendTopicIM(patientcode, patient.getName(), consult, String.valueOf(log.getType()), log.getContent(), agent, patient.getName(), Integer.parseInt(IdCardUtil.getSexForIdcard_new(patient.getIdcard())), IdCardUtil.getAgeForIdcard(patient.getIdcard()));
            if (org.apache.commons.lang3.StringUtils.isNotEmpty(response)) {
                JSONObject resObj = JSON.parseObject(response);
                if (resObj.getInteger("status") == -1) {
                    throw new Exception("追问失败!" + resObj.getString("message"));
            String response = "";
            if ("1".equals(sessionType)){
                response = imUtil.sendTopicIM(patientcode, patient.getName(), consult, String.valueOf(log.getType()), log.getContent(), agent, patient.getName(), Integer.parseInt(IdCardUtil.getSexForIdcard_new(patient.getIdcard())), IdCardUtil.getAgeForIdcard(patient.getIdcard()));
                if (org.apache.commons.lang3.StringUtils.isNotEmpty(response)) {
                    JSONObject resObj = JSON.parseObject(response);
                    if (resObj.getInteger("status") == -1) {
                        throw new Exception("追问失败!" + resObj.getString("message"));
                    }
                    failed.add(String.valueOf(resObj.get("data")));
                }
            }
            else {
                response = imUtil.sendImMsgAgent(patientcode, patient.getName(), consult, String.valueOf(log.getType()), log.getContent(), "2", null,agent);
                if (org.apache.commons.lang3.StringUtils.isNotEmpty(response)) {
                    JSONObject resObj = JSON.parseObject(response);
                    if (resObj.getInteger("count") == -1) {
                        throw new Exception("追问失败!" + resObj.getString("messages"));
                    }
                    failed.add(resObj.getJSONArray("messages").get(0).toString());
                }
                failed.add(String.valueOf(resObj.get("data")));
            }
        }
        return failed;

+ 23 - 0
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -295,6 +295,29 @@ public class ImUtil {
		String response = HttpClientUtil.postBody(imAddr, params);
		return response;
	}
	/**
	 * 发送消息给IM
	 *
	 * @param from        来自
	 * @param contentType 1文字 2图片消息
	 * @param content     内容
	 */
	public String sendImMsgAgent(String from, String fromName, String sessionId, String contentType, String content, String businessType,String extend,String agent) {
		String imAddr = im_host + "api/v2/sessions/" + sessionId + "/messages";
		System.out.println("im地址"+imAddr);
		JSONObject params = new JSONObject();
		params.put("sender_id", from);
		params.put("sender_name", fromName);
		params.put("content_type", contentType);
		params.put("content", content);
		params.put("session_id", sessionId);
		params.put("business_type", businessType);
		params.put("extend",extend);
		params.put("agent",agent);
		String response = HttpClientUtil.postBody(imAddr, params);
		return response;
	}
	
	/**
	 * 更新会话状态

+ 13 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -121,6 +121,7 @@ zuul:
    svr-rehabilitation:
      path: /rehabilitation/**
      serviceId: svr-rehabilitation
endpoints:
  env:
    enabled: false
@ -130,7 +131,18 @@ endpoints:
    enabled: false
  heapdump:
    enabled: false
  configprops:
    enabled: false
  metrics:
    enabled: false
  features:
    enabled: false
  beans:
    enabled: false
  autoconfig:
    enabled: false
  loggers:
    enabled: false
# 信息安全
security:
  csrf:

+ 5 - 0
starter/swagger-starter/pom.xml

@ -12,6 +12,11 @@
    <artifactId>swagger-starter</artifactId>
    <dependencies>
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>swagger-bootstrap-ui</artifactId>
            <version>1.9.3</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>

+ 2 - 0
starter/swagger-starter/src/main/java/com/yihu/jw/SwaggerConfig.java

@ -1,5 +1,6 @@
package com.yihu.jw;
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
@ -22,6 +23,7 @@ import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
public class SwaggerConfig {
    public static final String API_VERSION = "v1.0";

+ 1 - 1
svr/svr-base/pom.xml

@ -110,7 +110,7 @@
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <groupId>com.yihu.jw</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>

+ 6 - 0
svr/svr-base/src/main/resources/application.yml

@ -88,6 +88,12 @@ FileTempPath:
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
swagger:
  basic:
    enable: true
    username: jw
    password: jkzl
---
spring:
  profiles: jwdev

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/consult/PatientConsultEndpoint.java

@ -428,7 +428,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "times", value = "")
			@RequestParam(value = "times",required = false) Integer times,
			@ApiParam(name = "patientCode", value = "居民CODE")
			@RequestParam(value = "patientCode",required = false) String patientCode){
			@RequestParam(value = "patientCode",required = false) String patientCode,
			@ApiParam(name = "sessionType", value = "1咨询会话、2:P2P会话")
			@RequestParam(value = "sessionType",defaultValue = "1",required = false) String sessionType){
		try {
			List<String> failed = new ArrayList<>();
			//处理语音文件
@ -453,7 +455,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				}
			}else{}
			String agent = getAgentUID();
			failed = imService.append(consult,content,type,times,patientCode,wechat_appid,agent);
			failed = imService.append(consult,content,type,times,patientCode,wechat_appid,agent,sessionType);
			return success(failed);
		}catch (Exception e){
			return failedListEnvelopException2(e);

+ 1 - 2
svr/svr-internet-hospital/pom.xml

@ -54,7 +54,6 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
@ -113,7 +112,7 @@
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <groupId>com.yihu.jw</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>

+ 2 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/SvrInternetHospitalApplication.java

@ -6,12 +6,14 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
 * Created by Trick on 2019/5/13.
 */
@SpringBootApplication
@EnableJpaAuditing
@EnableSwagger2
public class SvrInternetHospitalApplication extends SpringBootServletInitializer {
    public static void main(String[] args)  {

+ 2 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/SpringSecurityAuditorAware.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.hospital.config;
import org.springframework.context.annotation.Configuration;
@ -16,3 +17,4 @@ public class SpringSecurityAuditorAware implements AuditorAware {
        return "123";
    }
}
*/

+ 5 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/SwaggerDocs.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.hospital.config;
import io.github.swagger2markup.GroupBy;
@ -11,9 +12,11 @@ import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
*/
/**
 * Created by lith on 2018/11/23
 */
 *//*
public class SwaggerDocs {
    public static void main(String[] args) throws Exception {
        //1.请求 http://ip:port/swagger-resources获取group
@ -41,4 +44,4 @@ public class SwaggerDocs {
        converter.toFile(outputFile);
    }
}
}*/

+ 6 - 0
svr/svr-internet-hospital/src/main/resources/application.yml

@ -80,6 +80,12 @@ interceptor:
    status: 1 ###  1开启 0 关闭
    time: 2 ##对外接的accesstoken生命周期 2小时
swagger:
  basic:
    enable: true
    username: jw
    password: jkzl
---
spring:
  profiles: jwdev