Commit 43410708 authored by luben's avatar luben

Merge branch 'dev-lb' into 'dev'

Dev lb

See merge request !213
parents 65ab38c9 3245c29d
Pipeline #145025 failed with stages
in 33 minutes and 12 seconds
......@@ -33,6 +33,8 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
......@@ -1008,4 +1010,30 @@ public class RegionController extends BaseController {
}
}
@RequestMapping(value = "/addRegion", method = RequestMethod.POST)
@ResponseBody
public String addRegion(@RequestBody GridRegion body) {
try {
// 获取当前日期和时间
LocalDateTime now = LocalDateTime.now();
// 定义日期时间格式,去掉特殊符号
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
// 格式化日期时间
String date = now.format(formatter);
body.setWgCode(body.getWgParentId()+date);
String level = body.getLevel();
if(level.equals("1")||level.equals("2")){
body.setStatus("1");
}else {
body.setStatus(level);
}
return gridRegionFacadeService.commit(body, "insert");
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
}
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