Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 112 KiB |
BIN
.image/Redis.jpg
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 95 KiB |
BIN
.image/admin-uniapp/01.png
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 15 KiB |
BIN
.image/admin-uniapp/02.png
Executable file → Normal file
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 33 KiB |
BIN
.image/admin-uniapp/03.png
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 15 KiB |
BIN
.image/admin-uniapp/04.png
Executable file → Normal file
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.7 KiB |
BIN
.image/admin-uniapp/05.png
Executable file → Normal file
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 56 KiB |
BIN
.image/admin-uniapp/06.png
Executable file → Normal file
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 8.6 KiB |
BIN
.image/admin-uniapp/07.png
Executable file → Normal file
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 26 KiB |
BIN
.image/admin-uniapp/08.png
Executable file → Normal file
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 26 KiB |
BIN
.image/admin-uniapp/09.png
Executable file → Normal file
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 238 KiB |
BIN
.image/common/project-vs.png
Normal file
After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 493 KiB After Width: | Height: | Size: 201 KiB |
BIN
.image/common/yudao-roadmap.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
.image/个人中心.jpg
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 37 KiB |
BIN
.image/代码生成.jpg
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 130 KiB |
BIN
.image/令牌管理.jpg
Executable file → Normal file
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 150 KiB |
BIN
.image/任务日志.jpg
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 124 KiB |
BIN
.image/在线用户.jpg
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 73 KiB |
0
.image/大屏设计器-列表.jpg
Executable file → Normal file
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
BIN
.image/大屏设计器-编辑.jpg
Executable file → Normal file
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 109 KiB |
BIN
.image/大屏设计器-预览.jpg
Executable file → Normal file
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 69 KiB |
BIN
.image/字典数据.jpg
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 78 KiB |
BIN
.image/字典类型.jpg
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 126 KiB |
BIN
.image/定时任务.jpg
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 74 KiB |
BIN
.image/岗位管理.jpg
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 80 KiB |
BIN
.image/应用管理.jpg
Executable file → Normal file
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 41 KiB |
BIN
.image/操作日志.jpg
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 98 KiB |
BIN
.image/敏感词.jpg
Executable file → Normal file
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 47 KiB |
BIN
.image/数据库文档.jpg
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 97 KiB |
BIN
.image/文件管理.jpg
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 74 KiB |
BIN
.image/日志中心.jpg
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 84 KiB |
BIN
.image/生成效果.jpg
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 128 KiB |
BIN
.image/用户管理.jpg
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 112 KiB |
BIN
.image/登录日志.jpg
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 77 KiB |
BIN
.image/短信日志.jpg
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 41 KiB |
BIN
.image/短信渠道.jpg
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 80 KiB |
BIN
.image/系统接口.jpg
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 91 KiB |
BIN
.image/菜单管理.jpg
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 129 KiB |
BIN
.image/表单构建.jpg
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 102 KiB |
BIN
.image/角色管理.jpg
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 85 KiB |
BIN
.image/访问日志.jpg
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 73 KiB |
BIN
.image/通知公告.jpg
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 77 KiB |
BIN
.image/部门管理.jpg
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 109 KiB |
BIN
.image/配置管理.jpg
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 89 KiB |
BIN
.image/链路追踪.jpg
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 80 KiB |
BIN
.image/错误日志.jpg
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 110 KiB |
BIN
.image/错误码管理.jpg
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 131 KiB |
BIN
.image/首页.jpg
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 62 KiB |
@ -42,7 +42,7 @@
|
||||
|
||||
## 🐳 项目关系
|
||||
|
||||
![架构演进](https://static.iocoder.cn/yudao-roadmap.png?imageView2/2/format/webp)
|
||||
![架构演进](/.image/common/yudao-roadmap.png)
|
||||
|
||||
三个项目的功能对比,可见社区共同整理的 [国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn) 表格。
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
② 代码全部开源,不会像其他项目一样,只开源部分代码,让你无法了解整个项目的架构设计。[国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn)
|
||||
|
||||
![开源项目对比](https://static.iocoder.cn/project-vs.png?imageView2/2/format/webp/w/1280)
|
||||
![开源项目对比](/.image/common/project-vs.png)
|
||||
|
||||
③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,57000 行 Java 代码,22000 行代码注释。
|
||||
|
||||
|
6
pom.xml
@ -13,14 +13,14 @@
|
||||
<!-- Server 主项目 -->
|
||||
<module>yudao-server</module>
|
||||
<!-- 各种 module 拓展 -->
|
||||
<module>yudao-module-member</module>
|
||||
<!-- <module>yudao-module-member</module>-->
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<module>yudao-module-pay</module>
|
||||
<module>yudao-module-mall</module>
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<!-- 示例项目 -->
|
||||
<module>yudao-example</module>
|
||||
</modules>
|
||||
|
@ -1,11 +1,17 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi;
|
||||
import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConvert;
|
||||
import cn.iocoder.yudao.module.promotion.convert.seckill.seckillactivity.SeckillActivityConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillActivityDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillProductDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.discount.DiscountActivityService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -17,8 +23,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Tag(name = "管理后台 - 限时折扣活动")
|
||||
@RestController
|
||||
@ -29,6 +38,9 @@ public class DiscountActivityController {
|
||||
@Resource
|
||||
private DiscountActivityService discountActivityService;
|
||||
|
||||
@Resource
|
||||
private ProductSpuApi productSpuApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建限时折扣活动")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:create')")
|
||||
@ -49,7 +61,7 @@ public class DiscountActivityController {
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:close')")
|
||||
public CommonResult<Boolean> closeRewardActivity(@RequestParam("id") Long id) {
|
||||
discountActivityService.closeRewardActivity(id);
|
||||
discountActivityService.closeDiscountActivity(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ -81,7 +93,18 @@ public class DiscountActivityController {
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')")
|
||||
public CommonResult<PageResult<DiscountActivityRespVO>> getDiscountActivityPage(@Valid DiscountActivityPageReqVO pageVO) {
|
||||
PageResult<DiscountActivityDO> pageResult = discountActivityService.getDiscountActivityPage(pageVO);
|
||||
return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult));
|
||||
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return success(PageResult.empty(pageResult.getTotal()));
|
||||
}
|
||||
// 拼接数据
|
||||
List<DiscountProductDO> products = discountActivityService.getDiscountProductsByActivityId(
|
||||
convertSet(pageResult.getList(), DiscountActivityDO::getId));
|
||||
|
||||
List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList(
|
||||
convertSet(products, DiscountProductDO::getSpuId));
|
||||
|
||||
return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult, products, spuList));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 限时折扣活动 Response VO")
|
||||
@Data
|
||||
@ -24,4 +25,25 @@ public class DiscountActivityRespVO extends DiscountActivityBaseVO {
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "限时折扣商品", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<DiscountActivityBaseVO.Product> products;
|
||||
|
||||
|
||||
// ========== 商品字段 ==========
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 name 读取
|
||||
example = "618大促")
|
||||
private String spuName;
|
||||
@Schema(description = "商品主图", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取
|
||||
example = "https://www.iocoder.cn/xx.png")
|
||||
private String picUrl;
|
||||
@Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取
|
||||
example = "50")
|
||||
private Integer marketPrice;
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,15 +2,22 @@ package cn.iocoder.yudao.module.promotion.convert.discount;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
||||
import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.discount.dto.DiscountProductRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.product.SeckillProductRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillProductDO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 限时折扣活动 Convert
|
||||
@ -29,14 +36,57 @@ public interface DiscountActivityConvert {
|
||||
DiscountActivityRespVO convert(DiscountActivityDO bean);
|
||||
|
||||
List<DiscountActivityRespVO> convertList(List<DiscountActivityDO> list);
|
||||
List<DiscountActivityBaseVO.Product> convertList2(List<DiscountProductDO> list);
|
||||
|
||||
List<DiscountProductRespDTO> convertList02(List<DiscountProductDO> list);
|
||||
|
||||
PageResult<DiscountActivityRespVO> convertPage(PageResult<DiscountActivityDO> page);
|
||||
|
||||
default PageResult<DiscountActivityRespVO> convertPage(PageResult<DiscountActivityDO> page,
|
||||
List<DiscountProductDO> discountProductDOList,
|
||||
List<ProductSpuRespDTO> spuList) {
|
||||
PageResult<DiscountActivityRespVO> pageResult = convertPage(page);
|
||||
|
||||
// 拼接商品
|
||||
Map<Long, DiscountProductDO> discountActivityMap = CollectionUtils.convertMap(discountProductDOList, DiscountProductDO::getActivityId);
|
||||
Map<Long, ProductSpuRespDTO> spuMap = CollectionUtils.convertMap(spuList, ProductSpuRespDTO::getId);
|
||||
pageResult.getList().forEach(item -> {
|
||||
item.setProducts(convertList2(discountProductDOList));
|
||||
item.setSpuId(discountActivityMap.get(item.getId())==null?null: discountActivityMap.get(item.getId()).getSpuId());
|
||||
if (item.getSpuId() != null) {
|
||||
MapUtils.findAndThen(spuMap, item.getSpuId(),
|
||||
spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()));
|
||||
}
|
||||
|
||||
});
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
DiscountProductDO convert(DiscountActivityBaseVO.Product bean);
|
||||
|
||||
DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List<DiscountProductDO> products);
|
||||
default DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List<DiscountProductDO> products){
|
||||
if ( activity == null && products == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
DiscountActivityDetailRespVO discountActivityDetailRespVO = new DiscountActivityDetailRespVO();
|
||||
|
||||
if ( activity != null ) {
|
||||
discountActivityDetailRespVO.setName( activity.getName() );
|
||||
discountActivityDetailRespVO.setStartTime( activity.getStartTime() );
|
||||
discountActivityDetailRespVO.setEndTime( activity.getEndTime() );
|
||||
discountActivityDetailRespVO.setRemark( activity.getRemark() );
|
||||
discountActivityDetailRespVO.setId( activity.getId() );
|
||||
discountActivityDetailRespVO.setStatus( activity.getStatus() );
|
||||
discountActivityDetailRespVO.setCreateTime( activity.getCreateTime() );
|
||||
}
|
||||
if (!products.isEmpty()) {
|
||||
discountActivityDetailRespVO.setSpuId(products.get(0).getSpuId());
|
||||
}
|
||||
discountActivityDetailRespVO.setProducts( convertList2( products ) );
|
||||
|
||||
return discountActivityDetailRespVO;
|
||||
}
|
||||
|
||||
// =========== 比较是否相等 ==========
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.discount;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -23,4 +24,10 @@ public interface DiscountProductMapper extends BaseMapperX<DiscountProductDO> {
|
||||
return selectList(DiscountProductDO::getActivityId, activityId);
|
||||
}
|
||||
|
||||
default List<DiscountProductDO> selectListByActivityId(Collection<Long> activityIds) {
|
||||
return selectList(DiscountProductDO::getActivityId, activityIds);
|
||||
}
|
||||
|
||||
|
||||
List<DiscountProductDO> getMatchDiscountProductList(@Param("skuIds") Collection<Long> skuIds);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public interface DiscountActivityService {
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void closeRewardActivity(Long id);
|
||||
void closeDiscountActivity(Long id);
|
||||
|
||||
/**
|
||||
* 删除限时折扣活动
|
||||
@ -81,4 +81,12 @@ public interface DiscountActivityService {
|
||||
*/
|
||||
List<DiscountProductDO> getDiscountProductsByActivityId(Long activityId);
|
||||
|
||||
/**
|
||||
* 获得活动编号,对应对应的商品列表
|
||||
*
|
||||
* @param activityIds 活动编号
|
||||
* @return 活动的商品列表
|
||||
*/
|
||||
List<DiscountProductDO> getDiscountProductsByActivityId(Collection<Long> activityIds);
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.service.discount;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.DiscountActivityBaseVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.DiscountActivityCreateReqVO;
|
||||
@ -20,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
@ -41,8 +43,9 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
|
||||
@Override
|
||||
public List<DiscountProductDO> getMatchDiscountProductList(Collection<Long> skuIds) {
|
||||
// TODO 芋艿:开启、满足 skuId、日期内
|
||||
return null;
|
||||
// 芋艿:开启、满足 skuId、日期内
|
||||
List<DiscountProductDO> matchDiscountProductList = discountProductMapper.getMatchDiscountProductList(skuIds);
|
||||
return matchDiscountProductList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,7 +69,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
public void updateDiscountActivity(DiscountActivityUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
DiscountActivityDO discountActivity = validateDiscountActivityExists(updateReqVO.getId());
|
||||
if (discountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 已关闭的活动,不能修改噢
|
||||
if (discountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能修改噢
|
||||
throw exception(DISCOUNT_ACTIVITY_UPDATE_FAIL_STATUS_CLOSED);
|
||||
}
|
||||
// 校验商品是否冲突
|
||||
@ -99,7 +102,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 芋艿:校验逻辑简化,只查询时间冲突的活动,开启状态的。
|
||||
// 芋艿:校验逻辑简化,只查询时间冲突的活动,开启状态的。
|
||||
/**
|
||||
* 校验商品是否冲突
|
||||
*
|
||||
@ -111,27 +114,30 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
return;
|
||||
}
|
||||
// 查询商品参加的活动
|
||||
List<DiscountProductDO> discountActivityProductList = null;
|
||||
|
||||
List<DiscountProductDO> list = discountProductMapper.selectListByActivityId(id);
|
||||
List<Long> skuIds = list.stream().map(item -> item.getSkuId()).collect(Collectors.toList());
|
||||
List<DiscountProductDO> matchDiscountProductList = getMatchDiscountProductList(skuIds);
|
||||
// getRewardProductListBySkuIds(
|
||||
// convertSet(products, DiscountActivityBaseVO.Product::getSkuId),
|
||||
// asList(PromotionActivityStatusEnum.WAIT.getStatus(), PromotionActivityStatusEnum.RUN.getStatus()));
|
||||
if (id != null) { // 排除自己这个活动
|
||||
discountActivityProductList.removeIf(product -> id.equals(product.getActivityId()));
|
||||
matchDiscountProductList.removeIf(product -> id.equals(product.getActivityId()));
|
||||
}
|
||||
// 如果非空,则说明冲突
|
||||
if (CollUtil.isNotEmpty(discountActivityProductList)) {
|
||||
if (CollUtil.isNotEmpty(matchDiscountProductList)) {
|
||||
throw exception(DISCOUNT_ACTIVITY_SPU_CONFLICTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeRewardActivity(Long id) {
|
||||
public void closeDiscountActivity(Long id) {
|
||||
// 校验存在
|
||||
DiscountActivityDO dbDiscountActivity = validateDiscountActivityExists(id);
|
||||
if (dbDiscountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 已关闭的活动,不能关闭噢
|
||||
if (dbDiscountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能关闭噢
|
||||
throw exception(DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED);
|
||||
}
|
||||
if (dbDiscountActivity.getStatus().equals(PromotionActivityStatusEnum.END.getStatus())) { // 已关闭的活动,不能关闭噢
|
||||
if (dbDiscountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能关闭噢
|
||||
throw exception(DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_END);
|
||||
}
|
||||
|
||||
@ -144,7 +150,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
public void deleteDiscountActivity(Long id) {
|
||||
// 校验存在
|
||||
DiscountActivityDO discountActivity = validateDiscountActivityExists(id);
|
||||
if (!discountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 未关闭的活动,不能删除噢
|
||||
if (!discountActivity.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())) { // 未关闭的活动,不能删除噢
|
||||
throw exception(DISCOUNT_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED);
|
||||
}
|
||||
|
||||
@ -175,4 +181,8 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
|
||||
return discountProductMapper.selectListByActivityId(activityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiscountProductDO> getDiscountProductsByActivityId(Collection<Long> activityIds) {
|
||||
return discountProductMapper.selectList("activity_id", activityIds);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
<?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="cn.iocoder.yudao.module.promotion.dal.mysql.discount.DiscountProductMapper">
|
||||
|
||||
|
||||
<select id="getMatchDiscountProductList" resultType="cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO">
|
||||
SELECT pdp.*
|
||||
FROM promotion_discount_product pdp
|
||||
LEFT JOIN promotion_discount_activity pda
|
||||
ON pdp.activity_id = pda.id
|
||||
<where>
|
||||
<if test="skuIds != null and skuIds.size > 0">
|
||||
AND pdp.sku_id in
|
||||
<foreach collection="skuIds" item="skuId" index="index" open="(" close=")" separator=",">
|
||||
#{skuId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND pda.start_time <= CURRENT_TIME AND pda.end_time >= CURRENT_TIME
|
||||
AND pda.`status` = 20
|
||||
AND pda.deleted != 1
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -37,11 +37,11 @@
|
||||
</dependency>
|
||||
|
||||
<!-- 会员中心。默认注释,保证编译速度 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-member-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-member-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 数据报表。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
@ -56,11 +56,11 @@
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 支付服务。默认注释,保证编译速度 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-pay-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-pay-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 微信公众号模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
@ -70,26 +70,26 @@
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 商城相关模块。默认注释,保证编译速度 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-promotion-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-product-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-trade-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-statistics-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-promotion-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-product-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-trade-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-statistics-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- spring boot 配置所需依赖 -->
|
||||
<dependency>
|
||||
|
@ -61,3 +61,25 @@ export function getTaskListByProcessInstanceId(processInstanceId) {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
export function getReturnList(taskId) {
|
||||
return request({
|
||||
url: '/bpm/task/get-return-list?taskId='+ taskId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function returnTask(data) {
|
||||
return request({
|
||||
url: '/bpm/task/return',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function delegateTask(data) {
|
||||
return request({
|
||||
url: '/bpm/task/delegate',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -233,6 +233,10 @@ export default {
|
||||
return 'highlight-reject';
|
||||
} else if (result === 4) { // 已取消
|
||||
return 'highlight-cancel';
|
||||
} else if (result === 5) { // 已退回
|
||||
return 'highlight-back';
|
||||
} else if (result === 6) { // 已委派
|
||||
return 'highlight-todo';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
@ -475,7 +479,33 @@ export default {
|
||||
:deep(.highlight-cancel.djs-connection > .djs-visual > path) {
|
||||
stroke: grey !important;
|
||||
}
|
||||
/**驳回 */
|
||||
.highlight-back.djs-connection > .djs-visual > path {
|
||||
stroke: #FFBA00 !important;
|
||||
stroke-dasharray: 4px !important;
|
||||
fill-opacity: 0.2 !important;
|
||||
}
|
||||
|
||||
.highlight-back.djs-shape .djs-visual > :nth-child(1) {
|
||||
fill: #FFBA00 !important;
|
||||
stroke: #FFBA00 !important;
|
||||
stroke-dasharray: 4px !important;
|
||||
fill-opacity: 0.2 !important;
|
||||
}
|
||||
|
||||
:deep(.highlight-back.djs-connection > .djs-visual > path) {
|
||||
stroke: #FFBA00 !important;
|
||||
stroke-dasharray: 4px !important;
|
||||
fill-opacity: 0.2 !important;
|
||||
marker-end: url(#sequenceflow-end-_E7DFDF-_E7DFDF-803g1kf6zwzmcig1y2ulm5egr);
|
||||
}
|
||||
|
||||
:deep(.highlight-back.djs-shape .djs-visual > :nth-child(1)) {
|
||||
fill: #FFBA00 !important;
|
||||
stroke: #FFBA00 !important;
|
||||
stroke-dasharray: 4px !important;
|
||||
fill-opacity: 0.2 !important;
|
||||
}
|
||||
.element-overlays {
|
||||
box-sizing: border-box;
|
||||
padding: 8px;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="el-icon-picture-outline">审批任务【{{ item.name }}】</span>
|
||||
</div>
|
||||
<el-col :span="16" :offset="6" >
|
||||
<el-col :span="16" :offset="6">
|
||||
<el-form :ref="'form' + index" :model="auditForms[index]" :rules="auditRule" label-width="100px">
|
||||
<el-form-item label="流程名" v-if="processInstance && processInstance.name">
|
||||
{{ processInstance.name }}
|
||||
@ -15,15 +15,20 @@
|
||||
<el-tag type="info" size="mini">{{ processInstance.startUser.deptName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批建议" prop="reason">
|
||||
<el-input type="textarea" v-model="auditForms[index].reason" placeholder="请输入审批建议" />
|
||||
<el-input type="textarea" v-model="auditForms[index].reason" placeholder="请输入审批建议"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px;">
|
||||
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(item, true)">通过</el-button>
|
||||
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(item, false)">不通过</el-button>
|
||||
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleUpdateAssignee(item)">转办</el-button>
|
||||
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate(item)">委派</el-button>
|
||||
<el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleBack(item)">退回</el-button>
|
||||
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(item, true)">通过
|
||||
</el-button>
|
||||
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(item, false)">不通过
|
||||
</el-button>
|
||||
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleUpdateAssignee(item)">转办
|
||||
</el-button>
|
||||
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate(item)">委派
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleBackList(item)">退回
|
||||
</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
@ -34,8 +39,8 @@
|
||||
</div>
|
||||
<el-col v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 10"
|
||||
:span="16" :offset="6">
|
||||
<div >
|
||||
<parser :key="new Date().getTime()" :form-conf="detailForm" />
|
||||
<div>
|
||||
<parser :key="new Date().getTime()" :form-conf="detailForm"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<div v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 20">
|
||||
@ -48,7 +53,7 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="el-icon-picture-outline">审批记录</span>
|
||||
</div>
|
||||
<el-col :span="16" :offset="4" >
|
||||
<el-col :span="16" :offset="4">
|
||||
<div class="block">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(item, index) in tasks" :key="index"
|
||||
@ -62,9 +67,12 @@
|
||||
<label style="font-weight: normal" v-if="item.createTime">创建时间:</label>
|
||||
<label style="color:#8a909c; font-weight: normal">{{ parseTime(item.createTime) }}</label>
|
||||
<label v-if="item.endTime" style="margin-left: 30px;font-weight: normal">审批时间:</label>
|
||||
<label v-if="item.endTime" style="color:#8a909c;font-weight: normal"> {{ parseTime(item.endTime) }}</label>
|
||||
<label v-if="item.endTime" style="color:#8a909c;font-weight: normal"> {{
|
||||
parseTime(item.endTime)
|
||||
}}</label>
|
||||
<label v-if="item.durationInMillis" style="margin-left: 30px;font-weight: normal">耗时:</label>
|
||||
<label v-if="item.durationInMillis" style="color:#8a909c;font-weight: normal"> {{ getDateStar(item.durationInMillis) }} </label>
|
||||
<label v-if="item.durationInMillis" style="color:#8a909c;font-weight: normal">
|
||||
{{ getDateStar(item.durationInMillis) }} </label>
|
||||
<p v-if="item.reason">
|
||||
<el-tag :type="getTimelineItemType(item)">{{ item.reason }}</el-tag>
|
||||
</p>
|
||||
@ -81,15 +89,16 @@
|
||||
<span class="el-icon-picture-outline">流程图</span>
|
||||
</div>
|
||||
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" :activityData="activityList"
|
||||
:processInstanceData="processInstance" :taskData="tasks" />
|
||||
:processInstanceData="processInstance" :taskData="tasks"/>
|
||||
</el-card>
|
||||
|
||||
<!-- 对话框(转派审批人) -->
|
||||
<el-dialog title="转派审批人" :visible.sync="updateAssignee.open" width="500px" append-to-body>
|
||||
<!-- 对话框(转办审批人) -->
|
||||
<el-dialog title="转办审批人" :visible.sync="updateAssignee.open" width="500px" append-to-body>
|
||||
<el-form ref="updateAssigneeForm" :model="updateAssignee.form" :rules="updateAssignee.rules" label-width="110px">
|
||||
<el-form-item label="新审批人" prop="assigneeUserId">
|
||||
<el-select v-model="updateAssignee.form.assigneeUserId" clearable style="width: 100%">
|
||||
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname" :value="parseInt(item.id)" />
|
||||
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname"
|
||||
:value="parseInt(item.id)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -98,17 +107,64 @@
|
||||
<el-button @click="cancelUpdateAssigneeForm">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 对话框(委派审批人) -->
|
||||
<el-dialog title="委派审批人" :visible.sync="updateDelegate.open" width="500px" append-to-body>
|
||||
<el-form ref="updateDelegateForm" :model="updateDelegate.form" :rules="updateDelegate.rules" label-width="110px">
|
||||
<el-form-item label="新审批人" prop="assigneeUserId">
|
||||
<el-select v-model="updateDelegate.form.delegateUserId" clearable style="width: 100%">
|
||||
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname"
|
||||
:value="parseInt(item.id)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="委派理由" prop="reason">
|
||||
<el-input v-model="updateDelegate.form.reason" clearable placeholder="请输入委派理由"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitUpdateDelegateForm">确 定</el-button>
|
||||
<el-button @click="cancelUpdateDelegateForm">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--退回流程-->
|
||||
<el-dialog title="退回流程" :visible.sync="returnOpen" width="40%" append-to-body>
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="110px">
|
||||
<el-form-item label="退回节点" prop="targetDefinitionKey">
|
||||
<el-select v-model="formData.targetDefinitionKey" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in returnList"
|
||||
:key="item.definitionKey"
|
||||
:label="item.name"
|
||||
:value="item.definitionKey"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回退理由" prop="reason">
|
||||
<el-input v-model="formData.reason" clearable placeholder="请输入回退理由"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="returnOpen = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitReturn">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import store from "@/store";
|
||||
import {decodeFields} from "@/utils/formGenerator";
|
||||
import Parser from '@/components/parser/Parser'
|
||||
import {getProcessInstance} from "@/api/bpm/processInstance";
|
||||
import {approveTask, getTaskListByProcessInstanceId, rejectTask, updateTaskAssignee} from "@/api/bpm/task";
|
||||
import {
|
||||
approveTask,
|
||||
delegateTask,
|
||||
getReturnList,
|
||||
getTaskListByProcessInstanceId,
|
||||
rejectTask,
|
||||
returnTask,
|
||||
updateTaskAssignee,
|
||||
} from "@/api/bpm/task";
|
||||
import {getDate} from "@/utils/dateUtils";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
import {getActivityList} from "@/api/bpm/activity";
|
||||
@ -127,12 +183,23 @@ export default {
|
||||
// 流程实例
|
||||
id: undefined, // 流程实例的编号
|
||||
processInstance: {},
|
||||
|
||||
formLoading: false,
|
||||
// 流程表单详情
|
||||
detailForm: {
|
||||
fields: []
|
||||
},
|
||||
|
||||
//回退列表数据
|
||||
returnList: [],
|
||||
formData: {
|
||||
id: '',
|
||||
targetDefinitionKey: undefined,
|
||||
reason: ''
|
||||
},
|
||||
formRules: {
|
||||
targetDefinitionKey: [{required: true, message: '必须选择回退节点', trigger: 'change'}],
|
||||
reason: [{required: true, message: '回退理由不能为空', trigger: 'blur'}]
|
||||
},
|
||||
returnOpen: false,
|
||||
// BPMN 数据
|
||||
bpmnXML: null,
|
||||
bpmnControlForm: {
|
||||
@ -148,9 +215,8 @@ export default {
|
||||
runningTasks: [],
|
||||
auditForms: [],
|
||||
auditRule: {
|
||||
reason: [{ required: true, message: "审批建议不能为空", trigger: "blur" }],
|
||||
reason: [{required: true, message: "审批建议不能为空", trigger: "blur"}],
|
||||
},
|
||||
|
||||
// 转派审批人
|
||||
userOptions: [],
|
||||
updateAssignee: {
|
||||
@ -159,7 +225,18 @@ export default {
|
||||
assigneeUserId: undefined,
|
||||
},
|
||||
rules: {
|
||||
assigneeUserId: [{ required: true, message: "新审批人不能为空", trigger: "change" }],
|
||||
assigneeUserId: [{required: true, message: "新审批人不能为空", trigger: "change"}],
|
||||
}
|
||||
},
|
||||
updateDelegate: {
|
||||
open: false,
|
||||
form: {
|
||||
delegateUserId: undefined,
|
||||
reason: ''
|
||||
},
|
||||
rules: {
|
||||
delegateUserId: [{required: true, message: "新审批人不能为空", trigger: "change"}],
|
||||
reason: [{required: true, message: '委派理由不能为空', trigger: 'blur'}]
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -193,7 +270,7 @@ export default {
|
||||
|
||||
//将业务表单,注册为动态组件
|
||||
const path = this.processInstance.processDefinition.formCustomViewPath;
|
||||
Vue.component("async-biz-form-component", function(resolve) {
|
||||
Vue.component("async-biz-form-component", function (resolve) {
|
||||
require([`@/views${path}`], resolve);
|
||||
});
|
||||
|
||||
@ -260,7 +337,7 @@ export default {
|
||||
// 需要审核的记录
|
||||
const userId = store.getters.userId;
|
||||
this.tasks.forEach(task => {
|
||||
if (task.result !== 1) { // 只有待处理才需要
|
||||
if (task.result !== 1 && task.result !== 6) { // 只有待处理才需要
|
||||
return;
|
||||
}
|
||||
if (!task.assigneeUser || task.assigneeUser.id !== userId) { // 自己不是处理人
|
||||
@ -292,6 +369,9 @@ export default {
|
||||
if (item.result === 4) {
|
||||
return 'el-icon-remove-outline';
|
||||
}
|
||||
if (item.result === 5) {
|
||||
return 'el-icon-back'
|
||||
}
|
||||
return '';
|
||||
},
|
||||
getTimelineItemType(item) {
|
||||
@ -307,6 +387,12 @@ export default {
|
||||
if (item.result === 4) {
|
||||
return 'info';
|
||||
}
|
||||
if (item.result === 5) {
|
||||
return 'warning';
|
||||
}
|
||||
if (item.result === 6) {
|
||||
return 'default'
|
||||
}
|
||||
return '';
|
||||
},
|
||||
/** 处理审批通过和不通过的操作 */
|
||||
@ -333,7 +419,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 处理转派审批人 */
|
||||
/** 处理转办审批人 */
|
||||
handleUpdateAssignee(task) {
|
||||
// 设置表单
|
||||
this.resetUpdateAssigneeForm();
|
||||
@ -341,25 +427,25 @@ export default {
|
||||
// 设置为打开
|
||||
this.updateAssignee.open = true;
|
||||
},
|
||||
/** 提交转派审批人 */
|
||||
/** 提交转办审批人 */
|
||||
submitUpdateAssigneeForm() {
|
||||
this.$refs['updateAssigneeForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
updateTaskAssignee(this.updateAssignee.form).then(response => {
|
||||
this.$modal.msgSuccess("转派任务成功!");
|
||||
this.$modal.msgSuccess("转办任务成功!");
|
||||
this.updateAssignee.open = false;
|
||||
this.getDetail(); // 获得最新详情
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 取消转派审批人 */
|
||||
/** 取消转办审批人 */
|
||||
cancelUpdateAssigneeForm() {
|
||||
this.updateAssignee.open = false;
|
||||
this.resetUpdateAssigneeForm();
|
||||
},
|
||||
/** 重置转派审批人 */
|
||||
/** 重置转办审批人 */
|
||||
resetUpdateAssigneeForm() {
|
||||
this.updateAssignee.form = {
|
||||
id: undefined,
|
||||
@ -367,22 +453,72 @@ export default {
|
||||
};
|
||||
this.resetForm("updateAssigneeForm");
|
||||
},
|
||||
/** 处理审批退回的操作 */
|
||||
/** 处理审批委派的操作 */
|
||||
handleDelegate(task) {
|
||||
this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
|
||||
//this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
|
||||
this.resetUpdateDelegateForm();
|
||||
this.updateDelegate.form.id = task.id;
|
||||
// 设置为打开
|
||||
this.updateDelegate.open = true;
|
||||
},
|
||||
/** 提交委派审批人 */
|
||||
submitUpdateDelegateForm() {
|
||||
this.$refs['updateDelegateForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
delegateTask(this.updateDelegate.form).then(response => {
|
||||
this.$modal.msgSuccess("委派任务成功!");
|
||||
this.updateDelegate.open = false;
|
||||
this.getDetail(); // 获得最新详情
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 取消委派审批人 */
|
||||
cancelUpdateDelegateForm() {
|
||||
this.updateDelegate.open = false;
|
||||
this.resetUpdateDelegateForm();
|
||||
},
|
||||
/** 重置委派审批人 */
|
||||
resetUpdateDelegateForm() {
|
||||
this.updateDelegate.form = {
|
||||
id: undefined,
|
||||
delegateUserId: undefined,
|
||||
};
|
||||
this.resetForm("updateDelegateForm");
|
||||
},
|
||||
/** 处理审批退回的操作 */
|
||||
handleBack(task) {
|
||||
this.$modal.msgError("暂不支持【退回】功能!");
|
||||
/** 返回退回节点列表 */
|
||||
handleBackList(task) {
|
||||
// 可参考 http://blog.wya1.com/article/636697030/details/7296
|
||||
// const data = {
|
||||
// id: task.id,
|
||||
// assigneeUserId: 1
|
||||
// }
|
||||
// backTask(data).then(response => {
|
||||
// this.$modal.msgSuccess("回退成功!");
|
||||
// this.getDetail(); // 获得最新详情
|
||||
// });
|
||||
getReturnList(task.id).then(response => {
|
||||
this.returnList = response.data;
|
||||
if (this.returnList.length == 0) {
|
||||
this.$modal.msgError("当前没有可回退的节点!");
|
||||
return;
|
||||
}
|
||||
this.formData.id = task.id;
|
||||
this.returnOpen = true;
|
||||
});
|
||||
|
||||
},
|
||||
/** 提交退回任务 */
|
||||
submitReturn() {
|
||||
if (!this.formData.targetDefinitionKey) {
|
||||
this.$modal.msgError("请选择退回节点!");
|
||||
}
|
||||
this.$refs['formRef'].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
returnTask(this.formData).then(res => {
|
||||
if (res.data) {
|
||||
this.$modal.msgSuccess("回退成功!");
|
||||
this.returnOpen = false;
|
||||
this.getDetail();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,12 +3,12 @@
|
||||
<doc-alert title="系统日志" url="https://doc.iocoder.cn/system-log/" />
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="系统模块" prop="title">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入系统模块" clearable style="width: 240px;"
|
||||
<el-form-item label="系统模块" prop="module">
|
||||
<el-input v-model="queryParams.module" placeholder="请输入系统模块" clearable style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员" prop="operName">
|
||||
<el-input v-model="queryParams.operName" placeholder="请输入操作人员" clearable style="width: 240px;"
|
||||
<el-form-item label="操作人员" prop="userNickname">
|
||||
<el-input v-model="queryParams.userNickname" placeholder="请输入操作人员" clearable style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
@ -154,8 +154,8 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
operName: undefined,
|
||||
module: undefined,
|
||||
userNickname: undefined,
|
||||
businessType: undefined,
|
||||
status: undefined,
|
||||
startTime: []
|
||||
|