浏览代码

Merge branch 'master' of http://223.75.76.159:9090/zq/picc

# Conflicts:
#	picc-common/src/main/resources/mapper/business/InsuranceApplication.xml
jz.kai 5 年之前
父节点
当前提交
1707882e5b

+ 30 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsuranceApplication.java

@@ -32,6 +32,10 @@ public class InsuranceApplication {
 	private String businessScope;
     @ApiModelProperty(value = "行业类型")
 	private String industryType;
+    @ApiModelProperty(value = "联系电话")
+	private String tel;
+    @ApiModelProperty(value = "邮编")
+	private String postal;
     @ApiModelProperty(value = "雇员人数")
 	private Integer employeesNumber;
     @ApiModelProperty(value = "已投保人数")
@@ -178,6 +182,32 @@ public class InsuranceApplication {
 	public void setIndustryType(String industryType){
 		this.industryType = industryType;
 	}
+	/**
+	 *获取联系电话
+	 */
+    	public String getTel(){
+		return tel;
+	}
+	
+	/**
+	 *设置联系电话
+	 */
+	public void setTel(String tel){
+		this.tel = tel;
+	}
+	/**
+	 *获取邮编
+	 */
+    	public String getPostal(){
+		return postal;
+	}
+	
+	/**
+	 *设置邮编
+	 */
+	public void setPostal(String postal){
+		this.postal = postal;
+	}
 	/**
 	 *获取雇员人数
 	 */

+ 164 - 65
picc-common/src/main/resources/mapper/business/InsuranceApplication.xml

@@ -1,69 +1,168 @@
 <?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">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.picc.modules.business.dao.InsuranceApplicationDAO">
-	<resultMap id="InsuranceApplicationMap" type="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
-		<id property="id" column="id_" />
-			<result property="companyId" column="company_id" />
-			<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="insuranceFee" column="insurance_fee" />
-			<result property="status" column="status_" />
-			<result property="processStatus" column="process_status" />
-			<result property="createBy" column="create_by" />
-			<result property="createTime" column="create_time" />
-			<result property="updateBy" column="update_by" />
-			<result property="updateTime" column="update_time" />
-			<result property="delFlag" column="del_flag" />
-			</resultMap>
-	<insert id="insert" parameterType="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+    <resultMap id="InsuranceApplicationMap" type="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
+        <id property="id" column="id_"/>
+        <result property="companyId" column="company_id"/>
+        <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="tel" column="tel_"/>
+        <result property="postal" column="postal_"/>
+        <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="insuranceFee" column="insurance_fee"/>
+        <result property="status" column="status_"/>
+        <result property="processStatus" column="process_status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
 		insert into business_insurance_application
-	    (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)
+	    (id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,business_scope,industry_type,tel_,postal_,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}
-			,#{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 }
+#{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}
+,#{tel,jdbcType=VARCHAR}
+,#{postal,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>
+    <delete id="delete" parameterType="string">
+        delete from business_insurance_application where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
+        update business_insurance_application
+        <set>
+            <if test="companyId!=null">
+                company_id=#{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="definitionId!=null">
+                definition_id=#{definitionId,jdbcType=VARCHAR},
+            </if>
+            <if test="insuredName!=null">
+                insured_name=#{insuredName,jdbcType=VARCHAR},
+            </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="tel!=null">
+                tel_=#{tel,jdbcType=VARCHAR},
+            </if>
+            <if test="postal!=null">
+                postal_=#{postal,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="insuranceFee!=null">
+                insurance_fee=#{insuranceFee,jdbcType= NUMERIC },
+            </if>
+            <if test="status!=null">
+                status_=#{status,jdbcType=VARCHAR},
+            </if>
+            <if test="processStatus!=null">
+                process_status=#{processStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="InsuranceApplicationMap">
+        select
+        id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,business_scope,industry_type,tel_,postal_,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}
+    </select>
+    <select id="list" resultMap="InsuranceApplicationMap">
+        select * from business_insurance_application
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="InsuranceApplicationMap">
+        <![CDATA[
 	</insert>
 	<delete id="delete" parameterType="string">
 		delete from business_insurance_application where id_=#{id,jdbcType=VARCHAR}
@@ -141,7 +240,7 @@
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="InsuranceApplicationMap">
-		select 
+		select
 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">
@@ -154,7 +253,7 @@ id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,bus
 		<![CDATA[
 			select * from business_insurance_application
 		]]>
-		<where>
+        <where>
             <if test="searchParams.id != null">
                 and ID_ like #{searchParams.id}
             </if>
@@ -164,9 +263,9 @@ id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,bus
             <if test="searchParams.status != null">
                 and status_ like #{searchParams.status}
             </if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
 </mapper>

+ 20 - 1
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsuranceApplicationController.java

@@ -109,10 +109,29 @@ public class InsuranceApplicationController {
                 insuranceApplication = insuranceApplicationService.get(id);
             } else {
                 insuranceApplication = new InsuranceApplication();
+//                insuranceApplication.setCompanyId();
+//                insuranceApplication.setDefinitionId();
+
+//                insuranceApplication.setStartTime();
+//                insuranceApplication.setEndTime();
+//
+//                insuranceApplication.setInsuredName();
+//                insuranceApplication.setInsuredTel();
+//                insuranceApplication.setCompanyName();
+//                //business_nature
+//                insuranceApplication.setUsccCode();
+//                insuranceApplication.setBusinessScope();
+//                insuranceApplication.setIndustryType();
+//                insuranceApplication.setEmployeesNumber();
+//                insuranceApplication.setInsuredNumber();
+//                //tel_
+//                //mail_
+//                insuranceApplication.setCompanyAddress();
+//                insuranceApplication.setLossInRecentYears();
             }
 
             objectMap.put("insuranceApplication",insuranceApplication);
-            objectMap.put("company",company);
+            objectMap.put("business_nature",company);
 
             msgResult.setData(objectMap);
         }

+ 14 - 7
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsurancePolicyUserController.java

@@ -2,8 +2,10 @@ package com.jpsoft.picc.modules.auth.controller;
 
 import cn.hutool.core.convert.Convert;
 import com.github.pagehelper.Page;
+import com.jpsoft.picc.modules.base.entity.Company;
 import com.jpsoft.picc.modules.base.entity.CompanyMember;
 import com.jpsoft.picc.modules.base.service.CompanyMemberService;
+import com.jpsoft.picc.modules.base.service.CompanyService;
 import com.jpsoft.picc.modules.business.entity.InsurancePolicyMember;
 import com.jpsoft.picc.modules.business.service.InsurancePolicyMemberService;
 import com.jpsoft.picc.modules.common.dto.MessageResult;
@@ -34,6 +36,9 @@ public class InsurancePolicyUserController {
     @Autowired
     private CompanyMemberService companyMemberService;
 
+    @Autowired
+    private CompanyService companyService;
+
     @Autowired
     private InsurancePolicyMemberService insurancePolicyMemberService;
 
@@ -69,12 +74,13 @@ public class InsurancePolicyUserController {
     @PostMapping("add")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "policyId",value = "每月投保单ID", required = true, paramType = "form",dataType = "String"),
-            @ApiImplicitParam(name = "memberId",value = "企业用户ID", required = true, paramType = "form",dataType = "String")
+//            @ApiImplicitParam(name = "memberId",value = "企业用户ID", required = true, paramType = "form",dataType = "String")
     })
     public MessageResult<InsurancePolicyMember> add(@RequestParam(value="policyId",defaultValue="") String policyId,
-                                                    @RequestParam(value="memberId",defaultValue="") String memberId,
+//                                                    @RequestParam(value="memberId",defaultValue="") String memberId,
                                                     HttpServletRequest request){
         AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
+        Company company = companyService.findByCreateBy(principal.getName());
 
         MessageResult<InsurancePolicyMember> msgResult = new MessageResult<>();
         InsurancePolicyMember insurancePolicyMember = new InsurancePolicyMember();
@@ -82,7 +88,7 @@ public class InsurancePolicyUserController {
         try {
             insurancePolicyMember.setId(UUID.randomUUID().toString());
             if(StringUtils.isNotEmpty(policyId)) insurancePolicyMember.setPolicyId(policyId);
-            if(StringUtils.isNotEmpty(memberId)) insurancePolicyMember.setMemberId(memberId);
+            if(StringUtils.isNotEmpty(company.getId())) insurancePolicyMember.setMemberId(company.getId());
             insurancePolicyMember.setStatus("0");
             insurancePolicyMember.setDelFlag(false);
             insurancePolicyMember.setCreateBy(principal.getName());
@@ -148,15 +154,16 @@ public class InsurancePolicyUserController {
     @ApiOperation(value="批量导入参保人员")
     @PostMapping("batchImport")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String"),
+//            @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "policyId",value = "每月投保单ID", required = true, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "uploadFile",value = "上传文件", required = true,paramType="form", dataType = "__file")
     })
-    public MessageResult<String> batchImport(@RequestParam(value="companyId",defaultValue="") String companyId,
+    public MessageResult<String> batchImport(//@RequestParam(value="companyId",defaultValue="") String companyId,
                                              @RequestParam(value="policyId",defaultValue="") String policyId,
                                             MultipartFile uploadFile,
                                             HttpServletRequest request){
         AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
+        Company company = companyService.findByCreateBy(principal.getName());
 
         MessageResult<String> msgResult = new MessageResult<>();
         CompanyMember companyMember = new CompanyMember();
@@ -176,7 +183,7 @@ public class InsurancePolicyUserController {
                 String healthStatus = array[3].toString();
 
                 Map<String,Object> searchParams = new HashMap<>();
-                searchParams.put("companyId",companyId);
+                searchParams.put("companyId",company.getId());
                 searchParams.put("name",name);
                 searchParams.put("cardNo",cardNo);
                 List<Sort> sortList = new ArrayList<>();
@@ -186,7 +193,7 @@ public class InsurancePolicyUserController {
                     companyMember = page.get(0);
                 }else{
                     companyMember.setId(UUID.randomUUID().toString());
-                    if(StringUtils.isNotEmpty(companyId)) companyMember.setCompanyId(companyId);
+                    if(StringUtils.isNotEmpty(company.getId())) companyMember.setCompanyId(company.getId());
                     if (StringUtils.isNotEmpty(name)) companyMember.setName(name);
                     if (StringUtils.isNotEmpty(cardType)) companyMember.setCardType(cardType);
                     if (StringUtils.isNotEmpty(cardNo)) companyMember.setCardNo(cardNo);