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
f11ade1e
Commit
f11ade1e
authored
Sep 29, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keyValueConfig module test and correct
parent
4ceb6cde
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
33 deletions
+36
-33
KeyValueConfigController.java
...pwc/taxtech/atms/controller/KeyValueConfigController.java
+15
-2
RemoteValidationRetDto.java
...a/pwc/taxtech/atms/dto/Common/RemoteValidationRetDto.java
+7
-15
KeyValueConfigDisplayDto.java
...n/java/pwc/taxtech/atms/dto/KeyValueConfigDisplayDto.java
+1
-1
KeyValueConfigServiceImpl.java
.../taxtech/atms/service/impl/KeyValueConfigServiceImpl.java
+1
-1
TemplateFormulaServiceImpl.java
...taxtech/atms/service/impl/TemplateFormulaServiceImpl.java
+1
-3
KeyValueConfigMapper.xml
...n/resources/pwc/taxtech/atms/dao/KeyValueConfigMapper.xml
+11
-11
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/KeyValueConfigController.java
View file @
f11ade1e
...
...
@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.*;
import
pwc.taxtech.atms.dto.Common.RemoteValidationRetDto
;
import
pwc.taxtech.atms.dto.formula.FormulaConfigDto
;
import
pwc.taxtech.atms.service.KeyValueConfigService
;
import
pwc.taxtech.atms.service.TemplateFormulaService
;
@RestController
@RequestMapping
(
"/api/v1/keyValueConfig"
)
...
...
@@ -27,6 +28,9 @@ public class KeyValueConfigController {
@Autowired
private
KeyValueConfigService
keyValueConfigService
;
@Autowired
private
TemplateFormulaService
templateFormulaService
;
@ApiOperation
(
value
=
"get keyValueConfig"
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
...
...
@@ -83,7 +87,7 @@ public class KeyValueConfigController {
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
int
delelte
(
@RequestParam
String
keyValueId
)
throws
BadHttpRequest
{
int
delelte
(
@RequestParam
(
"keyValueID"
)
String
keyValueId
)
throws
BadHttpRequest
{
if
(
StringUtils
.
isBlank
(
keyValueId
))
{
throw
new
BadHttpRequest
(
new
Exception
(
"keyValueId is null"
));
}
...
...
@@ -101,10 +105,19 @@ public class KeyValueConfigController {
RemoteValidationRetDto
isDuplicated
(
@RequestParam
String
value
)
{
boolean
isDuplicated
=
keyValueConfigService
.
isKeyValueDuplicated
(
value
);
RemoteValidationRetDto
result
=
new
RemoteValidationRetDto
();
result
.
setValid
(!
isDuplicated
);
result
.
set
Is
Valid
(!
isDuplicated
);
result
.
setValue
(
value
);
return
result
;
}
@RequestMapping
(
value
=
"isFormulaValid"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
RemoteValidationRetDto
isFormulaValid
(
@RequestParam
String
value
){
OperationResultDto
validateResult
=
templateFormulaService
.
validate
(
value
);
RemoteValidationRetDto
result
=
new
RemoteValidationRetDto
();
result
.
setIsValid
(
validateResult
.
getResult
());
result
.
setValue
(
value
);
return
result
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/Common/RemoteValidationRetDto.java
View file @
f11ade1e
package
pwc
.
taxtech
.
atms
.
dto
.
Common
;
public
class
RemoteValidationRetDto
{
private
boolean
isValid
;
private
String
value
;
public
boolean
isValid
()
{
return
isValid
;
}
import
lombok.Getter
;
import
lombok.Setter
;
public
void
setValid
(
boolean
valid
)
{
isValid
=
valid
;
}
@Getter
@Setter
public
class
RemoteValidationRetDto
{
public
String
getValue
()
{
return
value
;
}
private
Boolean
isValid
;
private
String
value
;
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/KeyValueConfigDisplayDto.java
View file @
f11ade1e
...
...
@@ -6,7 +6,7 @@ import java.util.List;
import
java.util.Map
;
public
class
KeyValueConfigDisplayDto
{
@JsonProperty
(
"ID"
)
//
@JsonProperty("ID")
private
String
id
;
private
String
keyCode
;
private
String
name
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/KeyValueConfigServiceImpl.java
View file @
f11ade1e
...
...
@@ -150,7 +150,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
keyValueConfig
.
setUpdator
(
addKeyValueConfigDto
.
getUserName
());
keyValueConfig
.
setKeyValueType
(
2
);
keyValueConfigMapper
.
insert
(
keyValueConfig
);
keyValueConfigMapper
.
insert
Selective
(
keyValueConfig
);
operationLogService
.
addDataAddLog
(
keyValueConfig
,
OperationModule
.
KeyValueConfig
,
addKeyValueConfigDto
.
getUserName
()
,
Message
.
Log
.
AddKeyValueConfiguration
,
""
,
keyValueConfig
.
getName
(),
logType
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateFormulaServiceImpl.java
View file @
f11ade1e
...
...
@@ -43,13 +43,11 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ
//var compileCode = sourceCode.Compile();
rtn.Result = compileCode != null;*/
result
.
setResult
(
true
);
return
result
;
}
catch
(
Exception
e
)
{
result
.
setResult
(
false
);
result
.
setResultMsg
(
e
.
getMessage
());
}
return
null
;
return
result
;
}
}
atms-dao/src/main/resources/pwc/taxtech/atms/dao/KeyValueConfigMapper.xml
View file @
f11ade1e
...
...
@@ -14,7 +14,7 @@
<result
column=
"IS_CONSTANT"
jdbcType=
"DECIMAL"
property=
"isConstant"
/>
<result
column=
"CALCULATE_STATUS"
jdbcType=
"DECIMAL"
property=
"calculateStatus"
/>
<result
column=
"RESULT_TYPE"
jdbcType=
"DECIMAL"
property=
"resultType"
/>
<result
column=
"SERVICE_TYPE_IDS"
jdbcType=
"VARCHAR"
property=
"serviceTypeI
D
s"
/>
<result
column=
"SERVICE_TYPE_IDS"
jdbcType=
"VARCHAR"
property=
"serviceTypeI
d
s"
/>
<result
column=
"INDUSTRY_IDS"
jdbcType=
"VARCHAR"
property=
"industryIds"
/>
<result
column=
"DESCRIPTION"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"CREATOR"
jdbcType=
"VARCHAR"
property=
"creator"
/>
...
...
@@ -157,7 +157,7 @@
DATA_SOURCE)
values (#{id,jdbcType=VARCHAR}, #{keyCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{keyValueType,jdbcType=DECIMAL}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=DECIMAL},
#{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeI
D
s,jdbcType=VARCHAR},
#{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeI
d
s,jdbcType=VARCHAR},
#{industryIds,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{dataSource,jdbcType=VARCHAR})
...
...
@@ -193,7 +193,7 @@
<if
test=
"resultType != null"
>
RESULT_TYPE,
</if>
<if
test=
"serviceTypeI
D
s != null"
>
<if
test=
"serviceTypeI
d
s != null"
>
SERVICE_TYPE_IDS,
</if>
<if
test=
"industryIds != null"
>
...
...
@@ -243,8 +243,8 @@
<if
test=
"resultType != null"
>
#{resultType,jdbcType=DECIMAL},
</if>
<if
test=
"serviceTypeI
D
s != null"
>
#{serviceTypeI
D
s,jdbcType=VARCHAR},
<if
test=
"serviceTypeI
d
s != null"
>
#{serviceTypeI
d
s,jdbcType=VARCHAR},
</if>
<if
test=
"industryIds != null"
>
#{industryIds,jdbcType=VARCHAR},
...
...
@@ -310,8 +310,8 @@
<if
test=
"record.resultType != null"
>
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
</if>
<if
test=
"record.serviceTypeI
D
s != null"
>
SERVICE_TYPE_IDS = #{record.serviceTypeI
D
s,jdbcType=VARCHAR},
<if
test=
"record.serviceTypeI
d
s != null"
>
SERVICE_TYPE_IDS = #{record.serviceTypeI
d
s,jdbcType=VARCHAR},
</if>
<if
test=
"record.industryIds != null"
>
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
...
...
@@ -353,7 +353,7 @@
IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{record.serviceTypeI
D
s,jdbcType=VARCHAR},
SERVICE_TYPE_IDS = #{record.serviceTypeI
d
s,jdbcType=VARCHAR},
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{record.description,jdbcType=VARCHAR},
CREATOR = #{record.creator,jdbcType=VARCHAR},
...
...
@@ -393,8 +393,8 @@
<if
test=
"resultType != null"
>
RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
</if>
<if
test=
"serviceTypeI
D
s != null"
>
SERVICE_TYPE_IDS = #{serviceTypeI
D
s,jdbcType=VARCHAR},
<if
test=
"serviceTypeI
d
s != null"
>
SERVICE_TYPE_IDS = #{serviceTypeI
d
s,jdbcType=VARCHAR},
</if>
<if
test=
"industryIds != null"
>
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
...
...
@@ -433,7 +433,7 @@
IS_CONSTANT = #{isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{serviceTypeI
D
s,jdbcType=VARCHAR},
SERVICE_TYPE_IDS = #{serviceTypeI
d
s,jdbcType=VARCHAR},
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR},
CREATOR = #{creator,jdbcType=VARCHAR},
...
...
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