From 1e749fe5ebaf2664bfc658f1b51b7c54b82c9128 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Wed, 19 Jun 2024 16:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=20=E5=92=8C=20?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E6=96=87=E7=AB=A0=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlayletPublicAccountController.java | 14 ++- .../web/controller/tool/WxController.java | 7 +- .../com/playlet/web/service/WxService.java | 2 + .../PlayletPublicDetailAppServiceImpl.java | 2 +- .../web/service/impl/WxServiceImpl.java | 12 +++ .../system/playlet/account/account.html | 9 +- .../templates/system/playlet/account/add.html | 54 +++++++++++- .../system/playlet/account/edit.html | 85 ++++++++++++++++++- .../templates/system/playlet/detail/add.html | 6 ++ .../system/playlet/detail/detail.html | 4 + .../templates/system/playlet/detail/edit.html | 6 ++ .../system/domain/PlayletPublicAccount.java | 7 ++ .../system/domain/PlayletPublicDetail.java | 3 + .../system/PlayletPublicAccountMapper.xml | 6 +- .../system/PlayletPublicDetailMapper.xml | 6 +- 15 files changed, 209 insertions(+), 14 deletions(-) diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java index de5b97d..3d1e348 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java @@ -2,7 +2,9 @@ package com.playlet.web.controller.system; import java.util.List; +import com.playlet.common.core.domain.entity.SysUser; import com.playlet.system.domain.PlayletPublicDetail; +import com.playlet.system.service.ISysUserService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -32,6 +34,9 @@ public class PlayletPublicAccountController extends BaseController @Autowired private IPlayletPublicAccountService playletPublicAccountService; + @Autowired + private ISysUserService sysUserService; + @GetMapping("/wxQrcode/{id}") public String wxQrcode(@PathVariable("id") String id, ModelMap mmap) { @@ -68,6 +73,11 @@ public class PlayletPublicAccountController extends BaseController { startPage(); List list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount); + list.forEach(model->{ + if(model.getManagerId() != null){ + model.setManagerName(sysUserService.selectUserById(model.getManagerId()).getUserName()); + } + }); return getDataTable(list); } @@ -89,8 +99,9 @@ public class PlayletPublicAccountController extends BaseController * 新增公众号列 */ @GetMapping("/add") - public String add() + public String add(ModelMap modelMap) { + modelMap.put("users",sysUserService.selectUserList(new SysUser())); return prefix + "/add"; } @@ -115,6 +126,7 @@ public class PlayletPublicAccountController extends BaseController { PlayletPublicAccount playletPublicAccount = playletPublicAccountService.selectPlayletPublicAccountById(id); mmap.put("playletPublicAccount", playletPublicAccount); + mmap.put("users",sysUserService.selectUserList(new SysUser())); return prefix + "/edit"; } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/tool/WxController.java b/playlet-admin/src/main/java/com/playlet/web/controller/tool/WxController.java index fd19c51..590358f 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/tool/WxController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/tool/WxController.java @@ -46,6 +46,11 @@ public class WxController { return Result.success(wxService.getWxInfo(openId, accessToken)); } - + @ApiOperation(value = "获取jsapi_ticket", httpMethod = "GET") + @GetMapping("/getWxTicket") + @ResponseBody + public Result getWxTicket(){ + return Result.success(wxService.getWxTicket()); + } } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/WxService.java b/playlet-admin/src/main/java/com/playlet/web/service/WxService.java index 3afb1c7..a8fa59a 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/WxService.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/WxService.java @@ -14,4 +14,6 @@ public interface WxService { String getWxInfo(String openId, String accessToken); + String getWxTicket(); + } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicDetailAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicDetailAppServiceImpl.java index d5a745f..f18bab2 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicDetailAppServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicDetailAppServiceImpl.java @@ -48,7 +48,7 @@ public class PlayletPublicDetailAppServiceImpl implements PlayletPublicDetailApp PlayletPublicDetail model = iPlayletPublicDetailService.getById(id); model.setPlayletPublicAccount(iPlayletPublicAccountService.selectPlayletPublicAccountById(model.getPublicId())); // 调用接口查询二维码信息 -- 富文本格式 - if("01".equals(model.getType())){ + if("01".equals(model.getType()) && model.getItemId() != null){ PlayletItem item = iPlayletItemService.getById(model.getItemId()); fillQrcode(item.getItemId(), model); } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java index 8c15c90..5e0f4c8 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java @@ -60,4 +60,16 @@ public class WxServiceImpl implements WxService { log.info("调用微信获取用户信息,响应内容:{}", result); return result; } + + @Override + public String getWxTicket() { + String accessTokenResult = HttpUtils.sendGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx2b7d9259c1188067&secret=919165aae35838480986555f6c03ae6f"); + log.info("accessTokenResult : {} ", accessTokenResult); + String accessToken = JSONObject.parseObject(accessTokenResult).getString("access_token"); + String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi"; + log.info("调用微信获取Ticket,入参url:{}", url); + String result = HttpUtils.sendGet(url); + log.info("调用微信获取Ticket,响应内容:{}", result); + return result; + } } diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/account.html b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html index a508435..72a50d6 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/account/account.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html @@ -100,15 +100,20 @@ }, { field: 'originalContentCount', - title: '原创片数' + title: '原创篇数' }, { field: 'followersCount', title: '关注人数' }, + { + field: 'managerName', + title: '运营人员' + }, { field: 'remark', - title: '备注' + title: '备注', + visible: false }, { title: '操作', diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/add.html b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html index b49440d..23f6af9 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/account/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html @@ -2,6 +2,7 @@ + @@ -24,7 +25,15 @@
- + +
+
+
+ +
+
@@ -49,14 +58,16 @@
- +
- + +
+ \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html index 55414e2..2ae2793 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html @@ -2,6 +2,8 @@ + +
@@ -24,7 +26,7 @@
- +
@@ -33,10 +35,21 @@
+
+ +
+ +
+
- + +
+ +
@@ -58,14 +71,17 @@
- +
- + +
+ + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html b/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html index efc549d..3be9eec 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html @@ -36,6 +36,12 @@ +
+ +
+ +
+
diff --git a/playlet-admin/src/main/resources/templates/system/playlet/detail/detail.html b/playlet-admin/src/main/resources/templates/system/playlet/detail/detail.html index 491e294..a22927d 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/detail/detail.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/detail/detail.html @@ -85,6 +85,10 @@ field: 'title', title: '标题' }, + { + field: 'authorAlias', + title: '作者花名' + }, { field: 'starCount', title: '点赞数' diff --git a/playlet-admin/src/main/resources/templates/system/playlet/detail/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/detail/edit.html index 409b5d9..a00537d 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/detail/edit.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/detail/edit.html @@ -22,6 +22,12 @@
+
+ +
+ +
+
diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java index 6047fdc..42f0773 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java @@ -1,6 +1,7 @@ package com.playlet.system.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.playlet.common.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; @@ -48,6 +49,12 @@ public class PlayletPublicAccount extends BaseEntity @ApiModelProperty(value = "作者花名") private String authorAlias; + @ApiModelProperty(value = "运营人员id") + private Long managerId; + + @TableField(exist = false) + private String managerName; + /** 头像 */ @Excel(name = "头像") @ApiModelProperty(value = "头像") diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java index 586d7db..867f68e 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java @@ -56,6 +56,9 @@ public class PlayletPublicDetail extends BaseEntity @ApiModelProperty(value = "标题") private String title; + @ApiModelProperty(value = "作者花名") + private String authorAlias; + @ApiModelProperty(value = "图片") private String imgUrl; diff --git a/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml index 6a2c95b..e6ba8fb 100644 --- a/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml +++ b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml @@ -10,6 +10,7 @@ + @@ -22,7 +23,7 @@ - select id, name, public_type, introduction, author_alias, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account + select id, name, public_type, introduction, author_alias, manager_id, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account