新增亲属资产领域对象与映射

This commit is contained in:
wkc
2026-03-13 09:47:21 +08:00
parent 472457c69b
commit 70bdce7bda
9 changed files with 105 additions and 80 deletions

View File

@@ -13,7 +13,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 员工资产信息对象 ccdi_asset_info
* 资产信息对象 ccdi_asset_info
*
* @author ruoyi
* @date 2026-03-12
@@ -29,10 +29,10 @@ public class CcdiAssetInfo implements Serializable {
@TableId(type = IdType.AUTO)
private Long assetId;
/** 归属员工身份证号 */
/** 归属员工证号 */
private String familyId;
/** 资产实际持有人身份证号 */
/** 资产实际持有人证号 */
private String personId;
/** 资产大类 */

View File

@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
@@ -14,24 +13,18 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 员工资产信息DTO
* 亲属资产信息DTO
*
* @author ruoyi
* @date 2026-03-12
*/
@Data
@Schema(description = "员工资产信息")
@Schema(description = "亲属资产信息")
public class CcdiAssetInfoDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 资产实际持有人身份证号 */
@NotBlank(message = "资产实际持有人身份证号不能为空")
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", message = "资产实际持有人身份证号格式不正确")
@Schema(description = "资产实际持有人身份证号")
private String personId;
/** 资产大类 */
@NotBlank(message = "资产大类不能为空")
@Size(max = 20, message = "资产大类长度不能超过20个字符")

View File

@@ -11,7 +11,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 员工资产信息Excel导入导出对象
* 亲属资产信息Excel导入导出对象
*
* @author ruoyi
* @date 2026-03-12
@@ -22,8 +22,8 @@ public class CcdiAssetInfoExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 资产实际持有人身份证号 */
@ExcelProperty(value = "资产实际持有人身份证号*", index = 0)
/** 关系人证件号 */
@ExcelProperty(value = "关系人证件号*", index = 0)
@ColumnWidth(22)
@Required
private String personId;

View File

@@ -6,17 +6,17 @@ import lombok.Data;
import java.math.BigDecimal;
/**
* 员工资产信息导入失败记录VO
* 亲属资产信息导入失败记录VO
*
* @author ruoyi
* @date 2026-03-12
*/
@Data
@Schema(description = "员工资产信息导入失败记录")
@Schema(description = "亲属资产信息导入失败记录")
public class AssetImportFailureVO {
/** 资产实际持有人身份证号 */
@Schema(description = "资产实际持有人身份证")
/** 关系人证件号 */
@Schema(description = "关系人证件")
private String personId;
/** 资产大类 */

View File

@@ -10,20 +10,20 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 员工资产信息VO
* 资产信息VO
*
* @author ruoyi
* @date 2026-03-12
*/
@Data
@Schema(description = "员工资产信息")
@Schema(description = "资产信息")
public class CcdiAssetInfoVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 资产实际持有人身份证号 */
@Schema(description = "资产实际持有人身份证号")
/** 资产实际持有人证号 */
@Schema(description = "资产实际持有人证")
private String personId;
/** 资产大类 */

View File

@@ -8,7 +8,7 @@ import java.util.List;
import java.util.Map;
/**
* 员工资产信息 数据层
* 资产信息 数据层
*
* @author ruoyi
* @date 2026-03-12
@@ -23,6 +23,16 @@ public interface CcdiAssetInfoMapper extends BaseMapper<CcdiAssetInfo> {
*/
List<CcdiAssetInfo> selectByFamilyId(@Param("familyId") String familyId);
/**
* 按归属键查询资产列表
*
* @param familyId 归属员工证件号
* @param personId 资产实际持有人证件号
* @return 资产列表
*/
List<CcdiAssetInfo> selectByFamilyIdAndPersonId(@Param("familyId") String familyId,
@Param("personId") String personId);
/**
* 按归属员工身份证号删除资产
*
@@ -31,6 +41,16 @@ public interface CcdiAssetInfoMapper extends BaseMapper<CcdiAssetInfo> {
*/
int deleteByFamilyId(@Param("familyId") String familyId);
/**
* 按归属键删除资产
*
* @param familyId 归属员工证件号
* @param personId 资产实际持有人证件号
* @return 影响行数
*/
int deleteByFamilyIdAndPersonId(@Param("familyId") String familyId,
@Param("personId") String personId);
/**
* 批量删除归属员工资产
*
@@ -56,18 +76,10 @@ public interface CcdiAssetInfoMapper extends BaseMapper<CcdiAssetInfo> {
int insertBatch(@Param("list") List<CcdiAssetInfo> list);
/**
* 按员工身份证号查询归属信息
* 按关系人证件号查询归属员工候选
*
* @param personIds 资产实际持有人身份证号列表
* @param relationCertNos 关系人证件号列表
* @return 归属映射
*/
List<Map<String, String>> selectOwnerByEmployeeIdCards(@Param("personIds") List<String> personIds);
/**
* 按员工家庭关系身份证号查询归属信息
*
* @param personIds 资产实际持有人身份证号列表
* @return 归属映射
*/
List<Map<String, String>> selectOwnerByFamilyRelationIdCards(@Param("personIds") List<String> personIds);
List<Map<String, String>> selectOwnerCandidatesByRelationCertNos(@Param("relationCertNos") List<String> relationCertNos);
}

View File

@@ -34,13 +34,14 @@
ORDER BY create_time DESC, asset_id DESC
</select>
<select id="selectByPersonId" resultMap="CcdiAssetInfoResultMap">
<select id="selectByFamilyIdAndPersonId" resultMap="CcdiAssetInfoResultMap">
SELECT
asset_id, family_id, person_id, asset_main_type, asset_sub_type, asset_name,
ownership_ratio, purchase_eval_date, original_value, current_value,
valuation_date, asset_status, remarks, create_by, create_time, update_by, update_time
FROM ccdi_asset_info
WHERE person_id = #{personId}
WHERE family_id = #{familyId}
AND person_id = #{personId}
ORDER BY create_time DESC, asset_id DESC
</select>
@@ -49,6 +50,12 @@
WHERE family_id = #{familyId}
</delete>
<delete id="deleteByFamilyIdAndPersonId">
DELETE FROM ccdi_asset_info
WHERE family_id = #{familyId}
AND person_id = #{personId}
</delete>
<delete id="deleteByFamilyIds">
DELETE FROM ccdi_asset_info
WHERE family_id IN
@@ -70,26 +77,15 @@
</foreach>
</insert>
<select id="selectOwnerByEmployeeIdCards" resultType="map">
SELECT
id_card AS personId,
id_card AS familyId
FROM ccdi_base_staff
WHERE id_card IN
<foreach collection="personIds" item="personId" open="(" separator="," close=")">
#{personId}
</foreach>
</select>
<select id="selectOwnerByFamilyRelationIdCards" resultType="map">
<select id="selectOwnerCandidatesByRelationCertNos" resultType="map">
SELECT
relation_cert_no AS personId,
person_id AS familyId
FROM ccdi_staff_fmy_relation
WHERE is_emp_family = 1
AND relation_cert_no IN
<foreach collection="personIds" item="personId" open="(" separator="," close=")">
#{personId}
<foreach collection="relationCertNos" item="relationCertNo" open="(" separator="," close=")">
#{relationCertNo}
</foreach>
</select>