Browse Source

投保单表结构修改,增加企业信息相关字段,企业信息可能在不同年份发送变化,因此每个投保单保存一份企业信息。

tomatozq 5 năm trước cách đây
mục cha
commit
0282fd49e4

+ 346 - 255
picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsuranceApplication.java

@@ -1,280 +1,371 @@
 package com.jpsoft.picc.modules.business.entity;
 
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.math.BigDecimal;
-import java.util.Date;
+import io.swagger.annotations.ApiModel;
 
 /**
- * 描述:business_insurance_application的实体类
+  描述:business_insurance_application的实体类
  */
 @ApiModel(value = "business_insurance_application的实体类")
 public class InsuranceApplication {
-    private String id;
-    private String companyId;
-    private String definitionId;
-    private String insuredName;
-    private String insuredTel;
-    private Date startTime;
-    private Date endTime;
-    private Integer number;
-    private BigDecimal insuranceFee;
-    private String status;
-    private String processStatus;
-    private String createBy;
-    private Date createTime;
-    private String updateBy;
-    private Date updateTime;
-    private Boolean delFlag;
-
-    /**
-     * 获取ID
-     */
     @ApiModelProperty(value = "ID")
-    public String getId() {
-        return id;
-    }
-
-    /**
-     * 设置ID
-     */
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    /**
-     * 获取企业ID
-     */
+	private String id;
     @ApiModelProperty(value = "企业ID")
-    public String getCompanyId() {
-        return companyId;
-    }
-
-    /**
-     * 设置企业ID
-     */
-    public void setCompanyId(String companyId) {
-        this.companyId = companyId;
-    }
-
-    /**
-     * 获取保险种类
-     */
+	private String companyId;
     @ApiModelProperty(value = "保险种类")
-    public String getDefinitionId() {
-        return definitionId;
-    }
-
-    /**
-     * 设置保险种类
-     */
-    public void setDefinitionId(String definitionId) {
-        this.definitionId = definitionId;
-    }
-
-    /**
-     * 获取投保人姓名
-     */
+	private String definitionId;
     @ApiModelProperty(value = "投保人姓名")
-    public String getInsuredName() {
-        return insuredName;
-    }
-
-    /**
-     * 设置投保人姓名
-     */
-    public void setInsuredName(String insuredName) {
-        this.insuredName = insuredName;
-    }
-
-    /**
-     * 获取联系电话
-     */
+	private String insuredName;
     @ApiModelProperty(value = "联系电话")
-    public String getInsuredTel() {
-        return insuredTel;
-    }
-
-    /**
-     * 设置联系电话
-     */
-    public void setInsuredTel(String insuredTel) {
-        this.insuredTel = insuredTel;
-    }
-
-    /**
-     * 获取保障开始时间
-     */
+	private String insuredTel;
+    @ApiModelProperty(value = "企业名称")
+	private String companyName;
+    @ApiModelProperty(value = "组织机构代码证")
+	private String usccCode;
+    @ApiModelProperty(value = "营业范围")
+	private String businessScope;
+    @ApiModelProperty(value = "行业类型")
+	private String industryType;
+    @ApiModelProperty(value = "雇员人数")
+	private Integer employeesNumber;
+    @ApiModelProperty(value = "已投保人数")
+	private Integer insuredNumber;
+    @ApiModelProperty(value = "公司地址")
+	private String companyAddress;
+    @ApiModelProperty(value = "近三年损失情况")
+	private String lossInRecentYears;
     @ApiModelProperty(value = "保障开始时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    /**
-     * 设置保障开始时间
-     */
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    /**
-     * 获取保障结束时间
-     */
+	private Date startTime;
     @ApiModelProperty(value = "保障结束时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    /**
-     * 设置保障结束时间
-     */
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    /**
-     * 获取保障数量
-     */
-    @ApiModelProperty(value = "保障数量")
-    public Integer getNumber() {
-        return number;
-    }
-
-    /**
-     * 设置保障数量
-     */
-    public void setNumber(Integer number) {
-        this.number = number;
-    }
-
-    /**
-     * 获取保险费合计(总金额)
-     */
+	private Date endTime;
     @ApiModelProperty(value = "保险费合计(总金额)")
-    public BigDecimal getInsuranceFee() {
-        return insuranceFee;
-    }
-
-    /**
-     * 设置保险费合计(总金额)
-     */
-    public void setInsuranceFee(BigDecimal insuranceFee) {
-        this.insuranceFee = insuranceFee;
-    }
-
-    /**
-     * 获取状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
-     */
+	private BigDecimal insuranceFee;
     @ApiModelProperty(value = "状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100")
-    public String getStatus() {
-        return status;
-    }
-
-    /**
-     * 设置状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
-     */
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    /**
-     * 获取流程审核状态:正常/回退等
-     */
+	private String status;
     @ApiModelProperty(value = "流程审核状态:正常/回退等")
-    public String getProcessStatus() {
-        return processStatus;
-    }
-
-    /**
-     * 设置流程审核状态:正常/回退等
-     */
-    public void setProcessStatus(String processStatus) {
-        this.processStatus = processStatus;
-    }
-
-    /**
-     * 获取创建人
-     */
+	private String processStatus;
     @ApiModelProperty(value = "创建人")
-    public String getCreateBy() {
-        return createBy;
-    }
-
-    /**
-     * 设置创建人
-     */
-    public void setCreateBy(String createBy) {
-        this.createBy = createBy;
-    }
-
-    /**
-     * 获取创建时间
-     */
+	private String createBy;
     @ApiModelProperty(value = "创建时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * 设置创建时间
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    /**
-     * 获取更新人
-     */
+	private Date createTime;
     @ApiModelProperty(value = "更新人")
-    public String getUpdateBy() {
-        return updateBy;
-    }
-
-    /**
-     * 设置更新人
-     */
-    public void setUpdateBy(String updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    /**
-     * 获取更新时间
-     */
+	private String updateBy;
     @ApiModelProperty(value = "更新时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    /**
-     * 设置更新时间
-     */
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    /**
-     * 获取是否删除
-     */
+	private Date updateTime;
     @ApiModelProperty(value = "是否删除")
-    public Boolean getDelFlag() {
-        return delFlag;
-    }
-
-    /**
-     * 设置是否删除
-     */
-    public void setDelFlag(Boolean delFlag) {
-        this.delFlag = delFlag;
-    }
+	private Boolean delFlag;
+
+	/**
+	 *获取ID
+	 */
+    	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+	/**
+	 *获取企业ID
+	 */
+    	public String getCompanyId(){
+		return companyId;
+	}
+	
+	/**
+	 *设置企业ID
+	 */
+	public void setCompanyId(String companyId){
+		this.companyId = companyId;
+	}
+	/**
+	 *获取保险种类
+	 */
+    	public String getDefinitionId(){
+		return definitionId;
+	}
+	
+	/**
+	 *设置保险种类
+	 */
+	public void setDefinitionId(String definitionId){
+		this.definitionId = definitionId;
+	}
+	/**
+	 *获取投保人姓名
+	 */
+    	public String getInsuredName(){
+		return insuredName;
+	}
+	
+	/**
+	 *设置投保人姓名
+	 */
+	public void setInsuredName(String insuredName){
+		this.insuredName = insuredName;
+	}
+	/**
+	 *获取联系电话
+	 */
+    	public String getInsuredTel(){
+		return insuredTel;
+	}
+	
+	/**
+	 *设置联系电话
+	 */
+	public void setInsuredTel(String insuredTel){
+		this.insuredTel = insuredTel;
+	}
+	/**
+	 *获取企业名称
+	 */
+    	public String getCompanyName(){
+		return companyName;
+	}
+	
+	/**
+	 *设置企业名称
+	 */
+	public void setCompanyName(String companyName){
+		this.companyName = companyName;
+	}
+	/**
+	 *获取组织机构代码证
+	 */
+    	public String getUsccCode(){
+		return usccCode;
+	}
+	
+	/**
+	 *设置组织机构代码证
+	 */
+	public void setUsccCode(String usccCode){
+		this.usccCode = usccCode;
+	}
+	/**
+	 *获取营业范围
+	 */
+    	public String getBusinessScope(){
+		return businessScope;
+	}
+	
+	/**
+	 *设置营业范围
+	 */
+	public void setBusinessScope(String businessScope){
+		this.businessScope = businessScope;
+	}
+	/**
+	 *获取行业类型
+	 */
+    	public String getIndustryType(){
+		return industryType;
+	}
+	
+	/**
+	 *设置行业类型
+	 */
+	public void setIndustryType(String industryType){
+		this.industryType = industryType;
+	}
+	/**
+	 *获取雇员人数
+	 */
+    	public Integer getEmployeesNumber(){
+		return employeesNumber;
+	}
+	
+	/**
+	 *设置雇员人数
+	 */
+	public void setEmployeesNumber(Integer employeesNumber){
+		this.employeesNumber = employeesNumber;
+	}
+	/**
+	 *获取已投保人数
+	 */
+    	public Integer getInsuredNumber(){
+		return insuredNumber;
+	}
+	
+	/**
+	 *设置已投保人数
+	 */
+	public void setInsuredNumber(Integer insuredNumber){
+		this.insuredNumber = insuredNumber;
+	}
+	/**
+	 *获取公司地址
+	 */
+    	public String getCompanyAddress(){
+		return companyAddress;
+	}
+	
+	/**
+	 *设置公司地址
+	 */
+	public void setCompanyAddress(String companyAddress){
+		this.companyAddress = companyAddress;
+	}
+	/**
+	 *获取近三年损失情况
+	 */
+    	public String getLossInRecentYears(){
+		return lossInRecentYears;
+	}
+	
+	/**
+	 *设置近三年损失情况
+	 */
+	public void setLossInRecentYears(String lossInRecentYears){
+		this.lossInRecentYears = lossInRecentYears;
+	}
+	/**
+	 *获取保障开始时间
+	 */
+    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		public Date getStartTime(){
+		return startTime;
+	}
+	
+	/**
+	 *设置保障开始时间
+	 */
+	public void setStartTime(Date startTime){
+		this.startTime = startTime;
+	}
+	/**
+	 *获取保障结束时间
+	 */
+    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		public Date getEndTime(){
+		return endTime;
+	}
+	
+	/**
+	 *设置保障结束时间
+	 */
+	public void setEndTime(Date endTime){
+		this.endTime = endTime;
+	}
+	/**
+	 *获取保险费合计(总金额)
+	 */
+    	public BigDecimal getInsuranceFee(){
+		return insuranceFee;
+	}
+	
+	/**
+	 *设置保险费合计(总金额)
+	 */
+	public void setInsuranceFee(BigDecimal insuranceFee){
+		this.insuranceFee = insuranceFee;
+	}
+	/**
+	 *获取状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
+	 */
+    	public String getStatus(){
+		return status;
+	}
+	
+	/**
+	 *设置状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
+	 */
+	public void setStatus(String status){
+		this.status = status;
+	}
+	/**
+	 *获取流程审核状态:正常/回退等
+	 */
+    	public String getProcessStatus(){
+		return processStatus;
+	}
+	
+	/**
+	 *设置流程审核状态:正常/回退等
+	 */
+	public void setProcessStatus(String processStatus){
+		this.processStatus = processStatus;
+	}
+	/**
+	 *获取创建人
+	 */
+    	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+	/**
+	 *获取创建时间
+	 */
+    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+	/**
+	 *获取更新人
+	 */
+    	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+	/**
+	 *获取更新时间
+	 */
+    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+	/**
+	 *获取是否删除
+	 */
+    	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
 }

+ 59 - 28
picc-common/src/main/resources/mapper/business/InsuranceApplication.xml

@@ -9,9 +9,16 @@
 			<result property="definitionId" column="definition_id" />
 			<result property="insuredName" column="insured_name" />
 			<result property="insuredTel" column="insured_tel" />
+			<result property="companyName" column="company_name" />
+			<result property="usccCode" column="uscc_code" />
+			<result property="businessScope" column="business_scope" />
+			<result property="industryType" column="industry_type" />
+			<result property="employeesNumber" column="employees_number" />
+			<result property="insuredNumber" column="insured_number" />
+			<result property="companyAddress" column="company_address" />
+			<result property="lossInRecentYears" column="loss_in_recent_years" />
 			<result property="startTime" column="start_time" />
 			<result property="endTime" column="end_time" />
-			<result property="number" column="number_" />
 			<result property="insuranceFee" column="insurance_fee" />
 			<result property="status" column="status_" />
 			<result property="processStatus" column="process_status" />
@@ -29,25 +36,32 @@
 	-->
 	<![CDATA[
 		insert into business_insurance_application
-	    (id_,company_id,definition_id,insured_name,insured_tel,start_time,end_time,number_,insurance_fee,status_,process_status,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,business_scope,industry_type,employees_number,insured_number,company_address,loss_in_recent_years,start_time,end_time,insurance_fee,status_,process_status,create_by,create_time,update_by,update_time,del_flag)
 		values
 		(
-#{id,jdbcType=VARCHAR}
-,#{companyId,jdbcType=VARCHAR}
-,#{definitionId,jdbcType=VARCHAR}
-,#{insuredName,jdbcType=VARCHAR}
-,#{insuredTel,jdbcType=VARCHAR}
-,#{startTime,jdbcType= TIMESTAMP }
-,#{endTime,jdbcType= TIMESTAMP }
-,#{number,jdbcType= NUMERIC }
-,#{insuranceFee,jdbcType= NUMERIC }
-,#{status,jdbcType=VARCHAR}
-,#{processStatus,jdbcType=VARCHAR}
-,#{createBy,jdbcType=VARCHAR}
-,#{createTime,jdbcType= TIMESTAMP }
-,#{updateBy,jdbcType=VARCHAR}
-,#{updateTime,jdbcType= TIMESTAMP }
-,#{delFlag,jdbcType= NUMERIC }
+			#{id,jdbcType=VARCHAR}
+			,#{companyId,jdbcType=VARCHAR}
+			,#{definitionId,jdbcType=VARCHAR}
+			,#{insuredName,jdbcType=VARCHAR}
+			,#{insuredTel,jdbcType=VARCHAR}
+			,#{companyName,jdbcType=VARCHAR}
+			,#{usccCode,jdbcType=VARCHAR}
+			,#{businessScope,jdbcType=VARCHAR}
+			,#{industryType,jdbcType=VARCHAR}
+			,#{employeesNumber,jdbcType= NUMERIC }
+			,#{insuredNumber,jdbcType= NUMERIC }
+			,#{companyAddress,jdbcType=VARCHAR}
+			,#{lossInRecentYears,jdbcType=VARCHAR}
+			,#{startTime,jdbcType= TIMESTAMP }
+			,#{endTime,jdbcType= TIMESTAMP }
+			,#{insuranceFee,jdbcType= NUMERIC }
+			,#{status,jdbcType=VARCHAR}
+			,#{processStatus,jdbcType=VARCHAR}
+			,#{createBy,jdbcType=VARCHAR}
+			,#{createTime,jdbcType= TIMESTAMP }
+			,#{updateBy,jdbcType=VARCHAR}
+			,#{updateTime,jdbcType= TIMESTAMP }
+			,#{delFlag,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -68,15 +82,36 @@
 		</if>
 				<if test="insuredTel!=null">
 		insured_tel=#{insuredTel,jdbcType=VARCHAR},
+		</if>
+				<if test="companyName!=null">
+		company_name=#{companyName,jdbcType=VARCHAR},
+		</if>
+				<if test="usccCode!=null">
+		uscc_code=#{usccCode,jdbcType=VARCHAR},
+		</if>
+				<if test="businessScope!=null">
+		business_scope=#{businessScope,jdbcType=VARCHAR},
+		</if>
+				<if test="industryType!=null">
+		industry_type=#{industryType,jdbcType=VARCHAR},
+		</if>
+				<if test="employeesNumber!=null">
+		employees_number=#{employeesNumber,jdbcType= NUMERIC },
+		</if>
+				<if test="insuredNumber!=null">
+		insured_number=#{insuredNumber,jdbcType= NUMERIC },
+		</if>
+				<if test="companyAddress!=null">
+		company_address=#{companyAddress,jdbcType=VARCHAR},
+		</if>
+				<if test="lossInRecentYears!=null">
+		loss_in_recent_years=#{lossInRecentYears,jdbcType=VARCHAR},
 		</if>
 				<if test="startTime!=null">
 		start_time=#{startTime,jdbcType= TIMESTAMP },
 		</if>
 				<if test="endTime!=null">
 		end_time=#{endTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="number!=null">
-		number_=#{number,jdbcType= NUMERIC },
 		</if>
 				<if test="insuranceFee!=null">
 		insurance_fee=#{insuranceFee,jdbcType= NUMERIC },
@@ -107,26 +142,22 @@
 	</update>
 	<select id="get" parameterType="string" resultMap="InsuranceApplicationMap">
 		select 
-id_,company_id,definition_id,insured_name,insured_tel,start_time,end_time,number_,insurance_fee,status_,process_status,create_by,create_time,update_by,update_time,del_flag		from business_insurance_application where id_=#{0}
+id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,business_scope,industry_type,employees_number,insured_number,company_address,loss_in_recent_years,start_time,end_time,insurance_fee,status_,process_status,create_by,create_time,update_by,update_time,del_flag		from business_insurance_application where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from business_insurance_application where id_=#{0} and del_flag = false
+		select count(*) from business_insurance_application where id_=#{0}
 	</select>
 	<select id="list" resultMap="InsuranceApplicationMap">
-		select * from business_insurance_application where del_flag = false
+		select * from business_insurance_application
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsuranceApplicationMap">
 		<![CDATA[
 			select * from business_insurance_application
 		]]>
 		<where>
-			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>
-			<if test="searchParams.companyId != null">
-				and company_id like #{searchParams.companyId}
-			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 30 - 0
picc-enterprise-server/src/test/java/com/jpsoft/picc/test/InsuranceApplicationTest.java

@@ -0,0 +1,30 @@
+package com.jpsoft.picc.test;
+
+import com.jpsoft.picc.modules.business.entity.InsuranceApplication;
+import com.jpsoft.picc.modules.business.service.InsuranceApplicationService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Date;
+import java.util.UUID;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class InsuranceApplicationTest {
+    @Autowired
+    private InsuranceApplicationService insuranceApplicationService;
+
+    @Test
+    public void testInsert(){
+        InsuranceApplication model = new InsuranceApplication();
+
+        model.setId(UUID.randomUUID().toString());
+        model.setCreateBy("2142006");
+        model.setCreateTime(new Date());
+
+        insuranceApplicationService.insert(model);
+    }
+}