新增工作流业务

feature/comment
Diyu0904 2025-01-09 14:46:01 +08:00
parent a938a05b72
commit a3241b83ff
17 changed files with 206 additions and 550 deletions

View File

@ -1,150 +0,0 @@
package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.service.MallProductService;
import com.mcwl.web.controller.common.OssUtil;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.web.controller.resource
* @FilenameMallProductController
* @Description
* @Date2024/12/31 10:48
*/
@RestController
@RequestMapping("/MallProduct")
public class MallProductController extends BaseController {
private final MallProductService mallProductRuleInfoService;
public MallProductController(MallProductService mallProductService) {
this.mallProductRuleInfoService = mallProductService;
}
/***
*
*
* @param file
* @return
*/
@PostMapping("/file")
public AjaxResult Malifile(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/***
*
* zip
* @param file
* @return
*/
@PostMapping("/zipUrlFile")
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/***
*
* zip
* @param file
* @return
*/
@PostMapping("/zipUrl")
public AjaxResult zipUrl(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/**
*
*/
@PostMapping("/list")
public TableDataInfo list(@RequestBody ModelProduct mallProduct)
{
startPage();
List<ModelProduct> list = mallProductRuleInfoService.selectMallProductList(mallProduct);
return getDataTable(list);
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long Id)
{
return success(mallProductRuleInfoService.getById(Id));
}
/**
*
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody ModelProduct mallProduct)
{
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
}
/**
*
*/
@PutMapping("/upda")
public AjaxResult edit(@RequestBody ModelProduct mallProduct)
{
mallProduct.setUpdateBy(getUsername());
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
}
/**
*
*/
@PostMapping
public AjaxResult remove(@RequestBody IdsParam ids)
{
mallProductRuleInfoService.deleteMallProductByIds(ids);
return success();
}
/**
*
* @return
*/
@PostMapping("/selectByUserId")
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
Page<ModelProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
return AjaxResult.success(mallProductList);
}
}

View File

@ -0,0 +1,73 @@
package com.mcwl.web.controller.resource;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.web.controller.common.OssUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.web.controller.resource
* @FilenameMallProductController
* @Description
* @Date2024/12/31 10:48
*/
@RestController
@RequestMapping("/WorkFlow")
public class WorkFlowController extends BaseController {
/***
*
*
* @param file
* @return
*/
@PostMapping("/file")
public AjaxResult Malifile(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/***
*
* zip
* @param file
* @return
*/
@PostMapping("/zipUrlFile")
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/***
*
* zip
* @param file
* @return
*/
@PostMapping("/zipUrl")
public AjaxResult zipUrl(@RequestParam MultipartFile file){
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
// @PostMapping("/add")
// public AjaxResult
}

View File

@ -1,53 +0,0 @@
//package com.mcwl.comment.domain;
//
//import com.baomidou.mybatisplus.annotation.TableId;
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.mcwl.common.core.domain.BaseEntity;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
///**
// * @AuthorChenYan
// * @ProjectMcWl
// * @Packagecom.mcwl.comment.domain
// * @FilenameComment
// * @Description 评论表
// * @Date2025/1/4 18:47
// */
//@AllArgsConstructor
//@NoArgsConstructor
//@Data
//@TableName("mall_product_comment")
//public class Comment extends BaseEntity {
//
// /**
// * ID
// */
// @TableId
// private Long id;
// /**
// * 父评论ID
// */
// private String parentId;
// /**
// * 商品ID
// */
// private String productId;
// /**
// * 用户ID
// */
// private String userId;
// /**
// * 评论内容
// */
// private String content;
// /**
// * 评分
// */
// private String rating;
// /**
// * 删除标志0代表存在 2代表删除
// */
// private String delFlag;
//}

View File

@ -1,56 +0,0 @@
//package com.mcwl.comment.domain;
//
//
//import lombok.Data;
//
//import java.util.List;
//
///**
// * 商品评论查询条件实体
// */
//@Data
//public class ProductCommentConditionEntity extends RequestConditionEntity {
//
// /**
// * ID集合
// */
// private List<Long> idList;
//
// /**
// * ID
// */
// private Long id;
// /**
// * 父评论ID
// */
// private Long parentId;
// /**
// * 商品ID
// */
// private Long productId;
//
// /**
// * 商品ID集合
// */
// private List<Long> productIdList;
// /**
// * 用户ID
// */
// private Long userId;
// /**
// * 评论内容
// */
// private String content;
// /**
// * 评分
// */
// private Integer rating;
// /**
// * 删除标志0代表存在 2代表删除
// */
// private String delFlag;
//// /**
//// * 评论类型
//// */
//// private Integer type;
//}

View File

@ -1,50 +0,0 @@
//package com.mcwl.comment.domain;
//
//import com.mcwl.common.core.domain.BaseEntity;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
///**
// * @AuthorChenYan
// * @ProjectMcWl
// * @Packagecom.mcwl.comment.domain
// * @FilenameProductCommentEntity
// * @Description 评论实体
// * @Date2025/1/6 13:21
// */
//@AllArgsConstructor
//@NoArgsConstructor
//@Data
//public class ProductCommentEntity extends BaseEntity {
//
// /**
// * 父评论ID
// */
// private Long parentId;
//
// /**
// * 商品ID
// */
// private Long productId;
//
// /**
// * 用户ID
// */
// private Long userId;
//
// /**
// * 评论内容
// */
// private String content;
//
// /**
// * 评分
// */
// private Integer rating;
//
//// /**
//// * 评论类型
//// */
//// private Integer type;
//}

View File

@ -1,41 +0,0 @@
//package com.mcwl.comment.domain;
//
//import com.mcwl.common.utils.RequestPageEntity;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//
//import java.util.List;
//
///**
// * 请求条件实体
// */
//@Data
//public class RequestConditionEntity extends RequestPageEntity {
//
//
// /**
// * 创建日期范围
// */
// @ApiModelProperty("创建日期范围")
// private List<String> betweenTime;
//
// /**
// * 创建开始时间
// */
// private String createBeginTime;
//
// /**
// * 创建结束时间
// */
// private String createEndTime;
//
// /**
// * 自定义excel表头列表
// */
// private List<String> customizeColumnNameList;
//
// /**
// * 查询条件
// */
// private String blurry;
//}

View File

@ -1,72 +0,0 @@
//package com.mcwl.comment.domain;
//
//import cn.hutool.core.collection.CollectionUtil;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
//import java.io.Serializable;
//import java.util.List;
//import java.util.Objects;
//
///**
// * 分页请求实体
// */
//@AllArgsConstructor
//@NoArgsConstructor
//@Data
//public class RequestPageEntity implements Serializable {
//
// private static final int DEFAULT_PAGE_SIZE = 10;
//
// /**
// * 页码,默认从一页开始
// */
// private Integer pageNo = 1;
//
// /**
// * 每页大小默认一页查询10条数据
// */
// private Integer pageSize = DEFAULT_PAGE_SIZE;
//
// /**
// * 排序字段
// */
// private List<String> sortField;
//
//
// /**
// * 获取分页开始位置
// *
// * @return 分页开始位置
// */
// public Integer getPageBegin() {
// if (Objects.isNull(this.pageNo) || this.pageNo <= 0) {
// this.pageNo = 1;
// }
//
// if (Objects.isNull(this.pageSize)) {
// this.pageSize = DEFAULT_PAGE_SIZE;
// }
//
// return (this.pageNo - 1) * this.pageSize;
// }
//
// /**
// * 获取用户自定义排序集合
// *
// * @return 排序集合实体
// */
// public String getSortString() {
// List<String> sortField = this.getSortField();
// if (CollectionUtil.isEmpty(sortField)) {
// return null;
// }
// StringBuilder sortBuilder = new StringBuilder();
// for (String field : sortField) {
// String[] values = field.split(",");
// sortBuilder.append(String.format("%s %s", values[0], values[1])).append(",");
// }
// return sortBuilder.deleteCharAt(sortBuilder.length() - 1).toString();
// }
//}

View File

@ -1,31 +0,0 @@
//package com.mcwl.comment.mapper;
//
//
//import com.mcwl.comment.domain.ProductCommentConditionEntity;
//import com.mcwl.comment.domain.ProductCommentEntity;
//import com.mcwl.common.web.BaseMapper;
//import com.mcwl.resource.domain.MallProduct;
//import org.apache.ibatis.annotations.Param;
//
//import java.util.List;
//
///**
// * @AuthorChenYan
// * @ProjectMcWl
// * @Packagecom.mcwl.comment.mapper
// * @FilenameCommentMapper
// * @Description TODO
// * @Date2025/1/4 19:04
// */
//public interface CommentMapper extends BaseMapper<ProductCommentEntity, ProductCommentConditionEntity> {
//
// MallProduct findById(@Param("id") Long id);
//
// int insert(ProductCommentEntity productCommentEntity);
//
// int upda(ProductCommentEntity productCommentEntity);
//
// List<ProductCommentEntity> findByIds(List<Long> ids);
//
// int deleteByIds(List<Long> ids, ProductCommentEntity productCommentEntity);
//}

View File

@ -1,88 +0,0 @@
//package com.mcwl.comment.service.impl;
//
//
//import com.mcwl.comment.domain.ProductCommentConditionEntity;
//import com.mcwl.comment.domain.ProductCommentEntity;
//import com.mcwl.comment.mapper.CommentMapper;
//import com.mcwl.common.core.domain.AjaxResult;
//import com.mcwl.common.utils.AssertUtil;
//import com.mcwl.common.utils.FillUserUtil;
//import com.mcwl.common.utils.ResponsePageEntity;
//import com.mcwl.common.utils.SecurityUtils;
//import com.mcwl.common.utils.bean.BaseService;
//
//import com.mcwl.common.web.BaseMapper;
//import com.mcwl.resource.domain.MallProduct;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import java.util.List;
//import java.util.Objects;
//
//import static com.mcwl.common.utils.SecurityUtils.getUsername;
//
///**
// * @AuthorChenYan
// * @ProjectMcWl
// * @Packagecom.mcwl.comment.service.impl
// * @FilenameCommentServiceImpl
// * @Description TODO
// * @Date2025/1/4 19:04
// */
//@Service
//public class CommentServiceImpl extends BaseService<ProductCommentEntity, ProductCommentConditionEntity> {
//
// @Autowired
// private CommentMapper commentMapper;
//
//
// public MallProduct findById(Long id) {
// return commentMapper.findById(id);
// }
//
//
// public int insert(ProductCommentEntity productCommentEntity) {
// // 获取当前用户
// Long userId = SecurityUtils.getUserId();
// productCommentEntity.setUserId(userId);
// productCommentEntity.setCreateBy(getUsername());
// checkParam(productCommentEntity);
// return commentMapper.insert(productCommentEntity);
// }
//
//
// public int update(ProductCommentEntity productCommentEntity) {
// // 获取当前用户
// Long userId = SecurityUtils.getUserId();
// productCommentEntity.setUserId(userId);
// productCommentEntity.setUpdateBy(getUsername());
// checkParam(productCommentEntity);
// return commentMapper.upda(productCommentEntity);
// }
//
//
// public int deleteByIds(List<Long> ids) {
// List<ProductCommentEntity> entities = commentMapper.findByIds(ids);
// AssertUtil.notEmpty(entities, "商品评论已被删除");
//
// ProductCommentEntity entity = new ProductCommentEntity();
// FillUserUtil.fillUpdateUserInfo(entity);
// return commentMapper.deleteByIds(ids, entity);
// }
// private void checkParam(ProductCommentEntity productCommentEntity) {
// if (Objects.nonNull(productCommentEntity.getParentId()) && productCommentEntity.getParentId() > 0) {
// MallProduct productEntity = commentMapper.findById(productCommentEntity.getParentId());
// AssertUtil.notNull(productEntity, "该父评论在系统中不存在");
// }
//
// MallProduct userEntity = commentMapper.findById(productCommentEntity.getUserId());
// AssertUtil.notNull(userEntity, "该用户在系统中不存在");
//
// MallProduct productEntity = commentMapper.findById(productCommentEntity.getProductId());
// AssertUtil.notNull(productEntity, "该商品在系统中不存在");
// }
//
// @Override
// protected BaseMapper getBaseMapper() {
// return commentMapper;
// }
//}

View File

@ -105,6 +105,32 @@ public class SysUser extends BaseEntity
*/ */
private String idCard; private String idCard;
/**
* id
*/
private Long inviterUserId;
/**
*
*/
private Double freePoints;
public Long getInviterUserId() {
return inviterUserId;
}
public void setInviterUserId(Long inviterUserId) {
this.inviterUserId = inviterUserId;
}
public Double getFreePoints() {
return freePoints;
}
public void setFreePoints(Double freePoints) {
this.freePoints = freePoints;
}
public SysUser() public SysUser()
{ {
@ -361,6 +387,8 @@ public class SysUser extends BaseEntity
", brief='" + brief + '\'' + ", brief='" + brief + '\'' +
", name='" + name + '\'' + ", name='" + name + '\'' +
", idCard='" + idCard + '\'' + ", idCard='" + idCard + '\'' +
", inviterUserId=" + inviterUserId +
", freePoints=" + freePoints +
'}'; '}';
} }
} }

View File

@ -5,17 +5,30 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.core.redis.RedisCache; import com.mcwl.common.core.redis.RedisCache;
import com.mcwl.common.domain.IdsParam; import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.DateUtils;
import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.StringUtils;
import com.mcwl.memberCenter.domain.RechargeRecord;
import com.mcwl.memberCenter.service.MemberService;
import com.mcwl.memberCenter.service.RechargeRecordService;
import com.mcwl.myInvitation.domain.Commission;
import com.mcwl.myInvitation.domain.Consume;
import com.mcwl.myInvitation.service.CommissionService;
import com.mcwl.myInvitation.service.ConsumeService;
import com.mcwl.pay.domain.OrderTrade; import com.mcwl.pay.domain.OrderTrade;
import com.mcwl.pay.domain.PaymentResult; import com.mcwl.pay.domain.enums.OrderTypeEnum;
import com.mcwl.pay.domain.enums.PaymentStatus;
import com.mcwl.pay.mapper.OrderTradeMapper; import com.mcwl.pay.mapper.OrderTradeMapper;
import com.mcwl.pay.service.OrderTradeService; import com.mcwl.pay.service.OrderTradeService;
import com.mcwl.system.service.ISysUserService;
import com.mcwl.system.service.impl.SysUserServiceImpl;
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 org.springframework.transaction.annotation.Transactional;
import java.util.Collections; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* @AuthorChenYan * @AuthorChenYan
@ -36,12 +49,6 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
@Autowired @Autowired
private OrderTradeService orderTradeService; private OrderTradeService orderTradeService;
@Autowired
private OrderTradeMapper orderTradeMapper;
@Autowired
private OrderTradeService orderTradeService;
@Autowired @Autowired
private CommissionService commissionService; private CommissionService commissionService;

View File

@ -0,0 +1,18 @@
package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.WorkFlow;
import org.apache.ibatis.annotations.Mapper;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
@Mapper
public interface WorkFlowMapper extends BaseMapper<WorkFlow> {
}

View File

@ -0,0 +1,16 @@
package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.WorkFlowVersion;
import org.apache.ibatis.annotations.Mapper;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
@Mapper
public interface WorkFlowVersionMapper extends BaseMapper<WorkFlowVersion> {
}

View File

@ -0,0 +1,11 @@
package com.mcwl.resource.service;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
public interface WorkFlowService {
}

View File

@ -0,0 +1,11 @@
package com.mcwl.resource.service;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
public interface WorkFlowVersionService {
}

View File

@ -0,0 +1,17 @@
package com.mcwl.resource.service.impl;
import com.mcwl.resource.service.WorkFlowService;
import org.springframework.stereotype.Service;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
@Service
public class WorkFlowServiceImpl implements WorkFlowService {
}

View File

@ -0,0 +1,16 @@
package com.mcwl.resource.service.impl;
import com.mcwl.resource.service.WorkFlowService;
import org.springframework.stereotype.Service;
/**
*
* @author DaiZibo
* @date 2025/1/9
* @apiNote
*/
@Service
public class WorkFlowVersionServiceImpl implements WorkFlowService {
}