Commit a7290494 by 翁国栋

运营后台--

可选择产品
parent fd7a88f6
...@@ -115,212 +115,6 @@ public class InsurePolicy extends Model<InsurePolicy> { ...@@ -115,212 +115,6 @@ public class InsurePolicy extends Model<InsurePolicy> {
*/ */
private Date updateTime; private Date updateTime;
/** private Integer productId;
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:方案名称(必选)
*/
public void setSchemeName(String schemeName) {
this.schemeName = schemeName;
}
/**
* 获取:方案名称(必选)
*/
public String getSchemeName() {
return schemeName;
}
/**
* 设置:保单生效日
*/
public void setPolicyDateStart(Date policyDateStart) {
this.policyDateStart = policyDateStart;
}
/**
* 获取:保单生效日
*/
public Date getPolicyDateStart() {
return policyDateStart;
}
/**
* 设置:保单终止日
*/
public void setPolicyDateEnd(Date policyDateEnd) {
this.policyDateEnd = policyDateEnd;
}
/**
* 获取:保单终止日
*/
public Date getPolicyDateEnd() {
return policyDateEnd;
}
/**
* 设置:产品代码
*/
public void setProductCodeId(String productCodeId) {
this.productCodeId = productCodeId;
}
/**
* 获取:产品代码
*/
public String getProductCodeId() {
return productCodeId;
}
/**
* 设置:计划代码
*/
public void setPlanCodeId(String planCodeId) {
this.planCodeId = planCodeId;
}
/**
* 获取:计划代码
*/
public String getPlanCodeId() {
return planCodeId;
}
/**
* 设置:分销商pid
*/
public void setPartnerPid(String partnerPid) {
this.partnerPid = partnerPid;
}
/**
* 获取:分销商pid
*/
public String getPartnerPid() {
return partnerPid;
}
/**
* 设置:保单号
*/
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
/**
* 获取:保单号
*/
public String getPolicyNo() {
return policyNo;
}
/**
* 设置:保单类型:1、年单 2、月单
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:保单类型:1、年单 2、月单
*/
public Integer getType() {
return type;
}
/**
* 设置:5-人民币,其他币种请参见全局数据字典
*/
public void setCurrency(String currency) {
this.currency = currency;
}
/**
* 获取:5-人民币,其他币种请参见全局数据字典
*/
public String getCurrency() {
return currency;
}
/**
* 设置:总保费
*/
public void setTotalPremium(String totalPremium) {
this.totalPremium = totalPremium;
}
/**
* 获取:总保费
*/
public String getTotalPremium() {
return totalPremium;
}
/**
* 设置:1-正常
*/
public void setStatus(String status) {
this.status = status;
}
/**
* 获取:1-正常
*/
public String getStatus() {
return status;
}
/**
* 设置:电子保单
*/
public void setPolicyFile(String policyFile) {
this.policyFile = policyFile;
}
/**
* 获取:电子保单
*/
public String getPolicyFile() {
return policyFile;
}
/**
* 设置:保单kit的地址
*/
public void setKitUrl(String kitUrl) {
this.kitUrl = kitUrl;
}
/**
* 获取:保单kit的地址
*/
public String getKitUrl() {
return kitUrl;
}
/**
* 设置:投保人id
*/
public void setInsureApplicantId(Integer insureApplicantId) {
this.insureApplicantId = insureApplicantId;
}
/**
* 获取:投保人id
*/
public Integer getInsureApplicantId() {
return insureApplicantId;
}
/**
* 设置:企业id
*/
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
/**
* 获取:企业id
*/
public Integer getOrgCode() {
return orgCode;
}
/**
* 设置:投保时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:投保时间
*/
public Date getCreateTime() {
return createTime;
}
} }
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_product")
@ApiModel("保险产品")
public class InsureProduct extends Model<InsureProduct> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 产品名称
*/
private String name;
/**
* 计划代码
*/
private String planCodeId;
/**
* 产品代码
*/
private String productCodeId;
/**
* 类型:1年单 2月单
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否删除 0否 1是
*/
private Integer isDel;
/**
* 设置:id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:id
*/
public Integer getId() {
return id;
}
/**
* 设置:产品名称
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取:产品名称
*/
public String getName() {
return name;
}
/**
* 设置:计划代码
*/
public void setPlanCodeId(String planCodeId) {
this.planCodeId = planCodeId;
}
/**
* 获取:计划代码
*/
public String getPlanCodeId() {
return planCodeId;
}
/**
* 设置:产品代码
*/
public void setProductCodeId(String productCodeId) {
this.productCodeId = productCodeId;
}
/**
* 获取:产品代码
*/
public String getProductCodeId() {
return productCodeId;
}
/**
* 设置:类型:1年单 2月单
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:类型:1年单 2月单
*/
public Integer getType() {
return type;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:是否删除 0否 1是
*/
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
/**
* 获取:是否删除 0否 1是
*/
public Integer getIsDel() {
return isDel;
}
}
package cn.timer.api.controller.insure; package cn.timer.api.controller.insure;
import cn.timer.api.bean.insure.InsureApplicant; import cn.timer.api.bean.insure.*;
import cn.timer.api.bean.insure.InsureLog;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.bean.qyzx.QyzxEntInfoM; import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
...@@ -134,6 +131,10 @@ public class InsureContorll { ...@@ -134,6 +131,10 @@ public class InsureContorll {
if(insurePolicy!=null){ if(insurePolicy!=null){
return ResultUtil.error("企业已存在"); return ResultUtil.error("企业已存在");
} }
InsureProduct insureProduct = InsureProduct.builder().id(Integer.parseInt(insureDto.getProductId())).build();
if(insureProduct==null){
return ResultUtil.error("产品不存在");
}
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(insureDto.getOrgCode())).build().selectById(); // 企业信息 QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(insureDto.getOrgCode())).build().selectById(); // 企业信息
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
...@@ -164,7 +165,7 @@ public class InsureContorll { ...@@ -164,7 +165,7 @@ public class InsureContorll {
companyApplicantMap.put("applicant_e_no_type", insureApplicant.getApplicantENoType());/*企业证件类型*/ companyApplicantMap.put("applicant_e_no_type", insureApplicant.getApplicantENoType());/*企业证件类型*/
companyApplicantMap.put("applicant_e_no", insureApplicant.getApplicantENo());/*企业证件号码*/ companyApplicantMap.put("applicant_e_no", insureApplicant.getApplicantENo());/*企业证件号码*/
companyApplicantMap.put("applicant_e_mail", insureApplicant.getApplicantEMail());/*企业邮箱*/ companyApplicantMap.put("applicant_e_mail", insureApplicant.getApplicantEMail());/*企业邮箱*/
companyApplicantMap.put("applicant_province_city", "21721");/*省市区*/ companyApplicantMap.put("applicant_province_city", "21024");/*省市区*/
/*人员清单填被保人员*/ /*人员清单填被保人员*/
String url = creaXSSFWorkbook(insureDto.getUserIds(),price); String url = creaXSSFWorkbook(insureDto.getUserIds(),price);
if (!StringUtil.isNotBlank(url)) { if (!StringUtil.isNotBlank(url)) {
...@@ -176,8 +177,8 @@ public class InsureContorll { ...@@ -176,8 +177,8 @@ public class InsureContorll {
Map basicMap = Maps.newHashMap(); Map basicMap = Maps.newHashMap();
basicMap.put("partner_pid", "1231");/*分销商pid*/ basicMap.put("partner_pid", "1231");/*分销商pid*/
basicMap.put("plan_code_id", "61b85207b73d2ab09fb2959");/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/ basicMap.put("plan_code_id", insureProduct.getPlanCodeId());/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
basicMap.put("product_code_id", "61b85207a9f87da19fb5986");/*产品代码,选项值:61b85207a9f87da19fb5986 (生产环境) 61b85207a9f87da19fb5986 (沙箱环境)*/ basicMap.put("product_code_id", insureProduct.getProductCodeId());/*产品代码,选项值:61b85207a9f87da19fb5986 (生产环境) 61b85207a9f87da19fb5986 (沙箱环境)*/
basicMap.put("policy_date_start",insureDto.getPolicyDateStart()); basicMap.put("policy_date_start",insureDto.getPolicyDateStart());
basicMap.put("policy_date_end", insureDto.getPolicyDateEnd()); basicMap.put("policy_date_end", insureDto.getPolicyDateEnd());
basicMap.put("promotion_id", 0); basicMap.put("promotion_id", 0);
...@@ -236,8 +237,9 @@ public class InsureContorll { ...@@ -236,8 +237,9 @@ public class InsureContorll {
insurePolicy.setOrgCode(qyzxEntInfoM.getId()); insurePolicy.setOrgCode(qyzxEntInfoM.getId());
insurePolicy.setCreateTime(date); insurePolicy.setCreateTime(date);
insurePolicy.setUpdateTime(date); insurePolicy.setUpdateTime(date);
insurePolicy.setSchemeName("【新】-安诚-雇主责任险(劳务公司)预付款");/*先写死*/ insurePolicy.setSchemeName(insureProduct.getName());/*先写死*/
insurePolicy.setTotalPremium(String.valueOf(insureDto.getUserIds().length * price)); insurePolicy.setTotalPremium(String.valueOf(insureDto.getUserIds().length * price));
insurePolicy.setProductId(insureProduct.getId());
insurePolicy.insert(); insurePolicy.insert();
for (YgglMainEmp y : ygglMainEmpList) { for (YgglMainEmp y : ygglMainEmpList) {
insureUser = InsureUser.builder().build(); insureUser = InsureUser.builder().build();
......
package cn.timer.api.controller.insure;
import java.util.List;
import java.util.Map;
import cn.timer.api.bean.insure.InsureProduct;
import cn.timer.api.dao.insure.InsureProductMapper;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Api(tags = "8.0保险列表")
@RestController
@Transactional
@RequestMapping(value = "/insureProduct", produces = {"application/json"})
public class InsureProductController{
@Autowired
private InsureProductMapper insureProductMapper;
@GetMapping(value = "/productList")
@ApiOperation(value = "12.产品列表", httpMethod = "Get", notes = "产品列表")
@ApiOperationSupport(order = 2)
public Result<Object> productList() {
List<InsureProduct> productList = InsureProduct.builder().build().selectList(new QueryWrapper<InsureProduct>().lambda().eq(InsureProduct::getIsDel,0));
if (productList.size()>0) {
return ResultUtil.data(productList);
}
return ResultUtil.error("暂无产品");
}
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Repository
public interface InsureProductMapper extends BaseMapper<InsureProduct> {
}
...@@ -31,5 +31,6 @@ public class InsureDto { ...@@ -31,5 +31,6 @@ public class InsureDto {
private String tricycleFrameNumber; private String tricycleFrameNumber;
private Integer type;/*类型 1是新增 3是替换*/ private Integer type;/*类型 1是新增 3是替换*/
private String[] oldIds; private String[] oldIds;
private String productId;
// private String // private String
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.core.db.dao.InsureProductMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureProduct" id="insureProductMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="planCodeId" column="plan_code_id"/>
<result property="productCodeId" column="product_code_id"/>
<result property="type" column="type"/>
<result property="createTime" column="create_time"/>
<result property="isDel" column="is_del"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureProduct">
select *
from insure_product
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureProduct">
select * from insure_product
<where>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="isDel != null and isDel != ''">AND `is_del` = #{isDel}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_product
<where>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="isDel != null and isDel != ''">AND `is_del` = #{isDel}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true" keyProperty="id">
insert into insure_product
(`name`,
`plan_code_id`,
`product_code_id`,
`type`,
`create_time`,
`is_del`)
values (#{name},
#{planCodeId},
#{productCodeId},
#{type},
#{createTime},
#{isDel})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true"
keyProperty="id">
insert into insure_product
(
<if test="name != null">,`name`</if>
<if test="planCodeId != null">,`plan_code_id`</if>
<if test="productCodeId != null">,`product_code_id`</if>
<if test="type != null">,`type`</if>
<if test="createTime != null">,`create_time`</if>
<if test="isDel != null">,`is_del`</if>
)
values
(
<if test="name != null">,#{name}</if>
<if test="planCodeId != null">,#{planCodeId}</if>
<if test="productCodeId != null">,#{productCodeId}</if>
<if test="type != null">,#{type}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="isDel != null">,#{isDel}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true"
keyProperty="id">
insert into insure_product
(
`name`,
`plan_code_id`,
`product_code_id`,
`type`,
`create_time`,
`is_del`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.name},
#{item.planCodeId},
#{item.productCodeId},
#{item.type},
#{item.createTime},
#{item.isDel}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsureProduct">
update insure_product
<set>
<if test="name != null">`name` = #{name},</if>
<if test="planCodeId != null">`plan_code_id` = #{planCodeId},</if>
<if test="productCodeId != null">`product_code_id` = #{productCodeId},</if>
<if test="type != null">`type` = #{type},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="isDel != null">`is_del` = #{isDel}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_product
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_product where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</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