Commit 90d170b0 authored by yangtianyou's avatar yangtianyou

Merge remote-tracking branch 'origin/master'

parents dece904d e61dfe9c
package cn.wisenergy.chnmuseum.party.mapper; package cn.wisenergy.chnmuseum.party.mapper;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard; import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -30,4 +31,13 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo ...@@ -30,4 +31,13 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
) )
IPage<ExhibitionBoard> selectBoardPageByLearningContentId(Page<?> page, String learningContentId, String nameOrCode); IPage<ExhibitionBoard> selectBoardPageByLearningContentId(Page<?> page, String learningContentId, String nameOrCode);
@Select("<script>" + "SELECT a.* FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a "
+ "WHERE lcb.learning_content_id = lc.id "
+ "and lcb.exhibition_board_id = eb.id "
+ "and eb.asset_id = a.id "
+ "and lc.organ_id = #{organId}"
+ "</script>"
)
IPage<Asset> selectAssetPageByOrganId(Page<?> page, String organId);
} }
...@@ -54,6 +54,10 @@ public class LearningContent implements Serializable { ...@@ -54,6 +54,10 @@ public class LearningContent implements Serializable {
@NotBlank(message = "适用范围不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "适用范围不能为空", groups = {Add.class, Update.class})
private String applicableScope; private String applicableScope;
@ApiModelProperty(value = "机构ID")
@TableField("organ_id")
private String organId;
@ApiModelProperty("学习项目ID") @ApiModelProperty("学习项目ID")
@TableField("learning_project_id") @TableField("learning_project_id")
@NotBlank(message = "学习项目ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "学习项目ID不能为空", groups = {Add.class, Update.class})
......
package cn.wisenergy.chnmuseum.party.service; package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard; import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -21,4 +22,7 @@ public interface LearningContentBoardService extends IService<LearningContentBoa ...@@ -21,4 +22,7 @@ public interface LearningContentBoardService extends IService<LearningContentBoa
List<LearningContentBoard> getBoardListByLearningContentId(String learningContentId); List<LearningContentBoard> getBoardListByLearningContentId(String learningContentId);
IPage<ExhibitionBoard> getBoardPageByLearningContentId(Page<ExhibitionBoard> page, String learningContentId, String nameOrCode); IPage<ExhibitionBoard> getBoardPageByLearningContentId(Page<ExhibitionBoard> page, String learningContentId, String nameOrCode);
IPage<Asset> getAssetPageByOrganId(Page<ExhibitionBoard> page, String organId);
} }
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.LearningContentBoardMapper; import cn.wisenergy.chnmuseum.party.mapper.LearningContentBoardMapper;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard; import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardService; import cn.wisenergy.chnmuseum.party.service.LearningContentBoardService;
...@@ -36,4 +37,9 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent ...@@ -36,4 +37,9 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
return learningContentBoardMapper.selectBoardPageByLearningContentId(page, learningContentId, nameOrCode); return learningContentBoardMapper.selectBoardPageByLearningContentId(page, learningContentId, nameOrCode);
} }
@Override
public IPage<Asset> getAssetPageByOrganId(Page<ExhibitionBoard> page, String organId) {
return learningContentBoardMapper.selectAssetPageByOrganId(page, organId);
}
} }
...@@ -616,60 +616,73 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -616,60 +616,73 @@ public class ChinaMobileRestApiController extends BaseController {
return getResult(page); return getResult(page);
} }
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer")
})
@PostMapping("/asset/search")
@RequiresPermissions("learning:content:board:page")
@ApiOperation(value = "获取当前用户可查看的视频信息", notes = "获取当前用户可查看的视频信息")
public Map<String, Object> getAssetPageByOrganId() {
final TUser tUser = getcurUser();
final String orgId = tUser.getOrgId();
IPage<Asset> page = this.learningContentBoardService.getAssetPageByOrganId(getPage(), orgId);
return getResult(page);
}
@ApiOperation(value = "app最新版本查询") @ApiOperation(value = "app最新版本查询")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "versionNo", value = "app版本号", dataType = "String", paramType = "query") @ApiImplicitParam(name = "versionNo", value = "app版本号", dataType = "String", paramType = "query")
}) })
@GetMapping(value = "/version/check") @GetMapping(value = "/version/check")
@RequiresPermissions("app:version:check") @RequiresPermissions("app:version:check")
public Map<String,Object> versionCheck(String versionNo) { public Map<String, Object> versionCheck(String versionNo) {
TAppVersion current = new TAppVersion();//当前版本 TAppVersion current = new TAppVersion();//当前版本
// 查询最新版本号信息 // 查询最新版本号信息
QueryWrapper<TAppVersion> qw = new QueryWrapper<>(); QueryWrapper<TAppVersion> qw = new QueryWrapper<>();
qw.eq("is_current",1); qw.eq("is_current", 1);
qw.select().orderByDesc("update_time"); qw.select().orderByDesc("update_time");
List<TAppVersion> currentList = appVersionService.list(qw); List<TAppVersion> currentList = appVersionService.list(qw);
if (currentList == null || currentList.size() == 0){ if (currentList == null || currentList.size() == 0) {
return getFailResult("未设置当前版本信息"); return getFailResult("未设置当前版本信息");
}else { } else {
current = currentList.get(0); current = currentList.get(0);
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("isLatest",versionNo.equals(current.getAppVersion())); map.put("isLatest", versionNo.equals(current.getAppVersion()));
map.put("versionNo",current.getAppVersion()); map.put("versionNo", current.getAppVersion());
map.put("versionUrl",current.getApkUrl()); map.put("versionUrl", current.getApkUrl());
map.put("updateLog",current.getUpdateLog()); map.put("updateLog", current.getUpdateLog());
map.put("updateTime", DateUtil.format(current.getUpdateTime(),DateUtil.FORMAT_ONE)); map.put("updateTime", DateUtil.format(current.getUpdateTime(), DateUtil.FORMAT_ONE));
return getResult(map); return getResult(map);
} }
@ApiOperation(value = "app界面图片查询") @ApiOperation(value = "app界面图片查询")
@GetMapping(value = "/app/picSelect") @GetMapping(value = "/app/picSelect")
@RequiresPermissions("app:pic:select") @RequiresPermissions("app:pic:select")
public Map<String,Object> appPicSelect() { public Map<String, Object> appPicSelect() {
TAppDirPic currentDir = null;// 当前目录页面 TAppDirPic currentDir = null;// 当前目录页面
TAppRunPic currentRun = null;// 当前运行画面 TAppRunPic currentRun = null;// 当前运行画面
// 查询当前目录界面信息 // 查询当前目录界面信息
QueryWrapper<TAppDirPic> qw = new QueryWrapper<>(); QueryWrapper<TAppDirPic> qw = new QueryWrapper<>();
qw.eq("is_current",1); qw.eq("is_current", 1);
qw.select().orderByDesc("create_time"); qw.select().orderByDesc("create_time");
List<TAppDirPic> currentDirList = appDirPicService.list(qw); List<TAppDirPic> currentDirList = appDirPicService.list(qw);
if (currentDirList != null && currentDirList.size() > 0){ if (currentDirList != null && currentDirList.size() > 0) {
currentDir = currentDirList.get(0); currentDir = currentDirList.get(0);
} }
QueryWrapper<TAppRunPic> qw1 = new QueryWrapper<>(); QueryWrapper<TAppRunPic> qw1 = new QueryWrapper<>();
qw1.eq("is_current",1); qw1.eq("is_current", 1);
qw1.select().orderByDesc("create_time"); qw1.select().orderByDesc("create_time");
List<TAppRunPic> currentRunList = appRunPicService.list(qw1); List<TAppRunPic> currentRunList = appRunPicService.list(qw1);
if (currentRunList != null && currentRunList.size() > 0){ if (currentRunList != null && currentRunList.size() > 0) {
currentRun = currentRunList.get(0); currentRun = currentRunList.get(0);
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("dirImgUrl",currentDir != null? currentDir.getAppDirPic() : "未设置目录图片"); map.put("dirImgUrl", currentDir != null ? currentDir.getAppDirPic() : "未设置目录图片");
map.put("runImgUrl",currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片"); map.put("runImgUrl", currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片");
return getResult(map); return getResult(map);
} }
} }
...@@ -59,6 +59,9 @@ public class LearningContentController extends BaseController { ...@@ -59,6 +59,9 @@ public class LearningContentController extends BaseController {
@RequiresPermissions("learning:content:save") @RequiresPermissions("learning:content:save")
@ApiOperation(value = "添加学习内容", notes = "添加学习内容") @ApiOperation(value = "添加学习内容", notes = "添加学习内容")
public Map<String, Object> saveLearningContent(@Validated(value = {Add.class}) LearningContent learningContent) { public Map<String, Object> saveLearningContent(@Validated(value = {Add.class}) LearningContent learningContent) {
final TUser tUser = getcurUser();
final String orgId = tUser.getOrgId();
learningContent.setOrganId(orgId);
learningContent.setAuditStatus(AuditStatusEnum.TBC.name()); learningContent.setAuditStatus(AuditStatusEnum.TBC.name());
learningContent.setIsPublished(false); learningContent.setIsPublished(false);
// 保存业务节点信息 // 保存业务节点信息
......
...@@ -12,6 +12,7 @@ import cn.wisenergy.chnmuseum.party.model.Menu; ...@@ -12,6 +12,7 @@ import cn.wisenergy.chnmuseum.party.model.Menu;
import cn.wisenergy.chnmuseum.party.service.RoleService; import cn.wisenergy.chnmuseum.party.service.RoleService;
import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl; import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.MenuServiceImpl; import cn.wisenergy.chnmuseum.party.service.impl.MenuServiceImpl;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -41,7 +42,7 @@ import java.util.concurrent.TimeUnit; ...@@ -41,7 +42,7 @@ import java.util.concurrent.TimeUnit;
*/ */
@Api(tags = "登录接口") @Api(tags = "登录接口")
@RestController @RestController
public class LoginController { public class LoginController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class); private static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class);
...@@ -203,7 +204,8 @@ public class LoginController { ...@@ -203,7 +204,8 @@ public class LoginController {
} }
@RequestMapping(value = "logout", method = RequestMethod.GET) @RequestMapping(value = "logout", method = RequestMethod.GET)
public ResponseEntity<JSONObject> logout(@RequestHeader(value = "token") String token) { public ResponseEntity<JSONObject> logout() {
String token = request.getHeader("Authorization");
try { try {
if (StringUtils.isNotBlank(token)) { if (StringUtils.isNotBlank(token)) {
// SecurityUtils.getSubject().logout(); // SecurityUtils.getSubject().logout();
...@@ -213,7 +215,7 @@ public class LoginController { ...@@ -213,7 +215,7 @@ public class LoginController {
resultMap.put("resultCode", "200"); resultMap.put("resultCode", "200");
resultMap.put("message", "成功"); resultMap.put("message", "成功");
resultMap.put("data", ""); resultMap.put("data", "");
return ResponseEntity.status(HttpStatus.OK).body(resultMap); return ResponseEntity.ok(resultMap);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("注销错误!", e); LOGGER.error("注销错误!", e);
} }
......
...@@ -152,7 +152,7 @@ public class TInteractionController extends BaseController { ...@@ -152,7 +152,7 @@ public class TInteractionController extends BaseController {
public Map<String, Object> getTInteractionPageList(String orgId) { public Map<String, Object> getTInteractionPageList(String orgId) {
Page<TInteraction> list = null; Page<TInteraction> list = null;
try { try {
list = tInteractionService.page(getPage(),new UpdateWrapper<TInteraction>().eq("organ_id", orgId)); list = tInteractionService.page(getPage(),new UpdateWrapper<TInteraction>().eq("organ_id", orgId).orderByDesc("create_time"));
return getResult(list); return getResult(list);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
package cn.wisenergy.chnmuseum.party.web.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import cn.wisenergy.chnmuseum.party.model.TItem;
import cn.wisenergy.chnmuseum.party.service.TItemService;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
/**
* <pre>
* 学习内容项目 前端控制器
* </pre>
*
* @author Danny Lee
* @since 2021-03-22
*/
@Slf4j
@RestController
@RequestMapping("/tItem")
@Api(tags = {"学习内容项目操作接口"})
public class TItemController extends BaseController {
@Resource
private TItemService tItemService;
@PostMapping("/batchSave")
@RequiresPermissions("t:item:batch:save")
@ApiOperation(value = "批量添加学习内容项目", notes = "批量添加学习内容项目")
public Map<String, Object> batchSaveTItem(@Validated(value = {Add.class}) List<TItem> tItemList) {
// 保存业务节点信息
boolean result = tItemService.saveBatch(tItemList);
// 返回操作结果
if (result) {
return getSuccessResult();
} else {
// 保存失败
return getFailResult();
}
}
@PostMapping("/save")
@RequiresPermissions("t:item:save")
@ApiOperation(value = "添加学习内容项目", notes = "添加学习内容项目")
public Map<String, Object> saveTItem(@Validated(value = {Add.class}) TItem tItem) {
// 保存业务节点信息
boolean result = tItemService.save(tItem);
// 返回操作结果
if (result) {
return getSuccessResult();
} else {
// 保存失败
return getFailResult();
}
}
@PutMapping("/update")
@RequiresPermissions("t:item:update")
@ApiOperation(value = "修改学习内容项目信息", notes = "修改学习内容项目信息")
public Map<String, Object> updateTItem(@Validated(value = {Update.class}) TItem tItem) {
boolean flag = tItemService.updateById(tItem);
if (flag) {
return getSuccessResult();
}
return getFailResult();
}
@PutMapping("/updateAuditStatus/{id}")
@RequiresPermissions("t:item: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<TItem> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
updateWrapper.eq("audit_status", status.name());
boolean flag = tItemService.update(updateWrapper);
if (flag) {
return getSuccessResult();
}
return getFailResult();
}
@DeleteMapping("/delete/{id}")
@RequiresPermissions("t:item:delete")
@ApiOperation(value = "根据ID删除学习内容项目", notes = "根据ID删除学习内容项目")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
public Map<String, Object> deleteTItem(@PathVariable("id") String id) {
boolean result = tItemService.removeById(id);
if (result) {
return getSuccessResult();
}
return getFailResult();
}
@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:item:page")
@ApiOperation(value = "获取学习内容项目分页列表", notes = "获取学习内容项目分页列表")
public Map<String, Object> getTItemPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<TItem> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(TItem::getName, genericPageParam.getNameOrCode());
}
// 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(TItem::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.le(TItem::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
}
// 设置排序规则
queryWrapper.orderByDesc(TItem::getCreateTime);
// 设置查询内容
queryWrapper.select(
TItem::getId,
TItem::getName,
TItem::getCreateTime,
TItem::getUpdateTime);
Page<TItem> page = this.tItemService.page(getPage(), queryWrapper);
for (TItem tItem : page.getRecords()) {
}
return getResult(page);
}
@ApiOperation(value = "获取学习内容项目详情", notes = "获取学习内容项目详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path")
})
@GetMapping("/get/{id}")
@RequiresPermissions("t:item:get:id")
public Map<String, Object> getById(@PathVariable("id") String id) {
TItem tItem = tItemService.getById(id);
return getResult(tItem);
}
}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="cover" property="cover"/> <result column="cover" property="cover"/>
<result column="applicable_scope" property="applicableScope"/> <result column="applicable_scope" property="applicableScope"/>
<result column="organ_id" property="organId"/>
<result column="learning_project_id" property="learningProjectId"/> <result column="learning_project_id" property="learningProjectId"/>
<result column="audit_status" property="auditStatus"/> <result column="audit_status" property="auditStatus"/>
<result column="is_published" property="isPublished"/> <result column="is_published" property="isPublished"/>
...@@ -19,8 +20,7 @@ ...@@ -19,8 +20,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, cover, applicable_scope, learning_project_id, audit_status, is_published, is_deleted, sortorder, id, name, cover, applicable_scope, organ_id, learning_project_id, audit_status, is_published, is_deleted, sortorder, create_time, update_time
create_time, update_time
</sql> </sql>
</mapper> </mapper>
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