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
788e071a
Commit
788e071a
authored
Jul 04, 2018
by
neo.wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_neo' into 'dev'
Dev neo See merge request root/atms!46
parents
64a1d633
a937fac7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
183 deletions
+58
-183
pom.xml
atms-api/pom.xml
+16
-13
FormulaAdminMapper.java
...rc/main/java/pwc/taxtech/atms/dao/FormulaAdminMapper.java
+12
-0
GroupId.java
atms-api/src/main/java/pwc/taxtech/atms/dto/GroupId.java
+6
-0
ReportFormulaFactory.java
...c/taxtech/atms/vat/service/impl/ReportFormulaFactory.java
+18
-4
FormulaContext.java
...tms/vat/service/impl/report/functions/FormulaContext.java
+6
-166
No files found.
atms-api/pom.xml
View file @
788e071a
...
...
@@ -316,19 +316,22 @@
<artifactId>
guava
</artifactId>
<version>
24.0-jre
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty.aggregate/jetty-all -->
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty.aggregate/jetty-all -->
<!--<dependency>-->
<!--<groupId>org.eclipse.jetty.aggregate</groupId>-->
<!--<artifactId>jetty-all</artifactId>-->
<!--<version>9.4.10.v20180503</version>-->
<!--<type>pom</type>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.jetty</groupId>-->
<!--<artifactId>apache-jsp</artifactId>-->
<!--<version>9.4.10.v20180503</version>-->
<!--</dependency>-->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.0
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty.aggregate
</groupId>
<artifactId>
jetty-all
</artifactId>
<version>
9.4.10.v20180503
</version>
<type>
pom
</type>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
apache-jsp
</artifactId>
<version>
9.4.10.v20180503
</version>
</dependency>
</dependencies>
<profiles>
...
...
atms-api/src/main/java/pwc/taxtech/atms/dao/FormulaAdminMapper.java
View file @
788e071a
...
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
pwc.taxtech.atms.MyMapper
;
import
pwc.taxtech.atms.dto.GroupId
;
import
pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto
;
import
java.util.List
;
...
...
@@ -33,5 +34,16 @@ public interface FormulaAdminMapper extends MyMapper {
" AND template.template_group_id = #{groupId}"
)
List
<
CellTemplatePerGroupDto
>
getCellTemplatePerGroupDto
(
@Param
(
"groupId"
)
String
groupId
);
@Select
(
"SELECT "
+
" rule.template_group_id as groupId, rule.is_default as isDefault "
+
"FROM "
+
" Project p, "
+
" tax_payer_report_rule rule "
+
"WHERE "
+
" (p.OrganizationID = rule.organization_id "
+
" OR rule.is_default = 1) "
+
" AND p.ID = #{projectId}"
)
List
<
GroupId
>
getTemplateGroupId
(
@Param
(
"projectId"
)
String
projectId
);
}
atms-api/src/main/java/pwc/taxtech/atms/dto/GroupId.java
0 → 100644
View file @
788e071a
package
pwc
.
taxtech
.
atms
.
dto
;
public
class
GroupId
{
public
String
groupId
;
public
Integer
isDefault
;
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportFormulaFactory.java
View file @
788e071a
...
...
@@ -8,12 +8,14 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dto.GroupId
;
import
pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.entitiy.ProjectServiceType
;
import
pwc.taxtech.atms.entitiy.ProjectServiceTypeExample
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaAgent
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext
;
import
java.util.Comparator
;
import
java.util.List
;
public
class
ReportFormulaFactory
{
...
...
@@ -25,7 +27,7 @@ public class ReportFormulaFactory {
protected
ReportBaseFormula
(
FormulaContext
context
)
{
this
.
context
=
context
;
this
.
agent
=
context
.
getFormulaAgent
();
this
.
agent
=
context
.
getFormulaAgent
();
}
static
String
resolverString
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
,
int
index
)
...
...
@@ -129,9 +131,21 @@ public class ReportFormulaFactory {
ProjectServiceTypeExample
pst
=
new
ProjectServiceTypeExample
();
pst
.
createCriteria
().
andTemplateGroupIDEqualTo
(
Long
.
valueOf
(
context
.
getReportTemplateGroupID
()))
.
andServiceTypeIDEqualTo
(
EnumServiceType
.
VAT
.
getCode
()+
""
);
List
<
ProjectServiceType
>
pstReult
=
agent
.
projectServiceTypeMapper
.
selectByExample
(
pst
);
List
<
CellTemplatePerGroupDto
>
cellTemplates
=
agent
.
adminMp
.
getCellTemplatePerGroupDto
(
context
.
getReportTemplateGroupID
());
.
andServiceTypeIDEqualTo
(
EnumServiceType
.
VAT
.
getCode
()
+
""
);
List
<
ProjectServiceType
>
pstReult
=
agent
.
projectServiceTypeMapper
.
selectByExample
(
pst
);
List
<
CellTemplatePerGroupDto
>
cellTemplates
=
agent
.
adminMp
.
getCellTemplatePerGroupDto
(
context
.
getReportTemplateGroupID
());
if
(
pstReult
==
null
||
pstReult
.
isEmpty
())
{
List
<
GroupId
>
groupIds
=
agent
.
adminMp
.
getTemplateGroupId
(
context
.
getProjectID
());
GroupId
groupId
;
if
(
groupIds
.
size
()
>
0
)
{
groupId
=
groupIds
.
stream
().
filter
(
m
->
m
.
isDefault
!=
1
).
findFirst
().
get
();
if
(
groupId
==
null
)
groupId
=
groupIds
.
get
(
0
);
cellTemplates
.
addAll
(
agent
.
adminMp
.
getCellTemplatePerGroupDto
(
groupId
.
groupId
));
}
}
}
catch
(
EvaluationException
e
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FormulaContext.java
View file @
788e071a
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
pwc.taxtech.atms.vat.dao.PeriodTemplateMapper
;
import
lombok.Getter
;
import
lombok.Setter
;
@Setter
@Getter
public
class
FormulaContext
{
private
String
projectID
;
private
String
reportTemplateGroupID
;
...
...
@@ -18,8 +21,7 @@ public class FormulaContext {
private
Boolean
isDetailed
;
private
Boolean
isIndexAnalysis
;
private
Boolean
cacheHasIndexCode
;
private
PeriodTemplateMapper
periodTemplateMappler
;
private
FormulaAgent
formulaAgent
;
// <summary>
// 如果BB公式在cache中取上期失败,是否去上期取
...
...
@@ -30,168 +32,6 @@ public class FormulaContext {
// </summary>
private
Integer
calculateStatus
;
// private Map<String, FormulaResult> replaceSpecialCellFormulaDic;
private
FormulaAgent
formulaAgent
;
public
String
getProjectID
()
{
return
projectID
;
}
public
void
setProjectID
(
String
projectID
)
{
this
.
projectID
=
projectID
;
}
public
String
getReportTemplateGroupID
()
{
return
reportTemplateGroupID
;
}
public
void
setReportTemplateGroupID
(
String
reportTemplateGroupID
)
{
this
.
reportTemplateGroupID
=
reportTemplateGroupID
;
}
public
String
getReportID
()
{
return
reportID
;
}
public
void
setReportID
(
String
reportID
)
{
this
.
reportID
=
reportID
;
}
public
String
getOrganizationID
()
{
return
organizationID
;
}
public
void
setOrganizationID
(
String
organizationID
)
{
this
.
organizationID
=
organizationID
;
}
public
Integer
getPeriod
()
{
return
period
;
}
public
void
setPeriod
(
Integer
period
)
{
this
.
period
=
period
;
}
public
Integer
getYear
()
{
return
year
;
}
public
void
setYear
(
Boolean
year
)
{
isYear
=
year
;
}
public
String
getIndexResultId
()
{
return
indexResultId
;
}
public
void
setIndexResultId
(
String
indexResultId
)
{
this
.
indexResultId
=
indexResultId
;
}
public
Integer
getYearBeginPeriod
()
{
return
yearBeginPeriod
;
}
public
void
setYearBeginPeriod
(
Integer
yearBeginPeriod
)
{
this
.
yearBeginPeriod
=
yearBeginPeriod
;
}
public
Integer
getYearEndPeriod
()
{
return
yearEndPeriod
;
}
public
void
setYearEndPeriod
(
Integer
yearEndPeriod
)
{
this
.
yearEndPeriod
=
yearEndPeriod
;
}
public
Boolean
getIfRound
()
{
return
ifRound
;
}
public
void
setIfRound
(
Boolean
ifRound
)
{
this
.
ifRound
=
ifRound
;
}
public
Boolean
getValidation
()
{
return
isValidation
;
}
public
void
setValidation
(
Boolean
validation
)
{
isValidation
=
validation
;
}
public
Boolean
getDetailed
()
{
return
isDetailed
;
}
public
void
setDetailed
(
Boolean
detailed
)
{
isDetailed
=
detailed
;
}
public
Boolean
getIndexAnalysis
()
{
return
isIndexAnalysis
;
}
public
void
setIndexAnalysis
(
Boolean
indexAnalysis
)
{
isIndexAnalysis
=
indexAnalysis
;
}
public
Boolean
getCacheHasIndexCode
()
{
return
cacheHasIndexCode
;
}
public
void
setCacheHasIndexCode
(
Boolean
cacheHasIndexCode
)
{
this
.
cacheHasIndexCode
=
cacheHasIndexCode
;
}
public
Boolean
getIfCalcStackValue
()
{
return
ifCalcStackValue
;
}
public
void
setIfCalcStackValue
(
Boolean
ifCalcStackValue
)
{
this
.
ifCalcStackValue
=
ifCalcStackValue
;
}
public
Integer
getCalculateStatus
()
{
return
calculateStatus
;
}
public
void
setCalculateStatus
(
Integer
calculateStatus
)
{
this
.
calculateStatus
=
calculateStatus
;
}
// public Map<String, FormulaResult> getReplaceSpecialCellFormulaDic() {
// return replaceSpecialCellFormulaDic;
// }
//
// public void setReplaceSpecialCellFormulaDic(Map<String, FormulaResult> replaceSpecialCellFormulaDic) {
// this.replaceSpecialCellFormulaDic = replaceSpecialCellFormulaDic;
// }
public
void
setYear
(
Integer
year
)
{
this
.
year
=
year
;
}
public
PeriodTemplateMapper
getPeriodTemplateMappler
()
{
return
periodTemplateMappler
;
}
public
void
setPeriodTemplateMappler
(
PeriodTemplateMapper
periodTemplateMappler
)
{
this
.
periodTemplateMappler
=
periodTemplateMappler
;
}
public
Boolean
getIsYear
()
{
return
isYear
;
}
public
void
setIsYear
(
Boolean
isYear
)
{
isYear
=
isYear
;
}
public
FormulaAgent
getFormulaAgent
()
{
return
formulaAgent
;
}
public
void
setFormulaAgent
(
FormulaAgent
formulaAgent
)
{
this
.
formulaAgent
=
formulaAgent
;
}
}
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