更新模版样式
This commit is contained in:
parent
6fa7d8cd78
commit
b1a1bceb1e
|
|
@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -29,8 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/system/address")
|
@RequestMapping("/system/address")
|
||||||
public class AddressController extends BaseController
|
public class AddressController extends BaseController {
|
||||||
{
|
|
||||||
private final static String PREFIX = "system/address";
|
private final static String PREFIX = "system/address";
|
||||||
private final static String ROOT = "0";
|
private final static String ROOT = "0";
|
||||||
|
|
||||||
|
|
@ -48,6 +48,9 @@ public class AddressController extends BaseController
|
||||||
@GetMapping("/childrenList")
|
@GetMapping("/childrenList")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Address> selectAddressByParentCode(String code) {
|
public List<Address> selectAddressByParentCode(String code) {
|
||||||
|
|
||||||
|
Long userId = ShiroUtils.getUserId();
|
||||||
|
//TODO 过滤未分配区域
|
||||||
return addressService.selectAddressByParentCode(code);
|
return addressService.selectAddressByParentCode(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,8 +60,7 @@ public class AddressController extends BaseController
|
||||||
@RequiresPermissions("system:address:list")
|
@RequiresPermissions("system:address:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(Address address)
|
public TableDataInfo list(Address address) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
if (StringUtils.isBlank(address.getAreaCode())
|
if (StringUtils.isBlank(address.getAreaCode())
|
||||||
|| StringUtils.isBlank(address.getAreaName())
|
|| StringUtils.isBlank(address.getAreaName())
|
||||||
|
|
@ -77,8 +79,7 @@ public class AddressController extends BaseController
|
||||||
@Log(title = "地区信息", businessType = BusinessType.EXPORT)
|
@Log(title = "地区信息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(Address address)
|
public AjaxResult export(Address address) {
|
||||||
{
|
|
||||||
List<Address> list = addressService.selectAddressList(address);
|
List<Address> list = addressService.selectAddressList(address);
|
||||||
ExcelUtil<Address> util = new ExcelUtil<Address>(Address.class);
|
ExcelUtil<Address> util = new ExcelUtil<Address>(Address.class);
|
||||||
return util.exportExcel(list, "address");
|
return util.exportExcel(list, "address");
|
||||||
|
|
@ -109,8 +110,7 @@ public class AddressController extends BaseController
|
||||||
* 修改地区信息
|
* 修改地区信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/edit/{id}")
|
||||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||||
{
|
|
||||||
Address address = addressService.selectAddressById(id);
|
Address address = addressService.selectAddressById(id);
|
||||||
mmap.put("address", address);
|
mmap.put("address", address);
|
||||||
return PREFIX + "/edit";
|
return PREFIX + "/edit";
|
||||||
|
|
|
||||||
|
|
@ -36,29 +36,18 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>省:</label>
|
<label>省:</label>
|
||||||
<select name="provinceForm"
|
<select name="provinceForm" th:onchange="changeAreaCode('provinceSelect')"
|
||||||
th:with="areas=${@iAddressService.selectAddressByParentCode('0')}">
|
th:with="areas=${@iAddressService.selectAddressByParentCode('0')}">
|
||||||
<option th:each="area : ${areas}"
|
|
||||||
th:text="${area.areaName}"
|
|
||||||
th:value="${area.areaCode}" onclick="alert(0)"/>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>市:</label>
|
<label>市:</label>
|
||||||
<select name="provinceForm"
|
<select id="countrySelect" name="countryCode" th:onchange="changeAreaCode('countrySelect')">
|
||||||
th:with="areas=${@iAddressService.selectAddressByParentCode('0')}">
|
|
||||||
<option th:each="area : ${areas}"
|
|
||||||
th:text="${area.areaName}"
|
|
||||||
th:value="${area.areaCode}" onclick="alert(0)"/>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>县:</label>
|
<label>县:</label>
|
||||||
<select name="provinceForm"
|
<select id="townSelect" name="townCode" th:onchange="changeAreaCode('townSelect')">
|
||||||
th:with="areas=${@iAddressService.selectAddressByParentCode('0')}">
|
|
||||||
<option th:each="area : ${areas}"
|
|
||||||
th:text="${area.areaName}"
|
|
||||||
th:value="${area.areaCode}" onclick="alert(0)"/>
|
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -93,7 +82,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script th:inline="javascript">
|
<script language="JavaScript" th:inline="javascript">
|
||||||
var editFlag = [[${@permission.hasPermi('system:firm:edit')}]];
|
var editFlag = [[${@permission.hasPermi('system:firm:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('system:firm:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('system:firm:remove')}]];
|
||||||
var prefix = ctx + "system/firm";
|
var prefix = ctx + "system/firm";
|
||||||
|
|
@ -232,6 +221,43 @@
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function changeAreaCode(selectId) {
|
||||||
|
var code = '0';
|
||||||
|
var nextSelectId = "";
|
||||||
|
if ("provinceSelect" == selectId) {
|
||||||
|
$("#citySelect").empty();
|
||||||
|
$("#countrySelect").empty();
|
||||||
|
$("#townSelect").empty();
|
||||||
|
code = $("#provinceSelect").find("option:selected").attr("value");
|
||||||
|
nextSelectId = "citySelect";
|
||||||
|
} else if ("citySelect" == selectId) {
|
||||||
|
code = $("#citySelect").find("option:selected").attr("value");
|
||||||
|
nextSelectId = "countrySelect";
|
||||||
|
} else if ("countrySelect" == selectId) {
|
||||||
|
code = $("#countrySelect").find("option:selected").attr("value");
|
||||||
|
nextSelectId = "townSelect";
|
||||||
|
} else if ("townSelect" == selectId) {
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/system/address/childrenList',
|
||||||
|
dataType : "json",
|
||||||
|
async:true,
|
||||||
|
data:{code:code},
|
||||||
|
success:function (result) {
|
||||||
|
var str='<option value="">--请选择--</option>';
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str+='<option value='+result[i].areaCode+'>'+result[i].areaName+'</option>';
|
||||||
|
}
|
||||||
|
$("#" + nextSelectId + "").html(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -32,8 +32,7 @@ import com.ruoyi.common.core.domain.Ztree;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/${moduleName}/${businessName}")
|
@RequestMapping("/${moduleName}/${businessName}")
|
||||||
public class ${ClassName}Controller extends BaseController
|
public class ${ClassName}Controller extends BaseController {
|
||||||
{
|
|
||||||
private String prefix = "${moduleName}/${businessName}";
|
private String prefix = "${moduleName}/${businessName}";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -53,8 +52,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@RequiresPermissions("${permissionPrefix}:list")
|
@RequiresPermissions("${permissionPrefix}:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(${ClassName} ${className})
|
public TableDataInfo list(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|
@ -66,8 +64,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@RequiresPermissions("${permissionPrefix}:list")
|
@RequiresPermissions("${permissionPrefix}:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<${ClassName}> list(${ClassName} ${className})
|
public List<${ClassName}> list(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
@ -80,8 +77,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(${ClassName} ${className})
|
public AjaxResult export(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
||||||
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
|
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
|
||||||
return util.exportExcel(list, "${businessName}");
|
return util.exportExcel(list, "${businessName}");
|
||||||
|
|
@ -101,10 +97,8 @@ public class ${ClassName}Controller extends BaseController
|
||||||
* 新增${functionName}
|
* 新增${functionName}
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = { "/add/{${pkColumn.javaField}}", "/add/" })
|
@GetMapping(value = { "/add/{${pkColumn.javaField}}", "/add/" })
|
||||||
public String add(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap)
|
public String add(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) {
|
||||||
{
|
if (StringUtils.isNotNull(${pkColumn.javaField})) {
|
||||||
if (StringUtils.isNotNull(${pkColumn.javaField}))
|
|
||||||
{
|
|
||||||
mmap.put("${className}", ${className}Service.select${ClassName}ById(${pkColumn.javaField}));
|
mmap.put("${className}", ${className}Service.select${ClassName}ById(${pkColumn.javaField}));
|
||||||
}
|
}
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
|
|
@ -118,8 +112,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(${ClassName} ${className})
|
public AjaxResult addSave(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
return toAjax(${className}Service.insert${ClassName}(${className}));
|
return toAjax(${className}Service.insert${ClassName}(${className}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,8 +120,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
* 修改${functionName}
|
* 修改${functionName}
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{${pkColumn.javaField}}")
|
@GetMapping("/edit/{${pkColumn.javaField}}")
|
||||||
public String edit(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}, ModelMap mmap)
|
public String edit(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}, ModelMap mmap) {
|
||||||
{
|
|
||||||
${ClassName} ${className} = ${className}Service.select${ClassName}ById(${pkColumn.javaField});
|
${ClassName} ${className} = ${className}Service.select${ClassName}ById(${pkColumn.javaField});
|
||||||
mmap.put("${className}", ${className});
|
mmap.put("${className}", ${className});
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
|
|
@ -141,8 +133,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(${ClassName} ${className})
|
public AjaxResult editSave(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
return toAjax(${className}Service.update${ClassName}(${className}));
|
return toAjax(${className}Service.update${ClassName}(${className}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,8 +157,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||||
@GetMapping("/remove/{${pkColumn.javaField}}")
|
@GetMapping("/remove/{${pkColumn.javaField}}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
public AjaxResult remove(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||||
{
|
|
||||||
return toAjax(${className}Service.delete${ClassName}ById(${pkColumn.javaField}));
|
return toAjax(${className}Service.delete${ClassName}ById(${pkColumn.javaField}));
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
@ -178,8 +168,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
*/
|
*/
|
||||||
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
|
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
|
||||||
@GetMapping(value = { "/select${BusinessName}Tree/{${pkColumn.javaField}}", "/select${BusinessName}Tree/" })
|
@GetMapping(value = { "/select${BusinessName}Tree/{${pkColumn.javaField}}", "/select${BusinessName}Tree/" })
|
||||||
public String select${BusinessName}Tree(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap)
|
public String select${BusinessName}Tree(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) {
|
||||||
{
|
|
||||||
if (StringUtils.isNotNull(${pkColumn.javaField}))
|
if (StringUtils.isNotNull(${pkColumn.javaField}))
|
||||||
{
|
{
|
||||||
mmap.put("${className}", ${className}Service.select${ClassName}ById(${pkColumn.javaField}));
|
mmap.put("${className}", ${className}Service.select${ClassName}ById(${pkColumn.javaField}));
|
||||||
|
|
@ -192,8 +181,7 @@ public class ${ClassName}Controller extends BaseController
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData")
|
@GetMapping("/treeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Ztree> treeData()
|
public List<Ztree> treeData() {
|
||||||
{
|
|
||||||
List<Ztree> ztrees = ${className}Service.select${ClassName}Tree();
|
List<Ztree> ztrees = ${className}Service.select${ClassName}Tree();
|
||||||
return ztrees;
|
return ztrees;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
#set($Entity="TreeEntity")
|
#set($Entity="TreeEntity")
|
||||||
#end
|
#end
|
||||||
|
@Data
|
||||||
public class ${ClassName} extends ${Entity}
|
public class ${ClassName} extends ${Entity}
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -56,29 +57,8 @@ public class ${ClassName} extends ${Entity}
|
||||||
#else
|
#else
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
#end
|
#end
|
||||||
public void set${AttrName}($column.javaType $column.javaField)
|
|
||||||
{
|
|
||||||
this.$column.javaField = $column.javaField;
|
|
||||||
}
|
|
||||||
|
|
||||||
public $column.javaType get${AttrName}()
|
|
||||||
{
|
|
||||||
return $column.javaField;
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
|
||||||
#set($AttrName=$column.javaField)
|
|
||||||
#else
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#end
|
|
||||||
.append("${column.javaField}", get${AttrName}())
|
|
||||||
#end
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ import ${packageName}.domain.${ClassName};
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
public interface ${ClassName}Mapper
|
public interface ${ClassName}Mapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}
|
* 查询${functionName}
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ import com.ruoyi.common.core.domain.Ztree;
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
public interface I${ClassName}Service
|
public interface I${ClassName}Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}
|
* 查询${functionName}
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ import com.ruoyi.common.core.text.Convert;
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ${ClassName}Mapper ${className}Mapper;
|
private ${ClassName}Mapper ${className}Mapper;
|
||||||
|
|
||||||
|
|
@ -38,8 +37,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
* @return ${functionName}
|
* @return ${functionName}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
|
public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||||
{
|
|
||||||
return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField});
|
return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,8 +48,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
* @return ${functionName}
|
* @return ${functionName}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
return ${className}Mapper.select${ClassName}List(${className});
|
return ${className}Mapper.select${ClassName}List(${className});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,8 +60,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insert${ClassName}(${ClassName} ${className})
|
public int insert${ClassName}(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.javaField == 'createTime')
|
#if($column.javaField == 'createTime')
|
||||||
${className}.setCreateTime(DateUtils.getNowDate());
|
${className}.setCreateTime(DateUtils.getNowDate());
|
||||||
|
|
@ -81,8 +77,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int update${ClassName}(${ClassName} ${className})
|
public int update${ClassName}(${ClassName} ${className}) {
|
||||||
{
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.javaField == 'updateTime')
|
#if($column.javaField == 'updateTime')
|
||||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
${className}.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
|
@ -99,8 +94,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int delete${ClassName}ByIds(String ids)
|
public int delete${ClassName}ByIds(String ids) {
|
||||||
{
|
|
||||||
return ${className}Mapper.delete${ClassName}ByIds(Convert.toStrArray(ids));
|
return ${className}Mapper.delete${ClassName}ByIds(Convert.toStrArray(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,8 +105,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
|
public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||||
{
|
|
||||||
return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField});
|
return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField});
|
||||||
}
|
}
|
||||||
#if($table.tree)
|
#if($table.tree)
|
||||||
|
|
@ -123,12 +116,10 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||||
* @return 所有${functionName}信息
|
* @return 所有${functionName}信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Ztree> select${ClassName}Tree()
|
public List<Ztree> select${ClassName}Tree() {
|
||||||
{
|
|
||||||
List<${ClassName}> ${className}List = ${className}Mapper.select${ClassName}List(new ${ClassName}());
|
List<${ClassName}> ${className}List = ${className}Mapper.select${ClassName}List(new ${ClassName}());
|
||||||
List<Ztree> ztrees = new ArrayList<Ztree>();
|
List<Ztree> ztrees = new ArrayList<Ztree>();
|
||||||
for (${ClassName} ${className} : ${className}List)
|
for (${ClassName} ${className} : ${className}List) {
|
||||||
{
|
|
||||||
Ztree ztree = new Ztree();
|
Ztree ztree = new Ztree();
|
||||||
#set($TreeCode=$treeCode.substring(0,1).toUpperCase() + ${treeCode.substring(1)})
|
#set($TreeCode=$treeCode.substring(0,1).toUpperCase() + ${treeCode.substring(1)})
|
||||||
#set($TreeParentCode=$treeParentCode.substring(0,1).toUpperCase() + ${treeParentCode.substring(1)})
|
#set($TreeParentCode=$treeParentCode.substring(0,1).toUpperCase() + ${treeParentCode.substring(1)})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue