Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
3ee146f0
Commit
3ee146f0
authored
Apr 17, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix add project bug
parent
3563a062
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
ProjectServiceImpl.java
...ava/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
+13
-4
ProjectMapper.java
...dao/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
+3
-1
ProjectExtendsMapper.xml
...ces/pwc/taxtech/atms/dao/extends/ProjectExtendsMapper.xml
+27
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
View file @
3ee146f0
...
...
@@ -177,13 +177,21 @@ public class ProjectServiceImpl {
try
{
project
.
setId
(
UUID
.
randomUUID
().
toString
());
project
.
setUpdateTime
(
new
Date
());
int
row
=
projectMapper
.
insertOnWhere
(
project
);
if
(
row
<=
0
){
ProjectExample
projectExample
=
new
ProjectExample
();
projectExample
.
createCriteria
().
andIsActiveEqualTo
(
true
).
andOrganizationIdEqualTo
(
project
.
getOrganizationId
()).
andYearEqualTo
(
project
.
getYear
());
List
<
Project
>
dataList
=
projectMapper
.
selectByExample
(
projectExample
);
project
=
dataList
.
get
(
0
);
}
else
{
final
Project
project1
=
project
;
OrganizationServiceTemplateGroupExample
example
=
new
OrganizationServiceTemplateGroupExample
();
example
.
createCriteria
().
andOrganizationIdEqualTo
(
projectDto
.
getOrganizationId
());
organizationServiceTemplateGroupMapper
.
selectByExample
(
example
).
forEach
(
ostg
->
{
ProjectServiceType
pst
=
new
ProjectServiceType
();
pst
.
setId
(
UUID
.
randomUUID
().
toString
());
pst
.
setProjectId
(
project
.
getId
());
pst
.
setProjectId
(
project1
.
getId
());
pst
.
setServiceTypeId
(
ostg
.
getServiceTypeId
());
pst
.
setTemplateGroupId
(
ostg
.
getTemplateGroupId
());
...
...
@@ -191,9 +199,10 @@ public class ProjectServiceImpl {
// operationLogService.addDataAddLog(pst, OperationModule.ProjectServiceType, userName,//TODO add peration log
// Message.Project.AddProjectServiceType, pst.getId(), projectDto.getName(), LOG_TYPE);
});
}
project
.
setUpdateTime
(
new
Date
());
projectMapper
.
insert
(
project
);
// operationLogService.addDataAddLog(project, OperationModule.Project, userName, Message.Project.AddProject,
// project.getId(), projectDto.getName(), LOG_TYPE);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
View file @
3ee146f0
package
pwc
.
taxtech
.
atms
.
dao
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
...
...
@@ -251,4 +250,6 @@ public interface ProjectMapper extends MyMapper {
List
<
ProjectAnaylsisDto
>
getTemlateWithServiceType2
(
@Param
(
"orgId"
)
String
orgId
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"month"
)
Integer
month
,
@Param
(
"code"
)
String
code
);
List
<
Project
>
queryChildOrgAndProjectByOrgId
(
@Param
(
"year"
)
Integer
year
,
@Param
(
"orgId"
)
String
orgId
);
int
insertOnWhere
(
Project
record
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/ProjectExtendsMapper.xml
View file @
3ee146f0
...
...
@@ -46,7 +46,34 @@
and o.parent_id = #{orgId,jdbcType=VARCHAR}
</select>
<insert
id=
"insertOnWhere"
parameterType=
"pwc.taxtech.atms.entity.Project"
>
insert into project (id, code, name,
year, client_code, is_active,
create_time, update_time, region_id,
industry_id, rule_type, organization_id,
db_name, enterprise_account_set_id, start_period,
end_period)
select #{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{year,jdbcType=INTEGER}, #{clientCode,jdbcType=VARCHAR}, #{isActive,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{regionId,jdbcType=VARCHAR},
#{industryId,jdbcType=VARCHAR}, #{ruleType,jdbcType=INTEGER}, #{organizationId,jdbcType=VARCHAR},
#{dbName,jdbcType=VARCHAR}, #{enterpriseAccountSetId,jdbcType=VARCHAR}, #{startPeriod,jdbcType=INTEGER},
#{endPeriod,jdbcType=INTEGER}
FROM dual
where not exists(
select
*
from
project
where
organization_id = #{organizationId,jdbcType=VARCHAR}
and
year = #{year,jdbcType=INTEGER}
and
is_active = 1
)
</insert>
...
...
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