Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-api-report
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
雷紫添
xzxt-api-report
Commits
0cb56db4
Commit
0cb56db4
authored
Sep 03, 2019
by
雷紫添
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后盖先原则
parent
8dfc3f1f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
12 deletions
+45
-12
src/main/java/com/founder/dao/RycjDao.java
+2
-1
src/main/java/com/founder/service/impl/JccjServiceImpl.java
+4
-3
src/main/java/com/founder/service/impl/RycjServiceImpl.java
+17
-8
src/main/resources/mybatis/mapper/Rycj.xml
+22
-0
No files found.
src/main/java/com/founder/dao/RycjDao.java
View file @
0cb56db4
...
@@ -13,5 +13,6 @@ import java.util.List;
...
@@ -13,5 +13,6 @@ import java.util.List;
public
interface
RycjDao
{
public
interface
RycjDao
{
int
insertRycj
(
Rycj
rycj
);
int
insertRycj
(
Rycj
rycj
);
Rycj
selectByPrimaryKey
(
String
taskid
);
int
updateByPrimaryKey
(
Rycj
Rycj
);
}
}
src/main/java/com/founder/service/impl/JccjServiceImpl.java
View file @
0cb56db4
...
@@ -47,12 +47,13 @@ public class JccjServiceImpl implements JccjService {
...
@@ -47,12 +47,13 @@ public class JccjServiceImpl implements JccjService {
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
if
(
sf
){
if
(
sf
){
res
.
put
(
"status_code"
,
"010101"
);
res
.
put
(
"status_code"
,
"010101"
);
res
.
put
(
"message"
,
"
存入
成功"
);
res
.
put
(
"message"
,
"
入省库
成功"
);
res
.
put
(
"taskid"
,
jccj
.
getTaskid
());
res
.
put
(
"taskid"
,
jccj
.
getTaskid
());
}
}
else
{
else
{
res
.
put
(
"status_code"
,
"010102"
);
res
.
put
(
"status_code"
,
"010104"
);
res
.
put
(
"message"
,
"存入失败"
);
res
.
put
(
"message"
,
"存入省库失败"
);
res
.
put
(
"taskid"
,
jccj
.
getTaskid
());
}
}
return
res
;
return
res
;
}
}
...
...
src/main/java/com/founder/service/impl/RycjServiceImpl.java
View file @
0cb56db4
...
@@ -10,6 +10,7 @@ import com.founder.util.RequertUtil;
...
@@ -10,6 +10,7 @@ import com.founder.util.RequertUtil;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -22,8 +23,7 @@ import java.util.Date;
...
@@ -22,8 +23,7 @@ import java.util.Date;
public
class
RycjServiceImpl
implements
RycjService
{
public
class
RycjServiceImpl
implements
RycjService
{
@Autowired
@Autowired
private
RycjDao
rycjDao
;
private
RycjDao
rycjDao
;
/*@Autowired
private AutoSeqService autoSeqService;*/
@Value
(
value
=
"${ftpfilePath}"
)
@Value
(
value
=
"${ftpfilePath}"
)
private
String
ftpfilePath
;
private
String
ftpfilePath
;
...
@@ -44,7 +44,7 @@ public class RycjServiceImpl implements RycjService {
...
@@ -44,7 +44,7 @@ public class RycjServiceImpl implements RycjService {
Rycj
rycj
=
new
Rycj
();
Rycj
rycj
=
new
Rycj
();
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
"yyyyMM"
);
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
"yyyyMM"
);
String
dateString
=
sf
.
format
(
new
Date
());
String
dateString
=
sf
.
format
(
new
Date
());
// rycj.setXxzjbh( autoSeqService.xxzjbhFnVal("TB_ST_RYCJ",jccj.getUser_dept()
));
rycj
.
setTaskid
(
jccj
.
getTaskid
(
));
rycj
.
setRycj_dzwjgs
(
".zip"
);
rycj
.
setRycj_dzwjgs
(
".zip"
);
rycj
.
setRycj_dzwjwz
(
ftpfilePath
+
"/"
+
dateString
+
"/"
+
rycj
.
getTaskid
()+
rycj
.
getRycj_dzwjgs
());
rycj
.
setRycj_dzwjwz
(
ftpfilePath
+
"/"
+
dateString
+
"/"
+
rycj
.
getTaskid
()+
rycj
.
getRycj_dzwjgs
());
rycj
.
setRycj_bt
(
dateString
);
rycj
.
setRycj_bt
(
dateString
);
...
@@ -61,15 +61,24 @@ public class RycjServiceImpl implements RycjService {
...
@@ -61,15 +61,24 @@ public class RycjServiceImpl implements RycjService {
InputStream
in
=
new
ByteArrayInputStream
(
data
);
InputStream
in
=
new
ByteArrayInputStream
(
data
);
boolean
bool
=
false
;
boolean
bool
=
false
;
try
{
try
{
int
rows
=
rycjDao
.
insertRycj
(
rycj
);
Rycj
yrycj
=
rycjDao
.
selectByPrimaryKey
(
jccj
.
getTaskid
());
if
(
yrycj
!=
null
){
int
rows
=
rycjDao
.
updateByPrimaryKey
(
rycj
);
bool
=
FtpUtil
.
uploadFile
(
ftpserverip
,
ftpport
,
ftpuser
,
ftppass
,
ftpbathPath
,
yrycj
.
getRycj_bt
(),
rycj
.
getTaskid
()+
rycj
.
getRycj_dzwjgs
(),
in
);
bool
=
FtpUtil
.
uploadFile
(
ftpserverip
,
ftpport
,
ftpuser
,
ftppass
,
ftpbathPath
,
dateString
,
rycj
.
getTaskid
()+
rycj
.
getRycj_dzwjgs
(),
in
);
if
(
rows
>
0
)
{
bool
=
true
;
}
}
else
{
int
rows
=
rycjDao
.
insertRycj
(
rycj
);
bool
=
FtpUtil
.
uploadFile
(
ftpserverip
,
ftpport
,
ftpuser
,
ftppass
,
ftpbathPath
,
dateString
,
rycj
.
getTaskid
()
+
rycj
.
getRycj_dzwjgs
(),
in
);
if
(
rows
>
0
){
if
(
rows
>
0
)
{
bool
=
true
;
bool
=
true
;
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
System
.
out
.
print
(
"增加失败"
+
e
.
getMessage
());
System
.
out
.
print
(
"增加
或更新
失败"
+
e
.
getMessage
());
}
}
return
bool
;
return
bool
;
}
}
...
...
src/main/resources/mybatis/mapper/Rycj.xml
View file @
0cb56db4
<?xml version="1.0" encoding="UTF-8" ?>
<?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" >
<mapper
namespace=
"com.founder.dao.RycjDao"
>
<mapper
namespace=
"com.founder.dao.RycjDao"
>
<resultMap
id=
"rycj"
type=
"com.founder.model.Rycj"
>
<id
column=
"TASKID"
property=
"taskid"
jdbcType=
"VARCHAR"
/>
<result
column=
"RYCJ_BT"
property=
"rycj_bt"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"selectByPrimaryKey"
resultMap=
"rycj"
parameterType=
"java.lang.String"
resultType=
"com.founder.model.Rycj"
>
select
RYCJ_BT,
TASKID
from TB_ST_RYCJ
where TASKID = #{ TASKID,jdbcType=VARCHAR }
</select>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.founder.model.Rycj"
>
update TB_ST_RYCJ
set
USER_ID = #{ user_id , jdbcType=VARCHAR }
,USER_DEPT = #{ user_dept , jdbcType=VARCHAR }
, STATUS_CODE = #{ status_code , jdbcType=VARCHAR }
, VERSION = #{ version , jdbcType=VARCHAR }
where TASKID = #{ taskid,jdbcType=VARCHAR }
</update>
<insert
id=
"insertRycj"
parameterType=
"com.founder.model.Rycj"
>
<insert
id=
"insertRycj"
parameterType=
"com.founder.model.Rycj"
>
INSERT INTO TB_ST_RYCJ (
INSERT INTO TB_ST_RYCJ (
...
...
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