Commit 4223427c authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:增加商险按钮权限验证"

See merge request fangxinjiang/yifu!224
parents 0f0adc19 2a8c343f
...@@ -1055,6 +1055,19 @@ public class InsurancesConstants { ...@@ -1055,6 +1055,19 @@ public class InsurancesConstants {
*/ */
public static final String CORRECT_SETTLE_BILL = "红冲结算单信息"; public static final String CORRECT_SETTLE_BILL = "红冲结算单信息";
/**
* 突发事件创建
*/
public static final String URGENT_UPDATE_IS_USE = "突发事件创建";
/**
* 系统触发
*/
public static final String SYSTEM_TRIGGER = "系统触发";
} }
...@@ -175,5 +175,10 @@ public class InsuranceExportListVO implements Serializable { ...@@ -175,5 +175,10 @@ public class InsuranceExportListVO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
...@@ -181,4 +181,10 @@ public class InsuranceRefundListVo implements Serializable { ...@@ -181,4 +181,10 @@ public class InsuranceRefundListVo implements Serializable {
*/ */
@Schema(description = "购买月数") @Schema(description = "购买月数")
private Long buyMonth; private Long buyMonth;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
...@@ -194,4 +194,10 @@ public class RefundExportListVo implements Serializable { ...@@ -194,4 +194,10 @@ public class RefundExportListVo implements Serializable {
*/ */
@Schema(description = "购买天数") @Schema(description = "购买天数")
private long buyDay; private long buyDay;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -11,6 +11,7 @@ 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.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -50,6 +51,7 @@ public class TInsuranceCompanyController { ...@@ -50,6 +51,7 @@ public class TInsuranceCompanyController {
*/ */
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情") @Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情")
@PreAuthorize("@pms.hasPermission('insurance:insuranceCompany_getById')")
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));
} }
...@@ -60,10 +62,10 @@ public class TInsuranceCompanyController { ...@@ -60,10 +62,10 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司明细 * @param insuranceCompany 保险公司明细
* @return R * @return R
*/ */
@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')") @Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('insurance:insuranceCompany_save')")
@SysLog("新增保险公司" ) @SysLog("新增保险公司" )
@PostMapping("/save") @PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" ) @PreAuthorize("@pms.hasPermission('insurance_company_ad')")
public R save(@RequestBody TInsuranceCompany insuranceCompany) { public R save(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.saveInsuranceCompany(insuranceCompany); return insuranceCompanyService.saveInsuranceCompany(insuranceCompany);
} }
...@@ -73,10 +75,9 @@ public class TInsuranceCompanyController { ...@@ -73,10 +75,9 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 修改实体类 * @param insuranceCompany 修改实体类
* @return R * @return R
*/ */
@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')") @Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('insurance:insuranceCompany_update')")
@SysLog("修改保险公司" ) @SysLog("修改保险公司" )
@PostMapping("/update") @PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_update')" )
public R update(@RequestBody TInsuranceCompany insuranceCompany) { public R update(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.updateInsuranceCompany(insuranceCompany); return insuranceCompanyService.updateInsuranceCompany(insuranceCompany);
} }
...@@ -85,7 +86,7 @@ public class TInsuranceCompanyController { ...@@ -85,7 +86,7 @@ public class TInsuranceCompanyController {
* 查询保险公司列表(不分页) * 查询保险公司列表(不分页)
* @return * @return
*/ */
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)") @Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页):insurance:insuranceCompany_list")
@GetMapping("/list") @GetMapping("/list")
public R<List<TInsuranceCompany>> getInsuranceCompanyList() { public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList()); return R.ok(insuranceCompanyService.getInsuranceCompanyList());
......
...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; ...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -46,6 +47,7 @@ public class TInsuranceEnclosureController { ...@@ -46,6 +47,7 @@ public class TInsuranceEnclosureController {
@SysLog("电子保单上传") @SysLog("电子保单上传")
@Schema(description = "电子保单上传") @Schema(description = "电子保单上传")
@PostMapping(value = "/uploadInsuranceEnclosure") @PostMapping(value = "/uploadInsuranceEnclosure")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_import')")
public R uploadInsuranceEnclosure(@RequestBody MultipartFile file, String filePath,String remark) throws IOException { public R uploadInsuranceEnclosure(@RequestBody MultipartFile file, String filePath,String remark) throws IOException {
return tInsuranceEnclosureService.uploadInsuranceEnclosure(file, filePath,remark); return tInsuranceEnclosureService.uploadInsuranceEnclosure(file, filePath,remark);
} }
...@@ -76,6 +78,7 @@ public class TInsuranceEnclosureController { ...@@ -76,6 +78,7 @@ public class TInsuranceEnclosureController {
@Schema(description = "删除电子保单") @Schema(description = "删除电子保单")
@SysLog("删除电子保单") @SysLog("删除电子保单")
@GetMapping("/deleteInsuranceEnclosure/{id}") @GetMapping("/deleteInsuranceEnclosure/{id}")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_delete')")
public R deleteInsuranceEnclosure(@PathVariable String id) { public R deleteInsuranceEnclosure(@PathVariable String id) {
return tInsuranceEnclosureService.deleteInsuranceEnclosure(id); return tInsuranceEnclosureService.deleteInsuranceEnclosure(id);
} }
......
...@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -12,6 +12,7 @@ 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.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -47,9 +48,10 @@ public class TInsuranceTypeController { ...@@ -47,9 +48,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细 * @param insuranceType 险种明细
* @return R * @return R
*/ */
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "新增险种", description = "新增险种:hasPermission('insurance:insuranceType_save')")
@SysLog("新增险种") @SysLog("新增险种")
@PostMapping("/save") @PostMapping("/save")
@PreAuthorize("@pms.hasPermission('insuranceType_add')")
public R save(@RequestBody TInsuranceType insuranceType) { public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType); return insuranceTypeService.saveInsuranceType(insuranceType);
} }
...@@ -59,8 +61,9 @@ public class TInsuranceTypeController { ...@@ -59,8 +61,9 @@ public class TInsuranceTypeController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')") @Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
public R getInsuranceTypeDetail(@PathVariable("id" ) String id) { public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return insuranceTypeService.getInsuranceTypeDetail(id); return insuranceTypeService.getInsuranceTypeDetail(id);
} }
...@@ -71,9 +74,10 @@ public class TInsuranceTypeController { ...@@ -71,9 +74,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细 * @param insuranceType 险种明细
* @return R * @return R
*/ */
@Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "修改险种", description = "新增险种:hasPermission('insurance:insuranceType_update')")
@SysLog("修改险种") @SysLog("修改险种")
@PostMapping("/update") @PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_update')")
public R update(@RequestBody TInsuranceType insuranceType) { public R update(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.updateInsuranceType(insuranceType); return insuranceTypeService.updateInsuranceType(insuranceType);
} }
......
...@@ -789,6 +789,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -789,6 +789,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
ProjectSetInfoVo setInfoVo = data.get(byId.getDeptNo()); ProjectSetInfoVo setInfoVo = data.get(byId.getDeptNo());
if (null != setInfoVo){ if (null != setInfoVo){
insuranceDetailVO.setCoverProjectName(Optional.ofNullable(setInfoVo.getDepartName()).orElse("")); insuranceDetailVO.setCoverProjectName(Optional.ofNullable(setInfoVo.getDepartName()).orElse(""));
insuranceDetailVO.setCoveInvoiceTitle(Optional.ofNullable(setInfoVo.getInvoiceTitle()).orElse(""));
} }
} }
} }
...@@ -945,6 +946,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -945,6 +946,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
record.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitle()).orElse(""));
} }
} }
} }
...@@ -3088,6 +3090,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3088,6 +3090,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
record.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitle()).orElse(""));
} }
} }
} }
...@@ -3171,6 +3174,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3171,6 +3174,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
record.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitle()).orElse(""));
} }
TInsuranceDetail detail = getById(record.getId()); TInsuranceDetail detail = getById(record.getId());
TInsuranceRefund refund = new TInsuranceRefund(); TInsuranceRefund refund = new TInsuranceRefund();
...@@ -5141,13 +5145,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5141,13 +5145,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)){
return R.failed("无可出险的保单"); return R.failed("无可出险的保单");
} }
List<TInsuranceOperate> operateList = new ArrayList<>();
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail tInsuranceDetail : list) { for (TInsuranceDetail tInsuranceDetail : list) {
TInsuranceOperate operate = new TInsuranceOperate();
updateWrapper.eq(TInsuranceDetail :: getId,tInsuranceDetail.getId()) updateWrapper.eq(TInsuranceDetail :: getId,tInsuranceDetail.getId())
.set(TInsuranceDetail :: getIsUse,CommonConstants.ONE_INT) .set(TInsuranceDetail :: getIsUse,CommonConstants.ONE_INT)
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper); update(updateWrapper);
operate.setOperateDesc(InsurancesConstants.URGENT_UPDATE_IS_USE);
operate.setCreateName(InsurancesConstants.SYSTEM_TRIGGER);
operate.setInsuranceDetailId(tInsuranceDetail.getId());
operate.setDisplayFlag(CommonConstants.ONE_INT);
operate.setCreateTime(LocalDateTime.now());
operate.setCreateBy(CommonConstants.ZERO_STRING);
operateList.add(operate);
} }
tInsuranceOperateService.saveBatch(operateList);
return R.ok("EKP紧急出险成功"); return R.ok("EKP紧急出险成功");
} }
......
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