diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CreditScoreItem.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CreditScoreItem.java index d6b6c43..98b27ba 100644 --- a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CreditScoreItem.java +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CreditScoreItem.java @@ -34,6 +34,7 @@ import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; import java.io.Serial; +import java.math.BigDecimal; /** * 评分项目实体类 @@ -71,6 +72,11 @@ public class CreditScoreItem extends TenantEntity { */ @Schema(description = "评分项目") private String itemName; + /** + * 分值 + */ + @Schema(description = "分值") + private BigDecimal score; /** * 得分说明 */ diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CreditScoreQuantificationVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CreditScoreQuantificationVO.java index 5fbc1e7..9c8c074 100644 --- a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CreditScoreQuantificationVO.java +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CreditScoreQuantificationVO.java @@ -60,6 +60,10 @@ public class CreditScoreQuantificationVO extends CreditScoreQuantification { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTimeEnd; + @TableField(exist = false) + @Schema(description = "创建人姓名") + private String createUserName; + @TableField(exist = false) @Schema(description = "评分分类") private List categories = new ArrayList<>(); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CargoTypeExportExcel.java b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CargoTypeExportExcel.java index 8b4f0eb..999bbde 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CargoTypeExportExcel.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CargoTypeExportExcel.java @@ -48,19 +48,16 @@ public class CargoTypeExportExcel implements Serializable { @Serial private static final long serialVersionUID = 1L; - @ExcelProperty("类型") - private String typeLevelName; - - @ExcelProperty("货物类型") + @ExcelProperty("*货物类型") private String cargoName; - @ExcelProperty("货物类型编码") + @ExcelProperty("*货物类型编码") private String cargoCode; - @ExcelProperty("上级货物类型") + @ExcelProperty("*上级货物类型") private String parentCargoName; - @ExcelProperty("上级货物类型编码") + @ExcelProperty("*上级货物类型编码") private String parentCargoCode; @ExcelProperty("创建人") diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CargoTypeServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CargoTypeServiceImpl.java index f219447..3cc6fb2 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CargoTypeServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CargoTypeServiceImpl.java @@ -343,7 +343,6 @@ public class CargoTypeServiceImpl extends BaseServiceImpl implements IR } role.setIsDeleted(BladeConstant.DB_NOT_DELETED); if (Func.isEmpty(role.getTenantId())) { - throw new ServiceException("租户ID不能为空"); + if (AuthUtil.isAdministrator()) { + role.setTenantId(BladeConstant.ADMIN_TENANT_ID); + } else { + throw new ServiceException("会话租户不可识别,拒绝创建角色"); + } } return saveOrUpdate(role); } diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CommonRouteController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CommonRouteController.java index 4fa91fa..7ca3e91 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CommonRouteController.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CommonRouteController.java @@ -37,7 +37,9 @@ import org.springblade.core.secure.annotation.PreAuth; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.common.excel.ImportFailureExcelUtil; import org.springblade.transport.excel.CommonRouteExcel; +import org.springblade.transport.excel.CommonRouteImportExcel; import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; import org.springblade.transport.pojo.vo.CommonRouteVO; @@ -48,6 +50,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; import java.util.ArrayList; import java.util.List; @@ -102,4 +105,31 @@ public class CommonRouteController extends BladeController { ExcelUtil.export(response, "常用线路" + DateUtil.time(), "常用线路", list, CommonRouteExcel.class); } + @PostMapping("/import-common-route") + @ApiOperationSupport(order = 6) + @Operation(summary = "导入常用线路", description = "传入excel") + public R importCommonRoute(MultipartFile file, HttpServletResponse response) { + List failureList = commonRouteService.importCommonRoute( + ExcelUtil.read(file, CommonRouteImportExcel.class) + ); + if (Func.isNotEmpty(failureList)) { + ImportFailureExcelUtil.export( + response, + "常用线路导入失败明细" + DateUtil.time(), + "导入失败明细", + failureList, + CommonRouteImportExcel.class + ); + return null; + } + return R.success("导入数据成功"); + } + + @GetMapping("/export-template") + @ApiOperationSupport(order = 7) + @Operation(summary = "导出导入模板") + public void exportTemplate(HttpServletResponse response) { + ExcelUtil.export(response, "常用线路模板", "常用线路导入模板", new ArrayList(), CommonRouteImportExcel.class); + } + } diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java index de082a0..ea24b0d 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java @@ -109,11 +109,21 @@ public class CustomerArchiveController extends BladeController { return R.status(customerArchiveService.submitApproval(id)); } + /** + * 撤回审批 + */ + @PostMapping("/withdraw-approval") + @ApiOperationSupport(order = 5) + @Operation(summary = "撤回审批", description = "传入id") + public R withdrawApproval(@Parameter(description = "主键", required = true) @RequestParam Long id) { + return R.status(customerArchiveService.withdrawApproval(id)); + } + /** * 审核通过 */ @PostMapping("/approve") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @Operation(summary = "审核通过", description = "传入id") public R approve(@Parameter(description = "主键", required = true) @RequestParam Long id) { return R.status(customerArchiveService.approve(id)); @@ -123,7 +133,7 @@ public class CustomerArchiveController extends BladeController { * 审核不通过 */ @PostMapping("/reject") - @ApiOperationSupport(order = 6) + @ApiOperationSupport(order = 7) @Operation(summary = "审核不通过", description = "传入id") public R reject(@Parameter(description = "主键", required = true) @RequestParam Long id) { return R.status(customerArchiveService.reject(id)); @@ -133,7 +143,7 @@ public class CustomerArchiveController extends BladeController { * 启用或停用 */ @PostMapping("/status") - @ApiOperationSupport(order = 7) + @ApiOperationSupport(order = 8) @Operation(summary = "启用或停用", description = "传入id和status") public R status(@Parameter(description = "主键", required = true) @RequestParam Long id, @Parameter(description = "状态", required = true) @RequestParam Integer status) { @@ -144,7 +154,7 @@ public class CustomerArchiveController extends BladeController { * 删除 */ @PostMapping("/remove") - @ApiOperationSupport(order = 8) + @ApiOperationSupport(order = 9) @Operation(summary = "逻辑删除", description = "传入ids") public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { return R.status(customerArchiveService.removeDraft(ids)); @@ -154,7 +164,7 @@ public class CustomerArchiveController extends BladeController { * 评分明细模板 */ @GetMapping("/score-template") - @ApiOperationSupport(order = 9) + @ApiOperationSupport(order = 10) @Operation(summary = "评分明细模板", description = "传入评分量化表ID") public R scoreTemplate(@RequestParam(required = false) Long quantificationId) { return R.data(customerArchiveService.buildScoreTemplate(quantificationId)); @@ -164,7 +174,7 @@ public class CustomerArchiveController extends BladeController { * 导出客商档案 */ @GetMapping("/export-customer-archive") - @ApiOperationSupport(order = 10) + @ApiOperationSupport(order = 11) @Operation(summary = "导出客商档案") public void exportCustomerArchive(CustomerArchiveVO customerArchive, @RequestParam(required = false) String ids, diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonCargoExportExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonCargoExportExcel.java index f250671..b9bf5e6 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonCargoExportExcel.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonCargoExportExcel.java @@ -49,65 +49,56 @@ public class CommonCargoExportExcel implements Serializable { @Serial private static final long serialVersionUID = 1L; - @ExcelProperty("一级货物类型") - private String firstCargoTypeName; - - @ExcelProperty("二级货物类型编码") - private String secondCargoTypeCode; - @ExcelProperty("货物名称") private String cargoName; @ExcelProperty("货物编号") private String cargoCode; - @ExcelProperty("货物编号后缀") - private String cargoCodeSuffix; + @ExcelProperty("一级货物类型") + private String firstCargoTypeName; - @ExcelProperty("品牌") - private String brand; + @ExcelProperty("二级货物类型") + private String secondCargoTypeName; - @ExcelProperty("包装") - private String packageType; + @ExcelProperty("二级货物类型编码") + private String secondCargoTypeCode; + + @ExcelProperty("包装品牌") + private String packageBrand; + + @ExcelProperty("规格") + private String specification; + + @ExcelProperty("型号") + private String model; @ExcelProperty("单价") @NumberFormat("0.00") private BigDecimal cargoValue; - @ExcelProperty("规格") - private String specification; - @ExcelProperty("计价单位") private String priceUnit; - @ExcelProperty("型号") - private String model; - - @ExcelProperty("说明1") - private String descriptionOne; - @ExcelProperty("尺寸") private String sizeText; - @ExcelProperty("说明2") - private String descriptionTwo; + @ExcelProperty("其他说明1") + private String descriptionOne; - @ExcelProperty("所属组织") - private String deptName; + @ExcelProperty("其他说明2") + private String descriptionTwo; @ExcelProperty("备注") private String remark; - @ExcelProperty("创建人") - private String createUserName; - - @ExcelProperty("更新人") - private String updateUserName; - - @ExcelProperty("创建时间") - private LocalDateTime createTime; + @ExcelProperty("组织") + private String deptName; @ExcelProperty("更新时间") private LocalDateTime updateTime; + @ExcelProperty("创建时间") + private LocalDateTime createTime; + } diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteExcel.java index 0841fed..31b2b76 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteExcel.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteExcel.java @@ -30,7 +30,6 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -55,10 +54,6 @@ public class CommonRouteExcel implements Serializable { private String departureName; @ExcelProperty("发货地址") private String departureAddress; - @ExcelProperty("发货经度") - private BigDecimal departureLongitude; - @ExcelProperty("发货纬度") - private BigDecimal departureLatitude; @ExcelProperty("发货联系人") private String departureContact; @ExcelProperty("发货联系方式") @@ -67,10 +62,6 @@ public class CommonRouteExcel implements Serializable { private String arrivalName; @ExcelProperty("收货地址") private String arrivalAddress; - @ExcelProperty("收货经度") - private BigDecimal arrivalLongitude; - @ExcelProperty("收货纬度") - private BigDecimal arrivalLatitude; @ExcelProperty("收货联系人") private String arrivalContact; @ExcelProperty("收货联系方式") diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteImportExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteImportExcel.java new file mode 100644 index 0000000..2da14c9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CommonRouteImportExcel.java @@ -0,0 +1,67 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + */ +package org.springblade.transport.excel; + +import cn.idev.excel.annotation.ExcelIgnore; +import cn.idev.excel.annotation.ExcelProperty; +import cn.idev.excel.annotation.write.style.ColumnWidth; +import cn.idev.excel.annotation.write.style.ContentRowHeight; +import cn.idev.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 常用线路导入 Excel + * + * @author Chill + */ +@Data +@ColumnWidth(24) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class CommonRouteImportExcel implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @ExcelProperty("*线路名称") + private String routeName; + + @ExcelProperty("*发货地") + private String departureName; + + @ExcelProperty("*发货地址") + private String departureAddress; + + @ExcelProperty("发货联系人") + private String departureContact; + + @ExcelProperty("发货联系方式") + private String departurePhone; + + @ExcelProperty("*收货地") + private String arrivalName; + + @ExcelProperty("*收货地址") + private String arrivalAddress; + + @ExcelProperty("收货联系人") + private String arrivalContact; + + @ExcelProperty("收货联系方式") + private String arrivalPhone; + + @ExcelProperty("备注") + private String remark; + + @ExcelIgnore + private String errorMessage; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java index 3db48f3..a18a875 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java @@ -54,19 +54,19 @@ public class CustomerArchiveExcel implements Serializable { @ExcelProperty("客商简称") private String shortName; - @ExcelProperty("客商名称") + @ExcelProperty("*客商名称") private String fullName; - @ExcelProperty("客商类型") + @ExcelProperty("*客商类型") private String customerType; - @ExcelProperty("客商性质") + @ExcelProperty("*客商性质") private String customerNature; - @ExcelProperty("统一信用代码") + @ExcelProperty("*统一信用代码") private String unifiedCreditCode; - @ExcelProperty("所属组织") + @ExcelProperty("*所属组织") private String deptName; @ExcelProperty("准入类型") @@ -96,10 +96,10 @@ public class CustomerArchiveExcel implements Serializable { @ExcelProperty("申请总资金使用额度(万元)") private BigDecimal applyCreditLimit; - @ExcelProperty("联系电话") + @ExcelProperty("*联系电话") private String contactPhone; - @ExcelProperty("法人/负责人") + @ExcelProperty("*法人/负责人") private String legalPerson; @ExcelProperty("创建时间") diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CreditScoreQuantificationMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CreditScoreQuantificationMapper.xml index ce0dd04..250cc9a 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CreditScoreQuantificationMapper.xml +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CreditScoreQuantificationMapper.xml @@ -8,6 +8,7 @@ + @@ -19,36 +20,38 @@ diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICommonRouteService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICommonRouteService.java index b0d6fd9..7f05d36 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICommonRouteService.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICommonRouteService.java @@ -25,6 +25,7 @@ package org.springblade.transport.service; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseService; import org.springblade.transport.excel.CommonRouteExcel; +import org.springblade.transport.excel.CommonRouteImportExcel; import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; import org.springblade.transport.pojo.vo.CommonRouteVO; @@ -43,5 +44,6 @@ public interface ICommonRouteService extends BaseService { boolean submit(CommonRoute commonRoute); BusinessRemoveResultVO removeCommonRoute(String ids); List exportCommonRoute(CommonRouteVO commonRoute, String ids); + List importCommonRoute(List data); } diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java index 54d05f8..ffabc83 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java @@ -72,6 +72,14 @@ public interface ICustomerArchiveService extends BaseService { */ boolean submitApproval(Long id); + /** + * 撤回审批并恢复草稿状态 + * + * @param id 主键 + * @return 是否成功 + */ + boolean withdrawApproval(Long id); + /** * 审核通过 * diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonCargoServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonCargoServiceImpl.java index 6ab127c..b76d98f 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonCargoServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonCargoServiceImpl.java @@ -29,7 +29,6 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; -import org.springblade.system.cache.UserCache; import org.springblade.system.pojo.entity.Dept; import org.springblade.transport.excel.CommonCargoExcel; import org.springblade.transport.excel.CommonCargoExportExcel; @@ -116,8 +115,10 @@ public class CommonCargoServiceImpl extends BaseServiceImpl { CommonCargoExportExcel excel = new CommonCargoExportExcel(); BeanUtil.copyProperties(record, excel); - excel.setCreateUserName(UserCache.getUserRealName(record.getCreateUser())); - excel.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser())); + excel.setPackageBrand(String.join(" / ", List.of( + Func.isEmpty(record.getPackageType()) ? "" : record.getPackageType(), + Func.isEmpty(record.getBrand()) ? "" : record.getBrand() + ).stream().filter(value -> !value.isEmpty()).toList())); return excel; }).toList(); } diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonRouteServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonRouteServiceImpl.java index dd27cd6..b808705 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonRouteServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CommonRouteServiceImpl.java @@ -32,6 +32,7 @@ import org.springblade.core.tool.utils.Func; import org.springblade.system.cache.UserCache; import org.springblade.system.pojo.entity.Dept; import org.springblade.transport.excel.CommonRouteExcel; +import org.springblade.transport.excel.CommonRouteImportExcel; import org.springblade.transport.mapper.CommonRouteMapper; import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; @@ -123,6 +124,27 @@ public class CommonRouteServiceImpl extends BaseServiceImpl importCommonRoute(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List failureList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + CommonRouteImportExcel excel = data.get(index); + try { + CommonRoute commonRoute = new CommonRoute(); + BeanUtil.copyProperties(excel, commonRoute); + submit(commonRoute); + } catch (Exception exception) { + excel.setErrorMessage("第" + (index + 2) + "行:" + exception.getMessage()); + failureList.add(excel); + } + } + return failureList; + } + private LambdaQueryWrapper buildQuery(CommonRouteVO commonRoute) { TransportBusinessSupport.validateAllDept(commonRoute.getAllDept(), "常用线路"); LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery().eq(CommonRoute::getIsDeleted, 0); @@ -195,6 +217,8 @@ public class CommonRouteServiceImpl extends BaseServiceImpl queryWrapper = Wrappers.lambdaQuery() + .eq(CommonRoute::getIsDeleted, 0) + .eq(CommonRoute::getDeptId, commonRoute.getDeptId()) + .eq(CommonRoute::getRouteName, commonRoute.getRouteName()); + if (Func.isNotEmpty(commonRoute.getId())) { + queryWrapper.ne(CommonRoute::getId, commonRoute.getId()); + } + if (count(queryWrapper) > 0) { + throw new ServiceException("线路名称已存在"); + } + } + + private void validateAddressCombinationUnique(CommonRoute commonRoute) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() + .eq(CommonRoute::getIsDeleted, 0) + .eq(CommonRoute::getDeptId, commonRoute.getDeptId()) + .eq(CommonRoute::getDepartureAddress, commonRoute.getDepartureAddress()) + .eq(CommonRoute::getArrivalAddress, commonRoute.getArrivalAddress()); + if (Func.isNotEmpty(commonRoute.getId())) { + queryWrapper.ne(CommonRoute::getId, commonRoute.getId()); + } + if (count(queryWrapper) > 0) { + throw new ServiceException("相同的发货地址和收货地址组合已存在"); + } + } + private CommonRoute loadEditable(Long id, boolean checkDept) { if (Func.isEmpty(id)) { throw new ServiceException("主键不能为空"); diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java index de58ee4..3131f4c 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java @@ -178,10 +178,8 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl list = listByIds(idList); - for (CreditScoreQuantification quantification : list) { - if (!Objects.equals(quantification.getStatus(), STATUS_DRAFT)) { - throw new ServiceException("仅草稿状态量表可删除"); - } + if (list.size() != idList.size()) { + throw new ServiceException("评分量化表不存在"); } deleteDetail(idList); return deleteLogic(idList); @@ -299,6 +297,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl()); @@ -348,6 +347,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl()); @@ -390,6 +390,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl