| | |
| | | package com.ruoyi.web.controller.product; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.im.util.ConverterUtil; |
| | | import com.ruoyi.system.domain.GroupWelcomeConfig; |
| | | import com.ruoyi.system.domain.InsuranceFeature; |
| | | import com.ruoyi.system.domain.InsuranceProduct; |
| | | import com.ruoyi.system.domain.IpBlacklist; |
| | | import com.ruoyi.system.domain.dto.InsuranceProductUpdateDTO; |
| | | import com.ruoyi.system.service.InsuranceFeatureService; |
| | | import com.ruoyi.system.service.InsuranceProductService; |
| | | import com.ruoyi.im.service.InsuranceFeatureService; |
| | | import com.ruoyi.im.service.InsuranceProductService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | insuranceProduct.setGuaranteeExplanation(dto.getGuaranteeExplanation()); |
| | | insuranceProduct.setInsureAge(dto.getInsureAge()); |
| | | insuranceProduct.setObligationDisclose(dto.getObligationDisclose()); |
| | | insuranceProduct.setProductFeature(dto.getProductFeature()); |
| | | insuranceProduct.setLiabilityExemption(dto.getLiabilityExemption()); |
| | | insuranceProduct.setImg1(dto.getImg1()); |
| | | insuranceProduct.setImg2(dto.getImg2()); |
| | |
| | | insuranceFeature.setProductId(insuranceProduct.getId()); |
| | | insuranceFeature.setTitle(f.getTitle()); |
| | | insuranceFeature.setDetail(f.getDetail()); |
| | | insuranceFeature.setCreatedAt(LocalDateTime.now()); |
| | | insuranceFeature.setUpdatedAt(LocalDateTime.now()); |
| | | insuranceFeature.setCreatedAt(new Date()); |
| | | insuranceFeature.setUpdatedAt(new Date()); |
| | | return insuranceFeature; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | |
| | | product.setGuaranteeExplanation(dto.getGuaranteeExplanation()); |
| | | product.setInsureAge(dto.getInsureAge()); |
| | | product.setObligationDisclose(dto.getObligationDisclose()); |
| | | product.setProductFeature(dto.getProductFeature()); |
| | | product.setLiabilityExemption(dto.getLiabilityExemption()); |
| | | product.setImg1(dto.getImg1()); |
| | | product.setImg2(dto.getImg2()); |
| | | |
| | | // 设置创建时间和更新时间 |
| | | product.setCreatedAt(LocalDateTime.now()); |
| | | product.setUpdatedAt(LocalDateTime.now()); |
| | | product.setCreatedAt(new Date()); |
| | | product.setUpdatedAt(new Date()); |
| | | |
| | | // 3. 保存产品信息 |
| | | boolean productSuccess = insuranceProductService.save(product); |
| | |
| | | insuranceFeature.setProductId(product.getId()); |
| | | insuranceFeature.setTitle(f.getTitle()); |
| | | insuranceFeature.setDetail(f.getDetail()); |
| | | insuranceFeature.setCreatedAt(LocalDateTime.now()); |
| | | insuranceFeature.setUpdatedAt(LocalDateTime.now()); |
| | | insuranceFeature.setCreatedAt(new Date()); |
| | | insuranceFeature.setUpdatedAt(new Date()); |
| | | return insuranceFeature; |
| | | }) |
| | | .collect(Collectors.toList()); |