Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
fe0a60a6
Commit
fe0a60a6
authored
Mar 21, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加配置
parent
288800b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
7 deletions
+62
-7
CORSFilter.java
...yeejoin/amos/boot/module/jxiop/api/config/CORSFilter.java
+52
-0
HouseholdPvDeviceImport.java
...os/boot/module/jxiop/api/dto/HouseholdPvDeviceImport.java
+1
-1
HouseholdPvDeviceMapper.xml
...api/src/main/resources/mapper/HouseholdPvDeviceMapper.xml
+9
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/config/CORSFilter.java
0 → 100644
View file @
fe0a60a6
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
config
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
javax.servlet.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* @program: api
* @description:
* @author: duanwei
* @create: 2019-12-13 11:16
**/
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
@Configuration
public
class
CORSFilter
implements
Filter
{
@Override
public
void
init
(
FilterConfig
filterConfig
)
throws
ServletException
{
}
@Override
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
request
=
(
HttpServletRequest
)
servletRequest
;
HttpServletResponse
response
=
(
HttpServletResponse
)
servletResponse
;
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
response
.
setHeader
(
"Access-Control-Allow-Methods"
,
"POST,GET,OPTIONS,PUT,DELETE,PATCH,HEAD"
);
response
.
setHeader
(
"Access-Control-Allow-Credentials"
,
"true"
);
response
.
setHeader
(
"Access-Control-Allow-Max-Age"
,
"3600"
);
response
.
setHeader
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, X-Access-Token, X-Api-Key, Content-Type, Accept, Cache-Control,appkey,token,product"
);
// response.setHeader("Access-Control-Allow-Headers","*");
if
(
"OPTIONS"
.
equalsIgnoreCase
(
request
.
getMethod
()))
{
response
.
setStatus
(
HttpServletResponse
.
SC_OK
);
}
else
{
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
}
@Override
public
void
destroy
()
{
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/HouseholdPvDeviceImport.java
View file @
fe0a60a6
...
@@ -22,7 +22,7 @@ public class HouseholdPvDeviceImport {
...
@@ -22,7 +22,7 @@ public class HouseholdPvDeviceImport {
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
@ExcelProperty
(
value
=
"SN编码"
,
index
=
3
)
@ExcelProperty
(
value
=
"SN编码"
,
index
=
3
)
private
String
sn
Code
;
private
String
SN
Code
;
@ColumnWidth
(
15
)
@ColumnWidth
(
15
)
@ExcelProperty
(
value
=
"型号"
,
index
=
4
)
@ExcelProperty
(
value
=
"型号"
,
index
=
4
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/HouseholdPvDeviceMapper.xml
View file @
fe0a60a6
...
@@ -2,15 +2,17 @@
...
@@ -2,15 +2,17 @@
<!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">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.api.mapper.HouseholdPvDeviceMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.api.mapper.HouseholdPvDeviceMapper"
>
<insert
id=
"insertAndUpdate"
>
<insert
id=
"insertAndUpdate"
>
INSERT INTO household_pv_device
INSERT INTO household_pv_device
(
(
sequence_nbr, household_pv_id, name, brand,SN_code, model, power, serial_number,type,description) VALUES
sequence_nbr, household_pv_id, name, brand,SN_code, model, power, serial_number,type,description
,create_time,rec_date,rec_user_id,rec_user_name,is_delete
) VALUES
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
","
>
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
","
>
(
(
#{item.sequenceNbr}, #{item.householdPvId}, #{item.name}, #{item.brand}, #{item.SNCode}, #{item.model},
#{item.sequenceNbr}, #{item.householdPvId}, #{item.name}, #{item.brand}, #{item.SNCode}, #{item.model},
#{item.power}, #{item.serialNumber}, #{item.type}, #{item.description}
#{item.power}, #{item.serialNumber}, #{item.type}, #{item.description}
, #{item.createTime}, #{item.recDate}, #{item.recUserId}, #{item.recUserName}, #{item.isDelete}
)
)
</foreach>
</foreach>
ON DUPLICATE KEY UPDATE name = VALUES(name),brand = VALUES(brand),SN_code = VALUES(SNCode)
ON DUPLICATE KEY UPDATE name = VALUES(name),brand = VALUES(brand),SN_code = VALUES(SN_code),model = VALUES(model),power = VALUES(power),serial_number = VALUES(serial_number)
</insert>
,type = VALUES(type),description = VALUES(description),create_time = VALUES(create_time),rec_date = VALUES(rec_date),rec_user_id = VALUES(rec_user_id),rec_user_name = VALUES(rec_user_name)
</insert>
</mapper>
</mapper>
\ No newline at end of file
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