提交 daf1ee60 authored 作者: gongwenjie's avatar gongwenjie

war

上级 7c3c36d8
...@@ -5,6 +5,7 @@ import com.zjty.tynotes.attendance.entity.WorkoverAppro; ...@@ -5,6 +5,7 @@ import com.zjty.tynotes.attendance.entity.WorkoverAppro;
import com.zjty.tynotes.attendance.entity.vo.request.PageRequestAtten; import com.zjty.tynotes.attendance.entity.vo.request.PageRequestAtten;
import com.zjty.tynotes.attendance.service.ApprovalInformationService; import com.zjty.tynotes.attendance.service.ApprovalInformationService;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.Department; import com.zjty.tynotes.pas.entity.Department;
import com.zjty.tynotes.pas.entity.User; import com.zjty.tynotes.pas.entity.User;
import com.zjty.tynotes.pas.entity.vo.PageResponse; import com.zjty.tynotes.pas.entity.vo.PageResponse;
...@@ -37,6 +38,7 @@ public class ApprovalController { ...@@ -37,6 +38,7 @@ public class ApprovalController {
@Autowired @Autowired
private ApprovalInformationService approvalInformationService; private ApprovalInformationService approvalInformationService;
@Content(value = "提交审批")
@ApiOperation(value = "提交审批", response = ApprovalInformation.class) @ApiOperation(value = "提交审批", response = ApprovalInformation.class)
@PostMapping("/submit") @PostMapping("/submit")
public ResponseEntity submit(@RequestBody ApprovalInformation approvalInformation) { public ResponseEntity submit(@RequestBody ApprovalInformation approvalInformation) {
...@@ -47,6 +49,7 @@ public class ApprovalController { ...@@ -47,6 +49,7 @@ public class ApprovalController {
return ok("提交审批失败,是否是调休,并且是否有加班时长"); return ok("提交审批失败,是否是调休,并且是否有加班时长");
} }
@Content(value = "删除请假审批")
@ApiOperation(value = "删除请假审批") @ApiOperation(value = "删除请假审批")
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public ResponseEntity delete(@PathVariable("id") String id) { public ResponseEntity delete(@PathVariable("id") String id) {
...@@ -68,6 +71,7 @@ public class ApprovalController { ...@@ -68,6 +71,7 @@ public class ApprovalController {
* @param approvalStatus * @param approvalStatus
* @return * @return
*/ */
@Content(value = "审核审批")
@ApiOperation(value = "审核审批") @ApiOperation(value = "审核审批")
@PostMapping("/audit/{userId}/{approvalStatus}") @PostMapping("/audit/{userId}/{approvalStatus}")
public ResponseEntity audit(@PathVariable String userId,@PathVariable String approvalStatus, public ResponseEntity audit(@PathVariable String userId,@PathVariable String approvalStatus,
...@@ -81,7 +85,6 @@ public class ApprovalController { ...@@ -81,7 +85,6 @@ public class ApprovalController {
return ok("审核审批失败"); return ok("审核审批失败");
} }
@ApiOperation(value = "查找所有我提交的审批") @ApiOperation(value = "查找所有我提交的审批")
@PostMapping("findAllSubmitApproval") @PostMapping("findAllSubmitApproval")
public ResponseEntity findAllSubmitApproval(@RequestBody PageRequestAtten pageRequest) { public ResponseEntity findAllSubmitApproval(@RequestBody PageRequestAtten pageRequest) {
...@@ -106,6 +109,7 @@ public class ApprovalController { ...@@ -106,6 +109,7 @@ public class ApprovalController {
return ok("查找所有我审核的审批失败"); return ok("查找所有我审核的审批失败");
} }
@Content(value = "提交加班申请")
@ApiOperation(value = "提交加班申请", response = WorkoverAppro.class) @ApiOperation(value = "提交加班申请", response = WorkoverAppro.class)
@PostMapping("/submitWorkover") @PostMapping("/submitWorkover")
public ResponseEntity submitWorkover(@RequestBody WorkoverAppro workoverAppro) { public ResponseEntity submitWorkover(@RequestBody WorkoverAppro workoverAppro) {
...@@ -116,6 +120,7 @@ public class ApprovalController { ...@@ -116,6 +120,7 @@ public class ApprovalController {
return ok("提交审批失败,是否可有加班时长"); return ok("提交审批失败,是否可有加班时长");
} }
@Content(value = "审批加班申请")
@ApiOperation(value = "审批加班申请", response = ApprovalInformation.class) @ApiOperation(value = "审批加班申请", response = ApprovalInformation.class)
@PostMapping("/approWorkover/{userId}/{status}") @PostMapping("/approWorkover/{userId}/{status}")
public ResponseEntity approWorkover(@RequestBody WorkoverAppro workoverAppro, public ResponseEntity approWorkover(@RequestBody WorkoverAppro workoverAppro,
...@@ -163,6 +168,7 @@ public class ApprovalController { ...@@ -163,6 +168,7 @@ public class ApprovalController {
return ok("查找可选择部门失败"); return ok("查找可选择部门失败");
} }
@Content(value = "删除加班审批")
@ApiOperation(value = "删除加班审批") @ApiOperation(value = "删除加班审批")
@DeleteMapping("/deleteWorkover/{id}") @DeleteMapping("/deleteWorkover/{id}")
public ResponseEntity deleteWorkover(@PathVariable("id") String id) { public ResponseEntity deleteWorkover(@PathVariable("id") String id) {
......
...@@ -26,6 +26,7 @@ public class AttendanceController { ...@@ -26,6 +26,7 @@ public class AttendanceController {
@Autowired @Autowired
private AttendanceDetailsService attendanceDetailsService; private AttendanceDetailsService attendanceDetailsService;
@ApiOperation(value = "查询个人考勤信息", response = ApprovalInformation.class) @ApiOperation(value = "查询个人考勤信息", response = ApprovalInformation.class)
@PostMapping("/personnel") @PostMapping("/personnel")
public ResponseEntity personnel(@RequestBody AttenRequest request){ public ResponseEntity personnel(@RequestBody AttenRequest request){
......
...@@ -14,6 +14,7 @@ import com.zjty.tynotes.attendance.entity.CardResult; ...@@ -14,6 +14,7 @@ import com.zjty.tynotes.attendance.entity.CardResult;
import com.zjty.tynotes.attendance.task.CardTask; import com.zjty.tynotes.attendance.task.CardTask;
import com.zjty.tynotes.attendance.task.MyInit; import com.zjty.tynotes.attendance.task.MyInit;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -37,6 +38,7 @@ public class DingTestController { ...@@ -37,6 +38,7 @@ public class DingTestController {
@Autowired @Autowired
private CardTask cardTask; private CardTask cardTask;
@GetMapping("/token") @GetMapping("/token")
public Object token(){ public Object token(){
List<String> responses = new ArrayList<>(); List<String> responses = new ArrayList<>();
......
...@@ -8,6 +8,7 @@ package com.zjty.tynotes.attendance.controller; ...@@ -8,6 +8,7 @@ package com.zjty.tynotes.attendance.controller;
import com.zjty.tynotes.attendance.service.DingUserService; import com.zjty.tynotes.attendance.service.DingUserService;
import com.zjty.tynotes.attendance.task.MyInit; import com.zjty.tynotes.attendance.task.MyInit;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -36,6 +37,7 @@ public class DingUserController { ...@@ -36,6 +37,7 @@ public class DingUserController {
@Autowired @Autowired
private MyInit init; private MyInit init;
@Content(value = "手动获取钉钉token的接口")
@GetMapping("/getToken") @GetMapping("/getToken")
@ApiOperation(value = "手动获取钉钉token的接口") @ApiOperation(value = "手动获取钉钉token的接口")
public ResponseEntity getToken(){ public ResponseEntity getToken(){
...@@ -48,6 +50,7 @@ public class DingUserController { ...@@ -48,6 +50,7 @@ public class DingUserController {
return ok("重新获取token失败"); return ok("重新获取token失败");
} }
@Content(value = "手动获取钉钉的用户与本地用户进行绑定")
@GetMapping("/getDingUser") @GetMapping("/getDingUser")
@ApiOperation(value = "手动获取钉钉的用户与本地用户进行绑定") @ApiOperation(value = "手动获取钉钉的用户与本地用户进行绑定")
public ResponseEntity getDingUser(){ public ResponseEntity getDingUser(){
......
...@@ -9,6 +9,7 @@ import com.zjty.tynotes.attendance.entity.vo.request.AttenRequest; ...@@ -9,6 +9,7 @@ import com.zjty.tynotes.attendance.entity.vo.request.AttenRequest;
import com.zjty.tynotes.attendance.service.AttendanceDetailsService; import com.zjty.tynotes.attendance.service.AttendanceDetailsService;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.misc.utils.ExcelUtil; import com.zjty.tynotes.misc.utils.ExcelUtil;
import com.zjty.tynotes.pas.base.advise.Content;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -34,6 +35,7 @@ public class ExlController { ...@@ -34,6 +35,7 @@ public class ExlController {
@Autowired @Autowired
private AttendanceDetailsService attendanceDetailsService; private AttendanceDetailsService attendanceDetailsService;
@Content(value = "导出元数据excel表格")
@PostMapping("/excel") @PostMapping("/excel")
@ApiOperation(value = "导出元数据excel表格") @ApiOperation(value = "导出元数据excel表格")
public void exportCurrentPage(HttpServletRequest request, HttpServletResponse response,@RequestBody AttenRequest attenRequest) { public void exportCurrentPage(HttpServletRequest request, HttpServletResponse response,@RequestBody AttenRequest attenRequest) {
......
...@@ -67,6 +67,17 @@ ...@@ -67,6 +67,17 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
<exclusions>
<exclusion>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-job</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -18,7 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -18,7 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
"com.zjty.tynotes.search", "com.zjty.tynotes.search",
"com.zjty.tynotes.redis", "com.zjty.tynotes.redis",
"com.zjty.tynotes.sms" "com.zjty.tynotes.sms"
,"com.zjty.tynotes.log"
}) })
@EnableCaching @EnableCaching
@EnableScheduling @EnableScheduling
......
...@@ -6,6 +6,8 @@ import com.zjty.tynotes.job.basic.entity.response.JobResponse; ...@@ -6,6 +6,8 @@ import com.zjty.tynotes.job.basic.entity.response.JobResponse;
import com.zjty.tynotes.job.basic.service.ScoreCoefficientService; import com.zjty.tynotes.job.basic.service.ScoreCoefficientService;
import com.zjty.tynotes.job.common.Action; import com.zjty.tynotes.job.common.Action;
import com.zjty.tynotes.job.status.service.BusinessTreeManagement; import com.zjty.tynotes.job.status.service.BusinessTreeManagement;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.log.server.LogService;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -28,6 +30,9 @@ import static org.springframework.http.ResponseEntity.ok; ...@@ -28,6 +30,9 @@ import static org.springframework.http.ResponseEntity.ok;
@RequestMapping("/job/sc") @RequestMapping("/job/sc")
public class ScController { public class ScController {
@Autowired
private LogService logService;
private final private final
ScoreCoefficientService scoreCoefficientService; ScoreCoefficientService scoreCoefficientService;
...@@ -40,12 +45,12 @@ public class ScController { ...@@ -40,12 +45,12 @@ public class ScController {
@PostMapping("/save") @PostMapping("/save")
@ApiOperation(value = "新增考评信息.", notes = "新增不可在数据中附带id.成功时返回新增数据保存的id.") @ApiOperation(value = "新增考评信息.", notes = "新增不可在数据中附带id.成功时返回新增数据保存的id.")
public ResponseEntity<JobResponse> add(@RequestBody ScRo scRo public ResponseEntity<JobResponse> add(@RequestBody ScRo scRo) {
) {
ScoreCoefficient scoreCoefficient= scRo.toDb(); ScoreCoefficient scoreCoefficient= scRo.toDb();
scoreCoefficient.setTime(new Date()); scoreCoefficient.setTime(new Date());
String saveId = scoreCoefficientService.add(scoreCoefficient); String saveId = scoreCoefficientService.add(scoreCoefficient);
businessTreeManagement.saveAction(scRo.getUserId(),scRo.getWorkId(),Action.APPRAISAL_WORD,new Date(),"自我评价"); businessTreeManagement.saveAction(scRo.getUserId(),scRo.getWorkId(),Action.APPRAISAL_WORD,new Date(),"自我评价");
logService.saveLog(new Log(null,"考评任务",new Date(),scRo.getUserId(),null));
return ok(new JobResponse(saveId)); return ok(new JobResponse(saveId));
} }
...@@ -67,6 +72,7 @@ public class ScController { ...@@ -67,6 +72,7 @@ public class ScController {
} }
String saveId = scoreCoefficientService.modify(scoreCoefficient); String saveId = scoreCoefficientService.modify(scoreCoefficient);
businessTreeManagement.saveAction(userId,scoreCoefficient.getWordId(),Action.APPRAISAL_WORD,new Date(),msg); businessTreeManagement.saveAction(userId,scoreCoefficient.getWordId(),Action.APPRAISAL_WORD,new Date(),msg);
logService.saveLog(new Log(null,"修改考评",new Date(),userId,null));
return ok(new JobResponse(saveId)); return ok(new JobResponse(saveId));
} }
......
...@@ -12,7 +12,10 @@ import com.zjty.tynotes.job.basic.service.WorkTimeService; ...@@ -12,7 +12,10 @@ import com.zjty.tynotes.job.basic.service.WorkTimeService;
import com.zjty.tynotes.job.common.Action; import com.zjty.tynotes.job.common.Action;
import com.zjty.tynotes.job.common.constant.WorkStatus; import com.zjty.tynotes.job.common.constant.WorkStatus;
import com.zjty.tynotes.job.status.service.BusinessTreeManagement; import com.zjty.tynotes.job.status.service.BusinessTreeManagement;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.log.server.LogService;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -35,6 +38,8 @@ import static org.springframework.http.ResponseEntity.ok; ...@@ -35,6 +38,8 @@ import static org.springframework.http.ResponseEntity.ok;
@RequestMapping("/job/work") @RequestMapping("/job/work")
@Slf4j @Slf4j
public class WorkController { public class WorkController {
@Autowired
private LogService logService;
@Autowired @Autowired
WorkService workService; WorkService workService;
...@@ -52,16 +57,12 @@ public class WorkController { ...@@ -52,16 +57,12 @@ public class WorkController {
private BusinessTreeManagement businessTreeManagement; private BusinessTreeManagement businessTreeManagement;
@GetMapping(value = "/{workId}") @GetMapping(value = "/{workId}")
@ApiOperation(value = "根据id查询工作.", notes = "在路径中指定要查询的工作id.") @ApiOperation(value = "根据id查询工作.", notes = "在路径中指定要查询的工作id.")
public ResponseEntity<WorkVo> findById(@PathVariable String workId) { public ResponseEntity<WorkVo> findById(@PathVariable String workId) {
return ok(conversionService.workToVo(workService.findById(workId))); return ok(conversionService.workToVo(workService.findById(workId)));
} }
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(value = "新增工作.", notes = "新增不可在数据中附带id.成功时返回新增数据保存的id.") @ApiOperation(value = "新增工作.", notes = "新增不可在数据中附带id.成功时返回新增数据保存的id.")
public ResponseEntity<JobResponse> add(@RequestBody WorkRo workRo) { public ResponseEntity<JobResponse> add(@RequestBody WorkRo workRo) {
...@@ -74,6 +75,7 @@ public class WorkController { ...@@ -74,6 +75,7 @@ public class WorkController {
}else { }else {
businessTreeManagement.saveAction(userId,workId,Action.SAVE_WORK,new Date(),remarks); businessTreeManagement.saveAction(userId,workId,Action.SAVE_WORK,new Date(),remarks);
} }
logService.saveLog(new Log(null,"新增工作"+workRo.getWork().getTitle(),new Date(),userId,null));
return ok(new JobResponse(workId)); return ok(new JobResponse(workId));
} }
...@@ -86,11 +88,11 @@ public class WorkController { ...@@ -86,11 +88,11 @@ public class WorkController {
Work oldWork = workService.findById(newWork.getId()); Work oldWork = workService.findById(newWork.getId());
String workId = workService.modify(newWork); String workId = workService.modify(newWork);
businessTreeManagement.saveAction(userId,workId,Action.SAVE_PUBLISH_WORK,new Date(),remarks); businessTreeManagement.saveAction(userId,workId,Action.SAVE_PUBLISH_WORK,new Date(),remarks);
logService.saveLog(new Log(null,"发布任务"+workRo.getWork().getTitle(),new Date(),userId,null));
return ok(new JobResponse(workId)); return ok(new JobResponse(workId));
} }
@PutMapping(value = "/delete") @PutMapping(value = "/delete")
@ApiOperation(value = "根据id删除工作.", notes = "本次删除选择是否要把个人工作量以及任务工作量纳入统计中.") @ApiOperation(value = "根据id删除工作.", notes = "本次删除选择是否要把个人工作量以及任务工作量纳入统计中.")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -108,6 +110,7 @@ public class WorkController { ...@@ -108,6 +110,7 @@ public class WorkController {
workService.deleteWork(workId,personalWorkload,workloadCount); workService.deleteWork(workId,personalWorkload,workloadCount);
businessTreeManagement.saveAction(userId,workId,Action.DELETE_WORK,new Date(),msg); businessTreeManagement.saveAction(userId,workId,Action.DELETE_WORK,new Date(),msg);
logService.saveLog(new Log(null,"删除任务",new Date(),userId,null));
return ok(new JobResponse(workId)); return ok(new JobResponse(workId));
} }
...@@ -117,6 +120,7 @@ public class WorkController { ...@@ -117,6 +120,7 @@ public class WorkController {
workService.updateWorkCrew(updateCrew.getWorkId(),updateCrew.getUsers(),updateCrew.getWorkload()); workService.updateWorkCrew(updateCrew.getWorkId(),updateCrew.getUsers(),updateCrew.getWorkload());
businessTreeManagement.saveAction(updateCrew.getUserid(),updateCrew.getWorkId(),Action.UPDATE_WORK_CREW,new Date(),updateCrew.getMsg()); businessTreeManagement.saveAction(updateCrew.getUserid(),updateCrew.getWorkId(),Action.UPDATE_WORK_CREW,new Date(),updateCrew.getMsg());
logService.saveLog(new Log(null,"修改任务的组员",new Date(),updateCrew.getUserid(),null));
return ok(new JobResponse(updateCrew.getWorkId())); return ok(new JobResponse(updateCrew.getWorkId()));
} }
...@@ -126,11 +130,10 @@ public class WorkController { ...@@ -126,11 +130,10 @@ public class WorkController {
workService.updateWorkload(updateWorkload.getWorkId(),updateWorkload.getWorkload(),updateWorkload.getWorkCoefficient()); workService.updateWorkload(updateWorkload.getWorkId(),updateWorkload.getWorkload(),updateWorkload.getWorkCoefficient());
businessTreeManagement.saveAction(updateWorkload.getUserId(),updateWorkload.getWorkId(),Action.UPDATE_WORKLOAD,new Date(),updateWorkload.getMsg()); businessTreeManagement.saveAction(updateWorkload.getUserId(),updateWorkload.getWorkId(),Action.UPDATE_WORKLOAD,new Date(),updateWorkload.getMsg());
logService.saveLog(new Log(null,"修改任务的工作量",new Date(),updateWorkload.getUserId(),null));
return ok(new JobResponse(updateWorkload.getWorkId())); return ok(new JobResponse(updateWorkload.getWorkId()));
} }
@PutMapping(value = "/status") @PutMapping(value = "/status")
@ApiOperation(value = "修改工作状态") @ApiOperation(value = "修改工作状态")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -154,25 +157,30 @@ public class WorkController { ...@@ -154,25 +157,30 @@ public class WorkController {
//撤回 //撤回
workService.alterTaskStatus1(workId,status,userId); workService.alterTaskStatus1(workId,status,userId);
businessTreeManagement.saveAction(userId,workId,Action.COMMIT_BACK_WORK,new Date(),msg); businessTreeManagement.saveAction(userId,workId,Action.COMMIT_BACK_WORK,new Date(),msg);
logService.saveLog(new Log(null,"撤回任务",new Date(),userId,null));
}else{ }else{
workService.alterTaskStatus(workId,status,userId); workService.alterTaskStatus(workId,status,userId);
businessTreeManagement.saveAction(userId,workId,Action.BACK_WORK,new Date(),msg); businessTreeManagement.saveAction(userId,workId,Action.BACK_WORK,new Date(),msg);
//审核不通过 //审核不通过
logService.saveLog(new Log(null,"审核任务",new Date(),userId,null));
} }
break; break;
case "audit": case "audit":
//执行者提交 //执行者提交
workService.alterTaskStatus(workId, status,userId); workService.alterTaskStatus(workId, status,userId);
businessTreeManagement.saveAction(userId, workId, Action.COMMIT_WORK, new Date(), msg); businessTreeManagement.saveAction(userId, workId, Action.COMMIT_WORK, new Date(), msg);
logService.saveLog(new Log(null,"提交任务",new Date(),userId,null));
break; break;
case "review": case "review":
//审核通过 //审核通过
workService.alterTaskStatus(workId, status,userId); workService.alterTaskStatus(workId, status,userId);
businessTreeManagement.saveAction(userId, workId, Action.FINISH_WORK, new Date(), msg); businessTreeManagement.saveAction(userId, workId, Action.FINISH_WORK, new Date(), msg);
logService.saveLog(new Log(null,"审核任务",new Date(),userId,null));
break; break;
case WorkStatus.FINISHED: case WorkStatus.FINISHED:
workService.alterTaskStatus(workId, status,userId); workService.alterTaskStatus(workId, status,userId);
businessTreeManagement.saveAction(userId, workId, Action.FINISHED_WORK, new Date(), msg); businessTreeManagement.saveAction(userId, workId, Action.FINISHED_WORK, new Date(), msg);
logService.saveLog(new Log(null,"完结任务",new Date(),userId,null));
break; break;
default: default:
log.warn("[job] 修改任务状态传入的参数有误,传入值为:{}", status); log.warn("[job] 修改任务状态传入的参数有误,传入值为:{}", status);
......
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tynotes</artifactId>
<groupId>com.zjty.tynotes</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>notes-log</artifactId>
<dependencies>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-redis</artifactId>
</dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-misc</artifactId>
</dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-search</artifactId>
</dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-sms</artifactId>
<exclusions>
<exclusion>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-pas</artifactId>
<exclusions>
<exclusion>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--<dependency>-->
<!--<groupId>com.zjty.tynotes</groupId>-->
<!--<artifactId>notes-weekly</artifactId>-->
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>com.zjty.tynotes</groupId>-->
<!--<artifactId>notes-log</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--</dependency>-->
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-attendance</artifactId>
<exclusions>
<exclusion>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!-- 关于aop的依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.zjty.tynotes.log;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {
"com.zjty.tynotes.misc",
"com.zjty.tynotes.pas",
"com.zjty.tynotes.log",
"com.zjty.tynotes.search",
"com.zjty.tynotes.redis",
"com.zjty.tynotes.sms"
// "com.zjty.tynotes.weekly"
// ,"com.zjty.tynotes.attendance"
})
public class NotesLogApplication {
public static void main(String[] args) {
SpringApplication.run(NotesLogApplication.class, args);
}
}
package com.zjty.tynotes.log.base.aspect;
import com.zjty.tynotes.log.dao.LogDao;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.base.advise.ContentParse;
import com.zjty.tynotes.pas.dao.PasUserDao;
import com.zjty.tynotes.pas.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Date;
/**
* @Author gwj
* @create 2020/4/23 8:57
*/
@Aspect
@Component
@Slf4j
public class ControllerAspect {
@Autowired
private PasUserDao pasUserDao;
@Autowired
private LogDao logDao;
private final static Logger logger = LoggerFactory.getLogger(ControllerAspect.class);
/**
* 定义切点
*/
@Pointcut("execution(public * com.zjty.tynotes.pas.controller.*.*(..))")
public void privilege1(){}
// @Pointcut("execution(public * com.zjty.tynotes.job.basic.controller.*.*(..))")
// public void privilege2(){}
@Pointcut("execution(public * com.zjty.tynotes.attendance.controller.*.*(..))")
public void privilege3(){}
// @Pointcut("execution(public * com.zjty.tynotes.weekly.subject.controller.*.*(..))")
// public void privilege4(){}
/**
* 日志记录的环绕通知
* @param joinPoint
* @throws Throwable
*/
@Around("privilege1() || privilege3()")
public Object isLogMethod(ProceedingJoinPoint joinPoint) throws Throwable {
try {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
String loginSession = request.getHeader("session");
logger.info("loginSession:{}",loginSession);
//获取访问目标方法
MethodSignature methodSignature = (MethodSignature)joinPoint.getSignature();
Method targetMethod = methodSignature.getMethod();
//得到方法的功能描述,生成日志信息
final Content content = ContentParse.privilegeParse(targetMethod);
//得到方法的访问权限
// final String[] methodAccess = AccessAnnotationParse.privilegeParse(targetMethod);
if(content!=null){
String contentValue = content.value();
User user = null;
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
if (authentication instanceof AnonymousAuthenticationToken) {
return null;
}
if (authentication instanceof UsernamePasswordAuthenticationToken) {
user = (User) authentication.getPrincipal();
}
}
if(authentication!=null){
String username = user.getUsername();
String description = username + "执行" + contentValue;
logger.info(description);
Log log = new Log(null,description,new Date(),null,username);
User byUsername = pasUserDao.findByUsername(username);
if(byUsername!=null){
log.setUserId(byUsername.getId());
}
logDao.save(log);
Object proceed = joinPoint.proceed();
return proceed;
}
}
}catch (Exception e){
e.printStackTrace();
logger.error("aop日志记录出现异常:{}",e.getMessage());
}
return null;
}
}
package com.zjty.tynotes.log.controller;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.log.entity.vo.LogPageRequest;
import com.zjty.tynotes.log.server.LogService;
import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.entity.Authority;
import com.zjty.tynotes.pas.entity.vo.PageRequest;
import com.zjty.tynotes.pas.entity.vo.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import static org.springframework.http.ResponseEntity.ok;
/**
* @Author gwj
* @create 2020/4/23 15:43
*/
@Api(tags = "日志管理模块",protocols = "http")
@RestController
@RequestMapping("/pas/log")
@AutoDocument
public class LogController {
@Autowired
private LogService logService;
@ApiOperation("查询日志")
@PostMapping("/findAllLogs")
public ResponseEntity findAllLogs(@RequestBody LogPageRequest pageRequest){
PageResponse<Log> logPageResponse = logService.findLogs(pageRequest);
return ok(logPageResponse);
}
}
package com.zjty.tynotes.log.dao;
import com.zjty.tynotes.log.entity.Log;
import org.springframework.data.mongodb.repository.MongoRepository;
import java.util.Date;
import java.util.List;
/**
* @Author gwj
* @create 2020/4/23 9:55
*/
public interface LogDao extends MongoRepository<Log,String> {
/**
* 根据日志生成时间查询日志
* @param date
* @return
*/
List<Log> findAllByLogTime(Date date);
/**
* 根据日志生成时间的区间段查询日志
* @param start
* @param end
* @return
*/
List<Log> findAllByLogTimeBetween(Date start,Date end);
}
package com.zjty.tynotes.log.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
/**
* @Author gwj
* @create 2020/4/23 9:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "日志", description = "日志说明")
@Document(collection = "pas_log")
public class Log {
@Id
@ApiModelProperty(value = "id",example = "1")
private String id;
@ApiModelProperty(value = "日志描述",example = "进行登录")
private String description;
@ApiModelProperty(value = "生成日志时间",example = "2020-03-21 09:00:00")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date logTime;
@ApiModelProperty(value = "用户id",example = "123")
private String userId;
@ApiModelProperty(value = "用户名",example = "gwj")
private String userName;
}
package com.zjty.tynotes.log.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author gwj
* @create 2020/4/23 15:56
*/
@ApiModel(value = "日志请求分页类", description = "日志请求分页类")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LogPageRequest {
/**
* 每页显示个数
*/
@ApiModelProperty(value = "每页数据数量",example = "10")
private int pageSize;
/**
* 当前页数
*/
@ApiModelProperty(value = "当前页",example = "1")
private int currentPage;
/**
* 总记录数
*/
@ApiModelProperty(value = "总记录数",example = "10")
private int totalCount;
/**
* 起始时间
*/
@ApiModelProperty(value = "起始时间",example = "2020-04-01 09:00:00")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间",example = "2020-04-01 09:00:00")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
}
package com.zjty.tynotes.log.server;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.log.entity.vo.LogPageRequest;
import com.zjty.tynotes.pas.entity.vo.PageResponse;
/**
* @Author gwj
* @create 2020/4/23 15:00
*/
public interface LogService {
Log saveLog(Log log);
PageResponse<Log> findLogs(LogPageRequest pageRequest);
}
package com.zjty.tynotes.log.server.impl;
import com.zjty.tynotes.log.dao.LogDao;
import com.zjty.tynotes.log.entity.Log;
import com.zjty.tynotes.log.entity.vo.LogPageRequest;
import com.zjty.tynotes.log.server.LogService;
import com.zjty.tynotes.pas.dao.PasUserDao;
import com.zjty.tynotes.pas.entity.User;
import com.zjty.tynotes.pas.entity.vo.PageResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @Author gwj
* @create 2020/4/23 15:01
*/
@Service
public class LogServiceImpl implements LogService {
private final static Logger logger = LoggerFactory.getLogger(LogServiceImpl.class);
@Autowired
private LogDao logDao;
@Autowired
private PasUserDao pasUserDao;
@Override
public Log saveLog(Log log) {
if(log.getUserId()!=null){
String userId = log.getUserId();
Optional<User> op = pasUserDao.findById(userId);
if(op.isPresent()){
User user = op.get();
String username = user.getUsername();
log.setUserName(username);
log.setDescription(username+"执行"+log.getDescription());
Log save = logDao.save(log);
return save;
}
}
logger.error("保存进入log日志失败");
return null;
}
/**
* 分页查找日志
* @param pageRequest
* @return
*/
@Override
public PageResponse<Log> findLogs(LogPageRequest pageRequest) {
PageResponse<Log> pageResponse = new PageResponse();
List<Log> logList = new ArrayList<>();
List<Log> logs = new ArrayList<>();
if(pageRequest.getStartTime()!=null && pageRequest.getEndTime()!=null){
List<Log> logs1 = logDao.findAllByLogTime(pageRequest.getStartTime());
List<Log> logs2 = logDao.findAllByLogTimeBetween(pageRequest.getStartTime(), pageRequest.getEndTime());
List<Log> logs3 = logDao.findAllByLogTime(pageRequest.getEndTime());
if(logs1!=null){
logs.addAll(logs1);
}
if(logs2!=null){
logs.addAll(logs2);
}
if(logs3!=null){
logs.addAll(logs3);
}
}else{
List<Log> all = logDao.findAll();
if(all!=null){
logs = all;
}
}
pageResponse.setPageSize(pageRequest.getPageSize());
pageResponse.setCurrentPage(pageRequest.getCurrentPage());
int currentPage = pageRequest.getCurrentPage();
int pageSize = pageRequest.getPageSize();
int start = (currentPage-1)*pageSize;
int end = start+pageSize;
int totalPage = 0;
if((logs.size()/pageSize)==0){
totalPage = (logs.size())/pageSize;
}else{
totalPage = (logs.size())/pageSize + 1;
}
if(currentPage>=totalPage){
logList = logs.subList(start, logs.size());
pageResponse.setRows(logList);
pageResponse.setTotalCount(logs.size());
}else{
logList = logs.subList(start, end);
pageResponse.setRows(logList);
pageResponse.setTotalCount(logs.size());
}
return pageResponse;
}
}
package com.zjty.tynotes.log;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class NotesLogApplicationTests {
void contextLoads() {
}
}
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> </dependency>
<!--springboot aop 依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--<dependency>--> <!--<dependency>-->
<!--<groupId>com.dingtalk</groupId>--> <!--<groupId>com.dingtalk</groupId>-->
<!--<artifactId>2</artifactId>--> <!--<artifactId>2</artifactId>-->
......
package com.zjty.tynotes.pas.base.advise;
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Content {
//访问的方法描述
String value()default "";
// 0:不记录;1:记录
String flag() default "0";
// 0:操作员;1:管理员;2:安全员;3:审计员
String[] part() default {"0"};
// 是否需要用户登录才能请求该方法,0:不需要登录;1:需要登陆
String access() default "0";
}
package com.zjty.tynotes.pas.base.advise;
import java.lang.reflect.Method;
public class ContentParse {
/***
* 解析权限注解
* @return 返回注解的authorities值
* @throws Exception
*/
public static Content privilegeParse(Method method) throws Exception {
//获取该方法
if(method.isAnnotationPresent(Content.class)){
return method.getAnnotation(Content.class);
}
return null;
}
}
...@@ -69,7 +69,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -69,7 +69,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/pas/user/**", .antMatchers("/pas/user/**",
"/pas/authority/findAuthority", "/pas/authority/findAuthority",
"/pas/role/**","/pas/department").hasAuthority("用户管理") "/pas/role/**","/pas/department").hasAuthority("用户管理")
.antMatchers("/pas/authority").hasAnyAuthority("权限管理") .antMatchers("/pas/authority","/pas/log/findAllLogs").hasAnyAuthority("权限管理")
.antMatchers("/pas/config").hasAnyAuthority("考勤管理") .antMatchers("/pas/config").hasAnyAuthority("考勤管理")
.antMatchers("/pas/role").hasAnyAuthority("角色管理") .antMatchers("/pas/role").hasAnyAuthority("角色管理")
.antMatchers("/pas/department").hasAnyAuthority("部门管理") .antMatchers("/pas/department").hasAnyAuthority("部门管理")
......
package com.zjty.tynotes.pas.controller; package com.zjty.tynotes.pas.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.Authority; import com.zjty.tynotes.pas.entity.Authority;
import com.zjty.tynotes.pas.service.IAuthorityService; import com.zjty.tynotes.pas.service.IAuthorityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -26,12 +27,14 @@ public class AuthorityController { ...@@ -26,12 +27,14 @@ public class AuthorityController {
@Autowired @Autowired
private IAuthorityService iAuthorityService; private IAuthorityService iAuthorityService;
@Content(value = "新增权限")
@ApiOperation("新增权限") @ApiOperation("新增权限")
@PostMapping("/addAuthority") @PostMapping("/addAuthority")
public ResponseEntity addAuthority(@RequestBody Authority authority){ public ResponseEntity addAuthority(@RequestBody Authority authority){
return ok(iAuthorityService.addAuthority(authority)); return ok(iAuthorityService.addAuthority(authority));
} }
@Content(value = "删除权限")
@ApiOperation("删除权限") @ApiOperation("删除权限")
@DeleteMapping("/deleteAuthority/{id}") @DeleteMapping("/deleteAuthority/{id}")
public String deleteAuthority(@PathVariable("id") String id){ public String deleteAuthority(@PathVariable("id") String id){
...@@ -46,6 +49,7 @@ public class AuthorityController { ...@@ -46,6 +49,7 @@ public class AuthorityController {
return "删除失败"; return "删除失败";
} }
@Content(value = "修改权限")
@ApiOperation("修改权限") @ApiOperation("修改权限")
@PutMapping("/updateAuthority") @PutMapping("/updateAuthority")
public String updateAuthority(@RequestBody Authority authority){ public String updateAuthority(@RequestBody Authority authority){
...@@ -60,6 +64,7 @@ public class AuthorityController { ...@@ -60,6 +64,7 @@ public class AuthorityController {
return "修改权限失败"; return "修改权限失败";
} }
@Content(value = "查询所有权限")
@ApiOperation("查询所有权限") @ApiOperation("查询所有权限")
@GetMapping("/findAuthority") @GetMapping("/findAuthority")
public ResponseEntity findAuthority(){ public ResponseEntity findAuthority(){
......
package com.zjty.tynotes.pas.controller; package com.zjty.tynotes.pas.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.Authority; import com.zjty.tynotes.pas.entity.Authority;
import com.zjty.tynotes.pas.entity.Config; import com.zjty.tynotes.pas.entity.Config;
import com.zjty.tynotes.pas.entity.Day; import com.zjty.tynotes.pas.entity.Day;
...@@ -30,6 +31,7 @@ public class ConfigController { ...@@ -30,6 +31,7 @@ public class ConfigController {
@Autowired @Autowired
private ConfigService configService; private ConfigService configService;
@Content(value = "保存基础参数配置")
@ApiOperation("保存基础参数配置") @ApiOperation("保存基础参数配置")
@PostMapping("/addConfig") @PostMapping("/addConfig")
public ResponseEntity addConfig(@RequestBody Config config){ public ResponseEntity addConfig(@RequestBody Config config){
...@@ -49,6 +51,7 @@ public class ConfigController { ...@@ -49,6 +51,7 @@ public class ConfigController {
return ok(configService.findHolidays(holidayRequest)); return ok(configService.findHolidays(holidayRequest));
} }
@Content(value = "批量设置工作日,节假日")
@ApiOperation("批量设置工作日,节假日") @ApiOperation("批量设置工作日,节假日")
@PutMapping("/setHolidays") @PutMapping("/setHolidays")
public ResponseEntity setHolidays(@RequestBody List<Day> days){ public ResponseEntity setHolidays(@RequestBody List<Day> days){
...@@ -67,6 +70,7 @@ public class ConfigController { ...@@ -67,6 +70,7 @@ public class ConfigController {
return ok(configService.findHolidaysByMonth(date)); return ok(configService.findHolidaysByMonth(date));
} }
@Content(value = "清除所有节假日数据")
@ApiOperation("清除所有节假日数据") @ApiOperation("清除所有节假日数据")
@DeleteMapping("/deleteAll") @DeleteMapping("/deleteAll")
public ResponseEntity deleteAll(){return ok(configService.deleteAll());} public ResponseEntity deleteAll(){return ok(configService.deleteAll());}
......
package com.zjty.tynotes.pas.controller; package com.zjty.tynotes.pas.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.Authority; import com.zjty.tynotes.pas.entity.Authority;
import com.zjty.tynotes.pas.entity.Department; import com.zjty.tynotes.pas.entity.Department;
import com.zjty.tynotes.pas.service.IDepartmentService; import com.zjty.tynotes.pas.service.IDepartmentService;
...@@ -28,12 +29,14 @@ public class DepartController { ...@@ -28,12 +29,14 @@ public class DepartController {
@Autowired @Autowired
private IDepartmentService departmentService; private IDepartmentService departmentService;
@ApiOperation(value = "获得所有部门",response = Department.class) @ApiOperation(value = "获得所有部门",response = Department.class)
@GetMapping @GetMapping
public ResponseEntity departments(){ public ResponseEntity departments(){
return ok(departmentService.findAll()); return ok(departmentService.findAll());
} }
@Content(value = "添加部门")
@ApiOperation(value = "添加部门",response = Department.class) @ApiOperation(value = "添加部门",response = Department.class)
@PostMapping @PostMapping
public ResponseEntity addDepartments(@RequestBody @Valid Department department){ public ResponseEntity addDepartments(@RequestBody @Valid Department department){
...@@ -41,6 +44,7 @@ public class DepartController { ...@@ -41,6 +44,7 @@ public class DepartController {
return ok(departmentService.addDepartments(department)); return ok(departmentService.addDepartments(department));
} }
@Content(value = "修改部门")
@ApiOperation(value = "修改部门",response = Department.class) @ApiOperation(value = "修改部门",response = Department.class)
@PutMapping @PutMapping
public ResponseEntity updateDepartments(@RequestBody @Valid Department department){ public ResponseEntity updateDepartments(@RequestBody @Valid Department department){
...@@ -64,6 +68,7 @@ public class DepartController { ...@@ -64,6 +68,7 @@ public class DepartController {
return ok(departmentService.findList()); return ok(departmentService.findList());
} }
@Content(value = "删除部门")
@ApiOperation(value = "删除部门") @ApiOperation(value = "删除部门")
@DeleteMapping("/deleteDepartment/{id}") @DeleteMapping("/deleteDepartment/{id}")
public ResponseEntity deleteDepartment(@PathVariable("id") String id){ public ResponseEntity deleteDepartment(@PathVariable("id") String id){
......
package com.zjty.tynotes.pas.controller; package com.zjty.tynotes.pas.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.Authority; import com.zjty.tynotes.pas.entity.Authority;
import com.zjty.tynotes.pas.entity.Role; import com.zjty.tynotes.pas.entity.Role;
import com.zjty.tynotes.pas.service.IRoleService; import com.zjty.tynotes.pas.service.IRoleService;
...@@ -32,6 +33,7 @@ public class RoleController { ...@@ -32,6 +33,7 @@ public class RoleController {
return ResponseEntity.ok(iRoleService.findAll()); return ResponseEntity.ok(iRoleService.findAll());
} }
@Content(value = "新增角色")
@ApiOperation(value = "新增角色",response = Role.class) @ApiOperation(value = "新增角色",response = Role.class)
@PostMapping @PostMapping
public ResponseEntity addRole(@RequestBody @Valid Role role){ public ResponseEntity addRole(@RequestBody @Valid Role role){
...@@ -45,6 +47,7 @@ public class RoleController { ...@@ -45,6 +47,7 @@ public class RoleController {
// return ResponseEntity.ok(iRoleService.addRole(role)); // return ResponseEntity.ok(iRoleService.addRole(role));
// } // }
@Content(value = "删除角色")
@ApiOperation(value = "删除角色",response = Role.class) @ApiOperation(value = "删除角色",response = Role.class)
@DeleteMapping("/deleteRole/{id}") @DeleteMapping("/deleteRole/{id}")
public String deleteRole(@PathVariable("id") String id){ public String deleteRole(@PathVariable("id") String id){
...@@ -59,6 +62,7 @@ public class RoleController { ...@@ -59,6 +62,7 @@ public class RoleController {
return "删除失败"; return "删除失败";
} }
@Content(value = "修改角色")
@ApiOperation(value = "修改角色",response = Role.class) @ApiOperation(value = "修改角色",response = Role.class)
@PutMapping("/updateRole") @PutMapping("/updateRole")
public String updateRole(@RequestBody Role role){ public String updateRole(@RequestBody Role role){
......
package com.zjty.tynotes.pas.controller; package com.zjty.tynotes.pas.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.User; import com.zjty.tynotes.pas.entity.User;
import com.zjty.tynotes.pas.entity.vo.PageRequest; import com.zjty.tynotes.pas.entity.vo.PageRequest;
import com.zjty.tynotes.pas.service.IUserService; import com.zjty.tynotes.pas.service.IUserService;
...@@ -37,6 +38,7 @@ public class UserController { ...@@ -37,6 +38,7 @@ public class UserController {
@Autowired @Autowired
IUserService iUserService; IUserService iUserService;
@ApiOperation(value = "查询所有用户", response = User.class) @ApiOperation(value = "查询所有用户", response = User.class)
@GetMapping @GetMapping
public ResponseEntity user() { public ResponseEntity user() {
...@@ -52,12 +54,14 @@ public class UserController { ...@@ -52,12 +54,14 @@ public class UserController {
} }
@Content(value = "用户登出")
@ApiOperation(value = "用户登出") @ApiOperation(value = "用户登出")
@GetMapping("/userLogout") @GetMapping("/userLogout")
public void logout() { public void logout() {
logoutUtil.logout(); logoutUtil.logout();
} }
@Content(value = "删除用户")
@ApiOperation(value = "删除用户") @ApiOperation(value = "删除用户")
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public ResponseEntity delete(@PathVariable @NotNull String id) { public ResponseEntity delete(@PathVariable @NotNull String id) {
...@@ -65,6 +69,7 @@ public class UserController { ...@@ -65,6 +69,7 @@ public class UserController {
return ok().build(); return ok().build();
} }
@Content(value = "更新任意用户信息")
@ApiOperation(value = "更新任意用户信息") @ApiOperation(value = "更新任意用户信息")
@PutMapping @PutMapping
public ResponseEntity update(@RequestBody @NotNull User user) { public ResponseEntity update(@RequestBody @NotNull User user) {
...@@ -94,6 +99,7 @@ public class UserController { ...@@ -94,6 +99,7 @@ public class UserController {
// return ok(iUserService.updateUser(userByUsername)); // return ok(iUserService.updateUser(userByUsername));
// } // }
@Content(value = "新增用户")
@ApiOperation(value = "新增用户", response = User.class) @ApiOperation(value = "新增用户", response = User.class)
@PostMapping @PostMapping
public ResponseEntity addUser(@RequestBody @Valid User user) { public ResponseEntity addUser(@RequestBody @Valid User user) {
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>notes-union</artifactId> <artifactId>notes-union</artifactId>
<packaging>jar</packaging> <!--<packaging>jar</packaging>-->
<packaging>war</packaging>
<profiles> <profiles>
<!--模拟环境--> <!--模拟环境-->
<profile> <profile>
...@@ -33,6 +33,29 @@ ...@@ -33,6 +33,29 @@
<dependencies> <dependencies>
<!-- 排除内置的tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 使用自带的tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--打包的时候可以不用包进去,别的设施会提供。事实上该依赖理论上可以参与编译,测试,运行等周期。
相当于compile,但是打包阶段做了exclude操作-->
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>com.zjty.tynotes</groupId> <groupId>com.zjty.tynotes</groupId>
<artifactId>notes-weekly</artifactId> <artifactId>notes-weekly</artifactId>
...@@ -78,6 +101,11 @@ ...@@ -78,6 +101,11 @@
<artifactId>notes-attendance</artifactId> <artifactId>notes-attendance</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
......
package com.zjty.tynotes.union; package com.zjty.tynotes.union;
import javafx.application.Application;
import org.apache.catalina.connector.Connector; import org.apache.catalina.connector.Connector;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
...@@ -23,12 +26,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -23,12 +26,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
"com.zjty.tynotes.redis", "com.zjty.tynotes.redis",
"com.zjty.tynotes.weekly", "com.zjty.tynotes.weekly",
"com.zjty.tynotes.misc", "com.zjty.tynotes.misc",
"com.zjty.tynotes.union" "com.zjty.tynotes.union",
"com.zjty.tynotes.log"
// , "com.zjty.tynotes.attendance" // , "com.zjty.tynotes.attendance"
}) })
@EnableCaching @EnableCaching
@EnableScheduling @EnableScheduling
public class UnionApplication { public class UnionApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(UnionApplication.class);
}
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(UnionApplication.class, args); SpringApplication.run(UnionApplication.class, args);
} }
......
...@@ -12,15 +12,15 @@ server.ssl.keyStoreType=PKCS12 ...@@ -12,15 +12,15 @@ server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias= alias server.ssl.keyAlias= alias
#mongodb configuration #mongodb configuration
spring.data.mongodb.uri=mongodb://192.168.1.246:27017/notes5 spring.data.mongodb.uri=mongodb://localhost:27017/notes5
# servlet configuration # servlet configuration
spring.servlet.multipart.max-file-size=100MB spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=1000MB spring.servlet.multipart.max-request-size=1000MB
spring.redis.host=192.168.1.246 spring.redis.host=localhost
spring.redis.port=6379 spring.redis.port=6379
spring.redis.timeout=5000ms spring.redis.timeout=5000ms
# es configuraiton # es configuraiton
es.ip=192.168.1.246 es.ip=localhost
logging.file=./log/note.log logging.file=./log/note.log
package com.zjty.tynotes.weekly.subject.controller; package com.zjty.tynotes.weekly.subject.controller;
import com.zjty.tynotes.misc.config.AutoDocument; import com.zjty.tynotes.misc.config.AutoDocument;
import com.zjty.tynotes.pas.base.advise.Content;
import com.zjty.tynotes.pas.entity.User; import com.zjty.tynotes.pas.entity.User;
import com.zjty.tynotes.pas.entity.vo.PageRequest; import com.zjty.tynotes.pas.entity.vo.PageRequest;
import com.zjty.tynotes.pas.entity.vo.PageResponse; import com.zjty.tynotes.pas.entity.vo.PageResponse;
...@@ -73,6 +74,7 @@ public class UserManageController { ...@@ -73,6 +74,7 @@ public class UserManageController {
// return ok(userManageService.findUserWork(id,status)); // return ok(userManageService.findUserWork(id,status));
// } // }
@Content(value = "更新当前用户自身信息")
@ApiOperation(value = "更新当前用户自身信息") @ApiOperation(value = "更新当前用户自身信息")
@PutMapping("/updateSelf") @PutMapping("/updateSelf")
public ResponseEntity updateSelf(@RequestBody @NotNull User user){ public ResponseEntity updateSelf(@RequestBody @NotNull User user){
...@@ -86,6 +88,7 @@ public class UserManageController { ...@@ -86,6 +88,7 @@ public class UserManageController {
return ok("更改当前用户信息失败"); return ok("更改当前用户信息失败");
} }
@Content(value = "更新当前用户密码")
@ApiOperation(value = "更新当前用户密码") @ApiOperation(value = "更新当前用户密码")
@PutMapping("/password") @PutMapping("/password")
public ResponseEntity updatePassword(@RequestBody @NotNull User user){ public ResponseEntity updatePassword(@RequestBody @NotNull User user){
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<module>notes-redis</module> <module>notes-redis</module>
<module>notes-weekly</module> <module>notes-weekly</module>
<module>notes-attendance</module> <module>notes-attendance</module>
<module>notes-log</module>
</modules> </modules>
<dependencyManagement> <dependencyManagement>
...@@ -97,6 +98,12 @@ ...@@ -97,6 +98,12 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.zjty.tynotes</groupId>
<artifactId>notes-log</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论