等级方案 接口优化
parent
7eefb4c928
commit
2f282aa5c4
@ -1,27 +0,0 @@
|
||||
package com.engine.organization.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 薪资公式计算器-变量
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface OrganizationFormulaVar {
|
||||
|
||||
int labelId();
|
||||
|
||||
String defaultLabel();
|
||||
|
||||
String dataType();
|
||||
|
||||
String fieldId() default "";
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package com.engine.organization.common;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO 基础查询参数
|
||||
* @Date 2022/3/17
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseQueryParam {
|
||||
//当前页码
|
||||
private Integer current = 1;
|
||||
|
||||
//每页数据条数
|
||||
private Integer pageSize = 10;
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package com.engine.organization.common;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 日期范围
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LocalDateRange {
|
||||
|
||||
//"开始日期
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date fromDate;
|
||||
|
||||
//结束日期
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date endDate;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.engine.organization.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import weaver.general.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Description: TODO
|
||||
* @Date 2022/5/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QueryParam {
|
||||
private String ids;
|
||||
|
||||
public Collection<Long> getIds() {
|
||||
if(StringUtil.isEmpty(ids)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Long> collect = Arrays.stream(ids.split(",")).map(item -> Long.parseLong(item)).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.engine.organization.entity.scheme.dto;
|
||||
|
||||
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Description: TODO
|
||||
* @Date 2022/5/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SchemeDTO {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String schemeNo;
|
||||
/**
|
||||
* 方案名称
|
||||
*/
|
||||
private String schemeName;
|
||||
/**
|
||||
* 方案说明
|
||||
*/
|
||||
private String schemeDescription;
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
private int forbiddenTag;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private int deleteType;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
public static SchemePO convertToPO(Map<String, Object> param, Long employeeId) {
|
||||
if (param == null) {
|
||||
return null;
|
||||
}
|
||||
return SchemePO.builder()
|
||||
.id(param.get("id") == null ? 0 : Integer.parseInt((String) param.get("id")))
|
||||
.schemeNo(param.get("scheme_no") == null ? null : (String) param.get("scheme_no"))
|
||||
.schemeName(param.get("scheme_name") == null ? null : (String) param.get("scheme_name"))
|
||||
.schemeDescription(param.get("scheme_description") == null ? null : (String) param.get("descrscheme_descriptioniption"))
|
||||
.forbiddenTag(param.get("forbidden_tag") == null ? 0 : Integer.parseInt((String) param.get("forbidden_tag")))
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static SchemePO convertParamToPO(SchemeSearchParam param, Long employeeId) {
|
||||
if (param == null) {
|
||||
return null;
|
||||
}
|
||||
return SchemePO.builder()
|
||||
.id(param.getId() == null ? 0 : param.getId())
|
||||
.schemeNo(param.getSchemeNo() == null ? null : param.getSchemeNo())
|
||||
.schemeName(param.getSchemeName() == null ? null : param.getSchemeName())
|
||||
.schemeDescription(param.getSchemeDescription() == null ? null : param.getSchemeDescription())
|
||||
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 1 : 0)
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
@ -1,34 +1,41 @@
|
||||
package com.engine.organization.entity.scheme.param;
|
||||
|
||||
import com.engine.organization.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资项目查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
* @Author dxfeng
|
||||
* @Description: TODO
|
||||
* @Date 2022/5/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SchemeSearchParam extends BaseQueryParam {
|
||||
public class SchemeSearchParam {
|
||||
|
||||
private Long id;
|
||||
//名称
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String schemeNo;
|
||||
|
||||
//备注
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String schemeName;
|
||||
|
||||
/**
|
||||
* 方案说明
|
||||
*/
|
||||
private String schemeDescription;
|
||||
|
||||
private Integer forbiddenTag;
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
private Boolean forbiddenTag;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,221 @@
|
||||
package com.engine.organization.util;
|
||||
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.api.browser.util.ConditionType;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Description: TODO
|
||||
* @Date 2022/5/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class OrganizationFormItemUtil {
|
||||
|
||||
/**
|
||||
* 下拉框
|
||||
* @param user
|
||||
* @param selectOptions
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param labelcol
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem selectItem(User user, List<SearchConditionOption> selectOptions, int colSpan, int fieldcol,
|
||||
int labelcol, boolean isQuickSearch, String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT,502327,name);
|
||||
select.setOptions(selectOptions);
|
||||
select.setColSpan(colSpan);
|
||||
select.setFieldcol(fieldcol);
|
||||
select.setLabelcol(labelcol);
|
||||
select.setIsQuickSearch(isQuickSearch);
|
||||
select.setLabel(label);
|
||||
return select;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checkbox
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem checkboxItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, boolean isQuickSearch, String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX,502327,name);
|
||||
checkbox.setColSpan(colSpan);
|
||||
checkbox.setFieldcol(fieldcol);
|
||||
checkbox.setViewAttr(viewAttr);
|
||||
checkbox.setIsQuickSearch(isQuickSearch);
|
||||
checkbox.setLabel(label);
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输入框数字
|
||||
* @param user
|
||||
* @param rules
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputNumberItem(User user,String rules,int colSpan, int fieldcol,
|
||||
int viewAttr, String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER,502327, name);
|
||||
inputnumber.setColSpan(colSpan);
|
||||
inputnumber.setFieldcol(fieldcol);
|
||||
inputnumber.setViewAttr(viewAttr);
|
||||
inputnumber.setLabel(label);
|
||||
inputnumber.setRules(rules);
|
||||
|
||||
return inputnumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输入框文本
|
||||
* @param user
|
||||
* @param rules
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param length
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputItem(User user,String rules,int colSpan, int fieldcol,
|
||||
int viewAttr,int length, String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT,25034, name);
|
||||
input.setColSpan(colSpan);
|
||||
input.setFieldcol(fieldcol);
|
||||
input.setViewAttr(viewAttr);
|
||||
input.setLength(length);
|
||||
input.setLabel(label);
|
||||
input.setRules(rules);
|
||||
return input;
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览按钮
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @param rules
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem browserItem(User user,int colSpan, int fieldcol,
|
||||
int viewAttr,boolean isQuickSearch,String label,String rules,String type,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER,502327,name,type);
|
||||
browser.setColSpan(colSpan);
|
||||
browser.setFieldcol(fieldcol);
|
||||
browser.setViewAttr(viewAttr);
|
||||
browser.setIsQuickSearch(isQuickSearch);
|
||||
browser.setLabel(label);
|
||||
browser.setRules(rules);
|
||||
return browser;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日期区间
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @param rules
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem rangeDateItem(User user,int colSpan, int fieldcol,int viewAttr
|
||||
,String label,String rules,String name1,String name2) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER,502327,new String[]{name1,name2});
|
||||
rangeDate.setColSpan(colSpan);
|
||||
rangeDate.setFieldcol(fieldcol);
|
||||
rangeDate.setViewAttr(viewAttr);
|
||||
rangeDate.setLabel(label);
|
||||
rangeDate.setRules(rules);
|
||||
return rangeDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多行文本框
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param isQuickSearch
|
||||
* @param viewAttr
|
||||
* @param length
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem textareaItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
||||
int viewAttr,int length, String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA,502227, name);
|
||||
textarea.setColSpan(colSpan);
|
||||
textarea.setFieldcol(fieldcol);
|
||||
textarea.setIsQuickSearch(isQuickSearch);
|
||||
textarea.setViewAttr(viewAttr);
|
||||
textarea.setLength(length);
|
||||
textarea.setLabel(label);
|
||||
|
||||
return textarea;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日期
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param isQuickSearch
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem datePickerItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
||||
int viewAttr,String label,String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER,502227, name);
|
||||
datePicker.setColSpan(colSpan);
|
||||
datePicker.setFieldcol(fieldcol);
|
||||
datePicker.setIsQuickSearch(isQuickSearch);
|
||||
datePicker.setViewAttr(viewAttr);
|
||||
datePicker.setLabel(label);
|
||||
return datePicker;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue