Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
76da2e74
Commit
76da2e74
authored
Mar 31, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营后台--
增加日志列表
parent
61640e0e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
105 additions
and
32 deletions
+105
-32
src/main/java/cn/timer/api/bean/insure/InsureLog.java
+4
-1
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
+1
-1
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+0
-0
src/main/java/cn/timer/api/controller/insure/InsureLogController.java
+78
-10
src/main/java/cn/timer/api/controller/insure/InsureProductController.java
+0
-1
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
+1
-3
src/main/java/cn/timer/api/dao/insure/InsureLogMapper.java
+4
-0
src/main/java/cn/timer/api/dto/insure/InsureDto.java
+0
-4
src/main/resources/mapping/insure/InsureLogMapper.xml
+6
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+9
-10
src/main/resources/mapping/insure/InsureUserMapper.xml
+2
-2
No files found.
src/main/java/cn/timer/api/bean/insure/InsureLog.java
View file @
76da2e74
...
...
@@ -33,7 +33,7 @@ import java.util.Date;
@NoArgsConstructor
@Table
(
name
=
"insure_log"
)
@ApiModel
(
"投保日志"
)
public
class
InsureLog
extends
Model
<
Insure
Policy
>
{
public
class
InsureLog
extends
Model
<
Insure
Log
>
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
...
...
@@ -88,6 +88,8 @@ public class InsureLog extends Model<InsurePolicy> {
private
Integer
policyId
;
public
String
fileUrl
;
/**
* 设置:
*/
...
...
@@ -221,4 +223,5 @@ public class InsureLog extends Model<InsurePolicy> {
return
type
;
}
}
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
View file @
76da2e74
...
...
@@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
*/
@Api
(
tags
=
"
投保人
"
)
@Api
(
tags
=
"
8.0保险列表
"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/insureApplicant"
,
produces
=
{
"application/json"
})
...
...
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
76da2e74
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/insure/InsureLogController.java
View file @
76da2e74
package
cn
.
timer
.
api
.
controller
.
insure
;
import
java.io.BufferedInputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.net.HttpURLConnection
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
cn.timer.api.bean.insure.InsureLog
;
import
cn.timer.api.bean.insure.InsureProduct
;
import
cn.timer.api.dao.insure.InsureLogMapper
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aliyun.oss.common.utils.StringUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
...
...
@@ -25,11 +39,65 @@ import org.springframework.web.bind.annotation.RestController;
* @email 862422848@qq.com
* @date 2022-03-22 09:55:46
*/
@Api
(
tags
=
"8.0保险列表"
)
@RestController
@RequestMapping
(
"insurelog"
)
@Transactional
@RequestMapping
(
value
=
"/insureLog"
,
produces
=
{
"application/json"
})
public
class
InsureLogController
{
@Autowired
private
InsureLogMapper
insureLog
Service
;
private
InsureLogMapper
insureLog
Mapper
;
@GetMapping
(
value
=
"/logList"
)
@ApiOperation
(
value
=
"12.日志列表"
,
httpMethod
=
"Get"
,
notes
=
"日志列表"
)
public
Result
<
Object
>
logList
(
@RequestParam
(
"policyId"
)
String
policyId
)
{
List
<
InsureLog
>
list
=
insureLogMapper
.
selectListById
(
policyId
);
if
(
list
.
size
()>
0
)
{
return
ResultUtil
.
data
(
list
);
}
return
ResultUtil
.
error
(
"暂无日志"
);
}
@GetMapping
(
value
=
"/downUserExcel"
)
@ApiOperation
(
value
=
"12.人员清单"
,
httpMethod
=
"Get"
,
notes
=
"人员清单"
)
public
void
downUserExcel
(
@RequestParam
(
"logId"
)
String
logId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
InsureLog
insureLog
=
InsureLog
.
builder
().
id
(
Integer
.
parseInt
(
logId
)).
build
().
selectById
();
if
(
insureLog
==
null
||
StringUtils
.
isNullOrEmpty
(
insureLog
.
getFileUrl
())){
return
;
}
DateTimeFormatter
dtf2
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
OutputStream
sos
=
null
;
BufferedInputStream
bis
=
null
;
try
{
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"content-disposition"
,
"attachment; filename="
+
new
String
((
dtf2
.
format
(
LocalDateTime
.
now
())+
".xlsx"
).
getBytes
(
"UTF8"
),
"ISO-8859-1"
));
response
.
setCharacterEncoding
(
"UTF-8"
);
sos
=
response
.
getOutputStream
();
String
destUrl
=
"http:"
+
insureLog
.
getFileUrl
();
URL
url
=
new
URL
(
destUrl
);
HttpURLConnection
httpUrl
=
(
HttpURLConnection
)
url
.
openConnection
();
//连接指定的网络资源
httpUrl
.
connect
();
//获取网络输入流
bis
=
new
BufferedInputStream
(
httpUrl
.
getInputStream
());
int
b
;
while
((
b
=
bis
.
read
())
!=
-
1
)
{
sos
.
write
(
b
);
}
}
catch
(
MalformedURLException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
sos
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
bis
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
src/main/java/cn/timer/api/controller/insure/InsureProductController.java
View file @
76da2e74
...
...
@@ -35,7 +35,6 @@ public class InsureProductController{
@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
)
{
...
...
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
View file @
76da2e74
...
...
@@ -36,7 +36,6 @@ public class InsureUserController{
@PostMapping
(
value
=
"/policyList"
)
@ApiOperation
(
value
=
"3.保单列表"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
Map
map
=
Maps
.
newHashMap
();
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
.
getPage
(),
String
.
valueOf
(
policyDto
.
getId
()));
...
...
@@ -45,8 +44,7 @@ public class InsureUserController{
return
ResultUtil
.
data
(
map
);
}
@GetMapping
(
value
=
"/userDetial"
)
@ApiOperation
(
value
=
"3.被保人详情"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperationSupport
(
order
=
2
)
@ApiOperation
(
value
=
"被保人详情"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
public
Result
<
Object
>
userDetial
(
@RequestParam
(
"userId"
)
String
userId
)
{
InsureUser
user
=
InsureUser
.
builder
().
id
(
Integer
.
parseInt
(
userId
)).
build
().
selectById
();
return
ResultUtil
.
data
(
user
);
...
...
src/main/java/cn/timer/api/dao/insure/InsureLogMapper.java
View file @
76da2e74
...
...
@@ -2,8 +2,11 @@ package cn.timer.api.dao.insure;
import
cn.timer.api.bean.insure.InsureLog
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
*
*
...
...
@@ -14,5 +17,6 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
InsureLogMapper
extends
BaseMapper
<
InsureLog
>
{
List
<
InsureLog
>
selectListById
(
@Param
(
"policyId"
)
String
policyId
);
}
src/main/java/cn/timer/api/dto/insure/InsureDto.java
View file @
76da2e74
package
cn
.
timer
.
api
.
dto
.
insure
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
sun.dc.pr.PRError
;
import
java.util.Date
;
/**
* @Description TODO
...
...
src/main/resources/mapping/insure/InsureLogMapper.xml
View file @
76da2e74
...
...
@@ -18,6 +18,7 @@
<result
property=
"type"
column=
"type"
/>
<result
property=
"requestType"
column=
"request_type"
/>
<result
property=
"policyId"
column=
"policy_id"
/>
<result
property=
"fileUrl"
column=
"file_url"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureLog"
>
...
...
@@ -170,4 +171,9 @@
</foreach>
</delete>
<select
id=
"selectListById"
resultType=
"cn.timer.api.bean.insure.InsureLog"
>
select id,return_msg,`type`,create_time from insure_log
where policy_id = #{policyId}
ORDER BY create_time DESC
</select>
</mapper>
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
76da2e74
...
...
@@ -247,9 +247,8 @@
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN qyzx_ent_info_m qy on qy.id=i
u
.org_code
LEFT JOIN qyzx_ent_info_m qy on qy.id=i
p
.org_code
<where>
iu.insure_status = 1
<if
test=
"policy.status!=null and policy.status!=''"
>
and ip.status = #{policy.status}
</if>
...
...
@@ -307,20 +306,20 @@
<select
id=
"policyTotalList"
resultType=
"cn.timer.api.dto.insure.PolicyDto"
>
SELECT
ip.id AS id,
ip.scheme_name AS schemeName,
ip.name AS schemeName,
ip.type AS type,
(select count(id) from insure_policy) AS totaPolicy,
(select count(org_code) from insure_policy) AS totalCompany,
count( iu.id ) AS totalUser,
(select sum(total_premium) from insure_policy
) as totalPremium,
ip.update_time AS updateTime
ifnull(0,(select sum(total_premium) from insure_policy)
) as totalPremium,
ip
p
.update_time AS updateTime
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
insure_product ip
LEFT JOIN insure_policy ipp ON ipp.product_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ipp.id
WHERE
i
u.insure_status = 1
i
p.is_del = 0
GROUP BY
ip.
type
ip.
id
</select>
</mapper>
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
76da2e74
...
...
@@ -283,7 +283,7 @@
from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
where yme.org_code = 3
AND iu.insure_status=1
where yme.org_code = 3
<if
test=
"id !=null and id !=''"
>
and ip.id=#{id}
</if>
...
...
@@ -296,7 +296,7 @@
select count(iu.id) from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
where yme.org_code = 3
AND iu.insure_status=1
where yme.org_code = 3
<if
test=
"id !=null and id !=''"
>
and ip.id=#{id}
</if>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment