f5a65866 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 2031b9bd 6a8a31c0
...@@ -160,7 +160,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ ...@@ -160,7 +160,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
160 flow.setProcessDefinitionKey(processDefinition.getKey()); 160 flow.setProcessDefinitionKey(processDefinition.getKey());
161 flow.setCategory(processDefinition.getCategory()); 161 flow.setCategory(processDefinition.getCategory());
162 } 162 }
163 flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); 163 flow.setCategoryName("工作流程");
164 flow.setProcessInstanceId(historicProcessInstance.getId()); 164 flow.setProcessInstanceId(historicProcessInstance.getId());
165 // HistoricTaskInstance 165 // HistoricTaskInstance
166 HistoricTaskInstance historicTaskInstance = historicTaskInstanceMap.get(historicProcessInstance.getId()); 166 HistoricTaskInstance historicTaskInstance = historicTaskInstanceMap.get(historicProcessInstance.getId());
...@@ -259,7 +259,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ ...@@ -259,7 +259,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
259 flow.setProcessDefinitionVersion(processDefinition.getVersion()); 259 flow.setProcessDefinitionVersion(processDefinition.getVersion());
260 flow.setCategory(processDefinition.getCategory()); 260 flow.setCategory(processDefinition.getCategory());
261 } 261 }
262 flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); 262 flow.setCategoryName("工作流程");
263 flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId()); 263 flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId());
264 flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId()); 264 flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId());
265 HistoricProcessInstance historicProcessInstance = historicProcessInstanceMap.get(historicTaskInstance.getProcessInstanceId()); 265 HistoricProcessInstance historicProcessInstance = historicProcessInstanceMap.get(historicTaskInstance.getProcessInstanceId());
...@@ -350,7 +350,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ ...@@ -350,7 +350,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
350 ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId()); 350 ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId());
351 if (Func.isNotEmpty(processDefinition)) { 351 if (Func.isNotEmpty(processDefinition)) {
352 flow.setCategory(processDefinition.getCategory()); 352 flow.setCategory(processDefinition.getCategory());
353 flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); 353 flow.setCategoryName("工作流程");
354 flow.setProcessDefinitionId(processDefinition.getId()); 354 flow.setProcessDefinitionId(processDefinition.getId());
355 flow.setProcessDefinitionName(processDefinition.getName()); 355 flow.setProcessDefinitionName(processDefinition.getName());
356 flow.setProcessDefinitionKey(processDefinition.getKey()); 356 flow.setProcessDefinitionKey(processDefinition.getKey());
......
...@@ -18,13 +18,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -18,13 +18,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
18 import com.baomidou.mybatisplus.core.metadata.IPage; 18 import com.baomidou.mybatisplus.core.metadata.IPage;
19 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 19 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
20 import lombok.extern.slf4j.Slf4j; 20 import lombok.extern.slf4j.Slf4j;
21
22 import org.jeecgframework.poi.excel.ExcelImportUtil; 21 import org.jeecgframework.poi.excel.ExcelImportUtil;
23 import org.jeecgframework.poi.excel.def.NormalExcelConstants; 22 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
24 import org.jeecgframework.poi.excel.entity.ExportParams; 23 import org.jeecgframework.poi.excel.entity.ExportParams;
25 import org.jeecgframework.poi.excel.entity.ImportParams; 24 import org.jeecgframework.poi.excel.entity.ImportParams;
26 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; 25 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
27
28 import org.springframework.beans.factory.annotation.Autowired; 26 import org.springframework.beans.factory.annotation.Autowired;
29 import org.springframework.web.bind.annotation.*; 27 import org.springframework.web.bind.annotation.*;
30 import org.springframework.web.multipart.MultipartFile; 28 import org.springframework.web.multipart.MultipartFile;
...@@ -92,8 +90,17 @@ public class ReportElectricCostController { ...@@ -92,8 +90,17 @@ public class ReportElectricCostController {
92 public Result<ReportElectricCost> add(@RequestBody ReportElectricCost reportElectricCost) { 90 public Result<ReportElectricCost> add(@RequestBody ReportElectricCost reportElectricCost) {
93 Result<ReportElectricCost> result = new Result<ReportElectricCost>(); 91 Result<ReportElectricCost> result = new Result<ReportElectricCost>();
94 try { 92 try {
93 //判断是否重复
94 QueryWrapper<ReportElectricCost> queryWrapper = new QueryWrapper<ReportElectricCost>();
95 queryWrapper.eq("month", reportElectricCost.getMonth());
96 queryWrapper.eq("depart_id", reportElectricCost.getDepartId());
97 List<ReportElectricCost> list = reportElectricCostService.list(queryWrapper);
98 if(list.size()>0){
99 result.error500("已存在");
100 }else{
95 reportElectricCostService.save(reportElectricCost); 101 reportElectricCostService.save(reportElectricCost);
96 result.success("添加成功!"); 102 result.success("添加成功!");
103 }
97 } catch (Exception e) { 104 } catch (Exception e) {
98 log.error(e.getMessage(),e); 105 log.error(e.getMessage(),e);
99 result.error500("操作失败"); 106 result.error500("操作失败");
...@@ -114,17 +121,24 @@ public class ReportElectricCostController { ...@@ -114,17 +121,24 @@ public class ReportElectricCostController {
114 @PutMapping(value = "/edit") 121 @PutMapping(value = "/edit")
115 public Result<ReportElectricCost> edit(@RequestBody ReportElectricCost reportElectricCost) { 122 public Result<ReportElectricCost> edit(@RequestBody ReportElectricCost reportElectricCost) {
116 Result<ReportElectricCost> result = new Result<ReportElectricCost>(); 123 Result<ReportElectricCost> result = new Result<ReportElectricCost>();
117 ReportElectricCost reportElectricCostEntity = reportElectricCostService.getById(reportElectricCost.getId()); 124 boolean ok = false;
118 if(reportElectricCostEntity==null) { 125 String id = reportElectricCost.getId();
119 result.error500("未找到对应实体"); 126 //判断是否重复
120 }else { 127 QueryWrapper<ReportElectricCost> queryWrapper = new QueryWrapper<ReportElectricCost>();
121 boolean ok = reportElectricCostService.updateById(reportElectricCost); 128 queryWrapper.eq("month", reportElectricCost.getMonth());
122 //TODO 返回false说明什么? 129 queryWrapper.eq("depart_id", reportElectricCost.getDepartId());
130 List<ReportElectricCost> list = reportElectricCostService.list(queryWrapper);
131 if(list.size()>0){
132 ReportElectricCost cost = list.get(0);
133 if(id.equals(cost.getId())){
134 ok = reportElectricCostService.updateById(reportElectricCost);
135 }
136 }else{
137 ok = reportElectricCostService.updateById(reportElectricCost);
138 }
123 if(ok) { 139 if(ok) {
124 result.success("修改成功!"); 140 result.success("修改成功!");
125 } 141 }
126 }
127
128 return result; 142 return result;
129 } 143 }
130 /** 144 /**
......
...@@ -10,24 +10,19 @@ import javax.servlet.http.HttpServletRequest; ...@@ -10,24 +10,19 @@ import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse; 10 import javax.servlet.http.HttpServletResponse;
11 import com.skua.core.api.vo.Result; 11 import com.skua.core.api.vo.Result;
12 import com.skua.core.aspect.annotation.AutoLog; 12 import com.skua.core.aspect.annotation.AutoLog;
13 import com.skua.core.context.BaseContextHandler;
14 import com.skua.core.query.QueryGenerator; 13 import com.skua.core.query.QueryGenerator;
15 import com.skua.core.service.ISequenceService;
16 import com.skua.core.util.ConvertUtils; 14 import com.skua.core.util.ConvertUtils;
17 import com.skua.modules.report.entity.ReportTargetConfig; 15 import com.skua.modules.report.entity.ReportTargetConfig;
18 import com.skua.modules.report.service.IReportTargetConfigService; 16 import com.skua.modules.report.service.IReportTargetConfigService;
19 import java.util.Date;
20 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 17 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
21 import com.baomidou.mybatisplus.core.metadata.IPage; 18 import com.baomidou.mybatisplus.core.metadata.IPage;
22 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 19 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
23 import lombok.extern.slf4j.Slf4j; 20 import lombok.extern.slf4j.Slf4j;
24
25 import org.jeecgframework.poi.excel.ExcelImportUtil; 21 import org.jeecgframework.poi.excel.ExcelImportUtil;
26 import org.jeecgframework.poi.excel.def.NormalExcelConstants; 22 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
27 import org.jeecgframework.poi.excel.entity.ExportParams; 23 import org.jeecgframework.poi.excel.entity.ExportParams;
28 import org.jeecgframework.poi.excel.entity.ImportParams; 24 import org.jeecgframework.poi.excel.entity.ImportParams;
29 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; 25 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
30
31 import org.springframework.beans.factory.annotation.Autowired; 26 import org.springframework.beans.factory.annotation.Autowired;
32 import org.springframework.web.bind.annotation.*; 27 import org.springframework.web.bind.annotation.*;
33 import org.springframework.web.multipart.MultipartFile; 28 import org.springframework.web.multipart.MultipartFile;
...@@ -81,6 +76,7 @@ public class ReportTargetConfigController { ...@@ -81,6 +76,7 @@ public class ReportTargetConfigController {
81 if(reportTargetConfig.getTargetYear()!=null){ 76 if(reportTargetConfig.getTargetYear()!=null){
82 queryWrapper.like("target_year",reportTargetConfig.getTargetYear()); 77 queryWrapper.like("target_year",reportTargetConfig.getTargetYear());
83 } 78 }
79 queryWrapper.orderByDesc("target_year");
84 IPage<ReportTargetConfig> pageList = reportTargetConfigService.page(page, queryWrapper); 80 IPage<ReportTargetConfig> pageList = reportTargetConfigService.page(page, queryWrapper);
85 result.setSuccess(true); 81 result.setSuccess(true);
86 result.setResult(pageList); 82 result.setResult(pageList);
...@@ -102,8 +98,17 @@ public class ReportTargetConfigController { ...@@ -102,8 +98,17 @@ public class ReportTargetConfigController {
102 public Result<ReportTargetConfig> add(@RequestBody ReportTargetConfig reportTargetConfig) { 98 public Result<ReportTargetConfig> add(@RequestBody ReportTargetConfig reportTargetConfig) {
103 Result<ReportTargetConfig> result = new Result<ReportTargetConfig>(); 99 Result<ReportTargetConfig> result = new Result<ReportTargetConfig>();
104 try { 100 try {
101 //判断是否重复
102 QueryWrapper<ReportTargetConfig> queryWrapper = new QueryWrapper<ReportTargetConfig>();
103 queryWrapper.eq("target_year", reportTargetConfig.getTargetYear());
104 queryWrapper.eq("depart_id", reportTargetConfig.getDepartId());
105 List<ReportTargetConfig> list = reportTargetConfigService.list(queryWrapper);
106 if(list.size()>0){
107 result.error500("已存在");
108 }else{
105 reportTargetConfigService.save(reportTargetConfig); 109 reportTargetConfigService.save(reportTargetConfig);
106 result.success("添加成功!"); 110 result.success("添加成功!");
111 }
107 } catch (Exception e) { 112 } catch (Exception e) {
108 log.error(e.getMessage(),e); 113 log.error(e.getMessage(),e);
109 result.error500("操作失败"); 114 result.error500("操作失败");
...@@ -124,17 +129,24 @@ public class ReportTargetConfigController { ...@@ -124,17 +129,24 @@ public class ReportTargetConfigController {
124 @PutMapping(value = "/edit") 129 @PutMapping(value = "/edit")
125 public Result<ReportTargetConfig> edit(@RequestBody ReportTargetConfig reportTargetConfig) { 130 public Result<ReportTargetConfig> edit(@RequestBody ReportTargetConfig reportTargetConfig) {
126 Result<ReportTargetConfig> result = new Result<ReportTargetConfig>(); 131 Result<ReportTargetConfig> result = new Result<ReportTargetConfig>();
127 ReportTargetConfig reportTargetConfigEntity = reportTargetConfigService.getById(reportTargetConfig.getId()); 132 boolean ok = false;
128 if(reportTargetConfigEntity==null) { 133 String id = reportTargetConfig.getId();
129 result.error500("未找到对应实体"); 134 //判断是否重复
130 }else { 135 QueryWrapper<ReportTargetConfig> queryWrapper = new QueryWrapper<ReportTargetConfig>();
131 boolean ok = reportTargetConfigService.updateById(reportTargetConfig); 136 queryWrapper.eq("target_year", reportTargetConfig.getTargetYear());
132 //TODO 返回false说明什么? 137 queryWrapper.eq("depart_id", reportTargetConfig.getDepartId());
138 List<ReportTargetConfig> list = reportTargetConfigService.list(queryWrapper);
139 if(list.size()>0){
140 ReportTargetConfig cost = list.get(0);
141 if(id.equals(cost.getId())){
142 ok = reportTargetConfigService.updateById(reportTargetConfig);
143 }
144 }else{
145 ok = reportTargetConfigService.updateById(reportTargetConfig);
146 }
133 if(ok) { 147 if(ok) {
134 result.success("修改成功!"); 148 result.success("修改成功!");
135 } 149 }
136 }
137
138 return result; 150 return result;
139 } 151 }
140 /** 152 /**
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
10 <if test="reportElectricCost.month!=null and reportElectricCost.month!=''"> 10 <if test="reportElectricCost.month!=null and reportElectricCost.month!=''">
11 AND month like CONCAT(#{reportElectricCost.month},'%') 11 AND month like CONCAT(#{reportElectricCost.month},'%')
12 </if> 12 </if>
13 order by month desc
13 </select> 14 </select>
14 15
15 </mapper> 16 </mapper>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!