Merge branch 'feature/resource' of https://gitea.qinmian.online/CY/mcwl-ai into preview

# Conflicts:
#	mcwl-pay/src/main/java/com/mcwl/pay/service/OrderTradeService.java
#	mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java
#	mcwl-system/src/main/resources/mapper/system/SysUserMapper.xml
feature/comment
ChenYan 2025-01-08 20:15:33 +08:00
commit 50c89af2c2
34 changed files with 499 additions and 688 deletions

View File

@ -20,18 +20,8 @@ public class McWlApplication
{ {
public static void main(String[] args) public static void main(String[] args)
{ {
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(McWlApplication.class, args); SpringApplication.run(McWlApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ \n" + System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ ");
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
} }
// 序列化枚举值为前端返回值 // 序列化枚举值为前端返回值

View File

@ -1,77 +0,0 @@
package com.mcwl.web.controller.comment;
import com.mcwl.comment.domain.ProductCommentConditionEntity;
import com.mcwl.comment.domain.ProductCommentEntity;
import com.mcwl.comment.service.impl.CommentServiceImpl;
import com.mcwl.common.utils.ResponsePageEntity;
import com.mcwl.resource.domain.MallProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.web.controller.comment
* @FilenameCommentController
* @Description TODO
* @Date2025/1/4 18:56
*/
@RestController
@RequestMapping("/comment")
public class CommentController {
@Autowired
private CommentServiceImpl commentService;
/**
* id
*
* @param id ID
* @return
*/
@GetMapping("/findById")
public MallProduct findById(Long id) {
return commentService.findById(id);
}
/**
*
*
* @param productCommentEntity
* @return
*/
@PostMapping("/insert")
public int insert(@RequestBody ProductCommentEntity productCommentEntity) {
return commentService.insert(productCommentEntity);
}
/**
*
*
* @param productCommentEntity
* @return
*/
@PostMapping("/update")
public int update(@RequestBody ProductCommentEntity productCommentEntity) {
return commentService.update(productCommentEntity);
}
/**
*
*
* @param ids ID
* @return
*/
@PostMapping("/deleteByIds")
public int deleteByIds(@RequestBody @NotNull List<Long> ids) {
return commentService.deleteByIds(ids);
}
}

View File

@ -5,8 +5,7 @@ import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.domain.IdsParam; import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.service.MallProductService; import com.mcwl.resource.service.MallProductService;
import com.mcwl.web.controller.common.OssUtil; import com.mcwl.web.controller.common.OssUtil;
@ -38,6 +37,7 @@ public class MallProductController extends BaseController {
} }
/*** /***
* *
* *
@ -86,11 +86,11 @@ public class MallProductController extends BaseController {
/** /**
* *
*/ */
@GetMapping("/list") @PostMapping("/list")
public TableDataInfo list(MallProduct sysJob) public TableDataInfo list(@RequestBody ModelProduct mallProduct)
{ {
startPage(); startPage();
List<MallProduct> list = mallProductRuleInfoService.selectMallProductList(sysJob); List<ModelProduct> list = mallProductRuleInfoService.selectMallProductList(mallProduct);
return getDataTable(list); return getDataTable(list);
} }
@ -99,35 +99,33 @@ public class MallProductController extends BaseController {
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long jobId) public AjaxResult getInfo(@PathVariable("id") Long Id)
{ {
return success(mallProductRuleInfoService.selectMallProductById(jobId)); return success(mallProductRuleInfoService.getById(Id));
} }
/** /**
* *
*/ */
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody MallProduct mallProduct) public AjaxResult add(@RequestBody ModelProduct mallProduct)
{ {
mallProduct.setUserId(SecurityUtils.getUserId());
mallProduct.setCreateBy(getUsername());
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct)); return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
} }
/** /**
* *
*/ */
@PutMapping("/upda") @PutMapping("/upda")
public AjaxResult edit(@RequestBody MallProduct mallProduct) public AjaxResult edit(@RequestBody ModelProduct mallProduct)
{ {
mallProduct.setUpdateBy(getUsername()); mallProduct.setUpdateBy(getUsername());
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct)); return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
} }
/** /**
* *
*/ */
@ -145,7 +143,7 @@ public class MallProductController extends BaseController {
@PostMapping("/selectByUserId") @PostMapping("/selectByUserId")
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){ public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
Page<MallProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo); Page<ModelProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
return AjaxResult.success(mallProductList); return AjaxResult.success(mallProductList);
} }

View File

@ -3,7 +3,7 @@ package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.annotation.RepeatSubmit; import com.mcwl.common.annotation.RepeatSubmit;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.MallProduct; import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.service.MallProductLikeService; import com.mcwl.resource.service.MallProductLikeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -31,7 +31,7 @@ public class MallProductLikeController {
@PostMapping("/selectByUserLike") @PostMapping("/selectByUserLike")
public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){ public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){
Page<MallProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo); Page<ModelProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
return AjaxResult.success(mallProductPage); return AjaxResult.success(mallProductPage);
} }

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

@ -9,67 +9,30 @@
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime}, values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
#{updateBy}, #{updateTime}, #{remark}, #{delFlag}) #{updateBy}, #{updateTime}, #{remark}, #{delFlag})
</insert> </insert>
<update id="upda"> <update id="upda"></update>
update mall_product_comment
<set>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="productId != null">
product_id = #{productId},
</if>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="content != null">
content = #{content},
</if>
<if test="rating !=null">
rating = #{rating},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</set>
where id = #{id}
</update>
<delete id="deleteByIds"> <delete id="deleteByIds">
delete delete
from mall_product_comment from model
where id in where id in
<foreach collection="ids" item="id" open="(" separator="," close=")"> <foreach collection="ids" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="findById" resultType="com.mcwl.resource.domain.MallProduct"> <select id="findById" resultType="com.mcwl.resource.domain.ModelProduct">
select productId, select
userId, id,
productName, parent_id,
detail, product_id,
model, user_id,
amount, content,
status, create_by,
name, create_time,
url, update_by,
zipUrl, update_time,
delFlag remark,
from mall_product del_flag
from model
where id = #{id} where id = #{id}
</select> </select>
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity"> <select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
@ -79,7 +42,6 @@
product_id, product_id,
user_id, user_id,
content, content,
rating,
create_by, create_by,
create_time, create_time,
update_by, update_by,

View File

@ -0,0 +1,12 @@
package com.mcwl.common.constant;
public class ShopCodeConstants {
/**
*
*/
public static final String MODEL = "model-";
/**
* cf
*/
public static final String CF = "cf-";
}

View File

@ -58,6 +58,9 @@ public class SysUser extends BaseEntity
/** 密码 */ /** 密码 */
private String password; private String password;
/** 钱包 */
private Long wallet;
/** 帐号状态0正常 1停用 */ /** 帐号状态0正常 1停用 */
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
private String status; private String status;

View File

@ -49,6 +49,10 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version> <version>${mybatis-plus.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.mcwl</groupId>
<artifactId>mcwl-system</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -26,4 +26,5 @@ public interface OrderTradeService extends IService<OrderTrade> {
void orderHandler(OrderTrade orderTrade, String suffix, Map<String, String> params); void orderHandler(OrderTrade orderTrade, String suffix, Map<String, String> params);
} }

View File

@ -5,31 +5,17 @@ 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.SecurityUtils;
import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.StringUtils;
import com.mcwl.common.utils.uuid.IdUtils;
import com.mcwl.memberCenter.domain.Member;
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.PaymentResult;
import com.mcwl.pay.domain.enums.PaymentStatus; import com.mcwl.pay.domain.enums.PaymentStatus;
import com.mcwl.pay.domain.enums.OrderTypeEnum;
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 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.math.BigDecimal; import java.util.Collections;
import java.util.*; import java.util.List;
/** /**
* @AuthorChenYan * @AuthorChenYan
@ -42,6 +28,14 @@ import java.util.*;
@Service @Service
public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTrade> implements OrderTradeService { public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTrade> implements OrderTradeService {
@Autowired
private OrderTradeMapper orderTradeMapper;
@Autowired
private SysUserServiceImpl userExtensionService;
@Autowired
private OrderTradeService orderTradeService;
@Autowired @Autowired
private OrderTradeMapper orderTradeMapper; private OrderTradeMapper orderTradeMapper;
@ -110,19 +104,8 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
@Override @Override
public int insertMallProduct(OrderTrade orderTrade) { public int insertMallProduct(OrderTrade orderTrade) {
PaymentResult paymentResult = orderTradeMapper.chargeCard(orderTrade.getTotalAmount(), orderTrade.getPaymentMethod());
if (paymentResult.isSuccess()) {
// 支付成功后的处理:更新订单状态、生成激活码、更新用户权限等
orderTrade.setOrderStatus(PaymentStatus.COMPLETED.ordinal());
// 保存订单 // 保存订单
return orderTradeMapper.insert(orderTrade); return orderTradeMapper.insert(orderTrade);
} else {
// 支付失败处理...
orderTrade.setOrderStatus(PaymentStatus.FAILED.ordinal());
}
return 0;
} }
@Override @Override

View File

@ -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.pay.mapper.OrderTradeMapper">
<update id="chargeCard">
</update>
</mapper>

View File

@ -0,0 +1,62 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameModelImage
* @Description
* @Date2025/1/8 19:35
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("model_image")
public class ModelImage {
/**
* ID
*/
private Long id;
/**
* 8
*/
private Long image_paths;
/**
*
*/
private Long has_watermark;
/**
*
*/
private Long is_member_download;
/**
*
*/
private Long is_not_downloadable;
/**
*
*/
private Long hide_gen_info;
/**
* 30
*/
private Long title;
/**
*
*/
private Long tags;
/**
* 500
*/
private Long description;
/**
* 0 2
*/
private Long del_flag;
}

View File

@ -10,70 +10,73 @@ import lombok.NoArgsConstructor;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
*
* @AuthorChenYan * @AuthorChenYan
* @ProjectMcWl * @ProjectMcWl
* @Packagecom.mcwl.common.domain.resource * @Packagecom.mcwl.common.domain.resource
* @FilenameMallProduct * @FilenameMallProduct
* @Description TODO * @Description
* @Date2024/12/30 17:22 * @Date2024/12/30 17:22
*/ */
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@TableName("mall_product") @TableName("model")
public class MallProduct extends BaseEntity { public class ModelProduct extends BaseEntity {
private static final long serialVersionUID = 1L;
/** /**
* ID * ID
*/ */
@TableId @TableId
private Long productId; private Long id;
/** /**
* ID *
*/
private String modelName;
/***
* id
*/ */
private Long userId; private Long userId;
/** /**
* * ID
*/ */
private String productName; private Long modelTypeId;
/** /**
* *
*/ */
private String detail; private String category;
/** /**
* *
*/ */
private String model; private String functions;
/** /**
* *
*/ */
private BigDecimal amount; private String tags;
/** /**
* (0 1 2 3 4) *
*/ */
private String status; private String activityParticipation;
/** /**
* *
*/ */
private String name; private Integer isOriginal;
/** /**
* url *
*/ */
private String url; private String originalAuthorName;
/** /**
* url *
*/ */
private String zipUrl; private Integer real;
/**
*
*/
private Integer number;
/** /**
* 0 2 * 0 2
*/ */
private String delFlag; private String delFlag;
/**
*
*/
private Long number;
} }

View File

@ -0,0 +1,101 @@
package com.mcwl.resource.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;
import org.locationtech.jts.noding.SegmentString;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameModelVersion
* @Description TODO
* @Date2025/1/8 19:25
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("model_version")
public class ModelVersion extends BaseEntity {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String versionName;
/**
* ID
*/
private Long modelTypeId;
/**
*
*/
private String filePath;
/**
*
*/
private String versionDescription;
/**
*
*/
private String triggerWords;
/**
*
*/
private Integer isPublic;
/**
* 线使
*/
private Integer isOnlineUse;
/**
*
*/
private Integer allowDownloadImage;
/**
* 使
*/
private Integer allowSoftwareUse;
/**
*
*/
private Integer allowFusion;
/**
*
*/
private Integer allowCommercialUse;
/**
* 使
*/
private Integer allowUsage;
/**
*
*/
private Integer isExclusiveModel;
/**
* 使
*/
private String sampleImagePaths;
/**
*
*/
private Integer hideImageGenInfo;
/**
*
*/
private String status;
/**
* 0 2
*/
private String delFlag;
}

View File

@ -0,0 +1,30 @@
package com.mcwl.resource.domain;
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.resource.domain
* @FilenameToActivity
* @Description TODO
* @Date2025/1/8 19:23
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("to_activity")
public class ToActivity extends BaseEntity {
/**
*
*/
private Long id;
/**
*
*/
private String activityName;
}

View File

@ -0,0 +1,59 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameWorkFlow
* @Description
* @Version1.0
* @Date2025/1/8 19:38
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("work_flow")
public class WorkFlow {
/**
* ID
*/
@TableId
private Long id;
/**
* 30
*/
private String workflowName;
/**
*
*/
private String category;
/**
*
*/
private String theme;
/**
*
*/
private String style;
/**
*
*/
private String functions;
/**
*
*/
private String activityParticipation;
/**
* 0 2
*/
private String del_flag;
}

View File

@ -0,0 +1,52 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameWorkFlow
* @Description TODO
* @Date2025/1/8 19:38
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("work_flow_version")
public class WorkFlowVersion {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String versionName;
/**
*
*/
private String versionDescription;
/**
*
*/
private String filePath;
/**
* 20,
*/
private String imagePaths;
/**
*
*/
private String hideGenInfo;
/**
* 0 2
*/
private String delFlag;
}

View File

@ -0,0 +1,23 @@
package com.mcwl.resource.domain.enums;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameOrderTypeEnum
* @Description TODO
* @Date2025/1/6 19:51
*/
public enum OrderTypeEnum {
TIME("time"), NUM("num");
private final String name;
OrderTypeEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -1,10 +1,13 @@
package com.mcwl.resource.mapper; package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
/** /**
* @AuthorChenYan * @AuthorChenYan
* @ProjectMcWl * @ProjectMcWl
@ -14,10 +17,12 @@ import org.apache.ibatis.annotations.Param;
* @Date2024/12/30 18:23 * @Date2024/12/30 18:23
*/ */
@Mapper @Mapper
public interface MallProductMapper extends BaseMapper<MallProduct> { public interface MallProductMapper extends BaseMapper<ModelProduct> {
String selectMallProductById(@Param("mallProductId") Long mallProductId);
Long sumNumber(@Param("userId") Long userId); Long sumNumber(@Param("userId") Long userId);
} }

View File

@ -2,7 +2,7 @@ package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.MallProduct; import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
/** /**
@ -12,7 +12,7 @@ import com.mcwl.resource.domain.vo.MallProductVo;
*/ */
public interface MallProductLikeService { public interface MallProductLikeService {
Page<MallProduct> selectByUserLike(MallProductVo mallProductVo); Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo);
AjaxResult addLike(Long productId); AjaxResult addLike(Long productId);

View File

@ -3,7 +3,7 @@ package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.domain.IdsParam; import com.mcwl.common.domain.IdsParam;
import com.mcwl.resource.domain.MallProduct; import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
import java.util.List; import java.util.List;
@ -16,21 +16,23 @@ import java.util.List;
* @Description TODO * @Description TODO
* @Date2024/12/30 18:20 * @Date2024/12/30 18:20
*/ */
public interface MallProductService extends IService<MallProduct> { public interface MallProductService extends IService<ModelProduct> {
List<MallProduct> selectMallProductList(MallProduct sysJob); List<ModelProduct> selectMallProductList(ModelProduct sysJob);
String selectMallProductById(Long mallProductId);
int insertMallProduct(MallProduct mallProduct);
int updateMallProduct(MallProduct mallProduct);
int insertMallProduct(ModelProduct mallProduct);
int updateMallProduct(ModelProduct mallProduct);
void deleteMallProductByIds(IdsParam ids); void deleteMallProductByIds(IdsParam ids);
Page<MallProduct> selectByUserId(MallProductVo mallProductVo); Page<ModelProduct> selectByUserId(MallProductVo mallProductVo);
Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
} }

View File

@ -3,10 +3,11 @@ package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.MallProductLike; import com.mcwl.resource.domain.MallProductLike;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.mapper.MallProductLikeMapper; import com.mcwl.resource.mapper.MallProductLikeMapper;
import com.mcwl.resource.mapper.MallProductMapper;
import com.mcwl.resource.service.MallProductLikeService; import com.mcwl.resource.service.MallProductLikeService;
import com.mcwl.resource.service.MallProductService; import com.mcwl.resource.service.MallProductService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -31,12 +32,11 @@ public class MallProductLikeServiceImpl implements MallProductLikeService {
private MallProductService mallProductService; private MallProductService mallProductService;
@Override @Override
public Page<MallProduct> selectByUserLike(MallProductVo mallProductVo) { public Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo) {
//获取登录人 //获取登录人
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
List<Long> list = mallProductLikeMapper.selectByUserId(userId); List<Long> list = mallProductLikeMapper.selectByUserId(userId);
//分页查询作品数据 //分页查询作品数据
return mallProductService.pageLike(mallProductVo, list); return mallProductService.pageLike(mallProductVo, list);
} }

View File

@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.redis.RedisCache;
import com.mcwl.common.domain.IdsParam; import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.MallProduct; import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.mapper.MallProductMapper; import com.mcwl.resource.mapper.MallProductMapper;
import com.mcwl.resource.service.MallProductService; import com.mcwl.resource.service.MallProductService;
import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.domain.vo.MallProductVo;
@ -25,33 +26,30 @@ import java.util.List;
* @Date2024/12/30 18:22 * @Date2024/12/30 18:22
*/ */
@Service @Service
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallProduct> implements MallProductService { public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements MallProductService {
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
private MallProductMapper postMapper; private MallProductMapper postMapper;
@Override @Override
public List<MallProduct> selectMallProductList(MallProduct mallProduct) { public List<ModelProduct> selectMallProductList(ModelProduct mallProduct) {
QueryWrapper<MallProduct> queryWrapper = new QueryWrapper<>(); QueryWrapper<ModelProduct> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(MallProduct::getProductName, mallProduct.getProductName()); queryWrapper.lambda().eq(ModelProduct::getModelName, mallProduct.getModelName());
queryWrapper.lambda().eq(MallProduct::getName, mallProduct.getName()); queryWrapper.lambda().eq(ModelProduct::getOriginalAuthorName, mallProduct.getOriginalAuthorName());
queryWrapper.lambda().eq(MallProduct::getAmount, mallProduct.getAmount());
return postMapper.selectList(queryWrapper); return postMapper.selectList(queryWrapper);
} }
@Override
public String selectMallProductById(Long mallProductId) {
return postMapper.selectMallProductById(mallProductId);
}
@Override @Override
public int insertMallProduct(MallProduct mallProduct) { public int insertMallProduct(ModelProduct mallProduct) {
return postMapper.insert(mallProduct); return postMapper.insert(mallProduct);
} }
@Override @Override
public int updateMallProduct(MallProduct mallProduct) { public int updateMallProduct(ModelProduct mallProduct) {
return postMapper.updateById(mallProduct); return postMapper.updateById(mallProduct);
} }
@ -61,60 +59,55 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallPr
} }
@Override @Override
public Page<MallProduct> selectByUserId(MallProductVo mallProductVo) { public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
// 创建分页对象 // 创建分页对象
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize()); Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
//获取当前登录人ID //获取当前登录人ID
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
mallProductLambdaQueryWrapper.eq(MallProduct::getUserId,userId); mallProductLambdaQueryWrapper.eq(ModelProduct::getUserId,userId);
mallProductLambdaQueryWrapper.eq(MallProduct::getDelFlag,0); mallProductLambdaQueryWrapper.eq(ModelProduct::getDelFlag,0);
if (mallProductVo.getStatus() != 0){
mallProductLambdaQueryWrapper.eq(MallProduct::getStatus,mallProductVo.getStatus());
}
if (mallProductVo.getOrder() == 1){
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId);
}else {
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber);
}
// 开始时间和结束时间过滤 // 开始时间和结束时间过滤
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) { if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
// 查询开始时间和结束时间之间的商品 // 查询开始时间和结束时间之间的商品
mallProductLambdaQueryWrapper.between(MallProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime()); mallProductLambdaQueryWrapper.between(ModelProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime());
} else if (mallProductVo.getStartTime() != null) { } else if (mallProductVo.getStartTime() != null) {
// 只有开始时间,查询大于等于开始时间的商品 // 只有开始时间,查询大于等于开始时间的商品
mallProductLambdaQueryWrapper.ge(MallProduct::getCreateTime, mallProductVo.getStartTime()); mallProductLambdaQueryWrapper.ge(ModelProduct::getCreateTime, mallProductVo.getStartTime());
} else if (mallProductVo.getEndTime() != null) { } else if (mallProductVo.getEndTime() != null) {
// 只有结束时间,查询小于等于结束时间的商品 // 只有结束时间,查询小于等于结束时间的商品
mallProductLambdaQueryWrapper.le(MallProduct::getCreateTime, mallProductVo.getEndTime()); mallProductLambdaQueryWrapper.le(ModelProduct::getCreateTime, mallProductVo.getEndTime());
} }
return postMapper.selectPage(mallProductPage, mallProductLambdaQueryWrapper); return postMapper.selectPage(mallProductPage, mallProductLambdaQueryWrapper);
} }
@Override @Override
public Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list) { public Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
// 创建分页对象 // 创建分页对象
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize()); Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
mallProductLambdaQueryWrapper.in(MallProduct::getProductId,list); mallProductLambdaQueryWrapper.in(ModelProduct::getModelTypeId,list);
if (mallProductVo.getOrder() == 1){ if (mallProductVo.getOrder() == 1){
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId); mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getModelTypeId);
}else { }else {
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber); mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getNumber);
} }
return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper); return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper);
} }
} }

View File

@ -5,27 +5,8 @@
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper"> <mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
<select id="selectMallProductById" resultType="java.lang.String">
select product_id,
user_id,
product_name,
detail,
model,
amount,
name,
status,
zip_url,
url,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag
from mall_product where product_id =#{mallProductId}
</select>
<select id="sumNumber" resultType="java.lang.Long"> <select id="sumNumber" resultType="java.lang.Long">
SELECT sum(number)sum FROM mall_product where user_id = #{userId} ORDER BY(user_id); SELECT sum(number)sum FROM model where user_id = #{userId} ORDER BY(user_id);
</select> </select>
</mapper> </mapper>

View File

@ -1,5 +1,6 @@
package com.mcwl.system.mapper; package com.mcwl.system.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -132,4 +133,5 @@ public interface SysUserMapper
SysUser selectUserInfoById(@Param("userId") Long userId); SysUser selectUserInfoById(@Param("userId") Long userId);
} }

View File

@ -1,5 +1,6 @@
package com.mcwl.system.service.impl; package com.mcwl.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mcwl.common.annotation.DataScope; import com.mcwl.common.annotation.DataScope;
import com.mcwl.common.constant.UserConstants; import com.mcwl.common.constant.UserConstants;
import com.mcwl.common.core.domain.entity.SysRole; import com.mcwl.common.core.domain.entity.SysRole;
@ -617,4 +618,5 @@ public class SysUserServiceImpl implements ISysUserService
return sb.toString(); return sb.toString();
} }
} }

View File

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.inviter_user_id,u.free_points, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u