Commit c5bee43b37c2e3909ec94aa171eaf0b506468ef4

Authored by litao
1 parent f7e0c21fae

二维码获取类型抽取

Showing 3 changed files with 120 additions and 1 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java View file @ c5bee43
... ... @@ -392,6 +392,9 @@
392 392  
393 393 PersonModel person = mongoTemplate.findById(userId, PersonModel.class);
394 394  
  395 + if (person == null)
  396 + return "http://weixin.qq.com/r/Fi9bQyLEgH--rWYg93oE";
  397 +
395 398 Map<String, String> params = new HashMap<>();
396 399 params.put("hId", hId);
397 400 params.put("dpId", person.getType() == 2 ? "2" : "1");
platform-biz-service/src/main/resources/mainOrm/master/WeixinQrcodeConfigMapper.xml View file @ c5bee43
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.lyms.platform.permission.dao.master.WeixinQrcodeConfigMapper">
  4 +
  5 + <resultMap id="WeixinShowqrcodeConfigResultMap" type="com.lyms.platform.permission.model.WeixinQrcodeConfig">
  6 + <id column="id" property="id" jdbcType="INTEGER" />
  7 + <result column="hospitalId" property="hospitalId" jdbcType="VARCHAR" />
  8 + <result column="dp_id" property="dpId" jdbcType="INTEGER" />
  9 + <result column="ticket" property="ticket" jdbcType="VARCHAR" />
  10 + <result column="wx_url" property="wxUrl" jdbcType="VARCHAR" />
  11 + <result column="created" property="created" jdbcType="TIMESTAMP" />
  12 + <result column="modified" property="modified" jdbcType="TIMESTAMP" />
  13 + </resultMap>
  14 +
  15 +
  16 +
  17 + <insert id="addWeixinShowqrcodeConfig" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfig">
  18 + <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER">
  19 + SELECT LAST_INSERT_ID()
  20 + </selectKey>
  21 + insert into weixin_qrcode_config (hospitalId,dp_id,ticket,created,modified,wx_url) values (#{hospitalId},#{dpId},#{ticket},#{created},#{modified},#{wxUrl})
  22 + </insert>
  23 +
  24 +
  25 +
  26 + <update id="updateWeixinShowqrcodeConfig" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfig">
  27 + update weixin_qrcode_config <set><if test="hospitalId != null and hospitalId != ''">
  28 + hospitalId = #{hospitalId,jdbcType=VARCHAR},
  29 + </if>
  30 +
  31 + <if test="dpId != null and dpId >= 0">
  32 + dp_id = #{dpId,jdbcType=INTEGER},
  33 + </if>
  34 + <if test="wxUrl != null">
  35 + wx_url = #{wxUrl,jdbcType=VARCHAR},
  36 + </if>
  37 + <if test="ticket != null and ticket != ''">
  38 + ticket = #{ticket,jdbcType=VARCHAR},
  39 + </if>
  40 + <if test="created != null">
  41 + created = #{created,jdbcType=TIMESTAMP},
  42 + </if>
  43 + <if test="modified != null">
  44 + modified = #{modified,jdbcType=TIMESTAMP},
  45 + </if>
  46 + </set>
  47 + where id = #{id,jdbcType=INTEGER}
  48 + </update>
  49 +
  50 +
  51 + <delete id="deleteWeixinShowqrcodeConfig" parameterType="java.lang.Integer">
  52 +delete from weixin_qrcode_config where id = #{id,jdbcType=INTEGER}
  53 +</delete>
  54 +
  55 +
  56 +
  57 + <select id="getWeixinShowqrcodeConfig" resultMap="WeixinShowqrcodeConfigResultMap" parameterType="java.lang.Integer">
  58 +select id,hospitalId,dp_id,ticket,created,modified,wx_url
  59 + from weixin_qrcode_config where id = #{id,jdbcType=INTEGER}
  60 +</select>
  61 +
  62 +
  63 + <sql id="orderAndLimit">
  64 + <if test="sort != null and sort != '' ">
  65 + order by ${sort}
  66 + <if test="need != null">
  67 + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
  68 + </if>
  69 + </if>
  70 + </sql>
  71 +
  72 +
  73 +
  74 + <sql id="WeixinShowqrcodeConfigCondition">
  75 + <where>
  76 + 1 = 1
  77 + <if test="id != null and id >= 0">
  78 + and id = #{id,jdbcType=INTEGER}
  79 + </if>
  80 + <if test="hospitalId != null and hospitalId != ''">
  81 + and hospitalId = #{hospitalId,jdbcType=VARCHAR}
  82 + </if>
  83 + <if test="dpId != null and dpId >= 0">
  84 + and dp_id = #{dpId,jdbcType=INTEGER}
  85 + </if>
  86 + <if test="ticket != null and ticket != ''">
  87 + and ticket = #{ticket,jdbcType=VARCHAR}
  88 + </if>
  89 + <if test="created != null">
  90 + and created = #{created,jdbcType=TIMESTAMP}
  91 + </if>
  92 + <if test="wxUrl != null">
  93 + and wx_url = #{wxUrl,jdbcType=VARCHAR}
  94 + </if>
  95 + <if test="modified != null">
  96 + and modified = #{modified,jdbcType=TIMESTAMP}
  97 + </if>
  98 + </where>
  99 + </sql>
  100 +
  101 +
  102 +
  103 + <select id="queryWeixinShowqrcodeConfig" resultMap="WeixinShowqrcodeConfigResultMap" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfigQuery">
  104 + select id,hospitalId,dp_id,ticket,created,modified,wx_url
  105 + from weixin_qrcode_config
  106 + <include refid="WeixinShowqrcodeConfigCondition" />
  107 + <include refid="orderAndLimit" />
  108 + </select>
  109 +
  110 +
  111 +
  112 + <select id="queryWeixinShowqrcodeConfigCount" resultType="int" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfigQuery">
  113 + select count(1) from weixin_qrcode_config
  114 + <include refid="WeixinShowqrcodeConfigCondition" />
  115 + </select>
  116 +</mapper>
platform-operate-api/src/main/resources/database.properties View file @ c5bee43
... ... @@ -88,5 +88,5 @@
88 88 or.code.url=https://rp-api.healthbaby.com.cn/scan?code={0}
89 89 or.code.create.url=http://ams.api.healthbaby.com.cn/v1/create/qrcode
90 90 # 二维码地址生成方式 1=本地 2=线上
91   -or.code.create.type=2
  91 +or.code.create.type=1