f5a65866 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 2031b9bd 6a8a31c0
......@@ -160,7 +160,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
flow.setProcessDefinitionKey(processDefinition.getKey());
flow.setCategory(processDefinition.getCategory());
}
flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
flow.setCategoryName("工作流程");
flow.setProcessInstanceId(historicProcessInstance.getId());
// HistoricTaskInstance
HistoricTaskInstance historicTaskInstance = historicTaskInstanceMap.get(historicProcessInstance.getId());
......@@ -259,7 +259,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
flow.setProcessDefinitionVersion(processDefinition.getVersion());
flow.setCategory(processDefinition.getCategory());
}
flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
flow.setCategoryName("工作流程");
flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId());
flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId());
HistoricProcessInstance historicProcessInstance = historicProcessInstanceMap.get(historicTaskInstance.getProcessInstanceId());
......@@ -350,7 +350,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ
ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId());
if (Func.isNotEmpty(processDefinition)) {
flow.setCategory(processDefinition.getCategory());
flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
flow.setCategoryName("工作流程");
flow.setProcessDefinitionId(processDefinition.getId());
flow.setProcessDefinitionName(processDefinition.getName());
flow.setProcessDefinitionKey(processDefinition.getKey());
......
......@@ -18,13 +18,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -92,8 +90,17 @@ public class ReportElectricCostController {
public Result<ReportElectricCost> add(@RequestBody ReportElectricCost reportElectricCost) {
Result<ReportElectricCost> result = new Result<ReportElectricCost>();
try {
reportElectricCostService.save(reportElectricCost);
result.success("添加成功!");
//判断是否重复
QueryWrapper<ReportElectricCost> queryWrapper = new QueryWrapper<ReportElectricCost>();
queryWrapper.eq("month", reportElectricCost.getMonth());
queryWrapper.eq("depart_id", reportElectricCost.getDepartId());
List<ReportElectricCost> list = reportElectricCostService.list(queryWrapper);
if(list.size()>0){
result.error500("已存在");
}else{
reportElectricCostService.save(reportElectricCost);
result.success("添加成功!");
}
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
......@@ -114,17 +121,24 @@ public class ReportElectricCostController {
@PutMapping(value = "/edit")
public Result<ReportElectricCost> edit(@RequestBody ReportElectricCost reportElectricCost) {
Result<ReportElectricCost> result = new Result<ReportElectricCost>();
ReportElectricCost reportElectricCostEntity = reportElectricCostService.getById(reportElectricCost.getId());
if(reportElectricCostEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = reportElectricCostService.updateById(reportElectricCost);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
boolean ok = false;
String id = reportElectricCost.getId();
//判断是否重复
QueryWrapper<ReportElectricCost> queryWrapper = new QueryWrapper<ReportElectricCost>();
queryWrapper.eq("month", reportElectricCost.getMonth());
queryWrapper.eq("depart_id", reportElectricCost.getDepartId());
List<ReportElectricCost> list = reportElectricCostService.list(queryWrapper);
if(list.size()>0){
ReportElectricCost cost = list.get(0);
if(id.equals(cost.getId())){
ok = reportElectricCostService.updateById(reportElectricCost);
}
}else{
ok = reportElectricCostService.updateById(reportElectricCost);
}
if(ok) {
result.success("修改成功!");
}
return result;
}
/**
......
......@@ -10,24 +10,19 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.report.entity.ReportTargetConfig;
import com.skua.modules.report.service.IReportTargetConfigService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -81,6 +76,7 @@ public class ReportTargetConfigController {
if(reportTargetConfig.getTargetYear()!=null){
queryWrapper.like("target_year",reportTargetConfig.getTargetYear());
}
queryWrapper.orderByDesc("target_year");
IPage<ReportTargetConfig> pageList = reportTargetConfigService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......@@ -102,8 +98,17 @@ public class ReportTargetConfigController {
public Result<ReportTargetConfig> add(@RequestBody ReportTargetConfig reportTargetConfig) {
Result<ReportTargetConfig> result = new Result<ReportTargetConfig>();
try {
reportTargetConfigService.save(reportTargetConfig);
result.success("添加成功!");
//判断是否重复
QueryWrapper<ReportTargetConfig> queryWrapper = new QueryWrapper<ReportTargetConfig>();
queryWrapper.eq("target_year", reportTargetConfig.getTargetYear());
queryWrapper.eq("depart_id", reportTargetConfig.getDepartId());
List<ReportTargetConfig> list = reportTargetConfigService.list(queryWrapper);
if(list.size()>0){
result.error500("已存在");
}else{
reportTargetConfigService.save(reportTargetConfig);
result.success("添加成功!");
}
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
......@@ -124,17 +129,24 @@ public class ReportTargetConfigController {
@PutMapping(value = "/edit")
public Result<ReportTargetConfig> edit(@RequestBody ReportTargetConfig reportTargetConfig) {
Result<ReportTargetConfig> result = new Result<ReportTargetConfig>();
ReportTargetConfig reportTargetConfigEntity = reportTargetConfigService.getById(reportTargetConfig.getId());
if(reportTargetConfigEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = reportTargetConfigService.updateById(reportTargetConfig);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
boolean ok = false;
String id = reportTargetConfig.getId();
//判断是否重复
QueryWrapper<ReportTargetConfig> queryWrapper = new QueryWrapper<ReportTargetConfig>();
queryWrapper.eq("target_year", reportTargetConfig.getTargetYear());
queryWrapper.eq("depart_id", reportTargetConfig.getDepartId());
List<ReportTargetConfig> list = reportTargetConfigService.list(queryWrapper);
if(list.size()>0){
ReportTargetConfig cost = list.get(0);
if(id.equals(cost.getId())){
ok = reportTargetConfigService.updateById(reportTargetConfig);
}
}else{
ok = reportTargetConfigService.updateById(reportTargetConfig);
}
if(ok) {
result.success("修改成功!");
}
return result;
}
/**
......
......@@ -10,6 +10,7 @@
<if test="reportElectricCost.month!=null and reportElectricCost.month!=''">
AND month like CONCAT(#{reportElectricCost.month},'%')
</if>
order by month desc
</select>
</mapper>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!