Browse Source

修改提交

master
主管理员 8 months ago
parent
commit
4d606cde3a
49 changed files with 3587 additions and 1075 deletions
  1. +2
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/controller/AtComplaintLogController.java
  3. +71
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/entity/AtComplaintLog.java
  4. +17
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/mapper/AtComplaintLogMapper.java
  5. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/mapper/xml/AtComplaintLogMapper.xml
  6. +14
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/service/IAtComplaintLogService.java
  7. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/service/impl/AtComplaintLogServiceImpl.java
  8. +196
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/AtComplaintLogList.vue
  9. +124
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogForm.vue
  10. +84
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogModal.Style#Drawer.vue
  11. +60
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogModal.vue
  12. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLog.api.ts
  13. +66
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLog.data.ts
  14. +162
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLogList.vue
  15. +58
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/components/AtComplaintLogModal.vue
  16. +171
    -171
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/controller/AtMasterPieceController.java
  17. +75
    -62
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/entity/AtMasterPiece.java
  18. +17
    -17
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/mapper/AtMasterPieceMapper.java
  19. +4
    -4
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/mapper/xml/AtMasterPieceMapper.xml
  20. +14
    -14
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/service/IAtMasterPieceService.java
  21. +19
    -19
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/service/impl/AtMasterPieceServiceImpl.java
  22. +203
    -183
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/AtMasterPieceList.vue
  23. +128
    -113
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceForm.vue
  24. +83
    -83
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceModal.Style#Drawer.vue
  25. +59
    -59
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceModal.vue
  26. +61
    -61
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPiece.api.ts
  27. +82
    -46
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPiece.data.ts
  28. +161
    -161
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPieceList.vue
  29. +57
    -57
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/components/AtMasterPieceModal.vue
  30. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/controller/AtThumbsLogController.java
  31. +71
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/entity/AtThumbsLog.java
  32. +17
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/mapper/AtThumbsLogMapper.java
  33. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/mapper/xml/AtThumbsLogMapper.xml
  34. +14
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/service/IAtThumbsLogService.java
  35. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/service/impl/AtThumbsLogServiceImpl.java
  36. +196
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/AtThumbsLogList.vue
  37. +124
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogForm.vue
  38. +84
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogModal.Style#Drawer.vue
  39. +60
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogModal.vue
  40. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLog.api.ts
  41. +66
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLog.data.ts
  42. +162
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLogList.vue
  43. +58
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/components/AtThumbsLogModal.vue
  44. +8
    -8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/noticeapicontroller/IndexApiController.java
  45. +35
    -3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/noticeapicontroller/InfoApiController.java
  46. +4
    -4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/IndexApiService.java
  47. +15
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/InfoApiService.java
  48. +85
    -9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/IndexApiServiceImpl.java
  49. +88
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/InfoApiServiceImpl.java

+ 2
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java View File

@ -73,9 +73,10 @@ public class ShiroConfig {
}
//开启小程序不需要token的接口过滤 现在先全开放后面再来改
//开启小程序不需要token的接口过滤 现在先全开放后面再来改e
filterChainDefinitionMap.put("/api/login/**", "anon");
filterChainDefinitionMap.put("/api/index/**", "anon");
filterChainDefinitionMap.put("/api/order/**", "anon");
filterChainDefinitionMap.put("/api/info/**", "anon");


+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/controller/AtComplaintLogController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.atComplaintLog.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.atComplaintLog.entity.AtComplaintLog;
import org.jeecg.modules.atComplaintLog.service.IAtComplaintLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 举报投诉日志表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Api(tags="举报投诉日志表")
@RestController
@RequestMapping("/atComplaintLog/atComplaintLog")
@Slf4j
public class AtComplaintLogController extends JeecgController<AtComplaintLog, IAtComplaintLogService> {
@Autowired
private IAtComplaintLogService atComplaintLogService;
/**
* 分页列表查询
*
* @param atComplaintLog
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "举报投诉日志表-分页列表查询")
@ApiOperation(value="举报投诉日志表-分页列表查询", notes="举报投诉日志表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AtComplaintLog>> queryPageList(AtComplaintLog atComplaintLog,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AtComplaintLog> queryWrapper = QueryGenerator.initQueryWrapper(atComplaintLog, req.getParameterMap());
Page<AtComplaintLog> page = new Page<AtComplaintLog>(pageNo, pageSize);
IPage<AtComplaintLog> pageList = atComplaintLogService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param atComplaintLog
* @return
*/
@AutoLog(value = "举报投诉日志表-添加")
@ApiOperation(value="举报投诉日志表-添加", notes="举报投诉日志表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AtComplaintLog atComplaintLog) {
atComplaintLogService.save(atComplaintLog);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param atComplaintLog
* @return
*/
@AutoLog(value = "举报投诉日志表-编辑")
@ApiOperation(value="举报投诉日志表-编辑", notes="举报投诉日志表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AtComplaintLog atComplaintLog) {
atComplaintLogService.updateById(atComplaintLog);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "举报投诉日志表-通过id删除")
@ApiOperation(value="举报投诉日志表-通过id删除", notes="举报投诉日志表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
atComplaintLogService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "举报投诉日志表-批量删除")
@ApiOperation(value="举报投诉日志表-批量删除", notes="举报投诉日志表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.atComplaintLogService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "举报投诉日志表-通过id查询")
@ApiOperation(value="举报投诉日志表-通过id查询", notes="举报投诉日志表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AtComplaintLog> queryById(@RequestParam(name="id",required=true) String id) {
AtComplaintLog atComplaintLog = atComplaintLogService.getById(id);
if(atComplaintLog==null) {
return Result.error("未找到对应数据");
}
return Result.OK(atComplaintLog);
}
/**
* 导出excel
*
* @param request
* @param atComplaintLog
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AtComplaintLog atComplaintLog) {
return super.exportXls(request, atComplaintLog, AtComplaintLog.class, "举报投诉日志表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AtComplaintLog.class);
}
}

+ 71
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/entity/AtComplaintLog.java View File

@ -0,0 +1,71 @@
package org.jeecg.modules.atComplaintLog.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 举报投诉日志表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Data
@TableName("at_complaint_log")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="at_complaint_log对象", description="举报投诉日志表")
public class AtComplaintLog implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户*/
@Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "用户")
private java.lang.String userId;
/**类型 */
@Excel(name = "类型 ", width = 15)
@ApiModelProperty(value = "类型 ")
private java.lang.Integer type;
/**举报溯源*/
@Excel(name = "举报溯源", width = 15)
@ApiModelProperty(value = "举报溯源")
private java.lang.String orderId;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String complaint;
/**原因标识*/
@Excel(name = "原因标识", width = 15)
@ApiModelProperty(value = "原因标识")
private java.lang.String complaintId;
}

+ 17
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/mapper/AtComplaintLogMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.atComplaintLog.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.atComplaintLog.entity.AtComplaintLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 举报投诉日志表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface AtComplaintLogMapper extends BaseMapper<AtComplaintLog> {
}

+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/mapper/xml/AtComplaintLogMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.atComplaintLog.mapper.AtComplaintLogMapper">
</mapper>

+ 14
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/service/IAtComplaintLogService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.atComplaintLog.service;
import org.jeecg.modules.atComplaintLog.entity.AtComplaintLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 举报投诉日志表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface IAtComplaintLogService extends IService<AtComplaintLog> {
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/service/impl/AtComplaintLogServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.atComplaintLog.service.impl;
import org.jeecg.modules.atComplaintLog.entity.AtComplaintLog;
import org.jeecg.modules.atComplaintLog.mapper.AtComplaintLogMapper;
import org.jeecg.modules.atComplaintLog.service.IAtComplaintLogService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 举报投诉日志表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Service
public class AtComplaintLogServiceImpl extends ServiceImpl<AtComplaintLogMapper, AtComplaintLog> implements IAtComplaintLogService {
}

+ 196
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/AtComplaintLogList.vue View File

@ -0,0 +1,196 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('举报投诉日志表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<at-complaint-log-modal ref="modalForm" @ok="modalFormOk"></at-complaint-log-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import AtComplaintLogModal from './modules/AtComplaintLogModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'AtComplaintLogList',
mixins:[JeecgListMixin, mixinDevice],
components: {
AtComplaintLogModal
},
data () {
return {
description: '举报投诉日志表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title:'类型 ',
align:"center",
dataIndex: 'type'
},
{
title:'举报溯源',
align:"center",
dataIndex: 'orderId'
},
{
title:'内容',
align:"center",
dataIndex: 'complaint'
},
{
title:'原因标识',
align:"center",
dataIndex: 'complaintId'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/atComplaintLog/atComplaintLog/list",
delete: "/atComplaintLog/atComplaintLog/delete",
deleteBatch: "/atComplaintLog/atComplaintLog/deleteBatch",
exportXlsUrl: "/atComplaintLog/atComplaintLog/exportXls",
importExcelUrl: "atComplaintLog/atComplaintLog/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'})
fieldList.push({type:'int',value:'type',text:'类型 ',dictCode:''})
fieldList.push({type:'string',value:'orderId',text:'举报溯源',dictCode:''})
fieldList.push({type:'string',value:'complaint',text:'内容',dictCode:''})
fieldList.push({type:'string',value:'complaintId',text:'原因标识',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 124
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogForm.vue View File

@ -0,0 +1,124 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="类型 " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input-number v-model="model.type" placeholder="请输入类型 " style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="举报溯源" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
<a-input v-model="model.orderId" placeholder="请输入举报溯源" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="complaint">
<a-input v-model="model.complaint" placeholder="请输入内容" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="原因标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="complaintId">
<a-input v-model="model.complaintId" placeholder="请输入原因标识" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'AtComplaintLogForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/atComplaintLog/atComplaintLog/add",
edit: "/atComplaintLog/atComplaintLog/edit",
queryById: "/atComplaintLog/atComplaintLog/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<at-complaint-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></at-complaint-log-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import AtComplaintLogForm from './AtComplaintLogForm'
export default {
name: 'AtComplaintLogModal',
components: {
AtComplaintLogForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue/modules/AtComplaintLogModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<at-complaint-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></at-complaint-log-form>
</j-modal>
</template>
<script>
import AtComplaintLogForm from './AtComplaintLogForm'
export default {
name: 'AtComplaintLogModal',
components: {
AtComplaintLogForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLog.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/atComplaintLog/atComplaintLog/list',
save='/atComplaintLog/atComplaintLog/add',
edit='/atComplaintLog/atComplaintLog/edit',
deleteOne = '/atComplaintLog/atComplaintLog/delete',
deleteBatch = '/atComplaintLog/atComplaintLog/deleteBatch',
importExcel = '/atComplaintLog/atComplaintLog/importExcel',
exportXls = '/atComplaintLog/atComplaintLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 66
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLog.data.ts View File

@ -0,0 +1,66 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title: '类型 ',
align:"center",
dataIndex: 'type'
},
{
title: '举报溯源',
align:"center",
dataIndex: 'orderId'
},
{
title: '内容',
align:"center",
dataIndex: 'complaint'
},
{
title: '原因标识',
align:"center",
dataIndex: 'complaintId'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'JSearchSelect',
componentProps:{
dict:"han_hai_member,nick_name,id"
},
},
{
label: '类型 ',
field: 'type',
component: 'InputNumber',
},
{
label: '举报溯源',
field: 'orderId',
component: 'Input',
},
{
label: '内容',
field: 'complaint',
component: 'Input',
},
{
label: '原因标识',
field: 'complaintId',
component: 'Input',
},
];

+ 162
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/AtComplaintLogList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AtComplaintLogModal @register="registerModal" @success="handleSuccess"></AtComplaintLogModal>
</div>
</template>
<script lang="ts" name="atComplaintLog-atComplaintLog" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AtComplaintLogModal from './components/AtComplaintLogModal.vue'
import {columns, searchFormSchema} from './atComplaintLog.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './atComplaintLog.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '举报投诉日志表',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"举报投诉日志表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atComplaintLog/vue3/components/AtComplaintLogModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../atComplaintLog.data';
import {saveOrUpdate} from '../atComplaintLog.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 171
- 171
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/controller/AtMasterPieceController.java View File

@ -1,171 +1,171 @@
package org.jeecg.modules.atMasterPiece.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-08-25
* @Version: V1.0
*/
@Api(tags="代表作品表")
@RestController
@RequestMapping("/atMasterPiece/atMasterPiece")
@Slf4j
public class AtMasterPieceController extends JeecgController<AtMasterPiece, IAtMasterPieceService> {
@Autowired
private IAtMasterPieceService atMasterPieceService;
/**
* 分页列表查询
*
* @param atMasterPiece
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "代表作品表-分页列表查询")
@ApiOperation(value="代表作品表-分页列表查询", notes="代表作品表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AtMasterPiece>> queryPageList(AtMasterPiece atMasterPiece,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AtMasterPiece> queryWrapper = QueryGenerator.initQueryWrapper(atMasterPiece, req.getParameterMap());
Page<AtMasterPiece> page = new Page<AtMasterPiece>(pageNo, pageSize);
IPage<AtMasterPiece> pageList = atMasterPieceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param atMasterPiece
* @return
*/
@AutoLog(value = "代表作品表-添加")
@ApiOperation(value="代表作品表-添加", notes="代表作品表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AtMasterPiece atMasterPiece) {
atMasterPieceService.save(atMasterPiece);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param atMasterPiece
* @return
*/
@AutoLog(value = "代表作品表-编辑")
@ApiOperation(value="代表作品表-编辑", notes="代表作品表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AtMasterPiece atMasterPiece) {
atMasterPieceService.updateById(atMasterPiece);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "代表作品表-通过id删除")
@ApiOperation(value="代表作品表-通过id删除", notes="代表作品表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
atMasterPieceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "代表作品表-批量删除")
@ApiOperation(value="代表作品表-批量删除", notes="代表作品表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.atMasterPieceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "代表作品表-通过id查询")
@ApiOperation(value="代表作品表-通过id查询", notes="代表作品表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AtMasterPiece> queryById(@RequestParam(name="id",required=true) String id) {
AtMasterPiece atMasterPiece = atMasterPieceService.getById(id);
if(atMasterPiece==null) {
return Result.error("未找到对应数据");
}
return Result.OK(atMasterPiece);
}
/**
* 导出excel
*
* @param request
* @param atMasterPiece
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AtMasterPiece atMasterPiece) {
return super.exportXls(request, atMasterPiece, AtMasterPiece.class, "代表作品表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AtMasterPiece.class);
}
}
package org.jeecg.modules.atMasterPiece.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Api(tags="代表作品表")
@RestController
@RequestMapping("/atMasterPiece/atMasterPiece")
@Slf4j
public class AtMasterPieceController extends JeecgController<AtMasterPiece, IAtMasterPieceService> {
@Autowired
private IAtMasterPieceService atMasterPieceService;
/**
* 分页列表查询
*
* @param atMasterPiece
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "代表作品表-分页列表查询")
@ApiOperation(value="代表作品表-分页列表查询", notes="代表作品表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AtMasterPiece>> queryPageList(AtMasterPiece atMasterPiece,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AtMasterPiece> queryWrapper = QueryGenerator.initQueryWrapper(atMasterPiece, req.getParameterMap());
Page<AtMasterPiece> page = new Page<AtMasterPiece>(pageNo, pageSize);
IPage<AtMasterPiece> pageList = atMasterPieceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param atMasterPiece
* @return
*/
@AutoLog(value = "代表作品表-添加")
@ApiOperation(value="代表作品表-添加", notes="代表作品表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AtMasterPiece atMasterPiece) {
atMasterPieceService.save(atMasterPiece);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param atMasterPiece
* @return
*/
@AutoLog(value = "代表作品表-编辑")
@ApiOperation(value="代表作品表-编辑", notes="代表作品表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AtMasterPiece atMasterPiece) {
atMasterPieceService.updateById(atMasterPiece);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "代表作品表-通过id删除")
@ApiOperation(value="代表作品表-通过id删除", notes="代表作品表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
atMasterPieceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "代表作品表-批量删除")
@ApiOperation(value="代表作品表-批量删除", notes="代表作品表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.atMasterPieceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "代表作品表-通过id查询")
@ApiOperation(value="代表作品表-通过id查询", notes="代表作品表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AtMasterPiece> queryById(@RequestParam(name="id",required=true) String id) {
AtMasterPiece atMasterPiece = atMasterPieceService.getById(id);
if(atMasterPiece==null) {
return Result.error("未找到对应数据");
}
return Result.OK(atMasterPiece);
}
/**
* 导出excel
*
* @param request
* @param atMasterPiece
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AtMasterPiece atMasterPiece) {
return super.exportXls(request, atMasterPiece, AtMasterPiece.class, "代表作品表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AtMasterPiece.class);
}
}

+ 75
- 62
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/entity/AtMasterPiece.java View File

@ -1,62 +1,75 @@
package org.jeecg.modules.atMasterPiece.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-08-25
* @Version: V1.0
*/
@Data
@TableName("at_masterpiece")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="at_masterpiece对象", description="代表作品表")
public class AtMasterPiece implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户*/
@Excel(name = "用户", width = 15)
@ApiModelProperty(value = "用户")
private java.lang.String userId;
/**作品图片*/
@Excel(name = "作品图片", width = 15)
@ApiModelProperty(value = "作品图片")
private java.lang.String image;
/**作品标题*/
@Excel(name = "作品标题", width = 15)
@ApiModelProperty(value = "作品标题")
private java.lang.String title;
}
package org.jeecg.modules.atMasterPiece.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Data
@TableName("at_masterpiece")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="at_masterpiece对象", description="代表作品表")
public class AtMasterPiece implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户*/
@Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "用户")
private java.lang.String userId;
/**作品图片*/
@Excel(name = "作品图片", width = 15)
@ApiModelProperty(value = "作品图片")
private java.lang.String image;
/**作品标题*/
@Excel(name = "作品标题", width = 15)
@ApiModelProperty(value = "作品标题")
private java.lang.String title;
/**视频*/
@Excel(name = "视频", width = 15)
@ApiModelProperty(value = "视频")
private java.lang.String vod;
/**文本内容*/
@Excel(name = "文本内容", width = 15)
@ApiModelProperty(value = "文本内容")
private java.lang.String context;
/**投票次数*/
@Excel(name = "投票次数", width = 15)
@ApiModelProperty(value = "投票次数")
private java.lang.Integer num;
}

+ 17
- 17
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/mapper/AtMasterPieceMapper.java View File

@ -1,17 +1,17 @@
package org.jeecg.modules.atMasterPiece.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-08-25
* @Version: V1.0
*/
public interface AtMasterPieceMapper extends BaseMapper<AtMasterPiece> {
}
package org.jeecg.modules.atMasterPiece.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface AtMasterPieceMapper extends BaseMapper<AtMasterPiece> {
}

+ 4
- 4
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/mapper/xml/AtMasterPieceMapper.xml View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.atMasterPiece.mapper.AtMasterPieceMapper">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.atMasterPiece.mapper.AtMasterPieceMapper">
</mapper>

+ 14
- 14
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/service/IAtMasterPieceService.java View File

@ -1,14 +1,14 @@
package org.jeecg.modules.atMasterPiece.service;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-08-25
* @Version: V1.0
*/
public interface IAtMasterPieceService extends IService<AtMasterPiece> {
}
package org.jeecg.modules.atMasterPiece.service;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface IAtMasterPieceService extends IService<AtMasterPiece> {
}

+ 19
- 19
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/service/impl/AtMasterPieceServiceImpl.java View File

@ -1,19 +1,19 @@
package org.jeecg.modules.atMasterPiece.service.impl;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atMasterPiece.mapper.AtMasterPieceMapper;
import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-08-25
* @Version: V1.0
*/
@Service
public class AtMasterPieceServiceImpl extends ServiceImpl<AtMasterPieceMapper, AtMasterPiece> implements IAtMasterPieceService {
}
package org.jeecg.modules.atMasterPiece.service.impl;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atMasterPiece.mapper.AtMasterPieceMapper;
import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 代表作品表
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Service
public class AtMasterPieceServiceImpl extends ServiceImpl<AtMasterPieceMapper, AtMasterPiece> implements IAtMasterPieceService {
}

+ 203
- 183
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/AtMasterPieceList.vue View File

@ -1,184 +1,204 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('代表作品表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<at-master-piece-modal ref="modalForm" @ok="modalFormOk"></at-master-piece-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import AtMasterPieceModal from './modules/AtMasterPieceModal'
export default {
name: 'AtMasterPieceList',
mixins:[JeecgListMixin, mixinDevice],
components: {
AtMasterPieceModal
},
data () {
return {
description: '代表作品表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户',
align:"center",
dataIndex: 'userId'
},
{
title:'作品图片',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'作品标题',
align:"center",
dataIndex: 'title'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/atMasterPiece/atMasterPiece/list",
delete: "/atMasterPiece/atMasterPiece/delete",
deleteBatch: "/atMasterPiece/atMasterPiece/deleteBatch",
exportXlsUrl: "/atMasterPiece/atMasterPiece/exportXls",
importExcelUrl: "atMasterPiece/atMasterPiece/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''})
fieldList.push({type:'string',value:'image',text:'作品图片',dictCode:''})
fieldList.push({type:'string',value:'title',text:'作品标题',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('代表作品表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<at-master-piece-modal ref="modalForm" @ok="modalFormOk"></at-master-piece-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import AtMasterPieceModal from './modules/AtMasterPieceModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'AtMasterPieceList',
mixins:[JeecgListMixin, mixinDevice],
components: {
AtMasterPieceModal
},
data () {
return {
description: '代表作品表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title:'作品图片',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'作品标题',
align:"center",
dataIndex: 'title'
},
{
title:'视频',
align:"center",
dataIndex: 'vod',
scopedSlots: {customRender: 'fileSlot'}
},
{
title:'文本内容',
align:"center",
dataIndex: 'context'
},
{
title:'投票次数',
align:"center",
dataIndex: 'num'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/atMasterPiece/atMasterPiece/list",
delete: "/atMasterPiece/atMasterPiece/delete",
deleteBatch: "/atMasterPiece/atMasterPiece/deleteBatch",
exportXlsUrl: "/atMasterPiece/atMasterPiece/exportXls",
importExcelUrl: "atMasterPiece/atMasterPiece/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'})
fieldList.push({type:'string',value:'image',text:'作品图片',dictCode:''})
fieldList.push({type:'string',value:'title',text:'作品标题',dictCode:''})
fieldList.push({type:'string',value:'vod',text:'视频',dictCode:''})
fieldList.push({type:'string',value:'context',text:'文本内容',dictCode:''})
fieldList.push({type:'int',value:'num',text:'投票次数',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 128
- 113
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceForm.vue View File

@ -1,114 +1,129 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<a-input v-model="model.userId" placeholder="请输入用户" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="作品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="作品标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-input v-model="model.title" placeholder="请输入作品标题" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'AtMasterPieceForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/atMasterPiece/atMasterPiece/add",
edit: "/atMasterPiece/atMasterPiece/edit",
queryById: "/atMasterPiece/atMasterPiece/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="作品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="作品标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-input v-model="model.title" placeholder="请输入作品标题" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="视频" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="vod">
<j-upload v-model="model.vod" ></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="文本内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="context">
<a-textarea v-model="model.context" rows="4" placeholder="请输入文本内容" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="投票次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
<a-input-number v-model="model.num" placeholder="请输入投票次数" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'AtMasterPieceForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/atMasterPiece/atMasterPiece/add",
edit: "/atMasterPiece/atMasterPiece/edit",
queryById: "/atMasterPiece/atMasterPiece/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 83
- 83
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceModal.Style#Drawer.vue View File

@ -1,84 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<at-master-piece-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></at-master-piece-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import AtMasterPieceForm from './AtMasterPieceForm'
export default {
name: 'AtMasterPieceModal',
components: {
AtMasterPieceForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<at-master-piece-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></at-master-piece-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import AtMasterPieceForm from './AtMasterPieceForm'
export default {
name: 'AtMasterPieceModal',
components: {
AtMasterPieceForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 59
- 59
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue/modules/AtMasterPieceModal.vue View File

@ -1,60 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<at-master-piece-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></at-master-piece-form>
</j-modal>
</template>
<script>
import AtMasterPieceForm from './AtMasterPieceForm'
export default {
name: 'AtMasterPieceModal',
components: {
AtMasterPieceForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<at-master-piece-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></at-master-piece-form>
</j-modal>
</template>
<script>
import AtMasterPieceForm from './AtMasterPieceForm'
export default {
name: 'AtMasterPieceModal',
components: {
AtMasterPieceForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 61
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPiece.api.ts View File

@ -1,61 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/atMasterPiece/atMasterPiece/list',
save='/atMasterPiece/atMasterPiece/add',
edit='/atMasterPiece/atMasterPiece/edit',
deleteOne = '/atMasterPiece/atMasterPiece/delete',
deleteBatch = '/atMasterPiece/atMasterPiece/deleteBatch',
importExcel = '/atMasterPiece/atMasterPiece/importExcel',
exportXls = '/atMasterPiece/atMasterPiece/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/atMasterPiece/atMasterPiece/list',
save='/atMasterPiece/atMasterPiece/add',
edit='/atMasterPiece/atMasterPiece/edit',
deleteOne = '/atMasterPiece/atMasterPiece/delete',
deleteBatch = '/atMasterPiece/atMasterPiece/deleteBatch',
importExcel = '/atMasterPiece/atMasterPiece/importExcel',
exportXls = '/atMasterPiece/atMasterPiece/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 82
- 46
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPiece.data.ts View File

@ -1,46 +1,82 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户',
align:"center",
dataIndex: 'userId'
},
{
title: '作品图片',
align:"center",
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '作品标题',
align:"center",
dataIndex: 'title'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'Input',
},
{
label: '作品图片',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '作品标题',
field: 'title',
component: 'Input',
},
];
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title: '作品图片',
align:"center",
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '作品标题',
align:"center",
dataIndex: 'title'
},
{
title: '视频',
align:"center",
dataIndex: 'vod',
slots: { customRender: 'fileSlot' },
},
{
title: '文本内容',
align:"center",
dataIndex: 'context'
},
{
title: '投票次数',
align:"center",
dataIndex: 'num'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'JSearchSelect',
componentProps:{
dict:"han_hai_member,nick_name,id"
},
},
{
label: '作品图片',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '作品标题',
field: 'title',
component: 'Input',
},
{
label: '视频',
field: 'vod',
component: 'JUpload',
componentProps:{
},
},
{
label: '文本内容',
field: 'context',
component: 'InputTextArea',//TODO 注意string转换问题
},
{
label: '投票次数',
field: 'num',
component: 'InputNumber',
},
];

+ 161
- 161
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/AtMasterPieceList.vue View File

@ -1,162 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AtMasterPieceModal @register="registerModal" @success="handleSuccess"></AtMasterPieceModal>
</div>
</template>
<script lang="ts" name="atMasterPiece-atMasterPiece" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AtMasterPieceModal from './components/AtMasterPieceModal.vue'
import {columns, searchFormSchema} from './atMasterPiece.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './atMasterPiece.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '代表作品表',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"代表作品表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AtMasterPieceModal @register="registerModal" @success="handleSuccess"></AtMasterPieceModal>
</div>
</template>
<script lang="ts" name="atMasterPiece-atMasterPiece" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AtMasterPieceModal from './components/AtMasterPieceModal.vue'
import {columns, searchFormSchema} from './atMasterPiece.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './atMasterPiece.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '代表作品表',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"代表作品表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 57
- 57
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atMasterPiece/vue3/components/AtMasterPieceModal.vue View File

@ -1,58 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../atMasterPiece.data';
import {saveOrUpdate} from '../atMasterPiece.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../atMasterPiece.data';
import {saveOrUpdate} from '../atMasterPiece.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/controller/AtThumbsLogController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.atThumbsLog.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import org.jeecg.modules.atThumbsLog.service.IAtThumbsLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 点赞记录
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Api(tags="点赞记录")
@RestController
@RequestMapping("/atThumbsLog/atThumbsLog")
@Slf4j
public class AtThumbsLogController extends JeecgController<AtThumbsLog, IAtThumbsLogService> {
@Autowired
private IAtThumbsLogService atThumbsLogService;
/**
* 分页列表查询
*
* @param atThumbsLog
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "点赞记录-分页列表查询")
@ApiOperation(value="点赞记录-分页列表查询", notes="点赞记录-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AtThumbsLog>> queryPageList(AtThumbsLog atThumbsLog,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AtThumbsLog> queryWrapper = QueryGenerator.initQueryWrapper(atThumbsLog, req.getParameterMap());
Page<AtThumbsLog> page = new Page<AtThumbsLog>(pageNo, pageSize);
IPage<AtThumbsLog> pageList = atThumbsLogService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param atThumbsLog
* @return
*/
@AutoLog(value = "点赞记录-添加")
@ApiOperation(value="点赞记录-添加", notes="点赞记录-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AtThumbsLog atThumbsLog) {
atThumbsLogService.save(atThumbsLog);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param atThumbsLog
* @return
*/
@AutoLog(value = "点赞记录-编辑")
@ApiOperation(value="点赞记录-编辑", notes="点赞记录-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AtThumbsLog atThumbsLog) {
atThumbsLogService.updateById(atThumbsLog);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "点赞记录-通过id删除")
@ApiOperation(value="点赞记录-通过id删除", notes="点赞记录-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
atThumbsLogService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "点赞记录-批量删除")
@ApiOperation(value="点赞记录-批量删除", notes="点赞记录-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.atThumbsLogService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "点赞记录-通过id查询")
@ApiOperation(value="点赞记录-通过id查询", notes="点赞记录-通过id查询")
@GetMapping(value = "/queryById")
public Result<AtThumbsLog> queryById(@RequestParam(name="id",required=true) String id) {
AtThumbsLog atThumbsLog = atThumbsLogService.getById(id);
if(atThumbsLog==null) {
return Result.error("未找到对应数据");
}
return Result.OK(atThumbsLog);
}
/**
* 导出excel
*
* @param request
* @param atThumbsLog
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AtThumbsLog atThumbsLog) {
return super.exportXls(request, atThumbsLog, AtThumbsLog.class, "点赞记录");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AtThumbsLog.class);
}
}

+ 71
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/entity/AtThumbsLog.java View File

@ -0,0 +1,71 @@
package org.jeecg.modules.atThumbsLog.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 点赞记录
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Data
@TableName("at_thumbs_log")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="at_thumbs_log对象", description="点赞记录")
public class AtThumbsLog implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户*/
@Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "用户")
private java.lang.String userId;
/**类型*/
@Excel(name = "类型", width = 15)
@ApiModelProperty(value = "类型")
private java.lang.Integer type;
/**溯源标识*/
@Excel(name = "溯源标识", width = 15)
@ApiModelProperty(value = "溯源标识")
private java.lang.String orderId;
/**点赞名称*/
@Excel(name = "点赞名称", width = 15)
@ApiModelProperty(value = "点赞名称")
private java.lang.String orderName;
/**点赞/踩*/
@Excel(name = "点赞/踩", width = 15)
@ApiModelProperty(value = "点赞/踩")
private java.lang.String isState;
}

+ 17
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/mapper/AtThumbsLogMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.atThumbsLog.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 点赞记录
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface AtThumbsLogMapper extends BaseMapper<AtThumbsLog> {
}

+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/mapper/xml/AtThumbsLogMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.atThumbsLog.mapper.AtThumbsLogMapper">
</mapper>

+ 14
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/service/IAtThumbsLogService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.atThumbsLog.service;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 点赞记录
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
public interface IAtThumbsLogService extends IService<AtThumbsLog> {
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/service/impl/AtThumbsLogServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.atThumbsLog.service.impl;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import org.jeecg.modules.atThumbsLog.mapper.AtThumbsLogMapper;
import org.jeecg.modules.atThumbsLog.service.IAtThumbsLogService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 点赞记录
* @Author: jeecg-boot
* @Date: 2024-09-12
* @Version: V1.0
*/
@Service
public class AtThumbsLogServiceImpl extends ServiceImpl<AtThumbsLogMapper, AtThumbsLog> implements IAtThumbsLogService {
}

+ 196
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/AtThumbsLogList.vue View File

@ -0,0 +1,196 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('点赞记录')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<at-thumbs-log-modal ref="modalForm" @ok="modalFormOk"></at-thumbs-log-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import AtThumbsLogModal from './modules/AtThumbsLogModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'AtThumbsLogList',
mixins:[JeecgListMixin, mixinDevice],
components: {
AtThumbsLogModal
},
data () {
return {
description: '点赞记录管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title:'类型',
align:"center",
dataIndex: 'type'
},
{
title:'溯源标识',
align:"center",
dataIndex: 'orderId'
},
{
title:'点赞名称',
align:"center",
dataIndex: 'orderName'
},
{
title:'点赞/踩',
align:"center",
dataIndex: 'isState'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/atThumbsLog/atThumbsLog/list",
delete: "/atThumbsLog/atThumbsLog/delete",
deleteBatch: "/atThumbsLog/atThumbsLog/deleteBatch",
exportXlsUrl: "/atThumbsLog/atThumbsLog/exportXls",
importExcelUrl: "atThumbsLog/atThumbsLog/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'})
fieldList.push({type:'int',value:'type',text:'类型',dictCode:''})
fieldList.push({type:'string',value:'orderId',text:'溯源标识',dictCode:''})
fieldList.push({type:'string',value:'orderName',text:'点赞名称',dictCode:''})
fieldList.push({type:'string',value:'isState',text:'点赞/踩',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 124
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogForm.vue View File

@ -0,0 +1,124 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input-number v-model="model.type" placeholder="请输入类型" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="溯源标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
<a-input v-model="model.orderId" placeholder="请输入溯源标识" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="点赞名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderName">
<a-input v-model="model.orderName" placeholder="请输入点赞名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="点赞/踩" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isState">
<a-input v-model="model.isState" placeholder="请输入点赞/踩" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'AtThumbsLogForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/atThumbsLog/atThumbsLog/add",
edit: "/atThumbsLog/atThumbsLog/edit",
queryById: "/atThumbsLog/atThumbsLog/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<at-thumbs-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></at-thumbs-log-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import AtThumbsLogForm from './AtThumbsLogForm'
export default {
name: 'AtThumbsLogModal',
components: {
AtThumbsLogForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue/modules/AtThumbsLogModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<at-thumbs-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></at-thumbs-log-form>
</j-modal>
</template>
<script>
import AtThumbsLogForm from './AtThumbsLogForm'
export default {
name: 'AtThumbsLogModal',
components: {
AtThumbsLogForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLog.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/atThumbsLog/atThumbsLog/list',
save='/atThumbsLog/atThumbsLog/add',
edit='/atThumbsLog/atThumbsLog/edit',
deleteOne = '/atThumbsLog/atThumbsLog/delete',
deleteBatch = '/atThumbsLog/atThumbsLog/deleteBatch',
importExcel = '/atThumbsLog/atThumbsLog/importExcel',
exportXls = '/atThumbsLog/atThumbsLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 66
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLog.data.ts View File

@ -0,0 +1,66 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title: '类型',
align:"center",
dataIndex: 'type'
},
{
title: '溯源标识',
align:"center",
dataIndex: 'orderId'
},
{
title: '点赞名称',
align:"center",
dataIndex: 'orderName'
},
{
title: '点赞/踩',
align:"center",
dataIndex: 'isState'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'JSearchSelect',
componentProps:{
dict:"han_hai_member,nick_name,id"
},
},
{
label: '类型',
field: 'type',
component: 'InputNumber',
},
{
label: '溯源标识',
field: 'orderId',
component: 'Input',
},
{
label: '点赞名称',
field: 'orderName',
component: 'Input',
},
{
label: '点赞/踩',
field: 'isState',
component: 'Input',
},
];

+ 162
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/AtThumbsLogList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AtThumbsLogModal @register="registerModal" @success="handleSuccess"></AtThumbsLogModal>
</div>
</template>
<script lang="ts" name="atThumbsLog-atThumbsLog" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AtThumbsLogModal from './components/AtThumbsLogModal.vue'
import {columns, searchFormSchema} from './atThumbsLog.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './atThumbsLog.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '点赞记录',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"点赞记录",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/atThumbsLog/vue3/components/AtThumbsLogModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../atThumbsLog.data';
import {saveOrUpdate} from '../atThumbsLog.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 8
- 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/noticeapicontroller/IndexApiController.java View File

@ -52,26 +52,26 @@ public class IndexApiController {
//获取动态详情
@ApiOperation(value="小程序-获取动态详情", notes="小程序-获取动态详情")
@GetMapping("/getTrendsDetail")
public Result<?> getTrendsDetail(String id)
public Result<?> getTrendsDetail(String id,String token)
{
return indexApiService.getTrendsDetail(id);
return indexApiService.getTrendsDetail(id,token);
}
//获取代表作品带分页
@ApiOperation(value="小程序-获取代表作品带分页", notes="小程序-获取代表作品带分页")
@GetMapping("/getWorkPage")
public Result<?> getWorkPage(String id,String token,WaterPageBean bean)
public Result<?> getWorkPage(String id,WaterPageBean bean)
{
return indexApiService.getWorkPage(token,bean);
return indexApiService.getWorkPage(bean);
}
//获取代表作品详情
@ApiOperation(value="小程序-获取代表作品详情", notes="小程序-获取代表作品详情")
@GetMapping("/getWorkDetail")
public Result<?> getWorkDetail(String id)
public Result<?> getWorkDetail(String id,String token)
{
return indexApiService.getWorkDetail(id);
return indexApiService.getWorkDetail(id,token);
}
//获取演员集带分页
@ -87,9 +87,9 @@ public class IndexApiController {
//获取演员集详情接口
@ApiOperation(value="小程序-获取演员集详情接口", notes="小程序-获取演员集详情接口")
@GetMapping("/getActorDetail")
public Result<?> getActorDetail(String id)
public Result<?> getActorDetail(String id,String token)
{
return indexApiService.getActorDetail(id);
return indexApiService.getActorDetail(id,token);
}


+ 35
- 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/noticeapicontroller/InfoApiController.java View File

@ -8,6 +8,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.*;
import org.jeecg.modules.apiservice.InfoApiService;
import org.jeecg.modules.atActorCollection.entity.AtActorCollection;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atTrends.entity.AtTrends;
import org.jeecg.modules.hanHaiBank.entity.HanHaiBank;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
@ -190,11 +191,42 @@ public class InfoApiController {
}
//举报
//点赞
//发布作品
@ApiOperation(value="小程序-发布作品", notes="小程序-发布作品")
@PostMapping("/releaseWorks")
public Result<?> releaseWorks(@RequestHeader("X-Access-Token") String token, AtMasterPiece atWorks)
{
return infoApiService.releaseWorks(token,atWorks);
}
//点赞 - 作品0/演员1/动态2
@ApiOperation(value="小程序-点赞type-作品0/演员1/动态2", notes="小程序-点赞-作品0/演员1/动态2")
@GetMapping("/like")
public Result<?> like(@RequestHeader("X-Access-Token") String token, String id, Integer type)
{
return infoApiService.like(token,id,type);
}
//
// - 作品0/演员1/动态2
@ApiOperation(value="小程序-踩type-作品0/演员1/动态2", notes="小程序-踩-作品0/演员1/动态2")
@GetMapping("/dislike")
public Result<?> dislike(@RequestHeader("X-Access-Token") String token, String id, Integer type)
{
return infoApiService.dislike(token,id,type);
}
//举报 - 作品0/演员1/动态2
@ApiOperation(value="小程序-举报type-作品0/演员1/动态2", notes="小程序-举报-作品0/演员1/动态2")
@GetMapping("/report")
public Result<?> report(@RequestHeader("X-Access-Token") String token, String id, Integer type)
{
return infoApiService.report(token,id,type);
}


+ 4
- 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/IndexApiService.java View File

@ -18,19 +18,19 @@ public interface IndexApiService {
Result<?> getTrendsPage(TrendsBean bean);
//获取动态详情
Result<?> getTrendsDetail(String id);
Result<?> getTrendsDetail(String id,String token);
//获取代表作品带分页
Result<?> getWorkPage(String token, WaterPageBean bean);
Result<?> getWorkPage( WaterPageBean bean);
//获取代表作品详情
Result<?> getWorkDetail(String id);
Result<?> getWorkDetail(String id,String token);
//获取演员集带分页
Result<?> getActorSetPage(ActorSetPageBean bean);
//获取演员集详情接口
Result<?> getActorDetail(String id);
Result<?> getActorDetail(String id,String token);
//获取投诉原因
Result<?> getComplaintReason();


+ 15
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/InfoApiService.java View File

@ -3,6 +3,7 @@ package org.jeecg.modules.apiservice;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.*;
import org.jeecg.modules.atActorCollection.entity.AtActorCollection;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atTrends.entity.AtTrends;
import org.jeecg.modules.hanHaiBank.entity.HanHaiBank;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
@ -67,4 +68,18 @@ public interface InfoApiService {
//发布演员集
Result<?> releaseActorSet(String token, AtActorCollection atActorCollection);
//发布作品
Result<?> releaseWorks(String token, AtMasterPiece atWorks);
//点赞
Result<?> like(String token, String id, Integer type);
//
Result<?> dislike(String token, String id, Integer type);
//举报
Result<?> report( String token, String id, Integer type);
}

+ 85
- 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/IndexApiServiceImpl.java View File

@ -19,6 +19,8 @@ import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import org.jeecg.modules.atPerformer.entity.AtPerformer;
import org.jeecg.modules.atPerformer.service.IAtPerformerService;
import org.jeecg.modules.atPromotion.service.IAtPromotionService;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import org.jeecg.modules.atThumbsLog.service.IAtThumbsLogService;
import org.jeecg.modules.atTopPrice.service.IAtTopPriceService;
import org.jeecg.modules.atTrends.entity.AtTrends;
import org.jeecg.modules.atTrends.service.IAtTrendsService;
@ -75,6 +77,9 @@ public class IndexApiServiceImpl implements IndexApiService {
//获取置顶
@Resource
private IAtTopPriceService atTopPriceService;
//点赞
@Resource
private IAtThumbsLogService atThumbsLogService;
@ -97,36 +102,84 @@ public class IndexApiServiceImpl implements IndexApiService {
public Result<?> getTrendsPage(TrendsBean bean){
Page<AtTrends> page = new Page<AtTrends>(bean.getPageNo(), bean.getPageSize());
Page<AtTrends> pageList = atTrendsService.page(page);
List<AtTrends> records = pageList.getRecords();
// for (AtTrends atTrends:records) {
// atTrends.setUserId(hanHaiMemberService
// .lambdaQuery()
// .eq(HanHaiMember::getId,atTrends.getUserId()).one().getNickName());
// }
pageList.setRecords(records);
return Result.OK("动态列表", pageList);
}
//获取动态详情
@Override
public Result<?> getTrendsDetail(String id){
public Result<?> getTrendsDetail(String id,String token){
AtTrends byId = atTrendsService.getById(id);
//根据用户标识查询发布人信息
HanHaiMember byId1 = hanHaiMemberService.getById(byId.getUserId());
byId.setUserId(byId1.getNickName());
return Result.OK("动态详情", byId);
Map<String,Object> map = new HashMap<>();
//作品0/演员1/动态2
if (StringUtils.isNotBlank(token)){
HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
AtThumbsLog one = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "2")
.eq(AtThumbsLog::getIsState, "0")
.one();
map.put("isThumbs_up", one);
AtThumbsLog one2 = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "2")
.eq(AtThumbsLog::getIsState, "1")
.one();
map.put("isThumbs_down", one2);
}
map.put("details", byId);
return Result.OK("动态详情", map);
}
//获取代表作品带分页
@Override
public Result<?> getWorkPage(String token, WaterPageBean bean){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
public Result<?> getWorkPage(WaterPageBean bean){
Page<AtMasterPiece> page = new Page<AtMasterPiece>(bean.getPageNo(), bean.getPageSize());
Page<AtMasterPiece> pageList = atMasterPieceService
.lambdaQuery()
.orderByDesc(AtMasterPiece::getCreateTime)
.orderByDesc(AtMasterPiece::getNum)
.page(page);
return Result.OK("作品列表", pageList);
}
//获取代表作品详情
@Override
public Result<?> getWorkDetail(String id){
public Result<?> getWorkDetail(String id,String token){
AtMasterPiece byId = atMasterPieceService.getById(id);
return Result.OK("作品详情", byId);
Map<String,Object> map = new HashMap<>();
//作品0/演员1/动态2
if (StringUtils.isNotBlank(token)){
HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
AtThumbsLog one = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "0")
.eq(AtThumbsLog::getIsState, "0")
.one();
map.put("isThumbs_up", one);
AtThumbsLog one2 = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "0")
.eq(AtThumbsLog::getIsState, "1")
.one();
map.put("isThumbs_down", one2);
}
map.put("details", byId);
return Result.OK("作品详情", map);
}
//获取投诉原因
@ -148,9 +201,32 @@ public class IndexApiServiceImpl implements IndexApiService {
//获取演员集详情接口
@Override
public Result<?> getActorDetail(String id){
public Result<?> getActorDetail(String id,String token){
AtActorCollection byId = atActorCollectionService.getById(id);
return Result.OK("演员集详情", byId);
//根据用户标识查询发布人信息
HanHaiMember byId1 = hanHaiMemberService.getById(byId.getUserId());
byId.setUserId(byId1.getNickName());
Map<String,Object> map = new HashMap<>();
//作品0/演员1/动态2
if (StringUtils.isNotBlank(token)){
HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
AtThumbsLog one = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "0")
.eq(AtThumbsLog::getIsState, "0")
.one();
map.put("isThumbs_up", one);
AtThumbsLog one2 = atThumbsLogService.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, "0")
.eq(AtThumbsLog::getIsState, "1")
.one();
map.put("isThumbs_down", one2);
}
map.put("details", byId);
return Result.OK("演员集详情", map);
}


+ 88
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/InfoApiServiceImpl.java View File

@ -9,8 +9,14 @@ import org.jeecg.modules.apiBean.*;
import org.jeecg.modules.apiservice.InfoApiService;
import org.jeecg.modules.atActorCollection.entity.AtActorCollection;
import org.jeecg.modules.atActorCollection.service.IAtActorCollectionService;
import org.jeecg.modules.atComplaintLog.entity.AtComplaintLog;
import org.jeecg.modules.atComplaintLog.service.IAtComplaintLogService;
import org.jeecg.modules.atMasterPiece.entity.AtMasterPiece;
import org.jeecg.modules.atMasterPiece.service.IAtMasterPieceService;
import org.jeecg.modules.atPromotion.entity.AtPromotion;
import org.jeecg.modules.atPromotion.service.IAtPromotionService;
import org.jeecg.modules.atThumbsLog.entity.AtThumbsLog;
import org.jeecg.modules.atThumbsLog.service.IAtThumbsLogService;
import org.jeecg.modules.atTrends.entity.AtTrends;
import org.jeecg.modules.atTrends.service.IAtTrendsService;
import org.jeecg.modules.hanHaiBank.entity.HanHaiBank;
@ -72,6 +78,16 @@ public class InfoApiServiceImpl implements InfoApiService {
@Autowired
private MpWxPayService mpWxPayService;
//发布作品
@Autowired
private IAtMasterPieceService iAtMasterpieceService;
//点赞
@Resource
private IAtThumbsLogService atThumbsLogService;
//举报
@Resource
private IAtComplaintLogService atComplaintLogService;
@ -385,4 +401,76 @@ public class InfoApiServiceImpl implements InfoApiService {
atActorCollectionService.save(atActorCollection);
return Result.OK("动态发布成功");
}
//发布作品
@Override
public Result<?> releaseWorks(String token, AtMasterPiece atWorks){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
atWorks.setUserId(hanHaiMember.getId());
iAtMasterpieceService.save(atWorks);
return Result.OK("作品发布成功");
}
//点赞
@Override
public Result<?> like(String token, String id, Integer type){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
AtThumbsLog one = atThumbsLogService
.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, type)
.eq(AtThumbsLog::getIsState, "0")
.one();
if (one != null){
return Result.error("您已经点过赞了");
}
AtThumbsLog newOne = new AtThumbsLog();
newOne.setUserId(hanHaiMember.getId());
newOne.setType(type);
newOne.setOrderId(id);
newOne.setIsState("0");
newOne.setCreateTime(new Date());
atThumbsLogService.save(newOne);
return Result.OK("点赞成功");
}
//
@Override
public Result<?> dislike(String token, String id, Integer type){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
AtThumbsLog one = atThumbsLogService
.lambdaQuery()
.eq(AtThumbsLog::getUserId, hanHaiMember.getId())
.eq(AtThumbsLog::getType, type)
.eq(AtThumbsLog::getIsState, "1")
.one();
if (one != null){
return Result.error("您已经踩过了");
}
AtThumbsLog newOne = new AtThumbsLog();
newOne.setUserId(hanHaiMember.getId());
newOne.setType(type);
newOne.setOrderId(id);
newOne.setIsState("1");
newOne.setCreateTime(new Date());
atThumbsLogService.save(newOne);
return Result.OK("踩成功");
}
//举报
@Override
public Result<?> report( String token, String id, Integer type){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
AtComplaintLog newOne = new AtComplaintLog();
newOne.setUserId(hanHaiMember.getId());
newOne.setType(type);
newOne.setOrderId(id);
newOne.setCreateTime(new Date());
atComplaintLogService.save(newOne);
return Result.OK("踩成功");
}
}

Loading…
Cancel
Save