Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.jysystem.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 国密加解密配置
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "gm.crypto")
|
||||
public class GmCryptoProperties
|
||||
{
|
||||
/**
|
||||
* SM4 密钥(建议 16 字节;也可配置任意字符串,系统会派生为 16 字节密钥)
|
||||
*/
|
||||
private String sm4Key;
|
||||
|
||||
public String getSm4Key()
|
||||
{
|
||||
return sm4Key;
|
||||
}
|
||||
|
||||
public void setSm4Key(String sm4Key)
|
||||
{
|
||||
this.sm4Key = sm4Key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.ruoyi.jysystem.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 业务短信通知配置(application.yml 中 sms 节点)
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "sms")
|
||||
public class SmsProperties
|
||||
{
|
||||
/** 短信签名 */
|
||||
private String signName = "金华觉远创智科技";
|
||||
|
||||
/** 配片订单分配至镜片厂(模板变量 code=订单号) */
|
||||
private SceneConfig assignOrder = new SceneConfig();
|
||||
|
||||
/** 配片订单发货通知(模板变量 code、expressCompany、expressNo) */
|
||||
private SceneConfig shipOrder = new SceneConfig();
|
||||
|
||||
public String getSignName()
|
||||
{
|
||||
return signName;
|
||||
}
|
||||
|
||||
public void setSignName(String signName)
|
||||
{
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
public SceneConfig getAssignOrder()
|
||||
{
|
||||
return assignOrder;
|
||||
}
|
||||
|
||||
public void setAssignOrder(SceneConfig assignOrder)
|
||||
{
|
||||
this.assignOrder = assignOrder;
|
||||
}
|
||||
|
||||
public SceneConfig getShipOrder()
|
||||
{
|
||||
return shipOrder;
|
||||
}
|
||||
|
||||
public void setShipOrder(SceneConfig shipOrder)
|
||||
{
|
||||
this.shipOrder = shipOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单一场景短信配置
|
||||
*/
|
||||
public static class SceneConfig
|
||||
{
|
||||
/** 是否启用 */
|
||||
private boolean enabled = true;
|
||||
|
||||
/** 短信模板 Code */
|
||||
private String template = "";
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled)
|
||||
{
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getTemplate()
|
||||
{
|
||||
return template;
|
||||
}
|
||||
|
||||
public void setTemplate(String template)
|
||||
{
|
||||
this.template = template;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.jysystem.domain.JyUser;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/")
|
||||
public class AppController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
|
||||
JyUser jyUser = new JyUser();
|
||||
jyUser.setUserId(user.getUserId());
|
||||
jyUser.setUserName(user.getUserName());
|
||||
jyUser.setNickName(user.getNickName());
|
||||
jyUser.setAvatar(user.getAvatar());
|
||||
jyUser.setPhonenumber(user.getPhonenumber());
|
||||
jyUser.setSex(user.getSex());
|
||||
jyUser.setEmail(user.getEmail());
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put(AjaxResult.DATA_TAG, jyUser);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@Log(title = "注销账户", businessType = BusinessType.INSERT)
|
||||
@DeleteMapping("/deleteAccount")
|
||||
public AjaxResult deleteAccount() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
return toAjax(iSysUserService.deleteAccountById(user.getUserId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.ForumCategory;
|
||||
import com.ruoyi.jysystem.service.IForumCategoryService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 论坛分类Controller
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/forum/category")
|
||||
public class ForumCategoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IForumCategoryService forumCategoryService;
|
||||
|
||||
/**
|
||||
* 查询论坛分类列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ForumCategory forumCategory)
|
||||
{
|
||||
List<ForumCategory> list = forumCategoryService.selectForumCategoryList(forumCategory);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出论坛分类列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:category:export')")
|
||||
@Log(title = "论坛分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ForumCategory forumCategory)
|
||||
{
|
||||
List<ForumCategory> list = forumCategoryService.selectForumCategoryList(forumCategory);
|
||||
ExcelUtil<ForumCategory> util = new ExcelUtil<ForumCategory>(ForumCategory.class);
|
||||
util.exportExcel(response, list, "论坛分类数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取论坛分类详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(forumCategoryService.selectForumCategoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛分类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:category:add')")
|
||||
@Log(title = "论坛分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ForumCategory forumCategory)
|
||||
{
|
||||
return toAjax(forumCategoryService.insertForumCategory(forumCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛分类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:category:edit')")
|
||||
@Log(title = "论坛分类", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ForumCategory forumCategory)
|
||||
{
|
||||
return toAjax(forumCategoryService.updateForumCategory(forumCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛分类
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:category:remove')")
|
||||
@Log(title = "论坛分类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(forumCategoryService.deleteForumCategoryByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,309 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.jysystem.domain.ForumPost;
|
||||
import com.ruoyi.jysystem.mapper.ForumPostMapper;
|
||||
import com.ruoyi.jysystem.service.IForumPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 论坛帖子Controller
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/forum/post")
|
||||
public class ForumPostController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IForumPostService forumPostService;
|
||||
|
||||
@Autowired
|
||||
private ForumPostMapper forumPostMapper;
|
||||
|
||||
/**
|
||||
* 查询论坛帖子列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ForumPost forumPost)
|
||||
{
|
||||
// 如果传入了 keyword 参数,设置到 forumPost 对象中用于模糊查询
|
||||
String keyword = ServletUtils.getParameter("keyword");
|
||||
if (keyword != null && !keyword.trim().isEmpty()) {
|
||||
forumPost.setKeyword(keyword.trim());
|
||||
}
|
||||
startPage();
|
||||
List<ForumPost> list = forumPostService.selectForumPostList(forumPost);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出论坛帖子列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:post:export')")
|
||||
@Log(title = "论坛帖子", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ForumPost forumPost)
|
||||
{
|
||||
List<ForumPost> list = forumPostService.selectForumPostList(forumPost);
|
||||
ExcelUtil<ForumPost> util = new ExcelUtil<ForumPost>(ForumPost.class);
|
||||
util.exportExcel(response, list, "论坛帖子数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取论坛帖子详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(forumPostService.selectForumPostById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛帖子
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:post:add')")
|
||||
@Log(title = "论坛帖子", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ForumPost forumPost)
|
||||
{
|
||||
return toAjax(forumPostService.insertForumPost(forumPost));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛帖子
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:post:edit')")
|
||||
@Log(title = "论坛帖子", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ForumPost forumPost)
|
||||
{
|
||||
return toAjax(forumPostService.updateForumPost(forumPost));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛帖子
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:post:remove')")
|
||||
@Log(title = "论坛帖子", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(forumPostService.deleteForumPostByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加浏览量
|
||||
*/
|
||||
@PutMapping("/view/{id}")
|
||||
public AjaxResult incrementViewCount(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(forumPostService.incrementViewCount(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*/
|
||||
@PutMapping("/like/{id}")
|
||||
public AjaxResult toggleLike(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return error("用户未登录");
|
||||
}
|
||||
boolean isLiked = forumPostService.toggleLike(id, userId);
|
||||
// 获取更新后的点赞数
|
||||
ForumPost post = forumPostService.selectForumPostById(id);
|
||||
java.util.Map<String, Object> result = new java.util.HashMap<>();
|
||||
result.put("isLiked", isLiked);
|
||||
result.put("likeCount", post != null ? post.getLikeCount() : 0);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏/取消收藏
|
||||
*/
|
||||
@PutMapping("/favorite/{id}")
|
||||
public AjaxResult toggleFavorite(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return error("用户未登录");
|
||||
}
|
||||
boolean isFavorited = forumPostService.toggleFavorite(id, userId);
|
||||
// 获取更新后的收藏数
|
||||
ForumPost post = forumPostService.selectForumPostById(id);
|
||||
java.util.Map<String, Object> result = new java.util.HashMap<>();
|
||||
result.put("isFavorited", isFavorited);
|
||||
result.put("favoriteCount", post != null ? post.getFavoriteCount() : 0);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记为已解决/取消已解决
|
||||
*/
|
||||
@PutMapping("/solved/{id}")
|
||||
public AjaxResult markSolved(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return error("用户未登录");
|
||||
}
|
||||
// 检查是否是作者
|
||||
ForumPost post = forumPostService.selectForumPostById(id);
|
||||
if (post == null) {
|
||||
return error("帖子不存在");
|
||||
}
|
||||
if (post.getAuthorId() == null || !post.getAuthorId().equals(userId)) {
|
||||
return error("只有作者可以标记为已解决");
|
||||
}
|
||||
// 切换已解决状态
|
||||
forumPostService.markSolved(id);
|
||||
// 获取更新后的帖子信息
|
||||
post = forumPostService.selectForumPostById(id);
|
||||
java.util.Map<String, Object> response = new java.util.HashMap<>();
|
||||
response.put("isSolved", post != null && "1".equals(post.getIsSolved()));
|
||||
return success(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 置顶/取消置顶
|
||||
*/
|
||||
@PutMapping("/top/{id}")
|
||||
public AjaxResult toggleTop(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return error("用户未登录");
|
||||
}
|
||||
// 检查是否是作者
|
||||
ForumPost post = forumPostService.selectForumPostById(id);
|
||||
if (post == null) {
|
||||
return error("帖子不存在");
|
||||
}
|
||||
if (post.getAuthorId() == null || !post.getAuthorId().equals(userId)) {
|
||||
return error("只有作者可以置顶帖子");
|
||||
}
|
||||
// 切换置顶状态
|
||||
forumPostService.toggleTop(id);
|
||||
// 获取更新后的帖子信息
|
||||
post = forumPostService.selectForumPostById(id);
|
||||
java.util.Map<String, Object> response = new java.util.HashMap<>();
|
||||
response.put("isTop", post != null && "1".equals(post.getIsTop()));
|
||||
return success(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的统计数据
|
||||
*/
|
||||
@GetMapping("/user/stats")
|
||||
public AjaxResult getUserStats()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return error("用户未登录");
|
||||
}
|
||||
return success(forumPostService.getUserStats(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否已点赞
|
||||
*/
|
||||
@GetMapping("/like/check/{id}")
|
||||
public AjaxResult checkLike(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return success(false);
|
||||
}
|
||||
int count = forumPostMapper.checkLike(id, userId);
|
||||
return success(count > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否已收藏
|
||||
*/
|
||||
@GetMapping("/favorite/check/{id}")
|
||||
public AjaxResult checkFavorite(@PathVariable("id") Long id)
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return success(false);
|
||||
}
|
||||
int count = forumPostMapper.checkFavorite(id, userId);
|
||||
return success(count > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户点赞的帖子列表
|
||||
*/
|
||||
@GetMapping("/user/liked")
|
||||
public TableDataInfo getLikedPosts()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return getDataTable(new java.util.ArrayList<>());
|
||||
}
|
||||
startPage();
|
||||
List<ForumPost> list = forumPostService.getLikedPosts(userId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户收藏的帖子列表
|
||||
*/
|
||||
@GetMapping("/user/favorited")
|
||||
public TableDataInfo getFavoritedPosts()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return getDataTable(new java.util.ArrayList<>());
|
||||
}
|
||||
startPage();
|
||||
List<ForumPost> list = forumPostService.getFavoritedPosts(userId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户发布的帖子列表
|
||||
*/
|
||||
@GetMapping("/user/posts")
|
||||
public TableDataInfo getUserPosts()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return getDataTable(new java.util.ArrayList<>());
|
||||
}
|
||||
startPage();
|
||||
List<ForumPost> list = forumPostService.getUserPosts(userId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户回复的帖子列表
|
||||
*/
|
||||
@GetMapping("/user/replied")
|
||||
public TableDataInfo getRepliedPosts()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return getDataTable(new java.util.ArrayList<>());
|
||||
}
|
||||
startPage();
|
||||
List<ForumPost> list = forumPostService.getRepliedPosts(userId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.ForumReply;
|
||||
import com.ruoyi.jysystem.service.IForumReplyService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 论坛回复Controller
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/forum/reply")
|
||||
public class ForumReplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IForumReplyService forumReplyService;
|
||||
|
||||
/**
|
||||
* 查询论坛回复列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ForumReply forumReply)
|
||||
{
|
||||
startPage();
|
||||
List<ForumReply> list = forumReplyService.selectForumReplyList(forumReply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据帖子ID查询回复列表(树形结构)
|
||||
*/
|
||||
@GetMapping("/list/{postId}")
|
||||
public AjaxResult listByPostId(@PathVariable("postId") Long postId)
|
||||
{
|
||||
List<ForumReply> list = forumReplyService.selectForumReplyListByPostId(postId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出论坛回复列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:reply:export')")
|
||||
@Log(title = "论坛回复", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ForumReply forumReply)
|
||||
{
|
||||
List<ForumReply> list = forumReplyService.selectForumReplyList(forumReply);
|
||||
ExcelUtil<ForumReply> util = new ExcelUtil<ForumReply>(ForumReply.class);
|
||||
util.exportExcel(response, list, "论坛回复数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取论坛回复详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(forumReplyService.selectForumReplyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛回复
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ForumReply forumReply)
|
||||
{
|
||||
return toAjax(forumReplyService.insertForumReply(forumReply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛回复
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:reply:edit')")
|
||||
@Log(title = "论坛回复", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ForumReply forumReply)
|
||||
{
|
||||
return toAjax(forumReplyService.updateForumReply(forumReply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛回复
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('forum:reply:remove')")
|
||||
@Log(title = "论坛回复", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(forumReplyService.deleteForumReplyByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*/
|
||||
@PutMapping("/like/{id}")
|
||||
public AjaxResult toggleLike(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(forumReplyService.toggleLike(id, getUserId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlement;
|
||||
import com.ruoyi.jysystem.dto.FeeSettlementGenerateDTO;
|
||||
import com.ruoyi.jysystem.service.IJySysFeeSettlementService;
|
||||
import com.ruoyi.jysystem.vo.FeeSettlementDetailVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/feeSettlement")
|
||||
public class JySysFeeSettlementController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysFeeSettlementService feeSettlementService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysFeeSettlement query)
|
||||
{
|
||||
startPage();
|
||||
List<JySysFeeSettlement> list = feeSettlementService.selectJySysFeeSettlementList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:query')")
|
||||
@GetMapping("/check")
|
||||
public AjaxResult check(@RequestParam("settleYearMonth") String settleYearMonth)
|
||||
{
|
||||
return success(feeSettlementService.checkByYearMonth(settleYearMonth));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:generate')")
|
||||
@Log(title = "生成费用结算单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/generate")
|
||||
public AjaxResult generate(@RequestBody FeeSettlementGenerateDTO dto)
|
||||
{
|
||||
int count = feeSettlementService.generateFeeSettlement(dto, getUsername());
|
||||
return success("成功生成 " + count + " 张费用结算单");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return success(feeSettlementService.selectFeeSettlementDetail(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:settle')")
|
||||
@Log(title = "费用结算单确认结算", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/settle/{id}")
|
||||
public AjaxResult settle(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(feeSettlementService.confirmSettle(id, getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:remove')")
|
||||
@Log(title = "费用结算单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(feeSettlementService.deleteJySysFeeSettlementByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:exportPdf')")
|
||||
@Log(title = "费用结算单导出PDF", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportPdf/{id}")
|
||||
public void exportPdf(@PathVariable Long id, HttpServletResponse response) throws IOException
|
||||
{
|
||||
byte[] data = feeSettlementService.exportPdf(id);
|
||||
FeeSettlementDetailVO detail = feeSettlementService.selectFeeSettlementDetail(id);
|
||||
String fileName = (detail != null && detail.getSettlementNo() != null ? detail.getSettlementNo() : "fee-settlement") + ".pdf";
|
||||
response.setContentType("application/pdf");
|
||||
FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
response.getOutputStream().write(data);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:exportExcel')")
|
||||
@Log(title = "费用结算单导出Excel", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportExcel/{id}")
|
||||
public void exportExcel(@PathVariable Long id, HttpServletResponse response) throws IOException
|
||||
{
|
||||
byte[] data = feeSettlementService.exportExcel(id);
|
||||
FeeSettlementDetailVO detail = feeSettlementService.selectFeeSettlementDetail(id);
|
||||
String fileName = (detail != null && detail.getSettlementNo() != null ? detail.getSettlementNo() : "fee-settlement") + ".xlsx";
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
response.getOutputStream().write(data);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:exportPdf')")
|
||||
@Log(title = "费用结算单批量导出PDF", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportPdf/batch/{ids}")
|
||||
public void exportPdfBatch(@PathVariable Long[] ids, HttpServletResponse response) throws IOException
|
||||
{
|
||||
writeBatchExport(response, feeSettlementService.exportPdfBatch(ids), ids, "pdf");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:feeSettlement:exportExcel')")
|
||||
@Log(title = "费用结算单批量导出Excel", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportExcel/batch/{ids}")
|
||||
public void exportExcelBatch(@PathVariable Long[] ids, HttpServletResponse response) throws IOException
|
||||
{
|
||||
writeBatchExport(response, feeSettlementService.exportExcelBatch(ids), ids, "excel");
|
||||
}
|
||||
|
||||
private void writeBatchExport(HttpServletResponse response, byte[] data, Long[] ids, String type) throws IOException
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
throw new ServiceException("请选择要导出的结算单");
|
||||
}
|
||||
boolean zip = ids.length > 1;
|
||||
String fileName;
|
||||
if (zip)
|
||||
{
|
||||
fileName = "fee-settlements-" + System.currentTimeMillis() + ".zip";
|
||||
response.setContentType("application/zip");
|
||||
}
|
||||
else if ("pdf".equals(type))
|
||||
{
|
||||
FeeSettlementDetailVO detail = feeSettlementService.selectFeeSettlementDetail(ids[0]);
|
||||
fileName = (detail != null && detail.getSettlementNo() != null ? detail.getSettlementNo() : "fee-settlement") + ".pdf";
|
||||
response.setContentType("application/pdf");
|
||||
}
|
||||
else
|
||||
{
|
||||
FeeSettlementDetailVO detail = feeSettlementService.selectFeeSettlementDetail(ids[0]);
|
||||
fileName = (detail != null && detail.getSettlementNo() != null ? detail.getSettlementNo() : "fee-settlement") + ".xlsx";
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
}
|
||||
FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
response.getOutputStream().write(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.JySysLens;
|
||||
import com.ruoyi.jysystem.service.IJySysLensService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 通用镜片Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/lens")
|
||||
public class JySysLensController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysLensService jySysLensService;
|
||||
|
||||
/**
|
||||
* 通用镜片下拉选项(配片单选择用)
|
||||
*/
|
||||
@GetMapping("/options")
|
||||
public AjaxResult options()
|
||||
{
|
||||
return success(jySysLensService.selectJySysLensOptions());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysLens jySysLens)
|
||||
{
|
||||
startPage();
|
||||
List<JySysLens> list = jySysLensService.selectJySysLensList(jySysLens);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:export')")
|
||||
@Log(title = "通用镜片", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JySysLens jySysLens)
|
||||
{
|
||||
List<JySysLens> list = jySysLensService.selectJySysLensList(jySysLens);
|
||||
ExcelUtil<JySysLens> util = new ExcelUtil<JySysLens>(JySysLens.class);
|
||||
util.exportExcel(response, list, "通用镜片数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysLensService.selectJySysLensById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:add')")
|
||||
@Log(title = "通用镜片", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysLens jySysLens)
|
||||
{
|
||||
return toAjax(jySysLensService.insertJySysLens(jySysLens));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:edit')")
|
||||
@Log(title = "通用镜片", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysLens jySysLens)
|
||||
{
|
||||
return toAjax(jySysLensService.updateJySysLens(jySysLens));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:lens:remove')")
|
||||
@Log(title = "通用镜片", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jySysLensService.deleteJySysLensByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.jysystem.domain.JySysNews;
|
||||
import com.ruoyi.jysystem.service.IJySysNewsService;
|
||||
import com.ruoyi.jysystem.version.annotation.ApiVersion;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新闻动态Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/{version}/jysystem/news")
|
||||
@ApiVersion(1)
|
||||
public class JySysNewsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysNewsService jySysNewsService;
|
||||
|
||||
/**
|
||||
* 查询新闻动态列表(公开接口,无需权限)
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysNews jySysNews)
|
||||
{
|
||||
startPage();
|
||||
// 默认只查询已发布的新闻
|
||||
if (jySysNews.getStatus() == null || jySysNews.getStatus().isEmpty()) {
|
||||
jySysNews.setStatus("2");
|
||||
}
|
||||
List<JySysNews> list = jySysNewsService.selectJySysNewsList(jySysNews);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@GetMapping("/listall")
|
||||
public TableDataInfo listall(JySysNews jySysNews)
|
||||
{
|
||||
startPage();
|
||||
List<JySysNews> list = jySysNewsService.selectJySysNewsList(jySysNews);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新闻动态列表(管理接口,需要权限)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:list')")
|
||||
@GetMapping("/admin/list")
|
||||
public TableDataInfo adminList(JySysNews jySysNews)
|
||||
{
|
||||
startPage();
|
||||
List<JySysNews> list = jySysNewsService.selectJySysNewsList(jySysNews);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出新闻动态列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:export')")
|
||||
@Log(title = "新闻动态", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JySysNews jySysNews)
|
||||
{
|
||||
List<JySysNews> list = jySysNewsService.selectJySysNewsList(jySysNews);
|
||||
ExcelUtil<JySysNews> util = new ExcelUtil<JySysNews>(JySysNews.class);
|
||||
util.exportExcel(response, list, "新闻动态数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新闻动态详细信息(公开接口)
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping(value = "/{newsId}")
|
||||
public AjaxResult getInfo(@PathVariable("newsId") Long newsId)
|
||||
{
|
||||
JySysNews jySysNews = jySysNewsService.selectJySysNewsByNewsId(newsId);
|
||||
if (jySysNews != null && "1".equals(jySysNews.getStatus())) {
|
||||
// 增加阅读量
|
||||
jySysNewsService.incrementViewCount(newsId);
|
||||
// 重新查询以获取更新后的阅读量
|
||||
jySysNews = jySysNewsService.selectJySysNewsByNewsId(newsId);
|
||||
}
|
||||
return success(jySysNews);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新闻动态详细信息(管理接口)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:query')")
|
||||
@GetMapping(value = "/admin/{newsId}")
|
||||
public AjaxResult getAdminInfo(@PathVariable("newsId") Long newsId)
|
||||
{
|
||||
return success(jySysNewsService.selectJySysNewsByNewsId(newsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新闻动态
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:add')")
|
||||
@Log(title = "新闻动态", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysNews jySysNews)
|
||||
{
|
||||
jySysNews.setCreateBy(getUsername());
|
||||
return toAjax(jySysNewsService.insertJySysNews(jySysNews));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新闻动态
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:edit')")
|
||||
@Log(title = "新闻动态", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysNews jySysNews)
|
||||
{
|
||||
jySysNews.setUpdateBy(getUsername());
|
||||
return toAjax(jySysNewsService.updateJySysNews(jySysNews));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除新闻动态
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:news:remove')")
|
||||
@Log(title = "新闻动态", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{newsIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] newsIds)
|
||||
{
|
||||
return toAjax(jySysNewsService.deleteJySysNewsByNewsIds(newsIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加阅读量(公开接口)
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/{newsId}/view")
|
||||
public AjaxResult incrementViewCount(@PathVariable("newsId") Long newsId)
|
||||
{
|
||||
return toAjax(jySysNewsService.incrementViewCount(newsId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.dto.OrderAdminRejectDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderAssignDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderCloseDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderStatusChangeDTO;
|
||||
import com.ruoyi.jysystem.service.IJySysOrderService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 订单Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/order")
|
||||
public class JySysOrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysOrderService jySysOrderService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysOrder jySysOrder)
|
||||
{
|
||||
startPage();
|
||||
List<JySysOrder> list = jySysOrderService.selectJySysOrderList(jySysOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:export')")
|
||||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JySysOrder jySysOrder)
|
||||
{
|
||||
List<JySysOrder> list = jySysOrderService.selectJySysOrderList(jySysOrder);
|
||||
ExcelUtil<JySysOrder> util = new ExcelUtil<JySysOrder>(JySysOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:export')")
|
||||
@Log(title = "订单批量导出Excel", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export/batch/{ids}")
|
||||
public void exportBatch(@PathVariable Long[] ids, HttpServletResponse response)
|
||||
{
|
||||
List<JySysOrder> list = jySysOrderService.selectJySysOrderByIds(ids);
|
||||
ExcelUtil<JySysOrder> util = new ExcelUtil<JySysOrder>(JySysOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:export')")
|
||||
@Log(title = "订单批量导出PDF", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportPdf/batch/{ids}")
|
||||
public void exportPdfBatch(@PathVariable Long[] ids, HttpServletResponse response) throws java.io.IOException
|
||||
{
|
||||
byte[] data = jySysOrderService.exportOrderPdfBatch(ids);
|
||||
response.setContentType("application/pdf");
|
||||
FileUtils.setAttachmentResponseHeader(response, "orders-" + System.currentTimeMillis() + ".pdf");
|
||||
response.getOutputStream().write(data);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:query')")
|
||||
@GetMapping("/logistics/{id}")
|
||||
public AjaxResult logistics(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysOrderService.selectOrderLogistics(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysOrderService.selectJySysOrderById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:add')")
|
||||
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysOrder jySysOrder)
|
||||
{
|
||||
jySysOrder.setCreateBy(getUsername());
|
||||
return toAjax(jySysOrderService.insertJySysOrder(jySysOrder));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysOrder jySysOrder)
|
||||
{
|
||||
jySysOrder.setUpdateBy(getUsername());
|
||||
return toAjax(jySysOrderService.updateJySysOrder(jySysOrder));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@GetMapping("/assign/preview")
|
||||
public AjaxResult previewAssign(Long orderId, Long lensFactoryTenantId)
|
||||
{
|
||||
return success(jySysOrderService.previewAssignPrice(orderId, lensFactoryTenantId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单分配", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/assign")
|
||||
public AjaxResult assign(@RequestBody OrderAssignDTO assignDTO)
|
||||
{
|
||||
if (assignDTO == null || assignDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.assignOrder(assignDTO.getOrderId(), assignDTO.getLensFactoryTenantId(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单驳回", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/reject")
|
||||
public AjaxResult reject(@RequestBody OrderAdminRejectDTO rejectDTO)
|
||||
{
|
||||
if (rejectDTO == null || rejectDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (rejectDTO.getReason() == null || rejectDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("驳回原因不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminRejectOrder(
|
||||
rejectDTO.getOrderId(), rejectDTO.getReason().trim(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单关闭", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/close")
|
||||
public AjaxResult close(@RequestBody OrderCloseDTO closeDTO)
|
||||
{
|
||||
if (closeDTO == null || closeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminCloseOrder(closeDTO.getOrderId(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单完成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/complete")
|
||||
public AjaxResult complete(@RequestBody OrderCloseDTO completeDTO)
|
||||
{
|
||||
if (completeDTO == null || completeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminCompleteOrder(completeDTO.getOrderId(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "同意换货申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/exchangeAgree")
|
||||
public AjaxResult exchangeAgree(@RequestBody OrderCloseDTO agreeDTO)
|
||||
{
|
||||
if (agreeDTO == null || agreeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminAgreeExchangeOrder(agreeDTO.getOrderId(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "拒绝换货申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/exchangeReject")
|
||||
public AjaxResult exchangeReject(@RequestBody OrderAdminRejectDTO rejectDTO)
|
||||
{
|
||||
if (rejectDTO == null || rejectDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (rejectDTO.getReason() == null || rejectDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("拒绝换货申请原因不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminRejectExchangeOrder(
|
||||
rejectDTO.getOrderId(), rejectDTO.getReason().trim(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "拒绝换货申请订单完成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/exchangeRejectedComplete")
|
||||
public AjaxResult exchangeRejectedComplete(@RequestBody OrderCloseDTO completeDTO)
|
||||
{
|
||||
if (completeDTO == null || completeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.adminCompleteExchangeRejectedOrder(
|
||||
completeDTO.getOrderId(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "批量完成拒绝换货申请订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/exchangeRejectedCompleteAll")
|
||||
public AjaxResult exchangeRejectedCompleteAll()
|
||||
{
|
||||
int rows = jySysOrderService.adminCompleteAllExchangeRejectedOrders(getUsername());
|
||||
if (rows <= 0)
|
||||
{
|
||||
return success("没有需要更新的订单");
|
||||
}
|
||||
return success("已成功更新 " + rows + " 条订单");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:edit')")
|
||||
@Log(title = "订单状态变更", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody OrderStatusChangeDTO statusChangeDTO)
|
||||
{
|
||||
if (statusChangeDTO == null || statusChangeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (statusChangeDTO.getOrderStatus() == null || statusChangeDTO.getOrderStatus().isEmpty())
|
||||
{
|
||||
return error("订单状态不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderService.changeOrderStatus(
|
||||
statusChangeDTO.getOrderId(), statusChangeDTO.getOrderStatus(), getUsername()));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:order:remove')")
|
||||
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jySysOrderService.deleteJySysOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalExchangeDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalRejectDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalWithdrawDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalResubmitDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalShipDTO;
|
||||
import com.ruoyi.jysystem.dto.OrderPortalSupplementDTO;
|
||||
import com.ruoyi.jysystem.service.IJySysOrderPortalService;
|
||||
|
||||
/**
|
||||
* 开发者门户订单Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/order/portal")
|
||||
public class JySysOrderPortalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysOrderPortalService jySysOrderPortalService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysOrder jySysOrder)
|
||||
{
|
||||
jySysOrderPortalService.applyPortalOrderQuery(jySysOrder);
|
||||
startPage();
|
||||
List<JySysOrder> list = jySysOrderPortalService.selectPortalOrderList(jySysOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/context")
|
||||
public AjaxResult context()
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("canManageLensOrder", jySysOrderPortalService.canManageLensOrder());
|
||||
ajax.put("isBrandTenant", jySysOrderPortalService.isBrandTenant());
|
||||
ajax.put("isLensFactoryTenant", jySysOrderPortalService.isLensFactoryTenant());
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@GetMapping("/productOptions")
|
||||
public AjaxResult productOptions()
|
||||
{
|
||||
return success(jySysOrderPortalService.selectPortalProductOptions());
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysOrderPortalService.selectPortalOrderById(id));
|
||||
}
|
||||
|
||||
@Log(title = "配片单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysOrder jySysOrder)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.insertPortalOrder(jySysOrder));
|
||||
}
|
||||
|
||||
@Log(title = "配片单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysOrder jySysOrder)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.updatePortalOrder(jySysOrder));
|
||||
}
|
||||
|
||||
@Log(title = "配片单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.deletePortalOrderByIds(ids));
|
||||
}
|
||||
|
||||
@Log(title = "制片单补充", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/supplement")
|
||||
public AjaxResult supplement(@RequestBody OrderPortalSupplementDTO supplementDTO)
|
||||
{
|
||||
if (supplementDTO == null || supplementDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.supplementPortalOrder(supplementDTO.getOrderId(), supplementDTO.getRemark()));
|
||||
}
|
||||
|
||||
@Log(title = "配片单重新提交", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resubmit")
|
||||
public AjaxResult resubmit(@RequestBody OrderPortalResubmitDTO resubmitDTO)
|
||||
{
|
||||
if (resubmitDTO == null || resubmitDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (resubmitDTO.getReason() == null || resubmitDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("重新提交原因不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.resubmitPortalOrder(
|
||||
resubmitDTO.getOrderId(), resubmitDTO.getReason().trim()));
|
||||
}
|
||||
|
||||
@Log(title = "制片单驳回", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/reject")
|
||||
public AjaxResult reject(@RequestBody OrderPortalRejectDTO rejectDTO)
|
||||
{
|
||||
if (rejectDTO == null || rejectDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (rejectDTO.getReason() == null || rejectDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("驳回原因不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.rejectPortalOrder(
|
||||
rejectDTO.getOrderId(), rejectDTO.getReason().trim()));
|
||||
}
|
||||
|
||||
@Log(title = "制片单接单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/accept/{id}")
|
||||
public AjaxResult accept(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.acceptPortalOrder(id));
|
||||
}
|
||||
|
||||
@Log(title = "制片单制作", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/produce/{id}")
|
||||
public AjaxResult produce(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.producePortalOrder(id));
|
||||
}
|
||||
|
||||
@Log(title = "制片单撤单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/withdraw")
|
||||
public AjaxResult withdraw(@RequestBody OrderPortalWithdrawDTO withdrawDTO)
|
||||
{
|
||||
if (withdrawDTO == null || withdrawDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (withdrawDTO.getReason() == null || withdrawDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("撤单理由不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.withdrawPortalOrder(
|
||||
withdrawDTO.getOrderId(), withdrawDTO.getReason().trim()));
|
||||
}
|
||||
|
||||
@GetMapping("/logistics/{id}")
|
||||
public AjaxResult logistics(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysOrderPortalService.selectPortalOrderLogistics(id));
|
||||
}
|
||||
|
||||
@Log(title = "制片单发货", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/ship")
|
||||
public AjaxResult ship(@RequestBody OrderPortalShipDTO shipDTO)
|
||||
{
|
||||
if (shipDTO == null || shipDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (shipDTO.getExpressCompany() == null || shipDTO.getExpressCompany().trim().isEmpty())
|
||||
{
|
||||
return error("物流公司不能为空");
|
||||
}
|
||||
if (shipDTO.getExpressNo() == null || shipDTO.getExpressNo().trim().isEmpty())
|
||||
{
|
||||
return error("物流单号不能为空");
|
||||
}
|
||||
if (shipDTO.getLogisticsFee() == null)
|
||||
{
|
||||
return error("物流费用不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.shipPortalOrder(
|
||||
shipDTO.getOrderId(), shipDTO.getExpressCompany().trim(), shipDTO.getExpressNo().trim(), shipDTO.getLogisticsFee()));
|
||||
}
|
||||
|
||||
@Log(title = "制片单完成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/complete/{id}")
|
||||
public AjaxResult complete(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.completePortalOrder(id));
|
||||
}
|
||||
|
||||
@Log(title = "配片单换货申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/exchangeApply")
|
||||
public AjaxResult exchangeApply(@RequestBody OrderPortalExchangeDTO exchangeDTO)
|
||||
{
|
||||
if (exchangeDTO == null || exchangeDTO.getOrderId() == null)
|
||||
{
|
||||
return error("订单ID不能为空");
|
||||
}
|
||||
if (exchangeDTO.getReason() == null || exchangeDTO.getReason().trim().isEmpty())
|
||||
{
|
||||
return error("换货申请原因不能为空");
|
||||
}
|
||||
return toAjax(jySysOrderPortalService.exchangeApplyPortalOrder(
|
||||
exchangeDTO.getOrderId(), exchangeDTO.getReason().trim()));
|
||||
}
|
||||
|
||||
@Log(title = "配片单接收", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/receive/{id}")
|
||||
public AjaxResult receive(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(jySysOrderPortalService.receivePortalOrder(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.domain.JySysProduct;
|
||||
import com.ruoyi.jysystem.service.IJySysProductService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/product")
|
||||
public class JySysProductController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysProductService jySysProductService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysProduct jySysProduct)
|
||||
{
|
||||
startPage();
|
||||
List<JySysProduct> list = jySysProductService.selectJySysProductList(jySysProduct);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品下拉选项(租户品牌方选择产品用)
|
||||
*/
|
||||
@GetMapping("/options")
|
||||
public AjaxResult options(Long tenantId)
|
||||
{
|
||||
return success(jySysProductService.selectJySysProductOptions(tenantId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:export')")
|
||||
@Log(title = "产品", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JySysProduct jySysProduct)
|
||||
{
|
||||
List<JySysProduct> list = jySysProductService.selectJySysProductList(jySysProduct);
|
||||
ExcelUtil<JySysProduct> util = new ExcelUtil<JySysProduct>(JySysProduct.class);
|
||||
util.exportExcel(response, list, "产品数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysProductService.selectJySysProductById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:add')")
|
||||
@Log(title = "产品", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysProduct jySysProduct)
|
||||
{
|
||||
jySysProduct.setCreateBy(getUsername());
|
||||
return toAjax(jySysProductService.insertJySysProduct(jySysProduct));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:edit')")
|
||||
@Log(title = "产品", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysProduct jySysProduct)
|
||||
{
|
||||
jySysProduct.setUpdateBy(getUsername());
|
||||
return toAjax(jySysProductService.updateJySysProduct(jySysProduct));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:product:remove')")
|
||||
@Log(title = "产品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jySysProductService.deleteJySysProductByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/tenant")
|
||||
public class JySysTenantController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysTenantService jySysTenantService;
|
||||
|
||||
/**
|
||||
* 查询租户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysTenant jySysTenant)
|
||||
{
|
||||
startPage();
|
||||
List<JySysTenant> list = jySysTenantService.selectJySysTenantList(jySysTenant);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:export')")
|
||||
@Log(title = "租户", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JySysTenant jySysTenant)
|
||||
{
|
||||
List<JySysTenant> list = jySysTenantService.selectJySysTenantList(jySysTenant);
|
||||
ExcelUtil<JySysTenant> util = new ExcelUtil<JySysTenant>(JySysTenant.class);
|
||||
util.exportExcel(response, list, "租户数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:query') or @ss.hasPermi('jysystem:tenant:edit')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jySysTenantService.selectJySysTenantById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:add')")
|
||||
@Log(title = "租户", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JySysTenant jySysTenant)
|
||||
{
|
||||
jySysTenant.setCreateBy(getUsername());
|
||||
return toAjax(jySysTenantService.insertJySysTenant(jySysTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:edit')")
|
||||
@Log(title = "租户", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JySysTenant jySysTenant)
|
||||
{
|
||||
jySysTenant.setUpdateBy(getUsername());
|
||||
return toAjax(jySysTenantService.updateJySysTenant(jySysTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:remove')")
|
||||
@Log(title = "租户", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jySysTenantService.deleteJySysTenantByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌方租户列表(产品管理专属品牌方选择用)
|
||||
*/
|
||||
@GetMapping("/brandList")
|
||||
public AjaxResult brandList()
|
||||
{
|
||||
return success(jySysTenantService.selectBrandTenantList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前登录用户关联租户
|
||||
*/
|
||||
@GetMapping("/current")
|
||||
public AjaxResult current()
|
||||
{
|
||||
return success(jySysTenantService.selectCurrentLoginTenant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 镜片厂租户列表(订单管理镜片厂选择用)
|
||||
*/
|
||||
@GetMapping("/lensFactoryList")
|
||||
public AjaxResult lensFactoryList(@RequestParam(value = "lensId", required = false) Long lensId)
|
||||
{
|
||||
if (lensId != null)
|
||||
{
|
||||
return success(jySysTenantService.selectLensFactoryTenantListByLensId(lensId));
|
||||
}
|
||||
return success(jySysTenantService.selectLensFactoryTenantList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户启用状态
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:edit')")
|
||||
@Log(title = "租户", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody JySysTenant jySysTenant)
|
||||
{
|
||||
jySysTenant.setUpdateBy(getUsername());
|
||||
return toAjax(jySysTenantService.changeTenantStatus(jySysTenant));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.dto.TenantLensSaveDTO;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantLensService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 租户可配镜片Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/tenantLens")
|
||||
public class JySysTenantLensController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysTenantLensService jySysTenantLensService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:lensView')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam Long tenantId)
|
||||
{
|
||||
return success(jySysTenantLensService.selectTenantLensListByTenantId(tenantId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:lensConfig')")
|
||||
@Log(title = "租户可配镜片", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody TenantLensSaveDTO saveDTO)
|
||||
{
|
||||
return toAjax(jySysTenantLensService.saveTenantLensConfig(saveDTO, getUsername()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantMessage;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantMessageService;
|
||||
|
||||
/**
|
||||
* 开发者门户消息Controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/message/portal")
|
||||
public class JySysTenantMessagePortalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysTenantMessageService jySysTenantMessageService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JySysTenantMessage message)
|
||||
{
|
||||
startPage();
|
||||
List<JySysTenantMessage> list = jySysTenantMessageService.selectPortalMessageList(message);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/unreadCount")
|
||||
public AjaxResult unreadCount()
|
||||
{
|
||||
return success(jySysTenantMessageService.countPortalUnread());
|
||||
}
|
||||
|
||||
@PutMapping("/read/{id}")
|
||||
public AjaxResult read(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(jySysTenantMessageService.markPortalRead(id));
|
||||
}
|
||||
|
||||
@PutMapping("/readAll")
|
||||
public AjaxResult readAll()
|
||||
{
|
||||
return toAjax(jySysTenantMessageService.markPortalAllRead());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.jysystem.dto.TenantProductSaveDTO;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantProductService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 租户关联产品Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jysystem/tenantProduct")
|
||||
public class JySysTenantProductController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJySysTenantProductService jySysTenantProductService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:productView')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam Long tenantId)
|
||||
{
|
||||
return success(jySysTenantProductService.selectTenantProductListByTenantId(tenantId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('jysystem:tenant:productConfig')")
|
||||
@Log(title = "租户关联产品", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody TenantProductSaveDTO saveDTO)
|
||||
{
|
||||
return toAjax(jySysTenantProductService.saveTenantProductConfig(saveDTO, getUsername()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.ruoyi.jysystem.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.jysystem.domain.SysRealNameAuth;
|
||||
import com.ruoyi.jysystem.service.ISysRealNameAuthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实名认证Controller(管理端列表/审核 + 用户端提交/查询)
|
||||
*
|
||||
* @author jueyuan
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/realNameAuth")
|
||||
public class SysRealNameAuthController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysRealNameAuthService sysRealNameAuthService;
|
||||
|
||||
// ========== 管理端 ==========
|
||||
|
||||
/** 查询实名认证列表 */
|
||||
@PreAuthorize("@ss.hasPermi('system:realNameAuth:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRealNameAuth sysRealNameAuth) {
|
||||
startPage();
|
||||
List<SysRealNameAuth> list = sysRealNameAuthService.selectSysRealNameAuthList(sysRealNameAuth);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/** 获取实名认证详情 */
|
||||
@PreAuthorize("@ss.hasPermi('system:realNameAuth:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return success(sysRealNameAuthService.selectSysRealNameAuthById(id));
|
||||
}
|
||||
|
||||
/** 审核通过 */
|
||||
@PreAuthorize("@ss.hasPermi('system:realNameAuth:audit')")
|
||||
@Log(title = "实名认证", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/auditPass/{id}")
|
||||
public AjaxResult auditPass(@PathVariable Long id, @RequestParam(required = false) String auditRemark) {
|
||||
return toAjax(sysRealNameAuthService.auditPass(id, auditRemark));
|
||||
}
|
||||
|
||||
/** 审核拒绝 */
|
||||
@PreAuthorize("@ss.hasPermi('system:realNameAuth:audit')")
|
||||
@Log(title = "实名认证", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/auditReject/{id}")
|
||||
public AjaxResult auditReject(@PathVariable Long id, @RequestParam(required = false) String auditRemark) {
|
||||
return toAjax(sysRealNameAuthService.auditReject(id, auditRemark));
|
||||
}
|
||||
|
||||
// ========== 用户端(developer-front) ==========
|
||||
|
||||
/** 获取当前用户的认证记录 */
|
||||
@GetMapping("/my")
|
||||
public AjaxResult getMyAuth() {
|
||||
return success(sysRealNameAuthService.getMyAuth());
|
||||
}
|
||||
|
||||
/** 提交实名认证 */
|
||||
@Log(title = "实名认证", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/submit")
|
||||
public AjaxResult submit(@RequestBody SysRealNameAuth sysRealNameAuth) {
|
||||
return toAjax(sysRealNameAuthService.submitAuth(sysRealNameAuth));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 论坛分类对象 forum_category
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public class ForumCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分类ID */
|
||||
private Long id;
|
||||
|
||||
/** 分类名称 */
|
||||
@Excel(name = "分类名称")
|
||||
private String name;
|
||||
|
||||
/** 分类描述 */
|
||||
@Excel(name = "分类描述")
|
||||
private String description;
|
||||
|
||||
/** 分类图标 */
|
||||
private String icon;
|
||||
|
||||
/** 排序顺序 */
|
||||
@Excel(name = "排序顺序")
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 帖子数量 */
|
||||
@Excel(name = "帖子数量")
|
||||
private Integer postCount;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setIcon(String icon)
|
||||
{
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setSortOrder(Integer sortOrder)
|
||||
{
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public Integer getSortOrder()
|
||||
{
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setPostCount(Integer postCount)
|
||||
{
|
||||
this.postCount = postCount;
|
||||
}
|
||||
|
||||
public Integer getPostCount()
|
||||
{
|
||||
return postCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("description", getDescription())
|
||||
.append("icon", getIcon())
|
||||
.append("sortOrder", getSortOrder())
|
||||
.append("status", getStatus())
|
||||
.append("postCount", getPostCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
305
jy-system/src/main/java/com/ruoyi/jysystem/domain/ForumPost.java
Normal file
305
jy-system/src/main/java/com/ruoyi/jysystem/domain/ForumPost.java
Normal file
@@ -0,0 +1,305 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 论坛帖子对象 forum_post
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public class ForumPost extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 帖子ID */
|
||||
private Long id;
|
||||
|
||||
/** 分类ID */
|
||||
@Excel(name = "分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
/** 标题 */
|
||||
@Excel(name = "标题")
|
||||
private String title;
|
||||
|
||||
/** 内容 */
|
||||
private String content;
|
||||
|
||||
/** 摘要 */
|
||||
@Excel(name = "摘要")
|
||||
private String excerpt;
|
||||
|
||||
/** 作者ID */
|
||||
@Excel(name = "作者ID")
|
||||
private Long authorId;
|
||||
|
||||
/** 作者名称 */
|
||||
@Excel(name = "作者名称")
|
||||
private String authorName;
|
||||
|
||||
/** 作者头像 */
|
||||
private String authorAvatar;
|
||||
|
||||
/** 浏览量 */
|
||||
@Excel(name = "浏览量")
|
||||
private Integer viewCount;
|
||||
|
||||
/** 回复数 */
|
||||
@Excel(name = "回复数")
|
||||
private Integer replyCount;
|
||||
|
||||
/** 点赞数 */
|
||||
@Excel(name = "点赞数")
|
||||
private Integer likeCount;
|
||||
|
||||
/** 收藏数 */
|
||||
@Excel(name = "收藏数")
|
||||
private Integer favoriteCount;
|
||||
|
||||
/** 是否置顶(0否 1是) */
|
||||
@Excel(name = "是否置顶", readConverterExp = "0=否,1=是")
|
||||
private String isTop;
|
||||
|
||||
/** 是否热门(0否 1是) */
|
||||
@Excel(name = "是否热门", readConverterExp = "0=否,1=是")
|
||||
private String isHot;
|
||||
|
||||
/** 是否已解决(0否 1是) */
|
||||
@Excel(name = "是否已解决", readConverterExp = "0=否,1=是")
|
||||
private String isSolved;
|
||||
|
||||
/** 状态(0正常 1删除 2审核中) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=删除,2=审核中")
|
||||
private String status;
|
||||
|
||||
/** 最后回复ID */
|
||||
private Long lastReplyId;
|
||||
|
||||
/** 最后回复用户 */
|
||||
private String lastReplyUser;
|
||||
|
||||
/** 最后回复时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后回复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastReplyTime;
|
||||
|
||||
/** 排序字段 */
|
||||
private String sort;
|
||||
|
||||
/** 搜索关键词(不持久化) */
|
||||
private transient String keyword;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCategoryId(Long categoryId)
|
||||
{
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public Long getCategoryId()
|
||||
{
|
||||
return categoryId;
|
||||
}
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
public void setExcerpt(String excerpt)
|
||||
{
|
||||
this.excerpt = excerpt;
|
||||
}
|
||||
|
||||
public String getExcerpt()
|
||||
{
|
||||
return excerpt;
|
||||
}
|
||||
public void setAuthorId(Long authorId)
|
||||
{
|
||||
this.authorId = authorId;
|
||||
}
|
||||
|
||||
public Long getAuthorId()
|
||||
{
|
||||
return authorId;
|
||||
}
|
||||
public void setAuthorName(String authorName)
|
||||
{
|
||||
this.authorName = authorName;
|
||||
}
|
||||
|
||||
public String getAuthorName()
|
||||
{
|
||||
return authorName;
|
||||
}
|
||||
public void setAuthorAvatar(String authorAvatar)
|
||||
{
|
||||
this.authorAvatar = authorAvatar;
|
||||
}
|
||||
|
||||
public String getAuthorAvatar()
|
||||
{
|
||||
return authorAvatar;
|
||||
}
|
||||
public void setViewCount(Integer viewCount)
|
||||
{
|
||||
this.viewCount = viewCount;
|
||||
}
|
||||
|
||||
public Integer getViewCount()
|
||||
{
|
||||
return viewCount;
|
||||
}
|
||||
public void setReplyCount(Integer replyCount)
|
||||
{
|
||||
this.replyCount = replyCount;
|
||||
}
|
||||
|
||||
public Integer getReplyCount()
|
||||
{
|
||||
return replyCount;
|
||||
}
|
||||
public void setLikeCount(Integer likeCount)
|
||||
{
|
||||
this.likeCount = likeCount;
|
||||
}
|
||||
|
||||
public Integer getLikeCount()
|
||||
{
|
||||
return likeCount;
|
||||
}
|
||||
public void setFavoriteCount(Integer favoriteCount)
|
||||
{
|
||||
this.favoriteCount = favoriteCount;
|
||||
}
|
||||
|
||||
public Integer getFavoriteCount()
|
||||
{
|
||||
return favoriteCount;
|
||||
}
|
||||
public void setIsTop(String isTop)
|
||||
{
|
||||
this.isTop = isTop;
|
||||
}
|
||||
|
||||
public String getIsTop()
|
||||
{
|
||||
return isTop;
|
||||
}
|
||||
public void setIsHot(String isHot)
|
||||
{
|
||||
this.isHot = isHot;
|
||||
}
|
||||
|
||||
public String getIsHot()
|
||||
{
|
||||
return isHot;
|
||||
}
|
||||
public void setIsSolved(String isSolved)
|
||||
{
|
||||
this.isSolved = isSolved;
|
||||
}
|
||||
|
||||
public String getIsSolved()
|
||||
{
|
||||
return isSolved;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setLastReplyId(Long lastReplyId)
|
||||
{
|
||||
this.lastReplyId = lastReplyId;
|
||||
}
|
||||
|
||||
public Long getLastReplyId()
|
||||
{
|
||||
return lastReplyId;
|
||||
}
|
||||
public void setLastReplyUser(String lastReplyUser)
|
||||
{
|
||||
this.lastReplyUser = lastReplyUser;
|
||||
}
|
||||
|
||||
public String getLastReplyUser()
|
||||
{
|
||||
return lastReplyUser;
|
||||
}
|
||||
public void setLastReplyTime(Date lastReplyTime)
|
||||
{
|
||||
this.lastReplyTime = lastReplyTime;
|
||||
}
|
||||
|
||||
public Date getLastReplyTime()
|
||||
{
|
||||
return lastReplyTime;
|
||||
}
|
||||
public void setSort(String sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword)
|
||||
{
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getKeyword()
|
||||
{
|
||||
return keyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ForumPost{" +
|
||||
"id=" + id +
|
||||
", categoryId=" + categoryId +
|
||||
", title='" + title + '\'' +
|
||||
", authorId=" + authorId +
|
||||
", authorName='" + authorName + '\'' +
|
||||
", viewCount=" + viewCount +
|
||||
", replyCount=" + replyCount +
|
||||
", likeCount=" + likeCount +
|
||||
", isTop='" + isTop + '\'' +
|
||||
", isHot='" + isHot + '\'' +
|
||||
", isSolved='" + isSolved + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 论坛回复对象 forum_reply
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public class ForumReply extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 回复ID */
|
||||
private Long id;
|
||||
|
||||
/** 帖子ID */
|
||||
@Excel(name = "帖子ID")
|
||||
private Long postId;
|
||||
|
||||
/** 父回复ID(0表示直接回复帖子) */
|
||||
@Excel(name = "父回复ID")
|
||||
private Long parentId;
|
||||
|
||||
/** 回复内容 */
|
||||
private String content;
|
||||
|
||||
/** 作者ID */
|
||||
@Excel(name = "作者ID")
|
||||
private Long authorId;
|
||||
|
||||
/** 作者名称 */
|
||||
@Excel(name = "作者名称")
|
||||
private String authorName;
|
||||
|
||||
/** 作者头像 */
|
||||
private String authorAvatar;
|
||||
|
||||
/** 点赞数 */
|
||||
@Excel(name = "点赞数")
|
||||
private Integer likeCount;
|
||||
|
||||
/** 状态(0正常 1删除 2审核中) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=删除,2=审核中")
|
||||
private String status;
|
||||
|
||||
/** 子回复列表 */
|
||||
private List<ForumReply> children;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setAuthorId(Long authorId)
|
||||
{
|
||||
this.authorId = authorId;
|
||||
}
|
||||
|
||||
public Long getAuthorId()
|
||||
{
|
||||
return authorId;
|
||||
}
|
||||
|
||||
public void setAuthorName(String authorName)
|
||||
{
|
||||
this.authorName = authorName;
|
||||
}
|
||||
|
||||
public String getAuthorName()
|
||||
{
|
||||
return authorName;
|
||||
}
|
||||
|
||||
public void setAuthorAvatar(String authorAvatar)
|
||||
{
|
||||
this.authorAvatar = authorAvatar;
|
||||
}
|
||||
|
||||
public String getAuthorAvatar()
|
||||
{
|
||||
return authorAvatar;
|
||||
}
|
||||
|
||||
public void setLikeCount(Integer likeCount)
|
||||
{
|
||||
this.likeCount = likeCount;
|
||||
}
|
||||
|
||||
public Integer getLikeCount()
|
||||
{
|
||||
return likeCount;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public List<ForumReply> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ForumReply> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 费用结算单主表 jy_sys_fee_settlement
|
||||
*/
|
||||
public class JySysFeeSettlement extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String TYPE_AR = "AR";
|
||||
|
||||
public static final String TYPE_AP = "AP";
|
||||
|
||||
private Long id;
|
||||
|
||||
private String settlementNo;
|
||||
|
||||
private String settleYearMonth;
|
||||
|
||||
private String settleStatus;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private String settlementType;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date settleDate;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private String tenantName;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSettlementNo()
|
||||
{
|
||||
return settlementNo;
|
||||
}
|
||||
|
||||
public void setSettlementNo(String settlementNo)
|
||||
{
|
||||
this.settlementNo = settlementNo;
|
||||
}
|
||||
|
||||
public String getSettleYearMonth()
|
||||
{
|
||||
return settleYearMonth;
|
||||
}
|
||||
|
||||
public void setSettleYearMonth(String settleYearMonth)
|
||||
{
|
||||
this.settleYearMonth = settleYearMonth;
|
||||
}
|
||||
|
||||
public String getSettleStatus()
|
||||
{
|
||||
return settleStatus;
|
||||
}
|
||||
|
||||
public void setSettleStatus(String settleStatus)
|
||||
{
|
||||
this.settleStatus = settleStatus;
|
||||
}
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public String getSettlementType()
|
||||
{
|
||||
return settlementType;
|
||||
}
|
||||
|
||||
public void setSettlementType(String settlementType)
|
||||
{
|
||||
this.settlementType = settlementType;
|
||||
}
|
||||
|
||||
public Date getSettleDate()
|
||||
{
|
||||
return settleDate;
|
||||
}
|
||||
|
||||
public void setSettleDate(Date settleDate)
|
||||
{
|
||||
this.settleDate = settleDate;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount()
|
||||
{
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(BigDecimal totalAmount)
|
||||
{
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public String getTenantName()
|
||||
{
|
||||
return tenantName;
|
||||
}
|
||||
|
||||
public void setTenantName(String tenantName)
|
||||
{
|
||||
this.tenantName = tenantName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementNo", getSettlementNo())
|
||||
.append("settleYearMonth", getSettleYearMonth())
|
||||
.append("settleStatus", getSettleStatus())
|
||||
.append("tenantId", getTenantId())
|
||||
.append("settlementType", getSettlementType())
|
||||
.append("settleDate", getSettleDate())
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 费用结算单子表 jy_sys_fee_settlement_item
|
||||
*/
|
||||
public class JySysFeeSettlementItem
|
||||
{
|
||||
private Long id;
|
||||
|
||||
private Long settlementId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String orderNo;
|
||||
|
||||
private BigDecimal lensPrice;
|
||||
|
||||
private BigDecimal progressivePrice;
|
||||
|
||||
private BigDecimal logisticsPrice;
|
||||
|
||||
private Integer logisticsCount;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private List<JySysFeeSettlementLogistics> logisticsList;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getSettlementId()
|
||||
{
|
||||
return settlementId;
|
||||
}
|
||||
|
||||
public void setSettlementId(Long settlementId)
|
||||
{
|
||||
this.settlementId = settlementId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public BigDecimal getLensPrice()
|
||||
{
|
||||
return lensPrice;
|
||||
}
|
||||
|
||||
public void setLensPrice(BigDecimal lensPrice)
|
||||
{
|
||||
this.lensPrice = lensPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getProgressivePrice()
|
||||
{
|
||||
return progressivePrice;
|
||||
}
|
||||
|
||||
public void setProgressivePrice(BigDecimal progressivePrice)
|
||||
{
|
||||
this.progressivePrice = progressivePrice;
|
||||
}
|
||||
|
||||
public BigDecimal getLogisticsPrice()
|
||||
{
|
||||
return logisticsPrice;
|
||||
}
|
||||
|
||||
public void setLogisticsPrice(BigDecimal logisticsPrice)
|
||||
{
|
||||
this.logisticsPrice = logisticsPrice;
|
||||
}
|
||||
|
||||
public Integer getLogisticsCount()
|
||||
{
|
||||
return logisticsCount;
|
||||
}
|
||||
|
||||
public void setLogisticsCount(Integer logisticsCount)
|
||||
{
|
||||
this.logisticsCount = logisticsCount;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount()
|
||||
{
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(BigDecimal totalAmount)
|
||||
{
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public List<JySysFeeSettlementLogistics> getLogisticsList()
|
||||
{
|
||||
return logisticsList;
|
||||
}
|
||||
|
||||
public void setLogisticsList(List<JySysFeeSettlementLogistics> logisticsList)
|
||||
{
|
||||
this.logisticsList = logisticsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementId", getSettlementId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("lensPrice", getLensPrice())
|
||||
.append("progressivePrice", getProgressivePrice())
|
||||
.append("logisticsPrice", getLogisticsPrice())
|
||||
.append("logisticsCount", getLogisticsCount())
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 费用结算单物流费用表 jy_sys_fee_settlement_logistics
|
||||
*/
|
||||
public class JySysFeeSettlementLogistics
|
||||
{
|
||||
private Long id;
|
||||
|
||||
private Long settlementItemId;
|
||||
|
||||
private Long statusLogId;
|
||||
|
||||
private BigDecimal logisticsFee;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getSettlementItemId()
|
||||
{
|
||||
return settlementItemId;
|
||||
}
|
||||
|
||||
public void setSettlementItemId(Long settlementItemId)
|
||||
{
|
||||
this.settlementItemId = settlementItemId;
|
||||
}
|
||||
|
||||
public Long getStatusLogId()
|
||||
{
|
||||
return statusLogId;
|
||||
}
|
||||
|
||||
public void setStatusLogId(Long statusLogId)
|
||||
{
|
||||
this.statusLogId = statusLogId;
|
||||
}
|
||||
|
||||
public BigDecimal getLogisticsFee()
|
||||
{
|
||||
return logisticsFee;
|
||||
}
|
||||
|
||||
public void setLogisticsFee(BigDecimal logisticsFee)
|
||||
{
|
||||
this.logisticsFee = logisticsFee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementItemId", getSettlementItemId())
|
||||
.append("statusLogId", getStatusLogId())
|
||||
.append("logisticsFee", getLogisticsFee())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
146
jy-system/src/main/java/com/ruoyi/jysystem/domain/JySysLens.java
Normal file
146
jy-system/src/main/java/com/ruoyi/jysystem/domain/JySysLens.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 通用镜片对象 jy_sys_lens
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysLens extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 品名 */
|
||||
@Excel(name = "品名")
|
||||
private String productName;
|
||||
|
||||
/** 材质 */
|
||||
@Excel(name = "材质")
|
||||
private String material;
|
||||
|
||||
/** AR镀膜(0否 1是) */
|
||||
@Excel(name = "AR镀膜", dictType = "zero_one")
|
||||
private Integer arCoating;
|
||||
|
||||
/** 颜色 */
|
||||
@Excel(name = "颜色")
|
||||
private String color;
|
||||
|
||||
/** 是否进口树脂(0否 1是) */
|
||||
@Excel(name = "是否进口树脂", dictType = "zero_one")
|
||||
private Integer importedResin;
|
||||
|
||||
/** 是否边缘薄(0否 1是) */
|
||||
@Excel(name = "是否边缘薄", dictType = "zero_one")
|
||||
private Integer thinEdge;
|
||||
|
||||
/** 删除标志(0正常 1已删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getMaterial()
|
||||
{
|
||||
return material;
|
||||
}
|
||||
|
||||
public void setMaterial(String material)
|
||||
{
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public Integer getArCoating()
|
||||
{
|
||||
return arCoating;
|
||||
}
|
||||
|
||||
public void setArCoating(Integer arCoating)
|
||||
{
|
||||
this.arCoating = arCoating;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color)
|
||||
{
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Integer getImportedResin()
|
||||
{
|
||||
return importedResin;
|
||||
}
|
||||
|
||||
public void setImportedResin(Integer importedResin)
|
||||
{
|
||||
this.importedResin = importedResin;
|
||||
}
|
||||
|
||||
public Integer getThinEdge()
|
||||
{
|
||||
return thinEdge;
|
||||
}
|
||||
|
||||
public void setThinEdge(Integer thinEdge)
|
||||
{
|
||||
this.thinEdge = thinEdge;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productName", getProductName())
|
||||
.append("material", getMaterial())
|
||||
.append("arCoating", getArCoating())
|
||||
.append("color", getColor())
|
||||
.append("importedResin", getImportedResin())
|
||||
.append("thinEdge", getThinEdge())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
212
jy-system/src/main/java/com/ruoyi/jysystem/domain/JySysNews.java
Normal file
212
jy-system/src/main/java/com/ruoyi/jysystem/domain/JySysNews.java
Normal file
@@ -0,0 +1,212 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新闻动态对象 jy_sys_news
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-01
|
||||
*/
|
||||
public class JySysNews extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 新闻ID */
|
||||
private Long id;
|
||||
|
||||
/** 新闻类型:1-内部新闻,2-行业新闻 */
|
||||
@Excel(name = "新闻类型", readConverterExp = "1=内部新闻,2=行业新闻")
|
||||
private String type;
|
||||
|
||||
/** 新闻标题 */
|
||||
@Excel(name = "新闻标题")
|
||||
private String title;
|
||||
|
||||
/** 新闻摘要 */
|
||||
@Excel(name = "新闻摘要")
|
||||
private String summary;
|
||||
|
||||
/** 新闻内容(HTML格式) */
|
||||
private String content;
|
||||
|
||||
/** 新闻封面图片URL */
|
||||
@Excel(name = "封面图片")
|
||||
private String image;
|
||||
|
||||
/** 作者 */
|
||||
@Excel(name = "作者")
|
||||
private String author;
|
||||
|
||||
/** 来源 */
|
||||
@Excel(name = "来源")
|
||||
private String source;
|
||||
|
||||
/** 阅读量 */
|
||||
@Excel(name = "阅读量")
|
||||
private Integer viewCount;
|
||||
|
||||
/** 状态:0-草稿,1-已发布,2-已下线 */
|
||||
@Excel(name = "状态", readConverterExp = "0=草稿,1=已发布,2=已下线")
|
||||
private String status;
|
||||
|
||||
/** 是否置顶:0-否,1-是 */
|
||||
@Excel(name = "是否置顶", readConverterExp = "0=否,1=是")
|
||||
private String isTop;
|
||||
|
||||
/** 排序顺序 */
|
||||
@Excel(name = "排序顺序")
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 发布时间 */
|
||||
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date publishTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
public void setSummary(String summary)
|
||||
{
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return summary;
|
||||
}
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
public void setImage(String image)
|
||||
{
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getImage()
|
||||
{
|
||||
return image;
|
||||
}
|
||||
public void setAuthor(String author)
|
||||
{
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getAuthor()
|
||||
{
|
||||
return author;
|
||||
}
|
||||
public void setSource(String source)
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
public void setViewCount(Integer viewCount)
|
||||
{
|
||||
this.viewCount = viewCount;
|
||||
}
|
||||
|
||||
public Integer getViewCount()
|
||||
{
|
||||
return viewCount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setIsTop(String isTop)
|
||||
{
|
||||
this.isTop = isTop;
|
||||
}
|
||||
|
||||
public String getIsTop()
|
||||
{
|
||||
return isTop;
|
||||
}
|
||||
public void setSortOrder(Integer sortOrder)
|
||||
{
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public Integer getSortOrder()
|
||||
{
|
||||
return sortOrder;
|
||||
}
|
||||
public void setPublishTime(Date publishTime)
|
||||
{
|
||||
this.publishTime = publishTime;
|
||||
}
|
||||
|
||||
public Date getPublishTime()
|
||||
{
|
||||
return publishTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("type", getType())
|
||||
.append("title", getTitle())
|
||||
.append("summary", getSummary())
|
||||
.append("content", getContent())
|
||||
.append("image", getImage())
|
||||
.append("author", getAuthor())
|
||||
.append("source", getSource())
|
||||
.append("viewCount", getViewCount())
|
||||
.append("status", getStatus())
|
||||
.append("isTop", getIsTop())
|
||||
.append("sortOrder", getSortOrder())
|
||||
.append("publishTime", getPublishTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,403 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单对象 jy_sys_order
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
private Long brandTenantId;
|
||||
|
||||
@Excel(name = "品牌方")
|
||||
private String brandTenantName;
|
||||
|
||||
private Long lensFactoryTenantId;
|
||||
|
||||
@Excel(name = "镜片厂")
|
||||
private String lensFactoryTenantName;
|
||||
|
||||
private Long productId;
|
||||
|
||||
@Excel(name = "产品型号")
|
||||
private String productModel;
|
||||
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
private Long lensId;
|
||||
|
||||
@Excel(name = "镜片品名")
|
||||
private String lensProductName;
|
||||
|
||||
@Excel(name = "镜片材质")
|
||||
private String lensMaterial;
|
||||
|
||||
@Excel(name = "B价格")
|
||||
private BigDecimal priceB;
|
||||
|
||||
@Excel(name = "C价格")
|
||||
private BigDecimal priceC;
|
||||
|
||||
@Excel(name = "物流费用")
|
||||
private BigDecimal logisticsFee;
|
||||
|
||||
@Excel(name = "渐进多焦点", readConverterExp = "0=否,1=是")
|
||||
private Integer progressiveMultifocal;
|
||||
|
||||
@Excel(name = "渐进多焦点价格")
|
||||
private BigDecimal progressiveMultifocalPrice;
|
||||
|
||||
@Excel(name = "订单状态", dictType = "jy_order_status")
|
||||
private String orderStatus;
|
||||
|
||||
/** 订单状态 IN 查询(逗号分隔,如 2,20) */
|
||||
private String orderStatusIn;
|
||||
|
||||
@Excel(name = "采购结算状态", readConverterExp = "0=未结算,1=已结算")
|
||||
private String purchaseSettleStatus;
|
||||
|
||||
@Excel(name = "销售结算状态", readConverterExp = "0=未结算,1=已结算")
|
||||
private String saleSettleStatus;
|
||||
|
||||
@Excel(name = "收货人姓名")
|
||||
private String receiverName;
|
||||
|
||||
@Excel(name = "收货人手机号")
|
||||
private String receiverPhone;
|
||||
|
||||
@Excel(name = "收货人地址")
|
||||
private String receiverAddress;
|
||||
|
||||
private String attachment;
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
private List<JySysOrderOptometry> optometryList;
|
||||
|
||||
private List<JySysOrderStatusLog> statusLogList;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public Long getBrandTenantId()
|
||||
{
|
||||
return brandTenantId;
|
||||
}
|
||||
|
||||
public void setBrandTenantId(Long brandTenantId)
|
||||
{
|
||||
this.brandTenantId = brandTenantId;
|
||||
}
|
||||
|
||||
public String getBrandTenantName()
|
||||
{
|
||||
return brandTenantName;
|
||||
}
|
||||
|
||||
public void setBrandTenantName(String brandTenantName)
|
||||
{
|
||||
this.brandTenantName = brandTenantName;
|
||||
}
|
||||
|
||||
public Long getLensFactoryTenantId()
|
||||
{
|
||||
return lensFactoryTenantId;
|
||||
}
|
||||
|
||||
public void setLensFactoryTenantId(Long lensFactoryTenantId)
|
||||
{
|
||||
this.lensFactoryTenantId = lensFactoryTenantId;
|
||||
}
|
||||
|
||||
public String getLensFactoryTenantName()
|
||||
{
|
||||
return lensFactoryTenantName;
|
||||
}
|
||||
|
||||
public void setLensFactoryTenantName(String lensFactoryTenantName)
|
||||
{
|
||||
this.lensFactoryTenantName = lensFactoryTenantName;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductModel()
|
||||
{
|
||||
return productModel;
|
||||
}
|
||||
|
||||
public void setProductModel(String productModel)
|
||||
{
|
||||
this.productModel = productModel;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public Long getLensId()
|
||||
{
|
||||
return lensId;
|
||||
}
|
||||
|
||||
public void setLensId(Long lensId)
|
||||
{
|
||||
this.lensId = lensId;
|
||||
}
|
||||
|
||||
public String getLensProductName()
|
||||
{
|
||||
return lensProductName;
|
||||
}
|
||||
|
||||
public void setLensProductName(String lensProductName)
|
||||
{
|
||||
this.lensProductName = lensProductName;
|
||||
}
|
||||
|
||||
public String getLensMaterial()
|
||||
{
|
||||
return lensMaterial;
|
||||
}
|
||||
|
||||
public void setLensMaterial(String lensMaterial)
|
||||
{
|
||||
this.lensMaterial = lensMaterial;
|
||||
}
|
||||
|
||||
public BigDecimal getPriceB()
|
||||
{
|
||||
return priceB;
|
||||
}
|
||||
|
||||
public void setPriceB(BigDecimal priceB)
|
||||
{
|
||||
this.priceB = priceB;
|
||||
}
|
||||
|
||||
public BigDecimal getPriceC()
|
||||
{
|
||||
return priceC;
|
||||
}
|
||||
|
||||
public void setPriceC(BigDecimal priceC)
|
||||
{
|
||||
this.priceC = priceC;
|
||||
}
|
||||
|
||||
public BigDecimal getLogisticsFee()
|
||||
{
|
||||
return logisticsFee;
|
||||
}
|
||||
|
||||
public void setLogisticsFee(BigDecimal logisticsFee)
|
||||
{
|
||||
this.logisticsFee = logisticsFee;
|
||||
}
|
||||
|
||||
public Integer getProgressiveMultifocal()
|
||||
{
|
||||
return progressiveMultifocal;
|
||||
}
|
||||
|
||||
public void setProgressiveMultifocal(Integer progressiveMultifocal)
|
||||
{
|
||||
this.progressiveMultifocal = progressiveMultifocal;
|
||||
}
|
||||
|
||||
public BigDecimal getProgressiveMultifocalPrice()
|
||||
{
|
||||
return progressiveMultifocalPrice;
|
||||
}
|
||||
|
||||
public void setProgressiveMultifocalPrice(BigDecimal progressiveMultifocalPrice)
|
||||
{
|
||||
this.progressiveMultifocalPrice = progressiveMultifocalPrice;
|
||||
}
|
||||
|
||||
public String getOrderStatus()
|
||||
{
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public void setOrderStatus(String orderStatus)
|
||||
{
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
|
||||
public String getOrderStatusIn()
|
||||
{
|
||||
return orderStatusIn;
|
||||
}
|
||||
|
||||
public void setOrderStatusIn(String orderStatusIn)
|
||||
{
|
||||
this.orderStatusIn = orderStatusIn;
|
||||
}
|
||||
|
||||
public String getPurchaseSettleStatus()
|
||||
{
|
||||
return purchaseSettleStatus;
|
||||
}
|
||||
|
||||
public void setPurchaseSettleStatus(String purchaseSettleStatus)
|
||||
{
|
||||
this.purchaseSettleStatus = purchaseSettleStatus;
|
||||
}
|
||||
|
||||
public String getSaleSettleStatus()
|
||||
{
|
||||
return saleSettleStatus;
|
||||
}
|
||||
|
||||
public void setSaleSettleStatus(String saleSettleStatus)
|
||||
{
|
||||
this.saleSettleStatus = saleSettleStatus;
|
||||
}
|
||||
|
||||
public String getReceiverName()
|
||||
{
|
||||
return receiverName;
|
||||
}
|
||||
|
||||
public void setReceiverName(String receiverName)
|
||||
{
|
||||
this.receiverName = receiverName;
|
||||
}
|
||||
|
||||
public String getReceiverPhone()
|
||||
{
|
||||
return receiverPhone;
|
||||
}
|
||||
|
||||
public void setReceiverPhone(String receiverPhone)
|
||||
{
|
||||
this.receiverPhone = receiverPhone;
|
||||
}
|
||||
|
||||
public String getReceiverAddress()
|
||||
{
|
||||
return receiverAddress;
|
||||
}
|
||||
|
||||
public void setReceiverAddress(String receiverAddress)
|
||||
{
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public String getAttachment()
|
||||
{
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public void setAttachment(String attachment)
|
||||
{
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public List<JySysOrderOptometry> getOptometryList()
|
||||
{
|
||||
return optometryList;
|
||||
}
|
||||
|
||||
public void setOptometryList(List<JySysOrderOptometry> optometryList)
|
||||
{
|
||||
this.optometryList = optometryList;
|
||||
}
|
||||
|
||||
public List<JySysOrderStatusLog> getStatusLogList()
|
||||
{
|
||||
return statusLogList;
|
||||
}
|
||||
|
||||
public void setStatusLogList(List<JySysOrderStatusLog> statusLogList)
|
||||
{
|
||||
this.statusLogList = statusLogList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("brandTenantId", getBrandTenantId())
|
||||
.append("lensFactoryTenantId", getLensFactoryTenantId())
|
||||
.append("productId", getProductId())
|
||||
.append("lensId", getLensId())
|
||||
.append("priceB", getPriceB())
|
||||
.append("priceC", getPriceC())
|
||||
.append("logisticsFee", getLogisticsFee())
|
||||
.append("progressiveMultifocal", getProgressiveMultifocal())
|
||||
.append("orderStatus", getOrderStatus())
|
||||
.append("purchaseSettleStatus", getPurchaseSettleStatus())
|
||||
.append("saleSettleStatus", getSaleSettleStatus())
|
||||
.append("receiverName", getReceiverName())
|
||||
.append("receiverPhone", getReceiverPhone())
|
||||
.append("receiverAddress", getReceiverAddress())
|
||||
.append("attachment", getAttachment())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 订单验光对象 jy_sys_order_optometry
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysOrderOptometry
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
/** 左右区分(OS左眼 OD右眼) */
|
||||
private String eyeSide;
|
||||
|
||||
/** 球镜S */
|
||||
private BigDecimal sphereS;
|
||||
|
||||
/** 柱镜C */
|
||||
private BigDecimal cylinderC;
|
||||
|
||||
/** 轴位A */
|
||||
private Integer axisA;
|
||||
|
||||
/** 单瞳距 */
|
||||
private BigDecimal pd;
|
||||
|
||||
/** 双瞳距(按eye_side区分左右) */
|
||||
private BigDecimal dualPd;
|
||||
|
||||
/** 瞳距类型(1单瞳距 2双瞳距) */
|
||||
private String pdType;
|
||||
|
||||
/** 瞳高 */
|
||||
private BigDecimal pupilHeight;
|
||||
|
||||
/** 远用VA */
|
||||
private String distanceVa;
|
||||
|
||||
/** 近用ADD */
|
||||
private BigDecimal nearAdd;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getEyeSide()
|
||||
{
|
||||
return eyeSide;
|
||||
}
|
||||
|
||||
public void setEyeSide(String eyeSide)
|
||||
{
|
||||
this.eyeSide = eyeSide;
|
||||
}
|
||||
|
||||
public BigDecimal getSphereS()
|
||||
{
|
||||
return sphereS;
|
||||
}
|
||||
|
||||
public void setSphereS(BigDecimal sphereS)
|
||||
{
|
||||
this.sphereS = sphereS;
|
||||
}
|
||||
|
||||
public BigDecimal getCylinderC()
|
||||
{
|
||||
return cylinderC;
|
||||
}
|
||||
|
||||
public void setCylinderC(BigDecimal cylinderC)
|
||||
{
|
||||
this.cylinderC = cylinderC;
|
||||
}
|
||||
|
||||
public Integer getAxisA()
|
||||
{
|
||||
return axisA;
|
||||
}
|
||||
|
||||
public void setAxisA(Integer axisA)
|
||||
{
|
||||
this.axisA = axisA;
|
||||
}
|
||||
|
||||
public BigDecimal getPd()
|
||||
{
|
||||
return pd;
|
||||
}
|
||||
|
||||
public void setPd(BigDecimal pd)
|
||||
{
|
||||
this.pd = pd;
|
||||
}
|
||||
|
||||
public BigDecimal getDualPd()
|
||||
{
|
||||
return dualPd;
|
||||
}
|
||||
|
||||
public void setDualPd(BigDecimal dualPd)
|
||||
{
|
||||
this.dualPd = dualPd;
|
||||
}
|
||||
|
||||
public String getPdType()
|
||||
{
|
||||
return pdType;
|
||||
}
|
||||
|
||||
public void setPdType(String pdType)
|
||||
{
|
||||
this.pdType = pdType;
|
||||
}
|
||||
|
||||
public BigDecimal getPupilHeight()
|
||||
{
|
||||
return pupilHeight;
|
||||
}
|
||||
|
||||
public void setPupilHeight(BigDecimal pupilHeight)
|
||||
{
|
||||
this.pupilHeight = pupilHeight;
|
||||
}
|
||||
|
||||
public String getDistanceVa()
|
||||
{
|
||||
return distanceVa;
|
||||
}
|
||||
|
||||
public void setDistanceVa(String distanceVa)
|
||||
{
|
||||
this.distanceVa = distanceVa;
|
||||
}
|
||||
|
||||
public BigDecimal getNearAdd()
|
||||
{
|
||||
return nearAdd;
|
||||
}
|
||||
|
||||
public void setNearAdd(BigDecimal nearAdd)
|
||||
{
|
||||
this.nearAdd = nearAdd;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("eyeSide", getEyeSide())
|
||||
.append("sphereS", getSphereS())
|
||||
.append("cylinderC", getCylinderC())
|
||||
.append("axisA", getAxisA())
|
||||
.append("pd", getPd())
|
||||
.append("dualPd", getDualPd())
|
||||
.append("pdType", getPdType())
|
||||
.append("pupilHeight", getPupilHeight())
|
||||
.append("distanceVa", getDistanceVa())
|
||||
.append("nearAdd", getNearAdd())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 订单状态变更对象 jy_sys_order_status_log
|
||||
*/
|
||||
public class JySysOrderStatusLog
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String orderStatus;
|
||||
|
||||
private String expressCompany;
|
||||
|
||||
private String expressNo;
|
||||
|
||||
private BigDecimal logisticsFee;
|
||||
|
||||
/** 应收结算状态(0未结算 1已结算) */
|
||||
private String saleSettleStatus;
|
||||
|
||||
/** 应付结算状态(0未结算 1已结算) */
|
||||
private String purchaseSettleStatus;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String operator;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date operateTime;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderStatus()
|
||||
{
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public void setOrderStatus(String orderStatus)
|
||||
{
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
|
||||
public String getExpressCompany()
|
||||
{
|
||||
return expressCompany;
|
||||
}
|
||||
|
||||
public void setExpressCompany(String expressCompany)
|
||||
{
|
||||
this.expressCompany = expressCompany;
|
||||
}
|
||||
|
||||
public String getExpressNo()
|
||||
{
|
||||
return expressNo;
|
||||
}
|
||||
|
||||
public void setExpressNo(String expressNo)
|
||||
{
|
||||
this.expressNo = expressNo;
|
||||
}
|
||||
|
||||
public BigDecimal getLogisticsFee()
|
||||
{
|
||||
return logisticsFee;
|
||||
}
|
||||
|
||||
public void setLogisticsFee(BigDecimal logisticsFee)
|
||||
{
|
||||
this.logisticsFee = logisticsFee;
|
||||
}
|
||||
|
||||
public String getSaleSettleStatus()
|
||||
{
|
||||
return saleSettleStatus;
|
||||
}
|
||||
|
||||
public void setSaleSettleStatus(String saleSettleStatus)
|
||||
{
|
||||
this.saleSettleStatus = saleSettleStatus;
|
||||
}
|
||||
|
||||
public String getPurchaseSettleStatus()
|
||||
{
|
||||
return purchaseSettleStatus;
|
||||
}
|
||||
|
||||
public void setPurchaseSettleStatus(String purchaseSettleStatus)
|
||||
{
|
||||
this.purchaseSettleStatus = purchaseSettleStatus;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getOperator()
|
||||
{
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator)
|
||||
{
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public Date getOperateTime()
|
||||
{
|
||||
return operateTime;
|
||||
}
|
||||
|
||||
public void setOperateTime(Date operateTime)
|
||||
{
|
||||
this.operateTime = operateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderStatus", getOrderStatus())
|
||||
.append("expressCompany", getExpressCompany())
|
||||
.append("expressNo", getExpressNo())
|
||||
.append("logisticsFee", getLogisticsFee())
|
||||
.append("saleSettleStatus", getSaleSettleStatus())
|
||||
.append("purchaseSettleStatus", getPurchaseSettleStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("operator", getOperator())
|
||||
.append("operateTime", getOperateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品对象 jy_sys_product
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 产品型号 */
|
||||
@Excel(name = "产品型号")
|
||||
private String productModel;
|
||||
|
||||
/** 产品名称 */
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/** 所属产品系列 */
|
||||
@Excel(name = "所属产品系列")
|
||||
private String productSeries;
|
||||
|
||||
/** 专属品牌方租户ID */
|
||||
private Long brandTenantId;
|
||||
|
||||
/** 专属品牌方名称 */
|
||||
@Excel(name = "专属品牌方")
|
||||
private String brandTenantName;
|
||||
|
||||
/** 可配镜片类型(多选,逗号分隔镜片ID) */
|
||||
private String lensIds;
|
||||
|
||||
/** 可配镜片类型名称 */
|
||||
@Excel(name = "可配镜片类型")
|
||||
private String lensNames;
|
||||
|
||||
/** 状态(0启用 1停用) */
|
||||
@Excel(name = "是否启用", readConverterExp = "0=启用,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0正常 1已删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProductModel()
|
||||
{
|
||||
return productModel;
|
||||
}
|
||||
|
||||
public void setProductModel(String productModel)
|
||||
{
|
||||
this.productModel = productModel;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductSeries()
|
||||
{
|
||||
return productSeries;
|
||||
}
|
||||
|
||||
public void setProductSeries(String productSeries)
|
||||
{
|
||||
this.productSeries = productSeries;
|
||||
}
|
||||
|
||||
public Long getBrandTenantId()
|
||||
{
|
||||
return brandTenantId;
|
||||
}
|
||||
|
||||
public void setBrandTenantId(Long brandTenantId)
|
||||
{
|
||||
this.brandTenantId = brandTenantId;
|
||||
}
|
||||
|
||||
public String getBrandTenantName()
|
||||
{
|
||||
return brandTenantName;
|
||||
}
|
||||
|
||||
public void setBrandTenantName(String brandTenantName)
|
||||
{
|
||||
this.brandTenantName = brandTenantName;
|
||||
}
|
||||
|
||||
public String getLensIds()
|
||||
{
|
||||
return lensIds;
|
||||
}
|
||||
|
||||
public void setLensIds(String lensIds)
|
||||
{
|
||||
this.lensIds = lensIds;
|
||||
}
|
||||
|
||||
public String getLensNames()
|
||||
{
|
||||
return lensNames;
|
||||
}
|
||||
|
||||
public void setLensNames(String lensNames)
|
||||
{
|
||||
this.lensNames = lensNames;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productModel", getProductModel())
|
||||
.append("productName", getProductName())
|
||||
.append("productSeries", getProductSeries())
|
||||
.append("brandTenantId", getBrandTenantId())
|
||||
.append("brandTenantName", getBrandTenantName())
|
||||
.append("lensIds", getLensIds())
|
||||
.append("lensNames", getLensNames())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.jysystem.dto.TenantLensSaveDTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 租户对象 jy_sys_tenant
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public class JySysTenant extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 租户编码 */
|
||||
@Excel(name = "租户编码")
|
||||
private String code;
|
||||
|
||||
/** 租户名称 */
|
||||
@Excel(name = "租户名称")
|
||||
private String name;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
private String phone;
|
||||
|
||||
/** 联系人 */
|
||||
@Excel(name = "联系人")
|
||||
private String contacts;
|
||||
|
||||
/** 地址 */
|
||||
@Excel(name = "地址")
|
||||
private String addr;
|
||||
|
||||
/** 租户类型 */
|
||||
@Excel(name = "租户类型", dictType = "tenant_type")
|
||||
private String tenantType;
|
||||
|
||||
/** 渐进多焦点价格 */
|
||||
@Excel(name = "渐进多焦点价格")
|
||||
private BigDecimal progressiveMultifocalPrice;
|
||||
|
||||
/** 关联产品名称(列表展示用,来自 jy_sys_tenant_product) */
|
||||
@Excel(name = "关联产品")
|
||||
private String tenantProductNames;
|
||||
|
||||
/** 关联产品数量(列表展示用) */
|
||||
private Integer tenantProductCount;
|
||||
|
||||
/** 可配镜片数量(列表展示用) */
|
||||
private Integer tenantLensCount;
|
||||
|
||||
/** 可配镜片材质(列表展示用,空格分隔) */
|
||||
private String tenantLensMaterials;
|
||||
|
||||
/** 关联产品ID列表(新增租户时用,非数据库字段) */
|
||||
private java.util.List<Long> productIds;
|
||||
|
||||
/** 可配镜片ID列表(新增租户时用,非数据库字段,兼容旧逻辑) */
|
||||
private java.util.List<Long> lensIds;
|
||||
|
||||
/** 可配镜片及价格(新增租户时用,非数据库字段) */
|
||||
private java.util.List<TenantLensSaveDTO.TenantLensItemDTO> lensItems;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志: 0正常,1-删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setContacts(String contacts)
|
||||
{
|
||||
this.contacts = contacts;
|
||||
}
|
||||
|
||||
public String getContacts()
|
||||
{
|
||||
return contacts;
|
||||
}
|
||||
public void setAddr(String addr)
|
||||
{
|
||||
this.addr = addr;
|
||||
}
|
||||
|
||||
public String getAddr()
|
||||
{
|
||||
return addr;
|
||||
}
|
||||
public void setTenantType(String tenantType)
|
||||
{
|
||||
this.tenantType = tenantType;
|
||||
}
|
||||
|
||||
public String getTenantType()
|
||||
{
|
||||
return tenantType;
|
||||
}
|
||||
public BigDecimal getProgressiveMultifocalPrice()
|
||||
{
|
||||
return progressiveMultifocalPrice;
|
||||
}
|
||||
public void setProgressiveMultifocalPrice(BigDecimal progressiveMultifocalPrice)
|
||||
{
|
||||
this.progressiveMultifocalPrice = progressiveMultifocalPrice;
|
||||
}
|
||||
public String getTenantProductNames()
|
||||
{
|
||||
return tenantProductNames;
|
||||
}
|
||||
public void setTenantProductNames(String tenantProductNames)
|
||||
{
|
||||
this.tenantProductNames = tenantProductNames;
|
||||
}
|
||||
public Integer getTenantProductCount()
|
||||
{
|
||||
return tenantProductCount;
|
||||
}
|
||||
public void setTenantProductCount(Integer tenantProductCount)
|
||||
{
|
||||
this.tenantProductCount = tenantProductCount;
|
||||
}
|
||||
public Integer getTenantLensCount()
|
||||
{
|
||||
return tenantLensCount;
|
||||
}
|
||||
public void setTenantLensCount(Integer tenantLensCount)
|
||||
{
|
||||
this.tenantLensCount = tenantLensCount;
|
||||
}
|
||||
public String getTenantLensMaterials()
|
||||
{
|
||||
return tenantLensMaterials;
|
||||
}
|
||||
public void setTenantLensMaterials(String tenantLensMaterials)
|
||||
{
|
||||
this.tenantLensMaterials = tenantLensMaterials;
|
||||
}
|
||||
public java.util.List<Long> getProductIds()
|
||||
{
|
||||
return productIds;
|
||||
}
|
||||
public void setProductIds(java.util.List<Long> productIds)
|
||||
{
|
||||
this.productIds = productIds;
|
||||
}
|
||||
public java.util.List<Long> getLensIds()
|
||||
{
|
||||
return lensIds;
|
||||
}
|
||||
public void setLensIds(java.util.List<Long> lensIds)
|
||||
{
|
||||
this.lensIds = lensIds;
|
||||
}
|
||||
public java.util.List<TenantLensSaveDTO.TenantLensItemDTO> getLensItems()
|
||||
{
|
||||
return lensItems;
|
||||
}
|
||||
public void setLensItems(java.util.List<TenantLensSaveDTO.TenantLensItemDTO> lensItems)
|
||||
{
|
||||
this.lensItems = lensItems;
|
||||
}
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("phone", getPhone())
|
||||
.append("contacts", getContacts())
|
||||
.append("addr", getAddr())
|
||||
.append("tenantType", getTenantType())
|
||||
.append("progressiveMultifocalPrice", getProgressiveMultifocalPrice())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户可配镜片对象 jy_sys_tenant_lens
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysTenantLens extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Long lensId;
|
||||
|
||||
private BigDecimal costPrice;
|
||||
|
||||
private BigDecimal salePrice;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public Long getLensId()
|
||||
{
|
||||
return lensId;
|
||||
}
|
||||
|
||||
public void setLensId(Long lensId)
|
||||
{
|
||||
this.lensId = lensId;
|
||||
}
|
||||
|
||||
public BigDecimal getCostPrice()
|
||||
{
|
||||
return costPrice;
|
||||
}
|
||||
|
||||
public void setCostPrice(BigDecimal costPrice)
|
||||
{
|
||||
this.costPrice = costPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getSalePrice()
|
||||
{
|
||||
return salePrice;
|
||||
}
|
||||
|
||||
public void setSalePrice(BigDecimal salePrice)
|
||||
{
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 租户消息对象 jy_sys_tenant_message
|
||||
*/
|
||||
public class JySysTenantMessage
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String TYPE_STATUS_CHANGE = "order_status_change";
|
||||
|
||||
public static final String TYPE_ORDER_ASSIGNED = "order_assigned";
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String orderNo;
|
||||
|
||||
private String messageType;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
private String orderStatus;
|
||||
|
||||
private String readFlag;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getMessageType()
|
||||
{
|
||||
return messageType;
|
||||
}
|
||||
|
||||
public void setMessageType(String messageType)
|
||||
{
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getOrderStatus()
|
||||
{
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public void setOrderStatus(String orderStatus)
|
||||
{
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
|
||||
public String getReadFlag()
|
||||
{
|
||||
return readFlag;
|
||||
}
|
||||
|
||||
public void setReadFlag(String readFlag)
|
||||
{
|
||||
this.readFlag = readFlag;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("tenantId", getTenantId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("messageType", getMessageType())
|
||||
.append("title", getTitle())
|
||||
.append("content", getContent())
|
||||
.append("orderStatus", getOrderStatus())
|
||||
.append("readFlag", getReadFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户关联产品对象 jy_sys_tenant_product
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class JySysTenantProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Long productId;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
public class JyToken {
|
||||
|
||||
private String token;
|
||||
|
||||
private long expireDate;
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public long getExpireDate() {
|
||||
return expireDate;
|
||||
}
|
||||
|
||||
public void setExpireDate(long expireDate) {
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
}
|
||||
154
jy-system/src/main/java/com/ruoyi/jysystem/domain/JyUser.java
Normal file
154
jy-system/src/main/java/com/ruoyi/jysystem/domain/JyUser.java
Normal file
@@ -0,0 +1,154 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
public class JyUser {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Excel(name = "用户序号", type = Excel.Type.EXPORT, cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Excel(name = "手机号码", cellType = Excel.ColumnType.TEXT)
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long userId) {
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
public class JyVerifyUUID {
|
||||
|
||||
private String uuid;
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.jysystem.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 实名认证对象 sys_real_name_auth
|
||||
*
|
||||
* @author jueyuan
|
||||
*/
|
||||
public class SysRealNameAuth extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 认证类别:1-个人认证,2-企业认证,3-其他 */
|
||||
@Excel(name = "认证类别", readConverterExp = "1=个人认证,2=企业认证,3=其他")
|
||||
private Integer authType;
|
||||
|
||||
/** 名称(个人姓名/企业名称) */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 证件类型:1-身份证,2-护照,3-驾驶证,4-营业执照,5-其他 */
|
||||
@Excel(name = "证件类型", readConverterExp = "1=身份证,2=护照,3=驾驶证,4=营业执照,5=其他")
|
||||
private Integer idType;
|
||||
|
||||
/** 证件号码 */
|
||||
@Excel(name = "证件号码")
|
||||
private String idNumber;
|
||||
|
||||
/** 手机号 */
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
/** 法人姓名(企业认证) */
|
||||
@Excel(name = "法人姓名")
|
||||
private String legalPersonName;
|
||||
|
||||
/** 证件正面照 */
|
||||
private String frontPhoto;
|
||||
|
||||
/** 证件背面照 */
|
||||
private String backPhoto;
|
||||
|
||||
/** 审核状态:0-待审核,1-审核通过,2-审核拒绝,3-审核中 */
|
||||
@Excel(name = "审核状态", readConverterExp = "0=待审核,1=审核通过,2=审核拒绝,3=审核中")
|
||||
private Integer auditStatus;
|
||||
|
||||
/** 审核备注 */
|
||||
private String auditRemark;
|
||||
|
||||
/** 审核时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
|
||||
/** 审核人ID */
|
||||
private Long auditorId;
|
||||
|
||||
/** 创建人ID */
|
||||
private Long creatorBy;
|
||||
|
||||
/** 创建人用户名(不入库,列表展示用) */
|
||||
private String creatorUserName;
|
||||
|
||||
/** 创建人手机号(不入库,列表展示用) */
|
||||
private String creatorMobile;
|
||||
/** 更新人ID */
|
||||
private Long updaterBy;
|
||||
|
||||
/** 是否删除:0-未删除,1-已删除 */
|
||||
private Integer isDeleted;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Integer getAuthType() { return authType; }
|
||||
public void setAuthType(Integer authType) { this.authType = authType; }
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public Integer getIdType() { return idType; }
|
||||
public void setIdType(Integer idType) { this.idType = idType; }
|
||||
public String getIdNumber() { return idNumber; }
|
||||
public void setIdNumber(String idNumber) { this.idNumber = idNumber; }
|
||||
|
||||
public String getPhone() { return phone; }
|
||||
public void setPhone(String phone) { this.phone = phone; }
|
||||
|
||||
public String getLegalPersonName() { return legalPersonName; }
|
||||
public void setLegalPersonName(String legalPersonName) { this.legalPersonName = legalPersonName; }
|
||||
|
||||
public String getFrontPhoto() { return frontPhoto; }
|
||||
public void setFrontPhoto(String frontPhoto) { this.frontPhoto = frontPhoto; }
|
||||
public String getBackPhoto() { return backPhoto; }
|
||||
public void setBackPhoto(String backPhoto) { this.backPhoto = backPhoto; }
|
||||
public Integer getAuditStatus() { return auditStatus; }
|
||||
public void setAuditStatus(Integer auditStatus) { this.auditStatus = auditStatus; }
|
||||
public String getAuditRemark() { return auditRemark; }
|
||||
public void setAuditRemark(String auditRemark) { this.auditRemark = auditRemark; }
|
||||
public Date getAuditTime() { return auditTime; }
|
||||
public void setAuditTime(Date auditTime) { this.auditTime = auditTime; }
|
||||
public Long getAuditorId() { return auditorId; }
|
||||
public void setAuditorId(Long auditorId) { this.auditorId = auditorId; }
|
||||
public Long getCreatorBy() { return creatorBy; }
|
||||
public void setCreatorBy(Long creatorBy) { this.creatorBy = creatorBy; }
|
||||
public String getCreatorUserName() { return creatorUserName; }
|
||||
public void setCreatorUserName(String creatorUserName) { this.creatorUserName = creatorUserName; }
|
||||
public String getCreatorMobile() { return creatorMobile; }
|
||||
public void setCreatorMobile(String creatorMobile) { this.creatorMobile = creatorMobile; }
|
||||
public Long getUpdaterBy() { return updaterBy; }
|
||||
public void setUpdaterBy(Long updaterBy) { this.updaterBy = updaterBy; }
|
||||
public Integer getIsDeleted() { return isDeleted; }
|
||||
public void setIsDeleted(Integer isDeleted) { this.isDeleted = isDeleted; }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 生成费用结算单请求
|
||||
*/
|
||||
public class FeeSettlementGenerateDTO
|
||||
{
|
||||
/** 结算年月 yyyy-MM */
|
||||
private String settleYearMonth;
|
||||
|
||||
/** 是否强制删除后重新生成 */
|
||||
private Boolean forceRegenerate;
|
||||
|
||||
public String getSettleYearMonth()
|
||||
{
|
||||
return settleYearMonth;
|
||||
}
|
||||
|
||||
public void setSettleYearMonth(String settleYearMonth)
|
||||
{
|
||||
this.settleYearMonth = settleYearMonth;
|
||||
}
|
||||
|
||||
public Boolean getForceRegenerate()
|
||||
{
|
||||
return forceRegenerate;
|
||||
}
|
||||
|
||||
public void setForceRegenerate(Boolean forceRegenerate)
|
||||
{
|
||||
this.forceRegenerate = forceRegenerate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 管理端订单驳回请求
|
||||
*/
|
||||
public class OrderAdminRejectDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String reason;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 订单分配镜片厂请求
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class OrderAssignDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private Long lensFactoryTenantId;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getLensFactoryTenantId()
|
||||
{
|
||||
return lensFactoryTenantId;
|
||||
}
|
||||
|
||||
public void setLensFactoryTenantId(Long lensFactoryTenantId)
|
||||
{
|
||||
this.lensFactoryTenantId = lensFactoryTenantId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 管理端订单关闭请求
|
||||
*/
|
||||
public class OrderCloseDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 配片单换货申请请求
|
||||
*/
|
||||
public class OrderPortalExchangeDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String reason;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 制片单驳回请求
|
||||
*/
|
||||
public class OrderPortalRejectDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String reason;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 配片单重新提交请求
|
||||
*/
|
||||
public class OrderPortalResubmitDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String reason;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 制片单发货请求
|
||||
*/
|
||||
public class OrderPortalShipDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String expressCompany;
|
||||
|
||||
private String expressNo;
|
||||
|
||||
private BigDecimal logisticsFee;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getExpressCompany()
|
||||
{
|
||||
return expressCompany;
|
||||
}
|
||||
|
||||
public void setExpressCompany(String expressCompany)
|
||||
{
|
||||
this.expressCompany = expressCompany;
|
||||
}
|
||||
|
||||
public String getExpressNo()
|
||||
{
|
||||
return expressNo;
|
||||
}
|
||||
|
||||
public void setExpressNo(String expressNo)
|
||||
{
|
||||
this.expressNo = expressNo;
|
||||
}
|
||||
|
||||
public BigDecimal getLogisticsFee()
|
||||
{
|
||||
return logisticsFee;
|
||||
}
|
||||
|
||||
public void setLogisticsFee(BigDecimal logisticsFee)
|
||||
{
|
||||
this.logisticsFee = logisticsFee;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 制片单补充请求
|
||||
*/
|
||||
public class OrderPortalSupplementDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String remark;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 制片单撤单请求
|
||||
*/
|
||||
public class OrderPortalWithdrawDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String reason;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
/**
|
||||
* 订单状态变更请求
|
||||
*/
|
||||
public class OrderStatusChangeDTO
|
||||
{
|
||||
private Long orderId;
|
||||
|
||||
private String orderStatus;
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderStatus()
|
||||
{
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public void setOrderStatus(String orderStatus)
|
||||
{
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户镜片配置保存DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TenantLensSaveDTO
|
||||
{
|
||||
private Long tenantId;
|
||||
|
||||
private List<TenantLensItemDTO> items;
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public List<TenantLensItemDTO> getItems()
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<TenantLensItemDTO> items)
|
||||
{
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public static class TenantLensItemDTO
|
||||
{
|
||||
private Long lensId;
|
||||
|
||||
private BigDecimal costPrice;
|
||||
|
||||
private BigDecimal salePrice;
|
||||
|
||||
public Long getLensId()
|
||||
{
|
||||
return lensId;
|
||||
}
|
||||
|
||||
public void setLensId(Long lensId)
|
||||
{
|
||||
this.lensId = lensId;
|
||||
}
|
||||
|
||||
public BigDecimal getCostPrice()
|
||||
{
|
||||
return costPrice;
|
||||
}
|
||||
|
||||
public void setCostPrice(BigDecimal costPrice)
|
||||
{
|
||||
this.costPrice = costPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getSalePrice()
|
||||
{
|
||||
return salePrice;
|
||||
}
|
||||
|
||||
public void setSalePrice(BigDecimal salePrice)
|
||||
{
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ruoyi.jysystem.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户产品配置保存DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TenantProductSaveDTO
|
||||
{
|
||||
private Long tenantId;
|
||||
|
||||
private List<Long> productIds;
|
||||
|
||||
public Long getTenantId()
|
||||
{
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId)
|
||||
{
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public List<Long> getProductIds()
|
||||
{
|
||||
return productIds;
|
||||
}
|
||||
|
||||
public void setProductIds(List<Long> productIds)
|
||||
{
|
||||
this.productIds = productIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.jysystem.enums;
|
||||
|
||||
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
|
||||
public enum RespEnum {
|
||||
OK(200, "成功"),
|
||||
BAD_REQUEST(400, "参数错误"),
|
||||
UNAUTHORIZED(401, "未认证"),
|
||||
FORBIDDEN(403, "无权限访问"),
|
||||
INTERNAL_SERVER_ERROR(500, "内部错误"),
|
||||
SERVICE_RESPONSE_TIMEOUT(501, "服务超时"),
|
||||
USERNAME_OR_PASSWORD_ERROR(900, "用户名或密码错误"),
|
||||
ACCOUNT_FROZEN(901, "账号已被冻结"),
|
||||
VALIDATE_CODE_EXPIRED(902, "验证码已过期"),
|
||||
VALIDATE_CODE_ERR(903, "验证码错误"),
|
||||
PASSWORD_ERROR(905, "密码错误"),
|
||||
RESPONSE_BODY_IS_NULL(904, "无响应体"),
|
||||
EXCEL_IMPORT_CELL_NOT_AVAILABLE(905, "字段异常"),
|
||||
ROLE_NOT_DELETED(906, "角色在使用不能删除"),
|
||||
CREATE_KEYCLOAK_USER_ERROR(907, "创建keycloak用户失败"),
|
||||
USER_ID_EXIST(908, "用户名已经存在"),
|
||||
USER_BE_FORBIDDEN(916, "用户被禁用"),
|
||||
ATTENDANCE_DATE_MUST_GREATER(910, "日期必须大于当前月的25日"),
|
||||
ATTENDANCE_ADJUST_DATA_IS_NULL(911, "请补充法定公休日数据"),
|
||||
NETWORK_CONNECTION_NOT_REACHABLE(912, "钉钉的接口地址不通"),
|
||||
SYNC_PROGRAM_ALREADY_RUNNING(913, "同步任务已经启动,请查看日志执行是否成功"),
|
||||
NO_DATA(915, "无数据"),
|
||||
DUPLICATE_PROJECT_NAME(918, "名称重复"),
|
||||
UNSUPPORTED_ENCODING(605, "不支持的编码异常"),
|
||||
FILE_NOT_FOUND(606, "文件没找到"),
|
||||
NULL_POINTER(607, "空指针异常"),
|
||||
EXCEPTION(608, "其他异常"),
|
||||
SCHOOL_ID_ERROR(614, "学校id错误"),
|
||||
CASE_ID_NOT_EXIST(615, "病例id不存在"),
|
||||
ID_LIST_TYPE_ERROR(616, "操作类型参数错误"),
|
||||
ID_COUNT_MUST_GT_2(617, "关联的聚集数必须大于等于2"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
RespEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static RespEnum getByCode(int code) {
|
||||
for (RespEnum values : RespEnum.values()) {
|
||||
if (code == values.getCode()) {
|
||||
return values;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.jysystem.exception;
|
||||
|
||||
|
||||
|
||||
import com.ruoyi.jysystem.enums.RespEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinessException extends RuntimeException {
|
||||
private int code;
|
||||
private String message;
|
||||
private Object obj;
|
||||
|
||||
public BusinessException(RespEnum response){
|
||||
this.code = response.getCode();
|
||||
this.message = response.getMessage();
|
||||
}
|
||||
|
||||
public BusinessException(int code, String message){
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BusinessException(String message){
|
||||
this.code = 0;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.ruoyi.jysystem.exception;
|
||||
|
||||
|
||||
|
||||
import com.ruoyi.jysystem.enums.RespEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExcelImportException extends RuntimeException {
|
||||
private int code;
|
||||
private String message;
|
||||
private Object obj;
|
||||
|
||||
public ExcelImportException(RespEnum response){
|
||||
this.code = response.getCode();
|
||||
this.message = response.getMessage();
|
||||
}
|
||||
|
||||
public ExcelImportException(int code, String message){
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ExcelImportException(String message){
|
||||
this.code = 0;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ExcelImportException(int code, Object obj ){
|
||||
this.code = code;
|
||||
this.obj = obj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.ForumCategory;
|
||||
|
||||
/**
|
||||
* 论坛分类Mapper接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface ForumCategoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询论坛分类
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 论坛分类
|
||||
*/
|
||||
public ForumCategory selectForumCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛分类列表
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 论坛分类集合
|
||||
*/
|
||||
public List<ForumCategory> selectForumCategoryList(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 新增论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumCategory(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 修改论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumCategory(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 删除论坛分类
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除论坛分类
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumCategoryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 增加帖子数量
|
||||
*/
|
||||
public int incrementPostCount(Long id);
|
||||
|
||||
/**
|
||||
* 减少帖子数量
|
||||
*/
|
||||
public int decrementPostCount(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.jysystem.domain.ForumPost;
|
||||
|
||||
/**
|
||||
* 论坛帖子Mapper接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface ForumPostMapper
|
||||
{
|
||||
/**
|
||||
* 查询论坛帖子
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 论坛帖子
|
||||
*/
|
||||
public ForumPost selectForumPostById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛帖子列表
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 论坛帖子集合
|
||||
*/
|
||||
public List<ForumPost> selectForumPostList(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 新增论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumPost(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 修改论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumPost(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 删除论坛帖子
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumPostById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除论坛帖子
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumPostByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 增加浏览量
|
||||
*/
|
||||
public int incrementViewCount(Long id);
|
||||
|
||||
/**
|
||||
* 增加点赞数
|
||||
*/
|
||||
public int incrementLikeCount(Long id);
|
||||
|
||||
/**
|
||||
* 减少点赞数
|
||||
*/
|
||||
public int decrementLikeCount(Long id);
|
||||
|
||||
/**
|
||||
* 增加收藏数
|
||||
*/
|
||||
public int incrementFavoriteCount(Long id);
|
||||
|
||||
/**
|
||||
* 减少收藏数
|
||||
*/
|
||||
public int decrementFavoriteCount(Long id);
|
||||
|
||||
/**
|
||||
* 检查是否已点赞
|
||||
*/
|
||||
public int checkLike(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 插入点赞记录
|
||||
*/
|
||||
public int insertLike(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除点赞记录
|
||||
*/
|
||||
public int deleteLike(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 检查是否已收藏
|
||||
*/
|
||||
public int checkFavorite(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 插入收藏记录
|
||||
*/
|
||||
public int insertFavorite(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除收藏记录
|
||||
*/
|
||||
public int deleteFavorite(@Param("postId") Long postId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 标记为已解决
|
||||
*/
|
||||
public int markSolved(Long id);
|
||||
|
||||
/**
|
||||
* 取消已解决标记
|
||||
*/
|
||||
public int unmarkSolved(Long id);
|
||||
|
||||
/**
|
||||
* 置顶帖子
|
||||
*/
|
||||
public int setTop(Long id);
|
||||
|
||||
/**
|
||||
* 取消置顶
|
||||
*/
|
||||
public int unsetTop(Long id);
|
||||
|
||||
/**
|
||||
* 增加回复数
|
||||
*/
|
||||
public int incrementReplyCount(Long id);
|
||||
|
||||
/**
|
||||
* 更新最后回复信息
|
||||
*/
|
||||
public int updateLastReply(@Param("postId") Long postId, @Param("replyId") Long replyId, @Param("replyUser") String replyUser);
|
||||
|
||||
/**
|
||||
* 统计用户的帖子数
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 帖子数
|
||||
*/
|
||||
public int countPostsByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 统计用户获得的点赞总数(所有帖子的点赞数之和)
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 点赞总数
|
||||
*/
|
||||
public int sumLikeCountByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 统计用户点赞的帖子数
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 点赞的帖子数
|
||||
*/
|
||||
public int countLikedPostsByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 统计用户收藏的帖子数
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 收藏的帖子数
|
||||
*/
|
||||
public int countFavoritedPostsByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户点赞的帖子列表
|
||||
*/
|
||||
public List<ForumPost> selectLikedPostsByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户收藏的帖子列表
|
||||
*/
|
||||
public List<ForumPost> selectFavoritedPostsByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户发布的帖子列表
|
||||
*/
|
||||
public List<ForumPost> selectPostsByUserId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.jysystem.domain.ForumReply;
|
||||
|
||||
/**
|
||||
* 论坛回复Mapper接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface ForumReplyMapper
|
||||
{
|
||||
/**
|
||||
* 查询论坛回复
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 论坛回复
|
||||
*/
|
||||
public ForumReply selectForumReplyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛回复列表
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 论坛回复集合
|
||||
*/
|
||||
public List<ForumReply> selectForumReplyList(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 根据帖子ID查询回复列表
|
||||
*
|
||||
* @param postId 帖子ID
|
||||
* @return 论坛回复集合
|
||||
*/
|
||||
public List<ForumReply> selectForumReplyListByPostId(Long postId);
|
||||
|
||||
/**
|
||||
* 新增论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumReply(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 修改论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumReply(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 删除论坛回复
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumReplyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除论坛回复
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumReplyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 增加点赞数
|
||||
*/
|
||||
public int incrementLikeCount(Long id);
|
||||
|
||||
/**
|
||||
* 减少点赞数
|
||||
*/
|
||||
public int decrementLikeCount(Long id);
|
||||
|
||||
/**
|
||||
* 检查是否已点赞
|
||||
*/
|
||||
public int checkLike(@Param("replyId") Long replyId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 插入点赞记录
|
||||
*/
|
||||
public int insertLike(@Param("replyId") Long replyId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除点赞记录
|
||||
*/
|
||||
public int deleteLike(@Param("replyId") Long replyId, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 统计用户的回复数
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 回复数
|
||||
*/
|
||||
public int countRepliesByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户回复的帖子ID列表(去重)
|
||||
*/
|
||||
public List<Long> selectPostIdsByReplyUserId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlementItem;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface JySysFeeSettlementItemMapper
|
||||
{
|
||||
List<JySysFeeSettlementItem> selectBySettlementId(Long settlementId);
|
||||
|
||||
int insertJySysFeeSettlementItem(JySysFeeSettlementItem item);
|
||||
|
||||
int deleteBySettlementId(Long settlementId);
|
||||
|
||||
int deleteBySettlementIds(@Param("settlementIds") List<Long> settlementIds);
|
||||
|
||||
List<Long> selectIdsBySettlementId(Long settlementId);
|
||||
|
||||
List<Long> selectIdsBySettlementIds(@Param("settlementIds") List<Long> settlementIds);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlementLogistics;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface JySysFeeSettlementLogisticsMapper
|
||||
{
|
||||
List<JySysFeeSettlementLogistics> selectBySettlementItemId(Long settlementItemId);
|
||||
|
||||
List<JySysFeeSettlementLogistics> selectBySettlementItemIds(@Param("itemIds") List<Long> itemIds);
|
||||
|
||||
int insertJySysFeeSettlementLogistics(JySysFeeSettlementLogistics logistics);
|
||||
|
||||
int deleteBySettlementItemIds(@Param("itemIds") List<Long> itemIds);
|
||||
|
||||
List<Long> selectStatusLogIdsByYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlement;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface JySysFeeSettlementMapper
|
||||
{
|
||||
JySysFeeSettlement selectJySysFeeSettlementById(Long id);
|
||||
|
||||
List<JySysFeeSettlement> selectJySysFeeSettlementList(JySysFeeSettlement query);
|
||||
|
||||
int insertJySysFeeSettlement(JySysFeeSettlement settlement);
|
||||
|
||||
int deleteJySysFeeSettlementById(Long id);
|
||||
|
||||
int deleteJySysFeeSettlementByYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
|
||||
int countBySettleYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
|
||||
List<String> selectSettlementNosByYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
|
||||
int countBySettlementNoPrefix(@Param("prefix") String prefix);
|
||||
|
||||
List<Long> selectIdsByYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
|
||||
int updateSettleStatus(JySysFeeSettlement settlement);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.jysystem.domain.JySysLens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用镜片Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysLensMapper extends BaseMapper<JySysLens>
|
||||
{
|
||||
JySysLens selectJySysLensById(Long id);
|
||||
|
||||
List<JySysLens> selectJySysLensList(JySysLens jySysLens);
|
||||
|
||||
List<JySysLens> selectJySysLensOptions();
|
||||
|
||||
int insertJySysLens(JySysLens jySysLens);
|
||||
|
||||
int updateJySysLens(JySysLens jySysLens);
|
||||
|
||||
int deleteJySysLensById(Long id);
|
||||
|
||||
int deleteJySysLensByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysNews;
|
||||
|
||||
/**
|
||||
* 新闻动态Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-01
|
||||
*/
|
||||
public interface JySysNewsMapper
|
||||
{
|
||||
/**
|
||||
* 查询新闻动态
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 新闻动态
|
||||
*/
|
||||
public JySysNews selectJySysNewsByNewsId(Long newsId);
|
||||
|
||||
/**
|
||||
* 查询新闻动态列表
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 新闻动态集合
|
||||
*/
|
||||
public List<JySysNews> selectJySysNewsList(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 新增新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJySysNews(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 修改新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJySysNews(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 删除新闻动态
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysNewsByNewsId(Long newsId);
|
||||
|
||||
/**
|
||||
* 批量删除新闻动态
|
||||
*
|
||||
* @param newsIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysNewsByNewsIds(Long[] newsIds);
|
||||
|
||||
/**
|
||||
* 增加阅读量
|
||||
*
|
||||
* @param newsId 新闻ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int incrementViewCount(Long newsId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysOrderMapper extends BaseMapper<JySysOrder>
|
||||
{
|
||||
JySysOrder selectJySysOrderById(Long id);
|
||||
|
||||
List<JySysOrder> selectJySysOrderList(JySysOrder jySysOrder);
|
||||
|
||||
List<JySysOrder> selectJySysOrderByIds(@Param("ids") Long[] ids);
|
||||
|
||||
int insertJySysOrder(JySysOrder jySysOrder);
|
||||
|
||||
int updateJySysOrder(JySysOrder jySysOrder);
|
||||
|
||||
int deleteJySysOrderById(Long id);
|
||||
|
||||
int deleteJySysOrderByIds(Long[] ids);
|
||||
|
||||
int countByTenantId(@Param("tenantId") Long tenantId);
|
||||
|
||||
List<JySysOrder> selectCompletedOrdersByYearMonth(@Param("settleYearMonth") String settleYearMonth);
|
||||
|
||||
int updatePurchaseSettleStatusByOrderIds(@Param("orderIds") List<Long> orderIds,
|
||||
@Param("settleStatus") String settleStatus, @Param("updateBy") String updateBy);
|
||||
|
||||
int updateSaleSettleStatusByOrderIds(@Param("orderIds") List<Long> orderIds,
|
||||
@Param("settleStatus") String settleStatus, @Param("updateBy") String updateBy);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.ruoyi.jysystem.domain.JySysOrderOptometry;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单验光Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysOrderOptometryMapper
|
||||
{
|
||||
List<JySysOrderOptometry> selectJySysOrderOptometryByOrderId(Long orderId);
|
||||
|
||||
int insertJySysOrderOptometry(JySysOrderOptometry optometry);
|
||||
|
||||
int deleteJySysOrderOptometryByOrderId(Long orderId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.ruoyi.jysystem.domain.JySysOrderStatusLog;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 订单状态变更Mapper接口
|
||||
*/
|
||||
public interface JySysOrderStatusLogMapper
|
||||
{
|
||||
List<JySysOrderStatusLog> selectJySysOrderStatusLogByOrderId(Long orderId);
|
||||
|
||||
java.math.BigDecimal sumLogisticsFeeByOrderId(Long orderId);
|
||||
|
||||
int insertJySysOrderStatusLog(JySysOrderStatusLog statusLog);
|
||||
|
||||
List<JySysOrderStatusLog> selectUnsettledShipLogsByOrderIdAndType(@Param("orderId") Long orderId,
|
||||
@Param("settlementType") String settlementType);
|
||||
|
||||
int updateSaleSettleStatusByIds(@Param("ids") List<Long> ids, @Param("settleStatus") String settleStatus);
|
||||
|
||||
int updatePurchaseSettleStatusByIds(@Param("ids") List<Long> ids, @Param("settleStatus") String settleStatus);
|
||||
|
||||
int resetShipLogSettleStatusByOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.jysystem.domain.JySysProduct;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysProductMapper extends BaseMapper<JySysProduct>
|
||||
{
|
||||
JySysProduct selectJySysProductById(Long id);
|
||||
|
||||
List<JySysProduct> selectJySysProductList(JySysProduct jySysProduct);
|
||||
|
||||
List<JySysProduct> selectJySysProductOptions(@Param("tenantId") Long tenantId);
|
||||
|
||||
int insertJySysProduct(JySysProduct jySysProduct);
|
||||
|
||||
int updateJySysProduct(JySysProduct jySysProduct);
|
||||
|
||||
int deleteJySysProductById(Long id);
|
||||
|
||||
int deleteJySysProductByIds(Long[] ids);
|
||||
|
||||
int deleteJySysProductByBrandTenantId(@Param("brandTenantId") Long brandTenantId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.ruoyi.jysystem.domain.JySysTenantLens;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantLensVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户可配镜片Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysTenantLensMapper
|
||||
{
|
||||
List<JySysTenantLensVO> selectJySysTenantLensListByTenantId(@Param("tenantId") Long tenantId);
|
||||
|
||||
List<JySysTenantLensVO> selectJySysTenantLensByTenantIdAndLensIds(@Param("tenantId") Long tenantId, @Param("lensIds") List<Long> lensIds);
|
||||
|
||||
int insertJySysTenantLens(JySysTenantLens jySysTenantLens);
|
||||
|
||||
int deleteJySysTenantLensByTenantId(@Param("tenantId") Long tenantId);
|
||||
|
||||
int countByLensId(@Param("lensId") Long lensId);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface JySysTenantMapper
|
||||
{
|
||||
/**
|
||||
* 查询租户
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 租户
|
||||
*/
|
||||
public JySysTenant selectJySysTenantById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户列表
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 租户集合
|
||||
*/
|
||||
public List<JySysTenant> selectJySysTenantList(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 新增租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJySysTenant(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJySysTenant(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 删除租户
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysTenantById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysTenantByIds(Long[] ids);
|
||||
|
||||
public int updateJySysTenantStatus(JySysTenant jySysTenant);
|
||||
|
||||
public int updateUserStatusByTenantCode(@Param("tenantCode") String tenantCode, @Param("status") String status);
|
||||
|
||||
JySysTenant selectJySysTenantByCode(@Param("code") String code);
|
||||
|
||||
JySysTenant selectJySysTenantByName(@Param("name") String name);
|
||||
|
||||
List<JySysTenant> selectJySysTenantListByTypes(@Param("types") String[] types, @Param("status") String status);
|
||||
|
||||
List<JySysTenant> selectLensFactoryTenantsByLensId(@Param("lensId") Long lensId, @Param("types") String[] types, @Param("status") String status);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantMessage;
|
||||
|
||||
/**
|
||||
* 租户消息Mapper
|
||||
*/
|
||||
public interface JySysTenantMessageMapper
|
||||
{
|
||||
List<JySysTenantMessage> selectJySysTenantMessageList(JySysTenantMessage message);
|
||||
|
||||
int countUnreadByTenantId(Long tenantId);
|
||||
|
||||
int insertJySysTenantMessage(JySysTenantMessage message);
|
||||
|
||||
int markReadById(@Param("id") Long id, @Param("tenantId") Long tenantId);
|
||||
|
||||
int markAllReadByTenantId(Long tenantId);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import com.ruoyi.jysystem.domain.JySysTenantProduct;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantProductVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户关联产品Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface JySysTenantProductMapper
|
||||
{
|
||||
List<JySysTenantProductVO> selectJySysTenantProductListByTenantId(@Param("tenantId") Long tenantId);
|
||||
|
||||
int insertJySysTenantProduct(JySysTenantProduct tenantProduct);
|
||||
|
||||
int deleteJySysTenantProductByTenantId(@Param("tenantId") Long tenantId);
|
||||
|
||||
int countByTenantIdAndProductId(@Param("tenantId") Long tenantId, @Param("productId") Long productId);
|
||||
|
||||
int countByProductId(@Param("productId") Long productId);
|
||||
|
||||
int deleteByProductBrandTenantId(@Param("brandTenantId") Long brandTenantId);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.jysystem.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.SysRealNameAuth;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 实名认证Mapper接口
|
||||
*
|
||||
* @author jueyuan
|
||||
*/
|
||||
public interface SysRealNameAuthMapper {
|
||||
|
||||
SysRealNameAuth selectSysRealNameAuthById(Long id);
|
||||
|
||||
List<SysRealNameAuth> selectSysRealNameAuthList(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int insertSysRealNameAuth(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int updateSysRealNameAuth(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int deleteSysRealNameAuthById(Long id);
|
||||
|
||||
/** 根据用户ID查询其最新一条认证记录(未删除) */
|
||||
SysRealNameAuth selectByCreatorBy(@Param("creatorBy") Long creatorBy);
|
||||
|
||||
/** 审核:更新审核状态、备注、时间、审核人 */
|
||||
int updateAudit(@Param("id") Long id, @Param("auditStatus") Integer auditStatus,
|
||||
@Param("auditRemark") String auditRemark, @Param("auditorId") Long auditorId);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.ForumCategory;
|
||||
|
||||
/**
|
||||
* 论坛分类Service接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface IForumCategoryService
|
||||
{
|
||||
/**
|
||||
* 查询论坛分类
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 论坛分类
|
||||
*/
|
||||
public ForumCategory selectForumCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛分类列表
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 论坛分类集合
|
||||
*/
|
||||
public List<ForumCategory> selectForumCategoryList(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 新增论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumCategory(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 修改论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumCategory(ForumCategory forumCategory);
|
||||
|
||||
/**
|
||||
* 批量删除论坛分类
|
||||
*
|
||||
* @param ids 需要删除的论坛分类主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumCategoryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除论坛分类信息
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 增加帖子数量
|
||||
*
|
||||
* @param id 分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int incrementPostCount(Long id);
|
||||
|
||||
/**
|
||||
* 减少帖子数量
|
||||
*
|
||||
* @param id 分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int decrementPostCount(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.ForumPost;
|
||||
|
||||
/**
|
||||
* 论坛帖子Service接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface IForumPostService
|
||||
{
|
||||
/**
|
||||
* 查询论坛帖子
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 论坛帖子
|
||||
*/
|
||||
public ForumPost selectForumPostById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛帖子列表
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 论坛帖子集合
|
||||
*/
|
||||
public List<ForumPost> selectForumPostList(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 新增论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumPost(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 修改论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumPost(ForumPost forumPost);
|
||||
|
||||
/**
|
||||
* 批量删除论坛帖子
|
||||
*
|
||||
* @param ids 需要删除的论坛帖子主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumPostByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除论坛帖子信息
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumPostById(Long id);
|
||||
|
||||
/**
|
||||
* 增加浏览量
|
||||
*
|
||||
* @param id 帖子ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int incrementViewCount(Long id);
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*
|
||||
* @param id 帖子ID
|
||||
* @param userId 用户ID
|
||||
* @return 是否已点赞
|
||||
*/
|
||||
public boolean toggleLike(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* 收藏/取消收藏
|
||||
*
|
||||
* @param id 帖子ID
|
||||
* @param userId 用户ID
|
||||
* @return 是否已收藏
|
||||
*/
|
||||
public boolean toggleFavorite(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* 标记为已解决
|
||||
*
|
||||
* @param id 帖子ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int markSolved(Long id);
|
||||
|
||||
/**
|
||||
* 置顶/取消置顶(切换状态)
|
||||
*
|
||||
* @param id 帖子ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int toggleTop(Long id);
|
||||
|
||||
/**
|
||||
* 获取用户统计数据
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 统计数据(帖子数、点赞数)
|
||||
*/
|
||||
public java.util.Map<String, Object> getUserStats(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户点赞的帖子列表
|
||||
*/
|
||||
public java.util.List<ForumPost> getLikedPosts(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户收藏的帖子列表
|
||||
*/
|
||||
public java.util.List<ForumPost> getFavoritedPosts(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户发布的帖子列表
|
||||
*/
|
||||
public java.util.List<ForumPost> getUserPosts(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户回复的帖子列表
|
||||
*/
|
||||
public java.util.List<ForumPost> getRepliedPosts(Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.ForumReply;
|
||||
|
||||
/**
|
||||
* 论坛回复Service接口
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
public interface IForumReplyService
|
||||
{
|
||||
/**
|
||||
* 查询论坛回复
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 论坛回复
|
||||
*/
|
||||
public ForumReply selectForumReplyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询论坛回复列表
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 论坛回复集合
|
||||
*/
|
||||
public List<ForumReply> selectForumReplyList(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 根据帖子ID查询回复列表(树形结构)
|
||||
*
|
||||
* @param postId 帖子ID
|
||||
* @return 论坛回复集合
|
||||
*/
|
||||
public List<ForumReply> selectForumReplyListByPostId(Long postId);
|
||||
|
||||
/**
|
||||
* 新增论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertForumReply(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 修改论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateForumReply(ForumReply forumReply);
|
||||
|
||||
/**
|
||||
* 批量删除论坛回复
|
||||
*
|
||||
* @param ids 需要删除的论坛回复主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumReplyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除论坛回复信息
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteForumReplyById(Long id);
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*
|
||||
* @param id 回复ID
|
||||
* @param userId 用户ID
|
||||
* @return 是否已点赞
|
||||
*/
|
||||
public boolean toggleLike(Long id, Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlement;
|
||||
import com.ruoyi.jysystem.dto.FeeSettlementGenerateDTO;
|
||||
import com.ruoyi.jysystem.vo.FeeSettlementCheckVO;
|
||||
import com.ruoyi.jysystem.vo.FeeSettlementDetailVO;
|
||||
|
||||
public interface IJySysFeeSettlementService
|
||||
{
|
||||
JySysFeeSettlement selectJySysFeeSettlementById(Long id);
|
||||
|
||||
FeeSettlementDetailVO selectFeeSettlementDetail(Long id);
|
||||
|
||||
List<JySysFeeSettlement> selectJySysFeeSettlementList(JySysFeeSettlement query);
|
||||
|
||||
FeeSettlementCheckVO checkByYearMonth(String settleYearMonth);
|
||||
|
||||
int generateFeeSettlement(FeeSettlementGenerateDTO dto, String operator);
|
||||
|
||||
int deleteJySysFeeSettlementByIds(Long[] ids);
|
||||
|
||||
int confirmSettle(Long id, String operator);
|
||||
|
||||
byte[] exportPdf(Long id);
|
||||
|
||||
byte[] exportExcel(Long id);
|
||||
|
||||
byte[] exportPdfBatch(Long[] ids);
|
||||
|
||||
byte[] exportExcelBatch(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.jysystem.domain.JySysLens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用镜片Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysLensService extends IService<JySysLens>
|
||||
{
|
||||
JySysLens selectJySysLensById(Long id);
|
||||
|
||||
List<JySysLens> selectJySysLensList(JySysLens jySysLens);
|
||||
|
||||
List<JySysLens> selectJySysLensOptions();
|
||||
|
||||
int insertJySysLens(JySysLens jySysLens);
|
||||
|
||||
int updateJySysLens(JySysLens jySysLens);
|
||||
|
||||
int deleteJySysLensByIds(Long[] ids);
|
||||
|
||||
int deleteJySysLensById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysNews;
|
||||
|
||||
/**
|
||||
* 新闻动态Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-01
|
||||
*/
|
||||
public interface IJySysNewsService
|
||||
{
|
||||
/**
|
||||
* 查询新闻动态
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 新闻动态
|
||||
*/
|
||||
public JySysNews selectJySysNewsByNewsId(Long newsId);
|
||||
|
||||
/**
|
||||
* 查询新闻动态列表
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 新闻动态集合
|
||||
*/
|
||||
public List<JySysNews> selectJySysNewsList(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 新增新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJySysNews(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 修改新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJySysNews(JySysNews jySysNews);
|
||||
|
||||
/**
|
||||
* 批量删除新闻动态
|
||||
*
|
||||
* @param newsIds 需要删除的新闻动态主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysNewsByNewsIds(Long[] newsIds);
|
||||
|
||||
/**
|
||||
* 删除新闻动态信息
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysNewsByNewsId(Long newsId);
|
||||
|
||||
/**
|
||||
* 增加阅读量
|
||||
*
|
||||
* @param newsId 新闻ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int incrementViewCount(Long newsId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantProductVO;
|
||||
import com.ruoyi.jysystem.vo.OrderPortalLogisticsVO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 开发者门户订单Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysOrderPortalService
|
||||
{
|
||||
void applyPortalOrderQuery(JySysOrder jySysOrder);
|
||||
|
||||
List<JySysOrder> selectPortalOrderList(JySysOrder jySysOrder);
|
||||
|
||||
JySysOrder selectPortalOrderById(Long id);
|
||||
|
||||
int insertPortalOrder(JySysOrder jySysOrder);
|
||||
|
||||
int updatePortalOrder(JySysOrder jySysOrder);
|
||||
|
||||
int deletePortalOrderByIds(Long[] ids);
|
||||
|
||||
boolean isBrandTenant();
|
||||
|
||||
boolean isLensFactoryTenant();
|
||||
|
||||
boolean canManageLensOrder();
|
||||
|
||||
int supplementPortalOrder(Long orderId, String remark);
|
||||
|
||||
int resubmitPortalOrder(Long orderId, String reason);
|
||||
|
||||
int rejectPortalOrder(Long orderId, String reason);
|
||||
|
||||
int acceptPortalOrder(Long orderId);
|
||||
|
||||
int producePortalOrder(Long orderId);
|
||||
|
||||
int withdrawPortalOrder(Long orderId, String reason);
|
||||
|
||||
int shipPortalOrder(Long orderId, String expressCompany, String expressNo, java.math.BigDecimal logisticsFee);
|
||||
|
||||
int completePortalOrder(Long orderId);
|
||||
|
||||
int exchangeApplyPortalOrder(Long orderId, String reason);
|
||||
|
||||
int receivePortalOrder(Long orderId);
|
||||
|
||||
OrderPortalLogisticsVO selectPortalOrderLogistics(Long orderId);
|
||||
|
||||
List<JySysTenantProductVO> selectPortalProductOptions();
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.vo.OrderAssignPriceVO;
|
||||
import com.ruoyi.jysystem.vo.OrderPortalLogisticsVO;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysOrderService extends IService<JySysOrder>
|
||||
{
|
||||
JySysOrder selectJySysOrderById(Long id);
|
||||
|
||||
List<JySysOrder> selectJySysOrderList(JySysOrder jySysOrder);
|
||||
|
||||
List<JySysOrder> selectJySysOrderByIds(Long[] ids);
|
||||
|
||||
byte[] exportOrderPdfBatch(Long[] ids);
|
||||
|
||||
int insertJySysOrder(JySysOrder jySysOrder);
|
||||
|
||||
int updateJySysOrder(JySysOrder jySysOrder);
|
||||
|
||||
int deleteJySysOrderByIds(Long[] ids);
|
||||
|
||||
int deleteJySysOrderById(Long id);
|
||||
|
||||
OrderAssignPriceVO previewAssignPrice(Long orderId, Long lensFactoryTenantId);
|
||||
|
||||
int assignOrder(Long orderId, Long lensFactoryTenantId, String operator);
|
||||
|
||||
int factorySupplementOrder(Long orderId, Long lensFactoryTenantId, String remark, String operator);
|
||||
|
||||
int factoryRejectOrder(Long orderId, Long lensFactoryTenantId, String reason, String operator);
|
||||
|
||||
int factoryAcceptOrder(Long orderId, Long lensFactoryTenantId, String operator);
|
||||
|
||||
int factoryProduceOrder(Long orderId, Long lensFactoryTenantId, String operator);
|
||||
|
||||
int factoryWithdrawOrder(Long orderId, Long lensFactoryTenantId, String reason, String operator);
|
||||
|
||||
int factoryShipOrder(Long orderId, Long lensFactoryTenantId, String expressCompany, String expressNo, BigDecimal logisticsFee, String operator);
|
||||
|
||||
int factoryCompleteOrder(Long orderId, Long lensFactoryTenantId, String operator);
|
||||
|
||||
int brandCompleteOrder(Long orderId, Long brandTenantId, String operator);
|
||||
|
||||
int brandReceiveExchangeRejectedOrder(Long orderId, Long brandTenantId, String operator);
|
||||
|
||||
int brandExchangeApplyOrder(Long orderId, Long brandTenantId, String reason, String operator);
|
||||
|
||||
int adminRejectOrder(Long orderId, String reason, String operator);
|
||||
|
||||
int adminCloseOrder(Long orderId, String operator);
|
||||
|
||||
int adminCompleteOrder(Long orderId, String operator);
|
||||
|
||||
int adminAgreeExchangeOrder(Long orderId, String operator);
|
||||
|
||||
int adminRejectExchangeOrder(Long orderId, String reason, String operator);
|
||||
|
||||
int adminCompleteExchangeRejectedOrder(Long orderId, String operator);
|
||||
|
||||
int adminCompleteAllExchangeRejectedOrders(String operator);
|
||||
|
||||
int brandResubmitOrder(Long orderId, Long brandTenantId, String reason, String operator);
|
||||
|
||||
int changeOrderStatus(Long orderId, String orderStatus, String operator);
|
||||
|
||||
OrderPortalLogisticsVO selectOrderLogistics(Long orderId);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.jysystem.domain.JySysProduct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysProductService extends IService<JySysProduct>
|
||||
{
|
||||
JySysProduct selectJySysProductById(Long id);
|
||||
|
||||
List<JySysProduct> selectJySysProductList(JySysProduct jySysProduct);
|
||||
|
||||
List<JySysProduct> selectJySysProductOptions(Long tenantId);
|
||||
|
||||
int insertJySysProduct(JySysProduct jySysProduct);
|
||||
|
||||
int updateJySysProduct(JySysProduct jySysProduct);
|
||||
|
||||
int deleteJySysProductByIds(Long[] ids);
|
||||
|
||||
int deleteJySysProductById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.ruoyi.jysystem.dto.TenantLensSaveDTO;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantLensVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户可配镜片Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysTenantLensService
|
||||
{
|
||||
List<JySysTenantLensVO> selectTenantLensListByTenantId(Long tenantId);
|
||||
|
||||
int saveTenantLensConfig(TenantLensSaveDTO saveDTO, String username);
|
||||
|
||||
int saveTenantLensInitialConfig(Long tenantId, java.util.List<Long> lensIds, String username);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantMessage;
|
||||
|
||||
/**
|
||||
* 租户消息Service
|
||||
*/
|
||||
public interface IJySysTenantMessageService
|
||||
{
|
||||
List<JySysTenantMessage> selectPortalMessageList(JySysTenantMessage message);
|
||||
|
||||
int countPortalUnread();
|
||||
|
||||
int markPortalRead(Long id);
|
||||
|
||||
int markPortalAllRead();
|
||||
|
||||
void notifyOrderStatusChange(Long orderId, String orderStatus, String remark, String expressCompany, String expressNo);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import com.ruoyi.jysystem.dto.TenantProductSaveDTO;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantProductVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户关联产品Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IJySysTenantProductService
|
||||
{
|
||||
List<JySysTenantProductVO> selectTenantProductListByTenantId(Long tenantId);
|
||||
|
||||
int saveTenantProductConfig(TenantProductSaveDTO saveDTO, String username);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
|
||||
/**
|
||||
* 租户Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface IJySysTenantService
|
||||
{
|
||||
/**
|
||||
* 查询租户
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 租户
|
||||
*/
|
||||
public JySysTenant selectJySysTenantById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户列表
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 租户集合
|
||||
*/
|
||||
public List<JySysTenant> selectJySysTenantList(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 新增租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJySysTenant(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJySysTenant(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 批量删除租户
|
||||
*
|
||||
* @param ids 需要删除的租户主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysTenantByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除租户信息
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJySysTenantById(Long id);
|
||||
|
||||
/**
|
||||
* 修改租户启用状态,并同步关联用户账号
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
public int changeTenantStatus(JySysTenant jySysTenant);
|
||||
|
||||
/**
|
||||
* 获取当前登录用户关联的租户
|
||||
*
|
||||
* @return 租户
|
||||
*/
|
||||
public JySysTenant selectCurrentLoginTenant();
|
||||
|
||||
/**
|
||||
* 根据登录用户解析关联租户(编码优先,名称兜底)
|
||||
*
|
||||
* @param user 登录用户
|
||||
* @return 租户,未关联时返回 null
|
||||
*/
|
||||
public JySysTenant selectLoginTenantByUser(com.ruoyi.common.core.domain.entity.SysUser user);
|
||||
|
||||
List<JySysTenant> selectBrandTenantList();
|
||||
|
||||
List<JySysTenant> selectLensFactoryTenantList();
|
||||
|
||||
List<JySysTenant> selectLensFactoryTenantListByLensId(Long lensId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.jysystem.domain.SysRealNameAuth;
|
||||
|
||||
/**
|
||||
* 实名认证Service接口
|
||||
*
|
||||
* @author jueyuan
|
||||
*/
|
||||
public interface ISysRealNameAuthService {
|
||||
|
||||
SysRealNameAuth selectSysRealNameAuthById(Long id);
|
||||
|
||||
List<SysRealNameAuth> selectSysRealNameAuthList(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int insertSysRealNameAuth(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int updateSysRealNameAuth(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
int deleteSysRealNameAuthById(Long id);
|
||||
|
||||
/** 当前用户提交实名认证 */
|
||||
int submitAuth(SysRealNameAuth sysRealNameAuth);
|
||||
|
||||
/** 当前用户获取自己的认证记录 */
|
||||
SysRealNameAuth getMyAuth();
|
||||
|
||||
/** 审核通过 */
|
||||
int auditPass(Long id, String auditRemark);
|
||||
|
||||
/** 审核拒绝 */
|
||||
int auditReject(Long id, String auditRemark);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ruoyi.jysystem.service;
|
||||
|
||||
/**
|
||||
* 业务短信通知
|
||||
*/
|
||||
public interface SmsNotificationService
|
||||
{
|
||||
/**
|
||||
* 订单分配至镜片厂后,向镜片厂手机号发送通知(失败不影响主流程)
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param orderNo 订单号,对应模板变量 code
|
||||
*/
|
||||
void trySendOrderAssignedNotify(String phone, String orderNo);
|
||||
|
||||
/**
|
||||
* 订单发货后,向收件人手机号发送通知(失败不影响主流程)
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param orderNo 订单号,对应模板变量 code
|
||||
* @param expressCompany 快递公司,对应模板变量 expressCompany
|
||||
* @param expressNo 快递单号,对应模板变量 expressNo
|
||||
*/
|
||||
void trySendOrderShippedNotify(String phone, String orderNo, String expressCompany, String expressNo);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.jysystem.mapper.ForumCategoryMapper;
|
||||
import com.ruoyi.jysystem.domain.ForumCategory;
|
||||
import com.ruoyi.jysystem.service.IForumCategoryService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* 论坛分类Service业务层处理
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@Service
|
||||
public class ForumCategoryServiceImpl implements IForumCategoryService
|
||||
{
|
||||
@Autowired
|
||||
private ForumCategoryMapper forumCategoryMapper;
|
||||
|
||||
/**
|
||||
* 查询论坛分类
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 论坛分类
|
||||
*/
|
||||
@Override
|
||||
public ForumCategory selectForumCategoryById(Long id)
|
||||
{
|
||||
return forumCategoryMapper.selectForumCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询论坛分类列表
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 论坛分类
|
||||
*/
|
||||
@Override
|
||||
public List<ForumCategory> selectForumCategoryList(ForumCategory forumCategory)
|
||||
{
|
||||
return forumCategoryMapper.selectForumCategoryList(forumCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertForumCategory(ForumCategory forumCategory)
|
||||
{
|
||||
forumCategory.setCreateTime(DateUtils.getNowDate());
|
||||
return forumCategoryMapper.insertForumCategory(forumCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛分类
|
||||
*
|
||||
* @param forumCategory 论坛分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateForumCategory(ForumCategory forumCategory)
|
||||
{
|
||||
forumCategory.setUpdateTime(DateUtils.getNowDate());
|
||||
return forumCategoryMapper.updateForumCategory(forumCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除论坛分类
|
||||
*
|
||||
* @param ids 需要删除的论坛分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumCategoryByIds(Long[] ids)
|
||||
{
|
||||
return forumCategoryMapper.deleteForumCategoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛分类信息
|
||||
*
|
||||
* @param id 论坛分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumCategoryById(Long id)
|
||||
{
|
||||
return forumCategoryMapper.deleteForumCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加帖子数量
|
||||
*/
|
||||
@Override
|
||||
public int incrementPostCount(Long id)
|
||||
{
|
||||
return forumCategoryMapper.incrementPostCount(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减少帖子数量
|
||||
*/
|
||||
@Override
|
||||
public int decrementPostCount(Long id)
|
||||
{
|
||||
return forumCategoryMapper.decrementPostCount(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.jysystem.mapper.ForumPostMapper;
|
||||
import com.ruoyi.jysystem.mapper.ForumReplyMapper;
|
||||
import com.ruoyi.jysystem.domain.ForumPost;
|
||||
import com.ruoyi.jysystem.service.IForumPostService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* 论坛帖子Service业务层处理
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@Service
|
||||
public class ForumPostServiceImpl implements IForumPostService
|
||||
{
|
||||
@Autowired
|
||||
private ForumPostMapper forumPostMapper;
|
||||
|
||||
@Autowired
|
||||
private ForumReplyMapper forumReplyMapper;
|
||||
|
||||
/**
|
||||
* 查询论坛帖子
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 论坛帖子
|
||||
*/
|
||||
@Override
|
||||
public ForumPost selectForumPostById(Long id)
|
||||
{
|
||||
return forumPostMapper.selectForumPostById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询论坛帖子列表
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 论坛帖子
|
||||
*/
|
||||
@Override
|
||||
public List<ForumPost> selectForumPostList(ForumPost forumPost)
|
||||
{
|
||||
return forumPostMapper.selectForumPostList(forumPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertForumPost(ForumPost forumPost)
|
||||
{
|
||||
forumPost.setCreateTime(DateUtils.getNowDate());
|
||||
forumPost.setAuthorId(SecurityUtils.getUserId());
|
||||
forumPost.setAuthorName(SecurityUtils.getUsername());
|
||||
return forumPostMapper.insertForumPost(forumPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛帖子
|
||||
*
|
||||
* @param forumPost 论坛帖子
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateForumPost(ForumPost forumPost)
|
||||
{
|
||||
forumPost.setUpdateTime(DateUtils.getNowDate());
|
||||
return forumPostMapper.updateForumPost(forumPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除论坛帖子
|
||||
*
|
||||
* @param ids 需要删除的论坛帖子主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumPostByIds(Long[] ids)
|
||||
{
|
||||
return forumPostMapper.deleteForumPostByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛帖子信息
|
||||
*
|
||||
* @param id 论坛帖子主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumPostById(Long id)
|
||||
{
|
||||
return forumPostMapper.deleteForumPostById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加浏览量
|
||||
*/
|
||||
@Override
|
||||
public int incrementViewCount(Long id)
|
||||
{
|
||||
return forumPostMapper.incrementViewCount(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*/
|
||||
@Override
|
||||
public boolean toggleLike(Long id, Long userId)
|
||||
{
|
||||
// 检查是否已点赞
|
||||
int count = forumPostMapper.checkLike(id, userId);
|
||||
if (count > 0) {
|
||||
// 取消点赞
|
||||
forumPostMapper.deleteLike(id, userId);
|
||||
forumPostMapper.decrementLikeCount(id);
|
||||
return false;
|
||||
} else {
|
||||
// 点赞
|
||||
forumPostMapper.insertLike(id, userId);
|
||||
forumPostMapper.incrementLikeCount(id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏/取消收藏
|
||||
*/
|
||||
@Override
|
||||
public boolean toggleFavorite(Long id, Long userId)
|
||||
{
|
||||
// 检查是否已收藏
|
||||
int count = forumPostMapper.checkFavorite(id, userId);
|
||||
if (count > 0) {
|
||||
// 取消收藏
|
||||
forumPostMapper.deleteFavorite(id, userId);
|
||||
forumPostMapper.decrementFavoriteCount(id);
|
||||
return false;
|
||||
} else {
|
||||
// 收藏
|
||||
forumPostMapper.insertFavorite(id, userId);
|
||||
forumPostMapper.incrementFavoriteCount(id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记为已解决/取消已解决(切换状态)
|
||||
*/
|
||||
@Override
|
||||
public int markSolved(Long id)
|
||||
{
|
||||
// 先查询当前状态
|
||||
ForumPost post = forumPostMapper.selectForumPostById(id);
|
||||
if (post == null) {
|
||||
return 0;
|
||||
}
|
||||
// 如果当前是已解决,则取消;否则标记为已解决
|
||||
if ("1".equals(post.getIsSolved())) {
|
||||
return forumPostMapper.unmarkSolved(id);
|
||||
} else {
|
||||
return forumPostMapper.markSolved(id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 置顶/取消置顶(切换状态)
|
||||
*/
|
||||
@Override
|
||||
public int toggleTop(Long id)
|
||||
{
|
||||
// 先查询当前状态
|
||||
ForumPost post = forumPostMapper.selectForumPostById(id);
|
||||
if (post == null) {
|
||||
return 0;
|
||||
}
|
||||
// 如果当前是置顶,则取消;否则置顶
|
||||
if ("1".equals(post.getIsTop())) {
|
||||
return forumPostMapper.unsetTop(id);
|
||||
} else {
|
||||
return forumPostMapper.setTop(id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户统计数据
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getUserStats(Long userId)
|
||||
{
|
||||
Map<String, Object> stats = new HashMap<>();
|
||||
// 统计帖子数
|
||||
int postCount = forumPostMapper.countPostsByUserId(userId);
|
||||
// 统计用户点赞的帖子数
|
||||
int likedPostCount = forumPostMapper.countLikedPostsByUserId(userId);
|
||||
// 统计用户收藏的帖子数
|
||||
int favoritedPostCount = forumPostMapper.countFavoritedPostsByUserId(userId);
|
||||
// 统计回复数
|
||||
int replyCount = forumReplyMapper.countRepliesByUserId(userId);
|
||||
|
||||
stats.put("postCount", postCount);
|
||||
stats.put("likedPostCount", likedPostCount);
|
||||
stats.put("favoritedPostCount", favoritedPostCount);
|
||||
stats.put("replyCount", replyCount);
|
||||
|
||||
return stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户点赞的帖子列表
|
||||
*/
|
||||
@Override
|
||||
public List<ForumPost> getLikedPosts(Long userId)
|
||||
{
|
||||
return forumPostMapper.selectLikedPostsByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户收藏的帖子列表
|
||||
*/
|
||||
@Override
|
||||
public List<ForumPost> getFavoritedPosts(Long userId)
|
||||
{
|
||||
return forumPostMapper.selectFavoritedPostsByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户发布的帖子列表
|
||||
*/
|
||||
@Override
|
||||
public List<ForumPost> getUserPosts(Long userId)
|
||||
{
|
||||
return forumPostMapper.selectPostsByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户回复的帖子列表
|
||||
*/
|
||||
@Override
|
||||
public List<ForumPost> getRepliedPosts(Long userId)
|
||||
{
|
||||
List<Long> postIds = forumReplyMapper.selectPostIdsByReplyUserId(userId);
|
||||
if (postIds == null || postIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 根据帖子ID列表查询帖子
|
||||
List<ForumPost> allPosts = forumPostMapper.selectForumPostList(new ForumPost());
|
||||
return allPosts.stream()
|
||||
.filter(post -> postIds.contains(post.getId()))
|
||||
.sorted((p1, p2) -> p2.getCreateTime().compareTo(p1.getCreateTime()))
|
||||
.collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.jysystem.mapper.ForumReplyMapper;
|
||||
import com.ruoyi.jysystem.mapper.ForumPostMapper;
|
||||
import com.ruoyi.jysystem.domain.ForumReply;
|
||||
import com.ruoyi.jysystem.service.IForumReplyService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* 论坛回复Service业务层处理
|
||||
*
|
||||
* @author jueyuan
|
||||
* @date 2025-01-20
|
||||
*/
|
||||
@Service
|
||||
public class ForumReplyServiceImpl implements IForumReplyService
|
||||
{
|
||||
@Autowired
|
||||
private ForumReplyMapper forumReplyMapper;
|
||||
|
||||
@Autowired
|
||||
private ForumPostMapper forumPostMapper;
|
||||
|
||||
/**
|
||||
* 查询论坛回复
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 论坛回复
|
||||
*/
|
||||
@Override
|
||||
public ForumReply selectForumReplyById(Long id)
|
||||
{
|
||||
return forumReplyMapper.selectForumReplyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询论坛回复列表
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 论坛回复
|
||||
*/
|
||||
@Override
|
||||
public List<ForumReply> selectForumReplyList(ForumReply forumReply)
|
||||
{
|
||||
return forumReplyMapper.selectForumReplyList(forumReply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据帖子ID查询回复列表(树形结构)
|
||||
*
|
||||
* @param postId 帖子ID
|
||||
* @return 论坛回复集合
|
||||
*/
|
||||
@Override
|
||||
public List<ForumReply> selectForumReplyListByPostId(Long postId)
|
||||
{
|
||||
List<ForumReply> allReplies = forumReplyMapper.selectForumReplyListByPostId(postId);
|
||||
return buildReplyTree(allReplies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建回复树形结构
|
||||
*/
|
||||
private List<ForumReply> buildReplyTree(List<ForumReply> allReplies)
|
||||
{
|
||||
List<ForumReply> rootReplies = new ArrayList<>();
|
||||
for (ForumReply reply : allReplies) {
|
||||
if (reply.getParentId() == null || reply.getParentId() == 0) {
|
||||
reply.setChildren(new ArrayList<>());
|
||||
rootReplies.add(reply);
|
||||
}
|
||||
}
|
||||
for (ForumReply reply : allReplies) {
|
||||
if (reply.getParentId() != null && reply.getParentId() != 0) {
|
||||
for (ForumReply root : rootReplies) {
|
||||
addChildReply(root, reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rootReplies;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归添加子回复
|
||||
*/
|
||||
private void addChildReply(ForumReply parent, ForumReply child)
|
||||
{
|
||||
if (parent.getId().equals(child.getParentId())) {
|
||||
if (parent.getChildren() == null) {
|
||||
parent.setChildren(new ArrayList<>());
|
||||
}
|
||||
parent.getChildren().add(child);
|
||||
} else {
|
||||
if (parent.getChildren() != null) {
|
||||
for (ForumReply subReply : parent.getChildren()) {
|
||||
addChildReply(subReply, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertForumReply(ForumReply forumReply)
|
||||
{
|
||||
forumReply.setCreateTime(DateUtils.getNowDate());
|
||||
forumReply.setAuthorId(SecurityUtils.getUserId());
|
||||
forumReply.setAuthorName(SecurityUtils.getUsername());
|
||||
forumReply.setStatus("0");
|
||||
if (forumReply.getParentId() == null) {
|
||||
forumReply.setParentId(0L);
|
||||
}
|
||||
int result = forumReplyMapper.insertForumReply(forumReply);
|
||||
|
||||
// 更新帖子的回复数和最后回复时间
|
||||
if (result > 0) {
|
||||
forumPostMapper.incrementReplyCount(forumReply.getPostId());
|
||||
forumPostMapper.updateLastReply(forumReply.getPostId(), forumReply.getId(), forumReply.getAuthorName());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改论坛回复
|
||||
*
|
||||
* @param forumReply 论坛回复
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateForumReply(ForumReply forumReply)
|
||||
{
|
||||
forumReply.setUpdateTime(DateUtils.getNowDate());
|
||||
return forumReplyMapper.updateForumReply(forumReply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除论坛回复
|
||||
*
|
||||
* @param ids 需要删除的论坛回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumReplyByIds(Long[] ids)
|
||||
{
|
||||
return forumReplyMapper.deleteForumReplyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除论坛回复信息
|
||||
*
|
||||
* @param id 论坛回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteForumReplyById(Long id)
|
||||
{
|
||||
return forumReplyMapper.deleteForumReplyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞
|
||||
*/
|
||||
@Override
|
||||
public boolean toggleLike(Long id, Long userId)
|
||||
{
|
||||
// 检查是否已点赞
|
||||
int count = forumReplyMapper.checkLike(id, userId);
|
||||
if (count > 0) {
|
||||
// 取消点赞
|
||||
forumReplyMapper.deleteLike(id, userId);
|
||||
forumReplyMapper.decrementLikeCount(id);
|
||||
return false;
|
||||
} else {
|
||||
// 点赞
|
||||
forumReplyMapper.insertLike(id, userId);
|
||||
forumReplyMapper.incrementLikeCount(id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,589 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlement;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlementItem;
|
||||
import com.ruoyi.jysystem.domain.JySysFeeSettlementLogistics;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.domain.JySysOrderStatusLog;
|
||||
import com.ruoyi.jysystem.dto.FeeSettlementGenerateDTO;
|
||||
import com.ruoyi.jysystem.mapper.JySysFeeSettlementItemMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysFeeSettlementLogisticsMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysFeeSettlementMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysOrderMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysOrderStatusLogMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysFeeSettlementService;
|
||||
import com.ruoyi.jysystem.utils.FeeSettlementBatchExportHelper;
|
||||
import com.ruoyi.jysystem.utils.FeeSettlementExcelExporter;
|
||||
import com.ruoyi.jysystem.utils.FeeSettlementExportHelper;
|
||||
import com.ruoyi.jysystem.utils.FeeSettlementPdfExporter;
|
||||
import com.ruoyi.jysystem.utils.IdUtil;
|
||||
import com.ruoyi.jysystem.vo.FeeSettlementCheckVO;
|
||||
import com.ruoyi.jysystem.vo.FeeSettlementDetailVO;
|
||||
|
||||
@Service
|
||||
public class JySysFeeSettlementServiceImpl implements IJySysFeeSettlementService
|
||||
{
|
||||
@Resource
|
||||
private JySysFeeSettlementMapper feeSettlementMapper;
|
||||
|
||||
@Resource
|
||||
private JySysFeeSettlementItemMapper feeSettlementItemMapper;
|
||||
|
||||
@Resource
|
||||
private JySysFeeSettlementLogisticsMapper feeSettlementLogisticsMapper;
|
||||
|
||||
@Resource
|
||||
private JySysOrderMapper jySysOrderMapper;
|
||||
|
||||
@Resource
|
||||
private JySysOrderStatusLogMapper jySysOrderStatusLogMapper;
|
||||
|
||||
@Override
|
||||
public JySysFeeSettlement selectJySysFeeSettlementById(Long id)
|
||||
{
|
||||
return feeSettlementMapper.selectJySysFeeSettlementById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeeSettlementDetailVO selectFeeSettlementDetail(Long id)
|
||||
{
|
||||
JySysFeeSettlement settlement = feeSettlementMapper.selectJySysFeeSettlementById(id);
|
||||
if (settlement == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
FeeSettlementDetailVO detail = new FeeSettlementDetailVO();
|
||||
copySettlement(detail, settlement);
|
||||
List<JySysFeeSettlementItem> items = feeSettlementItemMapper.selectBySettlementId(id);
|
||||
if (items != null && !items.isEmpty())
|
||||
{
|
||||
List<Long> itemIds = items.stream().map(JySysFeeSettlementItem::getId).collect(Collectors.toList());
|
||||
List<JySysFeeSettlementLogistics> logisticsList = feeSettlementLogisticsMapper.selectBySettlementItemIds(itemIds);
|
||||
Map<Long, List<JySysFeeSettlementLogistics>> logisticsMap = logisticsList.stream()
|
||||
.collect(Collectors.groupingBy(JySysFeeSettlementLogistics::getSettlementItemId));
|
||||
for (JySysFeeSettlementItem item : items)
|
||||
{
|
||||
item.setLogisticsList(logisticsMap.getOrDefault(item.getId(), new ArrayList<>()));
|
||||
}
|
||||
}
|
||||
detail.setItemList(items);
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysFeeSettlement> selectJySysFeeSettlementList(JySysFeeSettlement query)
|
||||
{
|
||||
return feeSettlementMapper.selectJySysFeeSettlementList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeeSettlementCheckVO checkByYearMonth(String settleYearMonth)
|
||||
{
|
||||
String yearMonth = normalizeYearMonth(settleYearMonth);
|
||||
FeeSettlementCheckVO vo = new FeeSettlementCheckVO();
|
||||
int count = feeSettlementMapper.countBySettleYearMonth(yearMonth);
|
||||
vo.setExists(count > 0);
|
||||
vo.setCount(count);
|
||||
if (count > 0)
|
||||
{
|
||||
vo.setSettlementNos(feeSettlementMapper.selectSettlementNosByYearMonth(yearMonth));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int generateFeeSettlement(FeeSettlementGenerateDTO dto, String operator)
|
||||
{
|
||||
if (dto == null || StringUtils.isEmpty(dto.getSettleYearMonth()))
|
||||
{
|
||||
throw new ServiceException("请选择结算年月");
|
||||
}
|
||||
String yearMonth = normalizeYearMonth(dto.getSettleYearMonth());
|
||||
boolean forceRegenerate = dto.getForceRegenerate() != null && dto.getForceRegenerate();
|
||||
boolean exists = feeSettlementMapper.countBySettleYearMonth(yearMonth) > 0;
|
||||
if (exists)
|
||||
{
|
||||
if (!forceRegenerate)
|
||||
{
|
||||
throw new ServiceException("该年月已存在费用结算单,请确认是否删除后重新生成");
|
||||
}
|
||||
deleteByYearMonth(yearMonth);
|
||||
}
|
||||
|
||||
List<JySysOrder> orders = jySysOrderMapper.selectCompletedOrdersByYearMonth(yearMonth);
|
||||
if (orders == null || orders.isEmpty())
|
||||
{
|
||||
throw new ServiceException("该年月没有已完成状态的订单,无法生成结算单");
|
||||
}
|
||||
if (forceRegenerate && exists)
|
||||
{
|
||||
resetShipLogSettleStatusForOrders(orders);
|
||||
}
|
||||
|
||||
Map<Long, List<JySysOrder>> brandGroups = new LinkedHashMap<>();
|
||||
Map<Long, List<JySysOrder>> factoryGroups = new LinkedHashMap<>();
|
||||
for (JySysOrder order : orders)
|
||||
{
|
||||
if (order.getBrandTenantId() != null)
|
||||
{
|
||||
brandGroups.computeIfAbsent(order.getBrandTenantId(), k -> new ArrayList<>()).add(order);
|
||||
}
|
||||
if (order.getLensFactoryTenantId() != null)
|
||||
{
|
||||
factoryGroups.computeIfAbsent(order.getLensFactoryTenantId(), k -> new ArrayList<>()).add(order);
|
||||
}
|
||||
}
|
||||
|
||||
int generated = 0;
|
||||
Date now = DateUtils.getNowDate();
|
||||
Date settleDate = DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, now));
|
||||
|
||||
for (Map.Entry<Long, List<JySysOrder>> entry : brandGroups.entrySet())
|
||||
{
|
||||
generated += createSettlement(JySysFeeSettlement.TYPE_AR, yearMonth, entry.getKey(), entry.getValue(), settleDate, operator);
|
||||
}
|
||||
for (Map.Entry<Long, List<JySysOrder>> entry : factoryGroups.entrySet())
|
||||
{
|
||||
generated += createSettlement(JySysFeeSettlement.TYPE_AP, yearMonth, entry.getKey(), entry.getValue(), settleDate, operator);
|
||||
}
|
||||
|
||||
if (generated == 0)
|
||||
{
|
||||
throw new ServiceException("未生成任何结算单,请检查订单租户信息");
|
||||
}
|
||||
return generated;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteJySysFeeSettlementByIds(Long[] ids)
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
List<Long> settlementIds = new ArrayList<>();
|
||||
for (Long id : ids)
|
||||
{
|
||||
settlementIds.add(id);
|
||||
}
|
||||
revertAndDeleteSettlements(settlementIds);
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int confirmSettle(Long id, String operator)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
throw new ServiceException("结算单ID不能为空");
|
||||
}
|
||||
JySysFeeSettlement settlement = feeSettlementMapper.selectJySysFeeSettlementById(id);
|
||||
if (settlement == null)
|
||||
{
|
||||
throw new ServiceException("结算单不存在");
|
||||
}
|
||||
if ("1".equals(settlement.getSettleStatus()))
|
||||
{
|
||||
throw new ServiceException("该结算单已是已结算状态");
|
||||
}
|
||||
JySysFeeSettlement update = new JySysFeeSettlement();
|
||||
update.setId(id);
|
||||
update.setSettleStatus("1");
|
||||
update.setUpdateBy(operator);
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
int rows = feeSettlementMapper.updateSettleStatus(update);
|
||||
updateOrderSettleStatusBySettlement(settlement, operator);
|
||||
updateStatusLogSettleStatusBySettlement(settlement);
|
||||
return rows;
|
||||
}
|
||||
|
||||
private void updateStatusLogSettleStatusBySettlement(JySysFeeSettlement settlement)
|
||||
{
|
||||
List<Long> statusLogIds = collectStatusLogIdsBySettlement(settlement.getId());
|
||||
if (statusLogIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (JySysFeeSettlement.TYPE_AP.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderStatusLogMapper.updatePurchaseSettleStatusByIds(statusLogIds, "1");
|
||||
}
|
||||
else if (JySysFeeSettlement.TYPE_AR.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderStatusLogMapper.updateSaleSettleStatusByIds(statusLogIds, "1");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateOrderSettleStatusBySettlement(JySysFeeSettlement settlement, String operator)
|
||||
{
|
||||
List<JySysFeeSettlementItem> items = feeSettlementItemMapper.selectBySettlementId(settlement.getId());
|
||||
if (items == null || items.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<Long> orderIds = items.stream()
|
||||
.map(JySysFeeSettlementItem::getOrderId)
|
||||
.filter(orderId -> orderId != null)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (orderIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (JySysFeeSettlement.TYPE_AP.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderMapper.updatePurchaseSettleStatusByOrderIds(orderIds, "1", operator);
|
||||
}
|
||||
else if (JySysFeeSettlement.TYPE_AR.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderMapper.updateSaleSettleStatusByOrderIds(orderIds, "1", operator);
|
||||
}
|
||||
}
|
||||
|
||||
private int createSettlement(String type, String yearMonth, Long tenantId, List<JySysOrder> orders,
|
||||
Date settleDate, String operator)
|
||||
{
|
||||
if (orders == null || orders.isEmpty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
JySysFeeSettlement settlement = new JySysFeeSettlement();
|
||||
settlement.setId(IdUtil.getInstance().nextId());
|
||||
settlement.setSettlementNo(nextSettlementNo(type));
|
||||
settlement.setSettleYearMonth(yearMonth);
|
||||
settlement.setSettleStatus("0");
|
||||
settlement.setTenantId(tenantId);
|
||||
settlement.setSettlementType(type);
|
||||
settlement.setSettleDate(settleDate);
|
||||
settlement.setTotalAmount(BigDecimal.ZERO);
|
||||
settlement.setCreateBy(operator);
|
||||
settlement.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
BigDecimal settlementTotal = BigDecimal.ZERO;
|
||||
List<JySysFeeSettlementItem> itemList = new ArrayList<>();
|
||||
|
||||
for (JySysOrder order : orders)
|
||||
{
|
||||
JySysFeeSettlementItem item = buildSettlementItem(settlement.getId(), type, order);
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
itemList.add(item);
|
||||
settlementTotal = settlementTotal.add(item.getTotalAmount());
|
||||
}
|
||||
if (itemList.isEmpty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
settlement.setTotalAmount(settlementTotal);
|
||||
feeSettlementMapper.insertJySysFeeSettlement(settlement);
|
||||
for (JySysFeeSettlementItem item : itemList)
|
||||
{
|
||||
feeSettlementItemMapper.insertJySysFeeSettlementItem(item);
|
||||
if (item.getLogisticsList() != null)
|
||||
{
|
||||
for (JySysFeeSettlementLogistics logistics : item.getLogisticsList())
|
||||
{
|
||||
logistics.setId(IdUtil.getInstance().nextId());
|
||||
logistics.setSettlementItemId(item.getId());
|
||||
feeSettlementLogisticsMapper.insertJySysFeeSettlementLogistics(logistics);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private JySysFeeSettlementItem buildSettlementItem(Long settlementId, String type, JySysOrder order)
|
||||
{
|
||||
BigDecimal lensPrice = JySysFeeSettlement.TYPE_AR.equals(type)
|
||||
? defaultAmount(order.getPriceC()) : defaultAmount(order.getPriceB());
|
||||
BigDecimal progressivePrice = Integer.valueOf(1).equals(order.getProgressiveMultifocal())
|
||||
? defaultAmount(order.getProgressiveMultifocalPrice()) : BigDecimal.ZERO;
|
||||
|
||||
List<JySysOrderStatusLog> shipLogs = jySysOrderStatusLogMapper
|
||||
.selectUnsettledShipLogsByOrderIdAndType(order.getId(), type);
|
||||
BigDecimal logisticsPrice = BigDecimal.ZERO;
|
||||
List<JySysFeeSettlementLogistics> logisticsList = new ArrayList<>();
|
||||
if (shipLogs != null)
|
||||
{
|
||||
for (JySysOrderStatusLog log : shipLogs)
|
||||
{
|
||||
BigDecimal fee = defaultAmount(log.getLogisticsFee());
|
||||
logisticsPrice = logisticsPrice.add(fee);
|
||||
JySysFeeSettlementLogistics row = new JySysFeeSettlementLogistics();
|
||||
row.setStatusLogId(log.getId());
|
||||
row.setLogisticsFee(fee);
|
||||
logisticsList.add(row);
|
||||
}
|
||||
}
|
||||
|
||||
BigDecimal total = lensPrice.add(progressivePrice).add(logisticsPrice);
|
||||
JySysFeeSettlementItem item = new JySysFeeSettlementItem();
|
||||
item.setId(IdUtil.getInstance().nextId());
|
||||
item.setSettlementId(settlementId);
|
||||
item.setOrderId(order.getId());
|
||||
item.setOrderNo(order.getOrderNo());
|
||||
item.setLensPrice(lensPrice);
|
||||
item.setProgressivePrice(progressivePrice);
|
||||
item.setLogisticsPrice(logisticsPrice);
|
||||
item.setLogisticsCount(logisticsList.size());
|
||||
item.setTotalAmount(total);
|
||||
item.setLogisticsList(logisticsList);
|
||||
return item;
|
||||
}
|
||||
|
||||
private void deleteByYearMonth(String yearMonth)
|
||||
{
|
||||
List<Long> settlementIds = feeSettlementMapper.selectIdsByYearMonth(yearMonth);
|
||||
if (settlementIds == null || settlementIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
revertAndDeleteSettlements(settlementIds);
|
||||
}
|
||||
|
||||
private void revertAndDeleteSettlements(List<Long> settlementIds)
|
||||
{
|
||||
if (settlementIds == null || settlementIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (Long settlementId : settlementIds)
|
||||
{
|
||||
JySysFeeSettlement settlement = feeSettlementMapper.selectJySysFeeSettlementById(settlementId);
|
||||
if (settlement == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
revertLogSettleStatusBySettlement(settlement);
|
||||
if ("1".equals(settlement.getSettleStatus()))
|
||||
{
|
||||
revertOrderSettleStatusBySettlement(settlement);
|
||||
}
|
||||
}
|
||||
List<Long> itemIds = feeSettlementItemMapper.selectIdsBySettlementIds(settlementIds);
|
||||
if (itemIds != null && !itemIds.isEmpty())
|
||||
{
|
||||
feeSettlementLogisticsMapper.deleteBySettlementItemIds(itemIds);
|
||||
feeSettlementItemMapper.deleteBySettlementIds(settlementIds);
|
||||
}
|
||||
for (Long settlementId : settlementIds)
|
||||
{
|
||||
feeSettlementMapper.deleteJySysFeeSettlementById(settlementId);
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除结算单时回滚关联发货日志的结算状态,便于重新生成时再次纳入物流费用 */
|
||||
private void revertLogSettleStatusBySettlement(JySysFeeSettlement settlement)
|
||||
{
|
||||
List<Long> statusLogIds = collectStatusLogIdsBySettlement(settlement.getId());
|
||||
if (statusLogIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (JySysFeeSettlement.TYPE_AP.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderStatusLogMapper.updatePurchaseSettleStatusByIds(statusLogIds, "0");
|
||||
}
|
||||
else if (JySysFeeSettlement.TYPE_AR.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderStatusLogMapper.updateSaleSettleStatusByIds(statusLogIds, "0");
|
||||
}
|
||||
}
|
||||
|
||||
private void revertOrderSettleStatusBySettlement(JySysFeeSettlement settlement)
|
||||
{
|
||||
List<JySysFeeSettlementItem> items = feeSettlementItemMapper.selectBySettlementId(settlement.getId());
|
||||
List<Long> orderIds = items == null ? new ArrayList<>() : items.stream()
|
||||
.map(JySysFeeSettlementItem::getOrderId)
|
||||
.filter(orderId -> orderId != null)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (orderIds.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
String operator = settlement.getUpdateBy() != null ? settlement.getUpdateBy() : settlement.getCreateBy();
|
||||
if (JySysFeeSettlement.TYPE_AP.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderMapper.updatePurchaseSettleStatusByOrderIds(orderIds, "0", operator);
|
||||
}
|
||||
else if (JySysFeeSettlement.TYPE_AR.equals(settlement.getSettlementType()))
|
||||
{
|
||||
jySysOrderMapper.updateSaleSettleStatusByOrderIds(orderIds, "0", operator);
|
||||
}
|
||||
}
|
||||
|
||||
private void resetShipLogSettleStatusForOrders(List<JySysOrder> orders)
|
||||
{
|
||||
if (orders == null || orders.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(JySysOrder::getId)
|
||||
.filter(orderId -> orderId != null)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (!orderIds.isEmpty())
|
||||
{
|
||||
jySysOrderStatusLogMapper.resetShipLogSettleStatusByOrderIds(orderIds);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Long> collectStatusLogIdsBySettlement(Long settlementId)
|
||||
{
|
||||
List<JySysFeeSettlementItem> items = feeSettlementItemMapper.selectBySettlementId(settlementId);
|
||||
if (items == null || items.isEmpty())
|
||||
{
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Long> itemIds = items.stream().map(JySysFeeSettlementItem::getId).collect(Collectors.toList());
|
||||
return feeSettlementLogisticsMapper.selectBySettlementItemIds(itemIds).stream()
|
||||
.map(JySysFeeSettlementLogistics::getStatusLogId)
|
||||
.filter(statusLogId -> statusLogId != null)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private String nextSettlementNo(String type)
|
||||
{
|
||||
String datePart = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
String prefix = "SET-" + type + "-" + datePart;
|
||||
int count = feeSettlementMapper.countBySettlementNoPrefix(prefix);
|
||||
return prefix + String.format("%03d", count + 1);
|
||||
}
|
||||
|
||||
private String normalizeYearMonth(String yearMonth)
|
||||
{
|
||||
if (StringUtils.isEmpty(yearMonth))
|
||||
{
|
||||
throw new ServiceException("结算年月不能为空");
|
||||
}
|
||||
String value = yearMonth.trim();
|
||||
if (value.matches("\\d{6}"))
|
||||
{
|
||||
return value.substring(0, 4) + "-" + value.substring(4, 6);
|
||||
}
|
||||
if (!value.matches("\\d{4}-\\d{2}"))
|
||||
{
|
||||
throw new ServiceException("结算年月格式不正确,应为 yyyy-MM");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private BigDecimal defaultAmount(BigDecimal value)
|
||||
{
|
||||
return value != null ? value : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] exportPdf(Long id)
|
||||
{
|
||||
FeeSettlementDetailVO detail = selectFeeSettlementDetail(id);
|
||||
if (detail == null)
|
||||
{
|
||||
throw new ServiceException("结算单不存在");
|
||||
}
|
||||
return FeeSettlementPdfExporter.export(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] exportExcel(Long id)
|
||||
{
|
||||
FeeSettlementDetailVO detail = selectFeeSettlementDetail(id);
|
||||
if (detail == null)
|
||||
{
|
||||
throw new ServiceException("结算单不存在");
|
||||
}
|
||||
return FeeSettlementExcelExporter.export(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] exportPdfBatch(Long[] ids)
|
||||
{
|
||||
return exportBatch(ids, "pdf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] exportExcelBatch(Long[] ids)
|
||||
{
|
||||
return exportBatch(ids, "excel");
|
||||
}
|
||||
|
||||
private byte[] exportBatch(Long[] ids, String type)
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
throw new ServiceException("请选择要导出的结算单");
|
||||
}
|
||||
Map<String, byte[]> files = FeeSettlementBatchExportHelper.createFileMap();
|
||||
for (Long id : ids)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
FeeSettlementDetailVO detail = selectFeeSettlementDetail(id);
|
||||
if (detail == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
String baseName = FeeSettlementExportHelper.safe(detail.getSettlementNo());
|
||||
if ("-".equals(baseName))
|
||||
{
|
||||
baseName = "fee-settlement-" + id;
|
||||
}
|
||||
String extension = "pdf".equals(type) ? ".pdf" : ".xlsx";
|
||||
String fileName = FeeSettlementBatchExportHelper.uniqueFileName(files, baseName + extension);
|
||||
byte[] data = "pdf".equals(type) ? FeeSettlementPdfExporter.export(detail) : FeeSettlementExcelExporter.export(detail);
|
||||
files.put(fileName, data);
|
||||
}
|
||||
if (files.isEmpty())
|
||||
{
|
||||
throw new ServiceException("未找到可导出的结算单");
|
||||
}
|
||||
if (files.size() == 1)
|
||||
{
|
||||
return files.values().iterator().next();
|
||||
}
|
||||
return FeeSettlementBatchExportHelper.toZip(files);
|
||||
}
|
||||
|
||||
private void copySettlement(FeeSettlementDetailVO target, JySysFeeSettlement source)
|
||||
{
|
||||
target.setId(source.getId());
|
||||
target.setSettlementNo(source.getSettlementNo());
|
||||
target.setSettleYearMonth(source.getSettleYearMonth());
|
||||
target.setSettleStatus(source.getSettleStatus());
|
||||
target.setTenantId(source.getTenantId());
|
||||
target.setSettlementType(source.getSettlementType());
|
||||
target.setSettleDate(source.getSettleDate());
|
||||
target.setTotalAmount(source.getTotalAmount());
|
||||
target.setRemark(source.getRemark());
|
||||
target.setCreateBy(source.getCreateBy());
|
||||
target.setCreateTime(source.getCreateTime());
|
||||
target.setUpdateBy(source.getUpdateBy());
|
||||
target.setUpdateTime(source.getUpdateTime());
|
||||
target.setTenantName(source.getTenantName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysLens;
|
||||
import com.ruoyi.jysystem.mapper.JySysLensMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantLensMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysLensService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用镜片Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class JySysLensServiceImpl extends ServiceImpl<JySysLensMapper, JySysLens> implements IJySysLensService
|
||||
{
|
||||
@Resource
|
||||
private JySysLensMapper jySysLensMapper;
|
||||
|
||||
@Resource
|
||||
private JySysTenantLensMapper jySysTenantLensMapper;
|
||||
|
||||
@Override
|
||||
public JySysLens selectJySysLensById(Long id)
|
||||
{
|
||||
return jySysLensMapper.selectJySysLensById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysLens> selectJySysLensList(JySysLens jySysLens)
|
||||
{
|
||||
return jySysLensMapper.selectJySysLensList(jySysLens);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysLens> selectJySysLensOptions()
|
||||
{
|
||||
return jySysLensMapper.selectJySysLensOptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertJySysLens(JySysLens jySysLens)
|
||||
{
|
||||
if (jySysLens.getColor() == null || jySysLens.getColor().isEmpty())
|
||||
{
|
||||
jySysLens.setColor("透明白");
|
||||
}
|
||||
if (jySysLens.getArCoating() == null)
|
||||
{
|
||||
jySysLens.setArCoating(1);
|
||||
}
|
||||
if (jySysLens.getImportedResin() == null)
|
||||
{
|
||||
jySysLens.setImportedResin(0);
|
||||
}
|
||||
if (jySysLens.getThinEdge() == null)
|
||||
{
|
||||
jySysLens.setThinEdge(0);
|
||||
}
|
||||
if (jySysLens.getDelFlag() == null)
|
||||
{
|
||||
jySysLens.setDelFlag(0);
|
||||
}
|
||||
jySysLens.setCreateTime(DateUtils.getNowDate());
|
||||
return jySysLensMapper.insertJySysLens(jySysLens);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateJySysLens(JySysLens jySysLens)
|
||||
{
|
||||
jySysLens.setUpdateTime(DateUtils.getNowDate());
|
||||
return jySysLensMapper.updateJySysLens(jySysLens);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteJySysLensByIds(Long[] ids)
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for (Long id : ids)
|
||||
{
|
||||
validateLensDeletable(id);
|
||||
}
|
||||
return jySysLensMapper.deleteJySysLensByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteJySysLensById(Long id)
|
||||
{
|
||||
validateLensDeletable(id);
|
||||
return jySysLensMapper.deleteJySysLensById(id);
|
||||
}
|
||||
|
||||
private void validateLensDeletable(Long lensId)
|
||||
{
|
||||
if (lensId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (jySysTenantLensMapper.countByLensId(lensId) > 0)
|
||||
{
|
||||
JySysLens lens = jySysLensMapper.selectJySysLensById(lensId);
|
||||
String name = lens != null && StringUtils.isNotEmpty(lens.getProductName())
|
||||
? lens.getProductName() : String.valueOf(lensId);
|
||||
throw new ServiceException("镜片【" + name + "】已被租户关联,不能删除");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysNews;
|
||||
import com.ruoyi.jysystem.mapper.JySysNewsMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysNewsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新闻动态Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-01
|
||||
*/
|
||||
@Service
|
||||
public class JySysNewsServiceImpl implements IJySysNewsService
|
||||
{
|
||||
@Autowired
|
||||
private JySysNewsMapper jySysNewsMapper;
|
||||
|
||||
/**
|
||||
* 查询新闻动态
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 新闻动态
|
||||
*/
|
||||
@Override
|
||||
public JySysNews selectJySysNewsByNewsId(Long newsId)
|
||||
{
|
||||
return jySysNewsMapper.selectJySysNewsByNewsId(newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新闻动态列表
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 新闻动态
|
||||
*/
|
||||
@Override
|
||||
public List<JySysNews> selectJySysNewsList(JySysNews jySysNews)
|
||||
{
|
||||
return jySysNewsMapper.selectJySysNewsList(jySysNews);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertJySysNews(JySysNews jySysNews)
|
||||
{
|
||||
jySysNews.setCreateTime(DateUtils.getNowDate());
|
||||
if (jySysNews.getViewCount() == null) {
|
||||
jySysNews.setViewCount(0);
|
||||
}
|
||||
if (jySysNews.getStatus() == null || jySysNews.getStatus().isEmpty()) {
|
||||
jySysNews.setStatus("1");
|
||||
}
|
||||
if (jySysNews.getIsTop() == null || jySysNews.getIsTop().isEmpty()) {
|
||||
jySysNews.setIsTop("0");
|
||||
}
|
||||
if (jySysNews.getSortOrder() == null) {
|
||||
jySysNews.setSortOrder(0);
|
||||
}
|
||||
return jySysNewsMapper.insertJySysNews(jySysNews);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新闻动态
|
||||
*
|
||||
* @param jySysNews 新闻动态
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateJySysNews(JySysNews jySysNews)
|
||||
{
|
||||
jySysNews.setUpdateTime(DateUtils.getNowDate());
|
||||
return jySysNewsMapper.updateJySysNews(jySysNews);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除新闻动态
|
||||
*
|
||||
* @param newsIds 需要删除的新闻动态主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteJySysNewsByNewsIds(Long[] newsIds)
|
||||
{
|
||||
return jySysNewsMapper.deleteJySysNewsByNewsIds(newsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除新闻动态信息
|
||||
*
|
||||
* @param newsId 新闻动态主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteJySysNewsByNewsId(Long newsId)
|
||||
{
|
||||
return jySysNewsMapper.deleteJySysNewsByNewsId(newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加阅读量
|
||||
*
|
||||
* @param newsId 新闻ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int incrementViewCount(Long newsId)
|
||||
{
|
||||
return jySysNewsMapper.incrementViewCount(newsId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,335 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantProductMapper;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantProductVO;
|
||||
import com.ruoyi.jysystem.vo.OrderPortalLogisticsVO;
|
||||
import com.ruoyi.jysystem.service.IJySysOrderPortalService;
|
||||
import com.ruoyi.jysystem.service.IJySysOrderService;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantProductService;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantService;
|
||||
import com.ruoyi.jysystem.utils.TenantTypeHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 开发者门户订单Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class JySysOrderPortalServiceImpl implements IJySysOrderPortalService
|
||||
{
|
||||
@Resource
|
||||
private IJySysOrderService jySysOrderService;
|
||||
|
||||
@Resource
|
||||
private IJySysTenantService jySysTenantService;
|
||||
|
||||
@Resource
|
||||
private IJySysTenantProductService jySysTenantProductService;
|
||||
|
||||
@Resource
|
||||
private JySysTenantProductMapper jySysTenantProductMapper;
|
||||
|
||||
@Override
|
||||
public void applyPortalOrderQuery(JySysOrder jySysOrder)
|
||||
{
|
||||
applyTenantFilter(jySysOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysOrder> selectPortalOrderList(JySysOrder jySysOrder)
|
||||
{
|
||||
return jySysOrderService.selectJySysOrderList(jySysOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JySysOrder selectPortalOrderById(Long id)
|
||||
{
|
||||
JySysOrder order = jySysOrderService.selectJySysOrderById(id);
|
||||
validateOrderAccessible(order);
|
||||
return order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPortalOrder(JySysOrder jySysOrder)
|
||||
{
|
||||
JySysTenant tenant = requireBrandTenant();
|
||||
validatePortalOrderProduct(jySysOrder, tenant.getId());
|
||||
jySysOrder.setBrandTenantId(tenant.getId());
|
||||
jySysOrder.setCreateBy(SecurityUtils.getUsername());
|
||||
return jySysOrderService.insertJySysOrder(jySysOrder);
|
||||
}
|
||||
|
||||
private static final String ORDER_STATUS_DRAFT = "1";
|
||||
|
||||
private static final String ORDER_STATUS_SUPPLEMENT_PENDING = "4";
|
||||
|
||||
private static final String ORDER_STATUS_REJECTED = "5";
|
||||
|
||||
private static final String ORDER_STATUS_SUPPLEMENTED = "19";
|
||||
|
||||
@Override
|
||||
public int updatePortalOrder(JySysOrder jySysOrder)
|
||||
{
|
||||
requireBrandTenant();
|
||||
if (jySysOrder.getId() == null)
|
||||
{
|
||||
throw new ServiceException("订单ID不能为空");
|
||||
}
|
||||
JySysOrder existing = jySysOrderService.selectJySysOrderById(jySysOrder.getId());
|
||||
validateOrderAccessible(existing);
|
||||
validatePortalOrderUpdate(existing, jySysOrder);
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
validatePortalOrderProduct(jySysOrder, tenant.getId());
|
||||
jySysOrder.setBrandTenantId(tenant.getId());
|
||||
jySysOrder.setUpdateBy(SecurityUtils.getUsername());
|
||||
return jySysOrderService.updateJySysOrder(jySysOrder);
|
||||
}
|
||||
|
||||
private void validatePortalOrderUpdate(JySysOrder existing, JySysOrder jySysOrder)
|
||||
{
|
||||
String existingStatus = existing.getOrderStatus();
|
||||
String targetStatus = jySysOrder.getOrderStatus();
|
||||
if (ORDER_STATUS_SUPPLEMENT_PENDING.equals(existingStatus))
|
||||
{
|
||||
if (!ORDER_STATUS_SUPPLEMENTED.equals(targetStatus))
|
||||
{
|
||||
throw new ServiceException("待补充订单请补充信息后提交");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ORDER_STATUS_SUPPLEMENTED.equals(existingStatus))
|
||||
{
|
||||
throw new ServiceException("已补充订单不可修改");
|
||||
}
|
||||
if (ORDER_STATUS_REJECTED.equals(existingStatus))
|
||||
{
|
||||
if (!ORDER_STATUS_REJECTED.equals(targetStatus))
|
||||
{
|
||||
throw new ServiceException("驳回订单请通过重新提交操作提交");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!ORDER_STATUS_DRAFT.equals(existingStatus))
|
||||
{
|
||||
throw new ServiceException("仅草稿、待补充或驳回状态的订单可修改");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePortalOrderByIds(Long[] ids)
|
||||
{
|
||||
requireBrandTenant();
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
for (Long id : ids)
|
||||
{
|
||||
JySysOrder order = jySysOrderService.selectJySysOrderById(id);
|
||||
if (order == null || !tenant.getId().equals(order.getBrandTenantId()))
|
||||
{
|
||||
throw new ServiceException("无权删除该订单");
|
||||
}
|
||||
}
|
||||
return jySysOrderService.deleteJySysOrderByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBrandTenant()
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
return TenantTypeHelper.isBrand(tenant.getTenantType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLensFactoryTenant()
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
return TenantTypeHelper.isLensFactory(tenant.getTenantType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canManageLensOrder()
|
||||
{
|
||||
return isBrandTenant();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int supplementPortalOrder(Long orderId, String remark)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factorySupplementOrder(orderId, tenant.getId(), remark, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int resubmitPortalOrder(Long orderId, String reason)
|
||||
{
|
||||
JySysTenant tenant = requireBrandTenant();
|
||||
return jySysOrderService.brandResubmitOrder(
|
||||
orderId, tenant.getId(), reason, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rejectPortalOrder(Long orderId, String reason)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factoryRejectOrder(
|
||||
orderId, tenant.getId(), reason, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int acceptPortalOrder(Long orderId)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factoryAcceptOrder(orderId, tenant.getId(), SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int producePortalOrder(Long orderId)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factoryProduceOrder(orderId, tenant.getId(), SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int withdrawPortalOrder(Long orderId, String reason)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factoryWithdrawOrder(
|
||||
orderId, tenant.getId(), reason, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int shipPortalOrder(Long orderId, String expressCompany, String expressNo, java.math.BigDecimal logisticsFee)
|
||||
{
|
||||
JySysTenant tenant = requireLensFactoryTenant();
|
||||
return jySysOrderService.factoryShipOrder(
|
||||
orderId, tenant.getId(), expressCompany, expressNo, logisticsFee, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int completePortalOrder(Long orderId)
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
String operator = SecurityUtils.getUsername();
|
||||
if (TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
return jySysOrderService.factoryCompleteOrder(orderId, tenant.getId(), operator);
|
||||
}
|
||||
if (TenantTypeHelper.isBrand(tenant.getTenantType()))
|
||||
{
|
||||
return jySysOrderService.brandCompleteOrder(orderId, tenant.getId(), operator);
|
||||
}
|
||||
throw new ServiceException("当前租户类型不支持完成订单");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int exchangeApplyPortalOrder(Long orderId, String reason)
|
||||
{
|
||||
JySysTenant tenant = requireBrandTenant();
|
||||
return jySysOrderService.brandExchangeApplyOrder(
|
||||
orderId, tenant.getId(), reason, SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receivePortalOrder(Long orderId)
|
||||
{
|
||||
JySysTenant tenant = requireBrandTenant();
|
||||
return jySysOrderService.brandReceiveExchangeRejectedOrder(
|
||||
orderId, tenant.getId(), SecurityUtils.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderPortalLogisticsVO selectPortalOrderLogistics(Long orderId)
|
||||
{
|
||||
validateOrderAccessible(jySysOrderService.selectJySysOrderById(orderId));
|
||||
return jySysOrderService.selectOrderLogistics(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysTenantProductVO> selectPortalProductOptions()
|
||||
{
|
||||
JySysTenant tenant = requireBrandTenant();
|
||||
return jySysTenantProductService.selectTenantProductListByTenantId(tenant.getId());
|
||||
}
|
||||
|
||||
private void validatePortalOrderProduct(JySysOrder order, Long brandTenantId)
|
||||
{
|
||||
if (order == null || order.getProductId() == null)
|
||||
{
|
||||
throw new ServiceException("请选择产品");
|
||||
}
|
||||
int count = jySysTenantProductMapper.countByTenantIdAndProductId(brandTenantId, order.getProductId());
|
||||
if (count <= 0)
|
||||
{
|
||||
throw new ServiceException("所选产品不在租户可配范围内");
|
||||
}
|
||||
}
|
||||
|
||||
private void applyTenantFilter(JySysOrder jySysOrder)
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
if (TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
jySysOrder.setLensFactoryTenantId(tenant.getId());
|
||||
return;
|
||||
}
|
||||
if (TenantTypeHelper.isBrand(tenant.getTenantType()) || TenantTypeHelper.isConsumer(tenant.getTenantType()))
|
||||
{
|
||||
jySysOrder.setBrandTenantId(tenant.getId());
|
||||
return;
|
||||
}
|
||||
throw new ServiceException("当前租户类型不支持查看订单");
|
||||
}
|
||||
|
||||
private void validateOrderAccessible(JySysOrder order)
|
||||
{
|
||||
if (order == null)
|
||||
{
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
if (TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
if (!tenant.getId().equals(order.getLensFactoryTenantId()))
|
||||
{
|
||||
throw new ServiceException("无权查看该订单");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (TenantTypeHelper.isBrand(tenant.getTenantType()) || TenantTypeHelper.isConsumer(tenant.getTenantType()))
|
||||
{
|
||||
if (!tenant.getId().equals(order.getBrandTenantId()))
|
||||
{
|
||||
throw new ServiceException("无权查看该订单");
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new ServiceException("当前租户类型不支持查看订单");
|
||||
}
|
||||
|
||||
private JySysTenant requireBrandTenant()
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
if (!TenantTypeHelper.isBrand(tenant.getTenantType()))
|
||||
{
|
||||
throw new ServiceException("仅品牌方可以操作配片单");
|
||||
}
|
||||
return tenant;
|
||||
}
|
||||
|
||||
private JySysTenant requireLensFactoryTenant()
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
if (!TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
throw new ServiceException("仅镜片厂可以操作制片单");
|
||||
}
|
||||
return tenant;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,123 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysProduct;
|
||||
import com.ruoyi.jysystem.mapper.JySysProductMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantProductMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysProductService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class JySysProductServiceImpl extends ServiceImpl<JySysProductMapper, JySysProduct> implements IJySysProductService
|
||||
{
|
||||
@Resource
|
||||
private JySysProductMapper jySysProductMapper;
|
||||
|
||||
@Resource
|
||||
private JySysTenantProductMapper jySysTenantProductMapper;
|
||||
|
||||
@Override
|
||||
public JySysProduct selectJySysProductById(Long id)
|
||||
{
|
||||
return jySysProductMapper.selectJySysProductById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysProduct> selectJySysProductList(JySysProduct jySysProduct)
|
||||
{
|
||||
return jySysProductMapper.selectJySysProductList(jySysProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysProduct> selectJySysProductOptions(Long tenantId)
|
||||
{
|
||||
return jySysProductMapper.selectJySysProductOptions(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertJySysProduct(JySysProduct jySysProduct)
|
||||
{
|
||||
validateProduct(jySysProduct);
|
||||
if (StringUtils.isEmpty(jySysProduct.getStatus()))
|
||||
{
|
||||
jySysProduct.setStatus("0");
|
||||
}
|
||||
if (jySysProduct.getDelFlag() == null)
|
||||
{
|
||||
jySysProduct.setDelFlag(0);
|
||||
}
|
||||
jySysProduct.setCreateTime(DateUtils.getNowDate());
|
||||
return jySysProductMapper.insertJySysProduct(jySysProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateJySysProduct(JySysProduct jySysProduct)
|
||||
{
|
||||
validateProduct(jySysProduct);
|
||||
jySysProduct.setUpdateTime(DateUtils.getNowDate());
|
||||
return jySysProductMapper.updateJySysProduct(jySysProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteJySysProductByIds(Long[] ids)
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for (Long id : ids)
|
||||
{
|
||||
validateProductDeletable(id);
|
||||
}
|
||||
return jySysProductMapper.deleteJySysProductByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteJySysProductById(Long id)
|
||||
{
|
||||
validateProductDeletable(id);
|
||||
return jySysProductMapper.deleteJySysProductById(id);
|
||||
}
|
||||
|
||||
private void validateProductDeletable(Long productId)
|
||||
{
|
||||
if (productId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (jySysTenantProductMapper.countByProductId(productId) > 0)
|
||||
{
|
||||
JySysProduct product = jySysProductMapper.selectJySysProductById(productId);
|
||||
String name = product != null && StringUtils.isNotEmpty(product.getProductModel())
|
||||
? product.getProductModel() : String.valueOf(productId);
|
||||
throw new ServiceException("产品【" + name + "】已被租户关联,不能删除");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateProduct(JySysProduct jySysProduct)
|
||||
{
|
||||
if (jySysProduct == null)
|
||||
{
|
||||
throw new ServiceException("产品信息不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(jySysProduct.getProductModel()))
|
||||
{
|
||||
throw new ServiceException("产品型号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(jySysProduct.getProductName()))
|
||||
{
|
||||
throw new ServiceException("产品名称不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantLens;
|
||||
import com.ruoyi.jysystem.dto.TenantLensSaveDTO;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantLensMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantLensService;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantLensVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户可配镜片Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class JySysTenantLensServiceImpl implements IJySysTenantLensService
|
||||
{
|
||||
@Resource
|
||||
private JySysTenantLensMapper jySysTenantLensMapper;
|
||||
|
||||
@Resource
|
||||
private JySysTenantMapper jySysTenantMapper;
|
||||
|
||||
@Override
|
||||
public List<JySysTenantLensVO> selectTenantLensListByTenantId(Long tenantId)
|
||||
{
|
||||
validateLensFactoryTenant(tenantId);
|
||||
return jySysTenantLensMapper.selectJySysTenantLensListByTenantId(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveTenantLensConfig(TenantLensSaveDTO saveDTO, String username)
|
||||
{
|
||||
if (saveDTO == null || saveDTO.getTenantId() == null)
|
||||
{
|
||||
throw new ServiceException("租户ID不能为空");
|
||||
}
|
||||
validateLensFactoryTenant(saveDTO.getTenantId());
|
||||
jySysTenantLensMapper.deleteJySysTenantLensByTenantId(saveDTO.getTenantId());
|
||||
int rows = 0;
|
||||
if (saveDTO.getItems() != null)
|
||||
{
|
||||
for (TenantLensSaveDTO.TenantLensItemDTO item : saveDTO.getItems())
|
||||
{
|
||||
if (item == null || item.getLensId() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.getCostPrice() == null || item.getCostPrice().compareTo(BigDecimal.ZERO) <= 0)
|
||||
{
|
||||
throw new ServiceException("成本价格必须大于0");
|
||||
}
|
||||
if (item.getSalePrice() == null || item.getSalePrice().compareTo(BigDecimal.ZERO) <= 0)
|
||||
{
|
||||
throw new ServiceException("销售价格必须大于0");
|
||||
}
|
||||
JySysTenantLens tenantLens = new JySysTenantLens();
|
||||
tenantLens.setTenantId(saveDTO.getTenantId());
|
||||
tenantLens.setLensId(item.getLensId());
|
||||
tenantLens.setCostPrice(item.getCostPrice());
|
||||
tenantLens.setSalePrice(item.getSalePrice());
|
||||
tenantLens.setCreateBy(username);
|
||||
tenantLens.setCreateTime(DateUtils.getNowDate());
|
||||
rows += jySysTenantLensMapper.insertJySysTenantLens(tenantLens);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveTenantLensInitialConfig(Long tenantId, List<Long> lensIds, String username)
|
||||
{
|
||||
if (tenantId == null)
|
||||
{
|
||||
throw new ServiceException("租户ID不能为空");
|
||||
}
|
||||
validateLensFactoryTenant(tenantId);
|
||||
jySysTenantLensMapper.deleteJySysTenantLensByTenantId(tenantId);
|
||||
int rows = 0;
|
||||
if (lensIds != null)
|
||||
{
|
||||
for (Long lensId : lensIds)
|
||||
{
|
||||
if (lensId == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
JySysTenantLens tenantLens = new JySysTenantLens();
|
||||
tenantLens.setTenantId(tenantId);
|
||||
tenantLens.setLensId(lensId);
|
||||
tenantLens.setCostPrice(BigDecimal.ONE);
|
||||
tenantLens.setSalePrice(BigDecimal.ONE);
|
||||
tenantLens.setCreateBy(username);
|
||||
tenantLens.setCreateTime(DateUtils.getNowDate());
|
||||
rows += jySysTenantLensMapper.insertJySysTenantLens(tenantLens);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
private void validateLensFactoryTenant(Long tenantId)
|
||||
{
|
||||
JySysTenant tenant = jySysTenantMapper.selectJySysTenantById(tenantId);
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ServiceException("租户不存在");
|
||||
}
|
||||
if (!com.ruoyi.jysystem.utils.TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
throw new ServiceException("仅镜片厂租户可配置镜片");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysOrder;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantMessage;
|
||||
import com.ruoyi.jysystem.mapper.JySysOrderMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantMessageMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantMessageService;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantService;
|
||||
import com.ruoyi.jysystem.service.SmsNotificationService;
|
||||
import com.ruoyi.jysystem.utils.TenantTypeHelper;
|
||||
|
||||
/**
|
||||
* 租户消息Service业务层
|
||||
*/
|
||||
@Service
|
||||
public class JySysTenantMessageServiceImpl implements IJySysTenantMessageService
|
||||
{
|
||||
private static final String ORDER_STATUS_DRAFT = "1";
|
||||
|
||||
private static final String ORDER_STATUS_ASSIGNED = "3";
|
||||
|
||||
private static final String ORDER_STATUS_SHIPPED = "8";
|
||||
|
||||
@Resource
|
||||
private JySysTenantMessageMapper jySysTenantMessageMapper;
|
||||
|
||||
@Resource
|
||||
private JySysOrderMapper jySysOrderMapper;
|
||||
|
||||
@Resource
|
||||
private IJySysTenantService jySysTenantService;
|
||||
|
||||
@Resource
|
||||
private SmsNotificationService smsNotificationService;
|
||||
|
||||
@Override
|
||||
public List<JySysTenantMessage> selectPortalMessageList(JySysTenantMessage message)
|
||||
{
|
||||
JySysTenant tenant = requirePortalTenant();
|
||||
message.setTenantId(tenant.getId());
|
||||
return jySysTenantMessageMapper.selectJySysTenantMessageList(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countPortalUnread()
|
||||
{
|
||||
JySysTenant tenant = requirePortalTenant();
|
||||
return jySysTenantMessageMapper.countUnreadByTenantId(tenant.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int markPortalRead(Long id)
|
||||
{
|
||||
JySysTenant tenant = requirePortalTenant();
|
||||
return jySysTenantMessageMapper.markReadById(id, tenant.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int markPortalAllRead()
|
||||
{
|
||||
JySysTenant tenant = requirePortalTenant();
|
||||
return jySysTenantMessageMapper.markAllReadByTenantId(tenant.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyOrderStatusChange(Long orderId, String orderStatus, String remark,
|
||||
String expressCompany, String expressNo)
|
||||
{
|
||||
if (orderId == null || StringUtils.isEmpty(orderStatus) || ORDER_STATUS_DRAFT.equals(orderStatus))
|
||||
{
|
||||
return;
|
||||
}
|
||||
JySysOrder order = jySysOrderMapper.selectJySysOrderById(orderId);
|
||||
if (order == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
String statusLabel = DictUtils.getDictLabel("jy_order_status", orderStatus);
|
||||
if (StringUtils.isEmpty(statusLabel))
|
||||
{
|
||||
statusLabel = orderStatus;
|
||||
}
|
||||
String orderNo = StringUtils.isNotEmpty(order.getOrderNo()) ? order.getOrderNo() : String.valueOf(orderId);
|
||||
|
||||
if (order.getBrandTenantId() != null)
|
||||
{
|
||||
JySysTenant brandTenant = jySysTenantService.selectJySysTenantById(order.getBrandTenantId());
|
||||
if (brandTenant != null && TenantTypeHelper.isBrand(brandTenant.getTenantType()))
|
||||
{
|
||||
String content = "您的订单【" + orderNo + "】状态已变更为:" + statusLabel;
|
||||
if (StringUtils.isNotEmpty(remark))
|
||||
{
|
||||
content = content + ",备注:" + remark;
|
||||
}
|
||||
insertMessage(order.getBrandTenantId(), order.getId(), orderNo,
|
||||
JySysTenantMessage.TYPE_STATUS_CHANGE, "订单状态变更", content, orderStatus);
|
||||
if (ORDER_STATUS_SHIPPED.equals(orderStatus))
|
||||
{
|
||||
String smsPhone = StringUtils.isNotEmpty(order.getReceiverPhone())
|
||||
? order.getReceiverPhone()
|
||||
: brandTenant.getPhone();
|
||||
if (StringUtils.isNotEmpty(smsPhone))
|
||||
{
|
||||
smsNotificationService.trySendOrderShippedNotify(smsPhone, orderNo, expressCompany, expressNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (order.getLensFactoryTenantId() != null)
|
||||
{
|
||||
JySysTenant factoryTenant = jySysTenantService.selectJySysTenantById(order.getLensFactoryTenantId());
|
||||
if (factoryTenant != null && TenantTypeHelper.isLensFactory(factoryTenant.getTenantType()))
|
||||
{
|
||||
if (ORDER_STATUS_ASSIGNED.equals(orderStatus))
|
||||
{
|
||||
String content = "新订单【" + orderNo + "】已分配给您,请及时处理";
|
||||
insertMessage(order.getLensFactoryTenantId(), order.getId(), orderNo,
|
||||
JySysTenantMessage.TYPE_ORDER_ASSIGNED, "新制片单分配", content, orderStatus);
|
||||
if (StringUtils.isNotEmpty(factoryTenant.getPhone()))
|
||||
{
|
||||
smsNotificationService.trySendOrderAssignedNotify(factoryTenant.getPhone(), orderNo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String content = "订单【" + orderNo + "】状态已变更为:" + statusLabel;
|
||||
if (StringUtils.isNotEmpty(remark))
|
||||
{
|
||||
content = content + ",备注:" + remark;
|
||||
}
|
||||
insertMessage(order.getLensFactoryTenantId(), order.getId(), orderNo,
|
||||
JySysTenantMessage.TYPE_STATUS_CHANGE, "订单状态变更", content, orderStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void insertMessage(Long tenantId, Long orderId, String orderNo, String messageType,
|
||||
String title, String content, String orderStatus)
|
||||
{
|
||||
JySysTenantMessage message = new JySysTenantMessage();
|
||||
message.setTenantId(tenantId);
|
||||
message.setOrderId(orderId);
|
||||
message.setOrderNo(orderNo);
|
||||
message.setMessageType(messageType);
|
||||
message.setTitle(title);
|
||||
message.setContent(content);
|
||||
message.setOrderStatus(orderStatus);
|
||||
message.setReadFlag("0");
|
||||
message.setCreateTime(DateUtils.getNowDate());
|
||||
jySysTenantMessageMapper.insertJySysTenantMessage(message);
|
||||
}
|
||||
|
||||
private JySysTenant requirePortalTenant()
|
||||
{
|
||||
JySysTenant tenant = jySysTenantService.selectCurrentLoginTenant();
|
||||
if (!TenantTypeHelper.isBrand(tenant.getTenantType())
|
||||
&& !TenantTypeHelper.isLensFactory(tenant.getTenantType()))
|
||||
{
|
||||
throw new ServiceException("当前租户类型不支持消息功能");
|
||||
}
|
||||
return tenant;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.domain.JySysTenantProduct;
|
||||
import com.ruoyi.jysystem.dto.TenantProductSaveDTO;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantProductMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantProductService;
|
||||
import com.ruoyi.jysystem.utils.TenantTypeHelper;
|
||||
import com.ruoyi.jysystem.vo.JySysTenantProductVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户关联产品Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class JySysTenantProductServiceImpl implements IJySysTenantProductService
|
||||
{
|
||||
@Resource
|
||||
private JySysTenantProductMapper jySysTenantProductMapper;
|
||||
|
||||
@Resource
|
||||
private JySysTenantMapper jySysTenantMapper;
|
||||
|
||||
@Override
|
||||
public List<JySysTenantProductVO> selectTenantProductListByTenantId(Long tenantId)
|
||||
{
|
||||
validateBrandTenant(tenantId);
|
||||
return jySysTenantProductMapper.selectJySysTenantProductListByTenantId(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveTenantProductConfig(TenantProductSaveDTO saveDTO, String username)
|
||||
{
|
||||
if (saveDTO == null || saveDTO.getTenantId() == null)
|
||||
{
|
||||
throw new ServiceException("租户ID不能为空");
|
||||
}
|
||||
validateBrandTenant(saveDTO.getTenantId());
|
||||
jySysTenantProductMapper.deleteJySysTenantProductByTenantId(saveDTO.getTenantId());
|
||||
int rows = 0;
|
||||
if (saveDTO.getProductIds() != null)
|
||||
{
|
||||
for (Long productId : saveDTO.getProductIds())
|
||||
{
|
||||
if (productId == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
JySysTenantProduct tenantProduct = new JySysTenantProduct();
|
||||
tenantProduct.setTenantId(saveDTO.getTenantId());
|
||||
tenantProduct.setProductId(productId);
|
||||
tenantProduct.setCreateBy(username);
|
||||
tenantProduct.setCreateTime(DateUtils.getNowDate());
|
||||
rows += jySysTenantProductMapper.insertJySysTenantProduct(tenantProduct);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
private void validateBrandTenant(Long tenantId)
|
||||
{
|
||||
JySysTenant tenant = jySysTenantMapper.selectJySysTenantById(tenantId);
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ServiceException("租户不存在");
|
||||
}
|
||||
if (!TenantTypeHelper.isBrand(tenant.getTenantType()))
|
||||
{
|
||||
throw new ServiceException("仅品牌方租户可配置产品");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.domain.JySysTenant;
|
||||
import com.ruoyi.jysystem.dto.TenantLensSaveDTO;
|
||||
import com.ruoyi.jysystem.dto.TenantProductSaveDTO;
|
||||
import com.ruoyi.jysystem.mapper.JySysOrderMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysProductMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantLensMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantMapper;
|
||||
import com.ruoyi.jysystem.mapper.JySysTenantProductMapper;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantLensService;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantProductService;
|
||||
import com.ruoyi.jysystem.service.IJySysTenantService;
|
||||
import com.ruoyi.jysystem.utils.IdUtil;
|
||||
import com.ruoyi.jysystem.utils.TenantTypeHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Service
|
||||
public class JySysTenantServiceImpl implements IJySysTenantService
|
||||
{
|
||||
@Autowired
|
||||
private JySysTenantMapper jySysTenantMapper;
|
||||
|
||||
@Autowired
|
||||
private IJySysTenantProductService jySysTenantProductService;
|
||||
|
||||
@Autowired
|
||||
private IJySysTenantLensService jySysTenantLensService;
|
||||
|
||||
@Autowired
|
||||
private JySysOrderMapper jySysOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private JySysTenantProductMapper jySysTenantProductMapper;
|
||||
|
||||
@Autowired
|
||||
private JySysTenantLensMapper jySysTenantLensMapper;
|
||||
|
||||
@Autowired
|
||||
private JySysProductMapper jySysProductMapper;
|
||||
|
||||
/**
|
||||
* 查询租户
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 租户
|
||||
*/
|
||||
@Override
|
||||
public JySysTenant selectJySysTenantById(Long id)
|
||||
{
|
||||
return jySysTenantMapper.selectJySysTenantById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户列表
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 租户
|
||||
*/
|
||||
@Override
|
||||
public List<JySysTenant> selectJySysTenantList(JySysTenant jySysTenant)
|
||||
{
|
||||
return jySysTenantMapper.selectJySysTenantList(jySysTenant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertJySysTenant(JySysTenant jySysTenant)
|
||||
{
|
||||
validateProgressiveMultifocalPrice(jySysTenant);
|
||||
if (jySysTenant.getId() == null)
|
||||
{
|
||||
jySysTenant.setId(IdUtil.getInstance().nextId());
|
||||
}
|
||||
if (StringUtils.isEmpty(jySysTenant.getStatus()))
|
||||
{
|
||||
jySysTenant.setStatus("0");
|
||||
}
|
||||
jySysTenant.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = jySysTenantMapper.insertJySysTenant(jySysTenant);
|
||||
saveTenantRelationsOnCreate(jySysTenant);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*
|
||||
* @param jySysTenant 租户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateJySysTenant(JySysTenant jySysTenant)
|
||||
{
|
||||
validateProgressiveMultifocalPrice(jySysTenant);
|
||||
jySysTenant.setUpdateTime(DateUtils.getNowDate());
|
||||
return jySysTenantMapper.updateJySysTenant(jySysTenant);
|
||||
}
|
||||
|
||||
private void validateProgressiveMultifocalPrice(JySysTenant jySysTenant)
|
||||
{
|
||||
if (jySysTenant == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!TenantTypeHelper.isLensFactory(jySysTenant.getTenantType()))
|
||||
{
|
||||
jySysTenant.setProgressiveMultifocalPrice(null);
|
||||
return;
|
||||
}
|
||||
if (jySysTenant.getProgressiveMultifocalPrice() == null
|
||||
|| jySysTenant.getProgressiveMultifocalPrice().compareTo(BigDecimal.ZERO) <= 0)
|
||||
{
|
||||
throw new ServiceException("渐进多焦点价格必须大于0");
|
||||
}
|
||||
}
|
||||
|
||||
private void saveTenantRelationsOnCreate(JySysTenant jySysTenant)
|
||||
{
|
||||
String operator = jySysTenant.getCreateBy();
|
||||
if (TenantTypeHelper.isBrand(jySysTenant.getTenantType())
|
||||
&& jySysTenant.getProductIds() != null
|
||||
&& !jySysTenant.getProductIds().isEmpty())
|
||||
{
|
||||
TenantProductSaveDTO saveDTO = new TenantProductSaveDTO();
|
||||
saveDTO.setTenantId(jySysTenant.getId());
|
||||
saveDTO.setProductIds(jySysTenant.getProductIds());
|
||||
jySysTenantProductService.saveTenantProductConfig(saveDTO, operator);
|
||||
}
|
||||
if (TenantTypeHelper.isLensFactory(jySysTenant.getTenantType()))
|
||||
{
|
||||
if (jySysTenant.getLensItems() != null && !jySysTenant.getLensItems().isEmpty())
|
||||
{
|
||||
TenantLensSaveDTO lensSaveDTO = new TenantLensSaveDTO();
|
||||
lensSaveDTO.setTenantId(jySysTenant.getId());
|
||||
lensSaveDTO.setItems(jySysTenant.getLensItems());
|
||||
jySysTenantLensService.saveTenantLensConfig(lensSaveDTO, operator);
|
||||
}
|
||||
else if (jySysTenant.getLensIds() != null && !jySysTenant.getLensIds().isEmpty())
|
||||
{
|
||||
jySysTenantLensService.saveTenantLensInitialConfig(
|
||||
jySysTenant.getId(), jySysTenant.getLensIds(), operator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户
|
||||
*
|
||||
* @param ids 需要删除的租户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteJySysTenantByIds(Long[] ids)
|
||||
{
|
||||
if (ids == null || ids.length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for (Long id : ids)
|
||||
{
|
||||
validateTenantDeletable(id);
|
||||
}
|
||||
int rows = 0;
|
||||
for (Long id : ids)
|
||||
{
|
||||
rows += deleteTenantCascade(id);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户信息
|
||||
*
|
||||
* @param id 租户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteJySysTenantById(Long id)
|
||||
{
|
||||
validateTenantDeletable(id);
|
||||
return deleteTenantCascade(id);
|
||||
}
|
||||
|
||||
private void validateTenantDeletable(Long tenantId)
|
||||
{
|
||||
if (tenantId == null)
|
||||
{
|
||||
throw new ServiceException("租户ID不能为空");
|
||||
}
|
||||
JySysTenant tenant = jySysTenantMapper.selectJySysTenantById(tenantId);
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ServiceException("租户不存在");
|
||||
}
|
||||
if (jySysOrderMapper.countByTenantId(tenantId) > 0)
|
||||
{
|
||||
throw new ServiceException("租户【" + tenant.getName() + "】已关联订单,不能删除");
|
||||
}
|
||||
}
|
||||
|
||||
private int deleteTenantCascade(Long tenantId)
|
||||
{
|
||||
jySysTenantProductMapper.deleteJySysTenantProductByTenantId(tenantId);
|
||||
jySysTenantLensMapper.deleteJySysTenantLensByTenantId(tenantId);
|
||||
jySysTenantProductMapper.deleteByProductBrandTenantId(tenantId);
|
||||
jySysProductMapper.deleteJySysProductByBrandTenantId(tenantId);
|
||||
return jySysTenantMapper.deleteJySysTenantById(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int changeTenantStatus(JySysTenant jySysTenant)
|
||||
{
|
||||
if (jySysTenant == null || jySysTenant.getId() == null)
|
||||
{
|
||||
throw new ServiceException("租户ID不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(jySysTenant.getStatus()))
|
||||
{
|
||||
throw new ServiceException("租户状态不能为空");
|
||||
}
|
||||
JySysTenant tenant = jySysTenantMapper.selectJySysTenantById(jySysTenant.getId());
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ServiceException("租户不存在");
|
||||
}
|
||||
jySysTenant.setUpdateTime(DateUtils.getNowDate());
|
||||
int rows = jySysTenantMapper.updateJySysTenantStatus(jySysTenant);
|
||||
if (StringUtils.isNotEmpty(tenant.getCode()))
|
||||
{
|
||||
jySysTenantMapper.updateUserStatusByTenantCode(tenant.getCode(), jySysTenant.getStatus());
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JySysTenant selectCurrentLoginTenant()
|
||||
{
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
JySysTenant tenant = selectLoginTenantByUser(user);
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ServiceException("当前用户未关联租户");
|
||||
}
|
||||
return tenant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JySysTenant selectLoginTenantByUser(SysUser user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getTenantCode()))
|
||||
{
|
||||
JySysTenant tenant = jySysTenantMapper.selectJySysTenantByCode(user.getTenantCode());
|
||||
if (tenant != null)
|
||||
{
|
||||
return tenant;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getTenantName()))
|
||||
{
|
||||
return jySysTenantMapper.selectJySysTenantByName(user.getTenantName());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysTenant> selectBrandTenantList()
|
||||
{
|
||||
return jySysTenantMapper.selectJySysTenantListByTypes(TenantTypeHelper.brandTypes(), "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysTenant> selectLensFactoryTenantList()
|
||||
{
|
||||
return jySysTenantMapper.selectJySysTenantListByTypes(TenantTypeHelper.lensFactoryTypes(), "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JySysTenant> selectLensFactoryTenantListByLensId(Long lensId)
|
||||
{
|
||||
if (lensId == null)
|
||||
{
|
||||
return selectLensFactoryTenantList();
|
||||
}
|
||||
return jySysTenantMapper.selectLensFactoryTenantsByLensId(lensId, TenantTypeHelper.lensFactoryTypes(), "0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.annotation.Resource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.jysystem.config.SmsProperties;
|
||||
import com.ruoyi.jysystem.service.SmsNotificationService;
|
||||
|
||||
/**
|
||||
* 业务短信通知
|
||||
*/
|
||||
@Service
|
||||
public class SmsNotificationServiceImpl implements SmsNotificationService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SmsNotificationServiceImpl.class);
|
||||
|
||||
private static final Pattern MOBILE_PATTERN = Pattern.compile("^1[3-9]\\d{9}$");
|
||||
|
||||
@Resource
|
||||
private SmsProperties smsProperties;
|
||||
|
||||
@Override
|
||||
public void trySendOrderAssignedNotify(String phone, String orderNo)
|
||||
{
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("code", nullToEmpty(orderNo));
|
||||
trySendScene("配片订单分配", smsProperties.getAssignOrder(), phone, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trySendOrderShippedNotify(String phone, String orderNo, String expressCompany, String expressNo)
|
||||
{
|
||||
Map<String, String> params = new HashMap<>(3);
|
||||
params.put("code", nullToEmpty(orderNo));
|
||||
params.put("expressCompany", nullToEmpty(expressCompany));
|
||||
params.put("expressNo", nullToEmpty(expressNo));
|
||||
trySendScene("配片订单发货", smsProperties.getShipOrder(), phone, params);
|
||||
}
|
||||
|
||||
private void trySendScene(String sceneLabel, SmsProperties.SceneConfig scene, String phone, Map<String, String> templateParams)
|
||||
{
|
||||
if (scene == null || !scene.isEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isEmpty(phone))
|
||||
{
|
||||
return;
|
||||
}
|
||||
String templateCode = StringUtils.isNotEmpty(scene.getTemplate()) ? scene.getTemplate().trim() : null;
|
||||
if (StringUtils.isEmpty(templateCode))
|
||||
{
|
||||
log.warn("未配置{}短信模板,请在 application.yml 的 sms.{} 中填写 template",
|
||||
sceneLabel, sceneLabel.contains("分配") ? "assign-order" : "ship-order");
|
||||
return;
|
||||
}
|
||||
String mobile = phone.trim();
|
||||
if (!MOBILE_PATTERN.matcher(mobile).matches())
|
||||
{
|
||||
log.warn("{}短信手机号格式无效,跳过通知: {}", sceneLabel, phone);
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
String templateParam = JSON.toJSONString(templateParams);
|
||||
Map<String, Object> result = SmsUtils.sendNotifyMsg(mobile, smsProperties.getSignName(),
|
||||
templateCode, templateParam);
|
||||
Integer statusCode = (Integer) result.get("statusCode");
|
||||
String bodyCode = (String) result.get("bodyCode");
|
||||
if (statusCode == null || statusCode != 200 || !"OK".equalsIgnoreCase(bodyCode))
|
||||
{
|
||||
log.warn("{}短信发送失败: phone={}, template={}, params={}, statusCode={}, bodyCode={}",
|
||||
sceneLabel, mobile, templateCode, templateParam, statusCode, bodyCode);
|
||||
return;
|
||||
}
|
||||
log.info("{}短信已发送: {}", sceneLabel, mobile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("{}短信发送异常: phone={}, err={}", sceneLabel, mobile, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String nullToEmpty(String value)
|
||||
{
|
||||
return value != null ? value : "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.jysystem.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.jysystem.mapper.SysRealNameAuthMapper;
|
||||
import com.ruoyi.jysystem.domain.SysRealNameAuth;
|
||||
import com.ruoyi.jysystem.service.ISysRealNameAuthService;
|
||||
import com.ruoyi.jysystem.utils.GmSm4Crypto;
|
||||
|
||||
/**
|
||||
* 实名认证Service业务层处理
|
||||
*
|
||||
* @author jueyuan
|
||||
*/
|
||||
@Service
|
||||
public class SysRealNameAuthServiceImpl implements ISysRealNameAuthService {
|
||||
|
||||
@Autowired
|
||||
private SysRealNameAuthMapper sysRealNameAuthMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private GmSm4Crypto gmSm4Crypto;
|
||||
|
||||
@Override
|
||||
public SysRealNameAuth selectSysRealNameAuthById(Long id) {
|
||||
SysRealNameAuth auth = sysRealNameAuthMapper.selectSysRealNameAuthById(id);
|
||||
decryptSensitive(auth);
|
||||
return auth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRealNameAuth> selectSysRealNameAuthList(SysRealNameAuth sysRealNameAuth) {
|
||||
List<SysRealNameAuth> list = sysRealNameAuthMapper.selectSysRealNameAuthList(sysRealNameAuth);
|
||||
// 为列表填充用户名、手机号
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (SysRealNameAuth auth : list) {
|
||||
decryptSensitive(auth);
|
||||
if (auth.getCreatorBy() != null) {
|
||||
SysUser u = userService.selectUserById(auth.getCreatorBy());
|
||||
if (u != null) {
|
||||
auth.setCreatorUserName(u.getUserName());
|
||||
auth.setCreatorMobile(u.getPhonenumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSysRealNameAuth(SysRealNameAuth sysRealNameAuth) {
|
||||
sysRealNameAuth.setCreateTime(DateUtils.getNowDate());
|
||||
return sysRealNameAuthMapper.insertSysRealNameAuth(sysRealNameAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSysRealNameAuth(SysRealNameAuth sysRealNameAuth) {
|
||||
sysRealNameAuth.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysRealNameAuthMapper.updateSysRealNameAuth(sysRealNameAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteSysRealNameAuthById(Long id) {
|
||||
return sysRealNameAuthMapper.deleteSysRealNameAuthById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int submitAuth(SysRealNameAuth sysRealNameAuth) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
sysRealNameAuth.setCreatorBy(userId);
|
||||
sysRealNameAuth.setAuditStatus(0); // 待审核
|
||||
sysRealNameAuth.setCreateTime(DateUtils.getNowDate());
|
||||
// 敏感字段国密加密落库
|
||||
sysRealNameAuth.setPhone(gmSm4Crypto.encrypt(sysRealNameAuth.getPhone()));
|
||||
sysRealNameAuth.setIdNumber(gmSm4Crypto.encrypt(sysRealNameAuth.getIdNumber()));
|
||||
return sysRealNameAuthMapper.insertSysRealNameAuth(sysRealNameAuth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRealNameAuth getMyAuth() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysRealNameAuth auth = sysRealNameAuthMapper.selectByCreatorBy(userId);
|
||||
decryptSensitive(auth);
|
||||
return auth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int auditPass(Long id, String auditRemark) {
|
||||
Long auditorId = SecurityUtils.getUserId();
|
||||
return sysRealNameAuthMapper.updateAudit(id, 1, auditRemark, auditorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int auditReject(Long id, String auditRemark) {
|
||||
Long auditorId = SecurityUtils.getUserId();
|
||||
return sysRealNameAuthMapper.updateAudit(id, 2, auditRemark, auditorId);
|
||||
}
|
||||
|
||||
private void decryptSensitive(SysRealNameAuth auth)
|
||||
{
|
||||
if (auth == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auth.setPhone(gmSm4Crypto.decrypt(auth.getPhone()));
|
||||
auth.setIdNumber(gmSm4Crypto.decrypt(auth.getIdNumber()));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user