Commit 129824ec authored by liqin's avatar liqin 💬

Merge branch 'master' of http://111.203.232.171:8888/lee/chnmuseum-party into master

parents 9d81c644 1ae4df7f
......@@ -30,7 +30,8 @@ public enum OperModule {
LOG(27,"日志管理"),
CHANGEPWD(28,"修改密码"),
UNITADMIN(29,"账号管理"),
STATISTICALUSER(30,"统计用户管理")
STATISTICALUSER(30,"统计用户管理"),
LOGIN(31,"登录管理")
;
// 错误编码
......
......@@ -24,7 +24,8 @@ public enum OperType {
CHANGE_STYLE(16,"修改风格"),
DETAILS(17,"详情"),
ACTIVATION(18,"激活"),
FAULT(19,"故障")
FAULT(19,"故障"),
LOGOUT(21,"退出登录"),
;
// 错误编码
......
......@@ -129,16 +129,17 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
// getMethodLog(user,methodLog,method_param);
if ("机顶盒运维信息管理".equals(methodLog.operModule().getMsg())) {
if (OperModule.STBOPERATION.getMsg().equals(methodLog.operModule().getMsg())) {
TOperationLog operationLog = new TOperationLog();
operationLog.setCreateTime(LocalDateTime.now());
operationLog.setUserId(user.getId());
operationLog.setArea(user.getAreaName());
operationLog.setOperationType(methodLog.operType().getMsg());
operationLogService.save(operationLog);
return object;
}
SysLog sysLog = new SysLog();
if ("1".equals(user.getId())) {
if (user.getRoleList().contains("1")) {
sysLog.setType(1);
} else {
sysLog.setType(2);
......
......@@ -28,7 +28,7 @@ public class WebLogAspect {
@Autowired
private SysLogController sysLogController;
@Pointcut("execution (public * com.cmbchina.business.hall.web.controller.*.*(..))")
@Pointcut("execution (public * cn.wisenergy.chnmuseum.party.web.controller.*.*(..))")
public void methodCutPoint() {
}
......@@ -76,7 +76,7 @@ public class WebLogAspect {
content = annotation.value();
}
//插入到系统日志表
this.sysLogController.insertSysLog(content,null,null);
this.sysLogController.insertSysLog(content,null);
}
return proceedingJoinPoint.proceed();
......
......@@ -185,7 +185,7 @@ public class LoginController extends BaseController {
if (user.getOrgName() != null) {
operationContent += ",机构" + user.getOrgName();
}
this.sysLogController.insertSysLog(operationContent, username, user.getId());
this.sysLogController.insertSysLog(operationContent,user);
String token = JwtTokenUtil.sign(username, user.getId());
// 将token信息存入Redis
......
......@@ -7,6 +7,7 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.RunLog;
import cn.wisenergy.chnmuseum.party.model.SysLog;
import cn.wisenergy.chnmuseum.party.model.TOperationLog;
import cn.wisenergy.chnmuseum.party.model.TUser;
import cn.wisenergy.chnmuseum.party.service.TOperationLogService;
import cn.wisenergy.chnmuseum.party.service.impl.RunLogServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.SysLogServiceImpl;
......@@ -51,7 +52,7 @@ public class SysLogController extends BaseController {
*/
@ApiOperation(value = "插入系统日志", notes = "插入系统日志")
@PostMapping(value = "/insertSysLog")
public Boolean insertSysLog(String operationContent, String username, String id) {
public Boolean insertSysLog(String operationContent, TUser user) {
SysLog sysLog = new SysLog();
//日志时间
sysLog.setOperationTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
......@@ -60,13 +61,13 @@ public class SysLogController extends BaseController {
HttpServletRequest request = attributes.getRequest();
String operationIp = NetWorkUtil.getLoggableAddress(request);
sysLog.setOperationIp(operationIp);
if (username == null) {
if (user.getUserName() == null) {
//操作者用户名
sysLog.setOperator(this.getUserName());
} else {
sysLog.setOperator(username);
sysLog.setOperator(user.getUserName());
}
if ("1".equals(id)) {
if (user.getRoleList().contains("1")) {
sysLog.setType(1);
} else {
sysLog.setType(2);
......
package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.util.DateUtil;
import cn.wisenergy.chnmuseum.party.model.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -54,6 +57,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getBoardSurvey")
@RequiresPermissions("t:board:statistic:survey")
@ApiOperation(value = "获取展板统计概况", notes = "获取展板统计概况")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getBoardSurvey(TBoardSurvey survey) {
TBoardSurvey result = this.tBoardStatisticService.getBoardSurvey(survey);
......@@ -68,6 +72,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getBoardRankPageList")
@RequiresPermissions("t:board:statistic:rankPage")
@ApiOperation(value = "获取展板播放排行", notes = "获取展板播放排行")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getBoardRankPageList(TBoardPlayRank rank) {
Page<TBoardPlayRank> page = this.tBoardStatisticService.getBoardRankPageList(getPage(),rank);
......@@ -84,6 +89,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getBoardTrendPageList")
@RequiresPermissions("t:board:statistic:trendPage")
@ApiOperation(value = "获取展板播放趋势", notes = "获取展板播放趋势")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getBoardTrendPageList(TBoardPlayTrend trend) {
// 如果查询日志为空,则默认当月
if (StringUtils.isEmpty(trend.getPlayDate())){
......@@ -113,6 +119,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getBoardDistrictPageList")
@RequiresPermissions("t:board:statistic:districtPage")
@ApiOperation(value = "获取地区展板播统计", notes = "获取地区展板播统计")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getBoardDistrictPageList(TDistrictBoardStatistic district) {
Page<TDistrictBoardStatistic> page = this.tBoardStatisticService.getBoardDistrictPageList(getPage(),district);
......@@ -130,6 +137,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getBoardProvincePlayTotalList")
@RequiresPermissions("t:board:statistic:provPlayList")
@ApiOperation(value = "获取省级展板播放统计", notes = "获取省级展板播放统计")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getBoardProvincePlayTotalList(String organId) {
List list = this.tBoardStatisticService.getBoardProvincePlayTotalList(organId);
......@@ -144,6 +152,7 @@ public class TBoardStatisticController extends BaseController {
@PostMapping("/getInteractionFrequencyPageList")
@RequiresPermissions("t:board:statistic:districtPage")
@ApiOperation(value = "获取互动频次统计信息", notes = "获取互动频次统计信息")
@MethodLog(operModule = OperModule.OVERVIEW, operType = OperType.SELECT)
public Map<String, Object> getInteractionFrequencyPageList(String frequencyDate) {
if (StringUtils.isEmpty(frequencyDate)){
frequencyDate = DateUtil.getCurrentDate("yyyyMM");
......@@ -164,144 +173,71 @@ public class TBoardStatisticController extends BaseController {
map.put("page",page);
return getResult(map);
}
//
// @PostMapping("/batchSave")
// @RequiresPermissions("t:board:statistic:batch:save")
// @ApiOperation(value = "批量添加展板统计信息表", notes = "批量添加展板统计信息表")
// public Map<String, Object> batchSaveTBoardStatistic(@Validated(value = {Add.class}) List<TBoardStatistic> tBoardStatisticList) {
// // 保存业务节点信息
// boolean result = tBoardStatisticService.saveBatch(tBoardStatisticList);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
//
//
//
// @PostMapping("/save")
// @RequiresPermissions("t:board:statistic:save")
// @ApiOperation(value = "添加展板统计信息表", notes = "添加展板统计信息表")
// public Map<String, Object> saveTBoardStatistic(@Validated(value = {Add.class}) TBoardStatistic tBoardStatistic) {
// // 获取当前日期
// tBoardStatistic.setPlayDate(DateUtil.getCurrentDate("yyyyMMdd"));
//
// // 保存业务节点信息
// boolean result = tBoardStatisticService.save(tBoardStatistic);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
// @PutMapping("/update")
// @RequiresPermissions("t:board:statistic:update")
// @ApiOperation(value = "修改展板统计信息表信息", notes = "修改展板统计信息表信息")
// public Map<String, Object> updateTBoardStatistic(@Validated(value = {Update.class}) TBoardStatistic tBoardStatistic) {
// boolean flag = tBoardStatisticService.updateById(tBoardStatistic);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @PutMapping("/updateAuditStatus/{id}")
// @RequiresPermissions("t:board:statistic:update:audit:status")
// @ApiOperation(value = "更新展板统计信息表审核状态", notes = "更新展板统计信息表审核状态")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
// @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> updateStatus(@NotNull(message = "展板统计信息表ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
// UpdateWrapper<TBoardStatistic> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id", id);
// updateWrapper.eq("audit_status", status.name());
// boolean flag = tBoardStatisticService.update(updateWrapper);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @DeleteMapping("/delete/{id}")
// @RequiresPermissions("t:board:statistic:delete")
// @ApiOperation(value = "根据ID删除展板统计信息表", notes = "根据ID删除展板统计信息表")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
// })
// public Map<String, Object> deleteTBoardStatistic(@PathVariable("id") String id) {
// boolean result = tBoardStatisticService.removeById(id);
// if (result) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @GetMapping("/getList")
// @RequiresPermissions("t:board:statistic:list")
// @ApiOperation(value = "获取展板统计信息表全部列表(无分页)", notes = "获取展板统计信息表全部列表(无分页)")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> getTBoardStatisticList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) TBoardStatistic auditStatus) {
// List<TBoardStatistic> tBoardStatisticList = tBoardStatisticService.list();
// return getResult(tBoardStatisticList);
// }
//
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
// @ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
// @ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
// @ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
// @ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
// })
// @PostMapping("/getPageList")
// @RequiresPermissions("t:board:statistic:page")
// @ApiOperation(value = "获取展板统计信息表分页列表", notes = "获取展板统计信息表分页列表")
// public Map<String, Object> getTBoardStatisticPageList(GenericPageParam genericPageParam) {
// LambdaQueryWrapper<TBoardStatistic> queryWrapper = new LambdaQueryWrapper<>();
//// // 对名称或编码模糊查询
//// if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
//// queryWrapper.like(TBoardStatistic::getName, genericPageParam.getNameOrCode());
//// }
//// // 根据创建时间区间检索
//// if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
//// queryWrapper.ge(TBoardStatistic::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
//// .le(TBoardStatistic::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
//// }
//// // 设置排序规则
//// queryWrapper.orderByDesc(TBoardStatistic::getCreateTime);
//// // 设置查询内容
//// queryWrapper.select(
//// TBoardStatistic::getId,
//// TBoardStatistic::getName,
//// TBoardStatistic::getAuditStatus,
//// TBoardStatistic::getCreateTime,
//// TBoardStatistic::getUpdateTime);
// Page<TBoardStatistic> page = this.tBoardStatisticService.page(getPage(), queryWrapper);
// for (TBoardStatistic tBoardStatistic : page.getRecords()) {
//
// }
// return getResult(page);
// }
//
// @ApiOperation(value = "获取展板统计信息表详情", notes = "获取展板统计信息表详情")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path")
// })
// @GetMapping("/get/{id}")
// @RequiresPermissions("t:board:statistic:get:id")
// public Map<String, Object> getById(@PathVariable("id") String id) {
// TBoardStatistic tBoardStatistic = tBoardStatisticService.getById(id);
// return getResult(tBoardStatistic);
// }
/**
* 以下两个接口是为方便区分日志模块
* @param trend
* @return
*/
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer")
})
@PostMapping("/getBoardPageList")
@RequiresPermissions("t:board:statistic:Page")
@ApiOperation(value = "获取展板播放趋势", notes = "获取展板播放趋势")
@MethodLog(operModule = OperModule.TEND, operType = OperType.SELECT)
public Map<String, Object> getBoardPageList(TBoardPlayTrend trend) {
// 如果查询日志为空,则默认当月
if (StringUtils.isEmpty(trend.getPlayDate())){
trend.setPlayDate(DateUtil.getCurrentDate("yyyyMM"));
}
Page<TBoardPlayTrend> page = this.tBoardStatisticService.getBoardTrendPageList(getPage(),trend);
// 处理数据为展板趋势图
Map map = new HashMap();
List dateList = new ArrayList();
List cntList = new ArrayList();
for (TBoardPlayTrend t : page.getRecords()) {
dateList.add(t.getPlayDate());
cntList.add(t.getPlayNumber());
}
map.put("dateList",dateList);
map.put("cntList",cntList);
map.put("page",page);
return getResult(map);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "frequencyDate", value = "互动统计时间 年:yyyy 月:yyyyMM,默认当月", paramType = "query", dataType = "String")
})
@PostMapping("/getInteractionPageList")
@RequiresPermissions("t:interaction:statistic:districtPage")
@ApiOperation(value = "获取互动频次统计信息", notes = "获取互动频次统计信息")
@MethodLog(operModule = OperModule.INTERACTION, operType = OperType.SELECT)
public Map<String, Object> getInteractionPageList(String frequencyDate) {
if (StringUtils.isEmpty(frequencyDate)){
frequencyDate = DateUtil.getCurrentDate("yyyyMM");
}
Page page = this.tBoardStatisticService.getInteractionFrequency(getPage(),frequencyDate);
//
Map map = new HashMap();
List organList = new ArrayList<>();
List cntList = new ArrayList();
for (Object o : page.getRecords()){
Map m = (HashMap) o;
organList.add(m.get("organName"));
cntList.add(m.get("frequencyCnt"));
}
map.put("organList",organList);
map.put("cntList",cntList);
map.put("page",page);
return getResult(map);
}
}
......@@ -615,7 +615,7 @@ public class TUserController extends BaseController {
@ApiOperation(value = "新增机顶盒账号")
@RequestMapping(value = "/boxAdd", method = RequestMethod.POST)
@RequiresPermissions("/user/boxAdd")
@MethodLog(operModule = OperModule.USER, operType = OperType.ADD)
@MethodLog(operModule = OperModule.STBBASE, operType = OperType.ADD)
public ResponseEntity<Map<String, Object>> BoxAdd(TUser user) {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
try {
......@@ -708,7 +708,7 @@ public class TUserController extends BaseController {
@ApiOperation(value = "新增运维账号")
@RequestMapping(value = "/operationAdd", method = RequestMethod.POST)
@RequiresPermissions("/user/operationAdd")
@MethodLog(operModule = OperModule.USER, operType = OperType.ADD)
@MethodLog(operModule = OperModule.STBACCOUNT, operType = OperType.ADD)
public ResponseEntity<Map<String, Object>> operationAdd(TUser user) {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
try {
......@@ -779,7 +779,7 @@ public class TUserController extends BaseController {
@ApiOperation(value = "新增统计账号")
@RequestMapping(value = "/statisticsAdd", method = RequestMethod.POST)
@RequiresPermissions("/user/statisticsAdd")
@MethodLog(operModule = OperModule.USER, operType = OperType.ADD)
@MethodLog(operModule = OperModule.STATISTICALUSER, operType = OperType.ADD)
public ResponseEntity<Map<String, Object>> statisticsAdd(TUser user) {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
try {
......
......@@ -23,7 +23,7 @@
</sql>
<select id="getList" resultMap="BaseResultMap">
SELECT b.*,r.`name` organ_name
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,r.`name` organ_name
FROM t_box_operation b
left join t_organ r on r.id = b.organ_id
where 1=1
......@@ -36,7 +36,7 @@ left join t_organ r on r.id = b.organ_id
</select>
<select id="selectBoxPage" resultMap="BaseResultMap">
select b.*,o.name organ_name,a.full_name area_name
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,o.name organ_name,a.full_name area_name
from t_user u
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
......@@ -60,7 +60,7 @@ left join t_organ r on r.id = b.organ_id
</select>
<select id="selectPageList" resultMap="BaseResultMap">
SELECT b.*,r.`name` organ_name
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,r.`name` organ_name
FROM t_box_operation b
left join t_organ r on r.id = b.organ_id
where 1=1
......
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