缓存线载具、位置、区域管理的基础功能、代码生成的模板修改
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
|
||||
package ${package}.rest;
|
||||
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.annotation.Log;
|
||||
import ${package}.service.${className}Service;
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
|
||||
@@ -4,15 +4,15 @@ import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import java.io.Serializable;
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
@@ -23,18 +23,18 @@ import java.io.Serializable;
|
||||
@Data
|
||||
public class ${className}Dto implements Serializable {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#list columns as column>
|
||||
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#list>
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
package ${package}.service;
|
||||
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
|
||||
package ${package}.service.impl;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import ${package}.service.${className}Service;
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -14,9 +19,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -33,18 +36,18 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<${className}Dto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(${className}Dto.class);
|
||||
return null;
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(${className}Dto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +55,7 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = wo.query("${pkChangeColName} = '" + ${pkChangeColName} + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -62,7 +65,7 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -73,7 +76,6 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
dto.set${pkChangeColName ? cap_first }(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
|
||||
@@ -113,13 +113,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { <#if columns??><#list columns as column>${column.changeColumnName}: null<#if column_has_next>, </#if></#list></#if> }
|
||||
const defaultForm = {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
${column.changeColumnName}: null<#if column_has_next>,</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
export default {
|
||||
name: '${className}',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
|
||||
Reference in New Issue
Block a user