Commit 40852235 authored by dqjdda's avatar dqjdda
Browse files

Merge branch '2.4dev' into 2.3opt

parents 4681ca6e 776cee4b
......@@ -4,6 +4,7 @@ import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
/**
* @author Zheng Jie
......@@ -18,9 +19,6 @@ public class JobQueryCriteria {
@Query
private Boolean isSuccess;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
......@@ -42,6 +42,14 @@ public class DictController {
dictService.download(dictService.queryAll(criteria), response);
}
@Log("查询字典")
@ApiOperation("查询字典")
@GetMapping(value = "/all")
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity all(){
return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK);
}
@Log("查询字典")
@ApiOperation("查询字典")
@GetMapping
......
......@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @author Zheng Jie
......@@ -51,8 +52,7 @@ public class JobController {
@ApiOperation("查询岗位")
@GetMapping
@PreAuthorize("@el.check('job:list','user:list')")
public ResponseEntity getJobs(JobQueryCriteria criteria,
Pageable pageable){
public ResponseEntity getJobs(JobQueryCriteria criteria, Pageable pageable){
// 数据权限
criteria.setDeptIds(dataScope.getDeptIds());
return new ResponseEntity<>(jobService.queryAll(criteria, pageable),HttpStatus.OK);
......
......@@ -4,7 +4,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.aop.log.Log;
import me.zhengjie.config.DataScope;
import me.zhengjie.modules.tools.domain.VerificationCode;
import me.zhengjie.domain.VerificationCode;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.system.domain.vo.UserPassVo;
......@@ -12,7 +12,7 @@ import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDTO;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import me.zhengjie.modules.tools.service.VerificationCodeService;
import me.zhengjie.service.VerificationCodeService;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.service.UserService;
import org.springframework.data.domain.Pageable;
......
......@@ -4,6 +4,7 @@ import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;
/**
......@@ -25,9 +26,6 @@ public class DeptQueryCriteria{
@Query
private Long pid;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
\ No newline at end of file
......@@ -22,5 +22,7 @@ public class DictDetailDTO implements Serializable {
private String sort;
private DictSmallDTO dict;
private Timestamp createTime;
}
\ No newline at end of file
package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Getter
@Setter
public class DictSmallDTO implements Serializable {
private Long id;
}
......@@ -3,9 +3,8 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhengjie.annotation.Query;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;
/**
......@@ -28,9 +27,6 @@ public class JobQueryCriteria {
@Query(propName = "id", joinName = "dept", type = Query.Type.IN)
private Set<Long> deptIds;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
/**
* 公共查询类
......@@ -15,9 +16,6 @@ public class MenuQueryCriteria {
@Query(blurry = "name,path,component")
private String blurry;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
......@@ -4,6 +4,7 @@ import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
/**
* 公共查询类
......@@ -15,9 +16,6 @@ public class RoleQueryCriteria {
@Query(blurry = "name,remark")
private String blurry;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
......@@ -4,6 +4,7 @@ import lombok.Data;
import me.zhengjie.annotation.Query;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;
/**
......@@ -28,9 +29,6 @@ public class UserQueryCriteria implements Serializable {
private Long deptId;
@Query(type = Query.Type.GREATER_THAN,propName = "createTime")
private Timestamp startTime;
@Query(type = Query.Type.LESS_THAN,propName = "createTime")
private Timestamp endTime;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
......@@ -10,7 +10,7 @@ import org.mapstruct.ReportingPolicy;
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
@Mapper(componentModel = "spring", uses = {DictSmallMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DictDetailMapper extends BaseMapper<DictDetailDTO, DictDetail> {
}
\ No newline at end of file
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.service.dto.DictDTO;
import me.zhengjie.modules.system.service.dto.DictSmallDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DictSmallMapper extends BaseMapper<DictSmallDTO, Dict> {
}
\ No newline at end of file
......@@ -70,4 +70,13 @@ public class ${className}Controller {
${changeClassName}Service.delete(${pkChangeColName});
return new ResponseEntity(HttpStatus.OK);
}
@Log("多选删除${className}")
@ApiOperation("多选删除${className}")
@PreAuthorize("@el.check('${changeClassName}:del')")
@DeleteMapping
public ResponseEntity deleteAll(@RequestBody ${pkColumnType}[] ids) {
${changeClassName}Service.deleteAll(ids);
return new ResponseEntity(HttpStatus.OK);
}
}
\ No newline at end of file
......@@ -23,8 +23,8 @@ public class ${className}DTO implements Serializable {
<#if columns??>
<#list columns as column>
<#if column.columnComment != ''>
// ${column.columnComment}
<#if column.remark != ''>
// ${column.remark}
</#if>
<#if column.columnKey = 'PRI'>
<#if !auto && pkColumnType = 'Long'>
......
......@@ -4,6 +4,14 @@ import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
<#if isNotNullColumns??>
import javax.validation.constraints.*;
</#if>
<#if hasDateAnnotation>
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
</#if>
<#if hasTimestamp>
import java.sql.Timestamp;
</#if>
......@@ -23,8 +31,8 @@ public class ${className} implements Serializable {
<#if columns??>
<#list columns as column>
<#if column.columnComment != ''>
// ${column.columnComment}
<#if column.remark != ''>
// ${column.remark}
</#if>
<#if column.columnKey = 'PRI'>
@Id
......@@ -32,7 +40,21 @@ public class ${className} implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
</#if>
</#if>
@Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.isNullable = 'NO' && column.columnKey != 'PRI'>,nullable = false</#if>)
@Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.istNotNull && column.columnKey != 'PRI'>,nullable = false</#if>)
<#if column.istNotNull && column.columnKey != 'PRI'>
<#if column.columnType = 'String'>
@NotBlank
<#else>
@NotNull
</#if>
</#if>
<#if column.dateAnnotation??>
<#if column.dateAnnotation = 'CreationTimestamp'>
@CreationTimestamp
<#else>
@UpdateTimestamp
</#if>
</#if>
private ${column.columnType} ${column.changeColumnName};
</#list>
</#if>
......
......@@ -7,6 +7,9 @@ import java.sql.Timestamp;
<#if queryHasBigDecimal>
import java.math.BigDecimal;
</#if>
<#if dateRanges??>
import java.util.List;
</#if>
<#if queryColumns??>
import me.zhengjie.annotation.Query;
</#if>
......@@ -20,15 +23,37 @@ public class ${className}QueryCriteria{
<#if queryColumns??>
<#list queryColumns as column>
<#if column.columnQuery = '1'>
// 模糊
@Query(type = Query.Type.INNER_LIKE)
</#if>
<#if column.columnQuery = '2'>
<#if column.queryType = '='>
// 精确
@Query
</#if>
private ${column.columnType} ${column.changeColumnName};
</#if>
<#if column.queryType = 'Like'>
// 模糊
@Query(type = Query.Type.INNER_LIKE)
private ${column.columnType} ${column.changeColumnName};
</#if>
<#if column.queryType = '!='>
// 不等于
@Query(type = Query.Type.NOT_EQUAL)
private ${column.columnType} ${column.changeColumnName};
</#if>
<#if column.queryType = '>='>
// 大于等于
@Query(type = Query.Type.GREATER_THAN)
private ${column.columnType} ${column.changeColumnName};
</#if>
<#if column.queryType = '<='>
// 小于等于
@Query(type = Query.Type.LESS_THAN)
private ${column.columnType} ${column.changeColumnName};
</#if>
</#list>
</#if>
<#if dateRanges??>
<#list dateRanges as column>
@Query(type = Query.Type.BETWEEN)
private List<${column.columnType}> createTime;
</#list>
</#if>
}
\ No newline at end of file
......@@ -43,5 +43,7 @@ public interface ${className}Service {
void delete(${pkColumnType} ${pkChangeColName});
void deleteAll(${pkColumnType}[] ids);
void download(List<${className}DTO> all, HttpServletResponse response) throws IOException;
}
\ No newline at end of file
......@@ -133,6 +133,13 @@ public class ${className}ServiceImpl implements ${className}Service {
${changeClassName}Repository.deleteById(${pkChangeColName});
}
@Override
@CacheEvict(allEntries = true)
public void deleteAll(${pkColumnType}[] ids) {
for (${pkColumnType} id : ids) {
${changeClassName}Repository.deleteById(${pkChangeColName});
}
}
@Override
public void download(List<${className}DTO> all, HttpServletResponse response) throws IOException {
......@@ -141,8 +148,8 @@ public class ${className}ServiceImpl implements ${className}Service {
Map<String,Object> map = new LinkedHashMap<>();
<#list columns as column>
<#if column.columnKey != 'PRI'>
<#if column.columnComment != ''>
map.put("${column.columnComment}", ${changeClassName}.get${column.capitalColumnName}());
<#if column.remark != ''>
map.put("${column.remark}", ${changeClassName}.get${column.capitalColumnName}());
<#else>
map.put(" ${column.changeColumnName}", ${changeClassName}.get${column.capitalColumnName}());
</#if>
......
......@@ -14,6 +14,13 @@ export function del(${pkChangeColName}) {
method: 'delete'
})
}
export function delAll(ids) {
return request({
url: 'api/${changeClassName}/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment