调整收付款问题
This commit is contained in:
+3
-2
@@ -44,6 +44,7 @@ import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.AirportMasterExcel;
|
||||
import org.springblade.system.excel.AirportMasterExportExcel;
|
||||
import org.springblade.system.excel.AirportMasterImporter;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
@@ -180,8 +181,8 @@ public class AirportMasterController extends BladeController {
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(AirportMaster::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<AirportMasterExcel> list = airportMasterService.exportAirportMaster(queryWrapper);
|
||||
ExcelUtil.export(response, "空港机场主数据" + DateUtil.time(), "空港机场主数据表", list, AirportMasterExcel.class);
|
||||
List<AirportMasterExportExcel> list = airportMasterService.exportAirportMaster(queryWrapper);
|
||||
ExcelUtil.export(response, "空港机场主数据" + DateUtil.time(), "空港机场主数据表", list, AirportMasterExportExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-2
@@ -44,6 +44,7 @@ import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.PortTerminalExcel;
|
||||
import org.springblade.system.excel.PortTerminalExportExcel;
|
||||
import org.springblade.system.excel.PortTerminalImporter;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
@@ -200,8 +201,8 @@ public class PortTerminalController extends BladeController {
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(PortTerminal::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<PortTerminalExcel> list = portTerminalService.exportPortTerminal(queryWrapper);
|
||||
ExcelUtil.export(response, "港口码头主数据" + DateUtil.time(), "港口码头主数据表", list, PortTerminalExcel.class);
|
||||
List<PortTerminalExportExcel> list = portTerminalService.exportPortTerminal(queryWrapper);
|
||||
ExcelUtil.export(response, "港口码头主数据" + DateUtil.time(), "港口码头主数据表", list, PortTerminalExportExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-2
@@ -44,6 +44,7 @@ import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.RailwayStationExcel;
|
||||
import org.springblade.system.excel.RailwayStationExportExcel;
|
||||
import org.springblade.system.excel.RailwayStationImporter;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
@@ -185,8 +186,8 @@ public class RailwayStationController extends BladeController {
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(RailwayStation::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<RailwayStationExcel> list = railwayStationService.exportRailwayStation(queryWrapper);
|
||||
ExcelUtil.export(response, "铁路车站主数据" + DateUtil.time(), "铁路车站主数据表", list, RailwayStationExcel.class);
|
||||
List<RailwayStationExportExcel> list = railwayStationService.exportRailwayStation(queryWrapper);
|
||||
ExcelUtil.export(response, "铁路车站主数据" + DateUtil.time(), "铁路车站主数据表", list, RailwayStationExportExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-13
@@ -53,9 +53,6 @@ public class AirportMasterExcel implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("IATA编码*")
|
||||
private String iataCode;
|
||||
|
||||
@@ -77,7 +74,7 @@ public class AirportMasterExcel implements Serializable {
|
||||
@ExcelProperty("所属区县*")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
@ExcelProperty("详细地址*")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度*")
|
||||
@@ -88,15 +85,6 @@ public class AirportMasterExcel implements Serializable {
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("行政区划编号")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 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.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.NumberFormat;
|
||||
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;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 空港机场主数据导出 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class AirportMasterExportExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("IATA编码*")
|
||||
private String iataCode;
|
||||
|
||||
@ExcelProperty("ICAO代码*")
|
||||
private String icaoCode;
|
||||
|
||||
@ExcelProperty("机场标准名称*")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("机场简称")
|
||||
private String shortName;
|
||||
|
||||
@ExcelProperty("所属省份*")
|
||||
private String provinceName;
|
||||
|
||||
@ExcelProperty("所属城市*")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("所属区县*")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度*")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("纬度*")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("行政区划编号")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelIgnore
|
||||
private String errorMessage;
|
||||
}
|
||||
+15
-21
@@ -53,50 +53,44 @@ public class PortTerminalExcel implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("*编码")
|
||||
private String code;
|
||||
@ExcelProperty("港口编码*")
|
||||
private String portCode;
|
||||
|
||||
@ExcelProperty("*港口/码头名称")
|
||||
@ExcelProperty("码头编码(如为港口则不需填写)")
|
||||
private String terminalCode;
|
||||
|
||||
@ExcelProperty("港口/码头名称*")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("*类型")
|
||||
@ExcelProperty("类型*")
|
||||
private String category;
|
||||
|
||||
@ExcelProperty("上级港口")
|
||||
@ExcelProperty("上级港口(如为港口则不需填写)")
|
||||
private String parentName;
|
||||
|
||||
@ExcelProperty("上级港口编码")
|
||||
@ExcelProperty("上级港口编码(如为港口则不需填写)")
|
||||
private String parentCode;
|
||||
|
||||
@ExcelProperty("*国家")
|
||||
@ExcelProperty("国家*")
|
||||
private String country;
|
||||
|
||||
@ExcelProperty("*城市")
|
||||
@ExcelProperty("城市*")
|
||||
private String city;
|
||||
|
||||
@ExcelProperty("*区县")
|
||||
@ExcelProperty("区县*")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("行政区划编码")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
@ExcelProperty("详细地址*")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("*经度")
|
||||
@ExcelProperty("经度*")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("*纬度")
|
||||
@ExcelProperty("纬度*")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.NumberFormat;
|
||||
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;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 港口码头主数据导出 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class PortTerminalExportExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("港口/码头名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("类型")
|
||||
private String category;
|
||||
|
||||
@ExcelProperty("上级港口")
|
||||
private String parentName;
|
||||
|
||||
@ExcelProperty("上级港口编码")
|
||||
private String parentCode;
|
||||
|
||||
@ExcelProperty("国家")
|
||||
private String country;
|
||||
|
||||
@ExcelProperty("城市")
|
||||
private String city;
|
||||
|
||||
@ExcelProperty("区县")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("行政区划编码")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("纬度")
|
||||
@NumberFormat("0.000000")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelIgnore
|
||||
private String errorMessage;
|
||||
}
|
||||
+3
-15
@@ -51,9 +51,6 @@ public class RailwayStationExcel implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("TMIS国标编码*")
|
||||
private String tmisCode;
|
||||
|
||||
@@ -75,24 +72,15 @@ public class RailwayStationExcel implements Serializable {
|
||||
@ExcelProperty("所属区县*")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
@ExcelProperty("详细地址*")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
@ExcelProperty("经度*")
|
||||
private String longitude;
|
||||
|
||||
@ExcelProperty("纬度")
|
||||
@ExcelProperty("纬度*")
|
||||
private String latitude;
|
||||
|
||||
@ExcelProperty("行政区划编号")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* 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.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
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;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据导出 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class RailwayStationExportExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("TMIS国标编码*")
|
||||
private String tmisCode;
|
||||
|
||||
@ExcelProperty("电报码*")
|
||||
private String telegraphCode;
|
||||
|
||||
@ExcelProperty("车站名称*")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("所属省份*")
|
||||
private String provinceName;
|
||||
|
||||
@ExcelProperty("所属城市*")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("所属区县*")
|
||||
private String districtName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度*")
|
||||
private String longitude;
|
||||
|
||||
@ExcelProperty("纬度*")
|
||||
private String latitude;
|
||||
|
||||
@ExcelProperty("行政区划编号")
|
||||
private String regionCode;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("启停状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("更新人")
|
||||
private String updateUserName;
|
||||
|
||||
@ExcelProperty("更新时间")
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
}
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.AirportMasterExcel;
|
||||
import org.springblade.system.excel.AirportMasterExportExcel;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
|
||||
@@ -80,6 +81,6 @@ public interface IAirportMasterService extends BaseService<AirportMaster> {
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<AirportMasterExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper);
|
||||
List<AirportMasterExportExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.PortTerminalExcel;
|
||||
import org.springblade.system.excel.PortTerminalExportExcel;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
|
||||
@@ -87,6 +88,6 @@ public interface IPortTerminalService extends BaseService<PortTerminal> {
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<PortTerminalExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper);
|
||||
List<PortTerminalExportExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.RailwayStationExcel;
|
||||
import org.springblade.system.excel.RailwayStationExportExcel;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
|
||||
@@ -80,6 +81,6 @@ public interface IRailwayStationService extends BaseService<RailwayStation> {
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<RailwayStationExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper);
|
||||
List<RailwayStationExportExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
+10
-4
@@ -35,6 +35,7 @@ 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.excel.AirportMasterExcel;
|
||||
import org.springblade.system.excel.AirportMasterExportExcel;
|
||||
import org.springblade.system.mapper.AirportMasterMapper;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.entity.Region;
|
||||
@@ -214,7 +215,9 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
validateImportUnique(AirportMaster::getIataCode, airportMaster.getIataCode(), "该IATA编码已存在", validationErrors);
|
||||
validateImportUnique(AirportMaster::getCode, airportMaster.getCode(), "该编码已存在", validationErrors);
|
||||
}
|
||||
if (Func.isNotEmpty(airportMaster.getIcaoCode())) {
|
||||
if (Func.isEmpty(airportMaster.getIcaoCode())) {
|
||||
addValidationError(validationErrors, "ICAO代码不能为空");
|
||||
} else {
|
||||
if (!ICAO_CODE_PATTERN.matcher(airportMaster.getIcaoCode()).matches()) {
|
||||
addValidationError(validationErrors, "ICAO代码为4位大写字母");
|
||||
}
|
||||
@@ -308,10 +311,10 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirportMasterExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper) {
|
||||
public List<AirportMasterExportExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper) {
|
||||
List<AirportMaster> airportMasterList = list(queryWrapper);
|
||||
return airportMasterList.stream().map(airportMaster -> {
|
||||
AirportMasterExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterExcel.class));
|
||||
AirportMasterExportExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterExportExcel.class));
|
||||
excel.setLongitude(scaleCoordinate(airportMaster.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
|
||||
excel.setLatitude(scaleCoordinate(airportMaster.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
|
||||
excel.setDataSource(normalizeDataSource(airportMaster.getDataSource()));
|
||||
@@ -363,7 +366,10 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
if (!IATA_CODE_PATTERN.matcher(airportMaster.getIataCode()).matches()) {
|
||||
throw new ServiceException("IATA编码为3位大写字母");
|
||||
}
|
||||
if (Func.isNotEmpty(airportMaster.getIcaoCode()) && !ICAO_CODE_PATTERN.matcher(airportMaster.getIcaoCode()).matches()) {
|
||||
if (Func.isEmpty(airportMaster.getIcaoCode())) {
|
||||
throw new ServiceException("ICAO代码不能为空");
|
||||
}
|
||||
if (!ICAO_CODE_PATTERN.matcher(airportMaster.getIcaoCode()).matches()) {
|
||||
throw new ServiceException("ICAO代码为4位大写字母");
|
||||
}
|
||||
if (Func.isEmpty(airportMaster.getName())) {
|
||||
|
||||
+15
-2
@@ -156,10 +156,10 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
|
||||
if (Func.isNotEmpty(feeItem.getRemark()) && feeItem.getRemark().length() > REMARK_MAX_LENGTH) {
|
||||
throw new ServiceException("备注不能超过200个字");
|
||||
}
|
||||
validateUniqueName(feeItem);
|
||||
validateUnique(feeItem);
|
||||
}
|
||||
|
||||
private void validateUniqueName(FeeItem feeItem) {
|
||||
private void validateUnique(FeeItem feeItem) {
|
||||
LambdaQueryWrapper<FeeItem> queryWrapper = Wrappers.<FeeItem>lambdaQuery()
|
||||
.eq(FeeItem::getName, feeItem.getName())
|
||||
.eq(FeeItem::getIsDeleted, 0);
|
||||
@@ -169,6 +169,19 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
|
||||
if (count(queryWrapper) > 0L) {
|
||||
throw new ServiceException("该费用项已存在");
|
||||
}
|
||||
|
||||
if (Func.isEmpty(feeItem.getEnglishName())) {
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapper<FeeItem> codeQueryWrapper = Wrappers.<FeeItem>lambdaQuery()
|
||||
.eq(FeeItem::getEnglishName, feeItem.getEnglishName())
|
||||
.eq(FeeItem::getIsDeleted, 0);
|
||||
if (Func.isNotEmpty(feeItem.getId())) {
|
||||
codeQueryWrapper.ne(FeeItem::getId, feeItem.getId());
|
||||
}
|
||||
if (count(codeQueryWrapper) > 0L) {
|
||||
throw new ServiceException("该费用项代码已存在");
|
||||
}
|
||||
}
|
||||
|
||||
private FeeItem buildImportFeeItem(FeeItemExcel excel) {
|
||||
|
||||
+81
-22
@@ -35,6 +35,7 @@ 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.excel.PortTerminalExcel;
|
||||
import org.springblade.system.excel.PortTerminalExportExcel;
|
||||
import org.springblade.system.mapper.PortTerminalMapper;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.entity.Region;
|
||||
@@ -53,6 +54,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
@@ -138,41 +140,46 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
if (Func.isEmpty(data)) {
|
||||
throw new ServiceException("导入数据不能为空");
|
||||
}
|
||||
List<PortTerminalExcel> errorList = new ArrayList<>();
|
||||
List<PortTerminal> portTerminalList = new ArrayList<>();
|
||||
Map<Integer, PortTerminalExcel> errorMap = new TreeMap<>();
|
||||
Map<String, Integer> codeCountMap = buildImportCodeCountMap(data);
|
||||
importPortTerminalByCategory(data, codeCountMap, errorMap, true);
|
||||
importPortTerminalByCategory(data, codeCountMap, errorMap, false);
|
||||
if (Func.isNotEmpty(errorMap)) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
}
|
||||
return new ArrayList<>(errorMap.values());
|
||||
}
|
||||
|
||||
private void importPortTerminalByCategory(List<PortTerminalExcel> data, Map<String, Integer> codeCountMap,
|
||||
Map<Integer, PortTerminalExcel> errorMap, boolean importPort) {
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
PortTerminalExcel excel = data.get(index);
|
||||
PortTerminal portTerminal = Objects.requireNonNull(BeanUtil.copyProperties(excel, PortTerminal.class));
|
||||
boolean isPort = CATEGORY_PORT.equals(trimToEmpty(excel.getCategory()));
|
||||
if (isPort != importPort) {
|
||||
continue;
|
||||
}
|
||||
PortTerminal portTerminal = buildImportPortTerminal(excel);
|
||||
portTerminal.setDataSource(SOURCE_BATCH);
|
||||
portTerminal.setStatus(STATUS_ENABLED);
|
||||
normalizeImportPortTerminal(portTerminal);
|
||||
List<String> validationErrors = validateImportPortTerminal(portTerminal, codeCountMap);
|
||||
List<String> validationErrors = validateImportPortTerminal(excel, portTerminal, codeCountMap);
|
||||
if (Func.isNotEmpty(validationErrors)) {
|
||||
excel.setErrorMessage(formatImportErrorMessage(validationErrors));
|
||||
errorList.add(excel);
|
||||
errorMap.put(index, excel);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
prepare(portTerminal, SOURCE_BATCH);
|
||||
validate(portTerminal);
|
||||
portTerminalList.add(portTerminal);
|
||||
} catch (Exception exception) {
|
||||
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
|
||||
excel.setErrorMessage(formatImportErrorMessage(List.of(message)));
|
||||
errorList.add(excel);
|
||||
}
|
||||
}
|
||||
if (Func.isNotEmpty(errorList)) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return errorList;
|
||||
}
|
||||
for (PortTerminal portTerminal : portTerminalList) {
|
||||
if (!save(portTerminal)) {
|
||||
throw new ServiceException("港口码头保存失败");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
|
||||
excel.setErrorMessage(formatImportErrorMessage(List.of(message)));
|
||||
errorMap.put(index, excel);
|
||||
}
|
||||
}
|
||||
return errorList;
|
||||
}
|
||||
|
||||
private String formatImportErrorMessage(List<String> validationErrors) {
|
||||
@@ -189,7 +196,7 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
private Map<String, Integer> buildImportCodeCountMap(List<PortTerminalExcel> data) {
|
||||
Map<String, Integer> codeCountMap = new HashMap<>();
|
||||
for (PortTerminalExcel excel : data) {
|
||||
String code = trimToEmpty(excel.getCode()).toUpperCase(Locale.ROOT);
|
||||
String code = resolveImportCode(excel);
|
||||
if (Func.isNotEmpty(code)) {
|
||||
codeCountMap.merge(code, 1, Integer::sum);
|
||||
}
|
||||
@@ -197,6 +204,32 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
return codeCountMap;
|
||||
}
|
||||
|
||||
private PortTerminal buildImportPortTerminal(PortTerminalExcel excel) {
|
||||
PortTerminal portTerminal = new PortTerminal();
|
||||
portTerminal.setCode(resolveImportCode(excel));
|
||||
portTerminal.setName(excel.getName());
|
||||
portTerminal.setCategory(excel.getCategory());
|
||||
portTerminal.setParentName(excel.getParentName());
|
||||
portTerminal.setParentCode(CATEGORY_TERMINAL.equals(trimToEmpty(excel.getCategory())) ? excel.getPortCode() : excel.getParentCode());
|
||||
portTerminal.setCountry(excel.getCountry());
|
||||
portTerminal.setCity(excel.getCity());
|
||||
portTerminal.setDistrictName(excel.getDistrictName());
|
||||
portTerminal.setDetailAddress(excel.getDetailAddress());
|
||||
portTerminal.setLongitude(excel.getLongitude());
|
||||
portTerminal.setLatitude(excel.getLatitude());
|
||||
portTerminal.setRemark(excel.getRemark());
|
||||
return portTerminal;
|
||||
}
|
||||
|
||||
private String resolveImportCode(PortTerminalExcel excel) {
|
||||
String portCode = trimToEmpty(excel.getPortCode()).toUpperCase(Locale.ROOT);
|
||||
String terminalCode = trimToEmpty(excel.getTerminalCode()).toUpperCase(Locale.ROOT);
|
||||
if (Func.isEmpty(terminalCode)) {
|
||||
return portCode;
|
||||
}
|
||||
return Func.isEmpty(portCode) ? terminalCode : portCode + "-" + terminalCode;
|
||||
}
|
||||
|
||||
private void normalizeImportPortTerminal(PortTerminal portTerminal) {
|
||||
portTerminal.setCode(trimToEmpty(portTerminal.getCode()).toUpperCase(Locale.ROOT));
|
||||
portTerminal.setCategory(trimToEmpty(portTerminal.getCategory()));
|
||||
@@ -218,11 +251,13 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
portTerminal.setRemark(trimToNull(portTerminal.getRemark()));
|
||||
}
|
||||
|
||||
private List<String> validateImportPortTerminal(PortTerminal portTerminal, Map<String, Integer> codeCountMap) {
|
||||
private List<String> validateImportPortTerminal(PortTerminalExcel excel, PortTerminal portTerminal,
|
||||
Map<String, Integer> codeCountMap) {
|
||||
List<String> validationErrors = new ArrayList<>();
|
||||
if (!CATEGORY_PORT.equals(portTerminal.getCategory()) && !CATEGORY_TERMINAL.equals(portTerminal.getCategory())) {
|
||||
addValidationError(validationErrors, "类型只能为港口或码头");
|
||||
}
|
||||
validateImportCodeColumns(excel, portTerminal, validationErrors);
|
||||
if (Func.isEmpty(portTerminal.getCode())) {
|
||||
addValidationError(validationErrors, "编码不能为空");
|
||||
} else {
|
||||
@@ -274,6 +309,30 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
private void validateImportCodeColumns(PortTerminalExcel excel, PortTerminal portTerminal,
|
||||
List<String> validationErrors) {
|
||||
String portCode = trimToEmpty(excel.getPortCode()).toUpperCase(Locale.ROOT);
|
||||
String terminalCode = trimToEmpty(excel.getTerminalCode()).toUpperCase(Locale.ROOT);
|
||||
String parentCode = trimToEmpty(excel.getParentCode()).toUpperCase(Locale.ROOT);
|
||||
if (Func.isEmpty(portCode)) {
|
||||
addValidationError(validationErrors, "港口编码不能为空");
|
||||
}
|
||||
if (!CATEGORY_TERMINAL.equals(portTerminal.getCategory())) {
|
||||
return;
|
||||
}
|
||||
if (Func.isEmpty(terminalCode)) {
|
||||
addValidationError(validationErrors, "码头编码不能为空");
|
||||
}
|
||||
if (Func.isEmpty(portTerminal.getParentName())) {
|
||||
addValidationError(validationErrors, "上级港口不能为空");
|
||||
}
|
||||
if (Func.isEmpty(parentCode)) {
|
||||
addValidationError(validationErrors, "上级港口编码不能为空");
|
||||
} else if (Func.isNotEmpty(portCode) && !portCode.equals(parentCode) && !portCode.endsWith(parentCode)) {
|
||||
addValidationError(validationErrors, "港口编码与上级港口编码不匹配");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateImportPortRegion(PortTerminal portTerminal, List<String> validationErrors) {
|
||||
if (Func.isEmpty(portTerminal.getCountry())) {
|
||||
addValidationError(validationErrors, "国家不能为空");
|
||||
@@ -324,10 +383,10 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PortTerminalExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper) {
|
||||
public List<PortTerminalExportExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper) {
|
||||
List<PortTerminal> portTerminalList = list(queryWrapper);
|
||||
return portTerminalList.stream().map(portTerminal -> {
|
||||
PortTerminalExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalExcel.class));
|
||||
PortTerminalExportExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalExportExcel.class));
|
||||
excel.setRegionCode(portTerminal.getDistrictCode());
|
||||
excel.setLongitude(scaleCoordinate(portTerminal.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
|
||||
excel.setLatitude(scaleCoordinate(portTerminal.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
|
||||
|
||||
+9
-9
@@ -34,7 +34,9 @@ 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.excel.RailwayStationExcel;
|
||||
import org.springblade.system.excel.RailwayStationExportExcel;
|
||||
import org.springblade.system.mapper.RailwayStationMapper;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.entity.Region;
|
||||
@@ -195,10 +197,6 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
railwayStation.setCityName(trimToNull(railwayStation.getCityName()));
|
||||
railwayStation.setDistrictCode(trimToNull(railwayStation.getDistrictCode()));
|
||||
railwayStation.setDistrictName(trimToNull(railwayStation.getDistrictName()));
|
||||
railwayStation.setRegionCode(trimToNull(railwayStation.getRegionCode()));
|
||||
if (Func.isEmpty(railwayStation.getDistrictCode()) && Func.isNotEmpty(railwayStation.getRegionCode())) {
|
||||
railwayStation.setDistrictCode(railwayStation.getRegionCode());
|
||||
}
|
||||
railwayStation.setDetailAddress(trimToNull(railwayStation.getDetailAddress()));
|
||||
railwayStation.setRemark(trimToNull(railwayStation.getRemark()));
|
||||
}
|
||||
@@ -250,7 +248,6 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
validateImportLength(railwayStation.getProvinceName(), REGION_NAME_MAX_LENGTH, "所属省份不能超过128字", validationErrors);
|
||||
validateImportLength(railwayStation.getCityName(), REGION_NAME_MAX_LENGTH, "所属城市不能超过128字", validationErrors);
|
||||
validateImportLength(railwayStation.getDistrictName(), REGION_NAME_MAX_LENGTH, "所属区县不能超过128字", validationErrors);
|
||||
validateImportLength(railwayStation.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编号不能超过32字", validationErrors);
|
||||
if (Func.isEmpty(railwayStation.getDetailAddress())) {
|
||||
addValidationError(validationErrors, "详细地址不能为空");
|
||||
}
|
||||
@@ -286,7 +283,9 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
}
|
||||
|
||||
private void validateImportCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name, List<String> validationErrors) {
|
||||
if (Func.isNotEmpty(value) && !validRange(value, min, max)) {
|
||||
if (Func.isEmpty(value)) {
|
||||
addValidationError(validationErrors, name + "不能为空");
|
||||
} else if (!validRange(value, min, max)) {
|
||||
addValidationError(validationErrors, name + "范围不正确");
|
||||
}
|
||||
}
|
||||
@@ -324,14 +323,15 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RailwayStationExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper) {
|
||||
public List<RailwayStationExportExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper) {
|
||||
List<RailwayStation> railwayStationList = list(queryWrapper);
|
||||
return railwayStationList.stream().map(railwayStation -> {
|
||||
RailwayStationExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationExcel.class));
|
||||
RailwayStationExportExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationExportExcel.class));
|
||||
excel.setLongitude(formatCoordinate(railwayStation.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
|
||||
excel.setLatitude(formatCoordinate(railwayStation.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
|
||||
excel.setDataSource(normalizeDataSource(railwayStation.getDataSource()));
|
||||
excel.setStatusName(Objects.equals(railwayStation.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
|
||||
excel.setUpdateUserName(UserCache.getUserRealName(railwayStation.getUpdateUser()));
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
@@ -488,7 +488,7 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
|
||||
private void validateCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name) {
|
||||
if (value == null) {
|
||||
return;
|
||||
throw new ServiceException(name + "不能为空");
|
||||
}
|
||||
if (value.compareTo(min) < 0 || value.compareTo(max) > 0) {
|
||||
throw new ServiceException(name + "范围不正确");
|
||||
|
||||
+9
-3
@@ -462,6 +462,11 @@ public class FormalSettlementServiceImpl extends BaseServiceImpl<FormalSettlemen
|
||||
private String createPayment(FormalSettlement settlement, BigDecimal appliedAmount, String remark) {
|
||||
if (!APPROVED.equals(settlement.getApprovalStatus())) throw new ServiceException("仅审批通过的正式结算单允许发起付款申请");
|
||||
if (!"payable".equals(settlement.getSettlementType())) throw new ServiceException("仅应付正式结算单允许发起付款申请");
|
||||
long activePaymentCount = paymentMapper.selectCount(Wrappers.<FormalSettlementPayment>lambdaQuery()
|
||||
.eq(FormalSettlementPayment::getFormalSettlementId, settlement.getId())
|
||||
.eq(FormalSettlementPayment::getIsDeleted, 0)
|
||||
.notIn(FormalSettlementPayment::getBillStatus, RETURNED, VOIDED));
|
||||
if (activePaymentCount > 0) throw new ServiceException("该结算单正在申请结算尾款,不允许再次提交申请付款");
|
||||
BigDecimal amount = positive(appliedAmount, "申请付款金额");
|
||||
BigDecimal available = money(settlement.getSettlementAmount()).subtract(money(settlement.getAppliedPaymentAmount()));
|
||||
if (amount.compareTo(available) > 0) throw new ServiceException("申请付款金额不能超过剩余可申请金额" + available);
|
||||
@@ -701,9 +706,10 @@ public class FormalSettlementServiceImpl extends BaseServiceImpl<FormalSettlemen
|
||||
if (Integer.valueOf(1).equals(requestRow.getManualFlag())) {
|
||||
String feeType = requiredText(requestRow.getFeeType(), "费用类型");
|
||||
String feeItem = requiredText(requestRow.getFeeItem(), "费用项");
|
||||
if (!allowedManualFees.getOrDefault(feeType, Set.of()).contains(feeItem)) {
|
||||
throw new ServiceException("费用类型与费用项不匹配或费用项已停用");
|
||||
}
|
||||
// 暂时注释费用类型与费用项匹配及停用校验
|
||||
// if (!allowedManualFees.getOrDefault(feeType, Set.of()).contains(feeItem)) {
|
||||
// throw new ServiceException("费用类型与费用项不匹配或费用项已停用");
|
||||
// }
|
||||
FormalSettlementSummaryFee row = requestRow.getId() == null ? null : existingMap.get(requestRow.getId());
|
||||
if (row == null && requestRow.getId() == null) row = new FormalSettlementSummaryFee();
|
||||
if (row == null || row.getId() != null && !Integer.valueOf(1).equals(row.getManualFlag())) {
|
||||
|
||||
+23
@@ -30,6 +30,7 @@ import org.springblade.core.tool.jackson.JsonUtil;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.transport.mapper.FormalSettlementMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementPaymentMapper;
|
||||
import org.springblade.transport.mapper.BillLedgerMapper;
|
||||
import org.springblade.transport.mapper.BillLedgerUsageMapper;
|
||||
import org.springblade.transport.mapper.PreSettlementMapper;
|
||||
@@ -46,6 +47,7 @@ import org.springblade.transport.pojo.dto.PaymentApplicationRecordRequest;
|
||||
import org.springblade.transport.pojo.dto.PaymentApplicationSaveRequest;
|
||||
import org.springblade.transport.pojo.dto.PaymentApplicationStatusRequest;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlement;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementPayment;
|
||||
import org.springblade.transport.pojo.entity.BillLedger;
|
||||
import org.springblade.transport.pojo.entity.BillLedgerUsage;
|
||||
import org.springblade.transport.pojo.entity.PreSettlement;
|
||||
@@ -89,6 +91,7 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
private final PaymentApplicationSettlementMapper settlementRelationMapper;
|
||||
private final PreSettlementMapper preSettlementMapper;
|
||||
private final FormalSettlementMapper formalSettlementMapper;
|
||||
private final FormalSettlementPaymentMapper formalSettlementPaymentMapper;
|
||||
private final ProjectApplyMapper projectApplyMapper;
|
||||
private final ContractManageMapper contractManageMapper;
|
||||
private final CustomerArchiveMapper customerArchiveMapper;
|
||||
@@ -253,6 +256,7 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
if (!List.of(DRAFT, RETURNED).contains(entity.getApprovalStatus())) {
|
||||
throw new ServiceException("当前状态不允许提交");
|
||||
}
|
||||
validateNoTailPayment(entity);
|
||||
validateProjectAdvanceContractFile(entity);
|
||||
validateSelectedBill(entity, false);
|
||||
validateQuota(entity);
|
||||
@@ -618,6 +622,25 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
formalSettlementService.refreshPaymentSummariesForPreSettlement(entity.getPreSettlementId());
|
||||
}
|
||||
}
|
||||
private void validateNoTailPayment(PaymentApplication entity) {
|
||||
if (!"settlement_payment".equals(entity.getPaymentType())) return;
|
||||
List<Long> formalSettlementIds = new java.util.ArrayList<>();
|
||||
if (entity.getSettlementId() != null) formalSettlementIds.add(entity.getSettlementId());
|
||||
formalSettlementIds.addAll(settlementRelationMapper.selectList(Wrappers.<PaymentApplicationSettlement>lambdaQuery()
|
||||
.select(PaymentApplicationSettlement::getFormalSettlementId)
|
||||
.eq(PaymentApplicationSettlement::getPaymentApplicationId, entity.getId())
|
||||
.eq(PaymentApplicationSettlement::getIsDeleted, 0))
|
||||
.stream().map(PaymentApplicationSettlement::getFormalSettlementId).filter(Objects::nonNull).toList());
|
||||
formalSettlementIds = formalSettlementIds.stream().distinct().toList();
|
||||
if (formalSettlementIds.isEmpty()) return;
|
||||
long activeTailPaymentCount = formalSettlementPaymentMapper.selectCount(Wrappers.<FormalSettlementPayment>lambdaQuery()
|
||||
.eq(FormalSettlementPayment::getIsDeleted, 0)
|
||||
.in(FormalSettlementPayment::getFormalSettlementId, formalSettlementIds)
|
||||
.notIn(FormalSettlementPayment::getBillStatus, RETURNED, VOIDED));
|
||||
if (activeTailPaymentCount > 0) {
|
||||
throw new ServiceException("该结算单正在申请结算尾款,不允许再次提交申请付款");
|
||||
}
|
||||
}
|
||||
private PaymentApplication existing(Long id) { PaymentApplication entity = getById(id); if (entity == null || Objects.equals(entity.getIsDeleted(), 1)) throw new ServiceException("付款申请不存在"); return entity; }
|
||||
private PaymentApplication editable(Long id) { PaymentApplication entity = existing(id); if (!List.of(DRAFT, RETURNED).contains(entity.getApprovalStatus())) throw new ServiceException("当前状态不可编辑"); return entity; }
|
||||
private String nextNo() { String prefix = "FKD" + LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE); return prefix + String.format("%05d", count(Wrappers.<PaymentApplication>lambdaQuery().likeRight(PaymentApplication::getPaymentNo, prefix)) + 1); }
|
||||
|
||||
+4
-3
@@ -961,9 +961,10 @@ public class PreSettlementServiceImpl extends BaseServiceImpl<PreSettlementMappe
|
||||
if (Integer.valueOf(1).equals(requestRow.getManualFlag())) {
|
||||
String feeType = requiredText(requestRow.getFeeType(), "费用类型");
|
||||
String feeItem = requiredText(requestRow.getFeeItem(), "费用项");
|
||||
if (!allowedManualFees.getOrDefault(feeType, Set.of()).contains(feeItem)) {
|
||||
throw new ServiceException("费用类型与费用项不匹配或费用项已停用");
|
||||
}
|
||||
// 暂时注释费用类型与费用项匹配及停用校验
|
||||
// if (!allowedManualFees.getOrDefault(feeType, Set.of()).contains(feeItem)) {
|
||||
// throw new ServiceException("费用类型与费用项不匹配或费用项已停用");
|
||||
// }
|
||||
PreSettlementSummaryFee row = requestRow.getId() == null ? null : existingMap.get(requestRow.getId());
|
||||
if (row == null) {
|
||||
row = existingMap.values().stream()
|
||||
|
||||
+103
-3
@@ -102,6 +102,7 @@ public class ReceivablePayableDetailServiceImpl
|
||||
|
||||
private static final String SOURCE_MASTER_ORDER = "总单系统生成";
|
||||
private static final String SOURCE_LOADING_ORDER = "配载单系统生成";
|
||||
private static final String SOURCE_MANUAL_GENERATION = "手动生成";
|
||||
private static final String FEE_SOURCE_AUTO = "自动生成";
|
||||
private static final String FEE_SOURCE_MANUAL = "手动录入";
|
||||
private static final Set<String> FEE_SOURCE_MANUAL_LEGACY = Set.of("手工录入", "手动添加");
|
||||
@@ -258,13 +259,16 @@ public class ReceivablePayableDetailServiceImpl
|
||||
if (!"pending".equals(detail.getSettlementStatus())) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal before = money(detail.getTotalAmount());
|
||||
List<ReceivablePayableCargoFee> beforeRows = activeCargoFees(detail.getId());
|
||||
rebuildDetailFee(detail, request.getBillingPlanId());
|
||||
if (request.getAdjustAmount() != null && request.getAdjustAmount().compareTo(BigDecimal.ZERO) != 0) {
|
||||
applyManualAdjustment(detail, request.getAdjustAmount(), request.getAdjustFeeItem(), request.getAdjustReason());
|
||||
}
|
||||
saveChangeRecord(detail, "【费用合计】从[" + formatMoney(before) + "]调整为[" + formatMoney(detail.getTotalAmount()) + "]",
|
||||
request.getAdjustReason());
|
||||
List<ReceivablePayableCargoFee> afterRows = activeCargoFees(detail.getId());
|
||||
List<String> changes = reconcileUpdatedFeeAmounts(beforeRows, afterRows);
|
||||
for (int index = 0; index < changes.size(); index++) {
|
||||
saveChangeRecord(detail, changes.get(index), request.getAdjustReason(), String.format("%04d", index + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,6 +609,7 @@ public class ReceivablePayableDetailServiceImpl
|
||||
continue;
|
||||
}
|
||||
ReceivablePayableDetail detail = buildDetail(waybill, contract, request.getBillingPlanId(), settlementType(request.getSettlementType()));
|
||||
detail.setSourceType(SOURCE_MANUAL_GENERATION);
|
||||
save(detail);
|
||||
calculatedFees(waybill, contract, request.getBillingPlanId()).forEach(fee -> {
|
||||
fee.setDetailId(detail.getId());
|
||||
@@ -1969,6 +1974,101 @@ public class ReceivablePayableDetailServiceImpl
|
||||
updateById(detail);
|
||||
}
|
||||
|
||||
private List<ReceivablePayableCargoFee> activeCargoFees(Long detailId) {
|
||||
return cargoFeeMapper.selectList(Wrappers.<ReceivablePayableCargoFee>lambdaQuery()
|
||||
.eq(ReceivablePayableCargoFee::getDetailId, detailId)
|
||||
.eq(ReceivablePayableCargoFee::getIsDeleted, 0)
|
||||
.orderByAsc(ReceivablePayableCargoFee::getLineNo));
|
||||
}
|
||||
|
||||
private List<String> reconcileUpdatedFeeAmounts(List<ReceivablePayableCargoFee> beforeRows,
|
||||
List<ReceivablePayableCargoFee> afterRows) {
|
||||
Map<String, ReceivablePayableCargoFee> beforeByKey = beforeRows.stream()
|
||||
.collect(Collectors.toMap(this::feeRowKey, row -> row, (left, right) -> left, LinkedHashMap::new));
|
||||
Set<String> matchedKeys = new LinkedHashSet<>();
|
||||
List<String> changes = new ArrayList<>();
|
||||
for (ReceivablePayableCargoFee after : afterRows) {
|
||||
String key = feeRowKey(after);
|
||||
ReceivablePayableCargoFee before = beforeByKey.get(key);
|
||||
if (before != null) matchedKeys.add(key);
|
||||
BigDecimal beforeAmount = before == null ? BigDecimal.ZERO : money(before.getAfterAmount());
|
||||
BigDecimal afterAmount = money(after.getAfterAmount());
|
||||
boolean changed = before == null || feeChanged(before, after);
|
||||
if (changed) {
|
||||
after.setOriginalAmount(beforeAmount);
|
||||
after.setAdjustAmount(afterAmount.subtract(beforeAmount));
|
||||
} else {
|
||||
after.setOriginalAmount(before.getOriginalAmount());
|
||||
after.setAdjustAmount(before.getAdjustAmount());
|
||||
}
|
||||
after.setAfterAmount(afterAmount);
|
||||
cargoFeeMapper.updateById(after);
|
||||
if (changed) {
|
||||
changes.add(updatedFeeChangeContent(before, after));
|
||||
}
|
||||
}
|
||||
for (ReceivablePayableCargoFee before : beforeRows) {
|
||||
if (!matchedKeys.contains(feeRowKey(before))) {
|
||||
changes.add(updatedFeeChangeContent(before, null));
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
}
|
||||
|
||||
private String updatedFeeChangeContent(ReceivablePayableCargoFee before,
|
||||
ReceivablePayableCargoFee after) {
|
||||
List<String> changes = new ArrayList<>();
|
||||
BigDecimal beforeFreight = before == null ? BigDecimal.ZERO : money(before.getFreightAmount());
|
||||
BigDecimal afterFreight = after == null ? BigDecimal.ZERO : money(after.getFreightAmount());
|
||||
if (beforeFreight.compareTo(afterFreight) != 0) {
|
||||
changes.add("【运输费】从[" + formatMoney(beforeFreight) + "]调整为["
|
||||
+ formatMoney(afterFreight) + "]");
|
||||
}
|
||||
Map<String, Object> beforeItems = parseMap(before == null ? null : before.getFeeItemsJson());
|
||||
Map<String, Object> afterItems = parseMap(after == null ? null : after.getFeeItemsJson());
|
||||
Set<String> names = new LinkedHashSet<>(beforeItems.keySet());
|
||||
names.addAll(afterItems.keySet());
|
||||
for (String name : names) {
|
||||
if (isFreightFeeItem(name)) continue;
|
||||
BigDecimal beforeAmount = decimal(beforeItems.get(name));
|
||||
BigDecimal afterAmount = decimal(afterItems.get(name));
|
||||
if (beforeAmount.compareTo(afterAmount) != 0) {
|
||||
changes.add("【" + name + "】从[" + formatMoney(beforeAmount) + "]调整为["
|
||||
+ formatMoney(afterAmount) + "]");
|
||||
}
|
||||
}
|
||||
if (changes.isEmpty()) {
|
||||
BigDecimal beforeAmount = before == null ? BigDecimal.ZERO : money(before.getAfterAmount());
|
||||
BigDecimal afterAmount = after == null ? BigDecimal.ZERO : money(after.getAfterAmount());
|
||||
changes.add("【费用合计】从[" + formatMoney(beforeAmount) + "]调整为["
|
||||
+ formatMoney(afterAmount) + "]");
|
||||
}
|
||||
ReceivablePayableCargoFee cargoFee = after == null ? before : after;
|
||||
return String.join(";", changes) + "(" + Objects.toString(cargoFee.getCargoName(), "") + ")";
|
||||
}
|
||||
|
||||
private String feeRowKey(ReceivablePayableCargoFee fee) {
|
||||
if (Func.isNotEmpty(fee.getLineNo())) return fee.getLineNo();
|
||||
return String.join("|", Objects.toString(fee.getCargoName(), ""),
|
||||
Objects.toString(fee.getCargoType(), ""), Objects.toString(fee.getSpecification(), ""),
|
||||
Objects.toString(fee.getModel(), ""));
|
||||
}
|
||||
|
||||
private boolean feeChanged(ReceivablePayableCargoFee before, ReceivablePayableCargoFee after) {
|
||||
return money(before.getAfterAmount()).compareTo(money(after.getAfterAmount())) != 0
|
||||
|| money(before.getFreightAmount()).compareTo(money(after.getFreightAmount())) != 0
|
||||
|| feeItemsChanged(before.getFeeItemsJson(), after.getFeeItemsJson());
|
||||
}
|
||||
|
||||
private boolean feeItemsChanged(String beforeJson, String afterJson) {
|
||||
Map<String, Object> beforeItems = parseMap(beforeJson);
|
||||
Map<String, Object> afterItems = parseMap(afterJson);
|
||||
Set<String> names = new LinkedHashSet<>(beforeItems.keySet());
|
||||
names.addAll(afterItems.keySet());
|
||||
return names.stream().anyMatch(name ->
|
||||
decimal(beforeItems.get(name)).compareTo(decimal(afterItems.get(name))) != 0);
|
||||
}
|
||||
|
||||
private String aggregateFeeItemsJson(List<ReceivablePayableCargoFee> fees) {
|
||||
Map<String, BigDecimal> feeItems = new LinkedHashMap<>();
|
||||
fees.forEach(fee -> parseMap(fee.getFeeItemsJson()).forEach((name, value) ->
|
||||
|
||||
+76
-2
@@ -13,7 +13,10 @@ import org.springblade.transport.mapper.FormalSettlementDetailFeeMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementDetailMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementChangeRecordMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementPaymentMapper;
|
||||
import org.springblade.transport.mapper.FormalSettlementSummaryFeeMapper;
|
||||
import org.springblade.transport.mapper.PaymentApplicationMapper;
|
||||
import org.springblade.transport.mapper.PaymentApplicationSettlementMapper;
|
||||
import org.springblade.transport.mapper.SettlementAdjustmentDetailMapper;
|
||||
import org.springblade.transport.mapper.SettlementAdjustmentMapper;
|
||||
import org.springblade.transport.pojo.dto.SettlementAdjustmentSaveRequest;
|
||||
@@ -22,7 +25,10 @@ import org.springblade.transport.pojo.entity.FormalSettlement;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementChangeRecord;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementDetail;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementDetailFee;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementPayment;
|
||||
import org.springblade.transport.pojo.entity.FormalSettlementSummaryFee;
|
||||
import org.springblade.transport.pojo.entity.PaymentApplication;
|
||||
import org.springblade.transport.pojo.entity.PaymentApplicationSettlement;
|
||||
import org.springblade.transport.pojo.entity.SettlementAdjustment;
|
||||
import org.springblade.transport.pojo.entity.SettlementAdjustmentDetail;
|
||||
import org.springblade.transport.pojo.vo.SettlementAdjustmentVO;
|
||||
@@ -36,9 +42,11 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -48,6 +56,7 @@ public class SettlementAdjustmentServiceImpl extends BaseServiceImpl<SettlementA
|
||||
private static final String REVIEWING = "reviewing";
|
||||
private static final String APPROVED = "approved";
|
||||
private static final String RETURNED = "returned";
|
||||
private static final String VOIDED = "voided";
|
||||
private static final String PAID = "paid";
|
||||
private final SettlementAdjustmentDetailMapper detailMapper;
|
||||
private final FormalSettlementMapper formalMapper;
|
||||
@@ -55,6 +64,9 @@ public class SettlementAdjustmentServiceImpl extends BaseServiceImpl<SettlementA
|
||||
private final FormalSettlementDetailFeeMapper formalFeeMapper;
|
||||
private final FormalSettlementSummaryFeeMapper formalSummaryFeeMapper;
|
||||
private final FormalSettlementChangeRecordMapper formalChangeRecordMapper;
|
||||
private final FormalSettlementPaymentMapper formalPaymentMapper;
|
||||
private final PaymentApplicationMapper paymentApplicationMapper;
|
||||
private final PaymentApplicationSettlementMapper paymentApplicationSettlementMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SettlementAdjustmentVO> selectPage(IPage<SettlementAdjustment> page, SettlementAdjustmentVO query) {
|
||||
@@ -94,6 +106,11 @@ public class SettlementAdjustmentServiceImpl extends BaseServiceImpl<SettlementA
|
||||
.or().ne(FormalSettlement::getPaymentStatus, PAID))
|
||||
.like(Func.isNotEmpty(keyword), FormalSettlement::getFormalSettlementNo, keyword)
|
||||
.orderByDesc(FormalSettlement::getCreateTime));
|
||||
Set<Long> tailPaymentSettlementIds = tailPaymentSettlementIds(rows.stream()
|
||||
.map(FormalSettlement::getId).filter(Objects::nonNull).toList());
|
||||
rows = rows.stream().filter(row -> !isSettlementCompleted(row)
|
||||
&& !isTailSettlement(row)
|
||||
&& !tailPaymentSettlementIds.contains(row.getId())).toList();
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (FormalSettlement row : rows) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
@@ -133,7 +150,7 @@ public class SettlementAdjustmentServiceImpl extends BaseServiceImpl<SettlementA
|
||||
public Long saveDraft(SettlementAdjustmentSaveRequest request) {
|
||||
SettlementAdjustment adjustment = request.getId() == null ? new SettlementAdjustment() : editable(request.getId());
|
||||
FormalSettlement formal = request.getFormalSettlementId() == null
|
||||
? null : formalMapper.selectById(request.getFormalSettlementId());
|
||||
? null : adjustableFormalSettlement(request.getFormalSettlementId());
|
||||
if (adjustment.getId() == null) adjustment.setAdjustmentNo(nextNo());
|
||||
adjustment.setApprovalStatus(DRAFT);
|
||||
adjustment.setCurrentNode("草稿");
|
||||
@@ -285,11 +302,68 @@ public class SettlementAdjustmentServiceImpl extends BaseServiceImpl<SettlementA
|
||||
if (formal == null || !APPROVED.equals(formal.getApprovalStatus())) {
|
||||
throw new ServiceException("仅审批通过的正式结算单可调整");
|
||||
}
|
||||
if (PAID.equals(formal.getPaymentStatus())) {
|
||||
if (isSettlementCompleted(formal)) {
|
||||
throw new ServiceException("该正式结算单已完成收/付款,不能进行结算调整");
|
||||
}
|
||||
if (isTailSettlement(formal)) {
|
||||
throw new ServiceException("尾款结算正式结算单不能进行结算调整");
|
||||
}
|
||||
if (hasTailPayment(formal.getId())) {
|
||||
throw new ServiceException("该正式结算单已发起尾款结算,不能进行结算调整");
|
||||
}
|
||||
return formal;
|
||||
}
|
||||
private boolean isSettlementCompleted(FormalSettlement formal) {
|
||||
return PAID.equals(formal.getPaymentStatus())
|
||||
|| (money(formal.getSettlementAmount()).signum() > 0
|
||||
&& money(formal.getPaidAmount()).compareTo(money(formal.getSettlementAmount())) >= 0);
|
||||
}
|
||||
private boolean isTailSettlement(FormalSettlement formal) {
|
||||
return formal != null && "预结算合并".equals(formal.getSourceType());
|
||||
}
|
||||
private boolean hasTailPayment(Long formalSettlementId) {
|
||||
return formalSettlementId != null && tailPaymentSettlementIds(List.of(formalSettlementId))
|
||||
.contains(formalSettlementId);
|
||||
}
|
||||
private Set<Long> tailPaymentSettlementIds(List<Long> formalSettlementIds) {
|
||||
if (formalSettlementIds == null || formalSettlementIds.isEmpty()) return Set.of();
|
||||
Set<Long> result = new HashSet<>(formalPaymentMapper.selectList(
|
||||
Wrappers.<FormalSettlementPayment>lambdaQuery()
|
||||
.eq(FormalSettlementPayment::getIsDeleted, 0)
|
||||
.in(FormalSettlementPayment::getFormalSettlementId, formalSettlementIds)
|
||||
.notIn(FormalSettlementPayment::getBillStatus, RETURNED, VOIDED)).stream()
|
||||
.map(FormalSettlementPayment::getFormalSettlementId)
|
||||
.filter(Objects::nonNull).toList());
|
||||
result.addAll(paymentApplicationMapper.selectList(Wrappers.<PaymentApplication>lambdaQuery()
|
||||
.select(PaymentApplication::getSettlementId)
|
||||
.in(PaymentApplication::getSettlementId, formalSettlementIds)
|
||||
.eq(PaymentApplication::getPaymentType, "settlement_payment")
|
||||
.eq(PaymentApplication::getIsDeleted, 0)
|
||||
.notIn(PaymentApplication::getApprovalStatus, RETURNED, VOIDED)).stream()
|
||||
.map(PaymentApplication::getSettlementId).filter(Objects::nonNull).toList());
|
||||
List<PaymentApplicationSettlement> relations = paymentApplicationSettlementMapper.selectList(
|
||||
Wrappers.<PaymentApplicationSettlement>lambdaQuery()
|
||||
.select(PaymentApplicationSettlement::getPaymentApplicationId,
|
||||
PaymentApplicationSettlement::getFormalSettlementId)
|
||||
.in(PaymentApplicationSettlement::getFormalSettlementId, formalSettlementIds)
|
||||
.eq(PaymentApplicationSettlement::getIsDeleted, 0));
|
||||
List<Long> applicationIds = relations.stream()
|
||||
.map(PaymentApplicationSettlement::getPaymentApplicationId)
|
||||
.filter(Objects::nonNull).distinct().toList();
|
||||
if (applicationIds.isEmpty()) return result;
|
||||
Set<Long> activeApplicationIds = new HashSet<>(paymentApplicationMapper.selectList(
|
||||
Wrappers.<PaymentApplication>lambdaQuery()
|
||||
.select(PaymentApplication::getId)
|
||||
.in(PaymentApplication::getId, applicationIds)
|
||||
.eq(PaymentApplication::getPaymentType, "settlement_payment")
|
||||
.eq(PaymentApplication::getIsDeleted, 0)
|
||||
.notIn(PaymentApplication::getApprovalStatus, RETURNED, VOIDED)).stream()
|
||||
.map(PaymentApplication::getId).filter(Objects::nonNull).toList());
|
||||
relations.stream().filter(relation -> activeApplicationIds.contains(relation.getPaymentApplicationId()))
|
||||
.map(PaymentApplicationSettlement::getFormalSettlementId).filter(Objects::nonNull)
|
||||
.forEach(result::add);
|
||||
return result;
|
||||
}
|
||||
private boolean isManualFee(SettlementAdjustmentSaveRequest.Detail row) { return row.getFormalSettlementDetailId() == null && row.getFormalSettlementDetailFeeId() == null; }
|
||||
private boolean isManualFee(SettlementAdjustmentDetail row) { return row.getFormalSettlementDetailId() == null && row.getFormalSettlementDetailFeeId() == null; }
|
||||
private FormalSettlementDetailFee validateFee(Long formalId, Long detailId, Long feeId) { FormalSettlementDetail detail = formalDetailMapper.selectById(detailId); FormalSettlementDetailFee fee = formalFeeMapper.selectById(feeId); if (detail == null || fee == null || !Objects.equals(detail.getFormalSettlementId(), formalId) || !Objects.equals(fee.getFormalSettlementDetailId(), detailId)) throw new ServiceException("费用明细不存在或不属于关联正式结算单"); return fee; }
|
||||
|
||||
Reference in New Issue
Block a user