开发动态插入单行数据

pull/1/head
wangziyangyang 2020-03-12 15:34:16 +08:00
parent a44198057d
commit 7c13304a7f
2 changed files with 5 additions and 10 deletions

View File

@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;
@ -87,13 +86,11 @@ public class TableNameDataController extends BaseController {
@ResponseBody
public Result addOrUpdate(HttpServletRequest request) throws Exception {
String id = request.getParameter("id");
SysUser user =getSysUser();
SysUser user = getSysUser();
if (StringUtils.isNotEmpty(id)) {
//TODO 修改当前数据
tableNameDataService.commonUpdate(request,user);
tableNameDataService.commonUpdate(request, user);
} else {
//TODO 新增当前表数据
tableNameDataService.commonSave(request,user);
tableNameDataService.commonSave(request, user);
}
return Result.success();
}

View File

@ -69,8 +69,7 @@ public class TableNameDataServiceImpl implements TableNameDataService {
*/
@Override
public String buildCol(String tableNameId) throws Exception {
if(StringUtils.isEmpty(tableNameId))
{
if (StringUtils.isEmpty(tableNameId)) {
throw new Exception("表关联ID不能为空");
}
List<SpTableManagerItem> spTableManagerItems = iSpTableManagerItemService.queryItemBytableNameId(tableNameId);
@ -91,7 +90,6 @@ public class TableNameDataServiceImpl implements TableNameDataService {
@Override
public void commonSave(HttpServletRequest request, SysUser user) throws Exception {
CommonDto commonDto = new CommonDto();
//拼接插入的SQL语句
String jsTableName = request.getParameter("jsTableName");
String jsTableNameId = request.getParameter("jsTableNameId");