This commit is contained in:
2026-10-10 21:34:36 +08:00
parent 7119dc76a9
commit 74bc08d958
434 changed files with 17723 additions and 13168 deletions
Vendored Regular → Executable
View File
+63 -7
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gxwebsoft</groupId> <groupId>com.gxwebsoft</groupId>
<artifactId>com-gxwebsoft-server</artifactId> <artifactId>yaoxiaoer-java</artifactId>
<version>1.5.2</version> <version>1.5.2</version>
<name>com-gxwebsoft-api</name> <name>com-gxwebsoft-api</name>
@@ -21,6 +21,7 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jackson-bom.version>2.13.5</jackson-bom.version>
</properties> </properties>
<dependencies> <dependencies>
@@ -256,13 +257,12 @@
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.8.0</version> <version>2.10.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.vaadin.external.google</groupId> <groupId>org.json</groupId>
<artifactId>android-json</artifactId> <artifactId>json</artifactId>
<version>0.0.20131108.vaadin1</version> <version>20170516</version>
<scope>compile</scope>
</dependency> </dependency>
<!--微信小程序--> <!--微信小程序-->
@@ -275,7 +275,63 @@
<dependency> <dependency>
<groupId>com.github.wechatpay-apiv3</groupId> <groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId> <artifactId>wechatpay-java</artifactId>
<version>0.2.12</version> <version>0.2.17</version>
</dependency>
<dependency>
<groupId>com.alibaba.nls</groupId>
<artifactId>nls-sdk-tts</artifactId>
<version>2.2.19</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
<version>2.22.5</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.18.4</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>sts20150401</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>ocr_api20210707</artifactId>
<version>3.1.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
@@ -0,0 +1,121 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 控制器
*
* @author LX
* @since 2025-11-23 14:05:18
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/cms/article-collect")
public class ArticleCollectController extends BaseController {
@Resource
private ArticleCollectService articleCollectService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<ArticleCollect>> page(ArticleCollectParam param) {
// 使用关联查询
return success(articleCollectService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<ArticleCollect>> list(ArticleCollectParam param) {
// 使用关联查询
param.setUserId(getLoginUserId());
return success(articleCollectService.listRel(param));
}
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<ArticleCollect> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(articleCollectService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody ArticleCollect articleCollect) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
articleCollect.setUserId(loginUser.getUserId());
}
ArticleCollect check = articleCollectService.check(getLoginUserId(), articleCollect.getArticleId());
if (check == null) {
if (articleCollectService.save(articleCollect)) {
return success("添加成功");
}
}else {
articleCollectService.removeById(check.getId());
return success("取消成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody ArticleCollect articleCollect) {
if (articleCollectService.updateById(articleCollect)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (articleCollectService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ArticleCollect> list) {
if (articleCollectService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ArticleCollect> batchParam) {
if (batchParam.update(articleCollectService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (articleCollectService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,9 +1,9 @@
package com.gxwebsoft.law.controller; package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawFeedbackService; import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.law.entity.LawFeedback; import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.law.param.LawFeedbackParam; import com.gxwebsoft.cms.param.ArticleCommentParam;
import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.PageParam;
@@ -22,50 +22,46 @@ import java.util.List;
* 控制器 * 控制器
* *
* @author LX * @author LX
* @since 2025-05-06 10:27:16 * @since 2025-12-02 16:56:51
*/ */
@Api(tags = "管理") @Api(tags = "管理")
@RestController @RestController
@RequestMapping("/api/law/law-feedback") @RequestMapping("/api/cms/article-comment")
public class LawFeedbackController extends BaseController { public class ArticleCommentController extends BaseController {
@Resource @Resource
private LawFeedbackService lawFeedbackService; private ArticleCommentService articleCommentService;
@ApiOperation("分页查询") @ApiOperation("分页查询")
@GetMapping("/page") @GetMapping("/page")
public ApiResult<PageResult<LawFeedback>> page(LawFeedbackParam param) { public ApiResult<PageResult<ArticleComment>> page(ArticleCommentParam param) {
// 使用关联查询 // 使用关联查询
return success(lawFeedbackService.pageRel(param)); return success(articleCommentService.pageRel(param));
} }
@ApiOperation("查询全部") @ApiOperation("查询全部")
@GetMapping() @GetMapping()
public ApiResult<List<LawFeedback>> list(LawFeedbackParam param) { public ApiResult<List<ArticleComment>> list(ArticleCommentParam param) {
User loginUser = getLoginUser();
if (loginUser != null) {
param.setUserId(loginUser.getUserId());
}
// 使用关联查询 // 使用关联查询
return success(lawFeedbackService.listRel(param)); return success(articleCommentService.listRel(param));
} }
@PreAuthorize("hasAuthority('law:lawFeedback:list')") @PreAuthorize("hasAuthority('cms:articleComment:list')")
@ApiOperation("根据id查询") @ApiOperation("根据id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
public ApiResult<LawFeedback> get(@PathVariable("id") Integer id) { public ApiResult<ArticleComment> get(@PathVariable("id") Integer id) {
// 使用关联查询 // 使用关联查询
return success(lawFeedbackService.getByIdRel(id)); return success(articleCommentService.getByIdRel(id));
} }
@ApiOperation("添加") @ApiOperation("添加")
@PostMapping() @PostMapping()
public ApiResult<?> save(@RequestBody LawFeedback lawFeedback) { public ApiResult<?> save(@RequestBody ArticleComment articleComment) {
// 记录当前登录用户id // 记录当前登录用户id
User loginUser = getLoginUser(); User loginUser = getLoginUser();
if (loginUser != null) { if (loginUser != null) {
lawFeedback.setUserId(loginUser.getUserId()); articleComment.setUserId(loginUser.getUserId());
} }
if (lawFeedbackService.save(lawFeedback)) { if (articleCommentService.save(articleComment)) {
return success("添加成功"); return success("添加成功");
} }
return fail("添加失败"); return fail("添加失败");
@@ -73,8 +69,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("修改") @ApiOperation("修改")
@PutMapping() @PutMapping()
public ApiResult<?> update(@RequestBody LawFeedback lawFeedback) { public ApiResult<?> update(@RequestBody ArticleComment articleComment) {
if (lawFeedbackService.updateById(lawFeedback)) { if (articleCommentService.updateById(articleComment)) {
return success("修改成功"); return success("修改成功");
} }
return fail("修改失败"); return fail("修改失败");
@@ -83,7 +79,7 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("删除") @ApiOperation("删除")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) { public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawFeedbackService.removeById(id)) { if (articleCommentService.removeById(id)) {
return success("删除成功"); return success("删除成功");
} }
return fail("删除失败"); return fail("删除失败");
@@ -91,8 +87,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量添加") @ApiOperation("批量添加")
@PostMapping("/batch") @PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawFeedback> list) { public ApiResult<?> saveBatch(@RequestBody List<ArticleComment> list) {
if (lawFeedbackService.saveBatch(list)) { if (articleCommentService.saveBatch(list)) {
return success("添加成功"); return success("添加成功");
} }
return fail("添加失败"); return fail("添加失败");
@@ -100,8 +96,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量修改") @ApiOperation("批量修改")
@PutMapping("/batch") @PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawFeedback> batchParam) { public ApiResult<?> updateBatch(@RequestBody BatchParam<ArticleComment> batchParam) {
if (batchParam.update(lawFeedbackService, "id")) { if (batchParam.update(articleCommentService, "id")) {
return success("修改成功"); return success("修改成功");
} }
return fail("修改失败"); return fail("修改失败");
@@ -110,7 +106,7 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量删除") @ApiOperation("批量删除")
@DeleteMapping("/batch") @DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) { public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawFeedbackService.removeByIds(ids)) { if (articleCommentService.removeByIds(ids)) {
return success("删除成功"); return success("删除成功");
} }
return fail("删除失败"); return fail("删除失败");
@@ -2,7 +2,9 @@ package com.gxwebsoft.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.cms.entity.ArticleCategory; import com.gxwebsoft.cms.entity.ArticleCategory;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.service.ArticleCategoryService; import com.gxwebsoft.cms.service.ArticleCategoryService;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.ArticleService; import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.cms.entity.Article; import com.gxwebsoft.cms.entity.Article;
@@ -35,6 +37,8 @@ public class ArticleController extends BaseController {
@Resource @Resource
private ArticleService articleService; private ArticleService articleService;
@Resource @Resource
private ArticleCollectService articleCollectService;
@Resource
private ArticleCategoryService articleCategoryService; private ArticleCategoryService articleCategoryService;
@ApiOperation("根据id查询文章记录表") @ApiOperation("根据id查询文章记录表")
@@ -45,7 +49,6 @@ public class ArticleController extends BaseController {
} }
@PreAuthorize("hasAuthority('cms:article:list')")
@OperationLog @OperationLog
@ApiOperation("分页查询文章记录表") @ApiOperation("分页查询文章记录表")
@GetMapping("/page") @GetMapping("/page")
@@ -74,11 +77,13 @@ public class ArticleController extends BaseController {
if (!categoryIds.isEmpty()) { if (!categoryIds.isEmpty()) {
queryWrapper.in(Article::getCategoryId, categoryIds); queryWrapper.in(Article::getCategoryId, categoryIds);
} }
if (param.getTitle() != null) {
queryWrapper.like(Article::getTitle, param.getTitle());
}
List<Article> articleList = articleService.list(queryWrapper); List<Article> articleList = articleService.list(queryWrapper);
return success(articleList); return success(articleList);
} }
@PreAuthorize("hasAuthority('cms:article:list')")
@OperationLog @OperationLog
@ApiOperation("根据id查询文章记录表") @ApiOperation("根据id查询文章记录表")
@GetMapping("/{id}") @GetMapping("/{id}")
@@ -89,6 +94,13 @@ public class ArticleController extends BaseController {
article.setArticleId(id); article.setArticleId(id);
article.setVirtualViews(article.getVirtualViews() + 1); article.setVirtualViews(article.getVirtualViews() + 1);
articleService.saveOrUpdate(article); articleService.saveOrUpdate(article);
ArticleCategory category = articleCategoryService.getByIdRel(article.getCategoryId());
if (category != null) article.setCategory(category.getTitle());
article.setHasCollect(false);
if (getLoginUser() != null) {
ArticleCollect articleCollect = articleCollectService.check(getLoginUserId(), id);
article.setHasCollect(articleCollect != null);
}
return success(article); return success(article);
} }
@@ -37,6 +37,9 @@ public class Article implements Serializable {
@ApiModelProperty(value = "文章分类ID") @ApiModelProperty(value = "文章分类ID")
private Integer categoryId; private Integer categoryId;
@TableField(exist = false)
private String category;
@ApiModelProperty(value = "封面图") @ApiModelProperty(value = "封面图")
private String image; private String image;
@@ -88,4 +91,6 @@ public class Article implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String userAvatar; private String userAvatar;
@TableField(exist = false)
private Boolean hasCollect;
} }
@@ -1,4 +1,4 @@
package com.gxwebsoft.shop.entity; package com.gxwebsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
@@ -10,26 +10,26 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
/** /**
* 商品匹配机型 *
* *
* @author 科技小王子 * @author LX
* @since 2024-03-12 01:30:55 * @since 2025-11-23 14:05:18
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value = "GoodsPhoneModel对象", description = "商品匹配机型") @ApiModel(value = "ArticleCollect对象", description = "")
@TableName("shop_goods_phone_model") @TableName("cms_article_collect")
public class GoodsPhoneModel implements Serializable { public class ArticleCollect implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
private Integer goodsId; private Integer articleId;
private Integer modelId; private Integer userId;
@ApiModelProperty(value = "状态, 0上架, 1下架") @ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status; private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是") @ApiModelProperty(value = "是否删除, 0否, 1是")
@@ -46,9 +46,5 @@ public class GoodsPhoneModel implements Serializable {
private LocalDateTime updateTime; private LocalDateTime updateTime;
@TableField(exist = false) @TableField(exist = false)
private String phoneModelName; private Article article;
@TableField(exist = false)
private String phoneModelCode;
} }
@@ -1,4 +1,4 @@
package com.gxwebsoft.law.entity; package com.gxwebsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
@@ -13,32 +13,27 @@ import lombok.EqualsAndHashCode;
* *
* *
* @author LX * @author LX
* @since 2025-04-14 01:31:54 * @since 2025-12-02 16:56:51
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrgPeople对象", description = "") @ApiModel(value = "ArticleComment对象", description = "")
@TableName("law_org_people") @TableName("cms_article_comment")
public class LawOrgPeople implements Serializable { public class ArticleComment implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
private Integer orgId; private Integer articleId;
private String name;
private String phone;
private String position;
private String type;
private String positionType;
private Integer userId; private Integer userId;
private String content;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是") @ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic @TableLogic
private Integer deleted; private Integer deleted;
@@ -46,12 +41,12 @@ public class LawOrgPeople implements Serializable {
@ApiModelProperty(value = "租户id") @ApiModelProperty(value = "租户id")
private Integer tenantId; private Integer tenantId;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "注册时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@TableField(exist = false) @TableField(exist = false)
private LawOrg lawOrg; private Article article;
} }
@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-11-23 14:05:18
*/
public interface ArticleCollectMapper extends BaseMapper<ArticleCollect> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<ArticleCollect>
*/
List<ArticleCollect> selectPageRel(@Param("page") IPage<ArticleCollect> page,
@Param("param") ArticleCollectParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<ArticleCollect> selectListRel(@Param("param") ArticleCollectParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-12-02 16:56:51
*/
public interface ArticleCommentMapper extends BaseMapper<ArticleComment> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<ArticleComment>
*/
List<ArticleComment> selectPageRel(@Param("page") IPage<ArticleComment> page,
@Param("param") ArticleCommentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<ArticleComment> selectListRel(@Param("param") ArticleCommentParam param);
}
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalCalContentMapper"> <mapper namespace="com.gxwebsoft.cms.mapper.ArticleCollectMapper">
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.* SELECT a.*
FROM law_legal_cal_content a FROM cms_article_collect a
<where> <where>
<if test="param.id != null"> <if test="param.id != null">
AND a.id = #{param.id} AND a.id = #{param.id}
</if> </if>
<if test="param.groupId != null"> <if test="param.articleId != null">
AND a.group_id = #{param.groupId} AND a.article_id = #{param.articleId}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if> </if>
<if test="param.userId != null"> <if test="param.userId != null">
AND a.user_id = #{param.userId} AND a.user_id = #{param.userId}
</if> </if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null"> <if test="param.deleted != null">
AND a.deleted = #{param.deleted} AND a.deleted = #{param.deleted}
</if> </if>
@@ -39,12 +39,12 @@
</sql> </sql>
<!-- 分页查询 --> <!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalCalContent"> <select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleCollect">
<include refid="selectSql"></include> <include refid="selectSql"></include>
</select> </select>
<!-- 查询全部 --> <!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalCalContent"> <select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleCollect">
<include refid="selectSql"></include> <include refid="selectSql"></include>
</select> </select>
@@ -1,23 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalDocContentMapper"> <mapper namespace="com.gxwebsoft.cms.mapper.ArticleCommentMapper">
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.* SELECT a.*
FROM law_legal_doc_content a FROM cms_article_comment a
<where> <where>
<if test="param.id != null"> <if test="param.id != null">
AND a.id = #{param.id} AND a.id = #{param.id}
</if> </if>
<if test="param.groupId != null"> <if test="param.articleId != null">
AND a.group_id = #{param.groupId} AND a.article_id = #{param.articleId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if> </if>
<if test="param.content != null"> <if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%') AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if> </if>
<if test="param.userId != null"> <if test="param.status != null">
AND a.user_id = #{param.userId} AND a.status = #{param.status}
</if> </if>
<if test="param.deleted != null"> <if test="param.deleted != null">
AND a.deleted = #{param.deleted} AND a.deleted = #{param.deleted}
@@ -39,12 +42,12 @@
</sql> </sql>
<!-- 分页查询 --> <!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalDocContent"> <select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
<include refid="selectSql"></include> <include refid="selectSql"></include>
</select> </select>
<!-- 查询全部 --> <!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalDocContent"> <select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
<include refid="selectSql"></include> <include refid="selectSql"></include>
</select> </select>
@@ -72,7 +72,7 @@
AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%') AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%')
</if> </if>
</where> </where>
ORDER BY a.create_time DESC ORDER BY a.sort_number ASC, a.create_time DESC
</sql> </sql>
<!-- 分页查询 --> <!-- 分页查询 -->
@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param; package com.gxwebsoft.cms.param;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField; import com.gxwebsoft.common.core.annotation.QueryField;
@@ -14,32 +14,28 @@ import lombok.EqualsAndHashCode;
* 查询参数 * 查询参数
* *
* @author LX * @author LX
* @since 2025-04-14 01:31:54 * @since 2025-11-23 14:05:18
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawOrgPeopleParam对象", description = "查询参数") @ApiModel(value = "ArticleCollectParam对象", description = "查询参数")
public class LawOrgPeopleParam extends BaseParam { public class ArticleCollectParam extends BaseParam {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer id; private Integer id;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer orgId; private Integer articleId;
private String name;
private String phone;
private String position;
private String type;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer userId; private Integer userId;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是") @ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer deleted; private Integer deleted;
@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param; package com.gxwebsoft.cms.param;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField; import com.gxwebsoft.common.core.annotation.QueryField;
@@ -11,29 +11,33 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
/** /**
* 用户填写法律计算器内容查询参数 * 查询参数
* *
* @author LX * @author LX
* @since 2025-04-17 19:23:47 * @since 2025-12-02 16:56:51
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawLegalCalContentParam对象", description = "用户填写法律计算器内容查询参数") @ApiModel(value = "ArticleCommentParam对象", description = "查询参数")
public class LawLegalCalContentParam extends BaseParam { public class ArticleCommentParam extends BaseParam {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer id; private Integer id;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer groupId; private Integer articleId;
private String content;
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer userId; private Integer userId;
private String content;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是") @ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer deleted; private Integer deleted;
@@ -0,0 +1,43 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2025-11-23 14:05:18
*/
public interface ArticleCollectService extends IService<ArticleCollect> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<ArticleCollect>
*/
PageResult<ArticleCollect> pageRel(ArticleCollectParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<ArticleCollect>
*/
List<ArticleCollect> listRel(ArticleCollectParam param);
/**
* 根据id查询
*
* @param id
* @return ArticleCollect
*/
ArticleCollect getByIdRel(Integer id);
ArticleCollect check(Integer userId, Integer id);
}
@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2025-12-02 16:56:51
*/
public interface ArticleCommentService extends IService<ArticleComment> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<ArticleComment>
*/
PageResult<ArticleComment> pageRel(ArticleCommentParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<ArticleComment>
*/
List<ArticleComment> listRel(ArticleCommentParam param);
/**
* 根据id查询
*
* @param id
* @return ArticleComment
*/
ArticleComment getByIdRel(Integer id);
}
@@ -0,0 +1,65 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.ArticleCollectMapper;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2025-11-23 14:05:18
*/
@Service
public class ArticleCollectServiceImpl extends ServiceImpl<ArticleCollectMapper, ArticleCollect> implements ArticleCollectService {
@Resource
private ArticleService articleService;
@Override
public PageResult<ArticleCollect> pageRel(ArticleCollectParam param) {
PageParam<ArticleCollect, ArticleCollectParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc");
List<ArticleCollect> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<ArticleCollect> listRel(ArticleCollectParam param) {
List<ArticleCollect> list = baseMapper.selectListRel(param);
// 排序
PageParam<ArticleCollect, ArticleCollectParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
for (ArticleCollect item : list) {
item.setArticle(articleService.getByIdRel(item.getArticleId()));
}
return page.sortRecords(list);
}
@Override
public ArticleCollect getByIdRel(Integer id) {
ArticleCollectParam param = new ArticleCollectParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public ArticleCollect check(Integer userId, Integer id) {
return getOne(
new LambdaQueryWrapper<ArticleCollect>()
.eq(ArticleCollect::getUserId, userId)
.eq(ArticleCollect::getArticleId, id)
.last("limit 1")
);
}
}
@@ -0,0 +1,53 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.ArticleCommentMapper;
import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2025-12-02 16:56:51
*/
@Service
public class ArticleCommentServiceImpl extends ServiceImpl<ArticleCommentMapper, ArticleComment> implements ArticleCommentService {
@Resource
private ArticleService articleService;
@Override
public PageResult<ArticleComment> pageRel(ArticleCommentParam param) {
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<ArticleComment> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<ArticleComment> listRel(ArticleCommentParam param) {
List<ArticleComment> list = baseMapper.selectListRel(param);
// 排序
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
for (ArticleComment item : list) {
item.setArticle(articleService.getById(item.getArticleId()));
}
return page.sortRecords(list);
}
@Override
public ArticleComment getByIdRel(Integer id) {
ArticleCommentParam param = new ArticleCommentParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
}
@@ -23,7 +23,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
@Override @Override
public PageResult<Article> pageRel(ArticleParam param) { public PageResult<Article> pageRel(ArticleParam param) {
PageParam<Article, ArticleParam> page = new PageParam<>(param); PageParam<Article, ArticleParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc"); // page.setDefaultOrder("sort_number asc, create_time desc");
List<Article> list = baseMapper.selectPageRel(page, param); List<Article> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal()); return new PageResult<>(list, page.getTotal());
} }
@@ -33,7 +33,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
List<Article> list = baseMapper.selectListRel(param); List<Article> list = baseMapper.selectListRel(param);
// 排序 // 排序
PageParam<Article, ArticleParam> page = new PageParam<>(); PageParam<Article, ArticleParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc"); // page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list); return page.sortRecords(list);
} }
@@ -84,4 +84,13 @@ public class ConfigProperties {
// 网关地址 // 网关地址
private String serverUrl; private String serverUrl;
/**
* 阿里云存储 OSS
* Endpoint
*/
private String endpoint;
private String accessKeyId;
private String accessKeySecret;
private String bucketName;
private String bucketDomain;
} }
@@ -1,21 +1,9 @@
package com.gxwebsoft.common.core.config; package com.gxwebsoft.common.core.config;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import com.gxwebsoft.common.system.entity.User;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
import net.sf.jsqlparser.expression.NullValue;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/** /**
* MybatisPlus配置 * MybatisPlus配置
@@ -23,58 +11,15 @@ import java.util.Arrays;
* @author WebSoft * @author WebSoft
* @since 2018-02-22 11:29:28 * @since 2018-02-22 11:29:28
*/ */
//@Configuration @Configuration
public class MybatisPlusConfig { public class MybatisPlusConfig {
// @Bean @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) { public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 多租户插件配置 interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
TenantLineHandler tenantLineHandler = new TenantLineHandler() {
@Override
public Expression getTenantId() {
System.out.println(getLoginUserTenantId());
return getLoginUserTenantId();
}
@Override
public boolean ignoreTable(String tableName) {
return Arrays.asList(
"sys_tenant",
"sys_dictionary",
"sys_dictionary_data"
).contains(tableName);
}
};
TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor(tenantLineHandler);
interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
// 分页插件配置
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
interceptor.addInnerInterceptor(paginationInnerInterceptor);
//
return interceptor; return interceptor;
} }
/**
* 获取当前登录用户的租户id
*
* @return Integer
*/
public Expression getLoginUserTenantId() {
try {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
Object object = authentication.getPrincipal();
if (object instanceof User) {
return new LongValue(((User) object).getTenantId());
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
return new NullValue();
}
} }
@@ -39,6 +39,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.permitAll() .permitAll()
.antMatchers( .antMatchers(
"/api/login", "/api/login",
"/api/system/user/loginByPhoneForTest",
"/api/wx-login/loginByMpWxPhone",
"/api/register", "/api/register",
"/druid/**", "/druid/**",
"/swagger-ui.html", "/swagger-ui.html",
@@ -56,6 +58,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/api/shop/payment/mp-alipay/getPhoneNumber", "/api/shop/payment/mp-alipay/getPhoneNumber",
"/api/shop/test/**", "/api/shop/test/**",
"/api/shop/wx-login/**", "/api/shop/wx-login/**",
"/api/shop/getOpenId",
"/api/shop/getOpenId/**",
"/api/apps/hualala/**", "/api/apps/hualala/**",
"/api/apps/hualala-cart/**", "/api/apps/hualala-cart/**",
"/api/apps/test-data/**", "/api/apps/test-data/**",
@@ -63,17 +67,35 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/api/system/user/login-by-phone", "/api/system/user/login-by-phone",
"/api/shop/wx-pay/notify", "/api/shop/wx-pay/notify",
"/api/shop/wx-pay/refund-notify", "/api/shop/wx-pay/refund-notify",
"/api/shop/goods",
"/api/shop/goods/**",
"/api/shop/goods-category",
"/api/shop/goods-category/**",
"/WW_verify_QMv7HoblYU6z63bb.txt", "/WW_verify_QMv7HoblYU6z63bb.txt",
"/WW_verify_10DxpA6fAgnSRayT.txt", "/WW_verify_10DxpA6fAgnSRayT.txt",
"/api/system/dict-data/by-code-name", "/api/system/dict-data/by-code-name",
"/api/chat/message",
"/api/chat/messageStop",
"/api/sys/sys-swiper", "/api/sys/sys-swiper",
"/api/law/law-org/**",
"/api/law/law-org-people/**",
"/api/system/dict-data/list-by-dict", "/api/system/dict-data/list-by-dict",
"/api/cms/article-category", "/api/cms/article-category",
"/api/file/upload" "/api/cms/article",
"/api/file/upload",
"/api/sys/sys-area",
"/api/yxe/yxe-task-cate",
"/api/yxe/yxe-task-cate/**",
"/api/yxe/yxe-task",
"/api/yxe/yxe-task/**",
"/api/sys/sys-area/**",
"/api/common/area",
"/api/common/area/**",
"/api/yxe/ai",
"/api/oss/**",
"/api/yxe/baidu",
"/api/yxe/baidu/**",
"/api/transport/maintenance-record/**",
"/api/transport/maintenance-plan/**",
"/api/shop/merchant",
"/api/yxe/yxe-product/group",
"/api/yxe/yxe-user-task/fixChain"
) )
.permitAll() .permitAll()
.anyRequest() .anyRequest()
@@ -0,0 +1,91 @@
package com.gxwebsoft.common.core.utils;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.system.entity.FileRecord;
import com.gxwebsoft.common.system.service.FileRecordService;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@Component
public class ExcelExportUtil {
private static final String EXCEL_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
@Resource
private ConfigProperties configProperties;
@Resource
private FileRecordService fileRecordService;
public XSSFWorkbook createWorkbook(String sheetName, String... headers) {
XSSFWorkbook workbook = new XSSFWorkbook();
Sheet sheet = workbook.createSheet(sheetName);
writeRow(sheet, 0, (Object[]) headers);
return workbook;
}
public void writeRow(Sheet sheet, int rowIndex, Object... values) {
Row row = sheet.createRow(rowIndex);
for (int i = 0; i < values.length; i++) {
Cell cell = row.createCell(i);
setCellValue(cell, values[i]);
}
}
public void autoSizeColumns(Sheet sheet, int columnCount) {
for (int i = 0; i < columnCount; i++) {
sheet.autoSizeColumn(i);
int width = sheet.getColumnWidth(i);
sheet.setColumnWidth(i, Math.min(width + 1024, 12000));
}
}
public FileRecord saveWorkbook(Workbook workbook, String filePrefix, Integer createUserId) throws IOException {
String safeServerUrl = StrUtil.removeSuffix(StrUtil.blankToDefault(configProperties.getServerUrl(), ""), "/");
String fileName = filePrefix + System.currentTimeMillis() + ".xlsx";
String relativePath = "excel/" + fileName;
File targetFile = new File(configProperties.getUploadPath() + "file/", relativePath);
File parent = targetFile.getParentFile();
if (parent != null && !parent.exists() && !parent.mkdirs()) {
throw new IOException("创建导出目录失败: " + parent.getAbsolutePath());
}
try (Workbook currentWorkbook = workbook; FileOutputStream outputStream = new FileOutputStream(targetFile)) {
currentWorkbook.write(outputStream);
outputStream.flush();
}
FileRecord fileRecord = new FileRecord();
fileRecord.setCreateUserId(createUserId);
fileRecord.setName(fileName);
fileRecord.setPath(relativePath);
fileRecord.setLength(targetFile.length());
fileRecord.setContentType(EXCEL_CONTENT_TYPE);
fileRecord.setUrl(safeServerUrl + "/file/" + relativePath);
fileRecord.setDownloadUrl(safeServerUrl + "/file/download/" + relativePath);
fileRecordService.save(fileRecord);
return fileRecord;
}
private void setCellValue(Cell cell, Object value) {
if (value == null) {
cell.setCellValue("");
return;
}
if (value instanceof Number) {
cell.setCellValue(String.valueOf(value));
return;
}
cell.setCellValue(String.valueOf(value));
}
}
@@ -1,8 +1,17 @@
package com.gxwebsoft.common.core.utils; package com.gxwebsoft.common.core.utils;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.service.OrderService; import com.gxwebsoft.shop.service.OrderService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 自动执行计划 * 自动执行计划
@@ -10,15 +19,20 @@ import javax.annotation.Resource;
* @author WebSoft * @author WebSoft
* @since 2018-12-14 08:38:19 * @since 2018-12-14 08:38:19
*/ */
@Component
public class SchedulingUtil { public class SchedulingUtil {
@Resource @Resource
private OrderService orderService; private UserService userService;
// @Scheduled(cron="*/5 * * * * *") @Scheduled(cron = "*/1 * * * * *")
// public void reportCurrentTime() { public void reportCurrentTime() {
// System.out.println("定时任务开始 = " + new Date()); // 0点执行
// int count = orderService.count(new LambdaQueryWrapper<Order>().eq(Order::getPayStatus, 20)); if (LocalDateTimeUtil.format(LocalDateTime.now(), "HH:mm:ss").equals("15:13:00")) {
//// orderService.removeOrderByTimeOut(); System.out.println("定时任务开始 = " + new Date());
// System.out.println("count = " + count); userService.update(
// } new LambdaUpdateWrapper<User>()
.set(User::getSendCoin, 0)
);
}
}
} }
@@ -89,7 +89,7 @@ public class BaseController {
// if(StrUtil.isNotBlank(request.getHeader("tenantId"))){ // if(StrUtil.isNotBlank(request.getHeader("tenantId"))){
// return Integer.valueOf(request.getHeader("tenantId")); // return Integer.valueOf(request.getHeader("tenantId"));
// } // }
return 10049; return 10325;
} }
/** /**
@@ -220,9 +220,6 @@ public class BaseController {
* *
* @return merchantCode * @return merchantCode
*/ */
public Merchant getMerchant() {
return merchantService.getMerchantByCode(getMerchantCode());
}
public String getAppId() { public String getAppId() {
// 兼容小写 // 兼容小写
@@ -10,6 +10,7 @@ import lombok.Data;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -64,4 +65,25 @@ public class BaseParam implements Serializable {
return CommonUtil.listGetOne(records); return CommonUtil.listGetOne(records);
} }
public void normalizeStringFields() {
Class<?> currentClass = this.getClass();
while (currentClass != null && currentClass != Object.class) {
Field[] fields = currentClass.getDeclaredFields();
for (Field field : fields) {
if (!String.class.equals(field.getType())) {
continue;
}
field.setAccessible(true);
try {
String value = (String) field.get(this);
if (StrUtil.isBlank(value)) {
field.set(this, null);
}
} catch (IllegalAccessException ignored) {
}
}
currentClass = currentClass.getSuperclass();
}
}
} }
@@ -0,0 +1,297 @@
package com.gxwebsoft.common.system.controller;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.alibaba.fastjson2.JSONObject;
import com.aliyun.ocr_api20210707.Client;
import com.aliyun.ocr_api20210707.models.RecognizeShoppingReceiptRequest;
import com.aliyun.ocr_api20210707.models.RecognizeShoppingReceiptResponse;
import com.aliyun.oss.*;
import com.aliyun.oss.common.auth.*;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.*;
import com.aliyun.sts20150401.models.AssumeRoleResponse;
import com.aliyun.sts20150401.models.AssumeRoleResponseBody;
import com.aliyun.tea.TeaException;
import com.aliyun.teautil.models.RuntimeOptions;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.service.FileRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
* 阿里云OSS云存储
*
* @author WebSoft
* @since 2022-11-19 13:54:27
*/
@Api(tags = "阿里云OSS云存储")
@RestController
@RequestMapping("/api/oss")
public class AliOssController extends BaseController {
// String accessKeyId = "LTAI5tGZwF9Pz1S9weuKMFe5";
// String accessKeySecret = "KVP7IIxaWkwS4Bz5UKqE63hxIbs61H";
// String accessKeyId = "LTAI4GKGZ9Z2Z8JZ77c3GNZP";
// String accessKeySecret = "BiDkpS7UXj72HWwDWaFZxiXjNFBNCM";
// String bucket = "oss-gxwebsoft";
// String region = "cn-shenzhen";
// String endpoint = "https://oss-cn-shenzhen.aliyuncs.com";
// String accessKeyId = "LTAI5tCqrMCF2VfCnuYutGnV";
// String accessKeySecret = "FQMnh7F7AnifC2dFpFrqYPZA5ngE11";
// String bucket = "nbg-oss";
// String region = "cn-shenzhen";
// String endpoint = "https://oss-cn-shenzhen.aliyuncs.com";
// String host = "https://oss-nbg.wsdns.cn";
String accessKeyId = "LTAI5tCttegrwcy2CdyLZ5HC";
String accessKeySecret = "SLOcoz5arYNeqXMM1tRYCnClGBkHkf";
String bucket = "yaodongxiao";
String region = "cn-guangzhou";
String endpoint = "https://oss-cn-guangzhou.aliyuncs.com";
String host = "https://yaodongxiao.oss-cn-guangzhou.aliyuncs.com";
public AliOssController() throws com.aliyuncs.exceptions.ClientException {
}
@PostMapping("/aliOCR")
public ApiResult<?> aliOcr(@RequestBody Map<String, String> mapData) throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setAccessKeyId(accessKeyId)
.setAccessKeySecret(accessKeySecret);
config.endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
Client client = new com.aliyun.ocr_api20210707.Client(config);
RecognizeShoppingReceiptRequest request = new RecognizeShoppingReceiptRequest()
.setUrl(mapData.get("imgUrl"));
RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
RecognizeShoppingReceiptResponse resp = client.recognizeShoppingReceiptWithOptions(request, runtime);
return success(JSONObject.parseObject(resp.body.data));
} catch (TeaException error) {
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
System.out.println(error.getMessage());
// 诊断地址
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
} catch (Exception _error) {
TeaException error = new TeaException(_error.getMessage(), _error);
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
System.out.println(error.getMessage());
// 诊断地址
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
}
return success();
}
@ApiOperation("获取临时osstoken")
@GetMapping("/getSTSToken")
public ApiResult<?> getSTSToken() {
CredentialsProvider credentialsProvider = new DefaultCredentialProvider(accessKeyId, accessKeySecret);
OSS ossClient = new OSSClientBuilder().build(endpoint, credentialsProvider);
try {
long expireTime = 60;
long expireEndTime = System.currentTimeMillis() + expireTime * 1000;
Date expiration = new Date(expireEndTime);
PolicyConditions policyConds = new PolicyConditions();
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 100 * 1024 * 1024);
String postPolicy = ossClient.generatePostPolicy(expiration, policyConds);
byte[] binaryData = postPolicy.getBytes("utf-8");
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
String postSignature = ossClient.calculatePostSignature(postPolicy);
Map<String, Object> result = new HashMap<>();
result.put("accessKeyId", accessKeyId);
result.put("token", credentialsProvider.getCredentials().getSecurityToken());
result.put("policy", encodedPolicy);
result.put("signature", postSignature);
result.put("expireEndTime", expireEndTime);
return success(result);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return fail();
} finally {
ossClient.shutdown();
}
}
@GetMapping("/getPostSignatureForOssUpload")
public ApiResult<Map<String, String>> getPostSignatureForOssUpload() throws Exception {
AssumeRoleResponseBody.AssumeRoleResponseBodyCredentials sts_data = getCredential();
String accesskeyid = sts_data.accessKeyId;
String accesskeysecret = sts_data.accessKeySecret;
String securitytoken = sts_data.securityToken;
//获取x-oss-credential里的date,当前日期,格式为yyyyMMdd
ZonedDateTime today = ZonedDateTime.now().withZoneSameInstant(java.time.ZoneOffset.UTC);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
String date = today.format(formatter);
//获取x-oss-date
ZonedDateTime now = ZonedDateTime.now().withZoneSameInstant(java.time.ZoneOffset.UTC);
DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
String x_oss_date = now.format(formatter2);
String upload_dir = LocalDateTimeUtil.format(LocalDateTimeUtil.now(), "yyyyMMdd");
// 步骤1:创建policy。
String x_oss_credential = accesskeyid + "/" + date + "/" + region + "/oss/aliyun_v4_request";
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> policy = new HashMap<>();
policy.put("expiration", generateExpiration(3600L));
List<Object> conditions = new ArrayList<>();
Map<String, String> bucketCondition = new HashMap<>();
bucketCondition.put("bucket", bucket);
conditions.add(bucketCondition);
Map<String, String> securityTokenCondition = new HashMap<>();
securityTokenCondition.put("x-oss-security-token", securitytoken);
conditions.add(securityTokenCondition);
Map<String, String> signatureVersionCondition = new HashMap<>();
signatureVersionCondition.put("x-oss-signature-version", "OSS4-HMAC-SHA256");
conditions.add(signatureVersionCondition);
Map<String, String> credentialCondition = new HashMap<>();
credentialCondition.put("x-oss-credential", x_oss_credential); // 替换为实际的 access key id
conditions.add(credentialCondition);
Map<String, String> dateCondition = new HashMap<>();
dateCondition.put("x-oss-date", x_oss_date);
conditions.add(dateCondition);
conditions.add(Arrays.asList("content-length-range", 1, 10240000));
conditions.add(Arrays.asList("eq", "$success_action_status", "200"));
conditions.add(Arrays.asList("starts-with", "$key", upload_dir));
policy.put("conditions", conditions);
String jsonPolicy = mapper.writeValueAsString(policy);
// 步骤2:构造待签名字符串(StringToSign)。
String stringToSign = new String(Base64.encodeBase64(jsonPolicy.getBytes()));
// System.out.println("stringToSign: " + stringToSign);
// 步骤3:计算SigningKey。
byte[] dateKey = hmacsha256(("aliyun_v4" + accesskeysecret).getBytes(), date);
byte[] dateRegionKey = hmacsha256(dateKey, region);
byte[] dateRegionServiceKey = hmacsha256(dateRegionKey, "oss");
byte[] signingKey = hmacsha256(dateRegionServiceKey, "aliyun_v4_request");
// System.out.println("signingKey: " + BinaryUtil.toBase64String(signingKey));
// 步骤4:计算Signature。
byte[] result = hmacsha256(signingKey, stringToSign);
String signature = BinaryUtil.toHex(result);
// System.out.println("signature:" + signature);
Map<String, String> response = new HashMap<>();
// 将数据添加到 map 中
response.put("version", "OSS4-HMAC-SHA256");
response.put("policy", stringToSign);
response.put("x_oss_credential", x_oss_credential);
response.put("x_oss_date", x_oss_date);
response.put("signature", signature);
response.put("security_token", securitytoken);
response.put("dir", upload_dir);
response.put("host", host);
// 返回带有状态码 200 (OK) 的 ResponseEntity,返回给Web端,进行PostObject操作
return success(response);
}
public static byte[] hmacsha256(byte[] key, String data) {
try {
// 初始化HMAC密钥规格,指定算法为HMAC-SHA256并使用提供的密钥。
SecretKeySpec secretKeySpec = new SecretKeySpec(key, "HmacSHA256");
// 获取Mac实例,并通过getInstance方法指定使用HMAC-SHA256算法。
Mac mac = Mac.getInstance("HmacSHA256");
// 使用密钥初始化Mac对象。
mac.init(secretKeySpec);
// 执行HMAC计算,通过doFinal方法接收需要计算的数据并返回计算结果的数组。
byte[] hmacBytes = mac.doFinal(data.getBytes());
return hmacBytes;
} catch (Exception e) {
throw new RuntimeException("Failed to calculate HMAC-SHA256", e);
}
}
public com.aliyun.sts20150401.Client createStsClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setAccessKeyId(accessKeyId)
.setAccessKeySecret(accessKeySecret);
config.endpoint = "sts.cn-guangzhou.aliyuncs.com";
return new com.aliyun.sts20150401.Client(config);
}
public AssumeRoleResponseBody.AssumeRoleResponseBodyCredentials getCredential() throws Exception {
com.aliyun.sts20150401.Client client = createStsClient();
com.aliyun.sts20150401.models.AssumeRoleRequest assumeRoleRequest = new com.aliyun.sts20150401.models.AssumeRoleRequest()
.setRoleArn("acs:ram::1975868532460222:role/sts")
.setRoleSessionName("YDXSTS");// 自定义会话名称
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
// 复制代码运行请自行打印 API 的返回值
AssumeRoleResponse response = client.assumeRoleWithOptions(assumeRoleRequest, runtime);
// credentials里包含了后续要用到的AccessKeyId、AccessKeySecret和SecurityToken。
return response.body.credentials;
} catch (TeaException error) {
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
System.out.println(error.getMessage());
// 诊断地址
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
}
// 返回一个默认的错误响应对象,避免返回null
AssumeRoleResponseBody.AssumeRoleResponseBodyCredentials defaultCredentials = new AssumeRoleResponseBody.AssumeRoleResponseBodyCredentials();
defaultCredentials.accessKeyId = "ERROR_ACCESS_KEY_ID";
defaultCredentials.accessKeySecret = "ERROR_ACCESS_KEY_SECRET";
defaultCredentials.securityToken = "ERROR_SECURITY_TOKEN";
return defaultCredentials;
}
public static String generateExpiration(long seconds) {
// 获取当前时间戳(以秒为单位)
long now = Instant.now().getEpochSecond();
// 计算过期时间的时间戳
long expirationTime = now + seconds;
// 将时间戳转换为Instant对象,并格式化为ISO8601格式
Instant instant = Instant.ofEpochSecond(expirationTime);
// 定义时区为UTC
ZoneId zone = ZoneOffset.UTC;
// 将 Instant 转换为 ZonedDateTime
ZonedDateTime zonedDateTime = instant.atZone(zone);
// 定义日期时间格式,例如2023-12-03T13:00:00.000Z
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
// 格式化日期时间
String formattedDate = zonedDateTime.format(formatter);
// 输出结果
return formattedDate;
}
}
@@ -64,6 +64,11 @@ public class AreaController extends BaseController {
//return success(areaService.listRel(param)); //return success(areaService.listRel(param));
} }
@PostMapping("/listByFid")
public ApiResult<?> listByFid(@RequestBody Map<String, Object> param) {
return success(areaService.list(new LambdaQueryWrapper<Area>().eq(Area::getFid, param.get("fid"))));
}
@ApiOperation("查询全部市") @ApiOperation("查询全部市")
@PostMapping("city-by-parent") @PostMapping("city-by-parent")
public ApiResult<?> cityByParent(@RequestBody Map<String, Object> param) { public ApiResult<?> cityByParent(@RequestBody Map<String, Object> param) {
@@ -84,6 +89,12 @@ public class AreaController extends BaseController {
//return success(areaService.listRel(param)); //return success(areaService.listRel(param));
} }
@ApiOperation("查询全部")
@PostMapping("/area-info-by-name")
public ApiResult<Area> areaInfoByName(@RequestBody AreaParam param) {
return success(areaService.areaInfoByName(param.getName(), null));
}
@PreAuthorize("hasAuthority('common.system:area:list')") @PreAuthorize("hasAuthority('common.system:area:list')")
@OperationLog @OperationLog
@ApiOperation("分页查询") @ApiOperation("分页查询")
@@ -37,7 +37,6 @@ public class CacheController extends BaseController {
@Resource @Resource
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
@PreAuthorize("hasAuthority('sys:cache:list')")
@ApiOperation("查询全部缓存") @ApiOperation("查询全部缓存")
@GetMapping() @GetMapping()
public ApiResult<HashMap<String, Object>> list() { public ApiResult<HashMap<String, Object>> list() {
@@ -65,17 +64,15 @@ public class CacheController extends BaseController {
return success(map); return success(map);
} }
@PreAuthorize("hasAuthority('sys:cache:list')")
@ApiOperation("读取缓存") @ApiOperation("读取缓存")
@GetMapping("/{key}") @GetMapping("/{key}")
public ApiResult<?> get(@PathVariable("key") String key) { public ApiResult<?> get(@PathVariable("key") String key) {
System.out.println("读取缓存 = " + key); // System.out.println("读取缓存 = " + key);
final String cache = cacheClient.get(key); final String cache = cacheClient.get(key);
System.out.println("cache = " + cache); // System.out.println("cache = " + cache);
return success("读取成功", JSONObject.parseObject(cache)); return success("读取成功", JSONObject.parseObject(cache));
} }
@PreAuthorize("hasAuthority('sys:cache:save')")
@ApiOperation("添加缓存") @ApiOperation("添加缓存")
@PostMapping() @PostMapping()
public ApiResult<?> add(@RequestBody Cache cache) { public ApiResult<?> add(@RequestBody Cache cache) {
@@ -87,7 +84,6 @@ public class CacheController extends BaseController {
return success("缓存成功"); return success("缓存成功");
} }
@PreAuthorize("hasAuthority('sys:cache:save')")
@OperationLog @OperationLog
@ApiOperation("删除缓存") @ApiOperation("删除缓存")
@DeleteMapping("/{key}") @DeleteMapping("/{key}")
@@ -98,7 +94,6 @@ public class CacheController extends BaseController {
return fail("删除失败"); return fail("删除失败");
} }
@PreAuthorize("hasAuthority('sys:cache:save')")
@ApiOperation("缓存皮肤") @ApiOperation("缓存皮肤")
@PostMapping("/theme") @PostMapping("/theme")
public ApiResult<?> saveTheme(@RequestBody Cache cache) { public ApiResult<?> saveTheme(@RequestBody Cache cache) {
@@ -53,7 +53,6 @@ public class DictDataController extends BaseController {
return success(dictDataService.pageRel(param)); return success(dictDataService.pageRel(param));
} }
@PreAuthorize("hasAuthority('sys:dict:list')")
@OperationLog @OperationLog
@ApiOperation("查询全部字典数据") @ApiOperation("查询全部字典数据")
@GetMapping() @GetMapping()
@@ -61,7 +60,6 @@ public class DictDataController extends BaseController {
return success(dictDataService.listRel(param)); return success(dictDataService.listRel(param));
} }
@PreAuthorize("hasAuthority('sys:dict:list')")
@OperationLog @OperationLog
@ApiOperation("根据id查询字典数据") @ApiOperation("根据id查询字典数据")
@GetMapping("/{id}") @GetMapping("/{id}")
@@ -79,11 +77,11 @@ public class DictDataController extends BaseController {
.eq(DictData::getDictDataName, dictData.getDictDataName())) > 0) { .eq(DictData::getDictDataName, dictData.getDictDataName())) > 0) {
return fail("字典数据名称已存在"); return fail("字典数据名称已存在");
} }
if (dictDataService.count(new LambdaQueryWrapper<DictData>() // if (dictDataService.count(new LambdaQueryWrapper<DictData>()
.eq(DictData::getDictId, dictData.getDictId()) // .eq(DictData::getDictId, dictData.getDictId())
.eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) { // .eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) {
return fail("字典数据标识已存在"); // return fail("字典数据标识已存在");
} // }
// 自动添加字典 // 自动添加字典
final int count = dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode, dictData.getDictCode())); final int count = dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode, dictData.getDictCode()));
if (dictData.getDictCode() != null && count == 0) { if (dictData.getDictCode() != null && count == 0) {
@@ -55,14 +55,14 @@ public class FileController extends BaseController {
File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName()); File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName());
String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1); String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1);
// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload"); // String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload");
String requestURL = config.getFileServer() + "/api/file"; String requestURL = config.getFileServer() + "/api/file/";
String originalName = file.getOriginalFilename(); String originalName = file.getOriginalFilename();
result = new FileRecord(); result = new FileRecord();
result.setCreateUserId(getLoginUserId()); result.setCreateUserId(getLoginUserId());
result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName); result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName);
result.setLength(upload.length()); result.setLength(upload.length());
result.setPath(path); result.setPath(path);
result.setUrl(requestURL + path); result.setUrl((requestURL + path).replace("file//", "file/"));
String contentType = FileServerUtil.getContentType(upload); String contentType = FileServerUtil.getContentType(upload);
result.setContentType(contentType); result.setContentType(contentType);
if (FileServerUtil.isImage(contentType)) { if (FileServerUtil.isImage(contentType)) {
@@ -2,6 +2,11 @@ package com.gxwebsoft.common.system.controller;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.common.core.annotation.OperationLog; import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties; import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.security.JwtSubject; import com.gxwebsoft.common.core.security.JwtSubject;
@@ -60,7 +65,9 @@ public class MainController extends BaseController {
@Resource @Resource
private CacheClient cacheClient; private CacheClient cacheClient;
@Resource @Resource
private StringRedisTemplate stringRedisTemplate; private ArticleCommentService articleCommentService;
@Resource
private ArticleCollectService articleCollectService;
@ApiOperation("用户登录") @ApiOperation("用户登录")
@PostMapping("/login") @PostMapping("/login")
@@ -123,7 +130,14 @@ public class MainController extends BaseController {
@ApiOperation("获取登录用户信息") @ApiOperation("获取登录用户信息")
@GetMapping("/auth/user") @GetMapping("/auth/user")
public ApiResult<User> userInfo() { public ApiResult<User> userInfo() {
return success(userService.getByIdRel(getLoginUserId())); User user = userService.getByIdRel(getLoginUserId());
int commentNum = articleCommentService.count(new LambdaQueryWrapper<ArticleComment>()
.eq(ArticleComment::getUserId, getLoginUser()));
int collectNum = articleCollectService.count(new LambdaQueryWrapper<ArticleCollect>()
.eq(ArticleCollect::getUserId, getLoginUser()));
user.setArticleCommentNum(commentNum);
user.setArticleCollectNum(collectNum);
return success(user);
} }
@ApiOperation("获取登录用户菜单") @ApiOperation("获取登录用户菜单")
@@ -2,6 +2,7 @@ package com.gxwebsoft.common.system.controller;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -12,30 +13,39 @@ import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.security.JwtSubject; import com.gxwebsoft.common.core.security.JwtSubject;
import com.gxwebsoft.common.core.security.JwtUtil; import com.gxwebsoft.common.core.security.JwtUtil;
import com.gxwebsoft.common.core.utils.CommonUtil; import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.utils.ExcelExportUtil;
import com.gxwebsoft.common.core.web.*; import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.*; import com.gxwebsoft.common.system.entity.*;
import com.gxwebsoft.common.system.param.UserImportParam; import com.gxwebsoft.common.system.param.UserImportParam;
import com.gxwebsoft.common.system.param.UserParam; import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.result.LoginResult; import com.gxwebsoft.common.system.result.LoginResult;
import com.gxwebsoft.common.system.service.*; import com.gxwebsoft.common.system.service.*;
import com.gxwebsoft.shop.entity.UserBalanceLog;
import com.gxwebsoft.shop.entity.UserOauth; import com.gxwebsoft.shop.entity.UserOauth;
import com.gxwebsoft.shop.service.RechargeOrderService; import com.gxwebsoft.shop.entity.UserParentList;
import com.gxwebsoft.shop.service.UserOauthService; import com.gxwebsoft.shop.entity.UserPointLog;
import com.gxwebsoft.shop.service.*;
import com.gxwebsoft.yxe.entity.YxeShare;
import com.gxwebsoft.yxe.entity.YxeTask;
import com.gxwebsoft.yxe.entity.YxeUserTask;
import com.gxwebsoft.yxe.service.YxeShareService;
import com.gxwebsoft.yxe.service.YxeTaskService;
import com.gxwebsoft.yxe.service.YxeUserTaskService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -54,6 +64,23 @@ public class UserController extends BaseController {
private UserOauthService userOauthService; private UserOauthService userOauthService;
@Resource @Resource
private ConfigProperties configProperties; private ConfigProperties configProperties;
@Resource
private YxeUserTaskService yxeUserTaskService;
@Resource
private YxeShareService yxeShareService;
@Resource
private YxeTaskService yxeTaskService;
@Resource
private ExcelExportUtil excelExportUtil;
@Resource
private UserParentListService userParentListService;
@Resource
private DictDataService dictDataService;
@Resource
private UserBalanceLogService userBalanceLogService;
@Resource
private UserPointLogService userPointLogService;
@PreAuthorize("hasAuthority('sys:user:list')") @PreAuthorize("hasAuthority('sys:user:list')")
@OperationLog @OperationLog
@@ -71,6 +98,72 @@ public class UserController extends BaseController {
return success("统计成功", totalBalance); return success("统计成功", totalBalance);
} }
@GetMapping("/countUserIncome")
public ApiResult<?> countUserIncome() {
Map<String, Object> data = new HashMap<>();
BigDecimal taskIncome = BigDecimal.ZERO;
BigDecimal shareIncome = BigDecimal.ZERO;
BigDecimal totalTaskIncome = BigDecimal.ZERO;
BigDecimal totalShareIncome = BigDecimal.ZERO;
List<YxeTask> taskList = new ArrayList<>();
if (getLoginUser() != null) {
List<YxeUserTask> userTaskList = yxeUserTaskService.listByUserId(getLoginUserId());
List<YxeShare> shareList = yxeShareService.listByUser(getLoginUserId());
if (!userTaskList.isEmpty()) {
Set<Integer> taskIds = userTaskList.stream().map(YxeUserTask::getTaskId).filter(Objects::nonNull).collect(Collectors.toSet());
if (!taskIds.isEmpty()) {
taskList = yxeTaskService.listByIds(taskIds);
}
}
for (YxeUserTask userTask : userTaskList) {
YxeTask task = taskList.stream().filter(t -> t.getId().equals(userTask.getTaskId())).findFirst().orElse(null);
if (Integer.valueOf(2).equals(userTask.getStatus())) {
taskIncome = taskIncome.add(resolveUserTaskIncome(userTask, task));
}
}
for (YxeShare share : shareList) {
if (share.getIncome() != null) shareIncome = shareIncome.add(share.getIncome());
}
if (getLoginUser().getCanAuth().equals(1)) {
List<YxeUserTask> totalUserTaskList = yxeUserTaskService.list();
List<YxeShare> totalShareList = yxeShareService.list();
List<YxeTask> taskListAll = new ArrayList<>();
if (!totalUserTaskList.isEmpty()) {
Set<Integer> taskIds = totalUserTaskList.stream().map(YxeUserTask::getTaskId).filter(Objects::nonNull).collect(Collectors.toSet());
if (!taskIds.isEmpty()) {
taskListAll = yxeTaskService.listByIds(taskIds);
}
}
for (YxeUserTask userTask : totalUserTaskList) {
YxeTask task = taskListAll.stream().filter(t -> t.getId().equals(userTask.getTaskId())).findFirst().orElse(null);
if (Integer.valueOf(2).equals(userTask.getStatus())) {
totalTaskIncome = totalTaskIncome.add(resolveUserTaskIncome(userTask, task));
}
}
for (YxeShare share : totalShareList) {
if (share.getIncome() != null) totalShareIncome = totalShareIncome.add(share.getIncome());
}
}
}
data.put("taskIncome", taskIncome);
data.put("shareIncome", shareIncome);
data.put("totalTaskIncome", totalTaskIncome);
data.put("totalShareIncome", totalShareIncome);
return success("统计成功", data);
}
private BigDecimal resolveUserTaskIncome(YxeUserTask userTask, YxeTask task) {
if (userTask != null && userTask.getIncome() != null && userTask.getIncome().compareTo(BigDecimal.ZERO) > 0) {
return userTask.getIncome();
}
if (task != null && task.getReward() != null) {
return task.getReward();
}
return BigDecimal.ZERO;
}
@PostMapping("/login-by-phone") @PostMapping("/login-by-phone")
public ApiResult<?> loginByPhone(@RequestBody User userParam) { public ApiResult<?> loginByPhone(@RequestBody User userParam) {
User user = userService.getByPhone(userParam.getPhone()); User user = userService.getByPhone(userParam.getPhone());
@@ -79,6 +172,16 @@ public class UserController extends BaseController {
return success("登录成功", new LoginResult(access_token, user)); return success("登录成功", new LoginResult(access_token, user));
} }
@ApiOperation("手机号登录(测试用)")
@PostMapping("/loginByPhoneForTest")
public ApiResult<?> loginByPhoneForTest(@RequestBody User user) {
User getLoginUser = userService.getByPhone(user.getPhone());
if (!user.getPhoneLoginCode().equals("1700083")) return fail("验证码错误");
String access_token = JwtUtil.buildToken(new JwtSubject(getLoginUser.getUsername(), getLoginUser.getTenantId()),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
return success("登录成功", new LoginResult(access_token, user));
}
@PostMapping("/data") @PostMapping("/data")
public ApiResult<User> userData() { public ApiResult<User> userData() {
User loginUser = getLoginUser(); User loginUser = getLoginUser();
@@ -125,7 +228,6 @@ public class UserController extends BaseController {
return success(userService.pageRel(param)); return success(userService.pageRel(param));
} }
@PreAuthorize("hasAuthority('sys:user:list')")
@OperationLog @OperationLog
@ApiOperation("查询全部用户") @ApiOperation("查询全部用户")
@GetMapping() @GetMapping()
@@ -166,6 +268,41 @@ public class UserController extends BaseController {
} else { } else {
user.setPassword(null); user.setPassword(null);
} }
if (userService.updateUser(user)) {
User user1 = userService.getById(user.getUserId());
if (user.getAuthStatus() != null && user.getAuthStatus().equals(2) && user1.getParentId() != null && user1.getParentId() > 0) {
UserParentList userParentList = userParentListService.check(user1.getUserId(), user1.getParentId());
if (userParentList == null) {
userParentList = new UserParentList();
userParentList.setParentId(user1.getParentId());
userParentList.setUid(user1.getUserId());
userParentListService.save(userParentList);
DictData dictData = dictDataService.getById(591);
if (dictData != null) {
User parentUser = userService.getById(user1.getParentId());
UserPointLog userPointLog = new UserPointLog();
userPointLog.setUserId(parentUser.getUserId());
userPointLog.setPoint(Integer.parseInt(dictData.getDictDataCode()));
userPointLog.setMsg("分享用户: " + user1.getPhone() + "获得积分");
userPointLogService.save(userPointLog);
parentUser.setPoints(parentUser.getPoints() + Integer.parseInt(dictData.getDictDataCode()));
userService.updateById(parentUser);
}
}
}
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("修改用户")
@PutMapping("/self")
public ApiResult<?> updateForSelf(@RequestBody User user) {
user.setUserId(getLoginUser().getUserId());
if (userService.updateUser(user)) { if (userService.updateUser(user)) {
return success("修改成功"); return success("修改成功");
} }
@@ -297,6 +434,44 @@ public class UserController extends BaseController {
return fail(param.getValue() + "不存在"); return fail(param.getValue() + "不存在");
} }
@PreAuthorize("hasAuthority('sys:user:list')")
@OperationLog
@ApiOperation("导出用户")
@PostMapping("/export")
public ApiResult<FileRecord> export(@RequestBody(required = false) UserParam param) throws IOException {
if (param == null) {
param = new UserParam();
}
param.normalizeStringFields();
List<User> list = userService.listRel(param);
XSSFWorkbook workbook = excelExportUtil.createWorkbook("用户",
"用户ID", "账号", "昵称", "姓名", "用户分组", "手机号", "余额", "积分", "状态", "注册时间");
Sheet sheet = workbook.getSheetAt(0);
int rowNum = 1;
for (User item : list) {
excelExportUtil.writeRow(sheet, rowNum++,
item.getUserId(),
item.getUsername(),
item.getNickname(),
item.getRealName(),
item.getUserGroup(),
item.getPhone(),
item.getBalance(),
item.getPoints(),
getUserStatusText(item.getStatus()),
item.getCreateTime() == null ? "" : DateUtil.formatDateTime(item.getCreateTime()));
}
excelExportUtil.autoSizeColumns(sheet, 13);
return success(excelExportUtil.saveWorkbook(workbook, "用户数据", getLoginUserId()));
}
private String getUserStatusText(Integer status) {
if (status == null) {
return "";
}
return status.equals(0) ? "正常" : "冻结";
}
@PreAuthorize("hasAuthority('sys:auth:user')") @PreAuthorize("hasAuthority('sys:auth:user')")
@PostMapping("/getAvatarByMpWx") @PostMapping("/getAvatarByMpWx")
@@ -40,4 +40,6 @@ public class Area implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<Area> children; private List<Area> children;
@TableField(exist = false)
private Area city;
} }
@@ -67,15 +67,28 @@ public class User implements UserDetails {
@ApiModelProperty("别名") @ApiModelProperty("别名")
private String alias; private String alias;
private Integer parentId;
@ApiModelProperty("真实姓名") @ApiModelProperty("真实姓名")
private String realName; private String realName;
@ApiModelProperty("身份证号") @ApiModelProperty("身份证号")
private String idCard; private String idCard;
private String idCardFront;
private String idCardBack;
private String qualification;
private Integer authStatus;
@ApiModelProperty("出生日期") @ApiModelProperty("出生日期")
@JsonFormat(pattern = "yyyy-MM-dd") private String birthday;
private Date birthday;
private String birthTime;
private String birthAddress;
@ApiModelProperty("所在国家") @ApiModelProperty("所在国家")
private String country; private String country;
@@ -101,6 +114,8 @@ public class User implements UserDetails {
@ApiModelProperty("用户可用积分") @ApiModelProperty("用户可用积分")
private Integer points; private Integer points;
private Integer canAuth;
@ApiModelProperty("用户总支付的金额") @ApiModelProperty("用户总支付的金额")
private String payMoney; private String payMoney;
@@ -135,6 +150,10 @@ public class User implements UserDetails {
@TableLogic @TableLogic
private Integer deleted; private Integer deleted;
private Integer coin;
private Integer sendCoin;
@ApiModelProperty(value = "租户id") @ApiModelProperty(value = "租户id")
private Integer tenantId; private Integer tenantId;
@@ -172,6 +191,9 @@ public class User implements UserDetails {
@ApiModelProperty("用户等级(0管理员1区代2总售后3零售商店长4导购5售后6散户7编外8售后店长)") @ApiModelProperty("用户等级(0管理员1区代2总售后3零售商店长4导购5售后6散户7编外8售后店长)")
private Integer userLevel; private Integer userLevel;
@ApiModelProperty("用户分组")
private String userGroup;
@ApiModelProperty("机构名称") @ApiModelProperty("机构名称")
@TableField(exist = false) @TableField(exist = false)
private String organizationName; private String organizationName;
@@ -220,6 +242,14 @@ public class User implements UserDetails {
@TableField(exist = false) @TableField(exist = false)
private String mobile; private String mobile;
@TableField(exist = false)
private String phoneLoginCode;
@TableField(exist = false)
private Integer articleCollectNum;
@TableField(exist = false)
private Integer articleCommentNum;
@Override @Override
public boolean isAccountNonExpired() { public boolean isAccountNonExpired() {
@@ -245,4 +275,12 @@ public class User implements UserDetails {
return DesensitizedUtil.mobilePhone(this.phone); return DesensitizedUtil.mobilePhone(this.phone);
} }
@TableField(exist = false)
private Integer totalTaskNum;
@TableField(exist = false)
private Integer taskCompleteNum;
@TableField(exist = false)
private BigDecimal incomeAmount;
} }
@@ -48,6 +48,9 @@
<if test="param.openId != null"> <if test="param.openId != null">
AND a.open_id = #{param.openId} AND a.open_id = #{param.openId}
</if> </if>
<if test="param.authStatus != null">
AND a.auth_status = #{param.authStatus}
</if>
<if test="param.nickname != null"> <if test="param.nickname != null">
AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%')
</if> </if>
@@ -81,6 +84,9 @@
<if test="param.userLevel != null"> <if test="param.userLevel != null">
AND a.user_level = #{param.userLevel} AND a.user_level = #{param.userLevel}
</if> </if>
<if test="param.userGroup != null and param.userGroup != ''">
AND a.user_group LIKE CONCAT('%', #{param.userGroup}, '%')
</if>
</where> </where>
<if test="param.organizationId != null"> <if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId} AND a.organization_id = #{param.organizationId}
@@ -92,6 +92,8 @@ public class UserParam extends BaseParam {
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer status; private Integer status;
private Integer authStatus;
@ApiModelProperty("是否删除, 0否, 1是") @ApiModelProperty("是否删除, 0否, 1是")
@TableLogic @TableLogic
private Integer deleted; private Integer deleted;
@@ -156,6 +158,9 @@ public class UserParam extends BaseParam {
@ApiModelProperty("用户等级(0管理员1区代2总售后3零售商店长4导购5售后6散户)") @ApiModelProperty("用户等级(0管理员1区代2总售后3零售商店长4导购5售后6散户)")
private Integer userLevel; private Integer userLevel;
@ApiModelProperty("用户分组")
private String userGroup;
@ApiModelProperty("性别名称") @ApiModelProperty("性别名称")
@TableField(exist = false) @TableField(exist = false)
private String sexName; private String sexName;
@@ -46,4 +46,8 @@ public interface AreaService extends IService<Area> {
Area getProvinceByName(String name); Area getProvinceByName(String name);
Area getRegionByName(String name); Area getRegionByName(String name);
Area areaInfoByName(String name, Integer level);
Area areaInfoByName(String name, Integer level, Integer parentId);
} }
@@ -31,6 +31,11 @@ public interface UserService extends IService<User>, UserDetailsService {
* @return List<User> * @return List<User>
*/ */
List<User> listRel(UserParam param); List<User> listRel(UserParam param);
List<User> listByNickname(String nickname);
List<User> listByRealName(String realName);
void listRanking(UserParam param); void listRanking(UserParam param);
/** /**
@@ -78,4 +78,23 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements Ar
); );
} }
@Override
public Area areaInfoByName(String name, Integer level) {
LambdaQueryWrapper<Area> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Area::getName, name);
if (level != null) wrapper.eq(Area::getLevelId, level);
Area item = getOne(wrapper);
if (item.getLevelId().equals(3))
item.setCity(getById(item.getFid()));
return item;
}
@Override
public Area areaInfoByName(String name, Integer level, Integer parentId) {
LambdaQueryWrapper<Area> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Area::getName, name);
if (parentId != null) wrapper.eq(Area::getFid, parentId);
if (level != null) wrapper.eq(Area::getLevelId, level);
return getOne(wrapper);
}
} }
@@ -81,10 +81,26 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
return page.sortRecords(list); return page.sortRecords(list);
} }
@Override
public List<User> listByNickname(String nickname) {
return list(
new LambdaQueryWrapper<User>()
.like(User::getNickname, nickname)
);
}
@Override
public List<User> listByRealName(String realName) {
return list(
new LambdaQueryWrapper<User>()
.like(User::getRealName, realName)
);
}
@Override @Override
public void listRanking(UserParam param) { public void listRanking(UserParam param) {
List<User> list = baseMapper.selectListRel(param); List<User> list = baseMapper.selectListRel(param);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
// list.forEach(d -> { // list.forEach(d -> {
// int count = appService.count(new LambdaQueryWrapper<App>() // int count = appService.count(new LambdaQueryWrapper<App>()
// .eq(App::getUserId, d.getUserId())); // .eq(App::getUserId, d.getUserId()));
@@ -130,7 +146,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
if (StrUtil.isBlank(username)) { if (StrUtil.isBlank(username)) {
return null; return null;
} }
User user = baseMapper.selectByUsername(username, tenantId); User user = getOne(new LambdaQueryWrapper<User>().eq(User::getUsername, username).last("limit 1"));
if (user != null) { if (user != null) {
user.setRoles(userRoleService.listByUserId(user.getUserId())); user.setRoles(userRoleService.listByUserId(user.getUserId()));
user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null)); user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null));
@@ -209,27 +225,31 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override @Override
public User getByPhone(String phone) { public User getByPhone(String phone) {
return query().eq("phone", phone).one(); return getOne(
new LambdaQueryWrapper<User>()
.eq(User::getPhone, phone)
.last("limit 1")
);
} }
@Override @Override
public User getByOpenId(String openId) { public User getByOpenId(String openId) {
return query().eq("openId", openId).one(); return query().eq("openId", openId).one();
} }
@Override @Override
public User getByUnionId(UserParam param) { public User getByUnionId(UserParam param) {
return param.getOne(baseMapper.getOne(param)); return param.getOne(baseMapper.getOne(param));
} }
@Override @Override
public User getByOauthId(UserParam userParam) { public User getByOauthId(UserParam userParam) {
return userParam.getOne(baseMapper.getOne(userParam)); return userParam.getOne(baseMapper.getOne(userParam));
} }
@Override @Override
public List<User> listStatisticsRel(UserParam param) { public List<User> listStatisticsRel(UserParam param) {
List<User> list = baseMapper.selectListStatisticsRel(param); List<User> list = baseMapper.selectListStatisticsRel(param);
return list; return list;
} }
@@ -1,22 +0,0 @@
package com.gxwebsoft.law.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig
{
@Bean
public ServerEndpointExporter serverEndpointExporter()
{
ServerEndpointExporter exporter = new ServerEndpointExporter();
// 手动注册 WebSocket 端点
exporter.setAnnotatedEndpointClasses(WebSocketServer.class);
return exporter;
}
}
@@ -1,87 +0,0 @@
package com.gxwebsoft.law.config;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
@ServerEndpoint(value = "/chat/{userId}")
@Component
public class WebSocketServer {
/**
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
*/
private static ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
/**
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
*/
private Session session;
/**
* 接收userId
*/
private String userId = "";
/**
* 连接建立成功调用的方法
*/
@OnOpen
public void onOpen(Session session, @PathParam("userId") String userId) {
this.session = session;
this.userId = userId;
if (webSocketMap.containsKey(userId)) {
webSocketMap.remove(userId);
webSocketMap.put(userId, this);
//加入set中
} else {
webSocketMap.put(userId, this);
}
try {
sendMessage(userId, "连接成功");
} catch (IOException e) {
}
}
/**
* 连接关闭调用的方法
*/
@OnClose
public void onClose() {
if (webSocketMap.containsKey(userId)) {
webSocketMap.remove(userId);
}
}
/**
* 实现服务器主动推送
*/
public void sendMessage(String userId, String message) throws IOException {
if (webSocketMap.containsKey(userId)) {
Session session1 = webSocketMap.get(userId).session;
if (session1 != null) session1.getBasicRemote().sendText(message);
}
}
/**
* 实现服务器主动推送
*/
public void sendAllMessage(String message) throws IOException {
ConcurrentHashMap.KeySetView<String, WebSocketServer> userIds = webSocketMap.keySet();
for (String userId : userIds) {
WebSocketServer webSocketServer = webSocketMap.get(userId);
webSocketServer.session.getBasicRemote().sendText(message);
}
}
}
@@ -1,138 +0,0 @@
package com.gxwebsoft.law.controller;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.sql.StringEscape;
import com.gxwebsoft.common.core.utils.JSONUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.config.WebSocketServer;
import com.gxwebsoft.law.entity.ChatMessage;
import com.gxwebsoft.law.entity.ChatResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@Api(tags = "AI")
@RestController
@RequestMapping("/api/chat")
public class AiController extends BaseController {
@Resource
private WebSocketServer webSocketServer;
@PostMapping("/message")
public ApiResult<?> message(@RequestBody ChatMessage message) throws IOException {
Map<String, Object> params = new HashMap<>();
params.put("query", message.getQuery());
params.put("user", getLoginUserId());
params.put("response_mode", "streaming");
String token = "Bearer app-UxV82WXIRrScpf53exkJ7dIw";
if (message.getType() != null) {
token = "Bearer app-7AFseF5UTEJpZGkW93S0wybh";
}
if (message.getInputs() != null) {
Map<String, Object> inputs = new HashMap<>();
inputs.put("request_type", message.getRequestType());
inputs.put("request_json", message.getInputs());
params.put("inputs", inputs);
} else {
params.put("inputs", new HashMap<>());
}
// 使用 Java 自带的 HttpURLConnection 发送流式请求
try {
URL url = new URL("http://workflow.gxshucheng.com:8010/v1/chat-messages");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Authorization", token);
connection.setRequestProperty("Content-Type", "application/json");
connection.setDoOutput(true);
connection.setConnectTimeout(600000);
connection.setReadTimeout(600000);
// 写入请求体
try (OutputStream os = connection.getOutputStream()) {
os.write(JSONUtil.toJSONString(params).getBytes(StandardCharsets.UTF_8));
}
StringBuilder responseStr = new StringBuilder();
// 读取响应流
try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
System.out.println("Received chunk: " + line); // 打印接收到的每一部分数据
// 这里可以对每一部分数据进行处理,例如解析或发送给前端
if (!line.isEmpty()) {
String[] dataList = line.split("data: ");
if (dataList.length == 2) {
// System.out.println(dataList[1]);
Map data = JSONUtil.parseObject(dataList[1], Map.class);
if (data.get("event") != null && data.get("event").equals("message")) {
String answer = (String) data.get("answer");
String task_id = (String) data.get("task_id");
if (answer != null && !answer.isEmpty()) {
HashMap<String, String> answerData = new HashMap<>();
answerData.put("answer", answer);
answerData.put("taskId", task_id);
webSocketServer.sendMessage(message.getUser(), JSONUtil.toJSONString(answerData));
}
System.out.println(answer);
responseStr.append(answer);
}else if (data.get("event") != null && data.get("event").equals("message_end")) {
String task_id = (String) data.get("task_id");
HashMap<String, String> answerData = new HashMap<>();
answerData.put("answer", "__END__");
answerData.put("taskId", task_id);
webSocketServer.sendMessage(message.getUser(), JSONUtil.toJSONString(answerData));
}
}
}
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
System.out.println(stackTraceElement);
}
webSocketServer.sendMessage(message.getUser(), "出错了,请晚点再来提问吧~");
return fail("出错了,请晚点再来提问吧~");
}
// 返回成功响应
return success("Stream processing completed");
}
@PostMapping("/messageStop")
public ApiResult<?> stop(@RequestBody Map<String, Object> data) {
if (data.get("taskId") == null) return success();
String taskId = data.get("taskId").toString();
Map<String, Integer> postData = new HashMap<>();
postData.put("user", getLoginUserId());
String token = "Bearer app-UxV82WXIRrScpf53exkJ7dIw";
if (data.get("type") != null) {
token = "Bearer app-7AFseF5UTEJpZGkW93S0wybh";
}
String res = HttpRequest.post("http://workflow.gxshucheng.com:8010/v1/chat-messages/" + taskId + "/stop")
.header("Authorization", token)
.header("Content-Type", "application/json")
.body(JSONObject.toJSONString(postData))
.execute().body();
System.out.println("stop res:" + res);
return success();
}
}
@@ -1,207 +0,0 @@
package com.gxwebsoft.law.controller;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalAidService;
import com.gxwebsoft.law.entity.LawLegalAid;
import com.gxwebsoft.law.param.LawLegalAidParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
/**
* 法律援助申请控制器
*
* @author LX
* @since 2025-04-17 17:33:28
*/
@Api(tags = "法律援助申请管理")
@RestController
@RequestMapping("/api/law/law-legal-aid")
public class LawLegalAidController extends BaseController {
@Resource
private LawLegalAidService lawLegalAidService;
@Value("${config.upload-path}")
private String uploadPath;
@Value("${config.server-url}")
private String serverUrl;
@ApiOperation("分页查询法律援助申请")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalAid>> page(LawLegalAidParam param) {
// 使用关联查询
return success(lawLegalAidService.pageRel(param));
}
@ApiOperation("查询全部法律援助申请")
@GetMapping()
public ApiResult<List<LawLegalAid>> list(LawLegalAidParam param) {
// 使用关联查询
return success(lawLegalAidService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalAid:list')")
@ApiOperation("根据id查询法律援助申请")
@GetMapping("/{id}")
public ApiResult<LawLegalAid> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalAidService.getByIdRel(id));
}
@ApiOperation("添加法律援助申请")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalAid lawLegalAid) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalAid.setUserId(loginUser.getUserId());
}
if (lawLegalAidService.save(lawLegalAid)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律援助申请")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalAid lawLegalAid) {
if (lawLegalAidService.updateById(lawLegalAid)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律援助申请")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalAidService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律援助申请")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalAid> list) {
if (lawLegalAidService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律援助申请")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalAid> batchParam) {
if (batchParam.update(lawLegalAidService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律援助申请")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalAidService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("导出")
@PostMapping("/export")
public ApiResult<?> export() throws IOException {
List<LawLegalAid> list = lawLegalAidService.list();
XWPFDocument doc = new XWPFDocument(Files.newInputStream(Paths.get(uploadPath + "/file/法律援助申请表.docx")));
List<String> pathList = new ArrayList<>();
for (LawLegalAid lawLegalAid : list) {
String outputPath = uploadPath + "file/doc/法律援助申请表/" + lawLegalAid.getName() + "-" + lawLegalAid.getId() + ".docx";
pathList.add(outputPath);
FileOutputStream fos = new FileOutputStream(outputPath);
List<XWPFTable> tables = doc.getTables();
XWPFTable table = tables.get(0);
for (int i = 0; i < table.getRows().size(); i++) {
XWPFTableRow row = table.getRow(i);
switch (i) {
case 0: {
row.getCell(2).setText(lawLegalAid.getName());
row.getCell(4).setText(lawLegalAid.getGender().equals(0) ? "男" : "女");
row.getCell(6).setText(lawLegalAid.getNation());
}
break;
case 1: {
row.getCell(2).setText("身份证 " + lawLegalAid.getIdCard());
}
break;
case 2: {
row.getCell(2).setText(lawLegalAid.getHouseholdAddress());
}
break;
case 3: {
row.getCell(2).setText(lawLegalAid.getLiveAddress());
}
break;
case 5: {
row.getCell(2).setText(lawLegalAid.getCompanyName());
}
break;
case 6: {
row.getCell(2).setText(lawLegalAid.getPhone());
}
break;
case 7: {
row.getCell(2).setText(lawLegalAid.getEmail());
}
break;
case 9: {
if (lawLegalAid.getProxyName() != null && !lawLegalAid.getProxyName().isEmpty())
row.getCell(2).setText(lawLegalAid.getProxyName());
if (lawLegalAid.getProxyRelation() != null && !lawLegalAid.getProxyRelation().isEmpty())
row.getCell(4).setText(lawLegalAid.getProxyRelation());
if (lawLegalAid.getProxyPhone() != null && !lawLegalAid.getProxyPhone().isEmpty())
row.getCell(6).setText(lawLegalAid.getProxyPhone());
}
break;
case 10: {
if (lawLegalAid.getProxyIdCard() != null && !lawLegalAid.getProxyIdCard().isEmpty())
row.getCell(2).setText("身份证 " + lawLegalAid.getProxyIdCard());
}
break;
case 12: {
row.getCell(1).setText(lawLegalAid.getContent());
}
break;
}
}
doc.write(fos);
fos.flush();
fos.close();
}
ZipUtil.zip(uploadPath + "file/doc/法律援助申请表");
for (String path : pathList) {
FileUtil.del(path);
}
return success("导出成功", serverUrl + "/file/doc/法律援助申请表.zip");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalAppraisalService;
import com.gxwebsoft.law.entity.LawLegalAppraisal;
import com.gxwebsoft.law.param.LawLegalAppraisalParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 司法鉴定申请控制器
*
* @author LX
* @since 2025-05-06 17:11:41
*/
@Api(tags = "司法鉴定申请管理")
@RestController
@RequestMapping("/api/law/law-legal-appraisal")
public class LawLegalAppraisalController extends BaseController {
@Resource
private LawLegalAppraisalService lawLegalAppraisalService;
@ApiOperation("分页查询司法鉴定申请")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalAppraisal>> page(LawLegalAppraisalParam param) {
// 使用关联查询
return success(lawLegalAppraisalService.pageRel(param));
}
@ApiOperation("查询全部司法鉴定申请")
@GetMapping()
public ApiResult<List<LawLegalAppraisal>> list(LawLegalAppraisalParam param) {
// 使用关联查询
return success(lawLegalAppraisalService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalAppraisal:list')")
@ApiOperation("根据id查询司法鉴定申请")
@GetMapping("/{id}")
public ApiResult<LawLegalAppraisal> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalAppraisalService.getByIdRel(id));
}
@ApiOperation("添加司法鉴定申请")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalAppraisal lawLegalAppraisal) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalAppraisal.setUserId(loginUser.getUserId());
}
if (lawLegalAppraisalService.save(lawLegalAppraisal)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改司法鉴定申请")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalAppraisal lawLegalAppraisal) {
if (lawLegalAppraisalService.updateById(lawLegalAppraisal)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除司法鉴定申请")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalAppraisalService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加司法鉴定申请")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalAppraisal> list) {
if (lawLegalAppraisalService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改司法鉴定申请")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalAppraisal> batchParam) {
if (batchParam.update(lawLegalAppraisalService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除司法鉴定申请")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalAppraisalService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,223 +0,0 @@
package com.gxwebsoft.law.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.entity.LawLegalAid;
import com.gxwebsoft.law.service.LawLegalArbitrateService;
import com.gxwebsoft.law.entity.LawLegalArbitrate;
import com.gxwebsoft.law.param.LawLegalArbitrateParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.xwpf.usermodel.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 法律仲裁申请控制器
*
* @author LX
* @since 2025-05-06 15:56:26
*/
@Api(tags = "法律仲裁申请管理")
@RestController
@RequestMapping("/api/law/law-legal-arbitrate")
public class LawLegalArbitrateController extends BaseController {
@Resource
private LawLegalArbitrateService lawLegalArbitrateService;
@Value("${config.upload-path}")
private String uploadPath;
@Value("${config.server-url}")
private String serverUrl;
@ApiOperation("分页查询法律仲裁申请")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalArbitrate>> page(LawLegalArbitrateParam param) {
// 使用关联查询
return success(lawLegalArbitrateService.pageRel(param));
}
@ApiOperation("查询全部法律仲裁申请")
@GetMapping()
public ApiResult<List<LawLegalArbitrate>> list(LawLegalArbitrateParam param) {
// 使用关联查询
return success(lawLegalArbitrateService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalArbitrate:list')")
@ApiOperation("根据id查询法律仲裁申请")
@GetMapping("/{id}")
public ApiResult<LawLegalArbitrate> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalArbitrateService.getByIdRel(id));
}
@ApiOperation("添加法律仲裁申请")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalArbitrate lawLegalArbitrate) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalArbitrate.setUserId(loginUser.getUserId());
}
if (lawLegalArbitrateService.save(lawLegalArbitrate)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律仲裁申请")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalArbitrate lawLegalArbitrate) {
if (lawLegalArbitrateService.updateById(lawLegalArbitrate)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律仲裁申请")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalArbitrateService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律仲裁申请")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalArbitrate> list) {
if (lawLegalArbitrateService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律仲裁申请")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalArbitrate> batchParam) {
if (batchParam.update(lawLegalArbitrateService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律仲裁申请")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalArbitrateService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("导出")
@PostMapping("/export")
public ApiResult<?> export() throws IOException {
List<LawLegalArbitrate> list = lawLegalArbitrateService.list();
List<String> pathList = new ArrayList<>();
for (LawLegalArbitrate lawLegalArbitrate : list) {
XWPFDocument doc = new XWPFDocument();
String outputPath = uploadPath + "file/doc/仲裁申请书/" + lawLegalArbitrate.getName() + "-" + lawLegalArbitrate.getId() + ".docx";
pathList.add(outputPath);
FileOutputStream fos = new FileOutputStream(outputPath);
XWPFParagraph paragraph = doc.createParagraph();
paragraph.setAlignment(ParagraphAlignment.CENTER);
XWPFRun titleRun = paragraph.createRun();
titleRun.setFontFamily("宋体");
titleRun.setBold(true);
titleRun.setFontSize(26f);
titleRun.setText("仲裁申请书");
String line0 = " 申请人:";
line0 += lawLegalArbitrate.getName() + ",";
line0 += lawLegalArbitrate.getGender().equals(0) ? "男," : "女,";
line0 += lawLegalArbitrate.getBirthday() + "出生,";
line0 += (lawLegalArbitrate.getNation().contains("族") ? lawLegalArbitrate.getNation() : lawLegalArbitrate.getNation() + "族") + ",";
line0 += "住" + lawLegalArbitrate.getLiveAddress() + ",";
line0 += "身份证号码:" + lawLegalArbitrate.getIdCard() + ",";
line0 += "联系电话:" + lawLegalArbitrate.getPhone() + "。";
setContent(doc, line0);
String line1 = " 被申请人:";
line1 += lawLegalArbitrate.getBeenName() + ",";
line1 += "住所地:" + lawLegalArbitrate.getBeenAddress() + "。";
line1 += "统一社会信用代码:" + lawLegalArbitrate.getBeenCode() + "。";
line1 += "联系电话:" + lawLegalArbitrate.getBeenPhone() + "。";
setContent(doc, line1);
String line2 = " 法定代表人:";
line2 += lawLegalArbitrate.getBeenLegalName() + "," + lawLegalArbitrate.getBeenLegalPosition() + "。";
setContent(doc, line2);
setTitle(doc, " 仲裁请求:");
setContent(doc, " " + lawLegalArbitrate.getRequestContent());
setTitle(doc, " 事实和理由:");
setContent(doc, " " + lawLegalArbitrate.getContent());
setContent(doc, " 此致");
setContent(doc, " 贵港仲裁委员会");
setEndContent(doc, "申请人: ");
String date = LocalDateTimeUtil.format(lawLegalArbitrate.getCreateTime(), "yyyy年MM月dd日");
setEndContent(doc, date);
doc.write(fos);
fos.flush();
fos.close();
}
ZipUtil.zip(uploadPath + "file/doc/仲裁申请书");
for (String path : pathList) {
FileUtil.del(path);
}
return success("导出成功", serverUrl + "/file/doc/仲裁申请书.zip");
}
private void setContent(XWPFDocument doc, String content) {
XWPFParagraph paragraph1 = doc.createParagraph();
paragraph1.setAlignment(ParagraphAlignment.LEFT);
XWPFRun pRun1 = paragraph1.createRun();
pRun1.setFontFamily("仿宋");
pRun1.setFontSize(16f);
pRun1.setText(content);
}
private void setEndContent(XWPFDocument doc, String content) {
XWPFParagraph paragraph1 = doc.createParagraph();
paragraph1.setAlignment(ParagraphAlignment.RIGHT);
XWPFRun pRun1 = paragraph1.createRun();
pRun1.setFontFamily("仿宋");
pRun1.setFontSize(16f);
pRun1.setText(content);
}
private void setTitle(XWPFDocument doc, String content) {
XWPFParagraph paragraph1 = doc.createParagraph();
paragraph1.setAlignment(ParagraphAlignment.LEFT);
XWPFRun pRun1 = paragraph1.createRun();
pRun1.setFontFamily("仿宋");
pRun1.setFontSize(16f);
pRun1.setBold(true);
pRun1.setText(content);
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalCalConfigService;
import com.gxwebsoft.law.entity.LawLegalCalConfig;
import com.gxwebsoft.law.param.LawLegalCalConfigParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 法律计算器配置控制器
*
* @author LX
* @since 2025-04-17 19:23:47
*/
@Api(tags = "法律计算器配置管理")
@RestController
@RequestMapping("/api/law/law-legal-cal-config")
public class LawLegalCalConfigController extends BaseController {
@Resource
private LawLegalCalConfigService lawLegalCalConfigService;
@ApiOperation("分页查询法律计算器配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalCalConfig>> page(LawLegalCalConfigParam param) {
// 使用关联查询
return success(lawLegalCalConfigService.pageRel(param));
}
@ApiOperation("查询全部法律计算器配置")
@GetMapping()
public ApiResult<List<LawLegalCalConfig>> list(LawLegalCalConfigParam param) {
// 使用关联查询
return success(lawLegalCalConfigService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalCalConfig:list')")
@ApiOperation("根据id查询法律计算器配置")
@GetMapping("/{id}")
public ApiResult<LawLegalCalConfig> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalCalConfigService.getByIdRel(id));
}
@ApiOperation("添加法律计算器配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalCalConfig lawLegalCalConfig) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalCalConfig.setUserId(loginUser.getUserId());
}
if (lawLegalCalConfigService.save(lawLegalCalConfig)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律计算器配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalCalConfig lawLegalCalConfig) {
if (lawLegalCalConfigService.updateById(lawLegalCalConfig)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律计算器配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalCalConfigService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律计算器配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalCalConfig> list) {
if (lawLegalCalConfigService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律计算器配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalCalConfig> batchParam) {
if (batchParam.update(lawLegalCalConfigService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律计算器配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalCalConfigService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalCalContentService;
import com.gxwebsoft.law.entity.LawLegalCalContent;
import com.gxwebsoft.law.param.LawLegalCalContentParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户填写法律计算器内容控制器
*
* @author LX
* @since 2025-04-17 19:23:47
*/
@Api(tags = "用户填写法律计算器内容管理")
@RestController
@RequestMapping("/api/law/law-legal-cal-content")
public class LawLegalCalContentController extends BaseController {
@Resource
private LawLegalCalContentService lawLegalCalContentService;
@ApiOperation("分页查询用户填写法律计算器内容")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalCalContent>> page(LawLegalCalContentParam param) {
// 使用关联查询
return success(lawLegalCalContentService.pageRel(param));
}
@ApiOperation("查询全部用户填写法律计算器内容")
@GetMapping()
public ApiResult<List<LawLegalCalContent>> list(LawLegalCalContentParam param) {
// 使用关联查询
return success(lawLegalCalContentService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalCalContent:list')")
@ApiOperation("根据id查询用户填写法律计算器内容")
@GetMapping("/{id}")
public ApiResult<LawLegalCalContent> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalCalContentService.getByIdRel(id));
}
@ApiOperation("添加用户填写法律计算器内容")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalCalContent lawLegalCalContent) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalCalContent.setUserId(loginUser.getUserId());
}
if (lawLegalCalContentService.save(lawLegalCalContent)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改用户填写法律计算器内容")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalCalContent lawLegalCalContent) {
if (lawLegalCalContentService.updateById(lawLegalCalContent)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除用户填写法律计算器内容")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalCalContentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加用户填写法律计算器内容")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalCalContent> list) {
if (lawLegalCalContentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改用户填写法律计算器内容")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalCalContent> batchParam) {
if (batchParam.update(lawLegalCalContentService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除用户填写法律计算器内容")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalCalContentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,114 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalCalTypeService;
import com.gxwebsoft.law.entity.LawLegalCalType;
import com.gxwebsoft.law.param.LawLegalCalTypeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 法律计算器配置控制器
*
* @author LX
* @since 2025-04-17 19:23:47
*/
@Api(tags = "法律计算器配置管理")
@RestController
@RequestMapping("/api/law/law-legal-cal-type")
public class LawLegalCalTypeController extends BaseController {
@Resource
private LawLegalCalTypeService lawLegalCalTypeService;
@ApiOperation("分页查询法律计算器配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalCalType>> page(LawLegalCalTypeParam param) {
// 使用关联查询
return success(lawLegalCalTypeService.pageRel(param));
}
@ApiOperation("查询全部法律计算器配置")
@GetMapping()
public ApiResult<List<LawLegalCalType>> list(LawLegalCalTypeParam param) {
// 使用关联查询
return success(lawLegalCalTypeService.listRel(param));
}
@ApiOperation("根据id查询法律计算器配置")
@GetMapping("/{id}")
public ApiResult<LawLegalCalType> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalCalTypeService.getByIdRel(id));
}
@ApiOperation("添加法律计算器配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalCalType lawLegalCalType) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalCalType.setUserId(loginUser.getUserId());
}
if (lawLegalCalTypeService.save(lawLegalCalType)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律计算器配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalCalType lawLegalCalType) {
if (lawLegalCalTypeService.updateById(lawLegalCalType)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律计算器配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalCalTypeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律计算器配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalCalType> list) {
if (lawLegalCalTypeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律计算器配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalCalType> batchParam) {
if (batchParam.update(lawLegalCalTypeService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律计算器配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalCalTypeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,203 +0,0 @@
package com.gxwebsoft.law.controller;
import cn.hutool.core.date.DateUtil;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalDocConfigService;
import com.gxwebsoft.law.entity.LawLegalDocConfig;
import com.gxwebsoft.law.param.LawLegalDocConfigParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.mail.Authenticator;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
/**
* 法律文书配置控制器
*
* @author LX
* @since 2025-04-17 19:06:41
*/
@Api(tags = "法律文书配置管理")
@RestController
@RequestMapping("/api/law/law-legal-doc-config")
public class LawLegalDocConfigController extends BaseController {
@Resource
private LawLegalDocConfigService lawLegalDocConfigService;
@Value("${config.upload-path}")
private String uploadPath;
@Autowired
private JavaMailSender javaMailSender;
@ApiOperation("分页查询法律文书配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalDocConfig>> page(LawLegalDocConfigParam param) {
// 使用关联查询
return success(lawLegalDocConfigService.pageRel(param));
}
@ApiOperation("查询全部法律文书配置")
@GetMapping()
public ApiResult<List<LawLegalDocConfig>> list(LawLegalDocConfigParam param) {
// 使用关联查询
return success(lawLegalDocConfigService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalDocConfig:list')")
@ApiOperation("根据id查询法律文书配置")
@GetMapping("/{id}")
public ApiResult<LawLegalDocConfig> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalDocConfigService.getByIdRel(id));
}
@ApiOperation("添加法律文书配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalDocConfig lawLegalDocConfig) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalDocConfig.setUserId(loginUser.getUserId());
}
if (lawLegalDocConfigService.save(lawLegalDocConfig)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律文书配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalDocConfig lawLegalDocConfig) {
if (lawLegalDocConfigService.updateById(lawLegalDocConfig)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律文书配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalDocConfigService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律文书配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalDocConfig> list) {
if (lawLegalDocConfigService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律文书配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalDocConfig> batchParam) {
if (batchParam.update(lawLegalDocConfigService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律文书配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalDocConfigService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@PostMapping("/make")
public ApiResult<?> makeDoc(@RequestBody LawLegalDocConfig lawLegalDocConfig) throws IOException {
String filePath = "/file/doc/" + lawLegalDocConfig.getTitle() + DateUtil.currentSeconds() + ".docx";
String levelOutputPath = uploadPath + filePath;
String userContent = lawLegalDocConfig.getUserContent();
XWPFDocument doc = new XWPFDocument();
XWPFParagraph paragraph = doc.createParagraph();
XWPFRun run = paragraph.createRun();
paragraph.setAlignment(ParagraphAlignment.CENTER);
run.setText(lawLegalDocConfig.getTitle());
run.setFontSize(16);
run.setBold(true);
run.addCarriageReturn();
XWPFParagraph newParagraph = doc.createParagraph();
XWPFRun newRun = newParagraph.createRun();
String[] userContentArray = userContent.split("\n");
run.setFontSize(14);
for (String item : userContentArray) {
newRun.setText(item);
newRun.addCarriageReturn();
}
FileOutputStream fos = new FileOutputStream(levelOutputPath);
doc.write(fos);
fos.flush();
fos.close();
return success("生成成功", filePath);
}
@PostMapping("/send-email")
public ApiResult<?> sendEmail(@RequestBody LawLegalDocConfig lawLegalDocConfig) throws IOException, MessagingException {
Properties properties = new Properties();// 创建Properties对象
properties.setProperty("mail.transport.protocol", "smtp");
properties.put("mail.smtp.host", "smtp.qq.com");
properties.setProperty("mail.smtp.auth", "true");
String from = "517289602@qq.com";
Authenticator auth = new MailAuthenticator(from, "fhvgbekxmxrxcaec");
Session session = Session.getDefaultInstance(properties, auth);
MimeMessage mimeMessage = new MimeMessage(session);
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
helper.setFrom(new InternetAddress(from));
helper.setTo(lawLegalDocConfig.getEmail());
helper.setSubject(lawLegalDocConfig.getTitle());
helper.setText("请注意查收");
File file = new File(uploadPath + lawLegalDocConfig.getFile());
helper.addAttachment(lawLegalDocConfig.getTitle(), file);
javaMailSender.send(mimeMessage);
return success("发送成功");
}
static class MailAuthenticator extends Authenticator {
private final String user;
private final String pwd;
public MailAuthenticator(String user, String pwd) {
this.user = user;
this.pwd = pwd;
}
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user, pwd);
}
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalDocContentService;
import com.gxwebsoft.law.entity.LawLegalDocContent;
import com.gxwebsoft.law.param.LawLegalDocContentParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户填写法律文书内容控制器
*
* @author LX
* @since 2025-04-17 19:06:41
*/
@Api(tags = "用户填写法律文书内容管理")
@RestController
@RequestMapping("/api/law/law-legal-doc-content")
public class LawLegalDocContentController extends BaseController {
@Resource
private LawLegalDocContentService lawLegalDocContentService;
@ApiOperation("分页查询用户填写法律文书内容")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalDocContent>> page(LawLegalDocContentParam param) {
// 使用关联查询
return success(lawLegalDocContentService.pageRel(param));
}
@ApiOperation("查询全部用户填写法律文书内容")
@GetMapping()
public ApiResult<List<LawLegalDocContent>> list(LawLegalDocContentParam param) {
// 使用关联查询
return success(lawLegalDocContentService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalDocContent:list')")
@ApiOperation("根据id查询用户填写法律文书内容")
@GetMapping("/{id}")
public ApiResult<LawLegalDocContent> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalDocContentService.getByIdRel(id));
}
@ApiOperation("添加用户填写法律文书内容")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalDocContent lawLegalDocContent) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalDocContent.setUserId(loginUser.getUserId());
}
if (lawLegalDocContentService.save(lawLegalDocContent)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改用户填写法律文书内容")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalDocContent lawLegalDocContent) {
if (lawLegalDocContentService.updateById(lawLegalDocContent)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除用户填写法律文书内容")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalDocContentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加用户填写法律文书内容")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalDocContent> list) {
if (lawLegalDocContentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改用户填写法律文书内容")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalDocContent> batchParam) {
if (batchParam.update(lawLegalDocContentService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除用户填写法律文书内容")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalDocContentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,114 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalDocTypeService;
import com.gxwebsoft.law.entity.LawLegalDocType;
import com.gxwebsoft.law.param.LawLegalDocTypeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 法律文书配置控制器
*
* @author LX
* @since 2025-04-17 19:06:41
*/
@Api(tags = "法律文书配置管理")
@RestController
@RequestMapping("/api/law/law-legal-doc-type")
public class LawLegalDocTypeController extends BaseController {
@Resource
private LawLegalDocTypeService lawLegalDocTypeService;
@ApiOperation("分页查询法律文书配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalDocType>> page(LawLegalDocTypeParam param) {
// 使用关联查询
return success(lawLegalDocTypeService.pageRel(param));
}
@ApiOperation("查询全部法律文书配置")
@GetMapping()
public ApiResult<List<LawLegalDocType>> list(LawLegalDocTypeParam param) {
// 使用关联查询
return success(lawLegalDocTypeService.listRel(param));
}
@ApiOperation("根据id查询法律文书配置")
@GetMapping("/{id}")
public ApiResult<LawLegalDocType> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalDocTypeService.getByIdRel(id));
}
@ApiOperation("添加法律文书配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalDocType lawLegalDocType) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalDocType.setUserId(loginUser.getUserId());
}
if (lawLegalDocTypeService.save(lawLegalDocType)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律文书配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalDocType lawLegalDocType) {
if (lawLegalDocTypeService.updateById(lawLegalDocType)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律文书配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalDocTypeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律文书配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalDocType> list) {
if (lawLegalDocTypeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律文书配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalDocType> batchParam) {
if (batchParam.update(lawLegalDocTypeService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律文书配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalDocTypeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckConfigService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckConfig;
import com.gxwebsoft.law.param.LawLegalOrgCheckConfigParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 企业法制体检配置控制器
*
* @author LX
* @since 2025-04-17 17:51:15
*/
@Api(tags = "企业法制体检配置管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-config")
public class LawLegalOrgCheckConfigController extends BaseController {
@Resource
private LawLegalOrgCheckConfigService lawLegalOrgCheckConfigService;
@ApiOperation("分页查询企业法制体检配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckConfig>> page(LawLegalOrgCheckConfigParam param) {
// 使用关联查询
return success(lawLegalOrgCheckConfigService.pageRel(param));
}
@ApiOperation("查询全部企业法制体检配置")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckConfig>> list(LawLegalOrgCheckConfigParam param) {
// 使用关联查询
return success(lawLegalOrgCheckConfigService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalOrgCheckConfig:list')")
@ApiOperation("根据id查询企业法制体检配置")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckConfig> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckConfigService.getByIdRel(id));
}
@ApiOperation("添加企业法制体检配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckConfig lawLegalOrgCheckConfig) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckConfig.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckConfigService.save(lawLegalOrgCheckConfig)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改企业法制体检配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalOrgCheckConfig lawLegalOrgCheckConfig) {
if (lawLegalOrgCheckConfigService.updateById(lawLegalOrgCheckConfig)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除企业法制体检配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckConfigService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加企业法制体检配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckConfig> list) {
if (lawLegalOrgCheckConfigService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改企业法制体检配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckConfig> batchParam) {
if (batchParam.update(lawLegalOrgCheckConfigService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除企业法制体检配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckConfigService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,122 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckConfigSuggestService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckConfigSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckConfigSuggestParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 法律意见书配置控制器
*
* @author LX
* @since 2025-04-17 18:55:31
*/
@Api(tags = "法律意见书配置管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-config-suggest")
public class LawLegalOrgCheckConfigSuggestController extends BaseController {
@Resource
private LawLegalOrgCheckConfigSuggestService lawLegalOrgCheckConfigSuggestService;
@ApiOperation("分页查询法律意见书配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckConfigSuggest>> page(LawLegalOrgCheckConfigSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckConfigSuggestService.pageRel(param));
}
@ApiOperation("查询全部法律意见书配置")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckConfigSuggest>> list(LawLegalOrgCheckConfigSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckConfigSuggestService.listRel(param));
}
@ApiOperation("树形")
@GetMapping("/tree")
public ApiResult<List<LawLegalOrgCheckConfigSuggest>> tree(LawLegalOrgCheckConfigSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckConfigSuggestService.listByLevel(param));
}
@PreAuthorize("hasAuthority('law:lawLegalOrgCheckConfigSuggest:list')")
@ApiOperation("根据id查询法律意见书配置")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckConfigSuggest> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckConfigSuggestService.getByIdRel(id));
}
@ApiOperation("添加法律意见书配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckConfigSuggest lawLegalOrgCheckConfigSuggest) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckConfigSuggest.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckConfigSuggestService.save(lawLegalOrgCheckConfigSuggest)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律意见书配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalOrgCheckConfigSuggest lawLegalOrgCheckConfigSuggest) {
if (lawLegalOrgCheckConfigSuggestService.updateById(lawLegalOrgCheckConfigSuggest)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律意见书配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckConfigSuggestService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律意见书配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckConfigSuggest> list) {
if (lawLegalOrgCheckConfigSuggestService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律意见书配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckConfigSuggest> batchParam) {
if (batchParam.update(lawLegalOrgCheckConfigSuggestService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律意见书配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckConfigSuggestService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,118 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckContentService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckContent;
import com.gxwebsoft.law.param.LawLegalOrgCheckContentParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户填写企业法制体检内容控制器
*
* @author LX
* @since 2025-04-17 17:48:54
*/
@Api(tags = "用户填写企业法制体检内容管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-content")
public class LawLegalOrgCheckContentController extends BaseController {
@Resource
private LawLegalOrgCheckContentService lawLegalOrgCheckContentService;
@ApiOperation("分页查询用户填写企业法制体检内容")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckContent>> page(LawLegalOrgCheckContentParam param) {
// 使用关联查询
return success(lawLegalOrgCheckContentService.pageRel(param));
}
@ApiOperation("查询全部用户填写企业法制体检内容")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckContent>> list(LawLegalOrgCheckContentParam param) {
// 使用关联查询
User loginUser = getLoginUser();
if (loginUser != null) {
param.setUserId(loginUser.getUserId());
}
return success(lawLegalOrgCheckContentService.listRel(param));
}
@ApiOperation("根据id查询用户填写企业法制体检内容")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckContent> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckContentService.getByIdRel(id));
}
@ApiOperation("添加用户填写企业法制体检内容")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckContent lawLegalOrgCheckContent) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckContent.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckContentService.save(lawLegalOrgCheckContent)) {
return success("添加成功", lawLegalOrgCheckContent.getId());
}
return fail("添加失败");
}
@ApiOperation("修改用户填写企业法制体检内容")
@PostMapping("/update")
public ApiResult<?> update(@RequestBody LawLegalOrgCheckContent lawLegalOrgCheckContent) {
if (lawLegalOrgCheckContentService.updateById(lawLegalOrgCheckContent)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除用户填写企业法制体检内容")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckContentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加用户填写企业法制体检内容")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckContent> list) {
if (lawLegalOrgCheckContentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改用户填写企业法制体检内容")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckContent> batchParam) {
if (batchParam.update(lawLegalOrgCheckContentService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除用户填写企业法制体检内容")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckContentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,114 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckContentSuggestService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckContentSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckContentSuggestParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户填写法律意见书内容控制器
*
* @author LX
* @since 2025-04-17 18:55:31
*/
@Api(tags = "用户填写法律意见书内容管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-content-suggest")
public class LawLegalOrgCheckContentSuggestController extends BaseController {
@Resource
private LawLegalOrgCheckContentSuggestService lawLegalOrgCheckContentSuggestService;
@ApiOperation("分页查询用户填写法律意见书内容")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckContentSuggest>> page(LawLegalOrgCheckContentSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckContentSuggestService.pageRel(param));
}
@ApiOperation("查询全部用户填写法律意见书内容")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckContentSuggest>> list(LawLegalOrgCheckContentSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckContentSuggestService.listRel(param));
}
@ApiOperation("根据id查询用户填写法律意见书内容")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckContentSuggest> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckContentSuggestService.getByIdRel(id));
}
@ApiOperation("添加用户填写法律意见书内容")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckContentSuggest lawLegalOrgCheckContentSuggest) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckContentSuggest.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckContentSuggestService.save(lawLegalOrgCheckContentSuggest)) {
return success("添加成功", lawLegalOrgCheckContentSuggest.getId());
}
return fail("添加失败");
}
@ApiOperation("修改用户填写法律意见书内容")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalOrgCheckContentSuggest lawLegalOrgCheckContentSuggest) {
if (lawLegalOrgCheckContentSuggestService.updateById(lawLegalOrgCheckContentSuggest)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除用户填写法律意见书内容")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckContentSuggestService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加用户填写法律意见书内容")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckContentSuggest> list) {
if (lawLegalOrgCheckContentSuggestService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改用户填写法律意见书内容")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckContentSuggest> batchParam) {
if (batchParam.update(lawLegalOrgCheckContentSuggestService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除用户填写法律意见书内容")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckContentSuggestService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,114 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckTypeService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckType;
import com.gxwebsoft.law.param.LawLegalOrgCheckTypeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 企业法制体检配置控制器
*
* @author LX
* @since 2025-04-17 18:04:46
*/
@Api(tags = "企业法制体检配置管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-type")
public class LawLegalOrgCheckTypeController extends BaseController {
@Resource
private LawLegalOrgCheckTypeService lawLegalOrgCheckTypeService;
@ApiOperation("分页查询企业法制体检配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckType>> page(LawLegalOrgCheckTypeParam param) {
// 使用关联查询
return success(lawLegalOrgCheckTypeService.pageRel(param));
}
@ApiOperation("查询全部企业法制体检配置")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckType>> list(LawLegalOrgCheckTypeParam param) {
// 使用关联查询
return success(lawLegalOrgCheckTypeService.listRel(param));
}
@ApiOperation("根据id查询企业法制体检配置")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckType> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckTypeService.getByIdRel(id));
}
@ApiOperation("添加企业法制体检配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckType lawLegalOrgCheckType) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckType.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckTypeService.save(lawLegalOrgCheckType)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改企业法制体检配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalOrgCheckType lawLegalOrgCheckType) {
if (lawLegalOrgCheckTypeService.updateById(lawLegalOrgCheckType)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除企业法制体检配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckTypeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加企业法制体检配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckType> list) {
if (lawLegalOrgCheckTypeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改企业法制体检配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckType> batchParam) {
if (batchParam.update(lawLegalOrgCheckTypeService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除企业法制体检配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckTypeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,114 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawLegalOrgCheckTypeSuggestService;
import com.gxwebsoft.law.entity.LawLegalOrgCheckTypeSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckTypeSuggestParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 法律意见书配置控制器
*
* @author LX
* @since 2025-04-17 18:55:31
*/
@Api(tags = "法律意见书配置管理")
@RestController
@RequestMapping("/api/law/law-legal-org-check-type-suggest")
public class LawLegalOrgCheckTypeSuggestController extends BaseController {
@Resource
private LawLegalOrgCheckTypeSuggestService lawLegalOrgCheckTypeSuggestService;
@ApiOperation("分页查询法律意见书配置")
@GetMapping("/page")
public ApiResult<PageResult<LawLegalOrgCheckTypeSuggest>> page(LawLegalOrgCheckTypeSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckTypeSuggestService.pageRel(param));
}
@ApiOperation("查询全部法律意见书配置")
@GetMapping()
public ApiResult<List<LawLegalOrgCheckTypeSuggest>> list(LawLegalOrgCheckTypeSuggestParam param) {
// 使用关联查询
return success(lawLegalOrgCheckTypeSuggestService.listRel(param));
}
@ApiOperation("根据id查询法律意见书配置")
@GetMapping("/{id}")
public ApiResult<LawLegalOrgCheckTypeSuggest> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawLegalOrgCheckTypeSuggestService.getByIdRel(id));
}
@ApiOperation("添加法律意见书配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawLegalOrgCheckTypeSuggest lawLegalOrgCheckTypeSuggest) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawLegalOrgCheckTypeSuggest.setUserId(loginUser.getUserId());
}
if (lawLegalOrgCheckTypeSuggestService.save(lawLegalOrgCheckTypeSuggest)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改法律意见书配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawLegalOrgCheckTypeSuggest lawLegalOrgCheckTypeSuggest) {
if (lawLegalOrgCheckTypeSuggestService.updateById(lawLegalOrgCheckTypeSuggest)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除法律意见书配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawLegalOrgCheckTypeSuggestService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加法律意见书配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawLegalOrgCheckTypeSuggest> list) {
if (lawLegalOrgCheckTypeSuggestService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改法律意见书配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawLegalOrgCheckTypeSuggest> batchParam) {
if (batchParam.update(lawLegalOrgCheckTypeSuggestService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除法律意见书配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawLegalOrgCheckTypeSuggestService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawNotaryConfigService;
import com.gxwebsoft.law.entity.LawNotaryConfig;
import com.gxwebsoft.law.param.LawNotaryConfigParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 公证配置控制器
*
* @author LX
* @since 2025-05-17 16:10:35
*/
@Api(tags = "公证配置管理")
@RestController
@RequestMapping("/api/law/law-notary-config")
public class LawNotaryConfigController extends BaseController {
@Resource
private LawNotaryConfigService lawNotaryConfigService;
@ApiOperation("分页查询公证配置")
@GetMapping("/page")
public ApiResult<PageResult<LawNotaryConfig>> page(LawNotaryConfigParam param) {
// 使用关联查询
return success(lawNotaryConfigService.pageRel(param));
}
@ApiOperation("查询全部公证配置")
@GetMapping()
public ApiResult<List<LawNotaryConfig>> list(LawNotaryConfigParam param) {
// 使用关联查询
return success(lawNotaryConfigService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawNotaryConfig:list')")
@ApiOperation("根据id查询公证配置")
@GetMapping("/{id}")
public ApiResult<LawNotaryConfig> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawNotaryConfigService.getByIdRel(id));
}
@ApiOperation("添加公证配置")
@PostMapping()
public ApiResult<?> save(@RequestBody LawNotaryConfig lawNotaryConfig) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawNotaryConfig.setUserId(loginUser.getUserId());
}
if (lawNotaryConfigService.save(lawNotaryConfig)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改公证配置")
@PutMapping()
public ApiResult<?> update(@RequestBody LawNotaryConfig lawNotaryConfig) {
if (lawNotaryConfigService.updateById(lawNotaryConfig)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除公证配置")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawNotaryConfigService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加公证配置")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawNotaryConfig> list) {
if (lawNotaryConfigService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改公证配置")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawNotaryConfig> batchParam) {
if (batchParam.update(lawNotaryConfigService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除公证配置")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawNotaryConfigService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawNotaryListService;
import com.gxwebsoft.law.entity.LawNotaryList;
import com.gxwebsoft.law.param.LawNotaryListParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 公证列表控制器
*
* @author LX
* @since 2025-05-17 16:10:35
*/
@Api(tags = "公证列表管理")
@RestController
@RequestMapping("/api/law/law-notary-list")
public class LawNotaryListController extends BaseController {
@Resource
private LawNotaryListService lawNotaryListService;
@ApiOperation("分页查询公证列表")
@GetMapping("/page")
public ApiResult<PageResult<LawNotaryList>> page(LawNotaryListParam param) {
// 使用关联查询
return success(lawNotaryListService.pageRel(param));
}
@ApiOperation("查询全部公证列表")
@GetMapping()
public ApiResult<List<LawNotaryList>> list(LawNotaryListParam param) {
// 使用关联查询
return success(lawNotaryListService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawNotaryList:list')")
@ApiOperation("根据id查询公证列表")
@GetMapping("/{id}")
public ApiResult<LawNotaryList> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawNotaryListService.getByIdRel(id));
}
@ApiOperation("添加公证列表")
@PostMapping()
public ApiResult<?> save(@RequestBody LawNotaryList lawNotaryList) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawNotaryList.setUserId(loginUser.getUserId());
}
if (lawNotaryListService.save(lawNotaryList)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改公证列表")
@PutMapping()
public ApiResult<?> update(@RequestBody LawNotaryList lawNotaryList) {
if (lawNotaryListService.updateById(lawNotaryList)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除公证列表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawNotaryListService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加公证列表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawNotaryList> list) {
if (lawNotaryListService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改公证列表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawNotaryList> batchParam) {
if (batchParam.update(lawNotaryListService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除公证列表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawNotaryListService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,115 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawOrgCheckLogService;
import com.gxwebsoft.law.entity.LawOrgCheckLog;
import com.gxwebsoft.law.param.LawOrgCheckLogParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 企业法制检查报告控制器
*
* @author LX
* @since 2025-04-20 07:43:09
*/
@Api(tags = "企业法制检查报告管理")
@RestController
@RequestMapping("/api/law/law-org-check-log")
public class LawOrgCheckLogController extends BaseController {
@Resource
private LawOrgCheckLogService lawOrgCheckLogService;
@ApiOperation("分页查询企业法制检查报告")
@GetMapping("/page")
public ApiResult<PageResult<LawOrgCheckLog>> page(LawOrgCheckLogParam param) {
// 使用关联查询
return success(lawOrgCheckLogService.pageRel(param));
}
@ApiOperation("查询全部企业法制检查报告")
@GetMapping()
public ApiResult<List<LawOrgCheckLog>> list(LawOrgCheckLogParam param) {
// 使用关联查询
return success(lawOrgCheckLogService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawOrgCheckLog:list')")
@ApiOperation("根据id查询企业法制检查报告")
@GetMapping("/{id}")
public ApiResult<LawOrgCheckLog> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawOrgCheckLogService.getByIdRel(id));
}
@ApiOperation("添加企业法制检查报告")
@PostMapping()
public ApiResult<?> save(@RequestBody LawOrgCheckLog lawOrgCheckLog) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawOrgCheckLog.setUserId(loginUser.getUserId());
}
if (lawOrgCheckLogService.save(lawOrgCheckLog)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改企业法制检查报告")
@PutMapping()
public ApiResult<?> update(@RequestBody LawOrgCheckLog lawOrgCheckLog) {
if (lawOrgCheckLogService.updateById(lawOrgCheckLog)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除企业法制检查报告")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawOrgCheckLogService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加企业法制检查报告")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawOrgCheckLog> list) {
if (lawOrgCheckLogService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改企业法制检查报告")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawOrgCheckLog> batchParam) {
if (batchParam.update(lawOrgCheckLogService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除企业法制检查报告")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawOrgCheckLogService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,150 +0,0 @@
package com.gxwebsoft.law.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.Area;
import com.gxwebsoft.common.system.service.AreaService;
import com.gxwebsoft.law.service.LawOrgService;
import com.gxwebsoft.law.entity.LawOrg;
import com.gxwebsoft.law.param.LawOrgParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 机构控制器
*
* @author LX
* @since 2025-04-14 00:35:34
*/
@Api(tags = "机构管理")
@RestController
@RequestMapping("/api/law/law-org")
public class LawOrgController extends BaseController {
@Resource
private LawOrgService lawOrgService;
@Resource
private AreaService areaService;
@ApiOperation("分页查询机构")
@GetMapping("/page")
public ApiResult<PageResult<LawOrg>> page(LawOrgParam param) {
// 使用关联查询
return success(lawOrgService.pageRel(param));
}
@ApiOperation("查询全部机构")
@GetMapping()
public ApiResult<List<LawOrg>> list(LawOrgParam param) {
// 使用关联查询
return success(lawOrgService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawOrg:list')")
@ApiOperation("根据id查询机构")
@GetMapping("/{id}")
public ApiResult<LawOrg> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawOrgService.getByIdRel(id));
}
@ApiOperation("添加机构")
@PostMapping()
public ApiResult<?> save(@RequestBody LawOrg lawOrg) {
if (lawOrg.getProvince() != null) {
Area province = areaService.getProvinceByName(lawOrg.getProvince());
if (province != null) {
lawOrg.setProvinceId(province.getId());
}
}
if (lawOrg.getCity() != null) {
Area city = areaService.getCityByName(lawOrg.getCity());
if (city != null) {
lawOrg.setCityId(city.getId());
}
}
if (lawOrg.getRegion() != null) {
Area region = areaService.getRegionByName(lawOrg.getRegion());
if (region != null) {
lawOrg.setAreaId(region.getId());
}
}
if (lawOrgService.save(lawOrg)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改机构")
@PutMapping()
public ApiResult<?> update(@RequestBody LawOrg lawOrg) {
if (lawOrg.getProvince() != null) {
Area province = areaService.getProvinceByName(lawOrg.getProvince());
if (province != null) {
lawOrg.setProvinceId(province.getId());
}
if (lawOrg.getCity() != null) {
Area city = areaService.getCityByName(lawOrg.getCity());
if (city != null) {
lawOrg.setCityId(city.getId());
}
if (lawOrg.getRegion() != null) {
Area region = areaService.getRegionByName(lawOrg.getRegion());
if (region != null) {
lawOrg.setAreaId(region.getId());
}
}
}
}
if (lawOrgService.updateById(lawOrg)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除机构")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawOrgService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加机构")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawOrg> list) {
if (lawOrgService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改机构")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawOrg> batchParam) {
if (batchParam.update(lawOrgService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除机构")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawOrgService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,50 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* 机构
*
* @author LX
* @since 2025-04-14 00:35:34
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrg对象", description = "机构")
@TableName("law_org")
public class ChatMessage implements Serializable {
private static final long serialVersionUID = 1L;
@TableField(exist = false)
private String query;
@TableField(exist = false)
private String inputs;
@TableField(exist = false)
private String responseMode;
@TableField(exist = false)
private String user;
@TableField(exist = false)
private String conversationId;
@TableField(exist = false)
private String type;
@TableField(exist = false)
private Integer requestType;
@TableField(exist = false)
private Map<String, Object> files;
}
@@ -1,66 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Map;
/**
* 机构
*
* @author LX
* @since 2025-04-14 00:35:34
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrg对象", description = "机构")
@TableName("law_org")
public class ChatResponse implements Serializable {
private String event;
private String conversation_id;
private String message_id;
private long created_at;
private String task_id;
private String workflow_run_id;
private String id;
private String answer;
private ChatResponse.Metadata metadata;
private ChatResponse.Data data;
private Object[] files;
public static class Data {
private Usage usage;
}
public static class Metadata {
private String id;
private String node_id;
private String node_type;
private String title;
private String index;
private String predecessor_node_id;
private String inputs;
private String created_at;
private String extras;
}
public static class Usage {
private int prompt_tokens;
private String prompt_unit_price;
private String prompt_price_unit;
private String prompt_price;
private int completion_tokens;
private String completion_unit_price;
private String completion_price_unit;
private String completion_price;
private int total_tokens;
private String total_price;
private String currency;
private double latency;
}
}
@@ -1,59 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author LX
* @since 2025-05-06 10:27:16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawFeedback对象", description = "")
@TableName("law_feedback")
public class LawFeedback implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer userId;
private String title;
private String company;
private String address;
private String date;
private String pics;
private String video;
private String content;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,77 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 司法鉴定申请
*
* @author LX
* @since 2025-05-06 17:11:41
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalAppraisal对象", description = "司法鉴定申请")
@TableName("law_legal_appraisal")
public class LawLegalAppraisal implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer userId;
private String name;
private Integer gender;
private Integer isNew;
private String phone;
private String birthday;
private String idCard;
private String fileList;
private String standard;
private String application;
@ApiModelProperty(value = "住所地址")
private String liveAddress;
@ApiModelProperty(value = "户籍地址")
private String householdAddress;
private Integer orgId;
@ApiModelProperty(value = "说明")
private String content;
@ApiModelProperty(value = "详情")
private String detail;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private LawOrg lawOrg;
}
@@ -1,87 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律仲裁申请
*
* @author LX
* @since 2025-05-06 15:56:26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalArbitrate对象", description = "法律仲裁申请")
@TableName("law_legal_arbitrate")
public class LawLegalArbitrate implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer userId;
private String name;
private Integer gender;
private String phone;
private String birthday;
private String idCard;
private String nation;
@ApiModelProperty(value = "住所地址")
private String liveAddress;
@ApiModelProperty(value = "户籍地址")
private String householdAddress;
@ApiModelProperty(value = "事实和理由")
private String content;
@ApiModelProperty(value = "仲裁请求")
private String requestContent;
@ApiModelProperty(value = "被申请人")
private String beenName;
@ApiModelProperty(value = "被申请人地址")
private String beenAddress;
@ApiModelProperty(value = "被申请人代码")
private String beenCode;
@ApiModelProperty(value = "被申请人联系方式")
private String beenPhone;
@ApiModelProperty(value = "法定代表人")
private String beenLegalName;
@ApiModelProperty(value = "职位")
private String beenLegalPosition;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,55 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律计算器配置
*
* @author LX
* @since 2025-04-17 19:23:47
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalCalConfig对象", description = "法律计算器配置")
@TableName("law_legal_cal_config")
public class LawLegalCalConfig implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer typeId;
private String title;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "内容")
private String answer;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,49 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写法律计算器内容
*
* @author LX
* @since 2025-04-17 19:23:47
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalCalContent对象", description = "用户填写法律计算器内容")
@TableName("law_legal_cal_content")
public class LawLegalCalContent implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer groupId;
private String content;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,61 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律文书配置
*
* @author LX
* @since 2025-04-17 19:06:41
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalDocConfig对象", description = "法律文书配置")
@TableName("law_legal_doc_config")
public class LawLegalDocConfig implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer typeId;
private String title;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "内容")
private String answer;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private String userContent;
@TableField(exist = false)
private String email;
@TableField(exist = false)
private String file;
}
@@ -1,49 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写法律文书内容
*
* @author LX
* @since 2025-04-17 19:06:41
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalDocContent对象", description = "用户填写法律文书内容")
@TableName("law_legal_doc_content")
public class LawLegalDocContent implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer groupId;
private String content;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,55 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 企业法制体检配置
*
* @author LX
* @since 2025-04-17 17:51:15
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalOrgCheckConfig对象", description = "企业法制体检配置")
@TableName("law_legal_org_check_config")
public class LawLegalOrgCheckConfig implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer typeId;
private String title;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "内容")
private String answer;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,60 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律意见书配置
*
* @author LX
* @since 2025-04-17 18:55:31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalOrgCheckConfigSuggest对象", description = "法律意见书配置")
@TableName("law_legal_org_check_config_suggest")
public class LawLegalOrgCheckConfigSuggest implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer typeId;
private Integer parentId;
private String title;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "内容")
private String answer;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private List<LawLegalOrgCheckConfigSuggest> children;
}
@@ -1,53 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写法律意见书内容
*
* @author LX
* @since 2025-04-17 18:55:31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalOrgCheckContentSuggest对象", description = "用户填写法律意见书内容")
@TableName("law_legal_org_check_content_suggest")
public class LawLegalOrgCheckContentSuggest implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer groupId;
private String content;
private String aiContent;
private String title;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,69 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 公证列表
*
* @author LX
* @since 2025-05-17 16:10:35
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawNotaryList对象", description = "公证列表")
@TableName("law_notary_list")
public class LawNotaryList implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer uid;
private String nameList;
private String type;
@ApiModelProperty(value = "公证事项")
private String content;
@ApiModelProperty(value = "用途")
private String application;
@ApiModelProperty(value = "使用地")
private String address;
@ApiModelProperty(value = "译文")
private String translate;
@ApiModelProperty(value = "文件列表")
private String fileList;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private User user;
}
@@ -1,61 +0,0 @@
package com.gxwebsoft.law.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 企业法制检查报告
*
* @author LX
* @since 2025-04-20 07:43:09
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrgCheckLog对象", description = "企业法制检查报告")
@TableName("law_org_check_log")
public class LawOrgCheckLog implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String companyName;
@ApiModelProperty(value = "来访单位")
private String checkCompanyName;
private String checkDate;
private String type;
@ApiModelProperty(value = "本月检查次数")
private Integer checkNum;
private String comment;
private String remark;
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawFeedback;
import com.gxwebsoft.law.param.LawFeedbackParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-05-06 10:27:16
*/
public interface LawFeedbackMapper extends BaseMapper<LawFeedback> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawFeedback>
*/
List<LawFeedback> selectPageRel(@Param("page") IPage<LawFeedback> page,
@Param("param") LawFeedbackParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawFeedback> selectListRel(@Param("param") LawFeedbackParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalAid;
import com.gxwebsoft.law.param.LawLegalAidParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律援助申请Mapper
*
* @author LX
* @since 2025-04-17 17:33:28
*/
public interface LawLegalAidMapper extends BaseMapper<LawLegalAid> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalAid>
*/
List<LawLegalAid> selectPageRel(@Param("page") IPage<LawLegalAid> page,
@Param("param") LawLegalAidParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalAid> selectListRel(@Param("param") LawLegalAidParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalAppraisal;
import com.gxwebsoft.law.param.LawLegalAppraisalParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 司法鉴定申请Mapper
*
* @author LX
* @since 2025-05-06 17:11:41
*/
public interface LawLegalAppraisalMapper extends BaseMapper<LawLegalAppraisal> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalAppraisal>
*/
List<LawLegalAppraisal> selectPageRel(@Param("page") IPage<LawLegalAppraisal> page,
@Param("param") LawLegalAppraisalParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalAppraisal> selectListRel(@Param("param") LawLegalAppraisalParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalArbitrate;
import com.gxwebsoft.law.param.LawLegalArbitrateParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律仲裁申请Mapper
*
* @author LX
* @since 2025-05-06 15:56:26
*/
public interface LawLegalArbitrateMapper extends BaseMapper<LawLegalArbitrate> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalArbitrate>
*/
List<LawLegalArbitrate> selectPageRel(@Param("page") IPage<LawLegalArbitrate> page,
@Param("param") LawLegalArbitrateParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalArbitrate> selectListRel(@Param("param") LawLegalArbitrateParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalCalConfig;
import com.gxwebsoft.law.param.LawLegalCalConfigParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律计算器配置Mapper
*
* @author LX
* @since 2025-04-17 19:23:47
*/
public interface LawLegalCalConfigMapper extends BaseMapper<LawLegalCalConfig> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalCalConfig>
*/
List<LawLegalCalConfig> selectPageRel(@Param("page") IPage<LawLegalCalConfig> page,
@Param("param") LawLegalCalConfigParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalCalConfig> selectListRel(@Param("param") LawLegalCalConfigParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalCalContent;
import com.gxwebsoft.law.param.LawLegalCalContentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户填写法律计算器内容Mapper
*
* @author LX
* @since 2025-04-17 19:23:47
*/
public interface LawLegalCalContentMapper extends BaseMapper<LawLegalCalContent> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalCalContent>
*/
List<LawLegalCalContent> selectPageRel(@Param("page") IPage<LawLegalCalContent> page,
@Param("param") LawLegalCalContentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalCalContent> selectListRel(@Param("param") LawLegalCalContentParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalCalType;
import com.gxwebsoft.law.param.LawLegalCalTypeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律计算器配置Mapper
*
* @author LX
* @since 2025-04-17 19:23:47
*/
public interface LawLegalCalTypeMapper extends BaseMapper<LawLegalCalType> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalCalType>
*/
List<LawLegalCalType> selectPageRel(@Param("page") IPage<LawLegalCalType> page,
@Param("param") LawLegalCalTypeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalCalType> selectListRel(@Param("param") LawLegalCalTypeParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalDocConfig;
import com.gxwebsoft.law.param.LawLegalDocConfigParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律文书配置Mapper
*
* @author LX
* @since 2025-04-17 19:06:41
*/
public interface LawLegalDocConfigMapper extends BaseMapper<LawLegalDocConfig> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalDocConfig>
*/
List<LawLegalDocConfig> selectPageRel(@Param("page") IPage<LawLegalDocConfig> page,
@Param("param") LawLegalDocConfigParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalDocConfig> selectListRel(@Param("param") LawLegalDocConfigParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalDocContent;
import com.gxwebsoft.law.param.LawLegalDocContentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户填写法律文书内容Mapper
*
* @author LX
* @since 2025-04-17 19:06:41
*/
public interface LawLegalDocContentMapper extends BaseMapper<LawLegalDocContent> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalDocContent>
*/
List<LawLegalDocContent> selectPageRel(@Param("page") IPage<LawLegalDocContent> page,
@Param("param") LawLegalDocContentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalDocContent> selectListRel(@Param("param") LawLegalDocContentParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalDocType;
import com.gxwebsoft.law.param.LawLegalDocTypeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律文书配置Mapper
*
* @author LX
* @since 2025-04-17 19:06:41
*/
public interface LawLegalDocTypeMapper extends BaseMapper<LawLegalDocType> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalDocType>
*/
List<LawLegalDocType> selectPageRel(@Param("page") IPage<LawLegalDocType> page,
@Param("param") LawLegalDocTypeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalDocType> selectListRel(@Param("param") LawLegalDocTypeParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckConfig;
import com.gxwebsoft.law.param.LawLegalOrgCheckConfigParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 企业法制体检配置Mapper
*
* @author LX
* @since 2025-04-17 17:51:15
*/
public interface LawLegalOrgCheckConfigMapper extends BaseMapper<LawLegalOrgCheckConfig> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckConfig>
*/
List<LawLegalOrgCheckConfig> selectPageRel(@Param("page") IPage<LawLegalOrgCheckConfig> page,
@Param("param") LawLegalOrgCheckConfigParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckConfig> selectListRel(@Param("param") LawLegalOrgCheckConfigParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckConfigSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckConfigSuggestParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律意见书配置Mapper
*
* @author LX
* @since 2025-04-17 18:55:31
*/
public interface LawLegalOrgCheckConfigSuggestMapper extends BaseMapper<LawLegalOrgCheckConfigSuggest> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckConfigSuggest>
*/
List<LawLegalOrgCheckConfigSuggest> selectPageRel(@Param("page") IPage<LawLegalOrgCheckConfigSuggest> page,
@Param("param") LawLegalOrgCheckConfigSuggestParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckConfigSuggest> selectListRel(@Param("param") LawLegalOrgCheckConfigSuggestParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckContent;
import com.gxwebsoft.law.param.LawLegalOrgCheckContentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户填写企业法制体检内容Mapper
*
* @author LX
* @since 2025-04-17 17:48:54
*/
public interface LawLegalOrgCheckContentMapper extends BaseMapper<LawLegalOrgCheckContent> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckContent>
*/
List<LawLegalOrgCheckContent> selectPageRel(@Param("page") IPage<LawLegalOrgCheckContent> page,
@Param("param") LawLegalOrgCheckContentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckContent> selectListRel(@Param("param") LawLegalOrgCheckContentParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckContentSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckContentSuggestParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户填写法律意见书内容Mapper
*
* @author LX
* @since 2025-04-17 18:55:31
*/
public interface LawLegalOrgCheckContentSuggestMapper extends BaseMapper<LawLegalOrgCheckContentSuggest> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckContentSuggest>
*/
List<LawLegalOrgCheckContentSuggest> selectPageRel(@Param("page") IPage<LawLegalOrgCheckContentSuggest> page,
@Param("param") LawLegalOrgCheckContentSuggestParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckContentSuggest> selectListRel(@Param("param") LawLegalOrgCheckContentSuggestParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckType;
import com.gxwebsoft.law.param.LawLegalOrgCheckTypeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 企业法制体检配置Mapper
*
* @author LX
* @since 2025-04-17 18:04:46
*/
public interface LawLegalOrgCheckTypeMapper extends BaseMapper<LawLegalOrgCheckType> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckType>
*/
List<LawLegalOrgCheckType> selectPageRel(@Param("page") IPage<LawLegalOrgCheckType> page,
@Param("param") LawLegalOrgCheckTypeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckType> selectListRel(@Param("param") LawLegalOrgCheckTypeParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawLegalOrgCheckTypeSuggest;
import com.gxwebsoft.law.param.LawLegalOrgCheckTypeSuggestParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 法律意见书配置Mapper
*
* @author LX
* @since 2025-04-17 18:55:31
*/
public interface LawLegalOrgCheckTypeSuggestMapper extends BaseMapper<LawLegalOrgCheckTypeSuggest> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawLegalOrgCheckTypeSuggest>
*/
List<LawLegalOrgCheckTypeSuggest> selectPageRel(@Param("page") IPage<LawLegalOrgCheckTypeSuggest> page,
@Param("param") LawLegalOrgCheckTypeSuggestParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawLegalOrgCheckTypeSuggest> selectListRel(@Param("param") LawLegalOrgCheckTypeSuggestParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawNotaryConfig;
import com.gxwebsoft.law.param.LawNotaryConfigParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 公证配置Mapper
*
* @author LX
* @since 2025-05-17 16:10:35
*/
public interface LawNotaryConfigMapper extends BaseMapper<LawNotaryConfig> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawNotaryConfig>
*/
List<LawNotaryConfig> selectPageRel(@Param("page") IPage<LawNotaryConfig> page,
@Param("param") LawNotaryConfigParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawNotaryConfig> selectListRel(@Param("param") LawNotaryConfigParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawNotaryList;
import com.gxwebsoft.law.param.LawNotaryListParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 公证列表Mapper
*
* @author LX
* @since 2025-05-17 16:10:35
*/
public interface LawNotaryListMapper extends BaseMapper<LawNotaryList> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawNotaryList>
*/
List<LawNotaryList> selectPageRel(@Param("page") IPage<LawNotaryList> page,
@Param("param") LawNotaryListParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawNotaryList> selectListRel(@Param("param") LawNotaryListParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawOrgCheckLog;
import com.gxwebsoft.law.param.LawOrgCheckLogParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 企业法制检查报告Mapper
*
* @author LX
* @since 2025-04-20 07:43:09
*/
public interface LawOrgCheckLogMapper extends BaseMapper<LawOrgCheckLog> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawOrgCheckLog>
*/
List<LawOrgCheckLog> selectPageRel(@Param("page") IPage<LawOrgCheckLog> page,
@Param("param") LawOrgCheckLogParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawOrgCheckLog> selectListRel(@Param("param") LawOrgCheckLogParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawOrg;
import com.gxwebsoft.law.param.LawOrgParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机构Mapper
*
* @author LX
* @since 2025-04-14 00:35:34
*/
public interface LawOrgMapper extends BaseMapper<LawOrg> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawOrg>
*/
List<LawOrg> selectPageRel(@Param("page") IPage<LawOrg> page,
@Param("param") LawOrgParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawOrg> selectListRel(@Param("param") LawOrgParam param);
}
@@ -1,37 +0,0 @@
package com.gxwebsoft.law.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.law.entity.LawOrgPeople;
import com.gxwebsoft.law.param.LawOrgPeopleParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-04-14 01:31:54
*/
public interface LawOrgPeopleMapper extends BaseMapper<LawOrgPeople> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<LawOrgPeople>
*/
List<LawOrgPeople> selectPageRel(@Param("page") IPage<LawOrgPeople> page,
@Param("param") LawOrgPeopleParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<LawOrgPeople> selectListRel(@Param("param") LawOrgPeopleParam param);
}
@@ -1,66 +0,0 @@
<?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="com.gxwebsoft.law.mapper.LawFeedbackMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_feedback a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.company != null">
AND a.company LIKE CONCAT('%', #{param.company}, '%')
</if>
<if test="param.address != null">
AND a.address LIKE CONCAT('%', #{param.address}, '%')
</if>
<if test="param.date != null">
AND a.date LIKE CONCAT('%', #{param.date}, '%')
</if>
<if test="param.pics != null">
AND a.pics LIKE CONCAT('%', #{param.pics}, '%')
</if>
<if test="param.video != null">
AND a.video LIKE CONCAT('%', #{param.video}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawFeedback">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawFeedback">
<include refid="selectSql"></include>
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More