【fix bug】修改请求类型 并效验有效参数
This commit is contained in:
+5
-5
@@ -81,7 +81,7 @@ public class OnlCgformAuthController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/authData"})
|
||||
@PostMapping({"/editAuthData"})
|
||||
public Result<OnlAuthData> editAuthData(@RequestBody OnlAuthData paramOnlAuthData) {
|
||||
Result<OnlAuthData> result = new Result<>();
|
||||
this.onlAuthDataService.updateById(paramOnlAuthData);
|
||||
@@ -168,7 +168,7 @@ public class OnlCgformAuthController {
|
||||
|
||||
LambdaQueryWrapper<OnlAuthPage> pageLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
pageLambdaQueryWrapper.eq(OnlAuthPage::getCgformId, paramString).eq(OnlAuthPage::getType, 1);
|
||||
List<OnlAuthPage> pageList = this.onlAuthPageService.list(pageLambdaQueryWrapper);
|
||||
List<OnlAuthPage> pageList = this.onlAuthPageService.list(pageLambdaQueryWrapper);
|
||||
|
||||
ArrayList<AuthColumnVO> arrayList = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : list) {
|
||||
@@ -215,7 +215,7 @@ public class OnlCgformAuthController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/authColumn"})
|
||||
@PostMapping({"/editAuthColumn"})
|
||||
public Result<T> editAuthColumn(@RequestBody AuthColumnVO paramAuthColumnVO) {
|
||||
try {
|
||||
if (paramAuthColumnVO.getStatus() == 1) {
|
||||
@@ -324,7 +324,7 @@ public class OnlCgformAuthController {
|
||||
|
||||
Result<List<AuthColumnVO>> result = new Result<>();
|
||||
LambdaQueryWrapper<OnlCgformField> cgformFieldLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if(!Objects.isNull(onlCgformHead)){
|
||||
if (!Objects.isNull(onlCgformHead)) {
|
||||
cgformFieldLambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId());
|
||||
}
|
||||
cgformFieldLambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
|
||||
@@ -335,7 +335,7 @@ public class OnlCgformAuthController {
|
||||
ArrayList<AuthColumnVO> arrayList = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : list) {
|
||||
AuthColumnVO authColumnVO = new AuthColumnVO(onlCgformField);
|
||||
if(!Objects.isNull(onlCgformHead)){
|
||||
if (!Objects.isNull(onlCgformHead)) {
|
||||
authColumnVO.setTableName(onlCgformHead.getTableName());
|
||||
authColumnVO.setTableNameTxt(onlCgformHead.getTableTxt());
|
||||
}
|
||||
|
||||
+5
-5
@@ -122,7 +122,7 @@ public class OnlCgformApiController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/editAll"})
|
||||
@PostMapping({"/editAll"})
|
||||
public Result<T> b(@RequestBody OnlCgformModel var1) {
|
||||
try {
|
||||
return this.onlCgformHeadService.editAll(var1);
|
||||
@@ -402,7 +402,7 @@ public class OnlCgformApiController {
|
||||
module = ModuleType.ONLINE
|
||||
)
|
||||
@OnlineAuth("form")
|
||||
@PutMapping({"/form/{code}"})
|
||||
@PostMapping({"/form/update/{code}"})
|
||||
public Result a(@PathVariable("code") String var1, @RequestBody JSONObject var2) {
|
||||
try {
|
||||
String var3 = this.onlCgformHeadService.editManyFormData(var1, var2);
|
||||
@@ -421,7 +421,7 @@ public class OnlCgformApiController {
|
||||
module = ModuleType.ONLINE
|
||||
)
|
||||
@OnlineAuth("form")
|
||||
@DeleteMapping({"/form/{code}/{id}"})
|
||||
@PostMapping({"/form/{code}/{id}"})
|
||||
public Result f(@PathVariable("code") String var1, @PathVariable("id") String var2) {
|
||||
OnlCgformHead var3 = this.onlCgformHeadService.getById(var1);
|
||||
if (var3 == null) {
|
||||
@@ -478,7 +478,7 @@ public class OnlCgformApiController {
|
||||
value = "online删除数据",
|
||||
module = ModuleType.ONLINE
|
||||
)
|
||||
@DeleteMapping({"/formByCode/{code}/{id}"})
|
||||
@PostMapping({"/formByCode/{code}/{id}"})
|
||||
public Result g(@PathVariable("code") String var1, @PathVariable("id") String var2) {
|
||||
OnlCgformHead var3 = this.onlCgformHeadService.getOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, var1));
|
||||
if (var3 == null) {
|
||||
@@ -1119,7 +1119,7 @@ public class OnlCgformApiController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/crazyForm/{name}"})
|
||||
@PostMapping({"/crazyForm/update/{name}"})
|
||||
public Result<T> c(@PathVariable("name") String var1, @RequestBody JSONObject var2) {
|
||||
try {
|
||||
var2.remove("create_by");
|
||||
|
||||
+12
-5
@@ -8,12 +8,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformButton;
|
||||
import com.jero.generater.modules.online.cgform.service.IOnlCgformButtonService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -75,7 +77,7 @@ public class OnlCgformButtonController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/edit"})
|
||||
@PostMapping({"/edit"})
|
||||
public Result<Object> edit(@RequestBody OnlCgformButton cgformButton) {
|
||||
OnlCgformButton existCgformButton = this.onlCgformButtonService.getById(cgformButton.getId());
|
||||
if (existCgformButton == null) {
|
||||
@@ -90,8 +92,12 @@ public class OnlCgformButtonController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@DeleteMapping({"/delete"})
|
||||
public Result<Object> delete(@RequestParam(name = "id",required = true) String id) {
|
||||
@PostMapping({"/delete"})
|
||||
public Result<Object> delete(@RequestBody Map<String,String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isEmpty(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
OnlCgformButton cgformButton = this.onlCgformButtonService.getById(id);
|
||||
if (cgformButton == null) {
|
||||
return Result.error(EN_IS_NULL);
|
||||
@@ -105,8 +111,9 @@ public class OnlCgformButtonController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestParam(name = "ids",required = true) String ids) {
|
||||
@PostMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String,String> map) {
|
||||
String ids = map.get("ids");
|
||||
if (ids != null && !"".equals(ids.trim())) {
|
||||
this.onlCgformButtonService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
|
||||
+73
-38
@@ -7,6 +7,7 @@ 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.extension.plugins.pagination.Page;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -17,6 +18,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import com.jero.codegenerate.properties.CodeConfigProperties;
|
||||
import com.jero.generater.modules.online.cgform.entity.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CgformEnum;
|
||||
@@ -62,11 +64,11 @@ public class OnlCgformHeadController {
|
||||
private static final String EN_IS_NULL = "未找到对应实体";
|
||||
private static final String SAVE_ERROR = "保存失败!";
|
||||
private static final String DEL_ERROR = "删除失败!";
|
||||
|
||||
private static final String PARAM_ERROR = "参数不识别!";
|
||||
|
||||
|
||||
@GetMapping({"/list"})
|
||||
public Result<IPage<OnlCgformHead>> a(OnlCgformHead var1, @RequestParam(name = "pageNo",defaultValue = "1") Integer var2, @RequestParam(name = "pageSize",defaultValue = "10") Integer var3, HttpServletRequest var4) {
|
||||
public Result<IPage<OnlCgformHead>> a(OnlCgformHead var1, @RequestParam(name = "pageNo", defaultValue = "1") Integer var2, @RequestParam(name = "pageSize", defaultValue = "10") Integer var3, HttpServletRequest var4) {
|
||||
Result<IPage<OnlCgformHead>> var5 = new Result<>();
|
||||
QueryWrapper<OnlCgformHead> var6 = QueryGenerator.initQueryWrapper(var1, var4.getParameterMap());
|
||||
Page<OnlCgformHead> var7 = new Page<>(var2, var3);
|
||||
@@ -91,7 +93,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/edit"})
|
||||
@PostMapping({"/edit"})
|
||||
public Result<Object> edit(@RequestBody OnlCgformHead var1) {
|
||||
OnlCgformHead var3 = this.onlCgformHeadService.getById(var1.getId());
|
||||
if (var3 == null) {
|
||||
@@ -105,8 +107,12 @@ public class OnlCgformHeadController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@DeleteMapping({"/delete"})
|
||||
public Result delete(@RequestParam(name = "id",required = true) String id) {
|
||||
@PostMapping({"/delete"})
|
||||
public Result delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if (id == null || "".equals(id.trim())) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
this.onlCgformHeadService.deleteRecordAndTable(id);
|
||||
} catch (DBException | SQLException e) {
|
||||
@@ -116,8 +122,12 @@ public class OnlCgformHeadController {
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@DeleteMapping({"/removeRecord"})
|
||||
public Result removeRecord(@RequestParam(name = "id",required = true) String id) {
|
||||
@PostMapping({"/removeRecord"})
|
||||
public Result removeRecord(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if (id == null || "".equals(id.trim())) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
this.onlCgformHeadService.deleteRecord(id);
|
||||
} catch (DBException | SQLException e) {
|
||||
@@ -127,18 +137,23 @@ public class OnlCgformHeadController {
|
||||
return Result.OK("移除成功!");
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestParam(name = "ids",required = true) String var1, @RequestParam(name = "flag") String var2) {
|
||||
@PostMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("ids");
|
||||
String var2 = map.get("flag");
|
||||
if (var2 == null || "".equals(var2.trim())) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
if (var1 != null && !"".equals(var1.trim())) {
|
||||
this.onlCgformHeadService.deleteBatch(var1, var2);
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
return Result.error("参数不识别!");
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping({"/queryById"})
|
||||
public Result<OnlCgformHead> queryById(@RequestParam(name = "id",required = true) String id) {
|
||||
public Result<OnlCgformHead> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
OnlCgformHead cgformHead = this.onlCgformHeadService.getById(id);
|
||||
if (cgformHead == null) {
|
||||
return Result.error(EN_IS_NULL);
|
||||
@@ -149,7 +164,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@GetMapping({"/queryByTableNames"})
|
||||
public Result queryByTableNames(@RequestParam(name = "tableNames",required = true) String var1) {
|
||||
public Result queryByTableNames(@RequestParam(name = "tableNames", required = true) String var1) {
|
||||
LambdaQueryWrapper<OnlCgformHead> var2 = new LambdaQueryWrapper<>();
|
||||
String[] var3 = var1.split(",");
|
||||
var2.in(OnlCgformHead::getTableName, Arrays.asList(var3));
|
||||
@@ -157,7 +172,7 @@ public class OnlCgformHeadController {
|
||||
return var4 == null ? Result.error(EN_IS_NULL) : Result.OK(var4);
|
||||
}
|
||||
|
||||
@PostMapping({"/enhanceJs/{code}"})
|
||||
@PostMapping({"/addEnhanceJs/{code}"})
|
||||
public Result addEnhanceJs(@PathVariable("code") String var1, @RequestBody OnlCgformEnhanceJs var2) {
|
||||
try {
|
||||
var2.setCgformHeadId(var1);
|
||||
@@ -181,7 +196,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/enhanceJs/{code}"})
|
||||
@PostMapping({"/enhanceJs/{code}"})
|
||||
public Result editEnhanceJs(@PathVariable("code") String var1, @RequestBody OnlCgformEnhanceJs var2) {
|
||||
try {
|
||||
var2.setCgformHeadId(var1);
|
||||
@@ -211,7 +226,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@RequiresRoles({"admin"})
|
||||
@PostMapping({"/enhanceSql/{formId}"})
|
||||
@PostMapping({"/addEnhanceSql/{formId}"})
|
||||
public Result addEnhanceSql(@PathVariable("formId") String var1, @RequestBody OnlCgformEnhanceSql var2) {
|
||||
try {
|
||||
var2.setCgformHeadId(var1);
|
||||
@@ -228,7 +243,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@RequiresRoles({"admin"})
|
||||
@PutMapping({"/enhanceSql/{formId}"})
|
||||
@PostMapping({"/enhanceSql/{formId}"})
|
||||
public Result editEnhanceSql(@PathVariable("formId") String var1, @RequestBody OnlCgformEnhanceSql var2) {
|
||||
try {
|
||||
var2.setCgformHeadId(var1);
|
||||
@@ -244,8 +259,12 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping({"/enhanceSql"})
|
||||
public Result deletenhanceSql(@RequestParam(name = "id",required = true) String var1) {
|
||||
@PostMapping({"/enhanceSql"})
|
||||
public Result deletenhanceSql(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("id");
|
||||
if (StringUtils.isBlank(var1)) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
this.onlCgformEnhanceService.deleteEnhanceSql(var1);
|
||||
return Result.OK("删除成功");
|
||||
@@ -255,8 +274,12 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deletebatchEnhanceSql"})
|
||||
public Result deletebatchEnhanceSql(@RequestParam(name = "ids",required = true) String var1) {
|
||||
@PostMapping({"/deletebatchEnhanceSql"})
|
||||
public Result deletebatchEnhanceSql(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("ids");
|
||||
if (StringUtils.isBlank(var1)) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
List<String> var2 = Arrays.asList(var1.split(","));
|
||||
this.onlCgformEnhanceService.deleteBatchEnhanceSql(var2);
|
||||
@@ -273,7 +296,7 @@ public class OnlCgformHeadController {
|
||||
return Result.OK(var3);
|
||||
}
|
||||
|
||||
@PostMapping({"/enhanceJava/{formId}"})
|
||||
@PostMapping({"/addEnhanceJava/{formId}"})
|
||||
public Result addEnhanceJava(@PathVariable("formId") String formId, @RequestBody OnlCgformEnhanceJava var2) {
|
||||
try {
|
||||
if (!CgformUtil.a(var2)) {
|
||||
@@ -293,7 +316,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/enhanceJava/{formId}"})
|
||||
@PostMapping({"/enhanceJava/{formId}"})
|
||||
public Result c(@PathVariable("formId") String var1, @RequestBody OnlCgformEnhanceJava var2) {
|
||||
try {
|
||||
if (!CgformUtil.a(var2)) {
|
||||
@@ -313,8 +336,12 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping({"/enhanceJava"})
|
||||
public Result g(@RequestParam(name = "id",required = true) String var1) {
|
||||
@PostMapping({"/enhanceJava"})
|
||||
public Result g(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("id");
|
||||
if (StringUtils.isBlank(var1)) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
this.onlCgformEnhanceService.deleteEnhanceJava(var1);
|
||||
return Result.OK("删除成功");
|
||||
@@ -324,8 +351,12 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatchEnhanceJava"})
|
||||
public Result h(@RequestParam(name = "ids",required = true) String var1) {
|
||||
@PostMapping({"/deleteBatchEnhanceJava"})
|
||||
public Result h(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("ids");
|
||||
if (StringUtils.isBlank(var1)) {
|
||||
return Result.error(PARAM_ERROR);
|
||||
}
|
||||
try {
|
||||
List<String> var2 = Arrays.asList(var1.split(","));
|
||||
this.onlCgformEnhanceService.deleteBatchEnhanceJava(var2);
|
||||
@@ -337,7 +368,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@GetMapping({"/queryTables"})
|
||||
public Result a(@RequestParam(name = "tableName",required = false) String var1, @RequestParam(name = "pageNo",defaultValue = "1") Integer var2, @RequestParam(name = "pageSize",defaultValue = "10") Integer var3, HttpServletRequest var4) {
|
||||
public Result a(@RequestParam(name = "tableName", required = false) String var1, @RequestParam(name = "pageNo", defaultValue = "1") Integer var2, @RequestParam(name = "pageSize", defaultValue = "10") Integer var3, HttpServletRequest var4) {
|
||||
String var5 = JwtUtil.getUserNameByToken(var4);
|
||||
if (!"admin".equals(var5)) {
|
||||
return Result.error("noadminauth");
|
||||
@@ -385,7 +416,7 @@ public class OnlCgformHeadController {
|
||||
c = var1;
|
||||
String[] var4 = var1.split(",");
|
||||
|
||||
for(int var5 = 0; var5 < var4.length; ++var5) {
|
||||
for (int var5 = 0; var5 < var4.length; ++var5) {
|
||||
if (oConvertUtils.isNotEmpty(var4[var5])) {
|
||||
int var6 = this.onlCgformHeadService.count(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, var4[var5]));
|
||||
if (var6 <= 0) {
|
||||
@@ -399,11 +430,13 @@ public class OnlCgformHeadController {
|
||||
return Result.OK("同步完成!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取磁盘根目录
|
||||
* @date 2021/4/6 11:20
|
||||
*
|
||||
* @param
|
||||
* @return com.jero.common.api.vo.Result
|
||||
* @date 2021/4/6 11:20
|
||||
*/
|
||||
@GetMapping({"/rootFile"})
|
||||
public Result rootFile() {
|
||||
@@ -411,7 +444,7 @@ public class OnlCgformHeadController {
|
||||
File[] files = File.listRoots();
|
||||
int var4 = files.length;
|
||||
|
||||
for(int i = 0; i < var4; ++i) {
|
||||
for (int i = 0; i < var4; ++i) {
|
||||
File file = files[i];
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (file.isDirectory()) {
|
||||
@@ -429,20 +462,22 @@ public class OnlCgformHeadController {
|
||||
|
||||
return Result.OK(jsonArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取磁盘文件树
|
||||
* @date 2021/4/6 11:20
|
||||
*
|
||||
* @param parentPath
|
||||
* @return com.jero.common.api.vo.Result
|
||||
* @date 2021/4/6 11:20
|
||||
*/
|
||||
@GetMapping({"/fileTree"})
|
||||
public Result fileTree(@RequestParam(name = "parentPath",required = true) String parentPath) {
|
||||
public Result fileTree(@RequestParam(name = "parentPath", required = true) String parentPath) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
File file = new File(parentPath);
|
||||
File[] files = file.listFiles();
|
||||
int length = files.length;
|
||||
|
||||
for(int i = 0; i < length; ++i) {
|
||||
for (int i = 0; i < length; ++i) {
|
||||
File file1 = files[i];
|
||||
if (file1.isDirectory() && oConvertUtils.isNotEmpty(file1.getPath())) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -462,7 +497,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@GetMapping({"/tableInfo"})
|
||||
public Result tableInfo(@RequestParam(name = "code",required = true) String code) {
|
||||
public Result tableInfo(@RequestParam(name = "code", required = true) String code) {
|
||||
OnlCgformHead onlCgformHead = this.onlCgformHeadService.getById(code);
|
||||
if (onlCgformHead == null) {
|
||||
return Result.error(EN_IS_NULL);
|
||||
@@ -476,7 +511,7 @@ public class OnlCgformHeadController {
|
||||
String[] subTableArray = subTableStr.split(",");
|
||||
int length = subTableArray.length;
|
||||
|
||||
for(int i = 0; i < length; ++i) {
|
||||
for (int i = 0; i < length; ++i) {
|
||||
String subTable = subTableArray[i];
|
||||
LambdaQueryWrapper<OnlCgformHead> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(OnlCgformHead::getTableName, subTable);
|
||||
@@ -514,7 +549,7 @@ public class OnlCgformHeadController {
|
||||
}
|
||||
|
||||
@PostMapping({"/copyOnline"})
|
||||
public Result k(@RequestParam(name = "code",required = true) String var1) {
|
||||
public Result k(@RequestParam(name = "code", required = true) String var1) {
|
||||
try {
|
||||
OnlCgformHead var2 = this.onlCgformHeadService.getById(var1);
|
||||
if (var2 == null) {
|
||||
@@ -538,8 +573,8 @@ public class OnlCgformHeadController {
|
||||
return false;
|
||||
}
|
||||
|
||||
var3 = (String)var2.next();
|
||||
} while(!var1.startsWith(var3) && !var1.startsWith(var3.toUpperCase()));
|
||||
var3 = (String) var2.next();
|
||||
} while (!var1.startsWith(var3) && !var1.startsWith(var3.toUpperCase()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+12
-5
@@ -9,12 +9,14 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformIndex;
|
||||
import com.jero.generater.modules.online.cgform.service.IOnlCgformIndexService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController("onlCgformIndexController")
|
||||
@RequestMapping({"/online/cgform/index"})
|
||||
@@ -58,7 +60,7 @@ public class OnlCgformIndexController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/edit"})
|
||||
@PostMapping({"/edit"})
|
||||
public Result<Object> edit(@RequestBody OnlCgformIndex cgformIndex) {
|
||||
OnlCgformIndex existCgformIndex = this.onlCgformIndexService.getById(cgformIndex.getId());
|
||||
if (existCgformIndex == null) {
|
||||
@@ -73,8 +75,12 @@ public class OnlCgformIndexController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@DeleteMapping({"/delete"})
|
||||
public Result<Object> delete(@RequestParam(name = "id",required = true) String id) {
|
||||
@PostMapping({"/delete"})
|
||||
public Result<Object> delete(@RequestBody Map<String,String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
OnlCgformIndex cgformIndex = this.onlCgformIndexService.getById(id);
|
||||
if (cgformIndex == null) {
|
||||
return Result.error(EN_IS_NULL);
|
||||
@@ -88,8 +94,9 @@ public class OnlCgformIndexController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestParam(name = "ids",required = true) String ids) {
|
||||
@PostMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String,String> map) {
|
||||
String ids = map.get("ids");
|
||||
if (ids != null && !"".equals(ids.trim())) {
|
||||
this.onlCgformIndexService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
|
||||
+15
-9
@@ -4,10 +4,8 @@ package com.jero.generater.modules.online.cgreport.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.jero.modules.base.service.BaseCommonService;
|
||||
@@ -168,7 +166,7 @@ public class OnlCgreportHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping({"/editAll"})
|
||||
@PostMapping({"/editAll"})
|
||||
public Result editAll(@RequestBody OnlCgreportModel cgreportModel) {
|
||||
try {
|
||||
return this.onlCgreportHeadService.editAll(cgreportModel);
|
||||
@@ -178,13 +176,21 @@ public class OnlCgreportHeadController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping({"/delete"})
|
||||
public Result delete(@RequestParam(name = "id",required = true) String id) {
|
||||
@PostMapping({"/delete"})
|
||||
public Result delete(@RequestBody Map<String,String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
return this.onlCgreportHeadService.delete(id);
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatch"})
|
||||
public Result deleteBatch(@RequestParam(name = "ids",required = true) String ids) {
|
||||
@PostMapping({"/deleteBatch"})
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String,String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
return this.onlCgreportHeadService.bathDelete(ids.split(","));
|
||||
}
|
||||
|
||||
|
||||
+20
-16
@@ -4,23 +4,19 @@ package com.jero.generater.modules.online.cgreport.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgreport.entity.OnlCgreportItem;
|
||||
import com.jero.generater.modules.online.cgreport.service.IOnlCgreportItemService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController("onlCgreportItemController")
|
||||
@RequestMapping({"/online/cgreport/item"})
|
||||
@@ -59,20 +55,28 @@ public class OnlCgreportItemController {
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@PutMapping({"/edit"})
|
||||
@PostMapping({"/edit"})
|
||||
public Result b(@RequestBody OnlCgreportItem var1) {
|
||||
this.onlCgreportItemService.updateById(var1);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@DeleteMapping({"/delete"})
|
||||
public Result b(@RequestParam(name = "id",required = true) String var1) {
|
||||
@PostMapping({"/delete"})
|
||||
public Result b(@RequestBody Map<String,String> map) {
|
||||
String var1 = map.get("id");
|
||||
if(StringUtils.isEmpty(var1)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.onlCgreportItemService.removeById(var1);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@DeleteMapping({"/deleteBatch"})
|
||||
public Result c(@RequestParam(name = "ids",required = true) String var1) {
|
||||
@PostMapping({"/deleteBatch"})
|
||||
public Result c(@RequestBody Map<String,String> map) {
|
||||
String var1 = map.get("ids");
|
||||
if(StringUtils.isBlank(var1)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.onlCgreportItemService.removeByIds(Arrays.asList(var1.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
+7
@@ -9,6 +9,7 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgreport.entity.OnlCgreportParam;
|
||||
import com.jero.generater.modules.online.cgreport.service.IOnlCgreportParamService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -65,6 +66,9 @@ public class OnlCgreportParamController {
|
||||
// public Result b(@RequestParam(name = "id",required = true) String var1) {
|
||||
public Result<Object> b(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("id");
|
||||
if(StringUtils.isBlank(var1)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.onlCgreportParamService.removeById(var1);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -73,6 +77,9 @@ public class OnlCgreportParamController {
|
||||
// public Result c(@RequestParam(name = "ids", required = true) String var1) {
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String var1 = map.get("ids");
|
||||
if(StringUtils.isBlank(var1)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.onlCgreportParamService.removeByIds(Arrays.asList(var1.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user