Browse Source

上传代码时,更新小程序名

dev_shibei_match
zhaoqifeng 5 years ago
parent
commit
d88c2d2a36
  1. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
  2. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  3. 7
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java

@ -63,5 +63,16 @@ public interface MiniInfoDao extends BaseDao<MiniInfoEntity> {
* @return java.lang.String
*/
String getNickName(@Param("customerId") String customerId, @Param("clientType") String clientType);
/**
* 更新小程序名
* @author zhaoqifeng
* @date 2020/12/2 9:37
* @param customerId
* @param clientType
* @param nickName
* @return void
*/
void updateNickName(@Param("customerId") String customerId, @Param("clientType") String clientType, @Param("nickName") String nickName);
}

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -142,10 +142,14 @@ public class CodeServiceImpl implements CodeService {
resiName = getNickName(authInfo.getAuthorizerAppid());
AuthorizationInfoDTO workAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.WORK);
workName = getNickName(workAuthInfo.getAuthorizerAppid());
miniInfoDao.updateNickName(formDTO.getCustomerId(), formDTO.getClientType(), resiName);
miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.WORK, workName);
} else {
workName = getNickName(authInfo.getAuthorizerAppid());
AuthorizationInfoDTO resiAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.RESI);
resiName = getNickName(resiAuthInfo.getAuthorizerAppid());
miniInfoDao.updateNickName(formDTO.getCustomerId(), formDTO.getClientType(), workName);
miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.RESI, resiName);
}
//获取小程序居民端与工作端名称
@ -831,6 +835,7 @@ public class CodeServiceImpl implements CodeService {
String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken , JSON.toJSONString(jsonObject)).getData();
Map map = JSON.parseObject(data, Map.class);
Map authInfo = (Map) map.get(ModuleConstant.AUTHORIZER_INFO);
ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name();
return ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name();
}

7
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml

@ -31,6 +31,13 @@
NOW()
)
</insert>
<update id="updateNickName">
update mini_info
set NICK_NAME = #{nickName}
where CUSTOMER_ID = #{customerId}
and CLIENT_TYPE = #{clientType}
and DEL_FLAG = '0'
</update>
<!-- 删除小程序信息 -->
<delete id="deleteMiniInfo">

Loading…
Cancel
Save