diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicDataController.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicDataController.java index d74430f..576f14a 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicDataController.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicDataController.java @@ -3,14 +3,15 @@ package com.cm.common.plugin.controller.apis.dynamic.form; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; import com.cm.common.plugin.service.dynamic.IDynamicDataService; +import com.cm.common.pojo.ListPage; import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import com.cm.common.result.SuccessResultList; +import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -31,10 +32,69 @@ public class DynamicDataController extends AbstractController { private IDynamicDataService dynamicDataService; @ApiOperation(value = "保存动态数据", notes = "保存动态数据接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") + }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("savedynamicdata/{tableName}") public SuccessResult saveDynamicData(@PathVariable("tableName") String tableName, @RequestBody Map params) { return dynamicDataService.saveDynamicData(tableName, params); } + @ApiOperation(value = "删除动态数据", notes = "删除动态数据接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), + @ApiImplicitParam(name = "ids", value = "数据ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("removedynamicdata/{tableName}/{ids}") + public SuccessResult removeDynamicData(@PathVariable("tableName") String tableName, @PathVariable("ids") String ids) { + return dynamicDataService.removeDynamicData(tableName, ids); + } + + @ApiOperation(value = "修改动态数据", notes = "修改动态数据接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), + @ApiImplicitParam(name = "id", value = "id", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatedynamicdata/{tableName}/{id}") + public SuccessResult updateDynamicData(@PathVariable("tableName") String tableName, @PathVariable("id") String id, @RequestBody Map params) { + return dynamicDataService.updateDynamicData(tableName, id, params); + } + + @ApiOperation(value = "动态数据列表", notes = "动态数据列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdynamicdata/{tableName}") + public List> listDynamicData(@PathVariable("tableName") String tableName) { + Map params = getParams(); + return dynamicDataService.listDynamicData(tableName, params); + } + + @ApiOperation(value = "分页动态数据列表", notes = "分页动态数据列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagedynamicdata/{tableName}") + public SuccessResultList>> listPageDynamicData(@PathVariable("tableName") String tableName, ListPage listPage) { + Map params = getParams(); + listPage.setParams(params); + return dynamicDataService.listPageDynamicData(tableName, listPage); + } + + @ApiOperation(value = "动态数据详情", notes = "动态数据详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), + @ApiImplicitParam(name = "id", value = "id", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getdynamicdata/{tableName}/{id}") + public Map getDynamicData(@PathVariable("tableName") String tableName, @PathVariable("id") String id) { + return dynamicDataService.getDynamicData(tableName, id); + } + } diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicFormController.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicFormController.java index 7a6067b..60b9bb4 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicFormController.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/apis/dynamic/form/DynamicFormController.java @@ -7,12 +7,11 @@ import com.cm.common.plugin.pojo.vos.dynamicform.DynamicFormVO; import com.cm.common.plugin.service.dynamic.IDynamicFormService; import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -40,4 +39,15 @@ public class DynamicFormController extends AbstractController { return dynamicFormService.saveDynamicForm(dynamicFormVO); } + @ApiOperation(value = "列表显示的字段", notes = "列表显示的字段接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listlistshowfield/{tableName}") + public List listListShowFieldOfPage(@PathVariable("tableName") String tableName) { + // return dynamicFormService.listListShowFieldOfPage(tableName); + } + + } diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/dynamic/form/DynamicFormRouteController.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/dynamic/form/DynamicFormRouteController.java new file mode 100644 index 0000000..e7f0bcb --- /dev/null +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/dynamic/form/DynamicFormRouteController.java @@ -0,0 +1,51 @@ +package com.cm.common.plugin.controller.routes.dynamic.form; + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.pojo.dtos.dynamic.DynamicFormDTO; +import com.cm.common.plugin.service.dynamic.IDynamicFormService; +import com.cm.common.result.ErrorResult; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +import java.util.List; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: DynamicFormRouteController + * @Description: 动态表单 + * @Author: WangGeng + * @Date: 2019/12/5 17:19 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "动态表单页面接口") +@Controller +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/dynamicform") +public class DynamicFormRouteController extends AbstractController { + + @Autowired + private IDynamicFormService dynamicFormService; + + @ApiOperation(value = "动态表单列表页面", notes = "动态表单列表页面接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdynamicform/{tableName}") + public ModelAndView listDynamicForm(@PathVariable("tableName") String tableName) { + ModelAndView mv = new ModelAndView("dynamic/form/list"); + List listShowFieldList = dynamicFormService.listListShowField(tableName); + mv.addObject("tableName", tableName); + mv.addObject("uuidField", String.format("%sId", tableName)); + mv.addObject("listShowFieldList", listShowFieldList); + return mv; + } + +} diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java index fe0efc0..8c339fa 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/dao/dynamic/IDynamicDataDao.java @@ -1,9 +1,13 @@ package com.cm.common.plugin.dao.dynamic; +import com.cm.common.exception.RemoveException; import com.cm.common.exception.SaveException; +import com.cm.common.exception.SearchException; +import com.cm.common.exception.UpdateException; import com.cm.common.result.SuccessResult; import org.springframework.stereotype.Repository; +import java.util.List; import java.util.Map; /** @@ -27,4 +31,39 @@ public interface IDynamicDataDao { * @throws SaveException */ void saveDynamicData(Map params) throws SaveException; + + /** + * 删除动态数据 + * + * @param params + * @return + * @throws RemoveException + */ + void removeDynamicData(Map params) throws RemoveException; + + /** + * 修改动态数据 + * + * @param params + * @throws UpdateException + */ + void updateDynamicData(Map params) throws UpdateException; + + /** + * 动态数据列表 + * + * @param params + * @return + * @throws SearchException + */ + List> listDynamicData(Map params) throws SearchException; + + /** + * 动态数据详情 + * + * @param params + * @return + * @throws SearchException + */ + Map getDynamicData(Map params) throws SearchException; } diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java new file mode 100644 index 0000000..a836698 --- /dev/null +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java @@ -0,0 +1,14 @@ +package com.cm.common.plugin.pojo.dtos.dynamic; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: DynamicFormListShowFieldDTO + * @Description: 动态表单列表显示字段 + * @Author: WangGeng + * @Date: 2019/12/5 18:35 + * @Version: 1.0 + **/ +public class DynamicFormListShowFieldDTO { +} diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java index af8d046..b752123 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java @@ -1,9 +1,14 @@ package com.cm.common.plugin.service.dynamic; +import com.cm.common.exception.RemoveException; import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; +import com.cm.common.exception.UpdateException; +import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultList; +import java.util.List; import java.util.Map; /** @@ -27,4 +32,54 @@ public interface IDynamicDataService { * @throws SaveException */ SuccessResult saveDynamicData(String tableName, Map params) throws SearchException, SaveException; + + /** + * 删除动态数据 + * + * @param tableName + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeDynamicData(String tableName, String ids) throws RemoveException; + + /** + * 修改动态数据 + * + * @param tableName + * @param id + * @param params + * @return + * @throws UpdateException + */ + SuccessResult updateDynamicData(String tableName, String id, Map params) throws UpdateException; + + /** + * 动态数据列表 + * + * @param tableName + * @param params + * @return + */ + List> listDynamicData(String tableName, Map params); + + /** + * 分页动态数据列表 + * + * @param tableName + * @param listPage + * @return + * @throws SearchException + */ + SuccessResultList>> listPageDynamicData(String tableName, ListPage listPage) throws SearchException; + + /** + * 动态数据详情 + * + * @param tableName + * @param id + * @return + * @throws SearchException + */ + Map getDynamicData(String tableName, String id) throws SearchException; } diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java index 492daf2..49875e1 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java @@ -37,4 +37,23 @@ public interface IDynamicFormService { * @throws SearchException */ List listDynamicForm(String tableName) throws SearchException; + + /** + * 获取列表显示的字段 + * + * @param tableName + * @return + * @throws SearchException + */ + List listListShowField(String tableName) throws SearchException; + + /** + * 获取表单显示的字段 + * + * @param tableName + * @return + * @throws SearchException + */ + List listFormShowField(String tableName) throws SearchException; + } diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java index 76ec713..4f4bc68 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java @@ -1,28 +1,29 @@ package com.cm.common.plugin.service.dynamic.impl; import com.cm.common.base.AbstractService; -import com.cm.common.exception.ParamsException; -import com.cm.common.exception.SaveException; -import com.cm.common.exception.SearchException; +import com.cm.common.exception.*; import com.cm.common.plugin.dao.dynamic.IDynamicDataDao; import com.cm.common.plugin.enums.dynamic.FieldRequireTypeEnum; -import com.cm.common.plugin.pojo.dtos.database.table.TableColumnDTO; import com.cm.common.plugin.pojo.dtos.dynamic.DynamicFormDTO; import com.cm.common.plugin.service.dynamic.IDynamicDataService; import com.cm.common.plugin.service.dynamic.IDynamicFormService; import com.cm.common.plugin.service.dynamic.IDynamicTableService; +import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultList; import com.cm.common.utils.RegexUtil; import com.cm.common.utils.UUIDUtil; import com.cm.common.utils.WStringUtil; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections.KeyValue; +import org.apache.commons.collections.keyvalue.DefaultKeyValue; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.regex.Pattern; /** @@ -56,9 +57,7 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD insertValueList.add(params.get(dynamicFormDTO.getFieldName())); } params.clear(); - String lowerUnderLineTableName = WStringUtil.lowerUpper2UnderLine(tableName); - params.put("tableName", String.format("%s%s", IDynamicTableService.DYNAMIC_TABLE_PREFIX, lowerUnderLineTableName)); - params.put("uuidField", String.format("%s_id", lowerUnderLineTableName)); + setUpdateBaseInfo(tableName, params); params.put("uuidValue", UUIDUtil.getUUID()); params.put("insertFieldList", insertFieldList); params.put("insertValueList", insertValueList); @@ -67,6 +66,141 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD return new SuccessResult(); } + @Override + public SuccessResult removeDynamicData(String tableName, String ids) throws RemoveException { + Map params = getHashMap(7); + setUpdateBaseInfo(tableName, params); + params.put("idArray", Arrays.asList(ids.split("_"))); + setUpdateInfo(params); + dynamicDataDao.removeDynamicData(params); + return new SuccessResult(); + } + + @Override + public SuccessResult updateDynamicData(String tableName, String id, Map params) throws UpdateException { + List dynamicFormDTOs = dynamicFormService.listDynamicForm(tableName); + LOG.debug("校验参数"); + requireData(params, dynamicFormDTOs); + LOG.debug("获取修改键值"); + List updateFieldValueList = new ArrayList<>(); + for (DynamicFormDTO dynamicFormDTO : dynamicFormDTOs) { + updateFieldValueList.add(new DefaultKeyValue(WStringUtil.lowerUpper2UnderLine(dynamicFormDTO.getFieldName()), params.get(dynamicFormDTO.getFieldName()))); + } + params.clear(); + setUpdateBaseInfo(tableName, params); + params.put("uuidValue", id); + params.put("updateFieldValueList", updateFieldValueList); + setUpdateInfo(params); + dynamicDataDao.updateDynamicData(params); + return new SuccessResult(); + } + + @Override + public List> listDynamicData(String tableName, Map params) { + setSearchBaseListInfo(tableName, params); + List> listDynamicData = dynamicDataDao.listDynamicData(params); + resetDynamicDataKey2LowerUpper(listDynamicData); + return listDynamicData; + } + + @Override + public SuccessResultList>> listPageDynamicData(String tableName, ListPage listPage) throws SearchException { + setSearchBaseListInfo(tableName, listPage.getParams()); + PageHelper.startPage(listPage.getPage(), listPage.getRows()); + List> listDynamicData = dynamicDataDao.listDynamicData(listPage.getParams()); + resetDynamicDataKey2LowerUpper(listDynamicData); + PageInfo> pageInfo = new PageInfo<>(listDynamicData); + return new SuccessResultList<>(listDynamicData, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Map getDynamicData(String tableName, String id) throws SearchException { + Map params = getHashMap(0); + setSearchBaseGetInfo(tableName, params); + params.put("uuidValue", id); + Map dynamicData = dynamicDataDao.getDynamicData(params); + resetDynamicDataKey2LowerUpper(dynamicData); + return dynamicData; + } + + /** + * 设置查询列表基础信息 + * + * @param tableName + * @param params + */ + private void setSearchBaseListInfo(String tableName, Map params) { + List listShowFieldList = dynamicFormService.listListShowField(tableName); + params.put("listShowFieldList", listShowFieldList); + setSearchBaseInfo(tableName, params); + } + + /** + * 设置查询详情基础信息 + * + * @param tableName + * @param params + */ + private void setSearchBaseGetInfo(String tableName, Map params) { + List formShowFieldList = dynamicFormService.listFormShowField(tableName); + params.put("formShowFieldList", formShowFieldList); + setSearchBaseInfo(tableName, params); + } + + /** + * 设置查询基础信息 + * + * @param tableName + * @param params + */ + private void setSearchBaseInfo(String tableName, Map params) { + String lowerUnderLineTableName = WStringUtil.lowerUpper2UnderLine(tableName); + params.put("tableName", String.format("%s%s", IDynamicTableService.DYNAMIC_TABLE_PREFIX, lowerUnderLineTableName)); + params.put("uuidField", String.format("%s_id", lowerUnderLineTableName)); + } + + /** + * 设置更新基础信息 + * + * @param tableName + * @param params + */ + private void setUpdateBaseInfo(String tableName, Map params) { + String lowerUnderLineTableName = WStringUtil.lowerUpper2UnderLine(tableName); + params.put("tableName", String.format("%s%s", IDynamicTableService.DYNAMIC_TABLE_PREFIX, lowerUnderLineTableName)); + params.put("uuidField", String.format("%s_id", lowerUnderLineTableName)); + } + + /** + * 设置表字段为驼峰式 + * + * @param listDynamicData + */ + private void resetDynamicDataKey2LowerUpper(List> listDynamicData) { + for (Map dynamicData : listDynamicData) { + resetDynamicDataKey2LowerUpper(dynamicData); + } + } + + /** + * 设置表字段为驼峰式 + * + * @param dynamicData + */ + private void resetDynamicDataKey2LowerUpper(Map dynamicData) { + List keyList = new ArrayList<>(); + for (Map.Entry keyValue : dynamicData.entrySet()) { + keyList.add(keyValue.getKey()); + } + for (String key : keyList) { + String newKey = WStringUtil.underLine2LowerUpper(key); + if (!StringUtils.equals(key, newKey)) { + dynamicData.put(WStringUtil.underLine2LowerUpper(key), dynamicData.get(key)); + dynamicData.remove(key); + } + } + } + /** * 验证数据 * diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java index f0e1c46..102dec2 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java @@ -64,6 +64,30 @@ public class DynamicFormServiceImpl extends AbstractService implements IDynamicF return dynamicFormDao.listDynamicForm(tableName); } + @Override + public List listListShowField(String tableName) throws SearchException { + List dynamicFormDTOs = listDynamicForm(tableName); + List listShowField = new ArrayList<>(); + for (DynamicFormDTO dynamicFormDTO : dynamicFormDTOs) { + if (dynamicFormDTO.getListShow() == 1) { + listShowField.add(WStringUtil.lowerUpper2UnderLine(dynamicFormDTO.getFieldName())); + } + } + return listShowField; + } + + @Override + public List listFormShowField(String tableName) throws SearchException { + List dynamicFormDTOs = listDynamicForm(tableName); + List listShowField = new ArrayList<>(); + for (DynamicFormDTO dynamicFormDTO : dynamicFormDTOs) { + if (dynamicFormDTO.getFormShow() == 1) { + listShowField.add(WStringUtil.lowerUpper2UnderLine(dynamicFormDTO.getFieldName())); + } + } + return listShowField; + } + /** * 保存动态表单信息 * diff --git a/cloud-common-plugin/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml b/cloud-common-plugin/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml index a55daa5..1013761 100644 --- a/cloud-common-plugin/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml +++ b/cloud-common-plugin/src/main/resources/mybatis/mapper/dynamic/dynamicdata-mapper.xml @@ -27,4 +27,63 @@ ) + + + UPDATE + ${tableName} + SET + is_delete = 1, + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + ${uuidField} IN + + #{idArray[${index}]} + + + + + + UPDATE + ${tableName} + SET + + + ${item.key} = #{item.value}, + + + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + ${uuidField} = #{uuidValue} + + + + + + + + \ No newline at end of file diff --git a/cloud-common-plugin/src/main/resources/templates/dynamic/form/list.html b/cloud-common-plugin/src/main/resources/templates/dynamic/form/list.html new file mode 100644 index 0000000..ed05e91 --- /dev/null +++ b/cloud-common-plugin/src/main/resources/templates/dynamic/form/list.html @@ -0,0 +1,246 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cloud-common/src/main/java/com/cm/common/utils/WStringUtil.java b/cloud-common/src/main/java/com/cm/common/utils/WStringUtil.java index 8088765..262bb97 100644 --- a/cloud-common/src/main/java/com/cm/common/utils/WStringUtil.java +++ b/cloud-common/src/main/java/com/cm/common/utils/WStringUtil.java @@ -167,9 +167,13 @@ public class WStringUtil { if (letter.length() == 0) { continue; } - int firstLetter = letter.charAt(0); - firstLetter -= 32; - sb.append((char) firstLetter).append(letter.substring(1, letter.length())); + if(i == 0) { + sb.append(letter); + } else { + int firstLetter = letter.charAt(0); + firstLetter -= 32; + sb.append((char) firstLetter).append(letter.substring(1)); + } } if (sb.length() > 0) { return sb.toString();