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
826cdbd1
Commit
826cdbd1
authored
Mar 31, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营后台--
增加日志列表
parent
5ad25bff
Show whitespace changes
Inline
Side-by-side
Showing
10 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/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 @
826cdbd1
...
@@ -33,7 +33,7 @@ import java.util.Date;
...
@@ -33,7 +33,7 @@ import java.util.Date;
@NoArgsConstructor
@NoArgsConstructor
@Table
(
name
=
"insure_log"
)
@Table
(
name
=
"insure_log"
)
@ApiModel
(
"投保日志"
)
@ApiModel
(
"投保日志"
)
public
class
InsureLog
extends
Model
<
Insure
Policy
>
{
public
class
InsureLog
extends
Model
<
Insure
Log
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
...
@@ -88,6 +88,8 @@ public class InsureLog extends Model<InsurePolicy> {
...
@@ -88,6 +88,8 @@ public class InsureLog extends Model<InsurePolicy> {
private
Integer
policyId
;
private
Integer
policyId
;
public
String
fileUrl
;
/**
/**
* 设置:
* 设置:
*/
*/
...
@@ -221,4 +223,5 @@ public class InsureLog extends Model<InsurePolicy> {
...
@@ -221,4 +223,5 @@ public class InsureLog extends Model<InsurePolicy> {
return
type
;
return
type
;
}
}
}
}
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
View file @
826cdbd1
...
@@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
* @email 862422848@qq.com
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
* @date 2022-03-07 17:02:46
*/
*/
@Api
(
tags
=
"
投保人
"
)
@Api
(
tags
=
"
8.0保险列表
"
)
@RestController
@RestController
@Transactional
@Transactional
@RequestMapping
(
value
=
"/insureApplicant"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/insureApplicant"
,
produces
=
{
"application/json"
})
...
...
src/main/java/cn/timer/api/controller/insure/InsureLogController.java
View file @
826cdbd1
package
cn
.
timer
.
api
.
controller
.
insure
;
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.List
;
import
java.util.Map
;
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.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.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.stereotype.Controller
;
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;
...
@@ -25,11 +39,65 @@ import org.springframework.web.bind.annotation.RestController;
* @email 862422848@qq.com
* @email 862422848@qq.com
* @date 2022-03-22 09:55:46
* @date 2022-03-22 09:55:46
*/
*/
@Api
(
tags
=
"8.0保险列表"
)
@RestController
@RestController
@RequestMapping
(
"insurelog"
)
@Transactional
@RequestMapping
(
value
=
"/insureLog"
,
produces
=
{
"application/json"
})
public
class
InsureLogController
{
public
class
InsureLogController
{
@Autowired
@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 @
826cdbd1
...
@@ -35,7 +35,6 @@ public class InsureProductController{
...
@@ -35,7 +35,6 @@ public class InsureProductController{
@GetMapping
(
value
=
"/productList"
)
@GetMapping
(
value
=
"/productList"
)
@ApiOperation
(
value
=
"12.产品列表"
,
httpMethod
=
"Get"
,
notes
=
"产品列表"
)
@ApiOperation
(
value
=
"12.产品列表"
,
httpMethod
=
"Get"
,
notes
=
"产品列表"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
productList
()
{
public
Result
<
Object
>
productList
()
{
List
<
InsureProduct
>
productList
=
InsureProduct
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureProduct
>().
lambda
().
eq
(
InsureProduct:
:
getIsDel
,
0
));
List
<
InsureProduct
>
productList
=
InsureProduct
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureProduct
>().
lambda
().
eq
(
InsureProduct:
:
getIsDel
,
0
));
if
(
productList
.
size
()>
0
)
{
if
(
productList
.
size
()>
0
)
{
...
...
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
View file @
826cdbd1
...
@@ -36,7 +36,6 @@ public class InsureUserController{
...
@@ -36,7 +36,6 @@ public class InsureUserController{
@PostMapping
(
value
=
"/policyList"
)
@PostMapping
(
value
=
"/policyList"
)
@ApiOperation
(
value
=
"3.保单列表"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperation
(
value
=
"3.保单列表"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
Map
map
=
Maps
.
newHashMap
();
Map
map
=
Maps
.
newHashMap
();
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
.
getPage
(),
String
.
valueOf
(
policyDto
.
getId
()));
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
.
getPage
(),
String
.
valueOf
(
policyDto
.
getId
()));
...
@@ -45,8 +44,7 @@ public class InsureUserController{
...
@@ -45,8 +44,7 @@ public class InsureUserController{
return
ResultUtil
.
data
(
map
);
return
ResultUtil
.
data
(
map
);
}
}
@GetMapping
(
value
=
"/userDetial"
)
@GetMapping
(
value
=
"/userDetial"
)
@ApiOperation
(
value
=
"3.被保人详情"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperation
(
value
=
"被保人详情"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
userDetial
(
@RequestParam
(
"userId"
)
String
userId
)
{
public
Result
<
Object
>
userDetial
(
@RequestParam
(
"userId"
)
String
userId
)
{
InsureUser
user
=
InsureUser
.
builder
().
id
(
Integer
.
parseInt
(
userId
)).
build
().
selectById
();
InsureUser
user
=
InsureUser
.
builder
().
id
(
Integer
.
parseInt
(
userId
)).
build
().
selectById
();
return
ResultUtil
.
data
(
user
);
return
ResultUtil
.
data
(
user
);
...
...
src/main/java/cn/timer/api/dao/insure/InsureLogMapper.java
View file @
826cdbd1
...
@@ -2,8 +2,11 @@ package cn.timer.api.dao.insure;
...
@@ -2,8 +2,11 @@ package cn.timer.api.dao.insure;
import
cn.timer.api.bean.insure.InsureLog
;
import
cn.timer.api.bean.insure.InsureLog
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
/**
*
*
*
*
...
@@ -14,5 +17,6 @@ import org.springframework.stereotype.Repository;
...
@@ -14,5 +17,6 @@ import org.springframework.stereotype.Repository;
@Repository
@Repository
public
interface
InsureLogMapper
extends
BaseMapper
<
InsureLog
>
{
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 @
826cdbd1
package
cn
.
timer
.
api
.
dto
.
insure
;
package
cn
.
timer
.
api
.
dto
.
insure
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
sun.dc.pr.PRError
;
import
java.util.Date
;
/**
/**
* @Description TODO
* @Description TODO
...
...
src/main/resources/mapping/insure/InsureLogMapper.xml
View file @
826cdbd1
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<result
property=
"type"
column=
"type"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"requestType"
column=
"request_type"
/>
<result
property=
"requestType"
column=
"request_type"
/>
<result
property=
"policyId"
column=
"policy_id"
/>
<result
property=
"policyId"
column=
"policy_id"
/>
<result
property=
"fileUrl"
column=
"file_url"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureLog"
>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureLog"
>
...
@@ -170,4 +171,9 @@
...
@@ -170,4 +171,9 @@
</foreach>
</foreach>
</delete>
</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>
</mapper>
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
826cdbd1
...
@@ -247,9 +247,8 @@
...
@@ -247,9 +247,8 @@
FROM
FROM
insure_policy ip
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
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>
<where>
iu.insure_status = 1
<if
test=
"policy.status!=null and policy.status!=''"
>
<if
test=
"policy.status!=null and policy.status!=''"
>
and ip.status = #{policy.status}
and ip.status = #{policy.status}
</if>
</if>
...
@@ -307,20 +306,20 @@
...
@@ -307,20 +306,20 @@
<select
id=
"policyTotalList"
resultType=
"cn.timer.api.dto.insure.PolicyDto"
>
<select
id=
"policyTotalList"
resultType=
"cn.timer.api.dto.insure.PolicyDto"
>
SELECT
SELECT
ip.id AS id,
ip.name AS schemeName,
ip.scheme_name AS schemeName,
ip.type AS type,
ip.type AS type,
(select count(id) from insure_policy) AS totaPolicy,
(select count(id) from insure_policy) AS totaPolicy,
(select count(org_code) from insure_policy) AS totalCompany,
(select count(org_code) from insure_policy) AS totalCompany,
count( iu.id ) AS totalUser,
count( iu.id ) AS totalUser,
(select sum(total_premium) from insure_policy
) as totalPremium,
ifnull(0,(select sum(total_premium) from insure_policy)
) as totalPremium,
ip.update_time AS updateTime
ip
p
.update_time AS updateTime
FROM
FROM
insure_policy ip
insure_product ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN insure_policy ipp ON ipp.product_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ipp.id
WHERE
WHERE
i
u.insure_status = 1
i
p.is_del = 0
GROUP BY
GROUP BY
ip.
type
ip.
id
</select>
</select>
</mapper>
</mapper>
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
826cdbd1
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
from insure_user iu
from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_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 !=''"
>
<if
test=
"id !=null and id !=''"
>
and ip.id=#{id}
and ip.id=#{id}
</if>
</if>
...
@@ -296,7 +296,7 @@
...
@@ -296,7 +296,7 @@
select count(iu.id) from insure_user iu
select count(iu.id) from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_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 !=''"
>
<if
test=
"id !=null and id !=''"
>
and ip.id=#{id}
and ip.id=#{id}
</if>
</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