代码优化
This commit is contained in:
@ -79,22 +79,10 @@ public class OrgServiceImpl implements IOrgService {
|
||||
|
||||
// 3. 解析 orgFullId(判空 + 安全分割)
|
||||
SysOrg sysOrg = baseResponse.getData();
|
||||
String orgFullId = sysOrg.getOrgFullId();
|
||||
if (StringUtils.isEmpty(orgFullId)) {
|
||||
return BaseResponse.fail("组织全ID为空");
|
||||
}
|
||||
|
||||
String[] parts = orgFullId.split(",");
|
||||
String orgId;
|
||||
if (parts.length == 1) {
|
||||
orgId = parts[0]; // 只有一级,返回一级
|
||||
} else {
|
||||
orgId = parts[1]; // 有多级,返回第二级
|
||||
}
|
||||
|
||||
// 4. 查询组织数据(判空构造参数)
|
||||
SysOrg sysOrgAll = new SysOrg();
|
||||
sysOrgAll.setOrgId(orgId);
|
||||
sysOrgAll.setOrgId(sysOrg.getUpOrgId());
|
||||
BaseResponse<List<SysOrgVO>> response = systemClient.queryAll(sysOrgAll);
|
||||
|
||||
// 5. 返回前检查接口响应
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.chinaunicom.zyhy.ebtp.supplier.common;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME) // 注解在运行时可用
|
||||
@Target(ElementType.FIELD) // 注解用于字段
|
||||
public @interface ChineseName {
|
||||
String value(); // 中文名称
|
||||
}
|
@ -46,6 +46,8 @@ public class CoscoSupplierBank extends CoscoBaseEntity {
|
||||
/** 币种 */
|
||||
//@Excel(name = "币种")
|
||||
private String currency;
|
||||
//字典名
|
||||
private String currencyName;
|
||||
|
||||
/** 国家 */
|
||||
//@Excel(name = "国家")
|
||||
@ -67,5 +69,14 @@ public class CoscoSupplierBank extends CoscoBaseEntity {
|
||||
//@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
//国家字典回显
|
||||
private String nationName;
|
||||
|
||||
//省字典回显
|
||||
private String provinceName;
|
||||
|
||||
//市回显
|
||||
private String cityName;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageRequest;
|
||||
import com.chinaunicom.zyhy.ebtp.supplier.common.ChineseName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -23,163 +22,163 @@ public class CoscoSupplierBase {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableField("主键ID")
|
||||
@ChineseName("主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@TableField("部门ID")
|
||||
@ChineseName("部门ID")
|
||||
private String deptId;
|
||||
|
||||
/** 供应商身份类型(dvs.境内企业/机构、ovs.境外企业、pe.个人) */
|
||||
@TableField("供应商身份类型")
|
||||
@ChineseName("供应商身份类型")
|
||||
private String supplierType;
|
||||
|
||||
/** 营业执照附件文件url */
|
||||
@TableField("营业执照附件文件URL")
|
||||
@ChineseName("营业执照附件文件URL")
|
||||
private String licenceAccessory;
|
||||
|
||||
/** 营业执照有效期 */
|
||||
@TableField("营业执照有效期")
|
||||
@ChineseName("营业执照有效期")
|
||||
private String licenceDate;
|
||||
|
||||
/** 企业类型(数据字典code) */
|
||||
@TableField("企业类型")
|
||||
@ChineseName("企业类型")
|
||||
private String enterpriseType;
|
||||
|
||||
/** 企业名称 */
|
||||
@TableField("企业名称")
|
||||
@ChineseName("企业名称")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String name;
|
||||
|
||||
/** 企业英文名称 */
|
||||
@TableField("企业英文名称")
|
||||
@ChineseName("企业英文名称")
|
||||
private String nameEn;
|
||||
|
||||
/** 统一社会信用代码 */
|
||||
@TableField("统一社会信用代码")
|
||||
@ChineseName("统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
/** 经营范围 */
|
||||
@TableField("经营范围")
|
||||
@ChineseName("经营范围")
|
||||
private String range;
|
||||
|
||||
/** 注册地址 */
|
||||
@TableField("注册地址")
|
||||
@ChineseName("注册地址")
|
||||
private String regAddress;
|
||||
|
||||
/** 办公地址 */
|
||||
@TableField("办公地址")
|
||||
@ChineseName("办公地址")
|
||||
private String workAddress;
|
||||
|
||||
/** 母公司/出资人信息 */
|
||||
@TableField("母公司/出资人信息")
|
||||
@ChineseName("母公司/出资人信息")
|
||||
private String parentCompanyInvestor;
|
||||
|
||||
/** 企业法定代表人/负责人 */
|
||||
@TableField("企业法定代表人/负责人")
|
||||
@ChineseName("企业法定代表人/负责人")
|
||||
private String legalPerson;
|
||||
|
||||
/** 身份证号 */
|
||||
@TableField("身份证号")
|
||||
@ChineseName("身份证号")
|
||||
private String idCard;
|
||||
|
||||
/** 注册资本/实收资本(万元) */
|
||||
@TableField("注册资本/实收资本(万元)")
|
||||
@ChineseName("注册资本/实收资本(万元)")
|
||||
private Long capital;
|
||||
|
||||
/** 联系人姓名 */
|
||||
@TableField("联系人姓名")
|
||||
@ChineseName("联系人姓名")
|
||||
private String contactsName;
|
||||
|
||||
/** 联系人手机 */
|
||||
@TableField("联系人手机")
|
||||
@ChineseName("联系人手机")
|
||||
private String contactsPhone;
|
||||
|
||||
/** 联系人身份类别 */
|
||||
@TableField("联系人身份类别")
|
||||
@ChineseName("联系人身份类别")
|
||||
private String contactsType;
|
||||
|
||||
/** 联系人邮箱 */
|
||||
@TableField("联系人邮箱")
|
||||
@ChineseName("联系人邮箱")
|
||||
private String contactsEmail;
|
||||
|
||||
/** 固定电话 */
|
||||
@TableField("固定电话")
|
||||
@ChineseName("固定电话")
|
||||
private String telephone;
|
||||
|
||||
/** 境外企业 __ 国家地区 */
|
||||
@TableField("境外企业国家地区")
|
||||
@ChineseName("境外企业国家地区")
|
||||
private String nation;
|
||||
|
||||
/** 境外企业 __ 增值税号VAT */
|
||||
@TableField("境外企业增值税号VAT")
|
||||
@ChineseName("境外企业增值税号VAT")
|
||||
private String vat;
|
||||
|
||||
/** 境外企业 __ 境外纳税人ID号 */
|
||||
@TableField("境外企业纳税人ID号")
|
||||
@ChineseName("境外企业纳税人ID号")
|
||||
private String taxpayerId;
|
||||
|
||||
/** 境外企业 __ 币种(数据字典code) */
|
||||
@TableField("境外企业币种")
|
||||
@ChineseName("境外企业币种")
|
||||
private String currency;
|
||||
|
||||
/** 个人 __ 个人姓名 */
|
||||
@TableField("个人姓名")
|
||||
@ChineseName("个人姓名")
|
||||
private String personName;
|
||||
|
||||
/** 个人 __ 个人联系电话 */
|
||||
@TableField("个人联系电话")
|
||||
@ChineseName("个人联系电话")
|
||||
@ExcelProperty("联系电话")
|
||||
private String personPhone;
|
||||
|
||||
/** 个人 __ 开户行 */
|
||||
@TableField("个人开户行")
|
||||
@ChineseName("个人开户行")
|
||||
private String personBank;
|
||||
|
||||
/** 个人 __ 银行账号 */
|
||||
@TableField("个人银行账号")
|
||||
@ChineseName("个人银行账号")
|
||||
private String personAccount;
|
||||
|
||||
/** 供应商准入状态(0.未准入、1.已准入) */
|
||||
@TableField("供应商准入状态")
|
||||
@ChineseName("供应商准入状态")
|
||||
private Long accessStatus;
|
||||
|
||||
/** 供应商黑名单状态(0.未加入、已加入) */
|
||||
@TableField("供应商黑名单状态")
|
||||
@ChineseName("供应商黑名单状态")
|
||||
private Long blacklistStatus;
|
||||
|
||||
/** 供应商灰名单状态(0.未加入、已加入) */
|
||||
@TableField("供应商灰名单状态")
|
||||
@ChineseName("供应商灰名单状态")
|
||||
private Long greylistStatus;
|
||||
|
||||
/** 是否为代理录入(0.否、1.是) */
|
||||
@TableField("代理录入状态")
|
||||
@ChineseName("代理录入状态")
|
||||
private Long fillinStatus;
|
||||
|
||||
/** 代理录入人 */
|
||||
@TableField("代理录入人")
|
||||
@ChineseName("代理录入人")
|
||||
private String fillinBy;
|
||||
|
||||
/** sap_code 集团数据底座赋码(集团北京SAP系统编码) */
|
||||
@TableField("SAP系统编码")
|
||||
@ChineseName("SAP系统编码")
|
||||
private String sapCode;
|
||||
|
||||
/** 删除标识(normal.正常、deleted.已删除) */
|
||||
@TableField("删除标识")
|
||||
@ChineseName("删除标识")
|
||||
private String delFlag;
|
||||
|
||||
/** 最后更新时间 */
|
||||
@TableField("最后更新时间")
|
||||
@ChineseName("最后更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
@TableField("供应商身份类型中文")
|
||||
@ChineseName("供应商身份类型中文")
|
||||
@ExcelProperty("境内/境外")
|
||||
private String supplierTypeCn;
|
||||
|
||||
@TableField("准入状态中文")
|
||||
@ChineseName("准入状态中文")
|
||||
private String accessStatusCn;
|
||||
|
||||
/** 创建时间 */
|
||||
@ -243,4 +242,14 @@ public class CoscoSupplierBase {
|
||||
|
||||
private List<String> supplierTypeList;
|
||||
|
||||
|
||||
/**
|
||||
* 境外地市回显字典
|
||||
*/
|
||||
private String nationName;
|
||||
|
||||
/**
|
||||
* 身份类别回显字段
|
||||
*/
|
||||
private String contactsTypeName;
|
||||
}
|
@ -2,13 +2,13 @@ package com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
|
||||
import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil;
|
||||
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
|
||||
import com.chinaunicom.zyhy.ebtp.supplier.common.ChineseName;
|
||||
import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoDateUtils;
|
||||
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType;
|
||||
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
|
||||
@ -91,8 +91,6 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
|
||||
@Autowired
|
||||
private CoscoCategoryLibraryContainMapper coscoCategoryLibraryContainMapper;
|
||||
|
||||
@Autowired
|
||||
private ICoscoCategoryService coscoCategoryService;
|
||||
|
||||
|
||||
/**
|
||||
@ -546,8 +544,8 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
|
||||
history.setFieldName(field.getName()); // 字段名
|
||||
|
||||
// 获取字段注解(中文名)
|
||||
if (field.isAnnotationPresent(TableField.class)) {
|
||||
TableField annotation = field.getAnnotation(TableField.class);
|
||||
if (field.isAnnotationPresent(ChineseName.class)) {
|
||||
ChineseName annotation = field.getAnnotation(ChineseName.class);
|
||||
history.setFieldAnnotation(annotation.value());
|
||||
} else {
|
||||
history.setFieldAnnotation(field.getName());
|
||||
|
@ -25,8 +25,35 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoSupplierBankVo">
|
||||
select id, supplier_id, interbank_number, bank, swift_code, account_name, account, currency, nation, province, city, del_flag, create_by, create_time, update_by, update_time, last_update_time
|
||||
from cosco_supplier_bank
|
||||
SELECT
|
||||
csb.id,
|
||||
csb.supplier_id,
|
||||
csb.interbank_number,
|
||||
csb.bank,
|
||||
csb.swift_code,
|
||||
csb.account_name,
|
||||
csb.account,
|
||||
csb.currency,
|
||||
dpbz.dic_name as currencyName,
|
||||
csb.nation,
|
||||
COALESCE(drn.`name`, dri.`name`) as nationName,
|
||||
csb.province,
|
||||
drp.`name` as provinceName,
|
||||
csb.city,
|
||||
drc.`name` as cityName,
|
||||
csb.del_flag,
|
||||
csb.create_by,
|
||||
csb.create_time,
|
||||
csb.update_by,
|
||||
csb.update_time,
|
||||
csb.last_update_time
|
||||
FROM
|
||||
cosco_supplier_bank csb
|
||||
left join dict_project dpbz on csb.currency = dpbz.`code` and dpbz.parent_code = 'currency'
|
||||
left join dict_region drn on csb.nation = drn.id
|
||||
left join dict_region drp on csb.province = drp.id
|
||||
left join dict_region drc on csb.city = drc.id
|
||||
left join dict_region_international dri on csb.nation = dri.id
|
||||
</sql>
|
||||
|
||||
|
||||
@ -34,57 +61,57 @@
|
||||
<include refid="selectCoscoSupplierBankVo"/>
|
||||
<where>
|
||||
<if test="vo.supplierId != null and vo.supplierId != ''">
|
||||
and supplier_id = #{vo.supplierId}
|
||||
and csb.supplier_id = #{vo.supplierId}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
order by csb.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierBankList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBank" resultMap="CoscoSupplierBankResult">
|
||||
<include refid="selectCoscoSupplierBankVo"/>
|
||||
<where>
|
||||
and del_flag = 'normal'
|
||||
and csb.del_flag = 'normal'
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
and supplier_id = #{supplierId}
|
||||
and csb.supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="interbankNumber != null and interbankNumber != ''">
|
||||
and interbank_number = #{interbankNumber}
|
||||
and csb.interbank_number = #{interbankNumber}
|
||||
</if>
|
||||
<if test="bank != null and bank != ''">
|
||||
and bank = #{bank}
|
||||
and csb.bank = #{bank}
|
||||
</if>
|
||||
<if test="swiftCode != null and swiftCode != ''">
|
||||
and swift_code = #{swiftCode}
|
||||
and csb.swift_code = #{swiftCode}
|
||||
</if>
|
||||
<if test="accountName != null and accountName != ''">
|
||||
and account_name like concat('%', #{accountName}, '%')
|
||||
and csb.account_name like concat('%', #{accountName}, '%')
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
and account = #{account}
|
||||
and csb.account = #{account}
|
||||
</if>
|
||||
<if test="currency != null and currency != ''">
|
||||
and currency = #{currency}
|
||||
and csb.currency = #{currency}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
and nation = #{nation}
|
||||
and csb.nation = #{nation}
|
||||
</if>
|
||||
<if test="province != null and province != ''">
|
||||
and province = #{province}
|
||||
and csb.province = #{province}
|
||||
</if>
|
||||
<if test="city != null and city != ''">
|
||||
and city = #{city}
|
||||
and csb.csb.city = #{city}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and last_update_time = #{lastUpdateTime}
|
||||
and csb.last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
order by csb.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierBankById" parameterType="String"
|
||||
resultMap="CoscoSupplierBankResult">
|
||||
<include refid="selectCoscoSupplierBankVo"/>
|
||||
where id = #{id}
|
||||
where csb.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCoscoSupplierBank" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBank">
|
||||
|
@ -59,84 +59,88 @@
|
||||
<sql id="selectCoscoSupplierBaseVo">
|
||||
SELECT
|
||||
csb.id,
|
||||
dept_id,
|
||||
supplier_type,
|
||||
CASE supplier_type
|
||||
csb.dept_id,
|
||||
csb.supplier_type,
|
||||
CASE csb.supplier_type
|
||||
WHEN 'dvs' THEN '境内企业'
|
||||
WHEN 'ovs' THEN '境外企业'
|
||||
WHEN 'pe' THEN '个人'
|
||||
ELSE supplier_type
|
||||
END AS supplier_type_cn,
|
||||
CASE
|
||||
WHEN supplier_type = 'dvs' THEN social_credit_code
|
||||
WHEN supplier_type = 'ovs' THEN vat
|
||||
WHEN supplier_type = 'pe' THEN id_card
|
||||
WHEN csb.supplier_type = 'dvs' THEN social_credit_code
|
||||
WHEN csb.supplier_type = 'ovs' THEN vat
|
||||
WHEN csb.supplier_type = 'pe' THEN id_card
|
||||
ELSE NULL
|
||||
END AS unified_code,
|
||||
licence_accessory,
|
||||
licence_date,
|
||||
enterprise_type,
|
||||
csb.licence_accessory,
|
||||
csb.licence_date,
|
||||
csb.enterprise_type,
|
||||
dp.dic_name as enterprise_type_cn,
|
||||
name,
|
||||
name_en,
|
||||
social_credit_code,
|
||||
`range`,
|
||||
reg_address,
|
||||
work_address,
|
||||
parent_company_investor,
|
||||
legal_person,
|
||||
id_card,
|
||||
capital,
|
||||
contacts_name,
|
||||
contacts_phone,
|
||||
contacts_type,
|
||||
contacts_email,
|
||||
telephone,
|
||||
nation,
|
||||
vat,
|
||||
taxpayer_id,
|
||||
currency,
|
||||
csb.name,
|
||||
csb.name_en,
|
||||
csb.social_credit_code,
|
||||
csb.`range`,
|
||||
csb.reg_address,
|
||||
csb.work_address,
|
||||
csb.parent_company_investor,
|
||||
csb.legal_person,
|
||||
csb.id_card,
|
||||
csb.capital,
|
||||
csb.contacts_name,
|
||||
csb.contacts_phone,
|
||||
csb.contacts_type,
|
||||
dpc.dic_name as contactsTypeName,
|
||||
csb.contacts_email,
|
||||
csb.telephone,
|
||||
csb.nation,
|
||||
dri.`name` as nationName,
|
||||
csb.vat,
|
||||
csb.taxpayer_id,
|
||||
csb.currency,
|
||||
dpbz.dic_name as currency_cn,
|
||||
person_name,
|
||||
person_phone,
|
||||
person_bank,
|
||||
person_account,
|
||||
remark,
|
||||
access_status,
|
||||
CASE access_status
|
||||
csb.person_name,
|
||||
csb.person_phone,
|
||||
csb.person_bank,
|
||||
csb.person_account,
|
||||
csb.remark,
|
||||
csb.access_status,
|
||||
CASE csb.access_status
|
||||
WHEN 0 THEN '未准入'
|
||||
WHEN 1 THEN '已准入'
|
||||
ELSE CAST(access_status AS CHAR)
|
||||
END AS access_status_cn,
|
||||
blacklist_status,
|
||||
CASE blacklist_status
|
||||
csb.blacklist_status,
|
||||
CASE csb.blacklist_status
|
||||
WHEN 0 THEN '未加入'
|
||||
WHEN 1 THEN '已加入'
|
||||
ELSE CAST(blacklist_status AS CHAR)
|
||||
END AS blacklist_status_cn,
|
||||
greylist_status,
|
||||
CASE greylist_status
|
||||
csb.greylist_status,
|
||||
CASE csb.greylist_status
|
||||
WHEN 0 THEN '未加入'
|
||||
WHEN 1 THEN '已加入'
|
||||
ELSE CAST(greylist_status AS CHAR)
|
||||
END AS greylist_status_cn,
|
||||
fillin_status,
|
||||
CASE fillin_status
|
||||
csb.fillin_status,
|
||||
CASE csb.fillin_status
|
||||
WHEN 0 THEN '否'
|
||||
WHEN 1 THEN '是'
|
||||
ELSE CAST(fillin_status AS CHAR)
|
||||
END AS fillin_status_cn,
|
||||
fillin_by,
|
||||
sap_code,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
last_update_time
|
||||
csb.fillin_by,
|
||||
csb.sap_code,
|
||||
csb.create_by,
|
||||
csb.create_time,
|
||||
csb.update_by,
|
||||
csb.update_time,
|
||||
csb.last_update_time
|
||||
FROM
|
||||
cosco_supplier_base csb
|
||||
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
|
||||
left join dict_project dpbz on csb.currency = dpbz.`code` and dpbz.parent_code = 'currency'
|
||||
left join dict_project dpc on csb.contacts_type = dpc.`code` and dpc.parent_code = 'contacts_type'
|
||||
left join dict_region_international dri on csb.nation = dri.id
|
||||
</sql>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user