Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add feature : query top n success process instance order by running duration #3315

Merged
merged 8 commits into from Jul 30, 2020
Merged

Conversation

RedemptionC
Copy link
Contributor

What is the purpose of the pull request

close (#3191)

Brief change log

  • add function in ProcessInstanceController.java , ProcessInstanceService.java , ProcessInstanceMapper.java
  • add some test in ProcessInstanceServiceTest.java , ProcessInstanceMapperTest.java
  • add some constant/status in Status.java , Constants.java
  • add some sql in ProcessInstanceMapper.xml

Verify this pull request

Manually verified the change by testing locally.

@CalvinKirs
Copy link
Member

Hi, have you encountered any problems? You can add me to WeChat to communicate. My WeChat is Kris_Evil

@RequestParam(value = "endTime",required = true) String endTime

){
projectName=projectName.replaceAll("[\n|\r\t]", "_");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should improve the handleEscapes method, this is a historical problem. like this:return inputString.replace("%", "////%").replaceAll("[\n|\r|\t]", "_");

improve handleEscape method in ParameterUtils.java
@yangyichao-mango
Copy link
Contributor

Good job,
I think this sonar checker can be removed. @dailidong , Please help to confirm.
image

@@ -204,6 +205,29 @@ public Result queryProcessInstanceById(@ApiIgnore @RequestAttribute(value = Cons
return returnDataList(result);
}

@ApiOperation(value = "queryTopNLongestRunningProcessInstance", notes = "QUERY_TOPN_LONGEST_RUNNING_PROCESS_INSTANCE_NOTES")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
It will be better to add the java docs like[1] here. can you do it?
[1] image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , I will do it in next commit

putMsg(result, Status.DATA_IS_NULL, Constants.END_TIME);
return result;
}
Date end=DateUtils.stringToDate(endTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Date end=DateUtils.stringToDate(endTime);
Date end = DateUtils.stringToDate(endTime);

putMsg(result, Status.DATA_IS_NULL, Constants.START_TIME);
return result;
}
Date start=DateUtils.stringToDate(startTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Date start=DateUtils.stringToDate(startTime);
Date start = DateUtils.stringToDate(startTime);

* @param endTime
* @return
*/
public Map<String, Object> queryTopNLongestRunningProcessInstance(User loginUser,String projectName,int size, String startTime, String endTime) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public Map<String, Object> queryTopNLongestRunningProcessInstance(User loginUser,String projectName,int size, String startTime, String endTime) {
public Map<String, Object> queryTopNLongestRunningProcessInstance(User loginUser, String projectName, int size, String startTime, String endTime) {

Comment on lines 981 to 982
public static final String START_TIME="start time";
public static final String END_TIME="end time";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String START_TIME="start time";
public static final String END_TIME="end time";
public static final String START_TIME = "start time";
public static final String END_TIME = "end time";

@@ -147,6 +147,40 @@ public void testQueryProcessInstanceList() {

}

@Test
public void testQueryTopNLongestRunningProcessInstance(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void testQueryTopNLongestRunningProcessInstance(){
public void testQueryTopNLongestRunningProcessInstance() {

return result;
}
Date end=DateUtils.stringToDate(endTime);
if(start == null || end == null){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(start == null || end == null){
if(start == null || end == null) {

@RequestParam(value = "startTime",required = true) String startTime,
@RequestParam(value = "endTime",required = true) String endTime

){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
){
) {

Copy link
Contributor

@yangyichao-mango yangyichao-mango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format this code. Thx a lot~

@CalvinKirs
Copy link
Member

CalvinKirs commented Jul 29, 2020 via email

@sonarcloud
Copy link

sonarcloud bot commented Jul 29, 2020

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability B 1 Vulnerability (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

57.1% 57.1% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@nauu nauu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidzollo
Copy link
Contributor

davidzollo commented Jul 30, 2020

In fact, the replacement of the CRLF string has been completed here, and I don't understand why sonar still reports this error. On 07/29/2020 19:46,Yichao Yangnotifications@github.com wrote: Good job, I think this sonar checker can be removed. @dailidong , Please help to confirm. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

this check could be ignore sometimes

Copy link
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
good job

@davidzollo davidzollo merged commit 0c5754c into apache:dev Jul 30, 2020
@davidzollo
Copy link
Contributor

close #3191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants