master:客户销售管理 批量删除功能调优;
parent
7c01d94d2c
commit
04962b0048
|
|
@ -6,10 +6,7 @@ import com.ruoyi.common.core.controller.XktBaseController;
|
|||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.StoreCusProdBatchDiscountVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.StoreCusProdDiscExistVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.StoreCusProdDiscPageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.StoreCusProdDiscountVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.*;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProd.StoreProdSkuResVO;
|
||||
import com.ruoyi.xkt.dto.storeCusProdDiscount.*;
|
||||
import com.ruoyi.xkt.service.IStoreCustomerProductDiscountService;
|
||||
|
|
@ -52,6 +49,14 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
return R.ok(storeCusProdDiscService.batchDiscount(BeanUtil.toBean(batchDiscVO, StoreCusProdBatchDiscountDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "客户销售管理 批量删除", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "客户销售管理 批量删除", businessType = BusinessType.UPDATE)
|
||||
@DeleteMapping("/batch")
|
||||
public R<Integer> batchDiscountDelete(@Validated @RequestBody StoreCusProdBatchDiscountDeleteVO batchDiscDeleteVO) {
|
||||
return R.ok(storeCusProdDiscService.batchDiscountDelete(BeanUtil.toBean(batchDiscDeleteVO, StoreCusProdBatchDiscountDeleteDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "查询客户销售管理列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口客户批量删除")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusProdBatchDiscountDeleteVO {
|
||||
|
||||
@NotNull(message = "ID列表不能为空!")
|
||||
@ApiModelProperty(value = "ID列表", required = true)
|
||||
private List<Long> storeCusProdDiscIdList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.dto.storeCusProdDiscount;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口客户批量删除")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusProdBatchDiscountDeleteDTO {
|
||||
|
||||
@ApiModelProperty(value = "ID列表")
|
||||
private List<Long> storeCusProdDiscIdList;
|
||||
|
||||
}
|
||||
|
|
@ -39,9 +39,18 @@ public interface IStoreCustomerProductDiscountService {
|
|||
|
||||
/**
|
||||
* 客户销售管理,新增客户优惠时,判断是否已存在优惠
|
||||
*
|
||||
* @param existDTO 优惠是否存在DTO
|
||||
* @return StoreCusProdDiscExistResDTO
|
||||
*/
|
||||
List<StoreCusProdDiscExistResDTO> discountExist(StoreCusProdDiscExistDTO existDTO);
|
||||
|
||||
/**
|
||||
* 批量优惠删除
|
||||
*
|
||||
* @param deleteDTO 删除优惠入参
|
||||
* @return Integer
|
||||
*/
|
||||
Integer batchDiscountDelete(StoreCusProdBatchDiscountDeleteDTO deleteDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,24 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
return existResList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户优惠
|
||||
* @param deleteDTO 删除优惠入参
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer batchDiscountDelete(StoreCusProdBatchDiscountDeleteDTO deleteDTO) {
|
||||
List<StoreCustomerProductDiscount> discList = this.cusProdDiscMapper.selectList(new LambdaQueryWrapper<StoreCustomerProductDiscount>()
|
||||
.in(StoreCustomerProductDiscount::getId, deleteDTO.getStoreCusProdDiscIdList())
|
||||
.eq(StoreCustomerProductDiscount::getDelFlag, Constants.UNDELETED));
|
||||
if (CollectionUtils.isEmpty(discList)) {
|
||||
return 0;
|
||||
}
|
||||
discList.forEach(x -> x.setDelFlag(Constants.DELETED));
|
||||
return this.cusProdDiscMapper.updateById(discList).size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口客户
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue