Merge branch 'feature/admin' into preview
# Conflicts: # mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.javafeature/my-invitation
commit
3e7a30d786
|
@ -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 "";
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,7 +24,6 @@ public class SysUserAttentionController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserAttentionServiceImpl sysUserAttentionService;
|
private SysUserAttentionServiceImpl sysUserAttentionService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加/取消关注
|
* 添加/取消关注
|
||||||
* @param userId
|
* @param userId
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.web.controller.resource;
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -66,12 +67,22 @@ public class WorkFlowController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加工作流
|
||||||
|
* @param requestWorkFlow
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/addWorkFlow")
|
@PostMapping("/addWorkFlow")
|
||||||
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||||
|
|
||||||
return workFlowService.addWorkFlow(requestWorkFlow);
|
return workFlowService.addWorkFlow(requestWorkFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工作流
|
||||||
|
* @param requestWorkFlow
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/updateWorkFlow")
|
@PostMapping("/updateWorkFlow")
|
||||||
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||||
|
|
||||||
|
@ -80,6 +91,39 @@ public class WorkFlowController extends BaseController {
|
||||||
return AjaxResult.success("修改成功");
|
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;
|
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;
|
||||||
import com.mcwl.common.annotation.Excel.ColumnType;
|
import com.mcwl.common.annotation.Excel.ColumnType;
|
||||||
import com.mcwl.common.constant.UserConstants;
|
import com.mcwl.common.constant.UserConstants;
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
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
|
* 字典数据表 sys_dict_data
|
||||||
|
@ -52,6 +53,16 @@ public class SysDictData extends BaseEntity
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private Integer partId;
|
||||||
|
|
||||||
|
public Integer getPartId() {
|
||||||
|
return partId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartId(Integer partId) {
|
||||||
|
this.partId = partId;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getDictCode()
|
public Long getDictCode()
|
||||||
{
|
{
|
||||||
return dictCode;
|
return dictCode;
|
||||||
|
|
|
@ -38,5 +38,11 @@
|
||||||
<version>${mybatis-plus.version}</version>
|
<version>${mybatis-plus.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mcwl</groupId>
|
||||||
|
<artifactId>mcwl-admin</artifactId>
|
||||||
|
<version>3.8.8</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
package com.mcwl.resource.domain;
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
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
|
* @Version:1.0
|
||||||
* @Date:2025/1/8 19:38
|
* @Date:2025/1/8 19:38
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
|
@ -54,7 +62,7 @@ public class WorkFlow {
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
private String del_flag;
|
private Integer delFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
* 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
||||||
|
@ -66,6 +74,11 @@ public class WorkFlow {
|
||||||
*/
|
*/
|
||||||
private String auditText;
|
private String auditText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否原创
|
||||||
|
*/
|
||||||
|
private Integer original;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 原文作者名字
|
* 原文作者名字
|
||||||
*/
|
*/
|
||||||
|
@ -81,4 +94,54 @@ public class WorkFlow {
|
||||||
*/
|
*/
|
||||||
private Long downloadNumber = 0L;
|
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 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;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.mcwl.resource.service;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
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 updateWorkFlow(RequestWorkFlow requestWorkFlow);
|
||||||
|
|
||||||
|
void deleteWorkFlow(Long id);
|
||||||
|
|
||||||
|
AjaxResult selectWorkFlow(PageVo pageVo);
|
||||||
|
|
||||||
|
AjaxResult selectWorkFlowById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.mcwl.resource.service;
|
package com.mcwl.resource.service;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流版本 业务层
|
* 工作流版本 业务层
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -8,4 +10,5 @@ package com.mcwl.resource.service;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface WorkFlowVersionService {
|
public interface WorkFlowVersionService {
|
||||||
|
AjaxResult selectVersionByWorkId(Long workId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,27 @@
|
||||||
package com.mcwl.resource.service.impl;
|
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.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.WorkFlowVersion;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
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.WorkFlowMapper;
|
||||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||||
|
import com.mcwl.resource.service.ToActivityService;
|
||||||
import com.mcwl.resource.service.WorkFlowService;
|
import com.mcwl.resource.service.WorkFlowService;
|
||||||
|
import com.mcwl.web.controller.init.DictInit;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流 业务实现层
|
* 工作流 业务实现层
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -27,9 +39,19 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ToActivityService toActivityService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult addWorkFlow(RequestWorkFlow requestWorkFlow) {
|
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());
|
flowMapper.insert(requestWorkFlow.getWorkFlow());
|
||||||
|
|
||||||
|
@ -48,7 +70,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
||||||
if (requestWorkFlow.getWorkFlow().getId() != null){
|
if (requestWorkFlow.getWorkFlow().getId() != null){
|
||||||
|
|
||||||
requestWorkFlow.getWorkFlow().setAuditStatus(3);
|
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()) {
|
for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
|
||||||
workFlowVersion.setAuditStatus(3);
|
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;
|
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 com.mcwl.resource.service.WorkFlowVersionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流版本 业务实现层
|
* 工作流版本 业务实现层
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -13,4 +20,19 @@ import org.springframework.stereotype.Service;
|
||||||
@Service
|
@Service
|
||||||
public class WorkFlowVersionServiceImpl implements WorkFlowVersionService {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.resource.mapper.SysUserAttentionMapper">
|
<mapper namespace="com.mcwl.resource.mapper.SysUserAttentionMapper">
|
||||||
|
|
||||||
<delete id="deleteByUserId">
|
<delete id="deleteByUserId">
|
||||||
delete from sys_user_attention where user_id = #{userId} and to_user_id = #{toUserId}
|
delete from sys_user_attention where user_id = #{userId} and to_user_id = #{toUserId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
|
@ -7,13 +7,11 @@
|
||||||
|
|
||||||
<insert id="addWorkFlowVersion">
|
<insert id="addWorkFlowVersion">
|
||||||
INSERT INTO work_flow_version (version_name,version_description,file_path,image_paths,hide_gen_info,del_flag,
|
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,
|
audit_status,work_flow_id,file_name)
|
||||||
download,fuse,sell,fuse_sell,exclusive,file_name)
|
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
||||||
0,#{item.auditStatus},#{workFlow.id},#{item.basicModel},#{item.jurisdiction},#{item.itselfUse},
|
0,#{item.auditStatus},#{workFlow.id},#{item.fileName})
|
||||||
#{item.subordinateUse},#{item.download},#{item.fuse},#{item.sell},#{item.fuseSell},#{item.exclusive},#{item.fileName})
|
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateWorkFlowVersion">
|
<update id="updateWorkFlowVersion">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.system.mapper.SysDictDataMapper">
|
<mapper namespace="com.mcwl.system.mapper.SysDictDataMapper">
|
||||||
|
|
||||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||||
<id property="dictCode" column="dict_code" />
|
<id property="dictCode" column="dict_code" />
|
||||||
<result property="dictSort" column="dict_sort" />
|
<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="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="partId" column="part_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDictDataVo">
|
<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
|
from sys_dict_data
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -40,37 +41,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
order by dict_sort asc
|
order by dict_sort asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">
|
<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">
|
||||||
<include refid="selectDictDataVo"/>
|
<include refid="selectDictDataVo"/>
|
||||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictLabel" resultType="String">
|
<select id="selectDictLabel" resultType="String">
|
||||||
select dict_label from sys_dict_data
|
select dict_label from sys_dict_data
|
||||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||||
<include refid="selectDictDataVo"/>
|
<include refid="selectDictDataVo"/>
|
||||||
where dict_code = #{dictCode}
|
where dict_code = #{dictCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countDictDataByType" resultType="Integer">
|
<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>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteDictDataById" parameterType="Long">
|
<delete id="deleteDictDataById" parameterType="Long">
|
||||||
delete from sys_dict_data where dict_code = #{dictCode}
|
delete from sys_dict_data where dict_code = #{dictCode}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
<delete id="deleteDictDataByIds" parameterType="Long">
|
||||||
delete from sys_dict_data where dict_code in
|
delete from sys_dict_data where dict_code in
|
||||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
||||||
#{dictCode}
|
#{dictCode}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateDictData" parameterType="SysDictData">
|
<update id="updateDictData" parameterType="SysDictData">
|
||||||
update sys_dict_data
|
update sys_dict_data
|
||||||
<set>
|
<set>
|
||||||
|
@ -88,11 +89,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</set>
|
</set>
|
||||||
where dict_code = #{dictCode}
|
where dict_code = #{dictCode}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateDictDataType" parameterType="String">
|
<update id="updateDictDataType" parameterType="String">
|
||||||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertDictData" parameterType="SysDictData">
|
<insert id="insertDictData" parameterType="SysDictData">
|
||||||
insert into sys_dict_data(
|
insert into sys_dict_data(
|
||||||
<if test="dictSort != null">dict_sort,</if>
|
<if test="dictSort != null">dict_sort,</if>
|
||||||
|
@ -120,5 +121,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue