From 69bdcf451ab704b63e47e7a1f49a4294a9065e41 Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Mon, 15 Mar 2021 19:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/CheckBoxTableCellFactory.java | 13 ++++++ .../code/factory/service/GenerateService.java | 4 +- .../normal/controller/api-controller.ftl | 16 +++---- .../normal/controller/app-controller.ftl | 20 ++++----- .../normal/controller/resource-controller.ftl | 20 ++++----- .../normal/controller/route-controller.ftl | 10 ++--- .../resources/template/normal/dao/i-dao.ftl | 4 +- .../resources/template/normal/pojo/dto.ftl | 21 +++++---- .../resources/template/normal/pojo/po.ftl | 1 - .../resources/template/normal/pojo/vo.ftl | 44 ++++++++++--------- .../template/normal/service/i-service.ftl | 3 -- .../template/normal/service/service-impl.ftl | 38 ++++++++-------- 12 files changed, 103 insertions(+), 91 deletions(-) diff --git a/src/main/java/ink/wgink/code/factory/factory/CheckBoxTableCellFactory.java b/src/main/java/ink/wgink/code/factory/factory/CheckBoxTableCellFactory.java index 0444c39..981704c 100644 --- a/src/main/java/ink/wgink/code/factory/factory/CheckBoxTableCellFactory.java +++ b/src/main/java/ink/wgink/code/factory/factory/CheckBoxTableCellFactory.java @@ -3,6 +3,7 @@ package ink.wgink.code.factory.factory; import com.sun.deploy.uitoolkit.impl.fx.ui.FXUIFactory; import ink.wgink.code.factory.vos.FieldVO; import javafx.beans.property.ReadOnlyObjectWrapper; +import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; @@ -34,6 +35,7 @@ public class CheckBoxTableCellFactory implements Callback call(TableColumn.CellDataFeatures param) { + FieldVO fieldVO = param.getValue(); CheckBox checkBox = new CheckBox(); if (StringUtils.equals(IS_FORM_SHOW, property)) { Boolean isFormShow = param.getValue().getFormShow(); @@ -47,6 +49,17 @@ public class CheckBoxTableCellFactory implements Callback { + if (StringUtils.equals(IS_FORM_SHOW, property)) { + fieldVO.setFormShow(newValue); + } + if (StringUtils.equals(IS_LIST_SHOW, property)) { + fieldVO.setListShow(newValue); + } + if (StringUtils.equals(IS_NOT_NULL, property)) { + fieldVO.setNotNull(newValue); + } + }); return new ReadOnlyObjectWrapper<>(checkBox); } } diff --git a/src/main/java/ink/wgink/code/factory/service/GenerateService.java b/src/main/java/ink/wgink/code/factory/service/GenerateService.java index 25d7f17..b4fe6d1 100644 --- a/src/main/java/ink/wgink/code/factory/service/GenerateService.java +++ b/src/main/java/ink/wgink/code/factory/service/GenerateService.java @@ -110,10 +110,10 @@ public class GenerateService { mySqlMapperCode("/normal/mapper/mysql-mapper.ftl", String.format("%s/mapper/%s", outFolder, tableName), tableName, dataModel); } if (generateVO.getHasHtml()) { - htmlCode("/normal/page", String.format("%s/route/%s", outFolder, tableName), tableName, dataModel); + htmlCode("/normal/page", String.format("%s/static/route/%s", outFolder, tableName), tableName, dataModel); } if (generateVO.getHasThymeleaf()) { - thymeleafCode("/normal/page", String.format("%s/route/%s", outFolder, tableName), tableName, dataModel); + thymeleafCode("/normal/page", String.format("%s/templates/%s", outFolder, tableName), tableName, dataModel); } if (generateVO.getHasRoute()) { routeCode("/normal/controller/route-controller.ftl", String.format("%s/controller/route/%s", outFolder, lowerTableName), firstUpperTableName, dataModel); diff --git a/src/main/resources/template/normal/controller/api-controller.ftl b/src/main/resources/template/normal/controller/api-controller.ftl index 9d236f4..238847d 100644 --- a/src/main/resources/template/normal/controller/api-controller.ftl +++ b/src/main/resources/template/normal/controller/api-controller.ftl @@ -2,16 +2,14 @@ package ${codePackage}.controller.api.${lowerTableName}; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; -import com.cm.common.constants.ISystemConstant; -import com.cm.common.pojo.ListPage; -import com.cm.common.result.ErrorResult; -import com.cm.common.result.SuccessResult; -import com.cm.common.result.SuccessResultData; -import com.cm.common.result.SuccessResultList; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO; import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; @@ -52,7 +50,7 @@ public class ${firstUpperTableName}Controller extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @DeleteMapping("remove/{ids}") public SuccessResult remove(@PathVariable("ids") String ids) { - ${firstLowerTableName}Service.remove(ids); + ${firstLowerTableName}Service.remove(Arrays.asList(ids.split("\\_"))); return new SuccessResult(); } diff --git a/src/main/resources/template/normal/controller/app-controller.ftl b/src/main/resources/template/normal/controller/app-controller.ftl index 6247ae8..108ef2a 100644 --- a/src/main/resources/template/normal/controller/app-controller.ftl +++ b/src/main/resources/template/normal/controller/app-controller.ftl @@ -2,12 +2,12 @@ package ${codePackage}.controller.app.api.${lowerTableName}; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; -import com.cm.common.constants.ISystemConstant; -import com.cm.common.pojo.ListPage; -import com.cm.common.result.ErrorResult; -import com.cm.common.result.SuccessResult; -import com.cm.common.result.SuccessResultData; -import com.cm.common.result.SuccessResultList; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO; import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service; @@ -54,7 +54,7 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @DeleteMapping("remove/{ids}") public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) { - ${firstLowerTableName}Service.remove(token, ids); + ${firstLowerTableName}Service.remove(token, Arrays.asList(ids.split("\\_"))); return new SuccessResult(); } @@ -104,7 +104,7 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage${lowerTableName}") - public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) throws SearchException { + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { Map params = requestParams(); page.setParams(params); return ${firstLowerTableName}Service.listPage(page); @@ -113,9 +113,9 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController { @ApiOperation(value = "${tableExplain}统计", notes = "${tableExplain}统计接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count") - SuccessResultData count() throws SearchException { + SuccessResultData count() { Map params = requestParams(); - return return new SuccessResultData<>(${firstLowerTableName}Service.count(params)); + return new SuccessResultData<>(${firstLowerTableName}Service.count(params)); } } \ No newline at end of file diff --git a/src/main/resources/template/normal/controller/resource-controller.ftl b/src/main/resources/template/normal/controller/resource-controller.ftl index 53e5d16..8dba9ae 100644 --- a/src/main/resources/template/normal/controller/resource-controller.ftl +++ b/src/main/resources/template/normal/controller/resource-controller.ftl @@ -2,12 +2,12 @@ package ${codePackage}.controller.resource.${lowerTableName}; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; -import com.cm.common.constants.ISystemConstant; -import com.cm.common.pojo.ListPage; -import com.cm.common.result.ErrorResult; -import com.cm.common.result.SuccessResult; -import com.cm.common.result.SuccessResultData; -import com.cm.common.result.SuccessResultList; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO; import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service; @@ -54,7 +54,7 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @DeleteMapping("remove/{ids}") public SuccessResult remove(@PathVariable("ids") String ids) { - ${firstLowerTableName}Service.remove(ids); + ${firstLowerTableName}Service.remove(Arrays.asList(ids.split("\\_"))); return new SuccessResult(); } @@ -104,7 +104,7 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage") - public SuccessResultList> listPage(ListPage page) throws SearchException { + public SuccessResultList> listPage(ListPage page) { Map params = requestParams(); page.setParams(params); return ${firstLowerTableName}Service.listPage(page); @@ -113,9 +113,9 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl @ApiOperation(value = "${tableExplain}统计", notes = "${tableExplain}统计接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count") - SuccessResultData count() throws SearchException { + SuccessResultData count() { Map params = requestParams(); - return return new SuccessResultData<>(${firstLowerTableName}Service.count(params)); + return new SuccessResultData<>(${firstLowerTableName}Service.count(params)); } } \ No newline at end of file diff --git a/src/main/resources/template/normal/controller/route-controller.ftl b/src/main/resources/template/normal/controller/route-controller.ftl index 1f8329f..b0d5905 100644 --- a/src/main/resources/template/normal/controller/route-controller.ftl +++ b/src/main/resources/template/normal/controller/route-controller.ftl @@ -1,14 +1,12 @@ -package ${codePackage}.controller.api.${lowerTableName}; +package ${codePackage}.controller.route.${lowerTableName}; import ink.wgink.common.base.DefaultBaseController; -import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO; +import ink.wgink.interfaces.consts.ISystemConstant; import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; import java.util.Arrays; import java.util.List; @@ -24,7 +22,7 @@ import java.util.Map; @Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "${tableExplain}路由") @RestController @RequestMapping(ISystemConstant.ROUTE_PREFIX + "/${lowerTableName}") -public class ${firstUpperTableName}Controller extends DefaultBaseController { +public class ${firstUpperTableName}RouteController extends DefaultBaseController { @GetMapping("save") public ModelAndView save() { diff --git a/src/main/resources/template/normal/dao/i-dao.ftl b/src/main/resources/template/normal/dao/i-dao.ftl index c311ea0..1b105ab 100644 --- a/src/main/resources/template/normal/dao/i-dao.ftl +++ b/src/main/resources/template/normal/dao/i-dao.ftl @@ -4,8 +4,8 @@ import ink.wgink.exceptions.RemoveException; import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SearchException; import ink.wgink.exceptions.UpdateException; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO; -import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO; +import ${codePackage}.pojo.bos.${lowerTableName}.${firstUpperTableName}BO; +import ${codePackage}.pojo.pos.${lowerTableName}.${firstUpperTableName}PO; import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; import org.springframework.stereotype.Repository; diff --git a/src/main/resources/template/normal/pojo/dto.ftl b/src/main/resources/template/normal/pojo/dto.ftl index c0c851c..297d190 100644 --- a/src/main/resources/template/normal/pojo/dto.ftl +++ b/src/main/resources/template/normal/pojo/dto.ftl @@ -15,24 +15,26 @@ import io.swagger.annotations.ApiModelProperty; public class ${firstUpperTableName}DTO { <#list fieldList! as field> - - <#if field.formFieldValue == "number"> + <#if field.listShow> + <#if field.formFieldValue == "number"> @ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}") private Integer ${field.propertyName}; - <#elseif field.formFieldValue == "double"> + <#elseif field.formFieldValue == "double"> @ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}") private Double ${field.propertyName}; - <#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select"> + <#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select"> @ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}") private String ${field.propertyName}; - <#else> + <#else> @ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}") private String ${field.propertyName}; + <#list fieldList! as field> - <#if field.formFieldValue == "number"> + <#if field.listShow> + <#if field.formFieldValue == "number"> public Integer get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? 0 : ${field.propertyName}; } @@ -41,7 +43,7 @@ public class ${firstUpperTableName}DTO { this.${field.propertyName} = ${field.propertyName}; } - <#elseif field.formFieldValue == "double"> + <#elseif field.formFieldValue == "double"> public Double get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? 0D : ${field.propertyName}; } @@ -50,7 +52,7 @@ public class ${firstUpperTableName}DTO { this.${field.propertyName} = ${field.propertyName}; } - <#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select"> + <#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select"> public String get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? "" : ${field.propertyName}.trim(); } @@ -59,7 +61,7 @@ public class ${firstUpperTableName}DTO { this.${field.propertyName} = ${field.propertyName}; } - <#else> + <#else> public String get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? "" : ${field.propertyName}.trim(); } @@ -68,6 +70,7 @@ public class ${firstUpperTableName}DTO { this.${field.propertyName} = ${field.propertyName}; } + diff --git a/src/main/resources/template/normal/pojo/po.ftl b/src/main/resources/template/normal/pojo/po.ftl index 8f8f0b3..de41678 100644 --- a/src/main/resources/template/normal/pojo/po.ftl +++ b/src/main/resources/template/normal/pojo/po.ftl @@ -8,7 +8,6 @@ package ${codePackage}.pojo.pos.${lowerTableName}; * @Date: ${date} * @Version: ${version} **/ -@ApiModel public class ${firstUpperTableName}PO { <#list fieldList! as field> diff --git a/src/main/resources/template/normal/pojo/vo.ftl b/src/main/resources/template/normal/pojo/vo.ftl index d0fc8c0..b16ef16 100644 --- a/src/main/resources/template/normal/pojo/vo.ftl +++ b/src/main/resources/template/normal/pojo/vo.ftl @@ -17,47 +17,50 @@ import io.swagger.annotations.ApiModelProperty; public class ${firstUpperTableName}VO { <#list fieldList! as field> + <#if field.formShow> @ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}") - <#if field.formFieldValue == "number"> + <#if field.formFieldValue == "number"> @CheckNumberAnnotation(name = "${field.columnComment}") private Integer ${field.propertyName}; - <#elseif field.formFieldValue == "double"> + <#elseif field.formFieldValue == "double"> @CheckNumberAnnotation(name = "${field.columnComment}") private Double ${field.propertyName}; - <#elseif field.formFieldValue == "date"> + <#elseif field.formFieldValue == "date"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "date") private String ${field.propertyName}; - <#elseif field.formFieldValue == "datetime"> + <#elseif field.formFieldValue == "datetime"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "datetime") private String ${field.propertyName}; - <#else> - <#if field.formFieldValue == "string"> - <#if field.verifyType?? && field.verifyType != "none"> - <#if field.verifyType == "phone"> + <#else> + <#if field.formFieldValue == "string"> + <#if field.verifyType?? && field.verifyType != "none"> + <#if field.verifyType == "phone"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "phone") - <#elseif field.verifyType == "email"> + <#elseif field.verifyType == "email"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "email") - <#elseif field.verifyType == "url"> + <#elseif field.verifyType == "url"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "url") - <#elseif field.verifyType == "number"> + <#elseif field.verifyType == "number"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "number") - <#elseif field.verifyType == "date"> + <#elseif field.verifyType == "date"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "date") - <#elseif field.verifyType == "identity"> + <#elseif field.verifyType == "identity"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "identity") - <#elseif field.verifyType == "custom"> + <#elseif field.verifyType == "custom"> @CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "custom", regex = "${field.verifyType}") - <#elseif field.verifyType == "required"> + <#elseif field.verifyType == "required"> @CheckEmptyAnnotation(name = "${field.columnComment}") + - private String ${field.propertyName}; + <#list fieldList! as field> - <#if field.formFieldValue == "number"> + <#if field.formShow> + <#if field.formFieldValue == "number"> public Integer get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? 0 : ${field.propertyName}; } @@ -66,7 +69,7 @@ public class ${firstUpperTableName}VO { this.${field.propertyName} = ${field.propertyName}; } - <#elseif field.formFieldValue == "double"> + <#elseif field.formFieldValue == "double"> public Double get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? 0D : ${field.propertyName}; } @@ -75,7 +78,7 @@ public class ${firstUpperTableName}VO { this.${field.propertyName} = ${field.propertyName}; } - <#elseif field.formFieldValue == "date" || field.formFieldValue == "datetime"> + <#elseif field.formFieldValue == "date" || field.formFieldValue == "datetime"> public String get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? "" : ${field.propertyName}.trim(); } @@ -84,7 +87,7 @@ public class ${firstUpperTableName}VO { this.${field.propertyName} = ${field.propertyName}; } - <#else> + <#else> public String get${field.firstUpperPropertyName}() { return ${field.propertyName} == null ? "" : ${field.propertyName}.trim(); } @@ -93,6 +96,7 @@ public class ${firstUpperTableName}VO { this.${field.propertyName} = ${field.propertyName}; } + diff --git a/src/main/resources/template/normal/service/i-service.ftl b/src/main/resources/template/normal/service/i-service.ftl index 9ce92d7..fcaa81f 100644 --- a/src/main/resources/template/normal/service/i-service.ftl +++ b/src/main/resources/template/normal/service/i-service.ftl @@ -75,7 +75,6 @@ public interface I${firstUpperTableName}Service { * 删除${tableExplain}(物理删除) * * @param ids id列表 - * @throws RemoveException */ void delete(List ids); @@ -175,7 +174,6 @@ public interface I${firstUpperTableName}Service { * * @param page * @return - * @throws SearchException */ SuccessResultList> listPage(ListPage page); @@ -184,7 +182,6 @@ public interface I${firstUpperTableName}Service { * * @param params * @return - * @throws SearchException */ Integer count(Map params); diff --git a/src/main/resources/template/normal/service/service-impl.ftl b/src/main/resources/template/normal/service/service-impl.ftl index 16316a9..918b43e 100644 --- a/src/main/resources/template/normal/service/service-impl.ftl +++ b/src/main/resources/template/normal/service/service-impl.ftl @@ -4,7 +4,7 @@ import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultList; -import ink.wgink.pojo.utils.HashMapUtil; +import ink.wgink.util.map.HashMapUtil; import ink.wgink.util.UUIDUtil; import ${codePackage}.dao.${lowerTableName}.I${firstUpperTableName}Dao; import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO; @@ -34,12 +34,12 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem private I${firstUpperTableName}Dao ${firstLowerTableName}Dao; @Override - public SuccessResult save(${firstUpperTableName}VO ${firstLowerTableName}VO) { + public void save(${firstUpperTableName}VO ${firstLowerTableName}VO) { saveReturnId(${firstLowerTableName}VO); } @Override - public SuccessResult save(String token, ${firstUpperTableName}VO ${firstLowerTableName}VO) { + public void save(String token, ${firstUpperTableName}VO ${firstLowerTableName}VO) { saveReturnId(token, ${firstLowerTableName}VO); } @@ -63,20 +63,20 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem } @Override - public void remove(String ids) { + public void remove(List ids) { remove(null, ids); } @Override - public void remove(String token, String ids) { + public void remove(String token, List ids) { Map params = getHashMap(2); params.put("${firstLowerTableName}Ids", ids); if (StringUtils.isBlank(token)) { setUpdateInfo(params); } else { - setAppUpdateInfo(params, token); + setAppUpdateInfo(token, params); } - userDao.remove(params); + ${firstLowerTableName}Dao.remove(params); } @Override @@ -104,58 +104,58 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem } @Override - public ${firstUpperTableName}DTO get(Map params) throws SearchException { + public ${firstUpperTableName}DTO get(Map params) { return ${firstLowerTableName}Dao.get(params); } @Override - public ${firstUpperTableName}DTO get(String ${firstLowerTableName}Id) throws SearchException { + public ${firstUpperTableName}DTO get(String ${firstLowerTableName}Id) { Map params = super.getHashMap(2); params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id); return get(params); } @Override - public ${firstUpperTableName}BO getBO(Map params) throws SearchException { + public ${firstUpperTableName}BO getBO(Map params) { return ${firstLowerTableName}Dao.getBO(params); } @Override - public ${firstUpperTableName}BO getBO(String ${firstLowerTableName}Id) throws SearchException { + public ${firstUpperTableName}BO getBO(String ${firstLowerTableName}Id) { Map params = super.getHashMap(2); params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id); return getBO(params); } @Override - public ${firstUpperTableName}PO getPO(Map params) throws SearchException { + public ${firstUpperTableName}PO getPO(Map params) { return ${firstLowerTableName}Dao.getPO(params); } @Override - public ${firstUpperTableName}PO getPO(String ${firstLowerTableName}Id) throws SearchException { + public ${firstUpperTableName}PO getPO(String ${firstLowerTableName}Id) { Map params = super.getHashMap(2); params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id); return getPO(params); } @Override - public List<${firstUpperTableName}DTO> list(Map params) throws SearchException { + public List<${firstUpperTableName}DTO> list(Map params) { return ${firstLowerTableName}Dao.list(params); } @Override - public List<${firstUpperTableName}BO> listBO(Map params) throws SearchException { + public List<${firstUpperTableName}BO> listBO(Map params) { return ${firstLowerTableName}Dao.listBO(params); } @Override - public List<${firstUpperTableName}PO> listPO(Map params) throws SearchException { + public List<${firstUpperTableName}PO> listPO(Map params) { return ${firstLowerTableName}Dao.listPO(params); } @Override - public SuccessResultList> listPage(ListPage page) throws SearchException { + public SuccessResultList> listPage(ListPage page) { PageHelper.startPage(page.getPage(), page.getRows()); List<${firstUpperTableName}DTO> ${firstLowerTableName}DTOs = list(page.getParams()); PageInfo<${firstUpperTableName}DTO> pageInfo = new PageInfo<>(${firstLowerTableName}DTOs); @@ -163,8 +163,8 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem } @Override - public Integer count(Map params) throws SearchException { - Integer count = ${firstLowerTableName}Dao.count${firstUpperTableName}(params); + public Integer count(Map params) { + Integer count = ${firstLowerTableName}Dao.count(params); return count == null ? 0 : count; }