Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
1a952829
Commit
1a952829
authored
Apr 08, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险规则-fxj
parent
182158ea
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1152 additions
and
65 deletions
+1152
-65
TAutoInsurStandard.java
...loud/plus/v1/yifu/archives/entity/TAutoInsurStandard.java
+9
-6
TAutoStandardInfo.java
...cloud/plus/v1/yifu/archives/entity/TAutoStandardInfo.java
+67
-0
TAutoInsurStandardSearchVo.java
.../plus/v1/yifu/archives/vo/TAutoInsurStandardSearchVo.java
+6
-0
TAutoMainRelDetailVo.java
.../cloud/plus/v1/yifu/archives/vo/TAutoMainRelDetailVo.java
+5
-4
TAutoStandardInfoSearchVo.java
...d/plus/v1/yifu/archives/vo/TAutoStandardInfoSearchVo.java
+61
-0
TAutoStandardInfoVo.java
...u/cloud/plus/v1/yifu/archives/vo/TAutoStandardInfoVo.java
+70
-0
TAutoStandardInfoController.java
...yifu/archives/controller/TAutoStandardInfoController.java
+127
-0
TAutoStandardInfoMapper.java
...plus/v1/yifu/archives/mapper/TAutoStandardInfoMapper.java
+46
-0
TAutoStandardInfoService.java
...us/v1/yifu/archives/service/TAutoStandardInfoService.java
+52
-0
TAutoInsurStandardServiceImpl.java
.../archives/service/impl/TAutoInsurStandardServiceImpl.java
+14
-0
TAutoMainRelServiceImpl.java
...1/yifu/archives/service/impl/TAutoMainRelServiceImpl.java
+137
-44
TAutoStandardInfoServiceImpl.java
...u/archives/service/impl/TAutoStandardInfoServiceImpl.java
+240
-0
TAutoInsurStandardMapper.xml
...iz/src/main/resources/mapper/TAutoInsurStandardMapper.xml
+18
-1
TAutoStandardInfoMapper.xml
...biz/src/main/resources/mapper/TAutoStandardInfoMapper.xml
+70
-0
TInsuranceType.java
.../cloud/plus/v1/yifu/insurances/entity/TInsuranceType.java
+6
-0
TInsuranceTypeStandard.java
...lus/v1/yifu/insurances/entity/TInsuranceTypeStandard.java
+6
-0
InsuranceDetailDispatchVO.java
...plus/v1/yifu/insurances/vo/InsuranceDetailDispatchVO.java
+66
-0
InsuranceDispatchParam.java
...ud/plus/v1/yifu/insurances/vo/InsuranceDispatchParam.java
+43
-0
InsuranceTypeExportVo.java
...oud/plus/v1/yifu/insurances/vo/InsuranceTypeExportVo.java
+5
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+1
-0
TInsuranceTypeController.java
.../yifu/insurances/controller/TInsuranceTypeController.java
+15
-0
TInsuranceTypeStandardController.java
...surances/controller/TInsuranceTypeStandardController.java
+17
-0
TInsuranceDetailMapper.java
.../insurances/mapper/insurances/TInsuranceDetailMapper.java
+1
-0
TInsuranceDetailService.java
...insurances/service/insurance/TInsuranceDetailService.java
+0
-1
TInsuranceTypeService.java
...u/insurances/service/insurance/TInsuranceTypeService.java
+2
-0
TInsuranceTypeStandardService.java
...nces/service/insurance/TInsuranceTypeStandardService.java
+2
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+10
-1
TInsuranceTypeServiceImpl.java
...ces/service/insurance/impl/TInsuranceTypeServiceImpl.java
+21
-1
TInsuranceTypeStandardServiceImpl.java
...ice/insurance/impl/TInsuranceTypeStandardServiceImpl.java
+20
-1
TInsuranceTypeMapper.xml
...main/resources/mapper/insurances/TInsuranceTypeMapper.xml
+13
-5
TInsuranceTypeStandardMapper.xml
...ources/mapper/insurances/TInsuranceTypeStandardMapper.xml
+2
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TAutoInsurStandard.java
View file @
1a952829
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
...
...
@@ -29,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.util.List
;
/**
* 购买标准配置表
...
...
@@ -65,7 +67,7 @@ public class TAutoInsurStandard extends BaseEntity {
@NotBlank
(
message
=
"保险公司不能为空"
)
@ExcelProperty
(
"保险公司"
)
@Schema
(
description
=
"保险公司"
)
private
Integer
company
;
private
String
company
;
/**
* 险种,下拉选项
*/
...
...
@@ -73,7 +75,7 @@ public class TAutoInsurStandard extends BaseEntity {
@NotBlank
(
message
=
"险种,下拉选项不能为空"
)
@ExcelProperty
(
"险种"
)
@Schema
(
description
=
"险种,下拉选项"
)
private
Integer
riskType
;
private
String
riskType
;
/**
* 购买标准,多值逗号分隔
*/
...
...
@@ -86,16 +88,14 @@ public class TAutoInsurStandard extends BaseEntity {
/**
* 派单-省
*/
@ExcelAttribute
(
name
=
"派单-省"
,
isNotEmpty
=
true
,
errorInfo
=
"派单-省不能为空"
)
@NotBlank
(
message
=
"派单-省不能为空"
)
@ExcelAttribute
(
name
=
"派单-省"
)
@ExcelProperty
(
"派单-省"
)
@Schema
(
description
=
"派单-省"
)
private
Integer
buyProvince
;
/**
* 派单-市
*/
@ExcelAttribute
(
name
=
"派单-市"
,
isNotEmpty
=
true
,
errorInfo
=
"派单-市不能为空"
)
@NotBlank
(
message
=
"派单-市不能为空"
)
@ExcelAttribute
(
name
=
"派单-市"
)
@ExcelProperty
(
"派单-市"
)
@Schema
(
description
=
"派单-市"
)
private
Integer
buyCity
;
...
...
@@ -115,4 +115,7 @@ public class TAutoInsurStandard extends BaseEntity {
@Schema
(
description
=
"商险配置表ID"
)
private
String
mainId
;
@TableField
(
exist
=
false
)
List
<
TAutoStandardInfo
>
standardInfos
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TAutoStandardInfo.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
/**
* @author fxj
* @date 2025-04-07 10:24:30
*/
@Data
@TableName
(
"t_auto_standard_info"
)
@Schema
(
description
=
"购买标准配存储表"
)
public
class
TAutoStandardInfo
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ExcelProperty
(
"主键"
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 关联主表ID
*/
@ExcelAttribute
(
name
=
"关联主表ID"
,
maxLength
=
32
)
@Length
(
max
=
32
,
message
=
"关联主表ID不能超过32个字符"
)
@ExcelProperty
(
"关联主表ID"
)
@Schema
(
description
=
"关联主表ID"
)
private
String
mainId
;
/**
* 购买标准
*/
@ExcelAttribute
(
name
=
"购买标准"
,
isNotEmpty
=
true
,
errorInfo
=
"购买标准不能为空"
,
maxLength
=
32
)
@NotBlank
(
message
=
"购买标准不能为空"
)
@ExcelProperty
(
"购买标准"
)
@Schema
(
description
=
"购买标准"
)
private
String
standard
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TAutoInsurStandardSearchVo.java
View file @
1a952829
...
...
@@ -55,4 +55,10 @@ public class TAutoInsurStandardSearchVo extends TAutoInsurStandard {
@Schema
(
description
=
"查询limit 数据条数"
)
private
int
limitEnd
;
/**
* @Author fxj
* 项目编码
**/
@Schema
(
description
=
"项目编码"
)
private
int
projectNo
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TAutoMainRelDetailVo.java
View file @
1a952829
...
...
@@ -19,10 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.SysAutoDictItem
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoEmpRuleInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoMainRel
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoRuleLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -52,5 +49,9 @@ public class TAutoMainRelDetailVo implements Serializable {
private
List
<
SysAutoDictItem
>
autoDictItems
;
//项目信息表
private
TSettleDomainSelectVo
settleDomainVo
;
//商险规则表
private
TAutoInsurRuleInfo
autoInsurRuleInfo
;
//商险购买标准表
private
List
<
TAutoInsurStandard
>
autoInsurStandards
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TAutoStandardInfoSearchVo.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDateTime
;
/**
*
*
* @author fxj
* @date 2025-04-07 10:24:30
*/
@Data
public
class
TAutoStandardInfoSearchVo
extends
TAutoStandardInfo
{
/**
* 多选导出或删除等操作
*/
@Schema
(
description
=
"选中ID,多个逗号分割"
)
private
String
ids
;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema
(
description
=
"创建时间区间"
)
private
LocalDateTime
[]
createTimes
;
/**
* @Author fxj
* 查询数据起
**/
@Schema
(
description
=
"查询limit 开始"
)
private
int
limitStart
;
/**
* @Author fxj
* 查询数据止
**/
@Schema
(
description
=
"查询limit 数据条数"
)
private
int
limitEnd
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TAutoStandardInfoVo.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @author fxj
* @date 2025-04-07 10:24:30
*/
@Data
public
class
TAutoStandardInfoVo
extends
RowIndex
implements
Serializable
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@NotBlank
(
message
=
"主键 不能为空"
)
@Length
(
max
=
32
,
message
=
"主键 不能超过32 个字符"
)
@ExcelAttribute
(
name
=
"主键"
,
isNotEmpty
=
true
,
errorInfo
=
"主键 不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"主键"
)
@ExcelProperty
(
"主键"
)
private
String
id
;
/**
* 关联主表ID
*/
@NotBlank
(
message
=
"关联主表ID 不能为空"
)
@Length
(
max
=
32
,
message
=
"关联主表ID 不能超过32 个字符"
)
@ExcelAttribute
(
name
=
"关联主表ID"
,
isNotEmpty
=
true
,
errorInfo
=
"关联主表ID 不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"关联主表ID"
)
@ExcelProperty
(
"关联主表ID"
)
private
String
mainId
;
/**
* 购买标准
*/
@NotBlank
(
message
=
"购买标准 不能为空"
)
@ExcelAttribute
(
name
=
"购买标准"
,
isNotEmpty
=
true
,
errorInfo
=
"购买标准 不能为空"
)
@Schema
(
description
=
"购买标准"
)
@ExcelProperty
(
"购买标准"
)
private
BigDecimal
standard
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TAutoStandardInfoController.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAutoStandardInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoStandardInfoSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
*
*
* @author fxj
* @date 2025-04-07 10:24:30
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/tautostandardinfo"
)
@Tag
(
name
=
"管理"
)
public
class
TAutoStandardInfoController
{
private
final
TAutoStandardInfoService
tAutoStandardInfoService
;
/**
* 简单分页查询
* @param page 分页对象
* @param tAutoStandardInfo
* @return
*/
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
TAutoStandardInfo
>>
getTAutoStandardInfoPage
(
Page
<
TAutoStandardInfo
>
page
,
TAutoStandardInfoSearchVo
tAutoStandardInfo
)
{
return
new
R
<>(
tAutoStandardInfoService
.
getTAutoStandardInfoPage
(
page
,
tAutoStandardInfo
));
}
/**
* 简单不分页查询
* @param tAutoStandardInfo
* @return
*/
@Operation
(
description
=
"简单不分页查询"
)
@GetMapping
(
"/getTAutoStandardInfoNoPage"
)
public
R
<
List
<
TAutoStandardInfo
>>
getTAutoStandardInfoNoPage
(
TAutoStandardInfoSearchVo
tAutoStandardInfo
)
{
return
tAutoStandardInfoService
.
getTAutoStandardInfoNoPage
(
tAutoStandardInfo
);
}
/**
* 通过id查询
* @param id id
* @return R
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('demo_tautostandardinfo_get')"
)
@GetMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('demo_tautostandardinfo_get')"
)
public
R
<
TAutoStandardInfo
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
tAutoStandardInfoService
.
getById
(
id
));
}
/**
* 新增
* @param tAutoStandardInfo
* @return R
*/
@Operation
(
summary
=
"新增"
,
description
=
"新增:hasPermission('demo_tautostandardinfo_add')"
)
@SysLog
(
"新增"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('demo_tautostandardinfo_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
TAutoStandardInfo
tAutoStandardInfo
)
{
return
R
.
ok
(
tAutoStandardInfoService
.
save
(
tAutoStandardInfo
));
}
/**
* 修改
* @param tAutoStandardInfo
* @return R
*/
@Operation
(
summary
=
"修改"
,
description
=
"修改:hasPermission('demo_tautostandardinfo_edit')"
)
@SysLog
(
"修改"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('demo_tautostandardinfo_edit')"
)
public
R
<
Boolean
>
updateById
(
@RequestBody
TAutoStandardInfo
tAutoStandardInfo
)
{
return
R
.
ok
(
tAutoStandardInfoService
.
updateById
(
tAutoStandardInfo
));
}
/**
* 通过id删除
* @param id id
* @return R
*/
@Operation
(
summary
=
"通过id删除"
,
description
=
"通过id删除:hasPermission('demo_tautostandardinfo_del')"
)
@SysLog
(
"通过id删除"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('demo_tautostandardinfo_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
tAutoStandardInfoService
.
removeById
(
id
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TAutoStandardInfoMapper.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
*
*
* @author fxj
* @date 2025-04-07 10:24:30
*/
@Mapper
public
interface
TAutoStandardInfoMapper
extends
BaseMapper
<
TAutoStandardInfo
>
{
/**
* 简单分页查询
* @param tAutoStandardInfo
* @return
*/
IPage
<
TAutoStandardInfo
>
getTAutoStandardInfoPage
(
Page
<
TAutoStandardInfo
>
page
,
@Param
(
"tAutoStandardInfo"
)
TAutoStandardInfo
tAutoStandardInfo
);
List
<
TAutoStandardInfo
>
getTAutoStandardInfoNoPage
(
@Param
(
"tAutoStandardInfo"
)
TAutoStandardInfo
tAutoStandardInfo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TAutoStandardInfoService.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoStandardInfoSearchVo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.util.List
;
/**
*
*
* @author fxj
* @date 2025-04-07 10:24:30
*/
public
interface
TAutoStandardInfoService
extends
IService
<
TAutoStandardInfo
>
{
/**
* 简单分页查询
* @param tAutoStandardInfo
* @return
*/
IPage
<
TAutoStandardInfo
>
getTAutoStandardInfoPage
(
Page
<
TAutoStandardInfo
>
page
,
TAutoStandardInfoSearchVo
tAutoStandardInfo
);
R
<
List
<
ErrorMessage
>>
importDiy
(
InputStream
inputStream
);
void
listExport
(
HttpServletResponse
response
,
TAutoStandardInfoSearchVo
searchVo
);
List
<
TAutoStandardInfo
>
noPageDiy
(
TAutoStandardInfoSearchVo
searchVo
);
R
<
List
<
TAutoStandardInfo
>>
getTAutoStandardInfoNoPage
(
TAutoStandardInfoSearchVo
tAutoStandardInfo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAutoInsurStandardServiceImpl.java
View file @
1a952829
...
...
@@ -30,7 +30,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurRuleInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurStandard
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoInsurRuleInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoInsurStandardMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAutoInsurStandardService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurStandardSearchVo
;
...
...
@@ -39,6 +41,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.ServletOutputStream
;
...
...
@@ -57,6 +60,9 @@ import java.util.List;
@Log4j2
@Service
public
class
TAutoInsurStandardServiceImpl
extends
ServiceImpl
<
TAutoInsurStandardMapper
,
TAutoInsurStandard
>
implements
TAutoInsurStandardService
{
@Autowired
private
TAutoInsurRuleInfoMapper
tAutoInsurRuleInfoMapper
;
/**
* 购买标准配置表简单分页查询
* @param tAutoInsurStandard 购买标准配置表
...
...
@@ -64,6 +70,14 @@ public class TAutoInsurStandardServiceImpl extends ServiceImpl<TAutoInsurStandar
*/
@Override
public
IPage
<
TAutoInsurStandard
>
getTAutoInsurStandardPage
(
Page
<
TAutoInsurStandard
>
page
,
TAutoInsurStandardSearchVo
tAutoInsurStandard
){
if
(
Common
.
isNotNull
(
tAutoInsurStandard
.
getProjectNo
())){
TAutoInsurRuleInfo
rule
=
tAutoInsurRuleInfoMapper
.
selectOne
(
Wrappers
.<
TAutoInsurRuleInfo
>
query
().
lambda
()
.
eq
(
TAutoInsurRuleInfo:
:
getDeptNo
,
tAutoInsurStandard
.
getProjectNo
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
rule
)){
tAutoInsurStandard
.
setMainId
(
rule
.
getId
());
}
}
return
baseMapper
.
getTAutoInsurStandardPage
(
page
,
tAutoInsurStandard
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAutoMainRelServiceImpl.java
View file @
1a952829
...
...
@@ -86,6 +86,9 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
@Autowired
private
TAutoInsurStandardMapper
autoInsurStandardMapper
;
@Autowired
private
TAutoStandardInfoMapper
autoStandardInfoMapper
;
public
static
final
String
itemsLabel
=
"label,description,disable"
;
public
static
final
String
itemsLabelRepeat
=
"同一项目岗位名称不可重复"
;
...
...
@@ -236,6 +239,21 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
.
eq
(
SysAutoDictItem:
:
getDisable
,
CommonConstants
.
ZERO_STRING
)));
//项目信息表
detailVo
.
setSettleDomainVo
(
archivesDaprUtil
.
selectDeptByNo
(
mainRel
.
getDeptNo
()));
//商险规则表
detailVo
.
setAutoInsurRuleInfo
(
autoInsurRuleInfoMapper
.
selectOne
(
Wrappers
.<
TAutoInsurRuleInfo
>
query
().
lambda
()
.
eq
(
TAutoInsurRuleInfo:
:
getMainId
,
id
).
last
(
CommonConstants
.
LAST_ONE_SQL
)));
//商险标准表
if
(
Common
.
isNotNull
(
detailVo
.
getAutoInsurRuleInfo
())){
List
<
TAutoInsurStandard
>
standards
=
autoInsurStandardMapper
.
selectList
(
Wrappers
.<
TAutoInsurStandard
>
query
()
.
lambda
().
eq
(
TAutoInsurStandard:
:
getMainId
,
detailVo
.
getAutoInsurRuleInfo
().
getId
()));
if
(
Common
.
isNotNull
(
standards
)){
for
(
TAutoInsurStandard
standard
:
standards
)
{
standard
.
setStandardInfos
(
autoStandardInfoMapper
.
selectList
(
Wrappers
.<
TAutoStandardInfo
>
query
()
.
lambda
().
eq
(
TAutoStandardInfo:
:
getMainId
,
standard
.
getId
())));
}
}
detailVo
.
setAutoInsurStandards
(
standards
);
}
return
R
.
ok
(
detailVo
);
}
/**
...
...
@@ -293,18 +311,9 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
}
//校验商险购买标准
List
<
TAutoInsurStandard
>
insurStandards
=
entity
.
getInsurStandards
();
if
(
Common
.
isNotNull
(
insurStandards
)){
ExcelUtil
<
TAutoInsurStandard
>
excelUtil
=
new
ExcelUtil
<>(
TAutoInsurStandard
.
class
);
ErrorMessage
errorMessage
;
for
(
TAutoInsurStandard
standard:
insurStandards
){
errorMessage
=
excelUtil
.
checkEntity
(
standard
,
0
);
if
(
Common
.
isNotNull
(
errorMessage
)){
return
R
.
failed
(
errorMessage
.
getMessage
());
}
}
}
if
(!
checkInsurStandardsForDuplicates
(
insurStandards
)){
return
R
.
failed
(
buyStandardRepeat
);
R
<
Boolean
>
PARAM_IS_NOT_ERROR
=
checkInsurStandard
(
insurStandards
);
if
(
PARAM_IS_NOT_ERROR
!=
null
){
return
PARAM_IS_NOT_ERROR
;
}
// 校验字典项是否有重复标签
List
<
SysAutoDictItem
>
autoDictItems
=
entity
.
getAutoDictItems
();
...
...
@@ -348,6 +357,8 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
for
(
TAutoInsurStandard
standard:
insurStandards
){
standard
.
setMainId
(
autoInsurRuleInfo
.
getId
());
autoInsurStandardMapper
.
insert
(
standard
);
//新增购买标准子表
saveStandard
(
standard
);
}
}
return
R
.
ok
();
...
...
@@ -357,6 +368,32 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
}
}
private
R
<
Boolean
>
checkInsurStandard
(
List
<
TAutoInsurStandard
>
insurStandards
)
{
if
(
Common
.
isNotNull
(
insurStandards
)){
List
<
TAutoStandardInfo
>
standards
;
ExcelUtil
<
TAutoInsurStandard
>
excelUtil
=
new
ExcelUtil
<>(
TAutoInsurStandard
.
class
);
ErrorMessage
errorMessage
;
for
(
TAutoInsurStandard
standard:
insurStandards
){
standards
=
standard
.
getStandardInfos
();
if
(
Common
.
isEmpty
(
standards
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
else
{
standard
.
setStandard
(
standards
.
stream
().
map
(
TAutoStandardInfo:
:
getStandard
).
collect
(
Collectors
.
joining
(
","
)));
}
errorMessage
=
excelUtil
.
checkEntity
(
standard
,
0
);
if
(
Common
.
isNotNull
(
errorMessage
)){
return
R
.
failed
(
errorMessage
.
getMessage
());
}
}
}
else
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
if
(!
checkInsurStandardsForDuplicates
(
insurStandards
)){
return
R
.
failed
(
buyStandardRepeat
);
}
return
null
;
}
private
boolean
checkInsurStandardsForDuplicates
(
List
<
TAutoInsurStandard
>
insurStandards
)
{
if
(
Common
.
isNotNull
(
insurStandards
))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -465,32 +502,45 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
// 根据ID查询原有的商险规则信息
autoInsurRuleOld
=
autoInsurRuleInfoMapper
.
selectById
(
autoEmpRuleNew
.
getId
());
}
//校验商险购买标准
List
<
TAutoInsurStandard
>
insurStandards
=
entity
.
getInsurStandards
();
//保存商险规则
List
<
TAutoInsurStandard
>
insurStandards
=
null
;
if
(
Common
.
isNotNull
(
autoInsurRuleNew
)){
if
(
Common
.
isNotNull
(
autoInsurRuleNew
.
getId
())){
autoInsurRuleNew
.
setDeptNo
(
autoMainRel
.
getDeptNo
());
autoInsurRuleNew
.
setDeptId
(
autoMainRel
.
getDeptId
());
autoInsurRuleNew
.
setMainId
(
autoMainRel
.
getId
());
autoInsurRuleInfoMapper
.
insert
(
autoInsurRuleNew
);
}
else
{
autoInsurRuleInfoMapper
.
updateById
(
autoInsurRuleNew
);
}
//校验商险购买标准
insurStandards
=
entity
.
getInsurStandards
();
R
<
Boolean
>
PARAM_IS_NOT_ERROR
=
checkInsurStandard
(
insurStandards
);
if
(
PARAM_IS_NOT_ERROR
!=
null
){
return
PARAM_IS_NOT_ERROR
;
}
if
(!
checkInsurStandardsForDuplicates
(
insurStandards
)){
return
R
.
failed
(
buyStandardRepeat
);
}
}
//获取旧的购买标准
List
<
TAutoInsurStandard
>
insurStandardsOld
=
autoInsurStandardMapper
.
selectList
(
Wrappers
.<
TAutoInsurStandard
>
query
().
lambda
().
eq
(
TAutoInsurStandard:
:
getMainId
,
autoInsurRuleNew
.
getId
()));
//商险购买标准是否更新标识 false 未更新 true 更新
boolean
flag
=
false
;
//保存商险购买标准
if
(
Common
.
isNotNull
(
insurStandards
)){
ExcelUtil
<
TAutoInsurStandard
>
excelUtil
=
new
ExcelUtil
<>(
TAutoInsurStandard
.
class
);
ErrorMessage
errorMessage
;
//先删除再批增
autoInsurStandardMapper
.
delete
(
Wrappers
.<
TAutoInsurStandard
>
query
().
lambda
().
eq
(
TAutoInsurStandard:
:
getMainId
,
autoInsurRuleNew
.
getId
()))
;
for
(
TAutoInsurStandard
standard:
insurStandards
){
errorMessage
=
excelUtil
.
checkEntity
(
standard
,
0
);
if
(
Common
.
isNotNull
(
errorMessage
)){
return
R
.
failed
(
errorMessage
.
getMessage
());
if
(!
Common
.
isNotNull
(
standard
.
getId
())){
flag
=
true
;
}
standard
.
setMainId
(
autoInsurRuleNew
.
getId
());
autoInsurStandardMapper
.
insert
(
standard
);
saveStandard
(
standard
);
}
}
if
(!
checkInsurStandardsForDuplicates
(
insurStandards
)){
return
R
.
failed
(
buyStandardRepeat
);
}
//保存商险规则
//保存商险购买标准
//处理商险规则日志
//处理商险购买标准日志
// 获取旧的商险标准
List
<
TAutoInsurStandard
>
insurStandardsOld
=
autoInsurStandardMapper
.
selectList
(
Wrappers
.<
TAutoInsurStandard
>
query
().
lambda
().
eq
(
TAutoInsurStandard:
:
getMainId
,
autoInsurRuleNew
.
getId
()));
// 更新岗位字典
List
<
SysAutoDictItem
>
autoDictItems
=
entity
.
getAutoDictItems
();
Map
<
String
,
SysAutoDictItem
>
repeatItems
=
new
HashMap
<>();
...
...
@@ -527,31 +577,74 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
dictItemHandle
(
user
,
autoMainRel
,
autoDict
,
diffKeyMap
,
autoDictItems
,
oldAutoDictItems
);
oldMap
.
put
(
"oldItems"
,
oldAutoDictItems
);
newMap
.
put
(
"newItems"
,
autoDictItems
);
// 更新档案管理规则
if
(
Common
.
isNotNull
(
autoEmpRuleNew
)){
oldMap
.
put
(
"oldEmpRule"
,
autoEmpRuleOld
);
newMap
.
put
(
"newEmpRule"
,
autoEmpRuleNew
);
List
<
String
>
ignoreFields
=
new
ArrayList
<>();
ignoreFields
.
add
(
"mainId"
);
ignoreFields
.
add
(
"createBy"
);
ignoreFields
.
add
(
"createName"
);
ignoreFields
.
add
(
"createTime"
);
ignoreFields
.
add
(
"deptId"
);
List
<
String
>
ignoreFields
=
new
ArrayList
<>();
ignoreFields
.
add
(
"mainId"
);
ignoreFields
.
add
(
"createBy"
);
ignoreFields
.
add
(
"createName"
);
ignoreFields
.
add
(
"createTime"
);
ignoreFields
.
add
(
"deptId"
);
// 更新档案管理规则
if
(
Common
.
isNotNull
(
autoEmpRuleNew
)){
String
differenceKey
=
HrEquator
.
comparisonValueIgnoreField
(
autoEmpRuleOld
,
autoEmpRuleNew
,
ignoreFields
);
if
(!
Common
.
isEmpty
(
differenceKey
)){
diffKeyMap
.
put
(
"empRule"
,
differenceKey
);
oldMap
.
put
(
"oldEmpRule"
,
autoEmpRuleOld
);
newMap
.
put
(
"newEmpRule"
,
autoEmpRuleNew
);
}
autoEmpRuleNew
.
setDeptNo
(
autoMainRel
.
getDeptNo
());
autoEmpRuleNew
.
setDeptId
(
autoMainRel
.
getDeptId
());
autoEmpRuleNew
.
setMainId
(
autoMainRel
.
getId
());
autoEmpRuleInfoMapper
.
updateById
(
autoEmpRuleNew
);
}
// 插入变更日志
//处理商险规则日志
if
(
Common
.
isNotNull
(
autoInsurRuleNew
)){
String
differenceKey
=
HrEquator
.
comparisonValueIgnoreField
(
autoInsurRuleOld
,
autoInsurRuleNew
,
ignoreFields
);
if
(!
Common
.
isEmpty
(
differenceKey
)){
diffKeyMap
.
put
(
"insurRule"
,
differenceKey
);
oldMap
.
put
(
"oldInsurRule"
,
autoInsurRuleOld
);
newMap
.
put
(
"newInsurRule"
,
autoInsurRuleNew
);
}
}
//处理商险购买标准日志
StringBuilder
diffKeys
=
new
StringBuilder
();
if
(
Common
.
isNotNull
(
insurStandards
)){
Map
<
String
,
TAutoInsurStandard
>
map
;
// 不为空且无新增数据,为空前面校验过了,这里不处理
if
(
Common
.
isNotNull
(
insurStandards
)
&&
!
flag
){
map
=
insurStandards
.
stream
().
collect
(
Collectors
.
toMap
(
TAutoInsurStandard:
:
getId
,
v
->
v
));
if
(
Common
.
isNotNull
(
insurStandardsOld
)){
String
differenceKey
;
for
(
TAutoInsurStandard
old:
insurStandardsOld
){
// 如果存在,则比较,不存在则标记为更新
differenceKey
=
HrEquator
.
comparisonValueIgnoreField
(
old
,
map
.
get
(
old
.
getId
()),
ignoreFields
);
if
(!
Common
.
isEmpty
(
differenceKey
)){
diffKeys
.
append
(
differenceKey
);
flag
=
true
;
}
}
}
}
if
(!
Common
.
isEmpty
(
flag
)){
diffKeyMap
.
put
(
"insurStandardRule"
,
diffKeys
.
toString
());
oldMap
.
put
(
"oldInsurStandards"
,
insurStandardsOld
);
newMap
.
put
(
"newInsurStandards"
,
insurStandards
);
}
}
// 插入变更日志
insertLog
(
autoMainRel
,
diffKeyMap
,
oldMap
,
newMap
);
// 返回更新成功的响应
return
R
.
ok
(
true
,
CommonConstants
.
UPDATE_SUCCESS
);
}
private
void
saveStandard
(
TAutoInsurStandard
standard
)
{
if
(
Common
.
isNotNull
(
standard
.
getStandardInfos
())){
for
(
TAutoStandardInfo
standardInfo:
standard
.
getStandardInfos
()){
standardInfo
.
setMainId
(
standard
.
getId
());
autoStandardInfoMapper
.
insert
(
standardInfo
);
}
}
}
private
Map
<
String
,
SysAutoDictItem
>
getStringSysAutoDictItemMap
(
List
<
SysAutoDictItem
>
autoDictItems
,
Map
<
String
,
SysAutoDictItem
>
repeatItems
,
List
<
SysAutoDictItem
>
oldAutoDictItems
)
{
if
(
Common
.
isNotNull
(
oldAutoDictItems
)){
repeatItems
=
oldAutoDictItems
.
stream
().
collect
(
Collectors
.
toMap
(
SysAutoDictItem:
:
getLabel
,
v
->
v
,(
k1
,
k2
)->
k1
));
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAutoStandardInfoServiceImpl.java
0 → 100644
View file @
1a952829
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.read.listener.ReadListener
;
import
com.alibaba.excel.read.metadata.holder.ReadRowHolder
;
import
com.alibaba.excel.util.ListUtils
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurRuleInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoInsurRuleInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoStandardInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAutoStandardInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoStandardInfoSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoStandardInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
*
*
* @author fxj
* @date 2025-04-07 10:24:30
*/
@Log4j2
@Service
public
class
TAutoStandardInfoServiceImpl
extends
ServiceImpl
<
TAutoStandardInfoMapper
,
TAutoStandardInfo
>
implements
TAutoStandardInfoService
{
@Autowired
private
TAutoInsurRuleInfoMapper
autoInsurRuleInfoMapper
;
/**
* 简单分页查询
* @param tAutoStandardInfo
* @return
*/
@Override
public
IPage
<
TAutoStandardInfo
>
getTAutoStandardInfoPage
(
Page
<
TAutoStandardInfo
>
page
,
TAutoStandardInfoSearchVo
tAutoStandardInfo
){
return
baseMapper
.
getTAutoStandardInfoPage
(
page
,
tAutoStandardInfo
);
}
@Override
public
R
<
List
<
TAutoStandardInfo
>>
getTAutoStandardInfoNoPage
(
TAutoStandardInfoSearchVo
tAutoStandardInfo
){
return
R
.
ok
(
baseMapper
.
getTAutoStandardInfoNoPage
(
tAutoStandardInfo
));
}
/**
* 批量导出
* @param searchVo
* @return
*/
@Override
public
void
listExport
(
HttpServletResponse
response
,
TAutoStandardInfoSearchVo
searchVo
){
String
fileName
=
"批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
TAutoStandardInfo
>
list
=
new
ArrayList
<>();
long
count
=
noPageCountDiy
(
searchVo
);
ServletOutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
response
.
setContentType
(
CommonConstants
.
MULTIPART_FORM_DATA
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
CommonConstants
.
UTF8
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TAutoStandardInfo
.
class
).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
){
for
(
int
i
=
0
;
i
<=
count
;
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
noPageDiy
(
searchVo
);
if
(
Common
.
isNotNull
(
list
)){
ExcelUtil
<
TAutoStandardInfo
>
util
=
new
ExcelUtil
<>(
TAutoStandardInfo
.
class
);
for
(
TAutoStandardInfo
vo:
list
){
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
}
if
(
Common
.
isNotNull
(
list
)){
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
""
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
index
++;
}
i
=
i
+
CommonConstants
.
EXCEL_EXPORT_LIMIT
;
if
(
Common
.
isNotNull
(
list
)){
list
.
clear
();
}
}
}
else
{
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
""
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
}
if
(
Common
.
isNotNull
(
list
)){
list
.
clear
();
}
out
.
flush
();
excelWriter
.
finish
();
}
catch
(
Exception
e
){
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
}
}
@Override
public
List
<
TAutoStandardInfo
>
noPageDiy
(
TAutoStandardInfoSearchVo
searchVo
)
{
return
null
;
}
private
Long
noPageCountDiy
(
TAutoStandardInfoSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TAutoStandardInfo
>
wrapper
=
buildQueryWrapper
(
searchVo
);
List
<
String
>
idList
=
Common
.
getList
(
searchVo
.
getIds
());
if
(
Common
.
isNotNull
(
idList
)){
wrapper
.
in
(
TAutoStandardInfo:
:
getId
,
idList
);
}
return
baseMapper
.
selectCount
(
wrapper
);
}
private
LambdaQueryWrapper
buildQueryWrapper
(
TAutoStandardInfoSearchVo
entity
){
return
null
;
}
@Override
public
R
<
List
<
ErrorMessage
>>
importDiy
(
InputStream
inputStream
)
{
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TAutoStandardInfoVo
>
util1
=
new
ExcelUtil
<>(
TAutoStandardInfoVo
.
class
);;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try
{
EasyExcel
.
read
(
inputStream
,
TAutoStandardInfoVo
.
class
,
new
ReadListener
<
TAutoStandardInfoVo
>()
{
/**
* 单次缓存的数据量
*/
public
static
final
int
BATCH_COUNT
=
CommonConstants
.
BATCH_COUNT
;
/**
*临时存储
*/
private
List
<
TAutoStandardInfoVo
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
@Override
public
void
invoke
(
TAutoStandardInfoVo
data
,
AnalysisContext
context
)
{
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
ErrorMessage
errorMessage
=
util1
.
checkEntity
(
data
,
data
.
getRowIndex
());
if
(
Common
.
isNotNull
(
errorMessage
)){
errorMessageList
.
add
(
errorMessage
);
}
else
{
cachedDataList
.
add
(
data
);
}
if
(
cachedDataList
.
size
()
>=
BATCH_COUNT
)
{
saveData
();
// 存储完成清理 list
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
}
}
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
saveData
();
}
/**
* 加上存储数据库
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importTAutoStandardInfo
(
cachedDataList
,
errorMessageList
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
}
catch
(
Exception
e
){
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
R
.
ok
(
errorMessageList
);
}
private
void
importTAutoStandardInfo
(
List
<
TAutoStandardInfoVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
// 个性化校验逻辑
ErrorMessage
errorMsg
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
TAutoStandardInfoVo
excel
=
excelVOList
.
get
(
i
);
// 数据合法情况 TODO
// 插入
insertExcel
(
excel
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
));
}
}
/**
* 插入excel bad record
*/
private
void
insertExcel
(
TAutoStandardInfoVo
excel
)
{
TAutoStandardInfo
insert
=
new
TAutoStandardInfo
();
BeanUtil
.
copyProperties
(
excel
,
insert
);
this
.
save
(
insert
);
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TAutoInsurStandardMapper.xml
View file @
1a952829
...
...
@@ -106,9 +106,26 @@
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_auto_insur_standard a
<if
test=
"tAutoInsurStandard.standard != null and tAutoInsurStandard.standard.trim() != ''"
>
LEFT JOIN (select * from t_auto_standard_info where STANDARD+0 = #{tAutoInsurStandard.standard}+0) b on a.id=b.MAIN_ID
</if>
<where>
1=1
<include
refid=
"tAutoInsurStandard_where"
/>
<if
test=
"tAutoInsurStandard != null"
>
<if
test=
"tAutoInsurStandard.mainId != null and tAutoInsurStandard.mainId.trim() != ''"
>
AND a.MAIN_ID = #{tAutoInsurStandard.mainId}
</if>
<if
test=
"tAutoInsurStandard.name != null and tAutoInsurStandard.name.trim() != ''"
>
AND a.NAME like concat(,'%',#{tAutoInsurStandard.name}, '%')
</if>
<if
test=
"tAutoInsurStandard.company != null"
>
AND a.COMPANY like concat(,'%',#{tAutoInsurStandard.company}, '%')
</if>
<if
test=
"tAutoInsurStandard.riskType != null"
>
AND a.RISK_TYPE like concat(,'%',#{tAutoInsurStandard.riskType}, '%')
</if>
</if>
</where>
</select>
</mapper>
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TAutoStandardInfoMapper.xml
0 → 100644
View file @
1a952829
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoStandardInfoMapper"
>
<resultMap
id=
"tAutoStandardInfoMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoStandardInfo"
>
<id
property=
"id"
column=
"ID"
/>
<result
property=
"mainId"
column=
"MAIN_ID"
/>
<result
property=
"standard"
column=
"STANDARD"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.ID,
a.MAIN_ID,
a.STANDARD
</sql>
<sql
id=
"tAutoStandardInfo_where"
>
<if
test=
"tAutoStandardInfo != null"
>
<if
test=
"tAutoStandardInfo.id != null and tAutoStandardInfo.id.trim() != ''"
>
AND a.ID = #{tAutoStandardInfo.id}
</if>
<if
test=
"tAutoStandardInfo.mainId != null and tAutoStandardInfo.mainId.trim() != ''"
>
AND a.MAIN_ID = #{tAutoStandardInfo.mainId}
</if>
<if
test=
"tAutoStandardInfo.standard != null"
>
AND a.STANDARD = #{tAutoStandardInfo.standard}
</if>
</if>
</sql>
<!--tAutoStandardInfo简单分页查询-->
<select
id=
"getTAutoStandardInfoPage"
resultMap=
"tAutoStandardInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_auto_standard_info a
<where>
1=1
<include
refid=
"tAutoStandardInfo_where"
/>
</where>
</select>
<!--tAutoStandardInfo简单分页查询-->
<select
id=
"getTAutoStandardInfoNoPage"
resultMap=
"tAutoStandardInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_auto_standard_info a
<where>
1=1
<include
refid=
"tAutoStandardInfo_where"
/>
</where>
</select>
</mapper>
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceType.java
View file @
1a952829
...
...
@@ -85,4 +85,10 @@ public class TInsuranceType extends BaseEntity {
@Schema
(
description
=
"是否地市自购"
)
private
String
isAdress
;
/**
* 启用状态 0是 1 否
*/
@Schema
(
description
=
"启用状态"
)
private
String
enable
;
}
\ No newline at end of file
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceTypeStandard.java
View file @
1a952829
...
...
@@ -62,4 +62,10 @@ public class TInsuranceTypeStandard extends BaseEntity {
*/
@Schema
(
description
=
"是否删除 0否/1是"
)
private
Integer
deleteFlag
;
/**
* 启用状态 0是 1 否
*/
@Schema
(
description
=
"启用状态"
)
private
String
enable
;
}
\ No newline at end of file
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceDetailDispatchVO.java
0 → 100644
View file @
1a952829
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
/**
* @Author fxj
* @Description 保单号列表查询对象
* @Author fxj
* @Date 2025/4/7 19:54
* @Version 1.0
**/
@Data
@Schema
(
description
=
"保单号列表查询对象"
)
public
class
InsuranceDetailDispatchVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
628032758008497542L
;
/**
* 保单号
*/
@Schema
(
description
=
"保单号"
)
private
String
policyNo
;
/**
* 保险公司名称
*/
@Schema
(
description
=
"保险公司名称"
)
private
String
insuranceCompanyName
;
/**
* 险种名称
*/
@Schema
(
description
=
"险种名称"
)
private
String
insuranceTypeName
;
/**
* 购买标准
*/
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 商险购买地
*/
@Schema
(
description
=
"商险购买地"
)
private
String
insuranceAreaName
;
/**
* 保单开始时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
@Schema
(
description
=
"保单开始时间"
)
private
LocalDate
policyStart
;
/**
* 保单结束时间
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
@Schema
(
description
=
"保单结束时间"
)
private
LocalDate
policyEnd
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceDispatchParam.java
0 → 100644
View file @
1a952829
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author fxj
* @Description 已投保保单号列表查询
* @Date 19:51 2025/4/7
**/
@Data
@Schema
(
description
=
"已投保保单号列表查询"
)
public
class
InsuranceDispatchParam
{
/**
* 保单编号
*/
@Schema
(
description
=
"保单编号"
)
private
String
policyNo
;
/**
* 险种名称
*/
@Schema
(
description
=
"险种名称"
)
private
String
insuranceTypeName
;
/**
* 购买标准
*/
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 保险公司名称
*/
@Schema
(
description
=
"保险公司名称"
)
private
String
insuranceCompanyName
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceTypeExportVo.java
View file @
1a952829
...
...
@@ -55,5 +55,10 @@ public class InsuranceTypeExportVo {
@Schema
(
description
=
"是否地市自购"
)
private
String
isAdress
;
/**
* 启用状态 0是 1 否
*/
@Schema
(
description
=
"启用状态"
)
private
String
enable
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
1a952829
...
...
@@ -825,4 +825,5 @@ public class TInsuranceDetailController {
public
SalaryRiskListVo
getRiskByIdCard
(
@RequestBody
List
<
TSalaryAccount
>
idCardList
)
{
return
tInsuranceDetailService
.
getRiskByIdCard
(
idCardList
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceTypeController.java
View file @
1a952829
...
...
@@ -103,4 +103,19 @@ public class TInsuranceTypeController {
public
R
getInsuranceTypeList
(
@RequestBody
TInsuranceType
insuranceType
)
{
return
insuranceTypeService
.
getInsuranceTypeList
(
insuranceType
);
}
/**
* @Author fxj
* @Description 更新启用禁用状态
* @param id 购买险种id
* @param enable 启用禁用状态
* @Date 19:00 2025/4/7
**/
@Operation
(
summary
=
"通过id更新启用状态"
,
description
=
"通过id更新启用状态"
)
@GetMapping
(
"/enableById"
)
public
R
enableById
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
String
id
,
@RequestParam
(
value
=
"enable"
,
required
=
true
)
String
enable
)
{
return
insuranceTypeService
.
enableById
(
id
,
enable
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceTypeStandardController.java
View file @
1a952829
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeStandardService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -62,4 +65,18 @@ public class TInsuranceTypeStandardController {
public
R
save
(
@RequestBody
TInsuranceTypeStandard
insuranceTypeStandard
)
{
return
insuranceTypeStandardService
.
saveInsuranceTypeStandard
(
insuranceTypeStandard
);
}
/**
* @Author fxj
* @Description 更新启用禁用状态
* @param id 购买标准id
* @param enable 启用禁用状态
* @Date 19:00 2025/4/7
**/
@Operation
(
summary
=
"通过id更新启用状态"
,
description
=
"通过id更新启用状态"
)
@DeleteMapping
(
"/enableById"
)
public
R
enableById
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
String
id
,
@RequestParam
(
value
=
"enable"
,
required
=
true
)
String
enable
)
{
return
insuranceTypeStandardService
.
enableById
(
id
,
enable
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceDetailMapper.java
View file @
1a952829
...
...
@@ -323,4 +323,5 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
void
batchexpireAlertIgnore
(
@Param
(
"idList"
)
List
<
String
>
idList
);
void
updateExpireAlert
(
@Param
(
"id"
)
String
id
,
@Param
(
"expireFlag"
)
String
expireFlag
,
@Param
(
"remark"
)
String
remark
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TInsuranceDetailService.java
View file @
1a952829
...
...
@@ -551,5 +551,4 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskListVo
**/
SalaryRiskListVo
getRiskByIdCard
(
List
<
TSalaryAccount
>
idCardList
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TInsuranceTypeService.java
View file @
1a952829
...
...
@@ -68,4 +68,6 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> {
* @return {@link List< TInsuranceType>}
*/
R
getInsuranceTypeList
(
TInsuranceType
insuranceType
);
R
enableById
(
String
id
,
String
enable
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TInsuranceTypeStandardService.java
View file @
1a952829
...
...
@@ -36,4 +36,6 @@ public interface TInsuranceTypeStandardService extends IService<TInsuranceTypeSt
* @return {@link R}
*/
R
saveInsuranceTypeStandard
(
TInsuranceTypeStandard
insuranceTypeStandard
);
R
enableById
(
String
id
,
String
enable
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
1a952829
...
...
@@ -493,6 +493,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
detail
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceType:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceType
).
isPresent
())
{
...
...
@@ -678,6 +679,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceType:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
...
...
@@ -688,6 +690,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
...
...
@@ -2557,6 +2560,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
byId
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
())
{
...
...
@@ -2871,6 +2875,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceType:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
...
...
@@ -2890,6 +2895,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
...
...
@@ -3242,6 +3248,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceType:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
...
...
@@ -3261,6 +3268,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
...
...
@@ -3458,6 +3466,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceType:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceType
).
isPresent
())
{
...
...
@@ -4187,6 +4196,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandardNew
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
detail
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getEnable
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
())
{
...
...
@@ -8233,5 +8243,4 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
return
returnVo
;
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceTypeServiceImpl.java
View file @
1a952829
...
...
@@ -100,7 +100,9 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
return
R
.
failed
(
"所属保险公司不存在或已被删除"
);
}
LambdaQueryWrapper
<
TInsuranceType
>
typeWrapper
=
new
LambdaQueryWrapper
<>();
typeWrapper
.
eq
(
TInsuranceType
::
getInsuranceCompanyId
,
companyId
).
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
()).
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
typeWrapper
.
eq
(
TInsuranceType
::
getInsuranceCompanyId
,
companyId
)
.
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceType
type
=
getOne
(
typeWrapper
);
if
(!
Common
.
isEmpty
(
type
)){
return
R
.
failed
(
"当前保险公司已存在该险种"
);
...
...
@@ -233,4 +235,22 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}
}
@Override
@Transactional
(
value
=
"insurancesTransactionEnableByIdr"
,
rollbackFor
=
{
Exception
.
class
})
public
R
enableById
(
String
id
,
String
enable
)
{
if
(
Common
.
isEmpty
(
id
)
||
Common
.
isEmpty
(
enable
)
||
!
CommonConstants
.
ONE_STRING
.
equals
(
enable
)
&&
!
CommonConstants
.
TWO_STRING
.
equals
(
enable
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
TInsuranceType
insuranceType
=
getById
(
id
);
if
(
Common
.
isEmpty
(
insuranceType
)){
return
R
.
failed
(
"当前险种信息不存在或已被删除"
);
}
insuranceType
.
setEnable
(
enable
);
baseMapper
.
updateById
(
insuranceType
);
return
R
.
ok
();
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceTypeStandardServiceImpl.java
View file @
1a952829
...
...
@@ -56,7 +56,8 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
return
R
.
failed
(
"当前险种信息不存在或已被删除"
);
}
LambdaQueryWrapper
<
TInsuranceTypeStandard
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
id
);
queryWrapper
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
id
);
queryWrapper
.
orderByDesc
(
TInsuranceTypeStandard
::
getCreateTime
);
return
R
.
ok
(
list
(
queryWrapper
));
}
...
...
@@ -173,4 +174,22 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
e
.
getStackTrace
();
}
}
@Override
@Transactional
(
value
=
"insurancesTransactionEnableById"
,
rollbackFor
=
{
Exception
.
class
})
public
R
enableById
(
String
id
,
String
enable
)
{
if
(
Common
.
isEmpty
(
id
)
||
Common
.
isEmpty
(
enable
)
||
!
CommonConstants
.
ONE_STRING
.
equals
(
enable
)
&&
!
CommonConstants
.
TWO_STRING
.
equals
(
enable
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
TInsuranceTypeStandard
typeStandard
=
getById
(
id
);
if
(
Common
.
isEmpty
(
typeStandard
)){
return
R
.
failed
(
"当前购买标准信息不存在或已被删除"
);
}
typeStandard
.
setEnable
(
enable
);
baseMapper
.
updateById
(
typeStandard
);
return
R
.
ok
();
}
}
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceTypeMapper.xml
View file @
1a952829
...
...
@@ -18,13 +18,14 @@
<result
property=
"updateBy"
column=
"UPDATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"isAdress"
column=
"IS_ADRESS"
jdbcType=
"VARCHAR"
/>
<result
property=
"enable"
column=
"ENABLE"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
ID,NAME,INSURANCE_COMPANY_ID,
RECEIPT_UNIT_NAME,BANK_NAME,BANK_NO,
DELETE_FLAG,CREATE_BY,CREATE_NAME,
CREATE_TIME,UPDATE_BY,UPDATE_TIME,IS_ADRESS
CREATE_TIME,UPDATE_BY,UPDATE_TIME,IS_ADRESS
,ENABLE
</sql>
<select
id=
"selectInsuranceTypeRateList"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate"
>
select
...
...
@@ -47,7 +48,8 @@
INSURANCE_TYPE_ID as insuranceTypeId,
BUY_STANDARD as buyStandard,
MEDICAL_QUOTA as medicalQuota,
DIE_DISABLE_QUOTA as dieDisableQuota
DIE_DISABLE_QUOTA as dieDisableQuota,
ENABLE as enable
from
t_insurance_type_standard
where
...
...
@@ -66,7 +68,7 @@
a.BANK_NAME as bankName,
a.BANK_NO as bankNo,
a.AGE_LIMIT as ageLimit,
a.IS_ADRESS as isAdress
a.IS_ADRESS as isAdress
,a.ENABLE as enable
from
t_insurance_type a,
t_insurance_company b
...
...
@@ -83,6 +85,9 @@
<if
test=
"insuranceType.isAdress != null and insuranceType.isAdress.trim() != ''"
>
and a.IS_ADRESS = #{insuranceType.isAdress}
</if>
<if
test=
"insuranceType.enable != null and insuranceType.enable.trim() != ''"
>
and a.ENABLE = #{insuranceType.enable}
</if>
ORDER BY a.CREATE_TIME DESC
</select>
...
...
@@ -94,7 +99,7 @@
a.BANK_NO as bankNo,
a.RECEIPT_UNIT_NAME as receiptUnitName,
if(a.AGE_LIMIT = '0','限制(16-70岁)','无') as ageLimit,
if(a.IS_ADRESS = '0','是',if(ifnull(a.IS_ADRESS,3) = 3,'','否')) as isAdress
if(a.IS_ADRESS = '0','是',if(ifnull(a.IS_ADRESS,3) = 3,'','否')) as isAdress
,a.ENABLE as enable
from
t_insurance_type a,
t_insurance_company b
...
...
@@ -111,6 +116,9 @@
<if
test=
"insuranceType.isAdress != null and insuranceType.isAdress.trim() != ''"
>
and a.IS_ADRESS = #{insuranceType.isAdress}
</if>
<if
test=
"insuranceType.enable != null and insuranceType.enable.trim() != ''"
>
and a.ENABLE = #{insuranceType.enable}
</if>
ORDER BY a.CREATE_TIME DESC
</select>
...
...
@@ -125,7 +133,7 @@
a.BANK_NAME as bankName,
a.BANK_NO as bankNo,
a.AGE_LIMIT as ageLimit,
a.IS_ADRESS as isAdress
a.IS_ADRESS as isAdress
,a.ENABLE as enable
from
t_insurance_type a,
t_insurance_company b
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceTypeStandardMapper.xml
View file @
1a952829
...
...
@@ -10,9 +10,10 @@
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"enable"
column=
"ENABLE"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
ID,INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,
ID,INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,
ENABLE
</sql>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment