1、基础数据修复bug

2、客商模块修复bug
This commit is contained in:
2026-08-06 02:57:38 +08:00
parent 58726a675e
commit 28eb484a68
23 changed files with 294 additions and 90 deletions

View File

@@ -34,6 +34,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial; import java.io.Serial;
import java.math.BigDecimal;
/** /**
* 评分项目实体类 * 评分项目实体类
@@ -71,6 +72,11 @@ public class CreditScoreItem extends TenantEntity {
*/ */
@Schema(description = "评分项目") @Schema(description = "评分项目")
private String itemName; private String itemName;
/**
* 分值
*/
@Schema(description = "分值")
private BigDecimal score;
/** /**
* 得分说明 * 得分说明
*/ */

View File

@@ -60,6 +60,10 @@ public class CreditScoreQuantificationVO extends CreditScoreQuantification {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd; private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false) @TableField(exist = false)
@Schema(description = "评分分类") @Schema(description = "评分分类")
private List<CreditScoreCategoryVO> categories = new ArrayList<>(); private List<CreditScoreCategoryVO> categories = new ArrayList<>();

View File

@@ -48,19 +48,16 @@ public class CargoTypeExportExcel implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ExcelProperty("类型") @ExcelProperty("*货物类型")
private String typeLevelName;
@ExcelProperty("货物类型")
private String cargoName; private String cargoName;
@ExcelProperty("货物类型编码") @ExcelProperty("*货物类型编码")
private String cargoCode; private String cargoCode;
@ExcelProperty("上级货物类型") @ExcelProperty("*上级货物类型")
private String parentCargoName; private String parentCargoName;
@ExcelProperty("上级货物类型编码") @ExcelProperty("*上级货物类型编码")
private String parentCargoCode; private String parentCargoCode;
@ExcelProperty("创建人") @ExcelProperty("创建人")

View File

@@ -343,7 +343,6 @@ public class CargoTypeServiceImpl extends BaseServiceImpl<CargoTypeMapper, Cargo
private CargoTypeExportExcel toExportExcel(CargoType cargoType) { private CargoTypeExportExcel toExportExcel(CargoType cargoType) {
CargoTypeExportExcel excel = new CargoTypeExportExcel(); CargoTypeExportExcel excel = new CargoTypeExportExcel();
excel.setTypeLevelName(Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_ONE) ? "一级货物类型" : "二级货物类型");
excel.setCargoName(cargoType.getCargoName()); excel.setCargoName(cargoType.getCargoName());
excel.setCargoCode(cargoType.getCargoCode()); excel.setCargoCode(cargoType.getCargoCode());
excel.setParentCargoName("/"); excel.setParentCargoName("/");

View File

@@ -269,7 +269,11 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
} }
role.setIsDeleted(BladeConstant.DB_NOT_DELETED); role.setIsDeleted(BladeConstant.DB_NOT_DELETED);
if (Func.isEmpty(role.getTenantId())) { 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); return saveOrUpdate(role);
} }

View File

@@ -37,7 +37,9 @@ import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.common.excel.ImportFailureExcelUtil;
import org.springblade.transport.excel.CommonRouteExcel; import org.springblade.transport.excel.CommonRouteExcel;
import org.springblade.transport.excel.CommonRouteImportExcel;
import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.entity.CommonRoute;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.CommonRouteVO; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -102,4 +105,31 @@ public class CommonRouteController extends BladeController {
ExcelUtil.export(response, "常用线路" + DateUtil.time(), "常用线路", list, CommonRouteExcel.class); 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<CommonRouteImportExcel> 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>(), CommonRouteImportExcel.class);
}
} }

View File

@@ -109,11 +109,21 @@ public class CustomerArchiveController extends BladeController {
return R.status(customerArchiveService.submitApproval(id)); 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") @PostMapping("/approve")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 6)
@Operation(summary = "审核通过", description = "传入id") @Operation(summary = "审核通过", description = "传入id")
public R approve(@Parameter(description = "主键", required = true) @RequestParam Long id) { public R approve(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(customerArchiveService.approve(id)); return R.status(customerArchiveService.approve(id));
@@ -123,7 +133,7 @@ public class CustomerArchiveController extends BladeController {
* 审核不通过 * 审核不通过
*/ */
@PostMapping("/reject") @PostMapping("/reject")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 7)
@Operation(summary = "审核不通过", description = "传入id") @Operation(summary = "审核不通过", description = "传入id")
public R reject(@Parameter(description = "主键", required = true) @RequestParam Long id) { public R reject(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(customerArchiveService.reject(id)); return R.status(customerArchiveService.reject(id));
@@ -133,7 +143,7 @@ public class CustomerArchiveController extends BladeController {
* 启用或停用 * 启用或停用
*/ */
@PostMapping("/status") @PostMapping("/status")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 8)
@Operation(summary = "启用或停用", description = "传入id和status") @Operation(summary = "启用或停用", description = "传入id和status")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id, public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) { @Parameter(description = "状态", required = true) @RequestParam Integer status) {
@@ -144,7 +154,7 @@ public class CustomerArchiveController extends BladeController {
* 删除 * 删除
*/ */
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 9)
@Operation(summary = "逻辑删除", description = "传入ids") @Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(customerArchiveService.removeDraft(ids)); return R.status(customerArchiveService.removeDraft(ids));
@@ -154,7 +164,7 @@ public class CustomerArchiveController extends BladeController {
* 评分明细模板 * 评分明细模板
*/ */
@GetMapping("/score-template") @GetMapping("/score-template")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 10)
@Operation(summary = "评分明细模板", description = "传入评分量化表ID") @Operation(summary = "评分明细模板", description = "传入评分量化表ID")
public R<CustomerCreditScoreVO> scoreTemplate(@RequestParam(required = false) Long quantificationId) { public R<CustomerCreditScoreVO> scoreTemplate(@RequestParam(required = false) Long quantificationId) {
return R.data(customerArchiveService.buildScoreTemplate(quantificationId)); return R.data(customerArchiveService.buildScoreTemplate(quantificationId));
@@ -164,7 +174,7 @@ public class CustomerArchiveController extends BladeController {
* 导出客商档案 * 导出客商档案
*/ */
@GetMapping("/export-customer-archive") @GetMapping("/export-customer-archive")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 11)
@Operation(summary = "导出客商档案") @Operation(summary = "导出客商档案")
public void exportCustomerArchive(CustomerArchiveVO customerArchive, public void exportCustomerArchive(CustomerArchiveVO customerArchive,
@RequestParam(required = false) String ids, @RequestParam(required = false) String ids,

View File

@@ -49,65 +49,56 @@ public class CommonCargoExportExcel implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ExcelProperty("一级货物类型")
private String firstCargoTypeName;
@ExcelProperty("二级货物类型编码")
private String secondCargoTypeCode;
@ExcelProperty("货物名称") @ExcelProperty("货物名称")
private String cargoName; private String cargoName;
@ExcelProperty("货物编号") @ExcelProperty("货物编号")
private String cargoCode; private String cargoCode;
@ExcelProperty("货物编号后缀") @ExcelProperty("一级货物类型")
private String cargoCodeSuffix; private String firstCargoTypeName;
@ExcelProperty("品牌") @ExcelProperty("二级货物类型")
private String brand; private String secondCargoTypeName;
@ExcelProperty("包装") @ExcelProperty("二级货物类型编码")
private String packageType; private String secondCargoTypeCode;
@ExcelProperty("包装品牌")
private String packageBrand;
@ExcelProperty("规格")
private String specification;
@ExcelProperty("型号")
private String model;
@ExcelProperty("单价") @ExcelProperty("单价")
@NumberFormat("0.00") @NumberFormat("0.00")
private BigDecimal cargoValue; private BigDecimal cargoValue;
@ExcelProperty("规格")
private String specification;
@ExcelProperty("计价单位") @ExcelProperty("计价单位")
private String priceUnit; private String priceUnit;
@ExcelProperty("型号")
private String model;
@ExcelProperty("说明1")
private String descriptionOne;
@ExcelProperty("尺寸") @ExcelProperty("尺寸")
private String sizeText; private String sizeText;
@ExcelProperty("说明2") @ExcelProperty("其他说明1")
private String descriptionTwo; private String descriptionOne;
@ExcelProperty("所属组织") @ExcelProperty("其他说明2")
private String deptName; private String descriptionTwo;
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;
@ExcelProperty("创建人") @ExcelProperty("组织")
private String createUserName; private String deptName;
@ExcelProperty("更新人")
private String updateUserName;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("更新时间") @ExcelProperty("更新时间")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
} }

View File

@@ -30,7 +30,6 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@@ -55,10 +54,6 @@ public class CommonRouteExcel implements Serializable {
private String departureName; private String departureName;
@ExcelProperty("发货地址") @ExcelProperty("发货地址")
private String departureAddress; private String departureAddress;
@ExcelProperty("发货经度")
private BigDecimal departureLongitude;
@ExcelProperty("发货纬度")
private BigDecimal departureLatitude;
@ExcelProperty("发货联系人") @ExcelProperty("发货联系人")
private String departureContact; private String departureContact;
@ExcelProperty("发货联系方式") @ExcelProperty("发货联系方式")
@@ -67,10 +62,6 @@ public class CommonRouteExcel implements Serializable {
private String arrivalName; private String arrivalName;
@ExcelProperty("收货地址") @ExcelProperty("收货地址")
private String arrivalAddress; private String arrivalAddress;
@ExcelProperty("收货经度")
private BigDecimal arrivalLongitude;
@ExcelProperty("收货纬度")
private BigDecimal arrivalLatitude;
@ExcelProperty("收货联系人") @ExcelProperty("收货联系人")
private String arrivalContact; private String arrivalContact;
@ExcelProperty("收货联系方式") @ExcelProperty("收货联系方式")

View File

@@ -0,0 +1,67 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* 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;
}

View File

@@ -54,19 +54,19 @@ public class CustomerArchiveExcel implements Serializable {
@ExcelProperty("客商简称") @ExcelProperty("客商简称")
private String shortName; private String shortName;
@ExcelProperty("客商名称") @ExcelProperty("*客商名称")
private String fullName; private String fullName;
@ExcelProperty("客商类型") @ExcelProperty("*客商类型")
private String customerType; private String customerType;
@ExcelProperty("客商性质") @ExcelProperty("*客商性质")
private String customerNature; private String customerNature;
@ExcelProperty("统一信用代码") @ExcelProperty("*统一信用代码")
private String unifiedCreditCode; private String unifiedCreditCode;
@ExcelProperty("所属组织") @ExcelProperty("*所属组织")
private String deptName; private String deptName;
@ExcelProperty("准入类型") @ExcelProperty("准入类型")
@@ -96,10 +96,10 @@ public class CustomerArchiveExcel implements Serializable {
@ExcelProperty("申请总资金使用额度(万元)") @ExcelProperty("申请总资金使用额度(万元)")
private BigDecimal applyCreditLimit; private BigDecimal applyCreditLimit;
@ExcelProperty("联系电话") @ExcelProperty("*联系电话")
private String contactPhone; private String contactPhone;
@ExcelProperty("法人/负责人") @ExcelProperty("*法人/负责人")
private String legalPerson; private String legalPerson;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")

View File

@@ -8,6 +8,7 @@
<result column="create_user" property="createUser"/> <result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/> <result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
<result column="create_user_name" property="createUserName"/>
<result column="update_user" property="updateUser"/> <result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/> <result column="update_time" property="updateTime"/>
<result column="status" property="status"/> <result column="status" property="status"/>
@@ -19,36 +20,38 @@
<select id="selectCreditScoreQuantificationPage" resultMap="creditScoreQuantificationResultMap"> <select id="selectCreditScoreQuantificationPage" resultMap="creditScoreQuantificationResultMap">
SELECT SELECT
id, csq.id,
tenant_id, csq.tenant_id,
create_user, csq.create_user,
create_dept, csq.create_dept,
create_time, csq.create_time,
update_user, cu.real_name AS create_user_name,
update_time, csq.update_user,
status, csq.update_time,
is_deleted, csq.status,
name, csq.is_deleted,
remark, csq.name,
standard_description csq.remark,
csq.standard_description
FROM FROM
blade_credit_score_quantification blade_credit_score_quantification csq
LEFT JOIN blade_user cu ON cu.id = csq.create_user
WHERE WHERE
is_deleted = 0 csq.is_deleted = 0
<if test="quantification.name != null and quantification.name != ''"> <if test="quantification.name != null and quantification.name != ''">
<bind name="nameLike" value="'%' + quantification.name + '%'"/> <bind name="nameLike" value="'%' + quantification.name + '%'"/>
AND name LIKE #{nameLike} AND csq.name LIKE #{nameLike}
</if> </if>
<if test="quantification.status != null"> <if test="quantification.status != null">
AND status = #{quantification.status} AND csq.status = #{quantification.status}
</if> </if>
<if test="quantification.createTimeStart != null and quantification.createTimeStart != ''"> <if test="quantification.createTimeStart != null and quantification.createTimeStart != ''">
AND create_time &gt;= #{quantification.createTimeStart} AND csq.create_time &gt;= #{quantification.createTimeStart}
</if> </if>
<if test="quantification.createTimeEnd != null and quantification.createTimeEnd != ''"> <if test="quantification.createTimeEnd != null and quantification.createTimeEnd != ''">
AND create_time &lt;= #{quantification.createTimeEnd} AND csq.create_time &lt;= #{quantification.createTimeEnd}
</if> </if>
ORDER BY create_time DESC ORDER BY csq.create_time DESC
</select> </select>
</mapper> </mapper>

View File

@@ -25,6 +25,7 @@ package org.springblade.transport.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.transport.excel.CommonRouteExcel; import org.springblade.transport.excel.CommonRouteExcel;
import org.springblade.transport.excel.CommonRouteImportExcel;
import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.entity.CommonRoute;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.CommonRouteVO; import org.springblade.transport.pojo.vo.CommonRouteVO;
@@ -43,5 +44,6 @@ public interface ICommonRouteService extends BaseService<CommonRoute> {
boolean submit(CommonRoute commonRoute); boolean submit(CommonRoute commonRoute);
BusinessRemoveResultVO removeCommonRoute(String ids); BusinessRemoveResultVO removeCommonRoute(String ids);
List<CommonRouteExcel> exportCommonRoute(CommonRouteVO commonRoute, String ids); List<CommonRouteExcel> exportCommonRoute(CommonRouteVO commonRoute, String ids);
List<CommonRouteImportExcel> importCommonRoute(List<CommonRouteImportExcel> data);
} }

View File

@@ -72,6 +72,14 @@ public interface ICustomerArchiveService extends BaseService<CustomerArchive> {
*/ */
boolean submitApproval(Long id); boolean submitApproval(Long id);
/**
* 撤回审批并恢复草稿状态
*
* @param id 主键
* @return 是否成功
*/
boolean withdrawApproval(Long id);
/** /**
* 审核通过 * 审核通过
* *

View File

@@ -29,7 +29,6 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.Dept; import org.springblade.system.pojo.entity.Dept;
import org.springblade.transport.excel.CommonCargoExcel; import org.springblade.transport.excel.CommonCargoExcel;
import org.springblade.transport.excel.CommonCargoExportExcel; import org.springblade.transport.excel.CommonCargoExportExcel;
@@ -116,8 +115,10 @@ public class CommonCargoServiceImpl extends BaseServiceImpl<CommonCargoMapper, C
return list(queryWrapper).stream().map(record -> { return list(queryWrapper).stream().map(record -> {
CommonCargoExportExcel excel = new CommonCargoExportExcel(); CommonCargoExportExcel excel = new CommonCargoExportExcel();
BeanUtil.copyProperties(record, excel); BeanUtil.copyProperties(record, excel);
excel.setCreateUserName(UserCache.getUserRealName(record.getCreateUser())); excel.setPackageBrand(String.join(" / ", List.of(
excel.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser())); Func.isEmpty(record.getPackageType()) ? "" : record.getPackageType(),
Func.isEmpty(record.getBrand()) ? "" : record.getBrand()
).stream().filter(value -> !value.isEmpty()).toList()));
return excel; return excel;
}).toList(); }).toList();
} }

View File

@@ -32,6 +32,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache; import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.Dept; import org.springblade.system.pojo.entity.Dept;
import org.springblade.transport.excel.CommonRouteExcel; import org.springblade.transport.excel.CommonRouteExcel;
import org.springblade.transport.excel.CommonRouteImportExcel;
import org.springblade.transport.mapper.CommonRouteMapper; import org.springblade.transport.mapper.CommonRouteMapper;
import org.springblade.transport.pojo.entity.CommonRoute; import org.springblade.transport.pojo.entity.CommonRoute;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO; import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
@@ -123,6 +124,27 @@ public class CommonRouteServiceImpl extends BaseServiceImpl<CommonRouteMapper, C
}).toList(); }).toList();
} }
@Override
@Transactional(rollbackFor = Exception.class)
public List<CommonRouteImportExcel> importCommonRoute(List<CommonRouteImportExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<CommonRouteImportExcel> 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<CommonRoute> buildQuery(CommonRouteVO commonRoute) { private LambdaQueryWrapper<CommonRoute> buildQuery(CommonRouteVO commonRoute) {
TransportBusinessSupport.validateAllDept(commonRoute.getAllDept(), "常用线路"); TransportBusinessSupport.validateAllDept(commonRoute.getAllDept(), "常用线路");
LambdaQueryWrapper<CommonRoute> queryWrapper = Wrappers.<CommonRoute>lambdaQuery().eq(CommonRoute::getIsDeleted, 0); LambdaQueryWrapper<CommonRoute> queryWrapper = Wrappers.<CommonRoute>lambdaQuery().eq(CommonRoute::getIsDeleted, 0);
@@ -195,6 +217,8 @@ public class CommonRouteServiceImpl extends BaseServiceImpl<CommonRouteMapper, C
TransportBusinessSupport.validateRequired(commonRoute.getDepartureAddress(), "发货地址不能为空"); TransportBusinessSupport.validateRequired(commonRoute.getDepartureAddress(), "发货地址不能为空");
TransportBusinessSupport.validateRequired(commonRoute.getArrivalName(), "收货地不能为空"); TransportBusinessSupport.validateRequired(commonRoute.getArrivalName(), "收货地不能为空");
TransportBusinessSupport.validateRequired(commonRoute.getArrivalAddress(), "收货地址不能为空"); TransportBusinessSupport.validateRequired(commonRoute.getArrivalAddress(), "收货地址不能为空");
validateRouteNameUnique(commonRoute);
validateAddressCombinationUnique(commonRoute);
TransportBusinessSupport.validateLength(commonRoute.getRouteCode(), 255, "线路编号不能超过255字"); TransportBusinessSupport.validateLength(commonRoute.getRouteCode(), 255, "线路编号不能超过255字");
TransportBusinessSupport.validateLength(commonRoute.getRouteName(), 255, "线路名称不能超过255字"); TransportBusinessSupport.validateLength(commonRoute.getRouteName(), 255, "线路名称不能超过255字");
TransportBusinessSupport.validateLength(commonRoute.getDepartureName(), 255, "发货地不能超过255字"); TransportBusinessSupport.validateLength(commonRoute.getDepartureName(), 255, "发货地不能超过255字");
@@ -215,6 +239,33 @@ public class CommonRouteServiceImpl extends BaseServiceImpl<CommonRouteMapper, C
TransportBusinessSupport.validateCoordinate(commonRoute.getArrivalLatitude(), false); TransportBusinessSupport.validateCoordinate(commonRoute.getArrivalLatitude(), false);
} }
private void validateRouteNameUnique(CommonRoute commonRoute) {
LambdaQueryWrapper<CommonRoute> queryWrapper = Wrappers.<CommonRoute>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<CommonRoute> queryWrapper = Wrappers.<CommonRoute>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) { private CommonRoute loadEditable(Long id, boolean checkDept) {
if (Func.isEmpty(id)) { if (Func.isEmpty(id)) {
throw new ServiceException("主键不能为空"); throw new ServiceException("主键不能为空");

View File

@@ -178,10 +178,8 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl<Credit
throw new ServiceException("请选择需要删除的数据"); throw new ServiceException("请选择需要删除的数据");
} }
List<CreditScoreQuantification> list = listByIds(idList); List<CreditScoreQuantification> list = listByIds(idList);
for (CreditScoreQuantification quantification : list) { if (list.size() != idList.size()) {
if (!Objects.equals(quantification.getStatus(), STATUS_DRAFT)) { throw new ServiceException("评分量化表不存在");
throw new ServiceException("仅草稿状态量表可删除");
}
} }
deleteDetail(idList); deleteDetail(idList);
return deleteLogic(idList); return deleteLogic(idList);
@@ -299,6 +297,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl<Credit
CreditScoreCategoryVO category = findCategory(quantification.getCategories(), row.getCategoryName()); CreditScoreCategoryVO category = findCategory(quantification.getCategories(), row.getCategoryName());
CreditScoreItemVO item = new CreditScoreItemVO(); CreditScoreItemVO item = new CreditScoreItemVO();
item.setItemName(trimToEmpty(row.getItemName())); item.setItemName(trimToEmpty(row.getItemName()));
item.setScore(row.getScore());
item.setScoreDescription(trimToNull(row.getScoreDescription())); item.setScoreDescription(trimToNull(row.getScoreDescription()));
item.setOptionDescription(trimToNull(row.getOptionDescription())); item.setOptionDescription(trimToNull(row.getOptionDescription()));
item.setOptions(new ArrayList<>()); item.setOptions(new ArrayList<>());
@@ -348,6 +347,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl<Credit
} }
item = new CreditScoreItemVO(); item = new CreditScoreItemVO();
item.setItemName(itemName); item.setItemName(itemName);
item.setScore(row.getScore());
item.setScoreDescription(trimToNull(row.getScoreDescription())); item.setScoreDescription(trimToNull(row.getScoreDescription()));
item.setOptionDescription(trimToNull(row.getOptionDescription())); item.setOptionDescription(trimToNull(row.getOptionDescription()));
item.setOptions(new ArrayList<>()); item.setOptions(new ArrayList<>());
@@ -390,6 +390,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl<Credit
excel.setRowType(ROW_TYPE_ITEM); excel.setRowType(ROW_TYPE_ITEM);
excel.setCategoryName(category.getCategoryName()); excel.setCategoryName(category.getCategoryName());
excel.setItemName(item.getItemName()); excel.setItemName(item.getItemName());
excel.setScore(item.getScore());
excel.setScoreDescription(item.getScoreDescription()); excel.setScoreDescription(item.getScoreDescription());
excel.setOptionDescription(item.getOptionDescription()); excel.setOptionDescription(item.getOptionDescription());
return excel; return excel;
@@ -482,6 +483,10 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl<Credit
validateLength(item.getItemName(), ITEM_NAME_MAX_LENGTH, "评分项目最多20汉字"); validateLength(item.getItemName(), ITEM_NAME_MAX_LENGTH, "评分项目最多20汉字");
validateLength(item.getScoreDescription(), SCORE_DESCRIPTION_MAX_LENGTH, "得分说明最多300字符"); validateLength(item.getScoreDescription(), SCORE_DESCRIPTION_MAX_LENGTH, "得分说明最多300字符");
validateLength(item.getOptionDescription(), OPTION_NAME_MAX_LENGTH, "选项描述最多100字符"); validateLength(item.getOptionDescription(), OPTION_NAME_MAX_LENGTH, "选项描述最多100字符");
if (Func.isEmpty(item.getScore())) {
throw new ServiceException(item.getItemName() + "分值不能为空");
}
validateNonNegative(item.getScore(), item.getItemName() + "分值不能小于0");
if (!itemNames.add(item.getItemName())) { if (!itemNames.add(item.getItemName())) {
throw new ServiceException(category.getCategoryName() + "下评分项目名称不能重复"); throw new ServiceException(category.getCategoryName() + "下评分项目名称不能重复");
} }

View File

@@ -169,6 +169,25 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
return updateById(update); return updateById(update);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public boolean withdrawApproval(Long id) {
CustomerArchive customer = getById(id);
if (Func.isEmpty(customer) || Objects.equals(customer.getIsDeleted(), 1)) {
throw new ServiceException("客商档案不存在");
}
if (!List.of(APPROVAL_DRAFT, APPROVAL_REVIEWING).contains(customer.getApprovalStatus())) {
throw new ServiceException("仅未审核或审核中状态客商可撤回");
}
CustomerArchive update = new CustomerArchive();
update.setId(id);
update.setApprovalStatus(APPROVAL_DRAFT);
update.setCurrentNode("草稿");
update.setCurrentProcessor(AuthUtil.getUserName());
addChangeRecord(id, "撤回客商准入审批");
return updateById(update);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean approve(Long id) { public boolean approve(Long id) {
@@ -178,6 +197,7 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
validateApproval(detail); validateApproval(detail);
CustomerArchive update = new CustomerArchive(); CustomerArchive update = new CustomerArchive();
update.setId(id); update.setId(id);
update.setAccessType(ACCESS_FORMAL);
update.setApprovalStatus(APPROVAL_APPROVED); update.setApprovalStatus(APPROVAL_APPROVED);
update.setCurrentNode("审核通过"); update.setCurrentNode("审核通过");
update.setCurrentProcessor(AuthUtil.getUserName()); update.setCurrentProcessor(AuthUtil.getUserName());

View File

@@ -13,6 +13,10 @@ server:
#spring配置 #spring配置
spring: spring:
servlet:
multipart:
max-file-size: 500MB
max-request-size: 512MB
cloud: cloud:
nacos: nacos:
discovery: discovery:

View File

@@ -0,0 +1,6 @@
-- 常用线路导入与模板下载权限增量
INSERT IGNORE INTO `blade_menu`
(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`)
VALUES
(2090000000000000106, 2090000000000000100, 'common_route_import', '批量导入', 'common_route_import', '', '', 6, 2, 0, 1, NULL, '', 0),
(2090000000000000107, 2090000000000000100, 'common_route_template', '下载模板', 'common_route_template', '', '', 7, 2, 0, 1, NULL, '', 0);

View File

@@ -0,0 +1,2 @@
ALTER TABLE `blade_credit_score_item`
ADD COLUMN `score` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '分值' AFTER `item_name`;

View File

@@ -54,6 +54,7 @@ CREATE TABLE `blade_credit_score_item` (
`category_id` bigint NOT NULL COMMENT '评分分类ID', `category_id` bigint NOT NULL COMMENT '评分分类ID',
`category_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类编码', `category_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类编码',
`item_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评分项目', `item_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评分项目',
`score` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '分值',
`score_description` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '得分说明', `score_description` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '得分说明',
`option_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '选项描述', `option_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '选项描述',
`sort` int NULL DEFAULT 0 COMMENT '排序', `sort` int NULL DEFAULT 0 COMMENT '排序',

View File

@@ -345,6 +345,8 @@ INSERT IGNORE INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `pa
(2090000000000000103, 2090000000000000100, 'common_route_edit', '编辑', 'common_route_edit', '', '', 3, 2, 0, 1, NULL, '', 0), (2090000000000000103, 2090000000000000100, 'common_route_edit', '编辑', 'common_route_edit', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000000104, 2090000000000000100, 'common_route_delete', '删除', 'common_route_delete', '', '', 4, 2, 0, 1, NULL, '', 0), (2090000000000000104, 2090000000000000100, 'common_route_delete', '删除', 'common_route_delete', '', '', 4, 2, 0, 1, NULL, '', 0),
(2090000000000000105, 2090000000000000100, 'common_route_export', '批量导出', 'common_route_export', '', '', 5, 2, 0, 1, NULL, '', 0), (2090000000000000105, 2090000000000000100, 'common_route_export', '批量导出', 'common_route_export', '', '', 5, 2, 0, 1, NULL, '', 0),
(2090000000000000106, 2090000000000000100, 'common_route_import', '批量导入', 'common_route_import', '', '', 6, 2, 0, 1, NULL, '', 0),
(2090000000000000107, 2090000000000000100, 'common_route_template', '下载模板', 'common_route_template', '', '', 7, 2, 0, 1, NULL, '', 0),
(2090000000000000200, 2090000000000000000, 'common_cargo', '常用货物', 'common_cargo', '/business/common-cargo', 'iconfont icon-caidanguanli', 20, 1, 0, 1, NULL, '', 0), (2090000000000000200, 2090000000000000000, 'common_cargo', '常用货物', 'common_cargo', '/business/common-cargo', 'iconfont icon-caidanguanli', 20, 1, 0, 1, NULL, '', 0),
(2090000000000000201, 2090000000000000200, 'common_cargo_view', '查看', 'common_cargo_view', '', '', 1, 2, 0, 1, NULL, '', 0), (2090000000000000201, 2090000000000000200, 'common_cargo_view', '查看', 'common_cargo_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000000202, 2090000000000000200, 'common_cargo_add', '新增', 'common_cargo_add', '', '', 2, 2, 0, 1, NULL, '', 0), (2090000000000000202, 2090000000000000200, 'common_cargo_add', '新增', 'common_cargo_add', '', '', 2, 2, 0, 1, NULL, '', 0),