fix bug
This commit is contained in:
@@ -344,3 +344,4 @@ id parent_id code name alias path source sort category action is_open component
|
||||
2075431753298714626 2075431169720033282 airport_master_status 修改状态 airport_master_status 1 2 0 1 0
|
||||
2075431820189474818 2075431169720033282 airport_master_add 新增 airport_master_add 1 2 0 1 0
|
||||
```
|
||||
2.生成的表、字段的排序规则要使用utf8mb4_general_ci
|
||||
@@ -39,7 +39,10 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
||||
* @author Chill
|
||||
*/
|
||||
public class RegionCache {
|
||||
public static final String MAIN_CODE = "00";
|
||||
public static final String ROOT_PARENT_CODE = "0";
|
||||
public static final String MAIN_CODE = "+86";
|
||||
public static final String LEGACY_MAIN_CODE = "00";
|
||||
public static final int COUNTRY_LEVEL = 0;
|
||||
public static final int PROVINCE_LEVEL = 1;
|
||||
public static final int CITY_LEVEL = 2;
|
||||
public static final int DISTRICT_LEVEL = 3;
|
||||
|
||||
@@ -93,6 +93,21 @@ public class AirportMaster extends BaseEntity {
|
||||
*/
|
||||
@Schema(description = "所属城市")
|
||||
private String cityName;
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
@Schema(description = "行政区划编码")
|
||||
private String regionCode;
|
||||
/**
|
||||
* 行政区划
|
||||
*/
|
||||
@Schema(description = "行政区划")
|
||||
private String regionName;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "详细地址")
|
||||
private String detailAddress;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
|
||||
@@ -93,6 +93,21 @@ public class RailwayStation extends BaseEntity {
|
||||
*/
|
||||
@Schema(description = "所属城市")
|
||||
private String cityName;
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
@Schema(description = "行政区划编码")
|
||||
private String regionCode;
|
||||
/**
|
||||
* 行政区划
|
||||
*/
|
||||
@Schema(description = "行政区划")
|
||||
private String regionName;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "详细地址")
|
||||
private String detailAddress;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
|
||||
@@ -121,9 +121,9 @@ public class RegionController extends BladeController {
|
||||
})
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "懒加载列表", description = "传入menu")
|
||||
public R<List<RegionVO>> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
|
||||
List<RegionVO> list = regionService.lazyTree(parentCode, menu);
|
||||
return R.data(RegionWrapper.build().listNodeLazyVO(list));
|
||||
public R<List<Map<String, Object>>> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
|
||||
List<Map<String, Object>> list = regionService.lazyTree(parentCode, menu);
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +173,7 @@ public class RegionController extends BladeController {
|
||||
@GetMapping("/select")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "下拉数据源", description = "传入tenant")
|
||||
public R<List<Region>> select(@RequestParam(required = false, defaultValue = "00") String code) {
|
||||
public R<List<Region>> select(@RequestParam(required = false, defaultValue = "+86") String code) {
|
||||
List<Region> list = regionService.list(Wrappers.<Region>query().lambda().eq(Region::getParentCode, code));
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,12 @@ public class AirportMasterExcel implements Serializable {
|
||||
@ExcelProperty("所属城市")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("行政区划")
|
||||
private String regionName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public class RailwayStationExcel implements Serializable {
|
||||
@ExcelProperty("车站名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("所属铁路线路")
|
||||
private String railwayLine;
|
||||
// @ExcelProperty("所属铁路线路")
|
||||
// private String railwayLine;
|
||||
|
||||
@ExcelProperty("所属省份")
|
||||
private String provinceName;
|
||||
@@ -73,6 +73,12 @@ public class RailwayStationExcel implements Serializable {
|
||||
@ExcelProperty("所属城市")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("行政区划")
|
||||
private String regionName;
|
||||
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_user_name" property="updateUserName"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
@@ -20,6 +21,9 @@
|
||||
<result column="province_name" property="provinceName"/>
|
||||
<result column="city_code" property="cityCode"/>
|
||||
<result column="city_name" property="cityName"/>
|
||||
<result column="region_code" property="regionCode"/>
|
||||
<result column="region_name" property="regionName"/>
|
||||
<result column="detail_address" property="detailAddress"/>
|
||||
<result column="longitude" property="longitude"/>
|
||||
<result column="latitude" property="latitude"/>
|
||||
<result column="data_source" property="dataSource"/>
|
||||
@@ -28,59 +32,72 @@
|
||||
|
||||
<select id="selectAirportMasterPage" resultMap="airportMasterResultMap">
|
||||
SELECT
|
||||
id,
|
||||
create_user,
|
||||
create_dept,
|
||||
create_time,
|
||||
update_user,
|
||||
update_time,
|
||||
status,
|
||||
is_deleted,
|
||||
code,
|
||||
iata_code,
|
||||
icao_code,
|
||||
name,
|
||||
short_name,
|
||||
province_code,
|
||||
province_name,
|
||||
city_code,
|
||||
city_name,
|
||||
longitude,
|
||||
latitude,
|
||||
CASE WHEN data_source = '手工导入' THEN '手动录入' ELSE data_source END AS data_source,
|
||||
remark
|
||||
am.id,
|
||||
am.create_user,
|
||||
am.create_dept,
|
||||
am.create_time,
|
||||
am.update_user,
|
||||
bu.real_name AS update_user_name,
|
||||
am.update_time,
|
||||
am.status,
|
||||
am.is_deleted,
|
||||
am.code,
|
||||
am.iata_code,
|
||||
am.icao_code,
|
||||
am.name,
|
||||
am.short_name,
|
||||
am.province_code,
|
||||
am.province_name,
|
||||
am.city_code,
|
||||
am.city_name,
|
||||
am.region_code,
|
||||
am.region_name,
|
||||
am.detail_address,
|
||||
am.longitude,
|
||||
am.latitude,
|
||||
CASE WHEN am.data_source = '手工导入' THEN '手动录入' ELSE am.data_source END AS data_source,
|
||||
am.remark
|
||||
FROM
|
||||
blade_airport_master
|
||||
blade_airport_master am
|
||||
LEFT JOIN blade_user bu ON bu.id = am.update_user
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
am.is_deleted = 0
|
||||
<if test="airportMaster.code != null and airportMaster.code != ''">
|
||||
<bind name="codeLike" value="'%' + airportMaster.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
AND am.code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="airportMaster.name != null and airportMaster.name != ''">
|
||||
<bind name="nameLike" value="'%' + airportMaster.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
AND am.name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="airportMaster.iataCode != null and airportMaster.iataCode != ''">
|
||||
AND iata_code = #{airportMaster.iataCode}
|
||||
AND am.iata_code = #{airportMaster.iataCode}
|
||||
</if>
|
||||
<if test="airportMaster.icaoCode != null and airportMaster.icaoCode != ''">
|
||||
AND icao_code = #{airportMaster.icaoCode}
|
||||
AND am.icao_code = #{airportMaster.icaoCode}
|
||||
</if>
|
||||
<if test="airportMaster.regionName != null and airportMaster.regionName != ''">
|
||||
<bind name="regionNameLike" value="'%' + airportMaster.regionName + '%'"/>
|
||||
AND am.region_name LIKE #{regionNameLike}
|
||||
</if>
|
||||
<if test="airportMaster.detailAddress != null and airportMaster.detailAddress != ''">
|
||||
<bind name="detailAddressLike" value="'%' + airportMaster.detailAddress + '%'"/>
|
||||
AND am.detail_address LIKE #{detailAddressLike}
|
||||
</if>
|
||||
<if test="airportMaster.dataSource != null and airportMaster.dataSource != ''">
|
||||
<choose>
|
||||
<when test="airportMaster.dataSource == '手动录入'">
|
||||
AND data_source IN ('手动录入', '手工导入')
|
||||
AND am.data_source IN ('手动录入', '手工导入')
|
||||
</when>
|
||||
<otherwise>
|
||||
AND data_source = #{airportMaster.dataSource}
|
||||
AND am.data_source = #{airportMaster.dataSource}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="airportMaster.status != null">
|
||||
AND status = #{airportMaster.status}
|
||||
AND am.status = #{airportMaster.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
ORDER BY am.update_time DESC, am.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_user_name" property="updateUserName"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
@@ -27,61 +28,63 @@
|
||||
|
||||
<select id="selectPortTerminalPage" resultMap="portTerminalResultMap">
|
||||
SELECT
|
||||
id,
|
||||
create_user,
|
||||
create_dept,
|
||||
create_time,
|
||||
update_user,
|
||||
update_time,
|
||||
status,
|
||||
is_deleted,
|
||||
code,
|
||||
name,
|
||||
category,
|
||||
parent_id,
|
||||
parent_code,
|
||||
parent_name,
|
||||
country,
|
||||
city,
|
||||
CASE WHEN longitude BETWEEN -180 AND 180 THEN longitude ELSE NULL END AS longitude,
|
||||
CASE WHEN latitude BETWEEN -90 AND 90 THEN latitude ELSE NULL END AS latitude,
|
||||
CASE WHEN data_source = '初始导入' THEN '初始化导入' ELSE data_source END AS data_source,
|
||||
remark
|
||||
pt.id,
|
||||
pt.create_user,
|
||||
pt.create_dept,
|
||||
pt.create_time,
|
||||
pt.update_user,
|
||||
bu.real_name AS update_user_name,
|
||||
pt.update_time,
|
||||
pt.status,
|
||||
pt.is_deleted,
|
||||
pt.code,
|
||||
pt.name,
|
||||
pt.category,
|
||||
pt.parent_id,
|
||||
pt.parent_code,
|
||||
pt.parent_name,
|
||||
pt.country,
|
||||
pt.city,
|
||||
CASE WHEN pt.longitude BETWEEN -180 AND 180 THEN pt.longitude ELSE NULL END AS longitude,
|
||||
CASE WHEN pt.latitude BETWEEN -90 AND 90 THEN pt.latitude ELSE NULL END AS latitude,
|
||||
CASE WHEN pt.data_source = '初始导入' THEN '初始化导入' ELSE pt.data_source END AS data_source,
|
||||
pt.remark
|
||||
FROM
|
||||
blade_port_terminal
|
||||
blade_port_terminal pt
|
||||
LEFT JOIN blade_user bu ON bu.id = pt.update_user
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
pt.is_deleted = 0
|
||||
<if test="portTerminal.code != null and portTerminal.code != ''">
|
||||
<bind name="codeLike" value="'%' + portTerminal.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
AND pt.code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="portTerminal.name != null and portTerminal.name != ''">
|
||||
<bind name="nameLike" value="'%' + portTerminal.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
AND pt.name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="portTerminal.category != null and portTerminal.category != ''">
|
||||
AND category = #{portTerminal.category}
|
||||
AND pt.category = #{portTerminal.category}
|
||||
</if>
|
||||
<if test="portTerminal.dataSource != null and portTerminal.dataSource != ''">
|
||||
<choose>
|
||||
<when test="portTerminal.dataSource == '初始化导入'">
|
||||
AND data_source IN ('初始化导入', '初始导入')
|
||||
AND pt.data_source IN ('初始化导入', '初始导入')
|
||||
</when>
|
||||
<otherwise>
|
||||
AND data_source = #{portTerminal.dataSource}
|
||||
AND pt.data_source = #{portTerminal.dataSource}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="portTerminal.city != null and portTerminal.city != ''">
|
||||
AND city = #{portTerminal.city}
|
||||
AND pt.city = #{portTerminal.city}
|
||||
</if>
|
||||
<if test="portTerminal.country != null and portTerminal.country != ''">
|
||||
AND country = #{portTerminal.country}
|
||||
AND pt.country = #{portTerminal.country}
|
||||
</if>
|
||||
<if test="portTerminal.status != null">
|
||||
AND status = #{portTerminal.status}
|
||||
AND pt.status = #{portTerminal.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
ORDER BY pt.update_time DESC, pt.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_user_name" property="updateUserName"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
@@ -20,6 +21,9 @@
|
||||
<result column="province_name" property="provinceName"/>
|
||||
<result column="city_code" property="cityCode"/>
|
||||
<result column="city_name" property="cityName"/>
|
||||
<result column="region_code" property="regionCode"/>
|
||||
<result column="region_name" property="regionName"/>
|
||||
<result column="detail_address" property="detailAddress"/>
|
||||
<result column="longitude" property="longitude"/>
|
||||
<result column="latitude" property="latitude"/>
|
||||
<result column="data_source" property="dataSource"/>
|
||||
@@ -28,70 +32,83 @@
|
||||
|
||||
<select id="selectRailwayStationPage" resultMap="railwayStationResultMap">
|
||||
SELECT
|
||||
id,
|
||||
create_user,
|
||||
create_dept,
|
||||
create_time,
|
||||
update_user,
|
||||
update_time,
|
||||
status,
|
||||
is_deleted,
|
||||
code,
|
||||
tmis_code,
|
||||
telegraph_code,
|
||||
name,
|
||||
railway_line,
|
||||
province_code,
|
||||
province_name,
|
||||
city_code,
|
||||
city_name,
|
||||
longitude,
|
||||
latitude,
|
||||
rs.id,
|
||||
rs.create_user,
|
||||
rs.create_dept,
|
||||
rs.create_time,
|
||||
rs.update_user,
|
||||
bu.real_name AS update_user_name,
|
||||
rs.update_time,
|
||||
rs.status,
|
||||
rs.is_deleted,
|
||||
rs.code,
|
||||
rs.tmis_code,
|
||||
rs.telegraph_code,
|
||||
rs.name,
|
||||
rs.railway_line,
|
||||
rs.province_code,
|
||||
rs.province_name,
|
||||
rs.city_code,
|
||||
rs.city_name,
|
||||
rs.region_code,
|
||||
rs.region_name,
|
||||
rs.detail_address,
|
||||
rs.longitude,
|
||||
rs.latitude,
|
||||
CASE
|
||||
WHEN data_source = '初始导入' THEN '初始化导入'
|
||||
WHEN data_source = '批量导入' THEN '批量'
|
||||
WHEN data_source IN ('手工导入', '手动录入') THEN '手动'
|
||||
ELSE data_source
|
||||
WHEN rs.data_source = '初始导入' THEN '初始化导入'
|
||||
WHEN rs.data_source = '批量导入' THEN '批量'
|
||||
WHEN rs.data_source IN ('手工导入', '手动录入') THEN '手动'
|
||||
ELSE rs.data_source
|
||||
END AS data_source,
|
||||
remark
|
||||
rs.remark
|
||||
FROM
|
||||
blade_railway_station
|
||||
blade_railway_station rs
|
||||
LEFT JOIN blade_user bu ON bu.id = rs.update_user
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
rs.is_deleted = 0
|
||||
<if test="railwayStation.code != null and railwayStation.code != ''">
|
||||
<bind name="codeLike" value="'%' + railwayStation.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
AND rs.code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="railwayStation.name != null and railwayStation.name != ''">
|
||||
<bind name="nameLike" value="'%' + railwayStation.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
AND rs.name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="railwayStation.tmisCode != null and railwayStation.tmisCode != ''">
|
||||
AND tmis_code = #{railwayStation.tmisCode}
|
||||
AND rs.tmis_code = #{railwayStation.tmisCode}
|
||||
</if>
|
||||
<if test="railwayStation.telegraphCode != null and railwayStation.telegraphCode != ''">
|
||||
AND telegraph_code = #{railwayStation.telegraphCode}
|
||||
AND rs.telegraph_code = #{railwayStation.telegraphCode}
|
||||
</if>
|
||||
<if test="railwayStation.regionName != null and railwayStation.regionName != ''">
|
||||
<bind name="regionNameLike" value="'%' + railwayStation.regionName + '%'"/>
|
||||
AND rs.region_name LIKE #{regionNameLike}
|
||||
</if>
|
||||
<if test="railwayStation.detailAddress != null and railwayStation.detailAddress != ''">
|
||||
<bind name="detailAddressLike" value="'%' + railwayStation.detailAddress + '%'"/>
|
||||
AND rs.detail_address LIKE #{detailAddressLike}
|
||||
</if>
|
||||
<if test="railwayStation.dataSource != null and railwayStation.dataSource != ''">
|
||||
<choose>
|
||||
<when test="railwayStation.dataSource == '初始化导入'">
|
||||
AND data_source IN ('初始化导入', '初始导入')
|
||||
AND rs.data_source IN ('初始化导入', '初始导入')
|
||||
</when>
|
||||
<when test="railwayStation.dataSource == '批量'">
|
||||
AND data_source IN ('批量', '批量导入')
|
||||
AND rs.data_source IN ('批量', '批量导入')
|
||||
</when>
|
||||
<when test="railwayStation.dataSource == '手动'">
|
||||
AND data_source IN ('手动', '手动录入', '手工导入')
|
||||
AND rs.data_source IN ('手动', '手动录入', '手工导入')
|
||||
</when>
|
||||
<otherwise>
|
||||
AND data_source = #{railwayStation.dataSource}
|
||||
AND rs.data_source = #{railwayStation.dataSource}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="railwayStation.status != null">
|
||||
AND status = #{railwayStation.status}
|
||||
AND rs.status = #{railwayStation.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
ORDER BY rs.update_time DESC, rs.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -58,7 +58,7 @@ public interface RegionMapper extends BaseMapper<Region> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RegionVO> lazyTree(String parentCode, Map<String, Object> param);
|
||||
List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 导出区划数据
|
||||
|
||||
@@ -74,14 +74,14 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="lazyTree" resultMap="treeNodeResultMap">
|
||||
<select id="lazyTree" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
region.code AS "id",
|
||||
region.parent_code AS "parent_id",
|
||||
region.name AS "title",
|
||||
region.code AS "value",
|
||||
region.code AS "key",
|
||||
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS "has_children"
|
||||
region.code AS id,
|
||||
region.parent_code AS parentId,
|
||||
region.name AS title,
|
||||
region.code AS value,
|
||||
region.code AS `key`,
|
||||
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS hasChildren
|
||||
FROM
|
||||
blade_region region
|
||||
<where>
|
||||
|
||||
@@ -73,7 +73,7 @@ public interface IRegionService extends IService<Region> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RegionVO> lazyTree(String parentCode, Map<String, Object> param);
|
||||
List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 导入区划数据
|
||||
|
||||
@@ -65,12 +65,15 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
private static final String SOURCE_BATCH = "批量导入";
|
||||
private static final String SOURCE_MANUAL = "手动录入";
|
||||
private static final String SOURCE_MANUAL_OLD = "手工导入";
|
||||
private static final String DEFAULT_COUNTRY_CODE = "+86";
|
||||
private static final int STATUS_ENABLED = 1;
|
||||
private static final int STATUS_DISABLED = 2;
|
||||
private static final int CODE_MAX_LENGTH = 20;
|
||||
private static final int NAME_MAX_LENGTH = 100;
|
||||
private static final int SHORT_NAME_MAX_LENGTH = 100;
|
||||
private static final int REGION_NAME_MAX_LENGTH = 128;
|
||||
private static final int REGION_CODE_MAX_LENGTH = 32;
|
||||
private static final int DETAIL_ADDRESS_MAX_LENGTH = 255;
|
||||
private static final int REMARK_MAX_LENGTH = 200;
|
||||
private static final Pattern IATA_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
|
||||
private static final Pattern ICAO_CODE_PATTERN = Pattern.compile("^[A-Z]{4}$");
|
||||
@@ -160,6 +163,9 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
airportMaster.setProvinceName(trimToNull(airportMaster.getProvinceName()));
|
||||
airportMaster.setCityCode(trimToNull(airportMaster.getCityCode()));
|
||||
airportMaster.setCityName(trimToNull(airportMaster.getCityName()));
|
||||
airportMaster.setRegionCode(trimToNull(airportMaster.getRegionCode()));
|
||||
airportMaster.setRegionName(trimToNull(airportMaster.getRegionName()));
|
||||
airportMaster.setDetailAddress(trimToNull(airportMaster.getDetailAddress()));
|
||||
airportMaster.setRemark(trimToNull(airportMaster.getRemark()));
|
||||
airportMaster.setDataSource(normalizeDataSource(Func.toStrWithEmpty(airportMaster.getDataSource(), defaultDataSource)));
|
||||
if (Func.isEmpty(airportMaster.getStatus())) {
|
||||
@@ -189,6 +195,9 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
validateLength(airportMaster.getShortName(), SHORT_NAME_MAX_LENGTH, "机场简称不能超过100字");
|
||||
validateLength(airportMaster.getProvinceName(), REGION_NAME_MAX_LENGTH, "所属省份不能超过128字");
|
||||
validateLength(airportMaster.getCityName(), REGION_NAME_MAX_LENGTH, "所属城市不能超过128字");
|
||||
validateLength(airportMaster.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编码不能超过32字");
|
||||
validateLength(airportMaster.getRegionName(), REGION_NAME_MAX_LENGTH, "行政区划不能超过128字");
|
||||
validateLength(airportMaster.getDetailAddress(), DETAIL_ADDRESS_MAX_LENGTH, "详细地址不能超过255字");
|
||||
validateLength(airportMaster.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字");
|
||||
if (Func.isEmpty(airportMaster.getProvinceCode()) || Func.isEmpty(airportMaster.getCityCode())) {
|
||||
throw new ServiceException("请选择省份和城市");
|
||||
@@ -209,7 +218,7 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
|
||||
}
|
||||
if (Func.isEmpty(province) && Func.isNotEmpty(airportMaster.getProvinceName())) {
|
||||
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, "00")
|
||||
.eq(Region::getParentCode, DEFAULT_COUNTRY_CODE)
|
||||
.eq(Region::getName, airportMaster.getProvinceName()), false);
|
||||
}
|
||||
if (Func.isEmpty(province)) {
|
||||
|
||||
@@ -68,12 +68,15 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
private static final String SOURCE_MANUAL = "手动";
|
||||
private static final String SOURCE_MANUAL_RECORD = "手动录入";
|
||||
private static final String SOURCE_MANUAL_OLD = "手工导入";
|
||||
private static final String DEFAULT_COUNTRY_CODE = "+86";
|
||||
private static final int STATUS_ENABLED = 1;
|
||||
private static final int STATUS_DISABLED = 2;
|
||||
private static final int CODE_MAX_LENGTH = 20;
|
||||
private static final int NAME_MAX_LENGTH = 100;
|
||||
private static final int RAILWAY_LINE_MAX_LENGTH = 100;
|
||||
private static final int REGION_NAME_MAX_LENGTH = 128;
|
||||
private static final int REGION_CODE_MAX_LENGTH = 32;
|
||||
private static final int DETAIL_ADDRESS_MAX_LENGTH = 255;
|
||||
private static final int REMARK_MAX_LENGTH = 200;
|
||||
private static final Pattern TMIS_CODE_PATTERN = Pattern.compile("^\\d{5}$");
|
||||
private static final Pattern TELEGRAPH_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
|
||||
@@ -163,6 +166,9 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
railwayStation.setProvinceName(trimToNull(railwayStation.getProvinceName()));
|
||||
railwayStation.setCityCode(trimToNull(railwayStation.getCityCode()));
|
||||
railwayStation.setCityName(trimToNull(railwayStation.getCityName()));
|
||||
railwayStation.setRegionCode(trimToNull(railwayStation.getRegionCode()));
|
||||
railwayStation.setRegionName(trimToNull(railwayStation.getRegionName()));
|
||||
railwayStation.setDetailAddress(trimToNull(railwayStation.getDetailAddress()));
|
||||
railwayStation.setRemark(trimToNull(railwayStation.getRemark()));
|
||||
railwayStation.setDataSource(normalizeDataSource(Func.toStrWithEmpty(railwayStation.getDataSource(), defaultDataSource)));
|
||||
if (Func.isEmpty(railwayStation.getStatus())) {
|
||||
@@ -189,9 +195,12 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
}
|
||||
validateLength(railwayStation.getCode(), CODE_MAX_LENGTH, "编码不能超过20字");
|
||||
validateLength(railwayStation.getName(), NAME_MAX_LENGTH, "车站名称不能超过100字");
|
||||
validateLength(railwayStation.getRailwayLine(), RAILWAY_LINE_MAX_LENGTH, "所属铁路线路不能超过100字");
|
||||
// validateLength(railwayStation.getRailwayLine(), RAILWAY_LINE_MAX_LENGTH, "所属铁路线路不能超过100字");
|
||||
validateLength(railwayStation.getProvinceName(), REGION_NAME_MAX_LENGTH, "所属省份不能超过128字");
|
||||
validateLength(railwayStation.getCityName(), REGION_NAME_MAX_LENGTH, "所属城市不能超过128字");
|
||||
validateLength(railwayStation.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编码不能超过32字");
|
||||
validateLength(railwayStation.getRegionName(), REGION_NAME_MAX_LENGTH, "行政区划不能超过128字");
|
||||
validateLength(railwayStation.getDetailAddress(), DETAIL_ADDRESS_MAX_LENGTH, "详细地址不能超过255字");
|
||||
validateLength(railwayStation.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字");
|
||||
if (Func.isEmpty(railwayStation.getProvinceCode()) || Func.isEmpty(railwayStation.getCityCode())) {
|
||||
throw new ServiceException("请选择省份和城市");
|
||||
@@ -212,7 +221,7 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
|
||||
}
|
||||
if (Func.isEmpty(province) && Func.isNotEmpty(railwayStation.getProvinceName())) {
|
||||
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, "00")
|
||||
.eq(Region::getParentCode, DEFAULT_COUNTRY_CODE)
|
||||
.eq(Region::getName, railwayStation.getProvinceName()), false);
|
||||
}
|
||||
if (Func.isEmpty(province)) {
|
||||
|
||||
@@ -57,14 +57,24 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
||||
|
||||
@Override
|
||||
public boolean submit(Region region) {
|
||||
// 设置市级编号格式
|
||||
String regionCode = region.getCode();
|
||||
String regionParentCode = region.getParentCode();
|
||||
if (regionCode.startsWith(MAIN_CODE)) {
|
||||
region.setCode(StringUtil.removePrefix(regionCode, MAIN_CODE));
|
||||
}
|
||||
if (regionParentCode.startsWith(MAIN_CODE)) {
|
||||
region.setParentCode(StringUtil.removePrefix(regionParentCode, MAIN_CODE));
|
||||
Integer level = region.getRegionLevel();
|
||||
if (level != null && level == COUNTRY_LEVEL) {
|
||||
region.setParentCode(ROOT_PARENT_CODE);
|
||||
region.setAncestors(ROOT_PARENT_CODE);
|
||||
} else {
|
||||
if (LEGACY_MAIN_CODE.equals(regionParentCode)) {
|
||||
region.setParentCode(MAIN_CODE);
|
||||
}
|
||||
if (StringUtil.isNotBlank(regionCode) && regionCode.startsWith(LEGACY_MAIN_CODE)) {
|
||||
region.setCode(StringUtil.removePrefix(regionCode, LEGACY_MAIN_CODE));
|
||||
}
|
||||
if (MAIN_CODE.equals(region.getParentCode())
|
||||
&& StringUtil.isNotBlank(region.getCode())
|
||||
&& region.getCode().startsWith(MAIN_CODE)) {
|
||||
region.setCode(StringUtil.removePrefix(region.getCode(), MAIN_CODE));
|
||||
}
|
||||
}
|
||||
// 查询是否已存在
|
||||
Long cnt = baseMapper.selectCount(Wrappers.<Region>query().lambda().eq(Region::getCode, region.getCode()));
|
||||
@@ -74,11 +84,14 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
||||
// 设置祖区划编号
|
||||
Region parent = getByCode(region.getParentCode());
|
||||
if (Func.isNotEmpty(parent) && Func.isNotEmpty(parent.getCode())) {
|
||||
String ancestors = parent.getAncestors() + StringPool.COMMA + parent.getCode();
|
||||
String ancestors = parent.getRegionLevel() != null && parent.getRegionLevel() == COUNTRY_LEVEL
|
||||
? parent.getCode()
|
||||
: parent.getAncestors() + StringPool.COMMA + parent.getCode();
|
||||
region.setAncestors(ancestors);
|
||||
} else if (MAIN_CODE.equals(region.getParentCode())) {
|
||||
region.setAncestors(MAIN_CODE);
|
||||
}
|
||||
// 设置省、市、区、镇、村
|
||||
Integer level = region.getRegionLevel();
|
||||
String code = region.getCode();
|
||||
String name = region.getName();
|
||||
if (level == PROVINCE_LEVEL) {
|
||||
@@ -115,7 +128,7 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RegionVO> lazyTree(String parentCode, Map<String, Object> param) {
|
||||
public List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param) {
|
||||
return baseMapper.lazyTree(parentCode, param);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.springblade.system.pojo.vo.RegionVO;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.springblade.system.cache.RegionCache.ROOT_PARENT_CODE;
|
||||
|
||||
/**
|
||||
* 包装类,返回视图层所需的字段
|
||||
*
|
||||
@@ -50,7 +52,11 @@ public class RegionWrapper extends BaseEntityWrapper<Region, RegionVO> {
|
||||
public RegionVO entityVO(Region region) {
|
||||
RegionVO regionVO = Objects.requireNonNull(BeanUtil.copyProperties(region, RegionVO.class));
|
||||
Region parentRegion = RegionCache.getByCode(region.getParentCode());
|
||||
regionVO.setParentName(parentRegion.getName());
|
||||
if (Objects.nonNull(parentRegion)) {
|
||||
regionVO.setParentName(parentRegion.getName());
|
||||
} else if (ROOT_PARENT_CODE.equals(region.getParentCode())) {
|
||||
regionVO.setParentName("根节点");
|
||||
}
|
||||
return regionVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,8 @@ public class CustomerArchiveController extends BladeController {
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入customerArchive")
|
||||
public R submit(@RequestBody CustomerArchiveVO customerArchive) {
|
||||
return R.status(customerArchiveService.submit(customerArchive));
|
||||
boolean result = customerArchiveService.submit(customerArchive);
|
||||
return result ? R.data(customerArchive.getId()) : R.status(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,6 +129,12 @@ public class AccidentRecordServiceImpl extends BaseServiceImpl<AccidentRecordMap
|
||||
if (Func.isEmpty(accidentRecord.getAccidentDate())) {
|
||||
throw new ServiceException("事故发生日期不能为空");
|
||||
}
|
||||
if (Func.isEmpty(accidentRecord.getAccidentNature())) {
|
||||
throw new ServiceException("事故性质不能为空");
|
||||
}
|
||||
if (Func.isEmpty(accidentRecord.getAccidentResponsibility())) {
|
||||
throw new ServiceException("事故责任不能为空");
|
||||
}
|
||||
validateLength(accidentRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字");
|
||||
validateLength(accidentRecord.getAccidentLocation(), LOCATION_MAX_LENGTH, "事故发生地点不能超过100字");
|
||||
validateLength(accidentRecord.getAccidentReasonDamage(), REASON_DAMAGE_MAX_LENGTH, "事故原因及损坏情况不能超过500字");
|
||||
|
||||
@@ -73,12 +73,14 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -99,6 +101,8 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
private static final String APPROVAL_APPROVED = "approved";
|
||||
private static final String APPROVAL_REJECTED = "rejected";
|
||||
private static final String CUSTOMER_CODE_PREFIX = "KS";
|
||||
private static final Set<String> CUSTOMER_NATURES = Set.of("有限公司", "个体工商户");
|
||||
private static final Set<String> CUSTOMER_TYPES = Set.of("客户", "承运商");
|
||||
|
||||
private final CustomerContactMapper contactMapper;
|
||||
private final CustomerReceiptAccountMapper receiptAccountMapper;
|
||||
@@ -146,6 +150,7 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
}
|
||||
CustomerArchive entity = Objects.requireNonNull(BeanUtil.copyProperties(customer, CustomerArchive.class));
|
||||
boolean result = saveOrUpdate(entity);
|
||||
customer.setId(entity.getId());
|
||||
replaceDetail(entity.getId(), customer);
|
||||
addChangeRecord(entity.getId(), created ? "新增客商档案" : "修改客商档案");
|
||||
return result;
|
||||
@@ -274,6 +279,9 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
if (Func.isEmpty(customer.getCustomerNature())) {
|
||||
throw new ServiceException("客商性质不能为空");
|
||||
}
|
||||
if (!CUSTOMER_NATURES.contains(customer.getCustomerNature())) {
|
||||
throw new ServiceException("客商性质只能选择有限公司或个体工商户");
|
||||
}
|
||||
if (Func.isEmpty(customer.getUnifiedCreditCode())) {
|
||||
throw new ServiceException("统一社会信用代码不能为空");
|
||||
}
|
||||
@@ -283,6 +291,7 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
if (Func.isEmpty(customer.getCustomerType())) {
|
||||
throw new ServiceException("客商类型不能为空");
|
||||
}
|
||||
validateCustomerType(customer.getCustomerType());
|
||||
if (Func.isEmpty(customer.getLegalPerson())) {
|
||||
throw new ServiceException("法人/负责人不能为空");
|
||||
}
|
||||
@@ -295,8 +304,13 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
if (Func.isEmpty(customer.getDeptName())) {
|
||||
throw new ServiceException("所属组织不能为空");
|
||||
}
|
||||
if (Objects.equals(customer.getBusinessTermType(), "固定期限") && Func.isEmpty(customer.getBusinessEndDate())) {
|
||||
throw new ServiceException("固定营业期限必须填写营业期限截止日");
|
||||
}
|
||||
validateLength(customer.getShortName(), 20, "客商简称最多20个汉字");
|
||||
validateLength(customer.getFullName(), 100, "客商全称最多100个字符");
|
||||
validateLength(customer.getLegalPerson(), 10, "法人/负责人最多10个汉字");
|
||||
validateLength(customer.getContactPhone(), 11, "联系电话必须为11位手机号");
|
||||
validateLength(customer.getRegisteredAddress(), 200, "地址最多200个字符");
|
||||
validateLength(customer.getBusinessScope(), 500, "经营范围最多500个字符");
|
||||
validateLength(customer.getRemark(), 500, "备注最多500个字符");
|
||||
@@ -307,6 +321,21 @@ public class CustomerArchiveServiceImpl extends BaseServiceImpl<CustomerArchiveM
|
||||
validateUnique(customer);
|
||||
}
|
||||
|
||||
private void validateCustomerType(String customerType) {
|
||||
List<String> typeList = Arrays.stream(customerType.replace(",", ",").split(","))
|
||||
.map(String::trim)
|
||||
.filter(Func::isNotEmpty)
|
||||
.toList();
|
||||
if (Func.isEmpty(typeList)) {
|
||||
throw new ServiceException("客商类型不能为空");
|
||||
}
|
||||
for (String type : typeList) {
|
||||
if (!CUSTOMER_TYPES.contains(type)) {
|
||||
throw new ServiceException("客商类型只能选择客户或承运商");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateApproval(CustomerArchiveVO customer) {
|
||||
if (Objects.equals(customer.getAccessType(), ACCESS_FORMAL)) {
|
||||
if (Func.isEmpty(customer.getQualificationAttachments())) {
|
||||
|
||||
@@ -249,7 +249,7 @@ public class ViolationRecordServiceImpl extends BaseServiceImpl<ViolationRecordM
|
||||
|
||||
private String normalizeProcessStatus(String processStatus) {
|
||||
String value = trimToEmpty(processStatus);
|
||||
return value.isEmpty() ? PROCESSED : value;
|
||||
return value.isEmpty() ? UNPROCESSED : value;
|
||||
}
|
||||
|
||||
private String trimToEmpty(String value) {
|
||||
|
||||
@@ -37,7 +37,7 @@ CREATE TABLE `blade_insurance_record` (
|
||||
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898
|
||||
-- ----------------------------
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
|
||||
(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0),
|
||||
(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录(OCR)', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0),
|
||||
(2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
|
||||
(2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
|
||||
(2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),
|
||||
|
||||
@@ -29,7 +29,7 @@ CREATE TABLE `blade_mileage_record` (
|
||||
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898
|
||||
-- ----------------------------
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
|
||||
(2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0),
|
||||
(2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录(无船)', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0),
|
||||
(2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
|
||||
(2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
|
||||
(2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),
|
||||
|
||||
93
doc/sql/transport/blade_region_plus86_migration.sql
Normal file
93
doc/sql/transport/blade_region_plus86_migration.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
Navicat Premium / MySQL 5.7+
|
||||
将 blade_region 的中国国家编码统一为 +86。
|
||||
|
||||
适用场景:
|
||||
1. 旧数据使用 code = '00' 作为中国根节点;
|
||||
2. 旧数据使用 code = '86' 或 parent_code / ancestors = '86';
|
||||
3. 当前数据没有国家根节点,但省级数据 parent_code 已经是 '86'。
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
-- 1. 确保新的中国国家节点存在。
|
||||
INSERT INTO `blade_region` (
|
||||
`code`,
|
||||
`parent_code`,
|
||||
`ancestors`,
|
||||
`name`,
|
||||
`province_code`,
|
||||
`province_name`,
|
||||
`city_code`,
|
||||
`city_name`,
|
||||
`district_code`,
|
||||
`district_name`,
|
||||
`town_code`,
|
||||
`town_name`,
|
||||
`village_code`,
|
||||
`village_name`,
|
||||
`region_level`,
|
||||
`sort`,
|
||||
`remark`
|
||||
)
|
||||
SELECT
|
||||
'+86',
|
||||
'0',
|
||||
'0',
|
||||
COALESCE(
|
||||
(SELECT r.`name` FROM (SELECT `code`, `name` FROM `blade_region`) r WHERE r.`code` IN ('86', '00') ORDER BY FIELD(r.`code`, '86', '00') LIMIT 1),
|
||||
'中华人民共和国'
|
||||
),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
1,
|
||||
''
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM (SELECT `code` FROM `blade_region` WHERE `code` = '+86') exists_region
|
||||
);
|
||||
|
||||
-- 2. 如果 +86 已存在,仍强制修正它的根节点关系。
|
||||
UPDATE `blade_region`
|
||||
SET
|
||||
`parent_code` = '0',
|
||||
`ancestors` = '0',
|
||||
`region_level` = 0
|
||||
WHERE `code` = '+86';
|
||||
|
||||
-- 3. 省级节点统一挂到 +86 下。
|
||||
UPDATE `blade_region`
|
||||
SET `parent_code` = '+86'
|
||||
WHERE `parent_code` IN ('00', '86');
|
||||
|
||||
-- 4. ancestors 按逗号分隔 token 精确替换,避免误伤 110086 这类编码。
|
||||
UPDATE `blade_region`
|
||||
SET `ancestors` = TRIM(BOTH ',' FROM REPLACE(REPLACE(CONCAT(',', `ancestors`, ','), ',00,', ',+86,'), ',86,', ',+86,'))
|
||||
WHERE FIND_IN_SET('00', `ancestors`) > 0
|
||||
OR FIND_IN_SET('86', `ancestors`) > 0;
|
||||
|
||||
-- 5. 清理旧中国根节点,避免树上出现多个国家根。
|
||||
DELETE FROM `blade_region`
|
||||
WHERE `code` IN ('00', '86')
|
||||
AND (`region_level` = 0 OR `name` IN ('中华人民共和国', '中国'));
|
||||
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
-- 验证:
|
||||
-- SELECT `code`, `parent_code`, `ancestors`, `name`, `region_level` FROM `blade_region` WHERE `code` = '+86';
|
||||
-- SELECT `code`, `parent_code`, `ancestors`, `name`, `region_level` FROM `blade_region` WHERE `parent_code` = '+86' ORDER BY `code` LIMIT 20;
|
||||
-- SELECT `code`, `parent_code`, `ancestors`, `name` FROM `blade_region` WHERE `parent_code` IN ('00', '86') OR FIND_IN_SET('00', `ancestors`) > 0 OR FIND_IN_SET('86', `ancestors`) > 0;
|
||||
@@ -0,0 +1,12 @@
|
||||
-- 铁路车站、空港机场补充行政区划与详细地址字段
|
||||
-- 执行前请先备份数据库;如字段已存在,请跳过对应 ALTER。
|
||||
|
||||
ALTER TABLE `blade_railway_station`
|
||||
ADD COLUMN `region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码' AFTER `city_name`,
|
||||
ADD COLUMN `region_name` varchar(128) DEFAULT NULL COMMENT '行政区划' AFTER `region_code`,
|
||||
ADD COLUMN `detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址' AFTER `region_name`;
|
||||
|
||||
ALTER TABLE `blade_airport_master`
|
||||
ADD COLUMN `region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码' AFTER `city_name`,
|
||||
ADD COLUMN `region_name` varchar(128) DEFAULT NULL COMMENT '行政区划' AFTER `region_code`,
|
||||
ADD COLUMN `detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址' AFTER `region_name`;
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE `blade_tire_replacement_record` (
|
||||
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898
|
||||
-- ----------------------------
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
|
||||
(2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0),
|
||||
(2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录(无船)', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0),
|
||||
(2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
|
||||
(2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
|
||||
(2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),
|
||||
|
||||
@@ -32,6 +32,9 @@ CREATE TABLE `blade_airport_master` (
|
||||
`province_name` varchar(128) DEFAULT NULL COMMENT '所属省份',
|
||||
`city_code` varchar(12) DEFAULT NULL COMMENT '所属城市编码',
|
||||
`city_name` varchar(128) DEFAULT NULL COMMENT '所属城市',
|
||||
`region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码',
|
||||
`region_name` varchar(128) DEFAULT NULL COMMENT '行政区划',
|
||||
`detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址',
|
||||
`longitude` decimal(12,6) DEFAULT NULL COMMENT '经度',
|
||||
`latitude` decimal(12,6) DEFAULT NULL COMMENT '纬度',
|
||||
`data_source` varchar(20) DEFAULT '手动录入' COMMENT '数据来源',
|
||||
@@ -1039,7 +1042,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075438207636316165, 2075437082342301697, 'maintenance_record_export', '批量导出', 'maintenance_record_export', '', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444068651868162, 2075437082342301697, 'maintenance_record_list', '列表', 'maintenance_record_list', '/blade-transport/maintenance-record/list', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444261606629377, 2075437237678350338, 'maintenance_plan_list', '列表', 'maintenance_plan_list', '/blade-transport/maintenance-plan/list', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录(OCR)', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
|
||||
@@ -1058,7 +1061,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000007, 2077620000000000001, 'violation_record_template', '下载模板', 'violation_record_template', '', '', 6, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000008, 2077620000000000001, 'violation_record_export', '批量导出', 'violation_record_export', '', '', 7, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000009, 2077620000000000001, 'violation_record_list', '列表', 'violation_record_list', '/blade-transport/violation-record/list', '', 8, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录(无船)', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
|
||||
@@ -1085,7 +1088,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000007, 2077650000000000001, 'annual_inspection_record_template', '下载模板', 'annual_inspection_record_template', '', '', 6, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000008, 2077650000000000001, 'annual_inspection_record_export', '批量导出', 'annual_inspection_record_export', '', '', 7, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000009, 2077650000000000001, 'annual_inspection_record_list', '列表', 'annual_inspection_record_list', '/blade-transport/annual-inspection-record/list', '', 8, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录(无船)', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
|
||||
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
|
||||
@@ -1414,6 +1417,9 @@ CREATE TABLE `blade_railway_station` (
|
||||
`province_name` varchar(128) DEFAULT NULL COMMENT '所属省份',
|
||||
`city_code` varchar(12) DEFAULT NULL COMMENT '所属城市编码',
|
||||
`city_name` varchar(128) DEFAULT NULL COMMENT '所属城市',
|
||||
`region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码',
|
||||
`region_name` varchar(128) DEFAULT NULL COMMENT '行政区划',
|
||||
`detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址',
|
||||
`longitude` decimal(12,6) DEFAULT NULL COMMENT '经度',
|
||||
`latitude` decimal(12,6) DEFAULT NULL COMMENT '纬度',
|
||||
`data_source` varchar(20) DEFAULT '手动' COMMENT '数据来源',
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- 同步已初始化环境中的运输模块菜单标题
|
||||
UPDATE `blade_menu` SET `name` = '保险记录(OCR)' WHERE `code` = 'insurance_record' AND `is_deleted` = 0;
|
||||
UPDATE `blade_menu` SET `name` = '里程记录(无船)' WHERE `code` = 'mileage_record' AND `is_deleted` = 0;
|
||||
UPDATE `blade_menu` SET `name` = '换胎记录(无船)' WHERE `code` = 'tire_replacement_record' AND `is_deleted` = 0;
|
||||
Reference in New Issue
Block a user