Commit 1a952829 authored by fangxinjiang's avatar fangxinjiang

商险规则-fxj

parent 182158ea
......@@ -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;
}
/*
* 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;
}
......@@ -55,4 +55,10 @@ public class TAutoInsurStandardSearchVo extends TAutoInsurStandard {
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* @Author fxj
* 项目编码
**/
@Schema(description = "项目编码")
private int projectNo;
}
......@@ -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;
}
/*
* 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;
}
/*
* 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;
}
/*
* 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));
}
}
/*
* 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);
}
/*
* 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);
}
......@@ -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);
}
......
......@@ -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>
<?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>
......@@ -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
......@@ -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
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;
}
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;
}
......@@ -55,5 +55,10 @@ public class InsuranceTypeExportVo {
@Schema(description = "是否地市自购")
private String isAdress;
/**
* 启用状态 0是 1 否
*/
@Schema(description = "启用状态")
private String enable;
}
......@@ -825,4 +825,5 @@ public class TInsuranceDetailController {
public SalaryRiskListVo getRiskByIdCard(@RequestBody List<TSalaryAccount> idCardList) {
return tInsuranceDetailService.getRiskByIdCard(idCardList);
}
}
......@@ -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);
}
}
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);
}
}
......@@ -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);
}
......@@ -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);
}
......@@ -68,4 +68,6 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> {
* @return {@link List< TInsuranceType>}
*/
R getInsuranceTypeList(TInsuranceType insuranceType);
R enableById(String id, String enable);
}
......@@ -36,4 +36,6 @@ public interface TInsuranceTypeStandardService extends IService<TInsuranceTypeSt
* @return {@link R}
*/
R saveInsuranceTypeStandard(TInsuranceTypeStandard insuranceTypeStandard);
R enableById(String id, String enable);
}
......@@ -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;
}
}
......@@ -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();
}
}
......@@ -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();
}
}
......@@ -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
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment