Compare commits
8 Commits
2d0a5dcb38
...
52ca9b3295
Author | SHA1 | Date |
---|---|---|
|
52ca9b3295 | |
|
4c15e5247f | |
|
3e7a30d786 | |
|
3645f7894c | |
|
b8bf961509 | |
|
1cdfb48ae3 | |
|
2385b58bb0 | |
|
f445567505 |
|
@ -0,0 +1,80 @@
|
|||
package com.mcwl.web.controller.init;
|
||||
|
||||
import com.mcwl.common.core.domain.entity.SysDictData;
|
||||
import com.mcwl.system.mapper.SysDictDataMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/14
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DictInit implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
|
||||
private static final Map<String, Map<String, SysDictData>> dictCache = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
|
||||
log.info("初始化字典数据...");
|
||||
|
||||
SysDictData dictData = new SysDictData();
|
||||
dictData.setStatus("0");
|
||||
|
||||
// 查询所有字典数据 查询所有状态为启用的正常的,sql太简单就不写了
|
||||
List<SysDictData> allDicts = sysDictDataMapper.selectDictDataList(dictData);
|
||||
|
||||
|
||||
// 根据 dictType 分组
|
||||
Map<String, List<SysDictData>> groupedByType = allDicts.stream()
|
||||
.collect(Collectors.groupingBy(SysDictData::getDictType));
|
||||
|
||||
// 组织最终的 Map 结构
|
||||
groupedByType.forEach((type, items) -> {
|
||||
Map<String, SysDictData> subMap = items.stream()
|
||||
.collect(Collectors.toMap(
|
||||
SysDictData::getDictValue,
|
||||
item -> item// 这里使用整个 SysDictData 对象作为值
|
||||
));
|
||||
dictCache.put(type, subMap);
|
||||
});
|
||||
log.info("字典数据初始化完成...");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典值
|
||||
*
|
||||
* @param type
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String getDictValue(String type, String value) {
|
||||
Map<String, SysDictData> stringSysDictDataMap = dictCache.get(type);
|
||||
if (stringSysDictDataMap != null) {
|
||||
|
||||
SysDictData sysDictData = stringSysDictDataMap.get(value);
|
||||
|
||||
if (sysDictData != null) {
|
||||
return sysDictData.getDictLabel();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -140,4 +141,16 @@ public class MemberController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据会员等级和活动计算支付金额
|
||||
*/
|
||||
@GetMapping("calculatePayment")
|
||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||
Double unitPrice = memberLevel.getUnitPrice();
|
||||
unitPrice = memberService.calculatePayment(unitPrice, promotionId);
|
||||
return AjaxResult.success(unitPrice);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
|||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
|
@ -38,6 +39,9 @@ public class MallProductController extends BaseController {
|
|||
@Autowired
|
||||
private ModelService modelService;
|
||||
|
||||
@Autowired
|
||||
private ModelImageService modelImageService;
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
|
@ -145,4 +149,31 @@ public class MallProductController extends BaseController {
|
|||
return AjaxResult.success(mallProductList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 我的发布-模型
|
||||
*/
|
||||
@PostMapping("/selectByUserIdModel")
|
||||
public AjaxResult selectByUserIdModel(@RequestBody MallProductVo mallProductVo){
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的发布-工作流
|
||||
*/
|
||||
@PostMapping("/selectByUserIdWorkFlow")
|
||||
public AjaxResult selectByUserIdWorkFlow(@RequestBody MallProductVo mallProductVo){
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的发布-图片
|
||||
*/
|
||||
@PostMapping("/selectByUserIdImage")
|
||||
public TableDataInfo selectByUserIdImage(@RequestBody ModelImagePageRes imagePageRes){
|
||||
|
||||
return modelImageService.listByPage(imagePageRes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelComment;
|
||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||
|
@ -36,6 +37,7 @@ public class ModelCommentController {
|
|||
/**
|
||||
* 模型点赞/取消
|
||||
*/
|
||||
@RepeatSubmit
|
||||
@GetMapping("/modelLike/{modelId}")
|
||||
public AjaxResult like(@PathVariable Long imageId) {
|
||||
modelLikeService.like(imageId);
|
||||
|
@ -55,6 +57,7 @@ public class ModelCommentController {
|
|||
/**
|
||||
* 模型评论点赞/取消
|
||||
*/
|
||||
@RepeatSubmit
|
||||
@GetMapping("/commentLike/{commentId}")
|
||||
public AjaxResult commentLike(@PathVariable Long commentId) {
|
||||
modelCommentLikeService.like(commentId);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.PageDomain;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.oss.OssUtil;
|
||||
|
@ -48,8 +50,9 @@ public class ModelImageController {
|
|||
* 图片列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
public TableDataInfo list(@RequestBody PageDomain pageDomain) {
|
||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||
return modelImageService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
|
@ -112,6 +115,7 @@ public class ModelImageController {
|
|||
/**
|
||||
* 图片点赞/取消
|
||||
*/
|
||||
@RepeatSubmit
|
||||
@GetMapping("/imageLike/{imageId}")
|
||||
public AjaxResult like(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
modelImageLikeService.like(imageId);
|
||||
|
@ -131,6 +135,7 @@ public class ModelImageController {
|
|||
/**
|
||||
* 图片评论点赞/取消
|
||||
*/
|
||||
@RepeatSubmit
|
||||
@GetMapping("/commentLike/{commentId}")
|
||||
public AjaxResult commentLike(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelImageCommentLikeService.like(commentId);
|
||||
|
|
|
@ -24,7 +24,6 @@ public class SysUserAttentionController {
|
|||
@Autowired
|
||||
private SysUserAttentionServiceImpl sysUserAttentionService;
|
||||
|
||||
|
||||
/**
|
||||
* 添加/取消关注
|
||||
* @param userId
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.web.controller.resource;
|
|||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -66,12 +67,22 @@ public class WorkFlowController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加工作流
|
||||
* @param requestWorkFlow
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/addWorkFlow")
|
||||
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
return workFlowService.addWorkFlow(requestWorkFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工作流
|
||||
* @param requestWorkFlow
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateWorkFlow")
|
||||
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
|
@ -80,6 +91,39 @@ public class WorkFlowController extends BaseController {
|
|||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工作流
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/deleteWorkFlow")
|
||||
public AjaxResult deleteWorkFlow(@RequestParam Long id){
|
||||
|
||||
workFlowService.deleteWorkFlow(id);
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工作流列表
|
||||
* @param pageVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectWorkFlow")
|
||||
public AjaxResult selectWorkFlow(@RequestBody PageVo pageVo){
|
||||
|
||||
return workFlowService.selectWorkFlow(pageVo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询工作流详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectWorkFlowById")
|
||||
public AjaxResult selectWorkFlowById(@RequestParam Long id){
|
||||
|
||||
return workFlowService.selectWorkFlowById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.service.impl.WorkFlowVersionServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 工作流版本
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/14
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@RequestMapping("/WorkFlowVersion")
|
||||
@RestController
|
||||
public class WorkFlowVersionController {
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionServiceImpl workFlowVersionService;
|
||||
|
||||
/**
|
||||
* 查询工作流下的所有版本信息
|
||||
*
|
||||
* @param workId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectVersionByWorkId")
|
||||
public AjaxResult selectVersionByWorkId(@RequestParam Long workId) {
|
||||
|
||||
return workFlowVersionService.selectVersionByWorkId(workId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.mcwl.common.constant;
|
||||
|
||||
/**
|
||||
* 字典值常量数据信息
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/14
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
public class DictConstants {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
public static final String MALL_PRODUCT_STATUS = "mall_product_status";
|
||||
|
||||
/**
|
||||
* 类型模型
|
||||
*/
|
||||
public static final String MODEL_CATEGORY = "model_category";
|
||||
|
||||
|
||||
/**
|
||||
* 垂类(一级)
|
||||
*/
|
||||
public static final String MODEL_PART_CATEGORY = "model_part_category";
|
||||
|
||||
/**
|
||||
* 垂类(二级)
|
||||
*/
|
||||
public static final String MODEL_CHILD_CATEGORY = "model_child_category";
|
||||
|
||||
/**
|
||||
* 主体
|
||||
*/
|
||||
public static final String WORK_FLOW_THEME = "work_flow_theme";
|
||||
|
||||
/**
|
||||
* 风格
|
||||
*/
|
||||
public static final String WORK_FLOW_STYLE = "work_flow_style";
|
||||
|
||||
/**
|
||||
* 功能
|
||||
*/
|
||||
public static final String WORK_FLOW_FUNCTIONS = "work_flow_functions";
|
||||
|
||||
/**
|
||||
* 图片标签
|
||||
*/
|
||||
public static final String IMAGE_LABLE = "image_lable";
|
||||
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
package com.mcwl.common.core.domain.entity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.mcwl.common.annotation.Excel;
|
||||
import com.mcwl.common.annotation.Excel.ColumnType;
|
||||
import com.mcwl.common.constant.UserConstants;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
|
@ -52,6 +53,16 @@ public class SysDictData extends BaseEntity
|
|||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
private Integer partId;
|
||||
|
||||
public Integer getPartId() {
|
||||
return partId;
|
||||
}
|
||||
|
||||
public void setPartId(Integer partId) {
|
||||
this.partId = partId;
|
||||
}
|
||||
|
||||
public Long getDictCode()
|
||||
{
|
||||
return dictCode;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.memberCenter.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
public interface MemberService extends IService<Member> {
|
||||
|
@ -41,4 +42,6 @@ public interface MemberService extends IService<Member> {
|
|||
* @param consumePoints 消费积分
|
||||
*/
|
||||
void consumePoints(Double consumePoints);
|
||||
|
||||
Double calculatePayment(Double unitPrice, Long promotionId);
|
||||
}
|
||||
|
|
|
@ -214,6 +214,24 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double calculatePayment(Double unitPrice, Long promotionId) {
|
||||
if (Objects.isNull(promotionId)) {
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
Promotion promotion = promotionMapper.selectById(promotionId);
|
||||
if (Objects.isNull(promotion)) {
|
||||
return unitPrice;
|
||||
}
|
||||
PromotionEnum activityType = promotion.getActivityType();
|
||||
if (activityType == PromotionEnum.DISCOUNT) {
|
||||
return unitPrice * promotion.getActivityValue();
|
||||
}
|
||||
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
private void saveMemberConsume(Double consumePoints, Long userId, double points) {
|
||||
MemberConsume memberConsume = new MemberConsume();
|
||||
memberConsume.setUserId(userId);
|
||||
|
|
|
@ -38,5 +38,11 @@
|
|||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mcwl</groupId>
|
||||
<artifactId>mcwl-admin</artifactId>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -85,4 +85,9 @@ public class ModelImage extends BaseEntity {
|
|||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
private Integer isTop;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,10 @@ public class ModelProduct extends BaseEntity {
|
|||
* 下载次数
|
||||
*/
|
||||
private Integer numbers;
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeNum;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,24 @@ public class SysUserInfo {
|
|||
private Long bean = 0L;
|
||||
|
||||
/**
|
||||
* 下载次数
|
||||
* 模型下载次数
|
||||
*/
|
||||
private Long download = 0L;
|
||||
private Long modelDownloadNum = 0L;
|
||||
|
||||
/**
|
||||
* 点赞次数
|
||||
* 模型运行次数
|
||||
*/
|
||||
private Long likeCount = 0L;
|
||||
private Long modelRunNum = 0L;
|
||||
|
||||
|
||||
/**
|
||||
* 模型点赞次数
|
||||
*/
|
||||
private Long modelLikeNum = 0L;
|
||||
|
||||
/**
|
||||
* 图片点赞次数
|
||||
*/
|
||||
private Long imageLikeNum = 0L;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流表
|
||||
|
@ -16,6 +23,7 @@ import lombok.NoArgsConstructor;
|
|||
* @Version:1.0
|
||||
* @Date:2025/1/8 19:38
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
|
@ -54,7 +62,7 @@ public class WorkFlow {
|
|||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String del_flag;
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
||||
|
@ -66,6 +74,11 @@ public class WorkFlow {
|
|||
*/
|
||||
private String auditText;
|
||||
|
||||
/**
|
||||
* 是否原创
|
||||
*/
|
||||
private Integer original;
|
||||
|
||||
/**
|
||||
* 原文作者名字
|
||||
*/
|
||||
|
@ -81,4 +94,54 @@ public class WorkFlow {
|
|||
*/
|
||||
private Long downloadNumber = 0L;
|
||||
|
||||
/**
|
||||
* 是否允许在线使用(0允许 1不允许)
|
||||
*/
|
||||
private Integer onlineUse;
|
||||
|
||||
/**
|
||||
* 是否允许下载工作流(0允许 1不允许)
|
||||
*/
|
||||
private Integer download;
|
||||
|
||||
/**
|
||||
* 是否允许出售或商用(0允许 1不允许
|
||||
*/
|
||||
private Integer sell;
|
||||
|
||||
/**
|
||||
* 封面图地址
|
||||
*/
|
||||
private String coverPath;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 作品点赞数量
|
||||
*/
|
||||
private Long likeCount = 0L;
|
||||
|
||||
/**
|
||||
* 翻译后主体
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> themeList;
|
||||
|
||||
/**
|
||||
* 翻译后风格
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> styleList;
|
||||
}
|
||||
|
|
|
@ -65,51 +65,6 @@ public class WorkFlowVersion {
|
|||
*/
|
||||
private Long workFlowId;
|
||||
|
||||
/**
|
||||
* 基础模型
|
||||
*/
|
||||
private Integer basicModel;
|
||||
|
||||
/**
|
||||
* 权限状态
|
||||
*/
|
||||
private Integer jurisdiction;
|
||||
|
||||
/**
|
||||
*是否允许在本软件使用(0授权 1不允许
|
||||
*/
|
||||
private Integer itselfUse;
|
||||
|
||||
/**
|
||||
* 是否允许在旗下软件使用(0授权 1不允许)
|
||||
*/
|
||||
private Integer subordinateUse;
|
||||
|
||||
/**
|
||||
* 是否允许下载生图(0授权 1不允许)
|
||||
*/
|
||||
private Integer download;
|
||||
|
||||
/**
|
||||
* 是否允许下载融合(0授权 1不允许)
|
||||
*/
|
||||
private Integer fuse;
|
||||
|
||||
/**
|
||||
* 生成的图片是否允许出售(0授权 1不允许)
|
||||
*/
|
||||
private Integer sell;
|
||||
|
||||
/**
|
||||
* 是否允许融合后(0授权 1不允许)
|
||||
*/
|
||||
private Integer fuseSell;
|
||||
|
||||
/**
|
||||
* 是否独家设置(0授权 1不允许)
|
||||
*/
|
||||
private Integer exclusive;
|
||||
|
||||
/**
|
||||
* 文件名字
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.mcwl.resource.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 分页+条件
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/13
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class PageVo {
|
||||
|
||||
private Integer pageNumber;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer order;
|
||||
}
|
|
@ -3,7 +3,9 @@ package com.mcwl.resource.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface ModelImageMapper extends BaseMapper<ModelImage> {
|
||||
Long sumLikeNumber(@Param("userId") Long userId);
|
||||
}
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
|
@ -20,7 +15,7 @@ import java.util.Date;
|
|||
* @Date:2024/12/30 18:23
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductMapper extends BaseMapper<ModelProduct> {
|
||||
public interface ModelMapper extends BaseMapper<ModelProduct> {
|
||||
|
||||
|
||||
|
||||
|
@ -29,4 +24,7 @@ public interface MallProductMapper extends BaseMapper<ModelProduct> {
|
|||
|
||||
void updateModel(ModelProduct modelProduct);
|
||||
|
||||
Long sumLikeNumber(@Param("userId") Long userId);
|
||||
|
||||
Long sumRunNumber(Long userId);
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.mcwl.resource.service;
|
|||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
|
||||
/**
|
||||
* 工作流 业务层
|
||||
|
@ -15,4 +16,9 @@ public interface WorkFlowService {
|
|||
|
||||
void updateWorkFlow(RequestWorkFlow requestWorkFlow);
|
||||
|
||||
void deleteWorkFlow(Long id);
|
||||
|
||||
AjaxResult selectWorkFlow(PageVo pageVo);
|
||||
|
||||
AjaxResult selectWorkFlowById(Long id);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 工作流版本 业务层
|
||||
* @author DaiZibo
|
||||
|
@ -8,4 +10,5 @@ package com.mcwl.resource.service;
|
|||
*/
|
||||
|
||||
public interface WorkFlowVersionService {
|
||||
AjaxResult selectVersionByWorkId(Long workId);
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
|||
BeanUtil.copyProperties(modelImageRes, modelImage);
|
||||
modelImage.setUserId(SecurityUtils.getUserId());
|
||||
modelImage.setCreateBy(SecurityUtils.getUsername());
|
||||
modelImage.setCreateTime(new Date());
|
||||
modelImage.setUpdateBy(SecurityUtils.getUsername());
|
||||
modelImage.setUpdateTime(new Date());
|
||||
modelImage.setStatus(3);
|
||||
|
|
|
@ -4,14 +4,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.mcwl.common.exception.ServiceException;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.*;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.mapper.ModelMapper;
|
||||
import com.mcwl.resource.mapper.ModelLikeMapper;
|
||||
import com.mcwl.resource.service.ModelLikeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import springfox.documentation.swagger2.mappers.ModelMapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
@ -29,12 +27,12 @@ public class ModelLikeServiceImpl extends ServiceImpl<ModelLikeMapper, ModelLike
|
|||
|
||||
|
||||
@Autowired
|
||||
private MallProductMapper mallProductMapper;
|
||||
private ModelMapper modelMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void like(Long modelId) {
|
||||
ModelProduct model = mallProductMapper.selectById(modelId);
|
||||
ModelProduct model = modelMapper.selectById(modelId);
|
||||
if (Objects.isNull(model)) {
|
||||
throw new ServiceException("该模型不存在或已下架");
|
||||
}
|
||||
|
@ -51,7 +49,7 @@ public class ModelLikeServiceImpl extends ServiceImpl<ModelLikeMapper, ModelLike
|
|||
// 更新点赞记录
|
||||
baseMapper.updateById(modelLike);
|
||||
// 更新图片点赞数
|
||||
mallProductMapper.updateById(model);
|
||||
modelMapper.updateById(model);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,6 +64,6 @@ public class ModelLikeServiceImpl extends ServiceImpl<ModelLikeMapper, ModelLike
|
|||
|
||||
// 更新图片点赞数
|
||||
model.setNumbers(model.getNumbers() + 1);
|
||||
mallProductMapper.updateById(model);
|
||||
modelMapper.updateById(model);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.mcwl.resource.service.impl;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -12,24 +11,19 @@ import com.mcwl.common.core.domain.AjaxResult;
|
|||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.core.redis.RedisCache;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.mapper.ModelMapper;
|
||||
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -49,14 +43,14 @@ import java.util.Objects;
|
|||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements ModelService {
|
||||
public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> implements ModelService {
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ModelVersionMapper modelVersionMapper;
|
||||
@Autowired
|
||||
private MallProductMapper postMapper;
|
||||
private ModelMapper postMapper;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
|
@ -1,12 +1,18 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.SysUserAttention;
|
||||
import com.mcwl.resource.domain.SysUserInfo;
|
||||
import com.mcwl.resource.mapper.MallProductLikeMapper;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.mapper.ModelMapper;
|
||||
import com.mcwl.resource.mapper.SysUserAttentionMapper;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.resource.service.SysUserAttentionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -26,7 +32,7 @@ public class SysUserAttentionServiceImpl implements SysUserAttentionService {
|
|||
|
||||
|
||||
@Autowired
|
||||
private MallProductMapper mallProductMapper;
|
||||
private ModelMapper modelMapper;
|
||||
|
||||
@Autowired
|
||||
private MallProductLikeMapper mallProductLikeMapper;
|
||||
|
@ -34,14 +40,17 @@ public class SysUserAttentionServiceImpl implements SysUserAttentionService {
|
|||
@Autowired
|
||||
private SysUserAttentionMapper sysUserAttentionMapper;
|
||||
|
||||
@Autowired
|
||||
private ModelImageMapper modelImageMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult addAttention(Long userId) {
|
||||
|
||||
//查看是否已关注
|
||||
Boolean aBoolean = selectAttention(userId);
|
||||
if (aBoolean == true){
|
||||
if (aBoolean == true) {
|
||||
//取关
|
||||
sysUserAttentionMapper.deleteByUserId(SecurityUtils.getUserId(),userId);
|
||||
sysUserAttentionMapper.deleteByUserId(SecurityUtils.getUserId(), userId);
|
||||
return AjaxResult.success(false);
|
||||
}
|
||||
|
||||
|
@ -58,9 +67,9 @@ public class SysUserAttentionServiceImpl implements SysUserAttentionService {
|
|||
@Override
|
||||
public Boolean selectAttention(Long userId) {
|
||||
|
||||
SysUserAttention sysUserAttention = sysUserAttentionMapper.selectAttention(SecurityUtils.getUserId(),userId);
|
||||
SysUserAttention sysUserAttention = sysUserAttentionMapper.selectAttention(SecurityUtils.getUserId(), userId);
|
||||
|
||||
if (sysUserAttention == null){
|
||||
if (sysUserAttention == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -71,9 +80,30 @@ public class SysUserAttentionServiceImpl implements SysUserAttentionService {
|
|||
public SysUserInfo selectUserInfo() {
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
return SysUserInfo.builder().bean(sysUserAttentionMapper.selectBean(userId))
|
||||
// .download(mallProductMapper.sumNumber(userId))
|
||||
.likeCount(mallProductLikeMapper.countLike(userId))
|
||||
.attention(sysUserAttentionMapper.selectAttentionCount(userId)).build();
|
||||
// 粉丝数
|
||||
Long userBeanNum = sysUserAttentionMapper.selectBean(userId);
|
||||
|
||||
// 关注数
|
||||
Long userAttentionNum = sysUserAttentionMapper.selectAttentionCount(userId);
|
||||
|
||||
// 模型下载数
|
||||
Long modelDownloadNum = modelMapper.sumNumber(userId);
|
||||
|
||||
// 模型运行次数
|
||||
Long modelRunNum = modelMapper.sumRunNumber(userId);
|
||||
|
||||
// 模型点赞次数
|
||||
Long modelLikeNum = modelMapper.sumLikeNumber(userId);
|
||||
|
||||
// 图片点赞次数
|
||||
Long imageLikeNum = modelImageMapper.sumLikeNumber(userId);
|
||||
|
||||
return SysUserInfo.builder().bean(userBeanNum)
|
||||
.attention(userAttentionNum)
|
||||
.modelDownloadNum(modelDownloadNum)
|
||||
.modelRunNum(modelRunNum)
|
||||
.modelLikeNum(modelLikeNum)
|
||||
.imageLikeNum(imageLikeNum)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,27 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mcwl.common.constant.DictConstants;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.mapper.WorkFlowMapper;
|
||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.ToActivityService;
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import com.mcwl.web.controller.init.DictInit;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 工作流 业务实现层
|
||||
* @author DaiZibo
|
||||
|
@ -27,9 +39,19 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
|||
@Autowired
|
||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||
|
||||
@Autowired
|
||||
private ToActivityService toActivityService;
|
||||
|
||||
@Override
|
||||
public AjaxResult addWorkFlow(RequestWorkFlow requestWorkFlow) {
|
||||
|
||||
//获取封面图
|
||||
String filePath = requestWorkFlow.getWorkFlowVersionList().get(0).getFilePath();
|
||||
|
||||
String[] split = filePath.split(",");
|
||||
|
||||
requestWorkFlow.getWorkFlow().setCoverPath(split[0]);
|
||||
requestWorkFlow.getWorkFlow().setCreateTime(new Date());
|
||||
//添加模型表数据
|
||||
flowMapper.insert(requestWorkFlow.getWorkFlow());
|
||||
|
||||
|
@ -48,7 +70,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
|||
if (requestWorkFlow.getWorkFlow().getId() != null){
|
||||
|
||||
requestWorkFlow.getWorkFlow().setAuditStatus(3);
|
||||
flowMapper.updateWorkFlow(requestWorkFlow.getWorkFlow());
|
||||
// flowMapper.updateWorkFlow(requestWorkFlow.getWorkFlow());
|
||||
flowMapper.updateById(requestWorkFlow.getWorkFlow());
|
||||
}
|
||||
|
||||
//修改工作流版本的信息
|
||||
|
@ -57,8 +80,92 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
|||
//批量修改
|
||||
for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
|
||||
workFlowVersion.setAuditStatus(3);
|
||||
workFlowVersionMapper.updateWorkFlowVersion(workFlowVersion);
|
||||
// workFlowVersionMapper.updateWorkFlowVersion(workFlowVersion);
|
||||
workFlowVersionMapper.updateById(workFlowVersion);
|
||||
}
|
||||
|
||||
WorkFlow workFlow = WorkFlow.builder().id(requestWorkFlow.getWorkFlowVersionList().get(0).getWorkFlowId())
|
||||
.createTime(new Date()).build();
|
||||
//更新时间
|
||||
flowMapper.updateById(workFlow);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWorkFlow(Long id) {
|
||||
|
||||
WorkFlow workFlow = WorkFlow.builder().id(id)
|
||||
.delFlag(2).build();
|
||||
|
||||
flowMapper.updateById(workFlow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectWorkFlow(PageVo pageVo) {
|
||||
|
||||
Page<WorkFlow> page = new Page<>(pageVo.getPageNumber(), pageVo.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<WorkFlow> lambdaQueryWrapper = Wrappers.<WorkFlow>lambdaQuery()
|
||||
.like(StringUtils.isNotBlank(pageVo.getName()), WorkFlow::getWorkflowName, pageVo.getName())
|
||||
.eq(WorkFlow::getDelFlag,0);
|
||||
|
||||
if (pageVo.getOrder() == 1){
|
||||
lambdaQueryWrapper.orderByDesc(WorkFlow::getUseNumber);
|
||||
}else {
|
||||
lambdaQueryWrapper.orderByDesc(WorkFlow::getId);
|
||||
}
|
||||
|
||||
lambdaQueryWrapper.select(WorkFlow::getId, WorkFlow::getWorkflowName,WorkFlow::getCoverPath);
|
||||
|
||||
return AjaxResult.success(flowMapper.selectPage(page,lambdaQueryWrapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectWorkFlowById(Long id) {
|
||||
|
||||
//查询详情
|
||||
WorkFlow workFlow = flowMapper.selectById(id);
|
||||
|
||||
//翻译属性 垂类
|
||||
if (StringUtils.isNotEmpty(workFlow.getCategory())){
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY,workFlow.getCategory()));
|
||||
}
|
||||
|
||||
//主体
|
||||
if (StringUtils.isNotEmpty(workFlow.getTheme())){
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getTheme().split(",");
|
||||
for (String s : split) {
|
||||
if (s != ""){
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_THEME,workFlow.getCategory()));
|
||||
}
|
||||
}
|
||||
workFlow.setThemeList(strings);
|
||||
}
|
||||
|
||||
//风格
|
||||
if (StringUtils.isNotEmpty(workFlow.getStyle())){
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getTheme().split(",");
|
||||
for (String s : split) {
|
||||
if (s != ""){
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE,workFlow.getStyle()));
|
||||
}
|
||||
}
|
||||
workFlow.setStyleList(strings);
|
||||
}
|
||||
|
||||
//功能
|
||||
if (StringUtils.isNotEmpty(workFlow.getFunctions())){
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS,workFlow.getFunctions()));
|
||||
}
|
||||
|
||||
//活动
|
||||
if (StringUtils.isNotEmpty(workFlow.getActivityParticipation())){
|
||||
workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName());
|
||||
}
|
||||
|
||||
return AjaxResult.success(workFlow);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.WorkFlowVersionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流版本 业务实现层
|
||||
* @author DaiZibo
|
||||
|
@ -13,4 +20,19 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class WorkFlowVersionServiceImpl implements WorkFlowVersionService {
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult selectVersionByWorkId(Long workId) {
|
||||
|
||||
LambdaQueryWrapper<WorkFlowVersion> workFlowVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
workFlowVersionLambdaQueryWrapper.eq(WorkFlowVersion::getDelFlag,0);
|
||||
workFlowVersionLambdaQueryWrapper.eq(WorkFlowVersion::getWorkFlowId,workId);
|
||||
|
||||
List<WorkFlowVersion> workFlowVersions = workFlowVersionMapper.selectList(workFlowVersionLambdaQueryWrapper);
|
||||
|
||||
return AjaxResult.success(workFlowVersions);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
||||
|
||||
<select id="sumLikeNumber" resultType="java.lang.Long">
|
||||
SELECT sum(like_num)sum FROM model_image where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
|
||||
<mapper namespace="com.mcwl.resource.mapper.ModelMapper">
|
||||
<update id="updateModel">
|
||||
update model
|
||||
<set>
|
||||
|
@ -72,7 +72,14 @@
|
|||
|
||||
|
||||
<select id="sumNumber" resultType="java.lang.Long">
|
||||
SELECT sum(number)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
SELECT sum(numbers)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
|
||||
<select id="sumLikeNumber" resultType="java.lang.Long">
|
||||
SELECT sum(like_num)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
<select id="sumRunNumber" resultType="java.lang.Long">
|
||||
SELECT sum(reals)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -3,6 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.SysUserAttentionMapper">
|
||||
|
||||
<delete id="deleteByUserId">
|
||||
delete from sys_user_attention where user_id = #{userId} and to_user_id = #{toUserId}
|
||||
</delete>
|
||||
|
|
|
@ -7,13 +7,11 @@
|
|||
|
||||
<insert id="addWorkFlowVersion">
|
||||
INSERT INTO work_flow_version (version_name,version_description,file_path,image_paths,hide_gen_info,del_flag,
|
||||
audit_status,work_flow_id,basic_model,jurisdiction,itself_use,subordinate_use,
|
||||
download,fuse,sell,fuse_sell,exclusive,file_name)
|
||||
audit_status,work_flow_id,file_name)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
||||
0,#{item.auditStatus},#{workFlow.id},#{item.basicModel},#{item.jurisdiction},#{item.itselfUse},
|
||||
#{item.subordinateUse},#{item.download},#{item.fuse},#{item.sell},#{item.fuseSell},#{item.exclusive},#{item.fileName})
|
||||
0,#{item.auditStatus},#{workFlow.id},#{item.fileName})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateWorkFlowVersion">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.system.mapper.SysDictDataMapper">
|
||||
|
||||
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
|
@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="partId" column="part_id" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark, part_id
|
||||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
|
@ -40,37 +41,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
select dict_label from sys_dict_data
|
||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteDictDataById" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code = #{dictCode}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code in
|
||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
||||
#{dictCode}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
|
@ -88,11 +89,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</set>
|
||||
where dict_code = #{dictCode}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateDictDataType" parameterType="String">
|
||||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
|
@ -120,5 +121,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue