Commit 7b6b43a1 by hzc

增加操作日志

parent 4ed09abf
...@@ -14,10 +14,7 @@ import com.keymobile.indicators.service.SystemAuthService; ...@@ -14,10 +14,7 @@ import com.keymobile.indicators.service.SystemAuthService;
import com.keymobile.indicators.service.dataenter.ExcelTemplateService; import com.keymobile.indicators.service.dataenter.ExcelTemplateService;
import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService; import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService;
import com.keymobile.indicators.service.dataenter.TaskService; import com.keymobile.indicators.service.dataenter.TaskService;
import com.keymobile.indicators.utils.DateUtils; import com.keymobile.indicators.utils.*;
import com.keymobile.indicators.utils.ExcelUtil;
import com.keymobile.indicators.utils.IdWorker;
import com.keymobile.indicators.utils.SystemUserUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -135,7 +132,7 @@ public class DataEnterCtrl { ...@@ -135,7 +132,7 @@ public class DataEnterCtrl {
} }
taskService.updateTaskStatusById(taskId,Constants.APPLY_STATE_DRAFT); taskService.updateTaskStatusById(taskId,Constants.APPLY_STATE_DRAFT);
LogManager.logInfo(Constants.LOG_CONTEXT_API,"获取需要在线填报的数据项(填报任务点击){}","");
return list; return list;
} }
...@@ -153,6 +150,7 @@ public class DataEnterCtrl { ...@@ -153,6 +150,7 @@ public class DataEnterCtrl {
list = taskService.findByPageAndTaskId(taskId, request.getOffset(), pageSize, includeFormula); list = taskService.findByPageAndTaskId(taskId, request.getOffset(), pageSize, includeFormula);
} }
Page<TaskIndValue> pageResult = new PageImpl<>(list, request, total); Page<TaskIndValue> pageResult = new PageImpl<>(list, request, total);
// LogManager.logInfo(Constants.LOG_CONTEXT_API,"获取已填报的数据项(审核清单点任务){}","");
return pageResult; return pageResult;
} }
...@@ -245,6 +243,7 @@ public class DataEnterCtrl { ...@@ -245,6 +243,7 @@ public class DataEnterCtrl {
value.setUpdateTime(now); value.setUpdateTime(now);
} }
taskService.saveTaskValues(values, taskId, null); taskService.saveTaskValues(values, taskId, null);
LogManager.logInfo(Constants.LOG_CONTEXT_API,"填报数据保存,在线编辑{}","");
return Result.genOkResult(); return Result.genOkResult();
} }
...@@ -338,8 +337,10 @@ public class DataEnterCtrl { ...@@ -338,8 +337,10 @@ public class DataEnterCtrl {
} }
taskService.saveTaskValues(taskIndValues, taskId, null); taskService.saveTaskValues(taskIndValues, taskId, null);
//成功 //成功
LogManager.logInfo(Constants.LOG_CONTEXT_API,"填报数据保存,excel导入","");
result= Result.genOkResult(); result= Result.genOkResult();
} catch (Exception e) { } catch (Exception e) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"填报数据保存,excel导入失败{}","");
log.error("数据填报导入出错:taskId=" + taskId , e); log.error("数据填报导入出错:taskId=" + taskId , e);
result = Result.genFailedResult("导入excel出错"); result = Result.genFailedResult("导入excel出错");
} }
...@@ -527,6 +528,7 @@ public class DataEnterCtrl { ...@@ -527,6 +528,7 @@ public class DataEnterCtrl {
} }
} }
} }
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_AUDIT_API,"导出填报数据excel成功,id:{}",taskId);
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
writerBuilder.excelType(ExcelTypeEnum.XLSX).head(headers) writerBuilder.excelType(ExcelTypeEnum.XLSX).head(headers)
.autoCloseStream(false).sheet("数据填报").doWrite(datas); .autoCloseStream(false).sheet("数据填报").doWrite(datas);
...@@ -538,6 +540,7 @@ public class DataEnterCtrl { ...@@ -538,6 +540,7 @@ public class DataEnterCtrl {
Map<String, String> map = new HashMap<>(4); Map<String, String> map = new HashMap<>(4);
map.put("status", "failure"); map.put("status", "failure");
map.put("message", "导出数据失败:" + e.getMessage()); map.put("message", "导出数据失败:" + e.getMessage());
LogManager.logInfo(Constants.LOG_CONTEXT_API,"导出填报数据excel错误,id:{}",taskId);
Gson gson = new Gson(); Gson gson = new Gson();
response.getWriter().write( gson.toJson(map)); response.getWriter().write( gson.toJson(map));
} }
...@@ -601,6 +604,7 @@ public class DataEnterCtrl { ...@@ -601,6 +604,7 @@ public class DataEnterCtrl {
} }
} }
} }
LogManager.logInfo(Constants.LOG_CONTEXT_API,"数据填报拉取数据,id:{}",taskId);
return values; return values;
} }
} }
...@@ -41,6 +41,7 @@ public class DriveIndCalResultCtrl { ...@@ -41,6 +41,7 @@ public class DriveIndCalResultCtrl {
@PostMapping(value = "/batchSaveOrUpdate") @PostMapping(value = "/batchSaveOrUpdate")
public void batchSaveOrUpdate(@RequestBody List<DriveIndCalResultDef> calResults) { public void batchSaveOrUpdate(@RequestBody List<DriveIndCalResultDef> calResults) {
driveIndCalResultService.batchSaveOrUpdate(calResults); driveIndCalResultService.batchSaveOrUpdate(calResults);
LogManager.logInfo(Constants.LOG_INDICATOR_UNIT_CAL_API,"对标结果批量新增,修改{}","");
} }
@ApiOperation(value = "对标单元综合计算(isTest: 0试运行 1正式运行)", notes = "对标单元综合计算") @ApiOperation(value = "对标单元综合计算(isTest: 0试运行 1正式运行)", notes = "对标单元综合计算")
...@@ -85,6 +86,7 @@ public class DriveIndCalResultCtrl { ...@@ -85,6 +86,7 @@ public class DriveIndCalResultCtrl {
@PostMapping(value = "/findByCompareIdAndDate") @PostMapping(value = "/findByCompareIdAndDate")
public List<DriveIndCalResultDef> findByCompareIdAndDate(@RequestParam String compareId, public List<DriveIndCalResultDef> findByCompareIdAndDate(@RequestParam String compareId,
@RequestParam Integer date){ @RequestParam Integer date){
LogManager.logInfo(Constants.LOG_INDICATOR_UNIT_CAL_API,"根据对标单元id和年份获取对标指标结果{}","");
return driveIndCalResultService.findByCompareIdAndDate(compareId, date); return driveIndCalResultService.findByCompareIdAndDate(compareId, date);
} }
...@@ -93,6 +95,7 @@ public class DriveIndCalResultCtrl { ...@@ -93,6 +95,7 @@ public class DriveIndCalResultCtrl {
public void deleteCompareUnitData(@RequestParam List<String> compareIds, public void deleteCompareUnitData(@RequestParam List<String> compareIds,
@RequestParam Integer currentDate,@RequestParam Integer sameDate, @RequestParam Integer currentDate,@RequestParam Integer sameDate,
@RequestParam String code) { @RequestParam String code) {
LogManager.logInfo(Constants.LOG_INDICATOR_UNIT_CAL_API,"根据对标单元id和年份删除相关数据{}","");
driveIndCalResultService.deleteCompareUnitData(compareIds, currentDate, sameDate, code,"1"); driveIndCalResultService.deleteCompareUnitData(compareIds, currentDate, sameDate, code,"1");
} }
......
...@@ -19,6 +19,7 @@ import com.keymobile.indicators.service.dataenter.ExcelTemplateService; ...@@ -19,6 +19,7 @@ import com.keymobile.indicators.service.dataenter.ExcelTemplateService;
import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService; import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService;
import com.keymobile.indicators.service.dataenter.TaskService; import com.keymobile.indicators.service.dataenter.TaskService;
import com.keymobile.indicators.utils.DateUtils; import com.keymobile.indicators.utils.DateUtils;
import com.keymobile.indicators.utils.LogManager;
import com.keymobile.indicators.utils.SystemUserUtil; import com.keymobile.indicators.utils.SystemUserUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -56,6 +57,7 @@ public class ExcelTempCtrl { ...@@ -56,6 +57,7 @@ public class ExcelTempCtrl {
public List<TaskIndicator> findTaskDataInds(@ApiParam("任务id") public List<TaskIndicator> findTaskDataInds(@ApiParam("任务id")
@RequestParam(value = "taskId") String taskId @RequestParam(value = "taskId") String taskId
) { ) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据任务id获取需要填报的数据项,id:{}",taskId);
return taskService.findTaskInds(taskId, true); return taskService.findTaskInds(taskId, true);
} }
...@@ -116,7 +118,7 @@ public class ExcelTempCtrl { ...@@ -116,7 +118,7 @@ public class ExcelTempCtrl {
break; break;
} }
} }
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据任务id获取需要填报的单位,id:{}",taskId);
return list; return list;
} }
...@@ -125,12 +127,14 @@ public class ExcelTempCtrl { ...@@ -125,12 +127,14 @@ public class ExcelTempCtrl {
@GetMapping("findByTaskRule") @GetMapping("findByTaskRule")
public List<ExcelTemplate> findByTaskRule(@ApiParam(name = "ruleId", required = false) @RequestParam("ruleId")Integer ruleId, public List<ExcelTemplate> findByTaskRule(@ApiParam(name = "ruleId", required = false) @RequestParam("ruleId")Integer ruleId,
@ApiParam(name = "taskId", required = false) @RequestParam("taskId")String taskId) { @ApiParam(name = "taskId", required = false) @RequestParam("taskId")String taskId) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据规则id任务id获取excel模板,id:{}",taskId);
return excelTemplateService.findByRuleTask(ruleId, taskId); return excelTemplateService.findByRuleTask(ruleId, taskId);
} }
@ApiOperation("根据任务id获取excel模板") @ApiOperation("根据任务id获取excel模板")
@GetMapping("findByTaskId") @GetMapping("findByTaskId")
public ExcelTemplate findByTaskId(@ApiParam(name = "taskId") @RequestParam("taskId")String taskId) { public ExcelTemplate findByTaskId(@ApiParam(name = "taskId") @RequestParam("taskId")String taskId) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据任务id获取excel模板,id:{}",taskId);
return excelTemplateService.getByTaskId(taskId); return excelTemplateService.getByTaskId(taskId);
} }
...@@ -139,6 +143,7 @@ public class ExcelTempCtrl { ...@@ -139,6 +143,7 @@ public class ExcelTempCtrl {
public Result refTempalteToTaskId(@ApiParam(name = "模板id") @RequestParam("templateId")Integer templateId, public Result refTempalteToTaskId(@ApiParam(name = "模板id") @RequestParam("templateId")Integer templateId,
@ApiParam(name = "任务id") @RequestParam("taskId")String taskId) { @ApiParam(name = "任务id") @RequestParam("taskId")String taskId) {
excelTemplateService.createTemplateFromOld(templateId, taskId, SystemUserUtil.getCurrentUserId()); excelTemplateService.createTemplateFromOld(templateId, taskId, SystemUserUtil.getCurrentUserId());
LogManager.logInfo(Constants.LOG_CONTEXT_API,"关联任务到现有的模板,id:{}",taskId);
return Result.genOkResult(); return Result.genOkResult();
} }
...@@ -162,12 +167,14 @@ public class ExcelTempCtrl { ...@@ -162,12 +167,14 @@ public class ExcelTempCtrl {
} else { } else {
excelTemplateService.update(template); excelTemplateService.update(template);
} }
LogManager.logInfo(Constants.LOG_CONTEXT_API,"保存excel模板{}","");
return Result.genOkResult(); return Result.genOkResult();
} }
@ApiOperation("根据id获取excel模板") @ApiOperation("根据id获取excel模板")
@GetMapping("getById") @GetMapping("getById")
public ExcelTemplate getById(@RequestParam("id")Integer id) { public ExcelTemplate getById(@RequestParam("id")Integer id) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据id获取excel模板:{}",id);
return excelTemplateService.getById(id); return excelTemplateService.getById(id);
} }
...@@ -175,6 +182,7 @@ public class ExcelTempCtrl { ...@@ -175,6 +182,7 @@ public class ExcelTempCtrl {
@GetMapping("deleteById") @GetMapping("deleteById")
public Result deleteById(@RequestParam("id")Integer id) { public Result deleteById(@RequestParam("id")Integer id) {
excelTemplateService.delete(id); excelTemplateService.delete(id);
LogManager.logInfo(Constants.LOG_CONTEXT_API,"删除excel模板,id:{}",id);
return Result.genOkResult(); return Result.genOkResult();
} }
...@@ -266,6 +274,7 @@ public class ExcelTempCtrl { ...@@ -266,6 +274,7 @@ public class ExcelTempCtrl {
// .autoCloseStream(false).sheet(0,"数据填报").doWrite(datas); // .autoCloseStream(false).sheet(0,"数据填报").doWrite(datas);
WriteSheet one = EasyExcel.writerSheet(0, "数据填报").head(headers).build(); WriteSheet one = EasyExcel.writerSheet(0, "数据填报").head(headers).build();
LogManager.logInfo(Constants.LOG_CONTEXT_API,"根据id导出excel模板,id:{}",id);
// Map<String,List<List<String>>> towDataMap = getTwoData(template); // Map<String,List<List<String>>> towDataMap = getTwoData(template);
// List<List<String>> headers2 = towDataMap.get("headers"); // List<List<String>> headers2 = towDataMap.get("headers");
...@@ -281,6 +290,7 @@ public class ExcelTempCtrl { ...@@ -281,6 +290,7 @@ public class ExcelTempCtrl {
Map<String, String> map = new HashMap<>(4); Map<String, String> map = new HashMap<>(4);
map.put("status", "failure"); map.put("status", "failure");
map.put("message", "导出模板失败"); map.put("message", "导出模板失败");
LogManager.logInfo(Constants.LOG_CONTEXT_API,"导出模板失败,id:{}",id);
Gson gson = new Gson(); Gson gson = new Gson();
response.getWriter().write( gson.toJson(map)); response.getWriter().write( gson.toJson(map));
} }
...@@ -290,6 +300,7 @@ public class ExcelTempCtrl { ...@@ -290,6 +300,7 @@ public class ExcelTempCtrl {
@GetMapping("getOldTemp") @GetMapping("getOldTemp")
public List<ExcelTemplate> getOldTemp(@RequestParam("ruleLevel") String ruleLevel){ public List<ExcelTemplate> getOldTemp(@RequestParam("ruleLevel") String ruleLevel){
String userId = SystemUserUtil.getCurrentUserId(); String userId = SystemUserUtil.getCurrentUserId();
LogManager.logInfo(Constants.LOG_CONTEXT_API,"获取历史模板,任务级别:{}",ruleLevel);
return excelTemplateService.getOldTemp(ruleLevel,userId); return excelTemplateService.getOldTemp(ruleLevel,userId);
} }
private Map<String, List<List<String>>> getTwoData(ExcelTemplate template) { private Map<String, List<List<String>>> getTwoData(ExcelTemplate template) {
......
...@@ -70,6 +70,7 @@ public class IndCatalogCtrl { ...@@ -70,6 +70,7 @@ public class IndCatalogCtrl {
@PostMapping(value = "/getBaseIndCatalog") @PostMapping(value = "/getBaseIndCatalog")
public List<IndCatalog> getBaseIndCatalog(@RequestParam(required=false) Integer parentId, public List<IndCatalog> getBaseIndCatalog(@RequestParam(required=false) Integer parentId,
@RequestParam(required = false) List<String> codes){ @RequestParam(required = false) List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"获取基础指标目录{}","");
return indCatalogService.getCatalog(parentId, codes); return indCatalogService.getCatalog(parentId, codes);
} }
/** /**
...@@ -81,6 +82,7 @@ public class IndCatalogCtrl { ...@@ -81,6 +82,7 @@ public class IndCatalogCtrl {
@PostMapping(value = "/getBaseIndCatalogByKeyword") @PostMapping(value = "/getBaseIndCatalogByKeyword")
public List<IndCatalog> getBaseIndCatalogByKeyword(@RequestParam(required=false) String keyword, public List<IndCatalog> getBaseIndCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam(required = false) List<String> codes){ @RequestParam(required = false) List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"根据关键字搜索获取基础指标目录关键字:{}",keyword);
return indCatalogService.getCatalogByKeyword(keyword,codes); return indCatalogService.getCatalogByKeyword(keyword,codes);
} }
/** /**
...@@ -138,6 +140,7 @@ public class IndCatalogCtrl { ...@@ -138,6 +140,7 @@ public class IndCatalogCtrl {
@PostMapping(value = "/getDriveIndCatalog") @PostMapping(value = "/getDriveIndCatalog")
public List<DriveIndCatalog> getDriveIndCatalog(@RequestParam(required=false) Integer parentId, public List<DriveIndCatalog> getDriveIndCatalog(@RequestParam(required=false) Integer parentId,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_DRIVE_INDI_API,"获取考核指标目录{}","");
return driveIndCatalogService.getCatalog(parentId, codes); return driveIndCatalogService.getCatalog(parentId, codes);
} }
...@@ -145,6 +148,8 @@ public class IndCatalogCtrl { ...@@ -145,6 +148,8 @@ public class IndCatalogCtrl {
@PostMapping(value = "/getDriveIndCatalogByKeyword") @PostMapping(value = "/getDriveIndCatalogByKeyword")
public List<DriveIndCatalog> getDriveIndCatalogByKeyword(@RequestParam(required=false) String keyword, public List<DriveIndCatalog> getDriveIndCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_DRIVE_INDI_API,"根据关键字搜索获取指标目录,关键字:{}",keyword);
return driveIndCatalogService.getCatalogByKeyword(keyword,codes); return driveIndCatalogService.getCatalogByKeyword(keyword,codes);
} }
......
...@@ -69,6 +69,7 @@ public class IndScorecardCtrl { ...@@ -69,6 +69,7 @@ public class IndScorecardCtrl {
@PostMapping(value = "/getCatalog") @PostMapping(value = "/getCatalog")
public List<ScorecardCatalog> getCatalog(@RequestParam(required=false) Integer parentId, public List<ScorecardCatalog> getCatalog(@RequestParam(required=false) Integer parentId,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_SCORECARD_API,"获取评分卡目录,{}","");
return scorecardCatalogService.getCatalog(parentId, codes); return scorecardCatalogService.getCatalog(parentId, codes);
} }
...@@ -79,6 +80,7 @@ public class IndScorecardCtrl { ...@@ -79,6 +80,7 @@ public class IndScorecardCtrl {
if(StringUtils.isBlank(keyword)) { if(StringUtils.isBlank(keyword)) {
return new ArrayList<>(); return new ArrayList<>();
} }
LogManager.logInfo(Constants.LOG_INDICATOR_SCORECARD_API,"根据关键字查询评分卡目录,关键字:{}",keyword);
return scorecardCatalogService.getCatalogByKeyword(keyword, codes); return scorecardCatalogService.getCatalogByKeyword(keyword, codes);
} }
...@@ -126,12 +128,14 @@ public class IndScorecardCtrl { ...@@ -126,12 +128,14 @@ public class IndScorecardCtrl {
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(value = "page", required = false, defaultValue = "0") int page, @RequestParam(value = "page", required = false, defaultValue = "0") int page,
@RequestParam(value = "rows", required = false, defaultValue = "10") int rows){ @RequestParam(value = "rows", required = false, defaultValue = "10") int rows){
LogManager.logInfo(Constants.LOG_INDICATOR_SCORECARD_API,"根据评分卡目录,关键字获取评分卡,目录id:{},关键字:{}",catalogId,keyword);
return indScorecardService.getByCatalogId(catalogId,keyword,page,rows); return indScorecardService.getByCatalogId(catalogId,keyword,page,rows);
} }
@ApiOperation(value = "根据id获取评分卡", notes = "根据id获取评分卡") @ApiOperation(value = "根据id获取评分卡", notes = "根据id获取评分卡")
@PostMapping(value = "/findById") @PostMapping(value = "/findById")
public IndScorecard findById(@RequestParam Integer id) { public IndScorecard findById(@RequestParam Integer id) {
LogManager.logInfo(Constants.LOG_INDICATOR_SCORECARD_API,"根据id获取评分卡id:{}",id);
return indScorecardService.findById(id); return indScorecardService.findById(id);
} }
......
...@@ -35,6 +35,7 @@ public class IndicatorsDefAuditCtrl { ...@@ -35,6 +35,7 @@ public class IndicatorsDefAuditCtrl {
@ApiOperation(value = "保存申请", notes = "保存申请") @ApiOperation(value = "保存申请", notes = "保存申请")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(@RequestBody BaseIndDefAudit baseIndDefAudit){ public Result add(@RequestBody BaseIndDefAudit baseIndDefAudit){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"保存数据项申请{}","");
return indicatorsDefAuditService.addAplay(baseIndDefAudit); return indicatorsDefAuditService.addAplay(baseIndDefAudit);
} }
...@@ -49,16 +50,19 @@ public class IndicatorsDefAuditCtrl { ...@@ -49,16 +50,19 @@ public class IndicatorsDefAuditCtrl {
if(count>0){ if(count>0){
baseIndDefAudits = indicatorsDefAuditService.findPageData(baseIndDefAuditParams); baseIndDefAudits = indicatorsDefAuditService.findPageData(baseIndDefAuditParams);
} }
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"按条件查询申请数据项记录{}","");
return new PageImpl<>(baseIndDefAudits,request,count); return new PageImpl<>(baseIndDefAudits,request,count);
} }
@ApiOperation(value="修改数据") @ApiOperation(value="修改数据")
@PostMapping("/update") @PostMapping("/update")
public Result update(@RequestBody BaseIndDefAudit baseIndDefAudit){ public Result update(@RequestBody BaseIndDefAudit baseIndDefAudit){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"修改申请数据项数据{}","");
return indicatorsDefAuditService.updateData(baseIndDefAudit); return indicatorsDefAuditService.updateData(baseIndDefAudit);
} }
@ApiOperation(value="审核数据") @ApiOperation(value="审核数据")
@GetMapping("/audit") @GetMapping("/audit")
public Result auditData(@RequestParam String indId,@RequestParam Integer status,@RequestParam String msg){ public Result auditData(@RequestParam String indId,@RequestParam Integer status,@RequestParam String msg){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"审核申请数据项数据,id:{}",indId);
return indicatorsDefAuditService.auditData(indId,status,msg); return indicatorsDefAuditService.auditData(indId,status,msg);
} }
@ApiOperation(value = "获取待审核数") @ApiOperation(value = "获取待审核数")
...@@ -69,12 +73,14 @@ public class IndicatorsDefAuditCtrl { ...@@ -69,12 +73,14 @@ public class IndicatorsDefAuditCtrl {
@ApiOperation(value="通过id删除") @ApiOperation(value="通过id删除")
@GetMapping("/delete") @GetMapping("/delete")
public Result delete(@RequestParam String indId){ public Result delete(@RequestParam String indId){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"通过id删除申请数据项数据,id:{}",indId);
return indicatorsDefAuditService.deleteById(indId); return indicatorsDefAuditService.deleteById(indId);
} }
@ApiOperation(value = "获取审核意见") @ApiOperation(value = "获取审核意见")
@GetMapping("/findAuditRecord") @GetMapping("/findAuditRecord")
public List<BaseIndDefRecord> findAuditRecord(@RequestParam String indId){ public List<BaseIndDefRecord> findAuditRecord(@RequestParam String indId){
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"获取数据项数据审核意见,id:{}",indId);
return indicatorsDefAuditService.findAuditRecord(indId); return indicatorsDefAuditService.findAuditRecord(indId);
} }
......
...@@ -47,6 +47,7 @@ public class IndicatorsDefCtrl { ...@@ -47,6 +47,7 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "根据基础指标id获取基础指标版本信息", notes = "根据基础指标id获取基础指标版本信息") @ApiOperation(value = "根据基础指标id获取基础指标版本信息", notes = "根据基础指标id获取基础指标版本信息")
@PostMapping(value = "/getBaseIndDefVersions") @PostMapping(value = "/getBaseIndDefVersions")
public List<BaseIndDefVersionData> getBaseIndDefVersions(@RequestParam String indId){ public List<BaseIndDefVersionData> getBaseIndDefVersions(@RequestParam String indId){
LogManager.logInfo(Constants.LOG_INDICATOR_DRIVE_INDI_API,"根据基础指标id获取基础指标版本信息,indId:{}",indId);
return baseIndDefVersionService.getVersionDataByIndId(indId); return baseIndDefVersionService.getVersionDataByIndId(indId);
} }
...@@ -96,12 +97,14 @@ public class IndicatorsDefCtrl { ...@@ -96,12 +97,14 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "根据id查询基础指标详情", notes = "根据id查询基础指标详情") @ApiOperation(value = "根据id查询基础指标详情", notes = "根据id查询基础指标详情")
@PostMapping(value = "/getBaseIndById") @PostMapping(value = "/getBaseIndById")
public BaseIndDef getBaseIndById(@RequestParam String indId) throws Exception{ public BaseIndDef getBaseIndById(@RequestParam String indId) throws Exception{
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"根据id查询基础指标详情,id:{}",indId);
return baseIndDefService.getById(indId); return baseIndDefService.getById(indId);
} }
@ApiOperation(value = "根据id List查询基础指标详情List", notes = "根据id List查询基础指标详情List") @ApiOperation(value = "根据id List查询基础指标详情List", notes = "根据id List查询基础指标详情List")
@PostMapping(value = "/getBaseIndByIdList") @PostMapping(value = "/getBaseIndByIdList")
public List<BaseIndDef> getBaseIndByIdList(@RequestParam List<String> indIds) throws Exception{ public List<BaseIndDef> getBaseIndByIdList(@RequestParam List<String> indIds) throws Exception{
return baseIndDefService.getByIdList(indIds); return baseIndDefService.getByIdList(indIds);
} }
...@@ -110,6 +113,7 @@ public class IndicatorsDefCtrl { ...@@ -110,6 +113,7 @@ public class IndicatorsDefCtrl {
public Map<String,Object> getByPageAndKeyword(@RequestParam Integer catalogId, public Map<String,Object> getByPageAndKeyword(@RequestParam Integer catalogId,
@RequestParam(required=false) String keyword, @RequestParam(required=false) String keyword,
@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{ @RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,"根据关键字查询基础指标,关键字:{}",keyword);
return baseIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows); return baseIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows);
} }
...@@ -185,6 +189,7 @@ public class IndicatorsDefCtrl { ...@@ -185,6 +189,7 @@ public class IndicatorsDefCtrl {
public Map<String,Object> getDriveByPageAndKeyword(@RequestParam Integer catalogId, public Map<String,Object> getDriveByPageAndKeyword(@RequestParam Integer catalogId,
@RequestParam(required=false) String keyword, @RequestParam(required=false) String keyword,
@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{ @RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{
LogManager.logInfo(Constants.LOG_INDICATOR_DRIVE_INDI_API,"根据关键字查询考核指标{}","");
return driveIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows); return driveIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows);
} }
......
package com.keymobile.indicators.api.hytobacco; package com.keymobile.indicators.api.hytobacco;
import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.dataenter.TaskIndValue; import com.keymobile.indicators.model.entity.dataenter.TaskIndValue;
import com.keymobile.indicators.model.entity.indicators.LogQuery; import com.keymobile.indicators.model.entity.indicators.LogQuery;
import com.keymobile.indicators.model.entity.indicators.LogStatistics; import com.keymobile.indicators.model.entity.indicators.LogStatistics;
import com.keymobile.indicators.model.entity.indicators.LoggingEvent; import com.keymobile.indicators.model.entity.indicators.LoggingEvent;
import com.keymobile.indicators.service.LoggingEventService; import com.keymobile.indicators.service.LoggingEventService;
import com.keymobile.indicators.utils.LogManager;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -59,6 +61,7 @@ public class LoggingEventCtrl { ...@@ -59,6 +61,7 @@ public class LoggingEventCtrl {
list = loggingEventService.findVisitMsg(logQuery); list = loggingEventService.findVisitMsg(logQuery);
} }
Page<LoggingEvent> pageResult = new PageImpl<>(list, request, total); Page<LoggingEvent> pageResult = new PageImpl<>(list, request, total);
LogManager.logInfo(Constants.LOG_INDICATOR_LOG,"查看操作日志页面{}","");
return pageResult; return pageResult;
} }
} }
...@@ -69,6 +69,7 @@ public class ObjScoreRuleCtrl { ...@@ -69,6 +69,7 @@ public class ObjScoreRuleCtrl {
@PostMapping(value = "/getCatalog") @PostMapping(value = "/getCatalog")
public List<ScoreRuleCatalog> getCatalog(@RequestParam(required=false) Integer parentId, public List<ScoreRuleCatalog> getCatalog(@RequestParam(required=false) Integer parentId,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_OBJ_SCORERULE_API,"获取单位规则目录{}","");
return scoreRuleCatalogService.getCatalog(parentId, codes); return scoreRuleCatalogService.getCatalog(parentId, codes);
} }
...@@ -79,12 +80,14 @@ public class ObjScoreRuleCtrl { ...@@ -79,12 +80,14 @@ public class ObjScoreRuleCtrl {
if(StringUtils.isBlank(keyword)) { if(StringUtils.isBlank(keyword)) {
return new ArrayList<>(); return new ArrayList<>();
} }
LogManager.logInfo(Constants.LOG_INDICATOR_OBJ_SCORERULE_API,"根据关键字搜索单位规则目录{}","");
return scoreRuleCatalogService.getCatalogByKeyword(keyword, codes); return scoreRuleCatalogService.getCatalogByKeyword(keyword, codes);
} }
@ApiOperation(value = "根据idList获取单位规则目录", notes = "根据idList获取单位规则目录") @ApiOperation(value = "根据idList获取单位规则目录", notes = "根据idList获取单位规则目录")
@PostMapping(value = "/getByCatalogIdList") @PostMapping(value = "/getByCatalogIdList")
public List<ScoreRuleCatalog> getByCatalogIdList(@RequestParam List<Integer> catalogIds){ public List<ScoreRuleCatalog> getByCatalogIdList(@RequestParam List<Integer> catalogIds){
return scoreRuleCatalogService.getByCatalogIdList(catalogIds); return scoreRuleCatalogService.getByCatalogIdList(catalogIds);
} }
...@@ -120,12 +123,14 @@ public class ObjScoreRuleCtrl { ...@@ -120,12 +123,14 @@ public class ObjScoreRuleCtrl {
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(value = "page", required = false, defaultValue = "0") int page, @RequestParam(value = "page", required = false, defaultValue = "0") int page,
@RequestParam(value = "rows", required = false, defaultValue = "10") int rows){ @RequestParam(value = "rows", required = false, defaultValue = "10") int rows){
LogManager.logInfo(Constants.LOG_INDICATOR_OBJ_SCORERULE_API,"根据单位评分规则目录,关键字获取单位评分规则:目录id:{},关键字:{}",catalogId,keyword);
return scoreRuleService.getByCatalogId(catalogId,keyword,page,rows); return scoreRuleService.getByCatalogId(catalogId,keyword,page,rows);
} }
@ApiOperation(value = "根据id获取单位评分规则", notes = "根据id获取单位评分规则") @ApiOperation(value = "根据id获取单位评分规则", notes = "根据id获取单位评分规则")
@PostMapping(value = "/findById") @PostMapping(value = "/findById")
public ScoreRule findById(@RequestParam Integer id) { public ScoreRule findById(@RequestParam Integer id) {
LogManager.logInfo(Constants.LOG_INDICATOR_OBJ_SCORERULE_API,"根据id获取单位评分规则,id={}",id);
return scoreRuleService.getById(id); return scoreRuleService.getById(id);
} }
......
...@@ -70,6 +70,7 @@ public class ShortboardRuleCtrl { ...@@ -70,6 +70,7 @@ public class ShortboardRuleCtrl {
@PostMapping(value = "/getCatalog") @PostMapping(value = "/getCatalog")
public List<ShortboardCatalog> getCatalog(@RequestParam(required=false) Integer parentId, public List<ShortboardCatalog> getCatalog(@RequestParam(required=false) Integer parentId,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RULE_API,"获取短板筛选规则目录{}","");
return shortboardCatalogService.getCatalog(parentId, codes); return shortboardCatalogService.getCatalog(parentId, codes);
} }
...@@ -80,6 +81,7 @@ public class ShortboardRuleCtrl { ...@@ -80,6 +81,7 @@ public class ShortboardRuleCtrl {
if(StringUtils.isBlank(keyword)) { if(StringUtils.isBlank(keyword)) {
return new ArrayList<>(); return new ArrayList<>();
} }
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RULE_API,"根据关键字搜索短板筛选规则目录,关键字:{}",keyword);
return shortboardCatalogService.getCatalogByKeyword(keyword, codes); return shortboardCatalogService.getCatalogByKeyword(keyword, codes);
} }
...@@ -121,12 +123,14 @@ public class ShortboardRuleCtrl { ...@@ -121,12 +123,14 @@ public class ShortboardRuleCtrl {
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(value = "page", required = false, defaultValue = "0") int page, @RequestParam(value = "page", required = false, defaultValue = "0") int page,
@RequestParam(value = "rows", required = false, defaultValue = "10") int rows){ @RequestParam(value = "rows", required = false, defaultValue = "10") int rows){
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RULE_API,"根据短板筛选规则目录,关键字获取短板筛选规则,目录:{},关键字:{}",catalogId,keyword);
return shortboardRuleService.getByCatalogId(catalogId,keyword,page,rows); return shortboardRuleService.getByCatalogId(catalogId,keyword,page,rows);
} }
@ApiOperation(value = "根据id获取短板筛选规则", notes = "根据id获取短板筛选规则") @ApiOperation(value = "根据id获取短板筛选规则", notes = "根据id获取短板筛选规则")
@PostMapping(value = "/findById") @PostMapping(value = "/findById")
public ShortboardRule findById(@RequestParam Integer id) { public ShortboardRule findById(@RequestParam Integer id) {
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RULE_API,"根据id获取短板筛选规则,id:{}",id);
return shortboardRuleService.getById(id); return shortboardRuleService.getById(id);
} }
......
...@@ -34,6 +34,7 @@ public class ShortboardTaskCtrl { ...@@ -34,6 +34,7 @@ public class ShortboardTaskCtrl {
@ApiOperation(value = "下发短板", notes = "下发短板") @ApiOperation(value = "下发短板", notes = "下发短板")
@PostMapping("assign") @PostMapping("assign")
public Result assignShortboard(@RequestBody ShortBoardTask shortBoardTask){ public Result assignShortboard(@RequestBody ShortBoardTask shortBoardTask){
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RECORD_API,"下发短板,短板名称{}",shortBoardTask.getDriveName());
return shortboardTaskService.assignShortboard(shortBoardTask); return shortboardTaskService.assignShortboard(shortBoardTask);
} }
...@@ -53,11 +54,11 @@ public class ShortboardTaskCtrl { ...@@ -53,11 +54,11 @@ public class ShortboardTaskCtrl {
if(count>0){ if(count>0){
lists= shortboardTaskService.selectPageByParam(shortboardParam); lists= shortboardTaskService.selectPageByParam(shortboardParam);
} }
// String message = SystemUserUtil.getCurrentUser()+"查找了我的检查改善措施 "; if(shortboardParam.getStatusArr()!=null&&shortboardParam.getStatusArr().length==2){
// if(shortboardParam.getStatusArr().length==2){ LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,"查找了我的短板任务清单{}","");
// message = SystemUserUtil.getCurrentUser()+"查找了我的短板任务清单或者检查改善措施 "; }else if(shortboardParam.getStatusArr()!=null&&shortboardParam.getStatusArr().length==2){
// } LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_AUDIT_API,"查找了我的检查改善措施{}","");
// LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,message); }
return new PageImpl<>(lists,request,count); return new PageImpl<>(lists,request,count);
} }
...@@ -67,6 +68,23 @@ public class ShortboardTaskCtrl { ...@@ -67,6 +68,23 @@ public class ShortboardTaskCtrl {
@ApiParam("状态值")@RequestParam("status") Integer status, @ApiParam("状态值")@RequestParam("status") Integer status,
@ApiParam("意见")@RequestParam( value = "description",required = false) String description){ @ApiParam("意见")@RequestParam( value = "description",required = false) String description){
String message="修改短板id:{}状态为{},审核意见为:{}";
String statusStr="";
if(status==1){
statusStr="短板清单";
}else if(status==2) {
statusStr="待改善";
}else if(status==3) {
statusStr="待改善";
} else if(status==3) {
statusStr="以改善";
}else if(status==4) {
statusStr="加入白名单";
}else if(status==5) {
statusStr="不合格";
}
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_AUDIT_API,message,taskId,statusStr,description);
return shortboardTaskService.updateTaskStatus(taskId,status,description); return shortboardTaskService.updateTaskStatus(taskId,status,description);
} }
@ApiOperation(value = "获取短板状态分析数据", notes = "获取短板状态分析数据") @ApiOperation(value = "获取短板状态分析数据", notes = "获取短板状态分析数据")
...@@ -101,6 +119,7 @@ public class ShortboardTaskCtrl { ...@@ -101,6 +119,7 @@ public class ShortboardTaskCtrl {
@ApiOperation(value = "查询短板检查记录", notes = "查询短板检查记录") @ApiOperation(value = "查询短板检查记录", notes = "查询短板检查记录")
@GetMapping("findAuditRecord") @GetMapping("findAuditRecord")
public List<ShortBoardAuditRecord> findAuditRecord(@RequestParam("taskId")Integer taskId){ public List<ShortBoardAuditRecord> findAuditRecord(@RequestParam("taskId")Integer taskId){
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RESULT_API,"查询短板结果汇总记录{}","");
return shortboardTaskService.findAuditRecord(taskId); return shortboardTaskService.findAuditRecord(taskId);
} }
} }
...@@ -46,6 +46,7 @@ public class ShortboardTaskValCtrl { ...@@ -46,6 +46,7 @@ public class ShortboardTaskValCtrl {
@ApiOperation(value = "查找任务清单填报值", notes = "通过id查找任务清单填报值") @ApiOperation(value = "查找任务清单填报值", notes = "通过id查找任务清单填报值")
@GetMapping("findById") @GetMapping("findById")
public ShortBoardTaskVal findById(@RequestParam Integer shortBoardTaskId){ public ShortBoardTaskVal findById(@RequestParam Integer shortBoardTaskId){
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,"查找任务清单填报值{}","");
return shortboardTaskService.selectShortBoardTaskValByTaskIdId(shortBoardTaskId); return shortboardTaskService.selectShortBoardTaskValByTaskIdId(shortBoardTaskId);
} }
...@@ -56,6 +57,7 @@ public class ShortboardTaskValCtrl { ...@@ -56,6 +57,7 @@ public class ShortboardTaskValCtrl {
Result result = shortboardTaskService.saveOrUpdateShortBoardTaskVal(shortBoardTaskVal,false); Result result = shortboardTaskService.saveOrUpdateShortBoardTaskVal(shortBoardTaskVal,false);
String message = SystemUserUtil.getCurrentUser()+"在线填报了短板清单:id={}"; String message = SystemUserUtil.getCurrentUser()+"在线填报了短板清单:id={}";
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,message,shortBoardTaskVal.getShortBoardTaskId()); LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,message,shortBoardTaskVal.getShortBoardTaskId());
return result; return result;
} }
...@@ -90,6 +92,7 @@ public class ShortboardTaskValCtrl { ...@@ -90,6 +92,7 @@ public class ShortboardTaskValCtrl {
shortBoardTaskVal.setStartUser(values.get(5)); shortBoardTaskVal.setStartUser(values.get(5));
//保存 //保存
shortboardTaskService.saveOrUpdateShortBoardTaskVal(shortBoardTaskVal,true); shortboardTaskService.saveOrUpdateShortBoardTaskVal(shortBoardTaskVal,true);
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,"保存短板清单填报(excel填报),id:{}",shortBoardTaskVal.getShortBoardTaskId());
} catch (Exception e) { } catch (Exception e) {
log.error("解析短板填报excel出错"); log.error("解析短板填报excel出错");
e.printStackTrace(); e.printStackTrace();
...@@ -193,6 +196,10 @@ public class ShortboardTaskValCtrl { ...@@ -193,6 +196,10 @@ public class ShortboardTaskValCtrl {
headers.add(column1); headers.add(column1);
headers.add(header); headers.add(header);
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,"下载短板清楚excel,id:{}",shortBoardTaskVal.getShortBoardTaskId());
writerBuilder.excelType(ExcelTypeEnum.XLSX).registerWriteHandler(new Custemhandler()). writerBuilder.excelType(ExcelTypeEnum.XLSX).registerWriteHandler(new Custemhandler()).
head(headers) head(headers)
.autoCloseStream(false).sheet("短板填报").doWrite(datas); .autoCloseStream(false).sheet("短板填报").doWrite(datas);
...@@ -204,6 +211,9 @@ public class ShortboardTaskValCtrl { ...@@ -204,6 +211,9 @@ public class ShortboardTaskValCtrl {
Map<String, String> map = new HashMap<>(4); Map<String, String> map = new HashMap<>(4);
map.put("status", "failure"); map.put("status", "failure");
map.put("message", "导出数据失败:" + e.getMessage()); map.put("message", "导出数据失败:" + e.getMessage());
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_TASK_API,"下载短板清楚excel 导出数据失败,id:{}",id);
Gson gson = new Gson(); Gson gson = new Gson();
response.getWriter().write( gson.toJson(map)); response.getWriter().write( gson.toJson(map));
} }
......
...@@ -162,6 +162,7 @@ public class ShortboardUnitCtrl { ...@@ -162,6 +162,7 @@ public class ShortboardUnitCtrl {
@PostMapping(value = "/getPageShortboardWarnData") @PostMapping(value = "/getPageShortboardWarnData")
public Map<String,Object> getPageShortboardWarnData(@RequestParam List<String> codes, public Map<String,Object> getPageShortboardWarnData(@RequestParam List<String> codes,
@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows)throws Exception{ @RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows)throws Exception{
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_RECORD_API,"查询预警池页面{}","");
return shortboardUnitService.getShortboardRecordPage(codes, page, rows); return shortboardUnitService.getShortboardRecordPage(codes, page, rows);
} }
......
...@@ -73,6 +73,7 @@ public class TaskCtrl { ...@@ -73,6 +73,7 @@ public class TaskCtrl {
@ApiOperation("根据关键字、规则类型、用户获取相关的填报任务") @ApiOperation("根据关键字、规则类型、用户获取相关的填报任务")
@PostMapping("findByPage") @PostMapping("findByPage")
public Page<Task> findByPage(@RequestBody QueryTaskParam param) { public Page<Task> findByPage(@RequestBody QueryTaskParam param) {
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_LIST_API, "查看我的任务清单页面{}","");
return taskService.findTask(param); return taskService.findTask(param);
} }
...@@ -104,7 +105,7 @@ public class TaskCtrl { ...@@ -104,7 +105,7 @@ public class TaskCtrl {
Map<String,String> map = orgPath.toJavaObject(Map.class); Map<String,String> map = orgPath.toJavaObject(Map.class);
task.setOrgPathMap(map); task.setOrgPathMap(map);
} }
// LogManager.logInfo(Constants.LOG_INDICATOR_TASK_START_API,"根据id获取填报任务{}","");
return task; return task;
} }
...@@ -119,6 +120,7 @@ public class TaskCtrl { ...@@ -119,6 +120,7 @@ public class TaskCtrl {
@ApiOperation("提交任务去审核") @ApiOperation("提交任务去审核")
@GetMapping("toSubmit") @GetMapping("toSubmit")
public Result toSubmit(@ApiParam("任务id") @RequestParam("taskId") String id) { public Result toSubmit(@ApiParam("任务id") @RequestParam("taskId") String id) {
LogManager.logInfo(Constants.LOG_CONTEXT_API,"提交任务去审核,id:{}",id);
return taskService.submitTask(id, SystemUserUtil.getCurrentUser()); return taskService.submitTask(id, SystemUserUtil.getCurrentUser());
} }
......
...@@ -56,12 +56,14 @@ public class TaskRuleCtrl { ...@@ -56,12 +56,14 @@ public class TaskRuleCtrl {
@ApiParam("机构编号") @RequestParam(value = "orgNo",required=false) String orgNo, @ApiParam("机构编号") @RequestParam(value = "orgNo",required=false) String orgNo,
@ApiParam("是否是管理员") @RequestParam(value = "sysAdmin",required=false) Boolean sysAdmin) { @ApiParam("是否是管理员") @RequestParam(value = "sysAdmin",required=false) Boolean sysAdmin) {
ruleType = null; ruleType = null;
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_START_API,"根据规则类型和关键字分页查找任务规则,关键字:{}",keyword);
return taskRuleService.findRuleByPage(ruleType, ruleLevel, keyword, page, pageSize,orgNo,sysAdmin); return taskRuleService.findRuleByPage(ruleType, ruleLevel, keyword, page, pageSize,orgNo,sysAdmin);
} }
@ApiOperation("根据id获取任务规则") @ApiOperation("根据id获取任务规则")
@GetMapping("getById") @GetMapping("getById")
public TaskRule getById(@ApiParam("id") @RequestParam("id")Integer id) { public TaskRule getById(@ApiParam("id") @RequestParam("id")Integer id) {
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_START_API,"根据id获取任务规则,id:{}",id);
return taskRuleService.getById(id, true); return taskRuleService.getById(id, true);
} }
......
...@@ -4,6 +4,7 @@ import com.keymobile.indicators.constant.Constants; ...@@ -4,6 +4,7 @@ import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj; import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj;
import com.keymobile.indicators.result.Result; import com.keymobile.indicators.result.Result;
import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService; import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService;
import com.keymobile.indicators.utils.LogManager;
import com.keymobile.indicators.utils.SystemUserUtil; import com.keymobile.indicators.utils.SystemUserUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -51,6 +52,7 @@ public class TaskRuleGroupObjCtrl { ...@@ -51,6 +52,7 @@ public class TaskRuleGroupObjCtrl {
obj.setUpdateTime(now); obj.setUpdateTime(now);
obj.setUpdater(userId); obj.setUpdater(userId);
taskRuleGroupObjService.save(obj); taskRuleGroupObjService.save(obj);
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_OBJ_API,"保存任务单位对象:{}",obj);
return Result.genOkResult(); return Result.genOkResult();
} }
...@@ -58,12 +60,14 @@ public class TaskRuleGroupObjCtrl { ...@@ -58,12 +60,14 @@ public class TaskRuleGroupObjCtrl {
@PostMapping("delete") @PostMapping("delete")
public Result delete(@RequestParam("id") Integer id) { public Result delete(@RequestParam("id") Integer id) {
taskRuleGroupObjService.deleteById(id); taskRuleGroupObjService.deleteById(id);
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_OBJ_API,"删除任务单位对象,id:{}",id);
return Result.genOkResult(); return Result.genOkResult();
} }
@ApiOperation("根据id获取任务单位") @ApiOperation("根据id获取任务单位")
@GetMapping("getById") @GetMapping("getById")
public TaskRuleGroupObj getById(@RequestParam("id") Integer id) { public TaskRuleGroupObj getById(@RequestParam("id") Integer id) {
return taskRuleGroupObjService.getById(id); return taskRuleGroupObjService.getById(id);
} }
...@@ -89,6 +93,7 @@ public class TaskRuleGroupObjCtrl { ...@@ -89,6 +93,7 @@ public class TaskRuleGroupObjCtrl {
list = taskRuleGroupObjService.find(ruleType, ruleLevel, orgNo, objType, keyword, request.getOffset(), pageSize); list = taskRuleGroupObjService.find(ruleType, ruleLevel, orgNo, objType, keyword, request.getOffset(), pageSize);
} }
Page<TaskRuleGroupObj> pageResult = new PageImpl<>(list, request, total); Page<TaskRuleGroupObj> pageResult = new PageImpl<>(list, request, total);
LogManager.logInfo(Constants.LOG_INDICATOR_TASK_OBJ_API,"分页查找任务单位对象信息,{}","");
return pageResult; return pageResult;
} }
} }
...@@ -6,6 +6,7 @@ import com.keymobile.indicators.model.entity.dataenter.TaskRuleTargetRoles; ...@@ -6,6 +6,7 @@ import com.keymobile.indicators.model.entity.dataenter.TaskRuleTargetRoles;
import com.keymobile.indicators.result.Result; import com.keymobile.indicators.result.Result;
import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService; import com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService;
import com.keymobile.indicators.service.dataenter.TaskRuleService; import com.keymobile.indicators.service.dataenter.TaskRuleService;
import com.keymobile.indicators.utils.LogManager;
import com.keymobile.indicators.utils.SystemUserUtil; import com.keymobile.indicators.utils.SystemUserUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -35,6 +36,7 @@ public class TaskRuleTargetRolesCtrl { ...@@ -35,6 +36,7 @@ public class TaskRuleTargetRolesCtrl {
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody TaskRuleTargetRoles obj) { public Result save(@RequestBody TaskRuleTargetRoles obj) {
taskRuleService.saveTargetRole(obj); taskRuleService.saveTargetRole(obj);
LogManager.logInfo(Constants.LOG_INDICATOR_AUDIT_ROLE_API,"保存下发对象、审批对象配置:{}",obj);
return Result.genOkResult(); return Result.genOkResult();
} }
......
...@@ -14,7 +14,14 @@ public class Constants { ...@@ -14,7 +14,14 @@ public class Constants {
* 日志---数据填报,任务下发 * 日志---数据填报,任务下发
*/ */
public static final String LOG_INDICATOR_TASK_START_API = "indicator.task.start"; public static final String LOG_INDICATOR_TASK_START_API = "indicator.task.start";
/**
* 日志---数据填报,任务下发
*/
public static final String LOG_INDICATOR_TASK_LIST_API = "indicator.task.list";
/**
* 日志---数据填报,填报单位管理
*/
public static final String LOG_INDICATOR_TASK_OBJ_API = "indicator.task.obj";
/** /**
* 日志---数据填报,数据审核 * 日志---数据填报,数据审核
*/ */
...@@ -48,7 +55,25 @@ public class Constants { ...@@ -48,7 +55,25 @@ public class Constants {
public static final String LOG_INDICATOR_SHORTBOARD_AUDIT_API = "indicator.shortboardaudit"; public static final String LOG_INDICATOR_SHORTBOARD_AUDIT_API = "indicator.shortboardaudit";
/**
*短板管理结果汇总
**/
public static final String LOG_INDICATOR_SHORTBOARD_RESULT_API = "indicator.shortboardresult";
public static final String LOG_INDICATOR_UPLOAD_FILE_API = "indicator.uploadfile"; public static final String LOG_INDICATOR_UPLOAD_FILE_API = "indicator.uploadfile";
/**
*配置项管理
**/
public static final String LOG_INDICATOR_CONFIG_INFO = "indicator.config.info";
/**
*系统管理操作日志
**/
public static final String LOG_INDICATOR_LOG = "indicator.log";
/**
*数据填报审核角色管理(系统管理)
**/
public static final String LOG_INDICATOR_AUDIT_ROLE_API= "indicator.audit.role";
......
...@@ -379,13 +379,15 @@ public class IndScorecardService { ...@@ -379,13 +379,15 @@ public class IndScorecardService {
} }
double avg = (sum*1.0)/(currentDriveResult.size()*1.0); double avg = (sum*1.0)/(currentDriveResult.size()*1.0);
Map<String, Integer> stringIntegerMap = CalculateUtils.rankValue(rankMapTmp, "0"); Map<String, Integer> tmpMap = CalculateUtils.rankValue(rankMapTmp, "0");
for (String s : stringIntegerMap.keySet()) { Map<String, Integer> rankValueMap = CalculateUtils.sortByValueAsc(tmpMap);
for (String s : rankValueMap.keySet()) {
DriveIndCalResultDef driveIndCalResultDef = new DriveIndCalResultDef(); DriveIndCalResultDef driveIndCalResultDef = new DriveIndCalResultDef();
driveIndCalResultDef.setAverage(String.format("%.8f", new BigDecimal(avg))); driveIndCalResultDef.setAverage(String.format("%.8f", new BigDecimal(avg)));
driveIndCalResultDef.setId(Integer.parseInt(s)); driveIndCalResultDef.setId(Integer.parseInt(s));
driveIndCalResultDef.setRank(stringIntegerMap.get(s)); driveIndCalResultDef.setRank(rankValueMap.get(s));
driveIndCalResultDef.setValue(rankMapTmp.get(s)); driveIndCalResultDef.setValue(rankMapTmp.get(s));
values.add(driveIndCalResultDef); values.add(driveIndCalResultDef);
} }
...@@ -472,6 +474,7 @@ public class IndScorecardService { ...@@ -472,6 +474,7 @@ public class IndScorecardService {
}else{ }else{
returnValue =baseScore-changeValue; returnValue =baseScore-changeValue;
} }
// log.info("单位:{},指标:{},值:{},公式:{},value={}",driveIndCalResultDef.getCompareObjDesc(),driveIndCalResultDef.getIndId(),value,sectionTmp,returnValue);
break; break;
} }
} }
......
...@@ -107,9 +107,8 @@ public class ShortboardUnitService { ...@@ -107,9 +107,8 @@ public class ShortboardUnitService {
shortComparedLog.setStatus(2); shortComparedLog.setStatus(2);
shortComparedLog.setDate(shortBoardWarnData.getDate()); shortComparedLog.setDate(shortBoardWarnData.getDate());
shortComparedLogMapper.insert(shortComparedLog); shortComparedLogMapper.insert(shortComparedLog);
LogManager.logInfo(Constants.LOG_INDICATOR_SHORTBOARD_UNIT_API,"短板运算id={},运算StartTime={}",shortBoardWarnData.getId(),new Date());
log.info("短板运算id={},开始运算StartTime={}",shortBoardWarnData.getId(),new Date()); //log.info("短板运算id={},开始运算StartTime={}",shortBoardWarnData.getId(),new Date());
List<ShortboardRecord> result = new ArrayList<>(); List<ShortboardRecord> result = new ArrayList<>();
//ShortboardUnit shortboardUnit = this.getById(id);//根据短板单元id获取短板单元 //ShortboardUnit shortboardUnit = this.getById(id);//根据短板单元id获取短板单元
try { try {
......
package com.keymobile.indicators.service.impl; package com.keymobile.indicators.service.impl;
import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.ConfigInfo; import com.keymobile.indicators.model.entity.ConfigInfo;
import com.keymobile.indicators.model.mapper.indicators.ConfigInfoMapper; import com.keymobile.indicators.model.mapper.indicators.ConfigInfoMapper;
import com.keymobile.indicators.service.ConfigInfoService; import com.keymobile.indicators.service.ConfigInfoService;
import com.keymobile.indicators.service.RedisCacheService; import com.keymobile.indicators.service.RedisCacheService;
import com.keymobile.indicators.utils.LogManager;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.*; import org.springframework.data.domain.*;
...@@ -39,6 +41,7 @@ public class ConfigInfoServiceImpl implements ConfigInfoService { ...@@ -39,6 +41,7 @@ public class ConfigInfoServiceImpl implements ConfigInfoService {
@Override @Override
public ConfigInfo createConfigInfo(ConfigInfo config) { public ConfigInfo createConfigInfo(ConfigInfo config) {
configInfoMapper.insert(config); configInfoMapper.insert(config);
LogManager.logInfo(Constants.LOG_INDICATOR_CONFIG_INFO,"新增配置项信息:{}",config);
return config; return config;
} }
...@@ -46,12 +49,14 @@ public class ConfigInfoServiceImpl implements ConfigInfoService { ...@@ -46,12 +49,14 @@ public class ConfigInfoServiceImpl implements ConfigInfoService {
public ConfigInfo updateInfo(ConfigInfo config) { public ConfigInfo updateInfo(ConfigInfo config) {
configInfoMapper.updateByPrimaryKey(config); configInfoMapper.updateByPrimaryKey(config);
this.refreshCache(); this.refreshCache();
LogManager.logInfo(Constants.LOG_INDICATOR_CONFIG_INFO,"刷新配置项信息{}","");
return config; return config;
} }
@Override @Override
public void deleteConfigById(String id) { public void deleteConfigById(String id) {
configInfoMapper.deleteByPrimaryKey(id); configInfoMapper.deleteByPrimaryKey(id);
LogManager.logInfo(Constants.LOG_INDICATOR_CONFIG_INFO,"删除配置项信息:{}",id);
this.refreshCache(); this.refreshCache();
} }
...@@ -62,6 +67,7 @@ public class ConfigInfoServiceImpl implements ConfigInfoService { ...@@ -62,6 +67,7 @@ public class ConfigInfoServiceImpl implements ConfigInfoService {
if (total > 0) { if (total > 0) {
list = configInfoMapper.findConfigInfo(keyword, page.getOffset(), page.getPageSize()); list = configInfoMapper.findConfigInfo(keyword, page.getOffset(), page.getPageSize());
} }
LogManager.logInfo(Constants.LOG_INDICATOR_CONFIG_INFO,"查询配置项页面信息{}","");
Page<ConfigInfo> pageResult = new PageImpl<>(list, page, total); Page<ConfigInfo> pageResult = new PageImpl<>(list, page, total);
return pageResult; return pageResult;
} }
......
...@@ -17,7 +17,14 @@ public enum ModelPathEnum { ...@@ -17,7 +17,14 @@ public enum ModelPathEnum {
LOG_INDICATOR_SHORTBOARD_TASK_API("indicator.shortboardtask","短板管理/短板清单"), LOG_INDICATOR_SHORTBOARD_TASK_API("indicator.shortboardtask","短板管理/短板清单"),
LOG_INDICATOR_UPLOAD_FILE_API("indicator.uploadfile","数据填报/精益台账"),//文件管理 LOG_INDICATOR_UPLOAD_FILE_API("indicator.uploadfile","数据填报/精益台账"),//文件管理
LOG_INDICATOR_SHORTBOARD_RECORD_API("indicator.shortboardrecord","短板管理/短板预警池"), LOG_INDICATOR_SHORTBOARD_RECORD_API("indicator.shortboardrecord","短板管理/短板预警池"),
LOG_INDICATOR_SHORTBOARD_AUDIT_API("indicator.shortboardaudit","短板管理/检查改善措施"); LOG_INDICATOR_SHORTBOARD_AUDIT_API("indicator.shortboardaudit","短板管理/检查改善措施"),
LOG_INDICATOR_SHORTBOARD_RESULT_API("indicator.shortboardresult","短板管理/结果汇总"),
LOG_INDICATOR_TASK_LIST_API("indicator.task.list","数据填报/任务清单"),
LOG_INDICATOR_TASK_OBJ_API("indicator.task.obj","数据填报/填报单位管理"),
LOG_INDICATOR_CONFIG_INFO("indicator.config.info","系统管理/配置项管理"),
LOG_INDICATOR_LOG("indicator.log","系统管理/操作日志"),
LOG_INDICATOR_AUDIT_ROLE_API("indicator.audit.role","系统管理/填报审核角色配置管理 ");
private String modelName; private String modelName;
private String modelPath; private String modelPath;
......
...@@ -69,6 +69,24 @@ ...@@ -69,6 +69,24 @@
<logger name="indicator.task.audit"> <logger name="indicator.task.audit">
<appender-ref ref="db" /> <appender-ref ref="db" />
</logger> </logger>
<logger name="indicator.task.list">
<appender-ref ref="db" />
</logger>
<logger name="indicator.task.obj">
<appender-ref ref="db" />
</logger>
<logger name="indicator.shortboardresult">
<appender-ref ref="db" />
</logger>
<logger name="indicator.config.info">
<appender-ref ref="db" />
</logger>
<logger name="indicator.log">
<appender-ref ref="db" />
</logger>
<logger name="indicator.audit.role">
<appender-ref ref="db" />
</logger>
<root level="INFO"> <root level="INFO">
<appender-ref ref="stdout" /> <appender-ref ref="stdout" />
</root> </root>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment