|
|
@@ -17,6 +17,7 @@
|
|
|
package org.springblade.system.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
@@ -39,6 +40,8 @@ import org.springblade.system.vo.ParamServiceVO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* 业务参数配置表 控制器
|
|
|
@@ -79,7 +82,9 @@ public class ParamServiceController extends BladeController {
|
|
|
if (res.isSuccess()) {
|
|
|
paramService.setSalesCompanyId(Long.parseLong(res.getData().getDeptPid()));
|
|
|
}
|
|
|
- IPage<ParamService> pages = paramServiceService.page(Condition.getPage(query), Condition.getQueryWrapper(paramService));
|
|
|
+ QueryWrapper<ParamService> wrapper = Condition.getQueryWrapper(paramService);
|
|
|
+ wrapper.orderByDesc("update_time");
|
|
|
+ IPage<ParamService> pages = paramServiceService.page(Condition.getPage(query), wrapper);
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
@@ -147,6 +152,11 @@ public class ParamServiceController extends BladeController {
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入paramService")
|
|
|
public R submit(@Valid @RequestBody ParamService paramService) {
|
|
|
+ Date nowDate = new Date();
|
|
|
+ if (Objects.isNull(paramService.getId())) {
|
|
|
+ paramService.setCreateTime(nowDate);
|
|
|
+ }
|
|
|
+ paramService.setUpdateTime(nowDate);
|
|
|
return R.status(paramServiceService.saveOrUpdate(paramService));
|
|
|
}
|
|
|
|