1. 优化了查询SQL
2. 控制台调试支持选择人员
This commit is contained in:
parent
363d968635
commit
6b9acef655
@ -1,4 +1,4 @@
|
||||
package cn.com.tenlion.systemcard.controller.app.api.cardconsole;
|
||||
package cn.com.tenlion.systemcard.controller.api.cardconsole;
|
||||
|
||||
import cn.com.tenlion.configcolumn.pojo.dtos.configcolumngroup.ConfigColumnGroupDTO;
|
||||
import cn.com.tenlion.projectconfig.util.ProjectConfigUtil;
|
||||
@ -29,8 +29,8 @@ import java.util.Map;
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/cardconsole")
|
||||
public class CardConsoleAppController extends DefaultBaseController {
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/cardconsole")
|
||||
public class CardConsoleController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IMiniappUserService iMiniappUserService;
|
@ -1,6 +1,7 @@
|
||||
package cn.com.tenlion.systemcard.controller.app.api.cardtemplatescans;
|
||||
|
||||
import cn.com.tenlion.systemcard.pojo.vos.cardtemplatescans.CardTemplateScansSaveVO;
|
||||
import cn.com.tenlion.systemcard.socket.CardLogSocket;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.common.component.SecurityComponent;
|
||||
@ -110,8 +111,11 @@ public class CardTemplateScansAppController extends DefaultBaseController {
|
||||
params.put("cardTemplateUseUserId", userId);
|
||||
}
|
||||
page.setParams(params);
|
||||
return cardTemplateScansService.listPage(page);
|
||||
SuccessResultList<List<CardTemplateScansDTO>> list = cardTemplateScansService.listPage(page);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
CardLogSocket cardLogSocket;
|
||||
|
||||
}
|
@ -21,7 +21,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "CBC日志控制台")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/cardconsole")
|
||||
public class CardConsoleController extends DefaultBaseController {
|
||||
public class CardConsoleRouteController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ServerProperties systemProperties;
|
||||
@ -33,4 +33,10 @@ public class CardConsoleController extends DefaultBaseController {
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("appuser")
|
||||
public ModelAndView appUser() {
|
||||
ModelAndView mv = new ModelAndView("cardconsole/select-department-appuser");
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.com.tenlion.systemcard.filter;
|
||||
|
||||
import cn.com.tenlion.projectconfig.util.ProjectConfigUtil;
|
||||
import cn.com.tenlion.systemcard.socket.CardLogSocket;
|
||||
import ink.wgink.common.component.SecurityComponent;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
@ -33,7 +34,9 @@ public class CardAppException {
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ModelAndView customException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
if (!ProjectConfigUtil.getSwitch("consoleDebugSwitch")) {
|
||||
return null;
|
||||
}
|
||||
e.printStackTrace();
|
||||
HttpServletRequest httpRequest = (HttpServletRequest) httpServletRequest;
|
||||
String token = httpRequest.getHeader("token");
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.com.tenlion.systemcard.filter;
|
||||
|
||||
import cn.com.tenlion.projectconfig.util.ProjectConfigUtil;
|
||||
import cn.com.tenlion.systemcard.socket.CardLogSocket;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.common.component.SecurityComponent;
|
||||
@ -38,6 +39,10 @@ public class CardAppFilter extends DefaultBaseController implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
if (!ProjectConfigUtil.getSwitch("consoleDebugSwitch")) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
return;
|
||||
}
|
||||
HttpServletRequest httpRequest = (HttpServletRequest) servletRequest;
|
||||
String token = httpRequest.getHeader("token");
|
||||
String url = httpRequest.getRequestURI();
|
||||
|
@ -1,8 +1,10 @@
|
||||
package cn.com.tenlion.systemcard.service.cardtemplatescans.impl;
|
||||
|
||||
import cn.com.tenlion.systemcard.pojo.dtos.cardtemplate.CardTemplateDTO;
|
||||
import cn.com.tenlion.systemcard.pojo.dtos.cardtemplateuse.CardTemplateUseDTO;
|
||||
import cn.com.tenlion.systemcard.pojo.vos.cardtemplatescans.CardTemplateScansSaveVO;
|
||||
import cn.com.tenlion.systemcard.service.cardtemplateuse.ICardTemplateUseService;
|
||||
import cn.com.tenlion.systemcard.socket.CardLogSocket;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.module.wechat.pojo.pos.miniapp.MiniappUserPO;
|
||||
@ -226,6 +228,7 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CardTemplateScansBO> listBO(Map<String, Object> params) {
|
||||
return cardTemplateScansDao.listBO(params);
|
||||
@ -240,23 +243,49 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements
|
||||
public SuccessResultList<List<CardTemplateScansDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<CardTemplateScansDTO> cardTemplateScansDTOs = list(page.getParams());
|
||||
// 加载系统默认名片在最上面
|
||||
if(1 == page.getPage() && page.getParams().get("homePage") != null && 1 == Integer.valueOf(page.getParams().get("homePage").toString())) {
|
||||
// 为了让系统默认名片在最上面 , 把本页的系统默认名片先删除掉
|
||||
Iterator<CardTemplateScansDTO> scansDTOIterator = cardTemplateScansDTOs.iterator();
|
||||
while(scansDTOIterator.hasNext()) {
|
||||
CardTemplateScansDTO cardTemplateScansDTO = scansDTOIterator.next();
|
||||
CardTemplateUseDTO useDTO = iCardTemplateUseService.get(cardTemplateScansDTO.getCardTemplateUseId());
|
||||
if("1".equals(useDTO.getCardTemplateUseSystem())) {
|
||||
scansDTOIterator.remove();
|
||||
}
|
||||
}
|
||||
// 把系统默认名片放到第一页
|
||||
if(1 == page.getPage()) {
|
||||
CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard();
|
||||
List<CardTemplateScansDTO> cardTemplateScansDTOList = new ArrayList<CardTemplateScansDTO>();
|
||||
if(cardTemplateUseDTO != null) {
|
||||
CardTemplateScansDTO scansDTO = new CardTemplateScansDTO();
|
||||
scansDTO.setCardTemplateUseId(cardTemplateUseDTO.getCardTemplateUseId());
|
||||
scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO);
|
||||
cardTemplateScansDTOList.add(scansDTO);
|
||||
cardTemplateScansDTOs.add(0, scansDTO);
|
||||
}
|
||||
}
|
||||
cardTemplateScansDTOList.addAll(cardTemplateScansDTOs);
|
||||
PageInfo<CardTemplateScansDTO> pageInfo = new PageInfo<>(cardTemplateScansDTOList);
|
||||
return new SuccessResultList<>(cardTemplateScansDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}else {
|
||||
PageInfo<CardTemplateScansDTO> pageInfo = new PageInfo<>(cardTemplateScansDTOs);
|
||||
return new SuccessResultList<>(cardTemplateScansDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
// 加载系统默认名片在最上面
|
||||
// if(1 == page.getPage() && page.getParams().get("homePage") != null && 1 == Integer.valueOf(page.getParams().get("homePage").toString())) {
|
||||
//
|
||||
// /**
|
||||
// * 如果有系统默认名片. 删除掉,
|
||||
// */
|
||||
//
|
||||
// CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard();
|
||||
// List<CardTemplateScansDTO> cardTemplateScansDTOList = new ArrayList<CardTemplateScansDTO>();
|
||||
// if(cardTemplateUseDTO != null) {
|
||||
// CardTemplateScansDTO scansDTO = new CardTemplateScansDTO();
|
||||
// scansDTO.setCardTemplateUseId(cardTemplateUseDTO.getCardTemplateUseId());
|
||||
// scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO);
|
||||
// cardTemplateScansDTOList.add(scansDTO);
|
||||
// }
|
||||
// cardTemplateScansDTOList.addAll(cardTemplateScansDTOs);
|
||||
// PageInfo<CardTemplateScansDTO> pageInfo = new PageInfo<>(cardTemplateScansDTOList);
|
||||
// return new SuccessResultList<>(cardTemplateScansDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
// }else {
|
||||
// PageInfo<CardTemplateScansDTO> pageInfo = new PageInfo<>(cardTemplateScansDTOs);
|
||||
// return new SuccessResultList<>(cardTemplateScansDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -338,7 +338,7 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC
|
||||
buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), userPO.getAvatarUrl());
|
||||
// 海报小程序二维码
|
||||
}else if("currentUserPosterQRCode".equals(buildingDTO.getTemplateAreaSource())) {
|
||||
buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateUseId=" + cardTemplateUseId);
|
||||
buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateUseId=" + cardTemplateUseId + "&userId=" + "e022768c-14f4-4dde-847f-b51587be9d36" );
|
||||
// 名片小程序二维码
|
||||
}else if("currentUserQRCode".equals(buildingDTO.getTemplateAreaSource())) {
|
||||
buildingPicturesMap.put(buildingDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateDispatchId=" + cardTemplateUseId);
|
||||
@ -402,7 +402,7 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC
|
||||
String cardTemplateDispatchId = iCardTemplateDispatchService.saveReturnId(token, cardTemplateDispatchSaveVO);
|
||||
if("2".equals(cardTemplateAppDTO.getTemplateMode())) {
|
||||
// 生成海报二维码
|
||||
BufferedImage weiXinImage = WeiXinBarCodeUtils.getBarCodeImage(appKey, appSecret, "pages/index/index?cardTemplateUseId=" + cardTemplateUseId, 200);
|
||||
BufferedImage weiXinImage = WeiXinBarCodeUtils.getBarCodeImage(appKey, appSecret, "pages/index/index?cardTemplateUseId=" + cardTemplateUseId + "&userId=" + getUserId(token) , 200);
|
||||
String fileId = iPicturesTemplateBuildingService.saveBufferImageToFile(weiXinImage);
|
||||
vo.setCardTemplateUseBarcode(fileId);
|
||||
}else{
|
||||
@ -567,7 +567,7 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC
|
||||
buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), userPO.getAvatarUrl());
|
||||
// 海报小程序二维码
|
||||
}else if("currentUserPosterQRCode".equals(useAreaDTO.getTemplateAreaSource())) {
|
||||
buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateUseId=" + cardTemplateUseId);
|
||||
buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateUseId=" + cardTemplateUseId + "&userId=" + getUserId(token) );
|
||||
// 名片小程序二维码
|
||||
}else if("currentUserQRCode".equals(useAreaDTO.getTemplateAreaSource())) {
|
||||
buildingPicturesMap.put(useAreaDTO.getTemplateAreaSource(), "appid=" + WeiXinUtils.getAppKey() + "&secret=" + WeiXinUtils.getAppSecret() + "&path=pages/index/index&cardTemplateDispatchId=" + cardTemplateUseId);
|
||||
|
@ -220,10 +220,10 @@
|
||||
t1.is_delete
|
||||
FROM
|
||||
e_card_template_scans t1
|
||||
LEFT JOIN
|
||||
/* LEFT JOIN
|
||||
e_card_template_use t2
|
||||
ON
|
||||
t1.card_template_use_id = t2.card_template_use_id
|
||||
t1.card_template_use_id = t2.card_template_use_id*/
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="creator != null and creator != ''">
|
||||
@ -236,9 +236,9 @@
|
||||
AND t1.card_template_use_id = #{cardTemplateUseId}
|
||||
</if>
|
||||
<!-- 不查询首页 -->
|
||||
<if test="homePage != null and homePage == 1">
|
||||
<!-- <if test="homePage != null and homePage == 1">
|
||||
AND t2.card_template_use_system = '0'
|
||||
</if>
|
||||
</if>-->
|
||||
ORDER BY
|
||||
t1.gmt_create DESC
|
||||
</select>
|
||||
|
@ -73,7 +73,7 @@ var context = context || (function () {
|
||||
var actiond = new Date(),
|
||||
actionID = 'event-' + actiond.getTime() * Math.floor(Math.random()*100000),
|
||||
eventAction = data[i].action;
|
||||
$sub.find('a').attr('id', actionID);
|
||||
$sub.find('a').attr('id', data[i].id ? data[i].id : actionID);
|
||||
$('#' + actionID).addClass('context-event');
|
||||
$(document).on('click', '#' + actionID, eventAction);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ var context = context || (function () {
|
||||
var actiond = new Date(),
|
||||
actionID = 'event-' + actiond.getTime() * Math.floor(Math.random()*100000),
|
||||
eventAction = data[i].action;
|
||||
$sub.find('a').attr('id', actionID);
|
||||
$sub.find('a').attr('id', data[i].id ? data[i].id : actionID);
|
||||
$('#' + actionID).addClass('context-event');
|
||||
$(document).on('click', '#' + actionID, eventAction);
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ layui.define(function(exports) {
|
||||
cancel: function (index) {
|
||||
self.closeBox();
|
||||
},
|
||||
success: opt.onSuccess,
|
||||
end: opt.onClose
|
||||
});
|
||||
this.dialogArray.push(index);
|
||||
|
@ -22,7 +22,7 @@
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||
<input type="text" style="" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
|
||||
|
@ -10,6 +10,12 @@
|
||||
<!-- 代码编辑器 -->
|
||||
<script src="assets/js/vendor/template/jquery.min.js"></script>
|
||||
<script src="assets/js/vendor/template/jstorage.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="assets/js/vendor/safety/js/jquery.min.js" ></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/safety/js/context.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/safety/js/drag.js" ></script>
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/safety/css/context.standalone.css">
|
||||
|
||||
<script>
|
||||
var codetype="java";
|
||||
var unid="59396e99ae344";
|
||||
@ -39,7 +45,7 @@
|
||||
<tr>
|
||||
<td colspan="10">
|
||||
<div class="starter-template">
|
||||
<div id="editor" class="ace_editor ace-monokai ace_dark">
|
||||
<div id="editor" class="ace_editor ace-monokai ace_dark" data-clipboard-action="copy">
|
||||
<textarea id="codeContent" class="ace_text-input" wrap="off" autocorrect="off" autocapitalize="off" spellcheck="false" style="opacity: 0; height: 17px; width: 8px; left: 45px; top: 0px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@ -55,7 +61,7 @@
|
||||
<a class="btn btn-big btn-danger" id="jumpNumber">指定行跳转</a>
|
||||
<label class="layui-form-label">打印异常详情</label>
|
||||
<input type="checkbox" style="height:15px;width:15px;" id="exceptionDescription">
|
||||
<a class="btn btn-big btn-warm">选中文字内容 CTRL + K【下一个】 | ALT + SHIF + K【上一个】</a>
|
||||
<span class="btn btn-big btn-warm" id="copyData" >选中文字内容 CTRL + K【下一个】 | ALT + SHIF + K【上一个】</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -74,6 +80,7 @@
|
||||
<script src="assets/js/vendor/template/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<!--提示框-->
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/safety/copy/clipboard.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
layui.config({
|
||||
@ -136,7 +143,7 @@
|
||||
};
|
||||
//获得消息事件
|
||||
socket.onmessage = function(msg) {
|
||||
console.log(msg.data);
|
||||
// console.log(msg.data);
|
||||
if(!stopStatus) {
|
||||
consoleLog = consoleLog + ( msg.data + "\r\n" );
|
||||
//发现消息进入
|
||||
@ -157,9 +164,9 @@
|
||||
}
|
||||
|
||||
$(document).on('click','#selectUser',function(){
|
||||
top.dialog.dialogData.selectedUserIds = $('#selectUserVal').val();
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/department/user/select-user', []),
|
||||
// route/cardconsole/appuser route/department/user/select-user
|
||||
var index = top.dialog.open({
|
||||
url: top.restAjax.path('route/cardconsole/appuser?selectedUserIds=' + $('#selectUserVal').val(), []),
|
||||
title: '选择用户',
|
||||
width: '500px',
|
||||
height: '500px',
|
||||
@ -362,6 +369,47 @@
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 右键菜单参数
|
||||
context.init({
|
||||
fadeSpeed: 100,
|
||||
filter: function ($obj){},
|
||||
above: 'auto',
|
||||
preventDoubleContext: true,
|
||||
compress: false
|
||||
});
|
||||
|
||||
context.attach('#editor', [
|
||||
// {header: '操作'},
|
||||
// {id: 'test', text: '复 制 内 容', action: function(e){
|
||||
// e.preventDefault();
|
||||
// var text = editor.getSelectedText();
|
||||
// // var clipboard = new Clipboard('#editor',{
|
||||
// // text: function(trigger) {
|
||||
// // console.log(trigger);
|
||||
// // return "123"; // trigger.getAttribute('aria-label');
|
||||
// // }
|
||||
// // });
|
||||
// // clipboard.on('success', function(e) {
|
||||
// // top.layer.msg("已复制到剪切板")
|
||||
// // });
|
||||
// // clipboard.on('error', function(e) {
|
||||
// // top.layer.msg("复制失败");
|
||||
// // });
|
||||
// }
|
||||
// },
|
||||
{text: '暂 停 | 继 续', action: function(e){
|
||||
e.preventDefault();
|
||||
$("#stop").click();
|
||||
}
|
||||
},
|
||||
{text: '清 空 控 制 台', action: function(e){
|
||||
e.preventDefault();
|
||||
$("#clear").click();
|
||||
}
|
||||
},
|
||||
{divider: true}
|
||||
] );
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
consoleLog = "控制台等待连接...\r\n\r\n";
|
||||
|
Loading…
Reference in New Issue
Block a user