Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	document/后端接口.xlsx
#	picc-common/src/main/resources/mapper/business/InsurancePolicy.xml
jz.kai 5 лет назад
Родитель
Сommit
2924680983
24 измененных файлов с 309 добавлено и 118 удалено
  1. 16 1
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceAgentController.java
  2. 16 1
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceDefinitionController.java
  3. 2 1
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceDefinitionLimitController.java
  4. 16 1
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/JobsController.java
  5. 1 1
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsuranceApplicationController.java
  6. 107 3
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsurancePolicyController.java
  7. 2 2
      picc-admin-server/src/main/resources/mapper/sys/DataDictionary.xml
  8. 4 4
      picc-admin-server/src/main/resources/mapper/sys/Role.xml
  9. 1 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/dao/CompanyDAO.java
  10. 1 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/service/CompanyService.java
  11. 5 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/service/impl/CompanyServiceImpl.java
  12. 3 0
      picc-common/src/main/resources/mapper/base/Company.xml
  13. 3 3
      picc-common/src/main/resources/mapper/base/CompanyMember.xml
  14. 6 5
      picc-common/src/main/resources/mapper/base/InsuranceAgent.xml
  15. 5 4
      picc-common/src/main/resources/mapper/base/InsuranceDefinition.xml
  16. 5 4
      picc-common/src/main/resources/mapper/base/InsuranceDefinitionLimit.xml
  17. 4 3
      picc-common/src/main/resources/mapper/base/InsuranceJobs.xml
  18. 6 5
      picc-common/src/main/resources/mapper/base/Jobs.xml
  19. 3 2
      picc-common/src/main/resources/mapper/business/InsuranceApplication.xml
  20. 3 3
      picc-common/src/main/resources/mapper/business/InsurancePolicy.xml
  21. 94 0
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/CompanyController.java
  22. 5 73
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/CompanyUserController.java
  23. 1 0
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/UserController.java
  24. 0 2
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/dto/CompanyInfoDTO.java

+ 16 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceAgentController.java

@@ -207,7 +207,7 @@ public class InsuranceAgentController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
@@ -220,4 +220,19 @@ public class InsuranceAgentController {
 
         return msgResult;
     }
+
+
+    @ApiOperation(value="所有代理人列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<List<InsuranceAgent>> list(){
+
+        MessageResult<List<InsuranceAgent>> msgResult = new MessageResult<>();
+
+        List<InsuranceAgent> list = insuranceAgentService.list();
+
+        msgResult.setResult(true);
+        msgResult.setData(list);
+
+        return msgResult;
+    }
 }

+ 16 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceDefinitionController.java

@@ -207,7 +207,7 @@ public class InsuranceDefinitionController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
@@ -220,4 +220,19 @@ public class InsuranceDefinitionController {
 
         return msgResult;
     }
+
+
+    @ApiOperation(value="所有险种列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<List<InsuranceDefinition>> list(){
+
+        MessageResult<List<InsuranceDefinition>> msgResult = new MessageResult<>();
+
+        List<InsuranceDefinition> list = insuranceDefinitionService.list();
+
+        msgResult.setResult(true);
+        msgResult.setData(list);
+
+        return msgResult;
+    }
 }

+ 2 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceDefinitionLimitController.java

@@ -1,6 +1,7 @@
 package com.jpsoft.picc.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.picc.modules.base.entity.InsuranceDefinition;
 import com.jpsoft.picc.modules.base.entity.InsuranceDefinitionLimit;
 import com.jpsoft.picc.modules.common.utils.PojoUtils;
 import com.jpsoft.picc.modules.common.dto.Sort;
@@ -207,7 +208,7 @@ public class InsuranceDefinitionLimitController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");

+ 16 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/JobsController.java

@@ -207,7 +207,7 @@ public class JobsController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
@@ -220,4 +220,19 @@ public class JobsController {
 
         return msgResult;
     }
+
+
+    @ApiOperation(value="所有行业类型列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<List<Jobs>> list(){
+
+        MessageResult<List<Jobs>> msgResult = new MessageResult<>();
+
+        List<Jobs> list = jobsService.list();
+
+        msgResult.setResult(true);
+        msgResult.setData(list);
+
+        return msgResult;
+    }
 }

+ 1 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsuranceApplicationController.java

@@ -261,7 +261,7 @@ public class InsuranceApplicationController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");

+ 107 - 3
picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsurancePolicyController.java

@@ -3,11 +3,13 @@ package com.jpsoft.picc.modules.business.controller;
 import com.github.pagehelper.Page;
 import com.jpsoft.picc.modules.base.entity.InsuranceAgent;
 import com.jpsoft.picc.modules.base.service.InsuranceAgentService;
+import com.jpsoft.picc.modules.business.service.InsurancePolicyRecordService;
 import com.jpsoft.picc.modules.common.utils.PojoUtils;
 import com.jpsoft.picc.modules.common.dto.Sort;
 import com.jpsoft.picc.modules.common.dto.MessageResult;
 import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
 import com.jpsoft.picc.modules.business.service.InsurancePolicyService;
+import com.jpsoft.picc.modules.business.entity.InsurancePolicyRecord;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -34,6 +36,9 @@ public class InsurancePolicyController {
     @Autowired
     private InsuranceAgentService insuranceAgentService;
 
+    @Autowired
+    private InsurancePolicyRecordService insurancePolicyRecordService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<InsurancePolicy> create(){
@@ -216,7 +221,7 @@ public class InsurancePolicyController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
@@ -265,11 +270,11 @@ public class InsurancePolicyController {
 
 
     @ApiOperation(value="读取推广信息")
-    @RequestMapping(value = "LoadInsuranceAgent",method = RequestMethod.POST)
+    @RequestMapping(value = "loadInsuranceAgent",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query")
     })
-    public MessageResult<InsuranceAgent> LoadInsuranceAgent(String id, @RequestAttribute String subject){
+    public MessageResult<InsuranceAgent> loadInsuranceAgent(String id, @RequestAttribute String subject){
 
         //当前用户ID
         System.out.println(subject);
@@ -287,4 +292,103 @@ public class InsurancePolicyController {
 
         return msgResult;
     }
+
+
+    @ApiOperation(value="人才超市初审")
+    @RequestMapping(value = "firstApproval",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
+            @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
+            @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
+    })
+    public MessageResult<Integer> firstApproval(String id,String processStatus,String opinion, @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        int affectCount1 = approval(id,processStatus,opinion,"50",subject);
+
+        msgResult.setResult(true);
+        msgResult.setData(affectCount1);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="PICC复审")
+    @RequestMapping(value = "secondApproval",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
+            @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
+            @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
+    })
+    public MessageResult<Integer> secondApproval(String id,String processStatus,String opinion, @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        int affectCount1 = approval(id,processStatus,opinion,"60",subject);
+
+        msgResult.setResult(true);
+        msgResult.setData(affectCount1);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="PICC出单")
+    @RequestMapping(value = "issued",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
+            @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
+            @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
+    })
+    public MessageResult<Integer> issued(String id,String processStatus,String opinion, @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        int affectCount1 = approval(id,processStatus,opinion,"70",subject);
+
+        msgResult.setResult(true);
+        msgResult.setData(affectCount1);
+
+        return msgResult;
+    }
+
+
+    private Integer approval(String id,String processStatus,String opinion,String status,String subject){
+
+        InsurancePolicy insurancePolicy = insurancePolicyService.get(id);
+
+        insurancePolicy.setProcessStatus(processStatus);
+        insurancePolicy.setStatus(status);
+
+        int affectCount = insurancePolicyService.update(insurancePolicy);
+
+        int affectCount1 = 0;
+
+        if(affectCount > 0){
+            InsurancePolicyRecord insurancePolicyRecord = new InsurancePolicyRecord();
+            insurancePolicyRecord.setPolicyId(insurancePolicy.getId());
+            insurancePolicyRecord.setOpinion(opinion);
+            insurancePolicyRecord.setProcessStatus(processStatus);
+            insurancePolicyRecord.setId(UUID.randomUUID().toString());
+            insurancePolicyRecord.setDelFlag(false);
+            insurancePolicyRecord.setCreateBy(subject);
+            insurancePolicyRecord.setCreateTime(new Date());
+
+            affectCount1 = insurancePolicyRecordService.insert(insurancePolicyRecord);
+        }
+        return affectCount1;
+    }
+
+
+
 }

+ 2 - 2
picc-admin-server/src/main/resources/mapper/sys/DataDictionary.xml

@@ -30,7 +30,7 @@
 		values
 		(
 #{id,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{value,jdbcType=VARCHAR}
 ,#{sortNo,jdbcType= NUMERIC }
 ,#{parentId,jdbcType=VARCHAR}
@@ -51,7 +51,7 @@
 		update sys_data_dictionary
 		<set>
 				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="value!=null">
 		value_=#{value,jdbcType=VARCHAR},

+ 4 - 4
picc-admin-server/src/main/resources/mapper/sys/Role.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.jpsoft.picc.modules.sys.dao.RoleDAO">
     <resultMap id="RoleMap" type="com.jpsoft.picc.modules.sys.entity.Role">
         <id property="id" column="id_"/>
-        <result property="userName" column="name_"/>
+        <result property="name" column="name_"/>
         <result property="description" column="description_"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
@@ -25,7 +25,7 @@
 		values
 		(
             #{id,jdbcType=VARCHAR}
-            ,#{userName,jdbcType=VARCHAR}
+            ,#{name,jdbcType=VARCHAR}
             ,#{description,jdbcType=VARCHAR}
             ,#{createTime,jdbcType= TIMESTAMP }
             ,#{updateTime,jdbcType= TIMESTAMP }
@@ -41,8 +41,8 @@
     <update id="update" parameterType="com.jpsoft.picc.modules.sys.entity.Role">
         update sys_role
         <set>
-            <if test="userName!=null">
-                name_=#{userName,jdbcType=VARCHAR},
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
             </if>
             <if test="description!=null">
                 description_=#{description,jdbcType=VARCHAR},

+ 1 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/dao/CompanyDAO.java

@@ -15,4 +15,5 @@ public interface CompanyDAO {
 	int delete(String id);
 	List<Company> list();
 	List<Company> search(Map<String, Object> searchParams, List<Sort> sortList);
+    Company findByCreateBy(String userId);
 }

+ 1 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/CompanyService.java

@@ -14,4 +14,5 @@ public interface CompanyService {
 	int delete(String id);
 	List<Company> list();
 	Page<Company> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+    Company findByCreateBy(String userId);
 }

+ 5 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/impl/CompanyServiceImpl.java

@@ -67,4 +67,9 @@ public class CompanyServiceImpl implements CompanyService {
         
         return page;
 	}
+
+	@Override
+	public Company findByCreateBy(String userId) {
+		return companyDAO.findByCreateBy(userId);
+	}
 }

+ 3 - 0
picc-common/src/main/resources/mapper/base/Company.xml

@@ -188,4 +188,7 @@ id_,name_,legal_name,legal_card,legal_card_file,uscc_code,uscc_files,type_,busin
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+    <select id="findByCreateBy" resultMap="CompanyMap">
+		select * from base_company where create_by=#{0} and del_flag=0 limit 1
+	</select>
 </mapper>

+ 3 - 3
picc-common/src/main/resources/mapper/base/CompanyMember.xml

@@ -34,7 +34,7 @@
 		(
 #{id,jdbcType=VARCHAR}
 ,#{companyId,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{cardType,jdbcType=VARCHAR}
 ,#{cardNo,jdbcType=VARCHAR}
 ,#{sex,jdbcType= NUMERIC }
@@ -60,8 +60,8 @@
 				<if test="companyId!=null">
 		company_id=#{companyId,jdbcType=VARCHAR},
 		</if>
-				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+				<if test="name!=null">
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="cardType!=null">
 		card_type=#{cardType,jdbcType=VARCHAR},

+ 6 - 5
picc-common/src/main/resources/mapper/base/InsuranceAgent.xml

@@ -25,7 +25,7 @@
 		values
 		(
 #{id,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{status,jdbcType=VARCHAR}
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{createBy,jdbcType=VARCHAR}
@@ -41,8 +41,8 @@
 	<update id="update" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceAgent">
 		update base_insurance_agent
 		<set>
-				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+				<if test="name!=null">
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="status!=null">
 		status_=#{status,jdbcType=VARCHAR},
@@ -70,16 +70,17 @@
 id_,name_,status_,del_flag,create_by,create_time,update_by,update_time		from base_insurance_agent where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from base_insurance_agent where id_=#{0}
+		select count(*) from base_insurance_agent where id_=#{0} and del_flag = false
 	</select>
 	<select id="list" resultMap="InsuranceAgentMap">
-		select * from base_insurance_agent
+		select * from base_insurance_agent where del_flag = false
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsuranceAgentMap">
 		<![CDATA[
 			select * from base_insurance_agent
 		]]>
 		<where>
+			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 5 - 4
picc-common/src/main/resources/mapper/base/InsuranceDefinition.xml

@@ -27,7 +27,7 @@
 		values
 		(
 #{id,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{insuranceDescription,jdbcType=VARCHAR}
 ,#{clause,jdbcType=VARCHAR}
 ,#{status,jdbcType=VARCHAR}
@@ -45,8 +45,8 @@
 	<update id="update" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
 		update base_insurance_definition
 		<set>
-				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+				<if test="name!=null">
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="insuranceDescription!=null">
 		insurance_description=#{insuranceDescription,jdbcType=VARCHAR},
@@ -83,13 +83,14 @@ id_,name_,insurance_description,clause_,status_,del_flag,create_by,create_time,u
 		select count(*) from base_insurance_definition where id_=#{0}
 	</select>
 	<select id="list" resultMap="InsuranceDefinitionMap">
-		select * from base_insurance_definition
+		select * from base_insurance_definition where del_flag=false
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsuranceDefinitionMap">
 		<![CDATA[
 			select * from base_insurance_definition
 		]]>
 		<where>
+			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 5 - 4
picc-common/src/main/resources/mapper/base/InsuranceDefinitionLimit.xml

@@ -29,7 +29,7 @@
 		(
 #{id,jdbcType=VARCHAR}
 ,#{definitionId,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{limit,jdbcType=VARCHAR}
 ,#{unit,jdbcType=VARCHAR}
 ,#{status,jdbcType=VARCHAR}
@@ -50,8 +50,8 @@
 				<if test="definitionId!=null">
 		definition_id=#{definitionId,jdbcType=VARCHAR},
 		</if>
-				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+				<if test="name!=null">
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="limit!=null">
 		limit_=#{limit,jdbcType=VARCHAR},
@@ -88,7 +88,7 @@ id_,definition_id,name_,limit_,unit_,status_,del_flag,create_by,create_time,upda
 		select count(*) from base_insurance_definition_limit where id_=#{0}
 	</select>
 	<select id="list" resultMap="InsuranceDefinitionLimitMap">
-		select * from base_insurance_definition_limit
+		select * from base_insurance_definition_limit where del_flag=false
 	</select>
 	<select id="findByDefinitionId" parameterType="string" resultMap="InsuranceDefinitionLimitMap">
 		select * from base_insurance_definition_limit where definition_id=#{0}
@@ -98,6 +98,7 @@ id_,definition_id,name_,limit_,unit_,status_,del_flag,create_by,create_time,upda
 			select * from base_insurance_definition_limit
 		]]>
 		<where>
+			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 4 - 3
picc-common/src/main/resources/mapper/base/InsuranceJobs.xml

@@ -78,19 +78,20 @@ id_,jobs_id,definition_id,charges_,del_flag,create_by,create_time,update_by,upda
 		select count(*) from base_insurance_jobs where id_=#{0}
 	</select>
 	<select id="list" resultMap="InsuranceJobsMap">
-	select * from base_insurance_jobs
+	select * from base_insurance_jobs where del_flag = false
 	</select>
 	<select id="listByDefinitionId" parameterType="string" resultMap="InsuranceJobsMap">
-		select * from base_insurance_jobs where definition_id=#{0}
+		select * from base_insurance_jobs where definition_id=#{0} and del_flag = false
 	</select>
 	<select id="findByDefinitionIdAndJobId" parameterType="string" resultMap="InsuranceJobsMap">
-		select * from base_insurance_jobs where definition_id=#{definitionId,jdbcType=VARCHAR} and jobs_id=#{jobId,jdbcType=VARCHAR}
+		select * from base_insurance_jobs where definition_id=#{definitionId,jdbcType=VARCHAR} and jobs_id=#{jobId,jdbcType=VARCHAR} and del_flag = false
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsuranceJobsMap">
 		<![CDATA[
 			select * from base_insurance_jobs
 		]]>
 		<where>
+			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 6 - 5
picc-common/src/main/resources/mapper/base/Jobs.xml

@@ -28,7 +28,7 @@
 		(
 #{id,jdbcType=VARCHAR}
 ,#{definitionId,jdbcType=VARCHAR}
-,#{userName,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
 ,#{content,jdbcType=VARCHAR}
 ,#{status,jdbcType=VARCHAR}
 ,#{delFlag,jdbcType= NUMERIC }
@@ -48,8 +48,8 @@
 				<if test="definitionId!=null">
 		definition_id=#{definitionId,jdbcType=VARCHAR},
 		</if>
-				<if test="userName!=null">
-		name_=#{userName,jdbcType=VARCHAR},
+				<if test="name!=null">
+		name_=#{name,jdbcType=VARCHAR},
 		</if>
 				<if test="content!=null">
 		content_=#{content,jdbcType=VARCHAR},
@@ -83,16 +83,17 @@ id_,definition_id,name_,content_,status_,del_flag,create_by,create_time,update_b
 		select count(*) from base_jobs where id_=#{0}
 	</select>
 	<select id="list" resultMap="JobsMap">
-		select * from base_jobs
+		select * from base_jobs where del_flag = false
 	</select>
 	<select id="findByDefinitionId" parameterType="string" resultMap="JobsMap">
-		select * from base_jobs where definition_id=#{0}
+		select * from base_jobs where definition_id=#{0} and del_flag = false
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="JobsMap">
 		<![CDATA[
 			select * from base_jobs
 		]]>
 		<where>
+			and del_flag = false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 3 - 2
picc-common/src/main/resources/mapper/business/InsuranceApplication.xml

@@ -110,16 +110,17 @@
 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}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from business_insurance_application where id_=#{0}
+		select count(*) from business_insurance_application where id_=#{0} and del_flag = false
 	</select>
 	<select id="list" resultMap="InsuranceApplicationMap">
-		select * from business_insurance_application
+		select * from business_insurance_application where del_flag = false
 	</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>

+ 3 - 3
picc-common/src/main/resources/mapper/business/InsurancePolicy.xml

@@ -132,11 +132,11 @@ id_,status_,process_status,insurance_fee,start_time,end_time,number_,account_ban
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsurancePolicyMap">
 		<![CDATA[
-			SELECT a.* FROM business_insurance_policy a LEFT JOIN business_application_policy b ON a.id_ = b.policy_id
+			select * from business_insurance_policy
 		]]>
 		<where>
-			<if test="searchParams.applicationId != null">
-				and b.application_id like #{searchParams.applicationId}
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 94 - 0
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/CompanyController.java

@@ -1,9 +1,103 @@
 package com.jpsoft.picc.modules.auth.controller;
 
+import com.alibaba.druid.util.StringUtils;
+import com.jpsoft.picc.modules.base.entity.Company;
+import com.jpsoft.picc.modules.base.service.CompanyService;
+import com.jpsoft.picc.modules.common.dto.MessageResult;
+import com.jpsoft.picc.modules.common.utils.PojoUtils;
+import com.jpsoft.picc.modules.pub.dto.CompanyInfoDTO;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jasig.cas.client.authentication.AttributePrincipal;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.UUID;
+
 @Api(description="企业信息管理")
 @RestController
+@RequestMapping("/auth/company")
 public class CompanyController {
+    @Autowired
+    private CompanyService companyService;
+
+    @GetMapping(value="detail")
+    @ApiOperation(value = "获取企业信息")
+    public MessageResult<CompanyInfoDTO> detail(HttpServletRequest request){
+        MessageResult<CompanyInfoDTO> messageResult = new MessageResult<>();
+
+        try {
+            CompanyInfoDTO companyInfoDTO = new CompanyInfoDTO();
+
+            //todo
+            AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
+
+            Company company = companyService.findByCreateBy(principal.getName());
+
+            if(company!=null) {
+                PojoUtils.map(company, companyInfoDTO);
+                messageResult.setData(companyInfoDTO);
+            }
+            else{
+                messageResult.setData(companyInfoDTO);
+            }
+
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping(value="save")
+    @ApiOperation(value = "保存企业信息")
+    public MessageResult<String> save(CompanyInfoDTO companyInfoDTO,HttpServletRequest request){
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+            //todo
+            AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
+
+            if (StringUtils.isEmpty(companyInfoDTO.getId())){
+                Company company = new Company();
+
+                PojoUtils.map(companyInfoDTO, company);
+
+                company.setId(UUID.randomUUID().toString());
+                company.setCreateTime(new Date());
+                company.setCreateBy(principal.getName());
+                company.setDelFlag(false);
+
+                companyService.insert(company);
+
+                messageResult.setData(company.getId());
+            }
+            else {
+                Company company = companyService.get(companyInfoDTO.getId());
+                PojoUtils.map(companyInfoDTO, company);
+                company.setUpdateTime(new Date());
+                company.setUpdateBy(principal.getName());
+
+                companyService.update(company);
+
+                messageResult.setData(company.getId());
+            }
+
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }

+ 5 - 73
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/CompanyUserController.java

@@ -23,8 +23,12 @@ import javax.servlet.http.HttpSession;
 import java.util.Date;
 import java.util.UUID;
 
+/***
+ * 账户信息在荆鹏云中统一管理
+ */
+@Deprecated
 @RestController
-@Api(description = "企业用户操作")
+//@Api(description = "企业用户操作")
 @RequestMapping("/companyUser")
 public class CompanyUserController {
     @Autowired
@@ -175,78 +179,6 @@ public class CompanyUserController {
         return messageResult;
     }
 
-    @GetMapping(value="getCompanyInformation")
-    @ApiOperation(value = "获取企业信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "companyId",value = "企业用户编号", required = true, paramType = "query"),
-    })
-    public MessageResult<CompanyInfoDTO> getCompanyInformation(String companyId){
-        MessageResult<CompanyInfoDTO> messageResult = new MessageResult<>();
-
-        try {
-            //todo
-            Company company = companyService.get(companyId);
-
-            CompanyInfoDTO companyInfoDTO = new CompanyInfoDTO();
-            PojoUtils.map(company,companyInfoDTO);
-
-            messageResult.setData(companyInfoDTO);
-            messageResult.setResult(true);
-        }
-        catch (Exception ex){
-            messageResult.setResult(false);
-            messageResult.setMessage(ex.getMessage());
-        }
-
-        return messageResult;
-    }
-
-    @PostMapping(value="saveCompanyInformation")
-    @ApiOperation(value = "保存企业信息")
-    public MessageResult<String> saveCompanyInformation(CompanyInfoDTO companyInfoDTO){
-        MessageResult<String> messageResult = new MessageResult<>();
-
-        try {
-            //todo
-            if (StringUtils.isEmpty(companyInfoDTO.getId())){
-                Company company = new Company();
-
-                PojoUtils.map(companyInfoDTO, company);
-
-                company.setId(UUID.randomUUID().toString());
-                company.setCreateTime(new Date());
-
-                companyService.insert(company);
-
-                messageResult.setData(company.getId());
-            }
-            else {
-                Company company = companyService.get(companyInfoDTO.getId());
-                PojoUtils.map(companyInfoDTO, company);
-                company.setUpdateTime(new Date());
-
-                companyService.update(company);
-
-                messageResult.setData(company.getId());
-            }
-
-            CompanyUser companyUser = companyUserService.get(companyInfoDTO.getCompanyUserId());
-
-            if (companyUser!=null) {
-                companyUser.setCompanyId(companyInfoDTO.getId());
-                companyUserService.update(companyUser);
-            }
-
-            messageResult.setResult(true);
-        }
-        catch (Exception ex){
-            messageResult.setResult(false);
-            messageResult.setMessage(ex.getMessage());
-        }
-
-        return messageResult;
-    }
-
     @PostMapping(value="updatePhoneNumber")
     @ApiOperation(value = "更新账户手机号")
     @ApiImplicitParams({

+ 1 - 0
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/UserController.java

@@ -115,6 +115,7 @@ public class UserController {
 
             Map<String, Object> map = new HashMap<>();
 
+            //{"serialNumber":"000101000178","phone":"13986703087","userName":"2142006","userId":"178"}
             for (String key : principal.getAttributes().keySet()) {
                 map.put(key, principal.getAttributes().get(key));
             }

+ 0 - 2
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/dto/CompanyInfoDTO.java

@@ -7,8 +7,6 @@ import lombok.Data;
 @Data
 @ApiModel(value = "企业信息")
 public class CompanyInfoDTO {
-    @ApiModelProperty(value = "企业用户编号")
-    private String companyUserId;
     @ApiModelProperty(value = "企业编号")
     private String id;
     @ApiModelProperty(value = "企业名称")