Commit a26a2167 by jinxin

自建类型字段处理

parent 7edc35dc
......@@ -522,15 +522,19 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
return ServiceResponse.failure("-9999","参数不能为空!");
}
//wxAppid是唯一的,不能重复
List<String> wxAppidList = new ArrayList<>();
wxAppidList.add(enterpriseDTO.getWxaAppid());
List<String> list = wxEnterpriseService.getWxAppidListByList(wxAppidList);
if (CollUtil.isNotEmpty(list)){
return ServiceResponse.failure("-9999","自建小程序的appid存在重复!");
}
String wxaAppid = enterpriseDTO.getWxaAppid();
WxEnterpriseDTO wxEnterpriseDTO = this.selectByWxaAppid(wxaAppid);
if (StrUtil.isBlank(enterpriseDTO.getWxEnterpriseId())){
if (null != wxEnterpriseDTO){
return ServiceResponse.failure("-9999","自建小程序的appid存在重复!");
}
//默认是自建应用
enterpriseDTO.setWxSecurityType(5);
wxEnterpriseService.add(enterpriseDTO);
}else {
if(null != wxEnterpriseDTO && (!enterpriseDTO.getWxEnterpriseId().equals(wxEnterpriseDTO.getWxEnterpriseId()))){
return ServiceResponse.failure("-9999","自建小程序的appid存在重复!");
}
wxEnterpriseService.update(enterpriseDTO);
}
return ServiceResponse.success(true);
......
......@@ -45,7 +45,6 @@
<result column="open_corpid" property="openCorpid"/>
<result column="wxa_appid" property="wxaAppid" />
<result column="url_host" property="urlHost"/>
<result column="app_type" property="appType"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -53,7 +52,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type , wx_corpid , open_corpid , auto_active_flag , wxa_appid , url_host,app_type
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type , wx_corpid , open_corpid , auto_active_flag , wxa_appid , url_host
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -183,9 +182,6 @@
<if test="null != urlHost">
url_host ,
</if>
<if test="null != appType">
app_type ,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wxEnterpriseId != null">
......@@ -299,9 +295,6 @@
<if test="null != urlHost">
#{urlHost} ,
</if>
<if test="null != appType">
#{appType} ,
</if>
</trim>
</insert>
......@@ -426,10 +419,7 @@
wxa_appid = #{wxaAppid},
</if>
<if test="null != urlHost">
url_host = #{urlHost},
</if>
<if test="null != appType">
app_type = #{appType}
url_host = #{urlHost}
</if>
</set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
......@@ -443,8 +433,11 @@
<if test="gicContactFlag != null">
and contact_flag = #{gicContactFlag,jdbcType=INTEGER}
</if>
<if test=" appType != null">
and app_type = #{appType}
<if test=" appType != null and appType == 1">
and wx_security_type = 5
</if>
<if test=" appType != null and appType == 0">
and wx_security_type != 5
</if>
<if test="version != null and version == 2">
<if test="keyword != null and keyword != '' and enterpriseIds != null and enterpriseIds.size() > 0">
......@@ -560,7 +553,7 @@
from tab_haoban_wx_enterprise
where
status_flag = 1
and app_type = 1
and wx_security_type = 5
<if test="wxAppidList != null and wxAppidList.size() > 0">
and wxa_appid IN
<foreach collection="wxAppidList" item="id" index="index" open="(" close=")" separator=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment