Commit 6cd41c41 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

# Conflicts:
#	yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
#	yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
#	yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
parents c54854f2 be11dd5e
...@@ -78,17 +78,17 @@ public class EmployeeContractExportVO implements Serializable { ...@@ -78,17 +78,17 @@ public class EmployeeContractExportVO implements Serializable {
private String contractEnd; private String contractEnd;
@ExcelProperty("档案-省") @ExcelProperty("档案-省")
@ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "") @ExcelAttribute(name = "档案-省", maxLength = 32, isArea = true)
@Schema(description = "档案-省", name = "fileProvince") @Schema(description = "档案-省", name = "fileProvince")
private String fileProvince; private String fileProvince;
@ExcelProperty("档案-市") @ExcelProperty("档案-市")
@ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince") @ExcelAttribute(name = "档案-市", maxLength = 32, isArea = true, parentField = "fileProvince")
@Schema(description = "档案-市", name = "fileCity") @Schema(description = "档案-市", name = "fileCity")
private String fileCity; private String fileCity;
@ExcelProperty("档案-县") @ExcelProperty("档案-县")
@ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity") @ExcelAttribute(name = "档案-县", maxLength = 32, isArea = true, parentField = "fileCity")
@Schema(description = "档案-县", name = "fileTown") @Schema(description = "档案-县", name = "fileTown")
private String fileTown; private String fileTown;
...@@ -114,7 +114,7 @@ public class EmployeeContractExportVO implements Serializable { ...@@ -114,7 +114,7 @@ public class EmployeeContractExportVO implements Serializable {
@Schema(description = "合同类型", name = "contractName") @Schema(description = "合同类型", name = "contractName")
private String contractName; private String contractName;
@ExcelProperty("申请编号") @ExcelProperty("业务细分")
@NotBlank(message = "业务细分不能为空") @NotBlank(message = "业务细分不能为空")
@Length(max = 32, message = "业务细分不能超过32个字符") @Length(max = 32, message = "业务细分不能超过32个字符")
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true) @ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
......
...@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setEmpNatrue(tEmployeeProject.getEmpNatrue()); tEmployeeContractInfo.setEmpNatrue(tEmployeeProject.getEmpNatrue());
tEmployeeContractInfo.setEmpIdcard(tEmployeeInfo.getEmpIdcard()); tEmployeeContractInfo.setEmpIdcard(tEmployeeInfo.getEmpIdcard());
tEmployeeContractInfo.setEmpName(tEmployeeInfo.getEmpName()); tEmployeeContractInfo.setEmpName(tEmployeeInfo.getEmpName());
tEmployeeContractInfo.setEmpNo(tEmployeeInfo.getEmpCode()); tEmployeeContractInfo.setEmpNo(tEmployeeProject.getEmpNo());
if (Common.isEmpty(tEmployeeContractInfo.getCreateBy())) { if (Common.isEmpty(tEmployeeContractInfo.getCreateBy())) {
tEmployeeContractInfo.setCreateBy(null == user ? "" : user.getId()); tEmployeeContractInfo.setCreateBy(null == user ? "" : user.getId());
tEmployeeContractInfo.setCreateName(null == user ? "" : user.getNickname()); tEmployeeContractInfo.setCreateName(null == user ? "" : user.getNickname());
...@@ -792,7 +792,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -792,7 +792,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) { if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "员工合同批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo); List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExport(contractInfo);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
list = new ArrayList<>(); list = new ArrayList<>();
...@@ -830,7 +830,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -830,7 +830,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
@Override @Override
public void exportContractInfoHistory(TEmployeeContractInfo contractInfo, HttpServletResponse response) { public void exportContractInfoHistory(TEmployeeContractInfo contractInfo, HttpServletResponse response) {
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) { if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出[合并]" + DateUtil.getThisTime() + ".xlsx"; String fileName = "员工合同批量导出【合并历史】" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo); List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo);
ServletOutputStream out = null; ServletOutputStream out = null;
...@@ -848,7 +848,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -848,7 +848,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeContractExportVO.class).includeColumnFiledNames(contractInfo.getExportFields()) EasyExcel.write(out, EmployeeContractExportVO.class).includeColumnFiledNames(contractInfo.getExportFields())
.sheet("员工合同[合并]").doWrite(list); .sheet("员工合同【合并历史】").doWrite(list);
out.flush(); out.flush();
} catch (Exception e) { } catch (Exception e) {
log.error(EmployeeConstants.CONCART_ALL_EXPORT_EXCEPTION, e); log.error(EmployeeConstants.CONCART_ALL_EXPORT_EXCEPTION, e);
......
...@@ -206,6 +206,12 @@ ...@@ -206,6 +206,12 @@
</sql> </sql>
<sql id="tEmployeeContractInfo_where"> <sql id="tEmployeeContractInfo_where">
<if test="tEmployeeContractInfo != null"> <if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tEmployeeContractInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''"> <if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''">
AND a.ID = #{tEmployeeContractInfo.id} AND a.ID = #{tEmployeeContractInfo.id}
</if> </if>
......
...@@ -1162,6 +1162,34 @@ public class DateUtil { ...@@ -1162,6 +1162,34 @@ public class DateUtil {
return sdf.format(date); return sdf.format(date);
} }
/**
* @param date
* @param patten
* @Description: 按指定格式返回
* @Author: hgw
* @Date: 2022/7/19 17:10
* @return: java.lang.String
**/
public static String formatDatePatten(Date date, String patten) {
if (Common.isEmpty(patten)) {
patten = DATETIME_YYYYMM;
}
SimpleDateFormat sdf = new SimpleDateFormat(patten);
return sdf.format(date);
}
/**
* @param date
* @Description: 按指定格式返回int
* @Author: hgw
* @Date: 2022/7/19 17:13
* @return: java.lang.Integer
**/
public static Integer formatDateInt(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_YYYYMM);
return Integer.parseInt(sdf.format(date));
}
/** /**
* @param mnt 增减月份的 值 * @param mnt 增减月份的 值
* @param yearMonth 202101 * @param yearMonth 202101
...@@ -1440,7 +1468,6 @@ public class DateUtil { ...@@ -1440,7 +1468,6 @@ public class DateUtil {
* @Date: 2020/12/21 * @Date: 2020/12/21
* @Description: 获取上个月 * @Description: 获取上个月
* @return: java.lang.String * @return: java.lang.String
* @see com.yifu.cloud.v1.common.core.util
**/ **/
public static String getLastMonth(){ public static String getLastMonth(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM); SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM);
...@@ -1459,7 +1486,6 @@ public class DateUtil { ...@@ -1459,7 +1486,6 @@ public class DateUtil {
* @Date: 2020/12/21 * @Date: 2020/12/21
* @Description: 获取上n个月 * @Description: 获取上n个月
* @return: java.lang.String * @return: java.lang.String
* @see com.yifu.cloud.v1.common.core.util
**/ **/
public static String getLastXMonth(int month){ public static String getLastXMonth(int month){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM); SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM);
......
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; 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.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
...@@ -15,6 +16,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -15,6 +16,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @author zhaji * @author zhaji
...@@ -37,9 +39,9 @@ public class TInsuranceCompanyController { ...@@ -37,9 +39,9 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司 * @param insuranceCompany 保险公司
* @return * @return
*/ */
@Operation(summary = "分页查询", description = "分页查询") //@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
public R<IPage<TInsuranceCompany>> getTCertRecordPage(Page page, TInsuranceCompany insuranceCompany) { public R<IPage<TInsuranceCompany>> getInsuranceCompanyPage(Page page, TInsuranceCompany insuranceCompany) {
return R.ok(insuranceCompanyService.pageDiy(page, insuranceCompany)); return R.ok(insuranceCompanyService.pageDiy(page, insuranceCompany));
} }
...@@ -48,9 +50,7 @@ public class TInsuranceCompanyController { ...@@ -48,9 +50,7 @@ public class TInsuranceCompanyController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询:hasPermission('demo_insuranceCompany_get')")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_get')" )
public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) { public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceCompanyService.getById(id)); return R.ok(insuranceCompanyService.getById(id));
} }
...@@ -61,13 +61,38 @@ public class TInsuranceCompanyController { ...@@ -61,13 +61,38 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司明细 * @param insuranceCompany 保险公司明细
* @return R * @return R
*/ */
@Operation(summary = "新增保险公司", description = "新增证明开具记录表:hasPermission('demo_insuranceCompany_add')") //@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')")
@SysLog("新增保险公司" ) @SysLog("新增保险公司" )
@PostMapping @PostMapping("/save")
@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" ) //@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" )
public R<Boolean> save(@RequestBody TInsuranceCompany insuranceCompany) { public R save(@RequestBody TInsuranceCompany insuranceCompany) {
return R.ok(insuranceCompanyService.save(insuranceCompany)); return insuranceCompanyService.saveInsuranceCompany(insuranceCompany);
}
/**
* 修改保险公司
* @param insuranceCompany 修改实体类
* @return R
*/
//@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')")
@SysLog("修改保险公司" )
@PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_update')" )
public R update(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.updateInsuranceCompany(insuranceCompany);
}
/**
* 查询保险公司列表(不分页)
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/list" )
public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList());
} }
} }
package com.yifu.cloud.plus.v1.yifu.insurances.controller; package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.InsuranceRefundCheck;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAddParam; import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAddParam;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
...@@ -10,6 +12,8 @@ import org.springframework.http.HttpHeaders; ...@@ -10,6 +12,8 @@ import org.springframework.http.HttpHeaders;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -17,6 +21,7 @@ import javax.annotation.Resource; ...@@ -17,6 +21,7 @@ import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
import java.util.List;
/** /**
* @author licancan * @author licancan
...@@ -33,6 +38,20 @@ public class TInsuranceDetailController { ...@@ -33,6 +38,20 @@ public class TInsuranceDetailController {
@Resource @Resource
private TInsuranceDetailService tInsuranceDetailService; private TInsuranceDetailService tInsuranceDetailService;
/**
* 导入减员校验
* @param insuranceRefundCheckList 导入减员校验
* @author zhaji
* @date 2022-07-19
* @since v1.0
*/
@PostMapping("/checkPayRollList")
public R checkInsuranceRefundList(@RequestBody List<InsuranceRefundCheck> insuranceRefundCheckList){
return tInsuranceDetailService.checkInsuranceRefundList(insuranceRefundCheckList);
}
/** /**
* 商险新增 * 商险新增
* *
......
...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; ...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -43,6 +44,19 @@ public class TInsuranceTypeController { ...@@ -43,6 +44,19 @@ public class TInsuranceTypeController {
return R.ok(insuranceTypeService.pageDiy(page, insuranceType)); return R.ok(insuranceTypeService.pageDiy(page, insuranceType));
} }
/**
* 新增险种
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("新增险种")
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType);
}
/** /**
* 通过id查询险种详情 * 通过id查询险种详情
* @param id id * @param id id
...@@ -51,21 +65,8 @@ public class TInsuranceTypeController { ...@@ -51,21 +65,8 @@ public class TInsuranceTypeController {
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')") @Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" ) @PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" )
public R<TInsuranceType> getById(@PathVariable("id" ) String id) { public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return R.ok(insuranceTypeService.getById(id)); return insuranceTypeService.getInsuranceTypeDetail(id);
} }
/**
* 新增险种
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "新增保险公司", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("新增险种")
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R<Boolean> save(@RequestBody TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.save(insuranceType));
}
} }
package com.yifu.cloud.plus.v1.yifu.insurances.controller; package com.yifu.cloud.plus.v1.yifu.insurances.controller;
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.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @author zhaji * @author zhaji
...@@ -24,4 +30,40 @@ public class TInsuranceTypeRateController { ...@@ -24,4 +30,40 @@ public class TInsuranceTypeRateController {
@Resource @Resource
private TInsuranceTypeRateService insuranceTypeRateService; private TInsuranceTypeRateService insuranceTypeRateService;
/**
* 查询费率列表(不分页)
* @return
*/
@Operation(summary = "费率列表", description = "费率列表")
@GetMapping("/list" )
public R getInsuranceTypeRateList(String id) {
return insuranceTypeRateService.getInsuranceTypeRateList(id);
}
/**
* 删除购买费率信息
* @param id 费率id
* @return R
*/
@Operation(summary = "删除购买费率信息", description = "删除购买费率信息:hasPermission('demo_insuranceTypeRate_delete')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_delete')" )
public R deleteById(@PathVariable("id" ) String id) {
return insuranceTypeRateService.deleteInsuranceTypeRate(id);
}
/**
* 新增费率
* @param insuranceTypeRate 费率明细
* @return R
*/
@Operation(summary = "新增费率", description = "新增费率:hasPermission('demo_insuranceTypeRate_add')")
@SysLog("新增费率" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_add')" )
public R save(@RequestBody TInsuranceTypeRate insuranceTypeRate) {
return insuranceTypeRateService.saveInsuranceTypeRate(insuranceTypeRate);
}
} }
package com.yifu.cloud.plus.v1.yifu.insurances.controller; package com.yifu.cloud.plus.v1.yifu.insurances.controller;
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.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -24,4 +29,39 @@ public class TInsuranceTypeStandardController { ...@@ -24,4 +29,39 @@ public class TInsuranceTypeStandardController {
@Resource @Resource
private TInsuranceTypeStandardService insuranceTypeStandardService; private TInsuranceTypeStandardService insuranceTypeStandardService;
/**
* 查询购买标准列表(不分页)
* @return
*/
@Operation(summary = "费率列表", description = "费率列表")
@GetMapping("/list" )
public R getInsuranceTypeRateList(String id) {
return insuranceTypeStandardService.getInsuranceTypeStandard(id);
}
/**
* 删除购买标准信息
* @param id 购买标准id
* @return R
*/
@Operation(summary = "删除购买标准信息", description = "删除购买标准信息:hasPermission('demo_insuranceTypeStandard_delete')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_delete')" )
public R deleteById(@PathVariable("id" ) String id) {
return insuranceTypeStandardService.deleteInsuranceTypeStandard(id);
}
/**
* 新增购买标准
* @param insuranceTypeStandard 购买标准
* @return R
*/
@Operation(summary = "新增购买标准", description = "新增购买标准:hasPermission('demo_insuranceTypeStandard_add')")
@SysLog("新增购买标准" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_add')" )
public R save(@RequestBody TInsuranceTypeStandard insuranceTypeStandard) {
return insuranceTypeStandardService.saveInsuranceTypeStandard(insuranceTypeStandard);
}
} }
...@@ -3,14 +3,59 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service; ...@@ -3,14 +3,59 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_company(保险公司表)】的数据库操作Service * @description 针对表【t_insurance_company(保险公司表)】的数据库操作Service
* @createDate 2022-07-18 17:19:09 * @createDate 2022-07-18 17:19:09
*/ */
public interface TInsuranceCompanyService extends IService<TInsuranceCompany> { public interface TInsuranceCompanyService extends IService<TInsuranceCompany> {
/**
* 分页查询保险公司
*
* @author zhaji
* @param page 分页参数
* @param insuranceCompany 查询类
* @return {@link IPage< TInsuranceCompany>}
*/
IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany); IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany);
/**
* 新增保险公司
*
* @author zhaji
* @param insuranceCompany 新增类
* @return {@link R}
*/
R saveInsuranceCompany(TInsuranceCompany insuranceCompany);
/**
* 修改保险公司
*
* @author zhaji
* @param insuranceCompany 修改类
* @return {@link R}
*/
R updateInsuranceCompany(TInsuranceCompany insuranceCompany);
/**
* 删除保险公司信息
*
* @author zhaji
* @param id 保险公司id
* @return {@link R}
*/
R deleteById(String id);
/**
* 查询当前保险公司列表
*
* @author zhaji
* @return {@link List< TInsuranceCompany>}
*/
List<TInsuranceCompany> getInsuranceCompanyList();
} }
...@@ -3,17 +3,29 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service; ...@@ -3,17 +3,29 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.InsuranceRefundCheck;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAddParam; import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAddParam;
import java.util.List; import java.util.List;
import java.util.List;
/** /**
* @author licancan * @author licancan
* @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service * @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service
* @date 2022-07-18 16:20:16 * @date 2022-07-18 16:20:16
*/ */
public interface TInsuranceDetailService extends IService<TInsuranceDetail> { public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
/**
* 减员导入校验
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
R checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList);
/** /**
* 商险新增 * 商险新增
......
package com.yifu.cloud.plus.v1.yifu.insurances.service; package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_type_rate(费率表)】的数据库操作Service * @description 针对表【t_insurance_type_rate(费率表)】的数据库操作Service
...@@ -10,4 +13,30 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; ...@@ -10,4 +13,30 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
*/ */
public interface TInsuranceTypeRateService extends IService<TInsuranceTypeRate> { public interface TInsuranceTypeRateService extends IService<TInsuranceTypeRate> {
/**
* 根据险种id查询费率列表
*
* @author zhaji
* @param id
* @return {@link List< TInsuranceTypeRate>}
*/
R getInsuranceTypeRateList(String id);
/**
* 删除费率
*
* @author zhaji
* @param id 费率id
* @return {@link R}
*/
R deleteInsuranceTypeRate(String id);
/**
* 新增费率
*
* @author zhaji
* @param insuranceTypeRate
* @return {@link R}
*/
R saveInsuranceTypeRate(TInsuranceTypeRate insuranceTypeRate);
} }
...@@ -4,8 +4,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service; ...@@ -4,8 +4,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
/** /**
* @author Administrator * @author Administrator
...@@ -13,6 +15,32 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; ...@@ -13,6 +15,32 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
* @createDate 2022-07-18 17:19:23 * @createDate 2022-07-18 17:19:23
*/ */
public interface TInsuranceTypeService extends IService<TInsuranceType> { public interface TInsuranceTypeService extends IService<TInsuranceType> {
/**
* 险种分页查询
*
* @author zhaji
* @param page 分页参数
* @param insuranceType 分页查询参数
* @return {@link IPage< TInsuranceType>}
*/
IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType); IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType);
/**
* 新增险种信息
*
* @author zhaji
* @param insuranceType 新增参数
* @return {@link R}
*/
R saveInsuranceType(TInsuranceType insuranceType);
/**
* 查看险种详情
*
* @author zhaji
* @param id 险种id
* @return {@link InsuranceTypeVo}
*/
R getInsuranceTypeDetail(String id);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service; package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
/** /**
...@@ -9,5 +10,30 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard; ...@@ -9,5 +10,30 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
* @createDate 2022-07-18 17:19:41 * @createDate 2022-07-18 17:19:41
*/ */
public interface TInsuranceTypeStandardService extends IService<TInsuranceTypeStandard> { public interface TInsuranceTypeStandardService extends IService<TInsuranceTypeStandard> {
/**
* 查询购买标准列表
*
* @author zhaji
* @param id
* @return {@link R}
*/
R getInsuranceTypeStandard(String id);
/**
* 删除购买标准
*
* @author zhaji
* @param id
* @return {@link R}
*/
R deleteInsuranceTypeStandard(String id);
/**
* 新增购买标准
*
* @author zhaji
* @param insuranceTypeStandard
* @return {@link R}
*/
R saveInsuranceTypeStandard(TInsuranceTypeStandard insuranceTypeStandard);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_company(保险公司表)】的数据库操作Service实现 * @description 针对表【t_insurance_company(保险公司表)】的数据库操作Service实现
...@@ -17,10 +29,133 @@ import org.springframework.stereotype.Service; ...@@ -17,10 +29,133 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyMapper, TInsuranceCompany> implements TInsuranceCompanyService { public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyMapper, TInsuranceCompany> implements TInsuranceCompanyService {
@Resource
private TInsuranceDetailService insuranceDetailService;
@Override @Override
public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) { public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) {
LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(TInsuranceCompany::getCreateTime); wrapper.orderByDesc(TInsuranceCompany::getCreateTime);
return this.baseMapper.selectPage(page,wrapper); return this.baseMapper.selectPage(page,wrapper);
} }
@Override
public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) {
if(Common.isEmpty(insuranceCompany)){
return R.failed("新增的信息为空");
}
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
}
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){
insuranceCompany.setCreateBy("");
insuranceCompany.setCreateName("");
insuranceCompany.setCreateTime(LocalDateTime.now());
return R.ok(this.save(insuranceCompany));
}else{
return R.failed("当前保险公司已存在");
}
}
/**
* 修改保险公司
*
* @author zhaji
* @param insuranceCompany 修改类
* @return {@link R}
*/
@Override
public R updateInsuranceCompany(TInsuranceCompany insuranceCompany) {
String id = insuranceCompany.getId();
if (Common.isEmpty(id)){
return R.failed("要修改的保险公司id为空");
}
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
}
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){
return R.failed("要修改的保险公司不存在或已被删除");
}
String companyName = one.getCompanyName();
//如果当前保险公司名称和修改后的名称不同
if (!companyName.equals(insuranceCompany.getCompanyName())){
//校验旧的保险公司名称是否已存在对应的商险信息
LambdaQueryWrapper<TInsuranceDetail> detailQueryWrapper = new LambdaQueryWrapper<>();
detailQueryWrapper.eq(TInsuranceDetail::getInsuranceCompanyName,companyName)
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(detailQueryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改");
}else{
//校验新的保险公司名称在数据库中是否存在
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if(b){
return R.failed("当前保险公司名称已存在");
}else {
return R.ok(updateById(insuranceCompany));
}
}
}else{
return R.ok(updateById(insuranceCompany));
}
}
/**
* 删除保险公司信息
*
* @author zhaji
* @param id 保险公司id
* @return {@link R}
*/
@Override
public R deleteById(String id) {
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
if(Common.isEmpty(one)){
return R.failed("当前保险公司不存在");
}else {
LambdaUpdateWrapper<TInsuranceCompany> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceCompany::getId,id);
updateWrapper.set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(update(updateWrapper));
}
}
/**
* 查询当前保险公司列表
*
* @author zhaji
* @return {@link List< TInsuranceCompany>}
*/
@Override
public List<TInsuranceCompany> getInsuranceCompanyList() {
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
return list(queryWrapper);
}
/**
* 校验保险公司是否存在
*
* @author zhaji
* @param companyName 保险公司名称
* @return {@link boolean}
*/
public boolean companyIsExists(String companyName){
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getCompanyName,companyName).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
if(Common.isEmpty(one)){
return false;
}else{
return true;
}
}
} }
...@@ -7,6 +7,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -7,6 +7,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants; import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.InsuranceRefundCheck;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
...@@ -20,6 +23,9 @@ import java.util.HashMap; ...@@ -20,6 +23,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author licancan * @author licancan
* @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service实现 * @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service实现
...@@ -28,6 +34,42 @@ import java.util.Map; ...@@ -28,6 +34,42 @@ import java.util.Map;
@Service @Service
public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMapper, TInsuranceDetail> implements TInsuranceDetailService { public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMapper, TInsuranceDetail> implements TInsuranceDetailService {
@Override
public R checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList) {
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
}
List<InsuranceRefundCheck> refundErrorList = new ArrayList(128);
for (InsuranceRefundCheck insuranceRefund : insuranceRefundCheckList) {
boolean b = true;
String empName = insuranceRefund.getEmpName();
String empIdCardNo = insuranceRefund.getEmpIdCardNo();
//保险公司名称
String insuranceCompanyName = insuranceRefund.getInsuranceCompanyName();
//险种名称
String insuranceTypeName = insuranceRefund.getInsuranceTypeName();
String refundMoney = insuranceRefund.getRefundMoney();
String policyStart = insuranceRefund.getPolicyStart();
String policyEnd = insuranceRefund.getPolicyEnd();
String remark = insuranceRefund.getRemark();
if (!b){
refundErrorList.add(insuranceRefund);
}
}
if (Common.isNotEmpty(refundErrorList)){
return null;
}
return null;
}
/** /**
* 商险新增 * 商险新增
* *
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_type_rate(费率表)】的数据库操作Service实现 * @description 针对表【t_insurance_type_rate(费率表)】的数据库操作Service实现
...@@ -14,4 +27,78 @@ import org.springframework.stereotype.Service; ...@@ -14,4 +27,78 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRateMapper, TInsuranceTypeRate> implements TInsuranceTypeRateService { public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRateMapper, TInsuranceTypeRate> implements TInsuranceTypeRateService {
@Resource
private TInsuranceTypeService insuranceTypeService;
/**
* 根据险种id查询费率列表
*
* @author zhaji
* @param id
* @return {@link List< TInsuranceTypeRate>}
*/
@Override
public R getInsuranceTypeRateList(String id) {
if (Common.isEmpty(id)){
return R.failed("险种id为空");
}
TInsuranceType byId = insuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,id);
return R.ok(list(queryWrapper));
}
/**
* 删除费率
*
* @author zhaji
* @param id 费率id
* @return {@link R}
*/
@Override
public R deleteInsuranceTypeRate(String id) {
if(Common.isEmpty(id)){
return R.failed("费率id不能为空");
}
TInsuranceTypeRate byId = getById(id);
if (Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("费率信息不存在或已被删除");
}
LambdaUpdateWrapper<TInsuranceTypeRate> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceTypeRate::getId,id);
updateWrapper.set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(update(updateWrapper));
}
/**
* 新增费率
*
* @author zhaji
* @param insuranceTypeRate 费率信息
* @return {@link R}
*/
@Override
public R saveInsuranceTypeRate(TInsuranceTypeRate insuranceTypeRate) {
if (Common.isEmpty(insuranceTypeRate)){
return R.failed("新增的费率信息为空");
}
String insuranceTypeId = insuranceTypeRate.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
String month = insuranceTypeRate.getMonth();
if (!ValidityUtil.isMonth(month)){
return R.failed("当前月份格式不正确");
}
String rate = insuranceTypeRate.getRate();
if (!Common.isNumber(rate)){
return R.failed("当前费率格式不正确");
}
return R.ok(this.baseMapper.insert(insuranceTypeRate));
}
} }
...@@ -5,11 +5,26 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -5,11 +5,26 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_type(险种表)】的数据库操作Service实现 * @description 针对表【t_insurance_type(险种表)】的数据库操作Service实现
...@@ -18,10 +33,77 @@ import org.springframework.stereotype.Service; ...@@ -18,10 +33,77 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService { public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService {
@Resource
private TInsuranceCompanyService insuranceCompanyService;
/**
* 险种分页查询
*
* @author zhaji
* @param page 分页参数
* @param insuranceType 分页查询参数
* @return {@link IPage< TInsuranceType>}
*/
@Override @Override
public IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType) { public IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType) {
LambdaQueryWrapper<TInsuranceType> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceType> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(TInsuranceType::getCreateTime); wrapper.orderByDesc(TInsuranceType::getCreateTime);
return this.baseMapper.selectPage(page,wrapper); return this.baseMapper.selectPage(page,wrapper);
} }
/**
* 新增险种信息
*
* @author zhaji
* @param insuranceType 新增参数
* @return {@link R}
*/
@Override
public R saveInsuranceType(TInsuranceType insuranceType) {
String companyId = insuranceType.getInsuranceCompanyId();
String bankNo = insuranceType.getBankNo();
if(Common.isNumber(bankNo)){
}
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>();
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("当前险种已存在");
}else{
return R.ok(save(insuranceType));
}
}
/**
* 查看险种详情
*
* @author zhaji
* @param id 险种id
* @return {@link InsuranceTypeVo}
*/
@Override
public R getInsuranceTypeDetail(String id) {
if (Common.isEmpty(id)){
return R.failed("险种ID不能为空");
}
InsuranceTypeVo insuranceTypeVo = new InsuranceTypeVo();
TInsuranceType byId = getById(id);
if(Common.isEmpty(byId) || byId.getDeleteFlag() == CommonConstants.ONE_INT){
return R.failed("当前险种信息不存在或已被删除");
}
BeanCopyUtils.copyProperties(byId,insuranceTypeVo);
List<TInsuranceTypeRate> tInsuranceTypeRates = this.baseMapper.selectInsuranceTypeRateList(id);
List<TInsuranceTypeStandard> tInsuranceTypeStandards = this.baseMapper.selectInsuranceTypeStandardList(id);
insuranceTypeVo.setInsuranceTypeRateList(tInsuranceTypeRates);
insuranceTypeVo.setInsuranceTypeStandardList(tInsuranceTypeStandards);
return R.ok(insuranceTypeVo);
}
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeStandardMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeStandardMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author Administrator * @author Administrator
* @description 针对表【t_insurance_type_standard(购买标准表)】的数据库操作Service实现 * @description 针对表【t_insurance_type_standard(购买标准表)】的数据库操作Service实现
...@@ -13,5 +26,91 @@ import org.springframework.stereotype.Service; ...@@ -13,5 +26,91 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTypeStandardMapper, TInsuranceTypeStandard> implements TInsuranceTypeStandardService { public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTypeStandardMapper, TInsuranceTypeStandard> implements TInsuranceTypeStandardService {
@Resource
private TInsuranceTypeService insuranceTypeService;
@Resource
private TInsuranceDetailService insuranceDetailService;
/**
* 查询购买标准列表
*
* @author zhaji
* @param id
* @return {@link R}
*/
@Override
public R getInsuranceTypeStandard(String id) {
if (Common.isEmpty(id)){
return R.failed("险种id为空");
}
TInsuranceType byId = insuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeStandard::getInsuranceTypeId,id);
return R.ok(list(queryWrapper));
}
/**
* 删除购买标准
*
* @author zhaji
* @param id
* @return {@link R}
*/
@Override
public R deleteInsuranceTypeStandard(String id) {
if(Common.isEmpty(id)){
return R.failed("购买标准id不能为空");
}
TInsuranceTypeStandard byId = getById(id);
if (Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("购买标准信息不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail::getInsuranceTypeId,byId.getInsuranceTypeId())
.eq(TInsuranceDetail::getBuyStandard,byId.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(queryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除");
}
LambdaUpdateWrapper<TInsuranceTypeStandard> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceTypeStandard::getId,id);
updateWrapper.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(update(updateWrapper));
}
/**
* 新增购买标准
*
* @author zhaji
* @param insuranceTypeStandard
* @return {@link R}
*/
@Override
public R saveInsuranceTypeStandard(TInsuranceTypeStandard insuranceTypeStandard) {
if (Common.isEmpty(insuranceTypeStandard)){
return R.failed("新增的购买标准信息为空");
}
String insuranceTypeId = insuranceTypeStandard.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
String buyStandard = insuranceTypeStandard.getBuyStandard();
String medicalQuota = insuranceTypeStandard.getMedicalQuota();
String dieDisableQuota = insuranceTypeStandard.getDieDisableQuota();
if (!Common.isNumber(buyStandard)){
return R.failed("当前购买标准格式不正确");
}
if (!Common.isNumber(medicalQuota)){
return R.failed("当前医疗额度格式不正确");
}
if (!Common.isNumber(dieDisableQuota)){
return R.failed("当前身故或残疾额度格式不正确");
}
return R.ok(this.baseMapper.insert(insuranceTypeStandard));
}
} }
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