提交 69092580 编写于 作者: ibizdev's avatar ibizdev

jackwang 部署微服务接口

上级 dae46960
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/
mvn clean package -Ppim
cd humanresource-app/humanresource-app-pim
mvn -Ppim docker:build
mvn -Ppim docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-app-pim.yaml iBizEE --with-registry-auth
mvn clean package -Phrapi
cd humanresource-provider/humanresource-provider-hrapi
mvn -Phrapi docker:build
mvn -Phrapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-provider-hrapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-app-pim.jar
EXPOSE 10327
EXPOSE 8080
ADD humanresource-app-pim.jar /humanresource-app-pim.jar
......@@ -3,25 +3,9 @@ services:
humanresource-app-pim:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest
ports:
- "10327:10327"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10327
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -43,9 +43,17 @@ zuul:
path: /hrorgaddresses/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrpost:
path: /hrposts/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrorganization:
path: /hrorganizations/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrduty:
path: /hrduties/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
......@@ -56,6 +56,9 @@ public class HROrganizationServiceImpl extends ServiceImpl<HROrganizationMapper,
protected cn.ibizlab.humanresource.core.base.service.IHROrgContactService hrorgcontactService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostService hrpostService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService hromhierarchyService;
protected int batchSize = 500;
......
package cn.ibizlab.humanresource.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;
/**
* 实体[工作人员分配]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRDISTRIBUTION",resultMap = "HRDistributionResultMap")
public class HRDistribution extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 工作人员分配名称
*/
@TableField(value = "hrdistributionname")
@JSONField(name = "hrdistributionname")
@JsonProperty("hrdistributionname")
private String hrdistributionname;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 工作人员分配标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrdistributionid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrdistributionid")
@JsonProperty("hrdistributionid")
private String hrdistributionid;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 设置 [工作人员分配名称]
*/
public void setHrdistributionname(String hrdistributionname){
this.hrdistributionname = hrdistributionname ;
this.modify("hrdistributionname",hrdistributionname);
}
}
package cn.ibizlab.humanresource.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;
/**
* 实体[职务]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRDUTY",resultMap = "HRDutyResultMap")
public class HRDuty extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 职务标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrdutyid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 职务名称
*/
@TableField(value = "hrdutyname")
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 设置 [职务名称]
*/
public void setHrdutyname(String hrdutyname){
this.hrdutyname = hrdutyname ;
this.modify("hrdutyname",hrdutyname);
}
}
package cn.ibizlab.humanresource.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;
/**
* 实体[职位]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRPOST",resultMap = "HRPostResultMap")
public class HRPost extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 职位标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrpostid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrpostid")
@JsonProperty("hrpostid")
private String hrpostid;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 职位
*/
@TableField(value = "hrpostname")
@JSONField(name = "hrpostname")
@JsonProperty("hrpostname")
private String hrpostname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 职务标识
*/
@TableField(value = "hrdutyid")
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 职务
*/
@TableField(exist = false)
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 编号
*/
@TableField(value = "postcode")
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 职位类型
*/
@TableField(value = "posttype")
@JSONField(name = "posttype")
@JsonProperty("posttype")
private String posttype;
/**
* 是否有效
*/
@TableField(value = "activeflag")
@JSONField(name = "activeflag")
@JsonProperty("activeflag")
private Integer activeflag;
/**
* 组织
*/
@TableField(value = "hrorganizationid")
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 部门
*/
@TableField(exist = false)
@JSONField(name = "hrorganizationname")
@JsonProperty("hrorganizationname")
private String hrorganizationname;
/**
* 最早入职时间
*/
@TableField(value = "entrytime")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "entrytime" , format="yyyy-MM-dd")
@JsonProperty("entrytime")
private Timestamp entrytime;
/**
* 职务
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HRDuty hrduty;
/**
* 部门
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization;
/**
* 设置 [职位]
*/
public void setHrpostname(String hrpostname){
this.hrpostname = hrpostname ;
this.modify("hrpostname",hrpostname);
}
/**
* 设置 [职务标识]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
/**
* 设置 [编号]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [职位类型]
*/
public void setPosttype(String posttype){
this.posttype = posttype ;
this.modify("posttype",posttype);
}
/**
* 设置 [是否有效]
*/
public void setActiveflag(Integer activeflag){
this.activeflag = activeflag ;
this.modify("activeflag",activeflag);
}
/**
* 设置 [组织]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
/**
* 设置 [最早入职时间]
*/
public void setEntrytime(Timestamp entrytime){
this.entrytime = entrytime ;
this.modify("entrytime",entrytime);
}
/**
* 格式化日期 [最早入职时间]
*/
public String formatEntrytime(){
if (this.entrytime == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(entrytime);
}
}
package cn.ibizlab.humanresource.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;
/**
* 实体[职位关系]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRPOSTREL",resultMap = "HRPostRelResultMap")
public class HRPostRel extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 职位关系名称
*/
@TableField(value = "hrpostrelname")
@JSONField(name = "hrpostrelname")
@JsonProperty("hrpostrelname")
private String hrpostrelname;
/**
* 职位关系标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrpostrelid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrpostrelid")
@JsonProperty("hrpostrelid")
private String hrpostrelid;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [职位关系名称]
*/
public void setHrpostrelname(String hrpostrelname){
this.hrpostrelname = hrpostrelname ;
this.modify("hrpostrelname",hrpostrelname);
}
}
package cn.ibizlab.humanresource.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.humanresource.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDistribution;
/**
* 关系型数据实体[HRDistribution] 查询条件对象
*/
@Slf4j
@Data
public class HRDistributionSearchContext extends QueryWrapperContext<HRDistribution> {
private String n_hrdistributionname_like;//[工作人员分配名称]
public void setN_hrdistributionname_like(String n_hrdistributionname_like) {
this.n_hrdistributionname_like = n_hrdistributionname_like;
if(!ObjectUtils.isEmpty(this.n_hrdistributionname_like)){
this.getSearchCond().like("hrdistributionname", n_hrdistributionname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrdistributionname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.humanresource.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
/**
* 关系型数据实体[HRDuty] 查询条件对象
*/
@Slf4j
@Data
public class HRDutySearchContext extends QueryWrapperContext<HRDuty> {
private String n_hrdutyname_like;//[职务名称]
public void setN_hrdutyname_like(String n_hrdutyname_like) {
this.n_hrdutyname_like = n_hrdutyname_like;
if(!ObjectUtils.isEmpty(this.n_hrdutyname_like)){
this.getSearchCond().like("hrdutyname", n_hrdutyname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrdutyname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.humanresource.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPostRel;
/**
* 关系型数据实体[HRPostRel] 查询条件对象
*/
@Slf4j
@Data
public class HRPostRelSearchContext extends QueryWrapperContext<HRPostRel> {
private String n_hrpostrelname_like;//[职位关系名称]
public void setN_hrpostrelname_like(String n_hrpostrelname_like) {
this.n_hrpostrelname_like = n_hrpostrelname_like;
if(!ObjectUtils.isEmpty(this.n_hrpostrelname_like)){
this.getSearchCond().like("hrpostrelname", n_hrpostrelname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrpostrelname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.humanresource.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
/**
* 关系型数据实体[HRPost] 查询条件对象
*/
@Slf4j
@Data
public class HRPostSearchContext extends QueryWrapperContext<HRPost> {
private String n_hrpostname_like;//[职位]
public void setN_hrpostname_like(String n_hrpostname_like) {
this.n_hrpostname_like = n_hrpostname_like;
if(!ObjectUtils.isEmpty(this.n_hrpostname_like)){
this.getSearchCond().like("hrpostname", n_hrpostname_like);
}
}
private String n_hrdutyid_eq;//[职务标识]
public void setN_hrdutyid_eq(String n_hrdutyid_eq) {
this.n_hrdutyid_eq = n_hrdutyid_eq;
if(!ObjectUtils.isEmpty(this.n_hrdutyid_eq)){
this.getSearchCond().eq("hrdutyid", n_hrdutyid_eq);
}
}
private String n_hrdutyname_eq;//[职务]
public void setN_hrdutyname_eq(String n_hrdutyname_eq) {
this.n_hrdutyname_eq = n_hrdutyname_eq;
if(!ObjectUtils.isEmpty(this.n_hrdutyname_eq)){
this.getSearchCond().eq("hrdutyname", n_hrdutyname_eq);
}
}
private String n_hrdutyname_like;//[职务]
public void setN_hrdutyname_like(String n_hrdutyname_like) {
this.n_hrdutyname_like = n_hrdutyname_like;
if(!ObjectUtils.isEmpty(this.n_hrdutyname_like)){
this.getSearchCond().like("hrdutyname", n_hrdutyname_like);
}
}
private String n_posttype_eq;//[职位类型]
public void setN_posttype_eq(String n_posttype_eq) {
this.n_posttype_eq = n_posttype_eq;
if(!ObjectUtils.isEmpty(this.n_posttype_eq)){
this.getSearchCond().eq("posttype", n_posttype_eq);
}
}
private String n_hrorganizationid_eq;//[组织]
public void setN_hrorganizationid_eq(String n_hrorganizationid_eq) {
this.n_hrorganizationid_eq = n_hrorganizationid_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationid_eq)){
this.getSearchCond().eq("hrorganizationid", n_hrorganizationid_eq);
}
}
private String n_hrorganizationname_eq;//[部门]
public void setN_hrorganizationname_eq(String n_hrorganizationname_eq) {
this.n_hrorganizationname_eq = n_hrorganizationname_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationname_eq)){
this.getSearchCond().eq("hrorganizationname", n_hrorganizationname_eq);
}
}
private String n_hrorganizationname_like;//[部门]
public void setN_hrorganizationname_like(String n_hrorganizationname_like) {
this.n_hrorganizationname_like = n_hrorganizationname_like;
if(!ObjectUtils.isEmpty(this.n_hrorganizationname_like)){
this.getSearchCond().like("hrorganizationname", n_hrorganizationname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrpostname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDistribution;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDistributionSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface HRDistributionMapper extends BaseMapper<HRDistribution>{
Page<HRDistribution> searchDefault(IPage page, @Param("srf") HRDistributionSearchContext context, @Param("ew") Wrapper<HRDistribution> wrapper) ;
@Override
HRDistribution selectById(Serializable id);
@Override
int insert(HRDistribution entity);
@Override
int updateById(@Param(Constants.ENTITY) HRDistribution entity);
@Override
int update(@Param(Constants.ENTITY) HRDistribution entity, @Param("ew") Wrapper<HRDistribution> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.humanresource.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface HRDutyMapper extends BaseMapper<HRDuty>{
Page<HRDuty> searchDefault(IPage page, @Param("srf") HRDutySearchContext context, @Param("ew") Wrapper<HRDuty> wrapper) ;
@Override
HRDuty selectById(Serializable id);
@Override
int insert(HRDuty entity);
@Override
int updateById(@Param(Constants.ENTITY) HRDuty entity);
@Override
int update(@Param(Constants.ENTITY) HRDuty entity, @Param("ew") Wrapper<HRDuty> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.humanresource.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface HRPostMapper extends BaseMapper<HRPost>{
Page<HRPost> searchDefault(IPage page, @Param("srf") HRPostSearchContext context, @Param("ew") Wrapper<HRPost> wrapper) ;
@Override
HRPost selectById(Serializable id);
@Override
int insert(HRPost entity);
@Override
int updateById(@Param(Constants.ENTITY) HRPost entity);
@Override
int update(@Param(Constants.ENTITY) HRPost entity, @Param("ew") Wrapper<HRPost> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<HRPost> selectByHrdutyid(@Param("hrdutyid") Serializable hrdutyid) ;
List<HRPost> selectByHrorganizationid(@Param("organizationid") Serializable organizationid) ;
}
package cn.ibizlab.humanresource.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPostRel;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostRelSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface HRPostRelMapper extends BaseMapper<HRPostRel>{
Page<HRPostRel> searchDefault(IPage page, @Param("srf") HRPostRelSearchContext context, @Param("ew") Wrapper<HRPostRel> wrapper) ;
@Override
HRPostRel selectById(Serializable id);
@Override
int insert(HRPostRel entity);
@Override
int updateById(@Param(Constants.ENTITY) HRPostRel entity);
@Override
int update(@Param(Constants.ENTITY) HRPostRel entity, @Param("ew") Wrapper<HRPostRel> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.humanresource.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDistribution;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDistributionSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRDistribution] 服务对象接口
*/
public interface IHRDistributionService extends IService<HRDistribution>{
boolean create(HRDistribution et) ;
void createBatch(List<HRDistribution> list) ;
boolean update(HRDistribution et) ;
void updateBatch(List<HRDistribution> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRDistribution get(String key) ;
HRDistribution getDraft(HRDistribution et) ;
boolean checkKey(HRDistribution et) ;
boolean save(HRDistribution et) ;
void saveBatch(List<HRDistribution> list) ;
Page<HRDistribution> searchDefault(HRDistributionSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HRDistribution> getHrdistributionByIds(List<String> ids) ;
List<HRDistribution> getHrdistributionByEntities(List<HRDistribution> entities) ;
}
package cn.ibizlab.humanresource.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRDuty] 服务对象接口
*/
public interface IHRDutyService extends IService<HRDuty>{
boolean create(HRDuty et) ;
void createBatch(List<HRDuty> list) ;
boolean update(HRDuty et) ;
void updateBatch(List<HRDuty> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRDuty get(String key) ;
HRDuty getDraft(HRDuty et) ;
boolean checkKey(HRDuty et) ;
boolean save(HRDuty et) ;
void saveBatch(List<HRDuty> list) ;
Page<HRDuty> searchDefault(HRDutySearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HRDuty> getHrdutyByIds(List<String> ids) ;
List<HRDuty> getHrdutyByEntities(List<HRDuty> entities) ;
}
package cn.ibizlab.humanresource.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPostRel;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostRelSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRPostRel] 服务对象接口
*/
public interface IHRPostRelService extends IService<HRPostRel>{
boolean create(HRPostRel et) ;
void createBatch(List<HRPostRel> list) ;
boolean update(HRPostRel et) ;
void updateBatch(List<HRPostRel> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRPostRel get(String key) ;
HRPostRel getDraft(HRPostRel et) ;
boolean checkKey(HRPostRel et) ;
boolean save(HRPostRel et) ;
void saveBatch(List<HRPostRel> list) ;
Page<HRPostRel> searchDefault(HRPostRelSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HRPostRel> getHrpostrelByIds(List<String> ids) ;
List<HRPostRel> getHrpostrelByEntities(List<HRPostRel> entities) ;
}
package cn.ibizlab.humanresource.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRPost] 服务对象接口
*/
public interface IHRPostService extends IService<HRPost>{
boolean create(HRPost et) ;
void createBatch(List<HRPost> list) ;
boolean update(HRPost et) ;
void updateBatch(List<HRPost> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRPost get(String key) ;
HRPost getDraft(HRPost et) ;
boolean checkKey(HRPost et) ;
boolean save(HRPost et) ;
void saveBatch(List<HRPost> list) ;
Page<HRPost> searchDefault(HRPostSearchContext context) ;
List<HRPost> selectByHrdutyid(String hrdutyid) ;
void removeByHrdutyid(String hrdutyid) ;
List<HRPost> selectByHrorganizationid(String organizationid) ;
void removeByHrorganizationid(String organizationid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HRPost> getHrpostByIds(List<String> ids) ;
List<HRPost> getHrpostByEntities(List<HRPost> entities) ;
}
package cn.ibizlab.humanresource.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDistribution;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDistributionSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDistributionService;
import cn.ibizlab.humanresource.util.helper.CachedBeanCopier;
import cn.ibizlab.humanresource.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.humanresource.core.humanresource.mapper.HRDistributionMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[工作人员分配] 服务对象接口实现
*/
@Slf4j
@Service("HRDistributionServiceImpl")
public class HRDistributionServiceImpl extends ServiceImpl<HRDistributionMapper, HRDistribution> implements IHRDistributionService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRDistribution et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrdistributionid()),et);
return true;
}
@Override
public void createBatch(List<HRDistribution> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRDistribution et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrdistributionid",et.getHrdistributionid())))
return false;
CachedBeanCopier.copy(get(et.getHrdistributionid()),et);
return true;
}
@Override
public void updateBatch(List<HRDistribution> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRDistribution get(String key) {
HRDistribution et = getById(key);
if(et==null){
et=new HRDistribution();
et.setHrdistributionid(key);
}
else{
}
return et;
}
@Override
public HRDistribution getDraft(HRDistribution et) {
return et;
}
@Override
public boolean checkKey(HRDistribution et) {
return (!ObjectUtils.isEmpty(et.getHrdistributionid()))&&(!Objects.isNull(this.getById(et.getHrdistributionid())));
}
@Override
@Transactional
public boolean save(HRDistribution et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRDistribution et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRDistribution> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRDistribution> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRDistribution> searchDefault(HRDistributionSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRDistribution> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRDistribution>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HRDistribution> getHrdistributionByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRDistribution> getHrdistributionByEntities(List<HRDistribution> entities) {
List ids =new ArrayList();
for(HRDistribution entity : entities){
Serializable id=entity.getHrdistributionid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.humanresource.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService;
import cn.ibizlab.humanresource.util.helper.CachedBeanCopier;
import cn.ibizlab.humanresource.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.humanresource.core.humanresource.mapper.HRDutyMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[职务] 服务对象接口实现
*/
@Slf4j
@Service("HRDutyServiceImpl")
public class HRDutyServiceImpl extends ServiceImpl<HRDutyMapper, HRDuty> implements IHRDutyService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostService hrpostService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRDuty et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrdutyid()),et);
return true;
}
@Override
public void createBatch(List<HRDuty> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRDuty et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrdutyid",et.getHrdutyid())))
return false;
CachedBeanCopier.copy(get(et.getHrdutyid()),et);
return true;
}
@Override
public void updateBatch(List<HRDuty> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRDuty get(String key) {
HRDuty et = getById(key);
if(et==null){
et=new HRDuty();
et.setHrdutyid(key);
}
else{
}
return et;
}
@Override
public HRDuty getDraft(HRDuty et) {
return et;
}
@Override
public boolean checkKey(HRDuty et) {
return (!ObjectUtils.isEmpty(et.getHrdutyid()))&&(!Objects.isNull(this.getById(et.getHrdutyid())));
}
@Override
@Transactional
public boolean save(HRDuty et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRDuty et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRDuty> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRDuty> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRDuty> searchDefault(HRDutySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRDuty> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRDuty>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HRDuty> getHrdutyByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRDuty> getHrdutyByEntities(List<HRDuty> entities) {
List ids =new ArrayList();
for(HRDuty entity : entities){
Serializable id=entity.getHrdutyid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.humanresource.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPostRel;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostRelSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRPostRelService;
import cn.ibizlab.humanresource.util.helper.CachedBeanCopier;
import cn.ibizlab.humanresource.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.humanresource.core.humanresource.mapper.HRPostRelMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[职位关系] 服务对象接口实现
*/
@Slf4j
@Service("HRPostRelServiceImpl")
public class HRPostRelServiceImpl extends ServiceImpl<HRPostRelMapper, HRPostRel> implements IHRPostRelService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRPostRel et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrpostrelid()),et);
return true;
}
@Override
public void createBatch(List<HRPostRel> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRPostRel et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrpostrelid",et.getHrpostrelid())))
return false;
CachedBeanCopier.copy(get(et.getHrpostrelid()),et);
return true;
}
@Override
public void updateBatch(List<HRPostRel> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRPostRel get(String key) {
HRPostRel et = getById(key);
if(et==null){
et=new HRPostRel();
et.setHrpostrelid(key);
}
else{
}
return et;
}
@Override
public HRPostRel getDraft(HRPostRel et) {
return et;
}
@Override
public boolean checkKey(HRPostRel et) {
return (!ObjectUtils.isEmpty(et.getHrpostrelid()))&&(!Objects.isNull(this.getById(et.getHrpostrelid())));
}
@Override
@Transactional
public boolean save(HRPostRel et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRPostRel et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRPostRel> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRPostRel> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRPostRel> searchDefault(HRPostRelSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRPostRel> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRPostRel>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HRPostRel> getHrpostrelByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRPostRel> getHrpostrelByEntities(List<HRPostRel> entities) {
List ids =new ArrayList();
for(HRPostRel entity : entities){
Serializable id=entity.getHrpostrelid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.humanresource.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRPostService;
import cn.ibizlab.humanresource.util.helper.CachedBeanCopier;
import cn.ibizlab.humanresource.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.humanresource.core.humanresource.mapper.HRPostMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[职位] 服务对象接口实现
*/
@Slf4j
@Service("HRPostServiceImpl")
public class HRPostServiceImpl extends ServiceImpl<HRPostMapper, HRPost> implements IHRPostService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService hrdutyService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrganizationService hrorganizationService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRPost et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrpostid()),et);
return true;
}
@Override
public void createBatch(List<HRPost> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRPost et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrpostid",et.getHrpostid())))
return false;
CachedBeanCopier.copy(get(et.getHrpostid()),et);
return true;
}
@Override
public void updateBatch(List<HRPost> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRPost get(String key) {
HRPost et = getById(key);
if(et==null){
et=new HRPost();
et.setHrpostid(key);
}
else{
}
return et;
}
@Override
public HRPost getDraft(HRPost et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(HRPost et) {
return (!ObjectUtils.isEmpty(et.getHrpostid()))&&(!Objects.isNull(this.getById(et.getHrpostid())));
}
@Override
@Transactional
public boolean save(HRPost et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRPost et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRPost> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRPost> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<HRPost> selectByHrdutyid(String hrdutyid) {
return baseMapper.selectByHrdutyid(hrdutyid);
}
@Override
public void removeByHrdutyid(String hrdutyid) {
this.remove(new QueryWrapper<HRPost>().eq("hrdutyid",hrdutyid));
}
@Override
public List<HRPost> selectByHrorganizationid(String organizationid) {
return baseMapper.selectByHrorganizationid(organizationid);
}
@Override
public void removeByHrorganizationid(String organizationid) {
this.remove(new QueryWrapper<HRPost>().eq("hrorganizationid",organizationid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRPost> searchDefault(HRPostSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRPost> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRPost>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(HRPost et){
//实体关系[DER1N_HRPOST_HRDUTY_HRDUTYID]
if(!ObjectUtils.isEmpty(et.getHrdutyid())){
cn.ibizlab.humanresource.core.humanresource.domain.HRDuty hrduty=et.getHrduty();
if(ObjectUtils.isEmpty(hrduty)){
cn.ibizlab.humanresource.core.humanresource.domain.HRDuty majorEntity=hrdutyService.get(et.getHrdutyid());
et.setHrduty(majorEntity);
hrduty=majorEntity;
}
et.setHrdutyname(hrduty.getHrdutyname());
}
//实体关系[DER1N_HRPOST_HRORGANIZATION_HRORGANIZATIONID_6BD9DC]
if(!ObjectUtils.isEmpty(et.getHrorganizationid())){
cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization=et.getHrorganization();
if(ObjectUtils.isEmpty(hrorganization)){
cn.ibizlab.humanresource.core.base.domain.HROrganization majorEntity=hrorganizationService.get(et.getHrorganizationid());
et.setHrorganization(majorEntity);
hrorganization=majorEntity;
}
et.setHrorganizationname(hrorganization.getOrganizationname());
}
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HRPost> getHrpostByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRPost> getHrpostByEntities(List<HRPost> entities) {
List ids =new ArrayList();
for(HRPost entity : entities){
Serializable id=entity.getHrpostid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -23,8 +23,48 @@
</changeSet>
<!--输出实体[HRDISTRIBUTION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrdistribution-2-2">
<createTable tableName="T_HRDISTRIBUTION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="HRDISTRIBUTIONNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="HRDISTRIBUTIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRDISTRIBUTION_HRDISTRIBUTI"/>
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
<!--输出实体[HRDUTY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrduty-6-3">
<createTable tableName="T_HRDUTY">
<column name="HRDUTYID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRDUTY_HRDUTYID"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="HRDUTYNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
<!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-5-2">
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-5-4">
<createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -46,7 +86,7 @@
<!--输出实体[HRLEAVE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrleave-3-3">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrleave-3-5">
<createTable tableName="LEAVE">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -66,7 +106,7 @@
<!--输出实体[HRLEGAL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrlegal-82-4">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrlegal-82-6">
<createTable tableName="LEGAL">
<column name="LEGALNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -92,7 +132,7 @@
<!--输出实体[HROMHIERARCHYPURPOSE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurpose-11-5">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurpose-11-7">
<createTable tableName="OMHIERARCHYPURPOSE">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -112,7 +152,7 @@
<!--输出实体[HROMHIERARCHY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchy-73-6">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchy-76-8">
<createTable tableName="OMHIERARCHY">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -140,7 +180,7 @@
<!--输出实体[HROMHIERARCHYCAT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchycat-53-7">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchycat-67-9">
<createTable tableName="OMHIERARCHYCAT">
<column name="OMHIERARCHYCATID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HROMHIERARCHYCAT_OMHIERARCH"/>
......@@ -162,7 +202,7 @@
<!--输出实体[HROMHIERARCHYPURPOSEREF]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurposeref-6-8">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurposeref-6-10">
<createTable tableName="OMHIERARCHYPURPOSEREF">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -186,7 +226,7 @@
<!--输出实体[HROPERATIONUNIT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hroperationunit-57-9">
<changeSet author="a_LAB01_e85d8801c" id="tab-hroperationunit-57-11">
<createTable tableName="OPERATIONUNIT">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -206,7 +246,7 @@
<!--输出实体[HRORGADDRESS]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgaddress-29-10">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgaddress-29-12">
<createTable tableName="T_HRORGADDRESS">
<column name="HRORGADDRESSNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -236,7 +276,7 @@
<!--输出实体[HRORGCONTACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgcontact-24-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgcontact-24-13">
<createTable tableName="T_HRORGCONTACT">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -264,7 +304,7 @@
<!--输出实体[HRORGANIZATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-28-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-29-14">
<createTable tableName="ORGANIZATION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -296,38 +336,100 @@
</createTable>
</changeSet>
<!--输出实体[HRPOST]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-40-15">
<createTable tableName="T_HRPOST">
<column name="HRPOSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/>
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="HRPOSTNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="HRDUTYID" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTTYPE" remarks="" type="VARCHAR(60)">
</column>
<column name="ACTIVEFLAG" remarks="" type="INT">
</column>
<column name="HRORGANIZATIONID" remarks="" type="VARCHAR(60)">
</column>
<column name="ENTRYTIME" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[HRPOSTREL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpostrel-2-16">
<createTable tableName="T_HRPOSTREL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="HRPOSTRELNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="HRPOSTRELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOSTREL_HRPOSTRELID"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[HRATTENDANCE]外键关系 -->
<!--输出实体[HRDISTRIBUTION]外键关系 -->
<!--输出实体[HRDUTY]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-5-13">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-5-17">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="EMPLOYEE" constraintName="DER1N_EMPLOYEE_ORGANIZATION_OR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRLEAVE]外键关系 -->
<!--输出实体[HRLEGAL]外键关系 -->
<!--输出实体[HROMHIERARCHYPURPOSE]外键关系 -->
<!--输出实体[HROMHIERARCHY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-73-14">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-18">
<addForeignKeyConstraint baseColumnNames="HROMHIERARCHYCATID" baseTableName="OMHIERARCHY" constraintName="DER1N_HROMHIERARCHY_HROMHIERAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYCATID" referencedTableName="OMHIERARCHYCAT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-73-15">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-19">
<addForeignKeyConstraint baseColumnNames="POMHIERARCHYID" baseTableName="OMHIERARCHY" constraintName="DER1N_OMHIERARCHY_OMHIERARCHY_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYID" referencedTableName="OMHIERARCHY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-73-16">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-20">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="OMHIERARCHY" constraintName="DER1N_OMHIERARCHY_ORGANIZATION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HROMHIERARCHYCAT]外键关系 -->
<!--输出实体[HROMHIERARCHYPURPOSEREF]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchypurposeref-6-17">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchypurposeref-6-21">
<addForeignKeyConstraint baseColumnNames="OMHIERARCHYCATID" baseTableName="OMHIERARCHYPURPOSEREF" constraintName="DER1N_OMHIERARCHYPURPOSEREF_OM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYCATID" referencedTableName="OMHIERARCHYCAT" validate="true"/>
</changeSet>
<!--输出实体[HROPERATIONUNIT]外键关系 -->
<!--输出实体[HRORGADDRESS]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgaddress-29-19">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgaddress-29-23">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGADDRESS" constraintName="DER1N_HRORGADDRESS_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGCONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgcontact-24-20">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgcontact-24-24">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGCONTACT" constraintName="DER1N_HRORGCONTACT_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGANIZATION]外键关系 -->
<!--输出实体[HRPOST]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-40-25">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRDUTY_HRDUTYID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-40-26">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRORGANIZATION_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRPOSTREL]外键关系 -->
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.humanresource.mapper.HRDistributionMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRDistributionResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDISTRIBUTIONID`, t1.`HRDISTRIBUTIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDISTRIBUTION` t1 ) t1 where hrdistributionid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRDistributionResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRDistribution" autoMapping="true">
<id property="hrdistributionid" column="hrdistributionid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRDistributionSearchContext" resultMap="HRDistributionResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDISTRIBUTIONID`, t1.`HRDISTRIBUTIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDISTRIBUTION` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDISTRIBUTIONID`, t1.`HRDISTRIBUTIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDISTRIBUTION` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.humanresource.mapper.HRDutyMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRDutyResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTY` t1 ) t1 where hrdutyid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRDutyResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRDuty" autoMapping="true">
<id property="hrdutyid" column="hrdutyid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRDutySearchContext" resultMap="HRDutyResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTY` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTY` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.humanresource.mapper.HRPostMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRPostResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ACTIVEFLAG`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTRYTIME`, t1.`HRDUTYID`, t11.`HRDUTYNAME`, t1.`HRORGANIZATIONID`, t21.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME`, t1.`HRPOSTID`, t1.`HRPOSTNAME`, t1.`POSTCODE`, t1.`POSTTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOST` t1 LEFT JOIN T_HRDUTY t11 ON t1.HRDUTYID = t11.HRDUTYID LEFT JOIN ORGANIZATION t21 ON t1.HRORGANIZATIONID = t21.ORGANIZATIONID ) t1 where hrpostid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRPostResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRPost" autoMapping="true">
<id property="hrpostid" column="hrpostid" /><!--主键字段映射-->
<result property="hrdutyid" column="hrdutyid" />
<result property="hrorganizationid" column="hrorganizationid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrduty" javaType="cn.ibizlab.humanresource.core.humanresource.domain.HRDuty" column="hrdutyid" select="cn.ibizlab.humanresource.core.humanresource.mapper.HRDutyMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrorganization" javaType="cn.ibizlab.humanresource.core.base.domain.HROrganization" column="hrorganizationid" select="cn.ibizlab.humanresource.core.base.mapper.HROrganizationMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRPOST_HRDUTY_HRDUTYID] -->
<select id="selectByHrdutyid" resultMap="HRPostResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrdutyid=#{hrdutyid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRPOST_HRORGANIZATION_HRORGANIZATIONID_6BD9DC] -->
<select id="selectByHrorganizationid" resultMap="HRPostResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrorganizationid=#{organizationid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRPostSearchContext" resultMap="HRPostResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ACTIVEFLAG`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTRYTIME`, t1.`HRDUTYID`, t11.`HRDUTYNAME`, t1.`HRORGANIZATIONID`, t21.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME`, t1.`HRPOSTID`, t1.`HRPOSTNAME`, t1.`POSTCODE`, t1.`POSTTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOST` t1 LEFT JOIN T_HRDUTY t11 ON t1.HRDUTYID = t11.HRDUTYID LEFT JOIN ORGANIZATION t21 ON t1.HRORGANIZATIONID = t21.ORGANIZATIONID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ACTIVEFLAG`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTRYTIME`, t1.`HRDUTYID`, t11.`HRDUTYNAME`, t1.`HRORGANIZATIONID`, t21.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME`, t1.`HRPOSTID`, t1.`HRPOSTNAME`, t1.`POSTCODE`, t1.`POSTTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOST` t1 LEFT JOIN T_HRDUTY t11 ON t1.HRDUTYID = t11.HRDUTYID LEFT JOIN ORGANIZATION t21 ON t1.HRORGANIZATIONID = t21.ORGANIZATIONID
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.humanresource.mapper.HRPostRelMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRPostRelResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRPOSTRELID`, t1.`HRPOSTRELNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOSTREL` t1 ) t1 where hrpostrelid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRPostRelResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRPostRel" autoMapping="true">
<id property="hrpostrelid" column="hrpostrelid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRPostRelSearchContext" resultMap="HRPostRelResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRPOSTRELID`, t1.`HRPOSTRELNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOSTREL` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRPOSTRELID`, t1.`HRPOSTRELNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRPOSTREL` t1
]]>
</sql>
</mapper>
......@@ -76,11 +76,27 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HRPost",
"delogicname":"职位",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROrganization",
"delogicname":"组织",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HRDuty",
"delogicname":"职务",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
],
......@@ -89,7 +105,7 @@
{
"appid":"PIM",
"appname":"基础管理",
"appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem1" , "name":"菜单项" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem5" , "name":"人员" , "items":[{ "id":"menuitem15" , "name":"员工信息" }]},{ "id":"menuitem2" , "name":"组织" , "items":[{ "id":"menuitem4" , "name":"法人" },{ "id":"menuitem6" , "name":"运营单位" },{ "id":"menuitem7" , "name":"组织层次结构" },{ "id":"menuitem9" , "name":"所有组织" },{ "id":"menuitem10" , "name":"职位" , "items":[{ "id":"menuitem11" , "name":"有效职位" },{ "id":"menuitem12" , "name":"空缺职位" },{ "id":"menuitem13" , "name":"所有职位" },{ "id":"menuitem14" , "name":"无效职位" },{ "id":"menuitem8" , "name":"测试" }]}]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
"appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem1" , "name":"菜单项" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem5" , "name":"人员" , "items":[{ "id":"menuitem15" , "name":"员工信息" }]},{ "id":"menuitem2" , "name":"组织" , "items":[{ "id":"menuitem4" , "name":"法人" },{ "id":"menuitem6" , "name":"运营单位" },{ "id":"menuitem7" , "name":"组织层次结构" },{ "id":"menuitem9" , "name":"所有组织" },{ "id":"menuitem10" , "name":"职位" , "items":[{ "id":"menuitem11" , "name":"职位" },{ "id":"menuitem12" , "name":"职务" },{ "id":"menuitem8" , "name":"测试" }]}]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
}
]
}
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-provider-hrapi.jar
EXPOSE 8081
EXPOSE 10317
ADD humanresource-provider-hrapi.jar /humanresource-provider-hrapi.jar
......@@ -3,9 +3,25 @@ services:
humanresource-provider-hrapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-provider-hrapi:latest
ports:
- "8081:8081"
- "10317:10317"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10317
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
package cn.ibizlab.humanresource.hrapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.humanresource.util.domain.DTOBase;
import cn.ibizlab.humanresource.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[HRDutyDTO]
*/
@Data
public class HRDutyDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRDUTYID]
*
*/
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [HRDUTYNAME]
*
*/
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 设置 [HRDUTYNAME]
*/
public void setHrdutyname(String hrdutyname){
this.hrdutyname = hrdutyname ;
this.modify("hrdutyname",hrdutyname);
}
}
package cn.ibizlab.humanresource.hrapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.humanresource.util.domain.DTOBase;
import cn.ibizlab.humanresource.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[HRPostDTO]
*/
@Data
public class HRPostDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRPOSTID]
*
*/
@JSONField(name = "hrpostid")
@JsonProperty("hrpostid")
private String hrpostid;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [HRPOSTNAME]
*
*/
@JSONField(name = "hrpostname")
@JsonProperty("hrpostname")
private String hrpostname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [HRDUTYID]
*
*/
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 属性 [HRDUTYNAME]
*
*/
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 属性 [POSTCODE]
*
*/
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 属性 [POSTTYPE]
*
*/
@JSONField(name = "posttype")
@JsonProperty("posttype")
private String posttype;
/**
* 属性 [ACTIVEFLAG]
*
*/
@JSONField(name = "activeflag")
@JsonProperty("activeflag")
private Integer activeflag;
/**
* 属性 [HRORGANIZATIONID]
*
*/
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 属性 [HRORGANIZATIONNAME]
*
*/
@JSONField(name = "hrorganizationname")
@JsonProperty("hrorganizationname")
private String hrorganizationname;
/**
* 属性 [ENTRYTIME]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "entrytime" , format="yyyy-MM-dd")
@JsonProperty("entrytime")
private Timestamp entrytime;
/**
* 设置 [HRPOSTNAME]
*/
public void setHrpostname(String hrpostname){
this.hrpostname = hrpostname ;
this.modify("hrpostname",hrpostname);
}
/**
* 设置 [HRDUTYID]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
/**
* 设置 [POSTCODE]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [POSTTYPE]
*/
public void setPosttype(String posttype){
this.posttype = posttype ;
this.modify("posttype",posttype);
}
/**
* 设置 [ACTIVEFLAG]
*/
public void setActiveflag(Integer activeflag){
this.activeflag = activeflag ;
this.modify("activeflag",activeflag);
}
/**
* 设置 [HRORGANIZATIONID]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
/**
* 设置 [ENTRYTIME]
*/
public void setEntrytime(Timestamp entrytime){
this.entrytime = entrytime ;
this.modify("entrytime",entrytime);
}
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
import cn.ibizlab.humanresource.hrapi.dto.HRDutyDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRDutyMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRDutyMapping extends MappingBase<HRDutyDTO, HRDuty> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
import cn.ibizlab.humanresource.hrapi.dto.HRPostDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRPostMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRPostMapping extends MappingBase<HRPostDTO, HRPost> {
}
package cn.ibizlab.humanresource.hrapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDuty;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"职务" })
@RestController("HRApi-hrduty")
@RequestMapping("")
public class HRDutyResource {
@Autowired
public IHRDutyService hrdutyService;
@Autowired
@Lazy
public HRDutyMapping hrdutyMapping;
@PreAuthorize("hasPermission(this.hrdutyMapping.toDomain(#hrdutydto),'iBizHumanResources-HRDuty-Create')")
@ApiOperation(value = "新建职务", tags = {"职务" }, notes = "新建职务")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties")
@Transactional
public ResponseEntity<HRDutyDTO> create(@RequestBody HRDutyDTO hrdutydto) {
HRDuty domain = hrdutyMapping.toDomain(hrdutydto);
hrdutyService.create(domain);
HRDutyDTO dto = hrdutyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyMapping.toDomain(#hrdutydtos),'iBizHumanResources-HRDuty-Create')")
@ApiOperation(value = "批量新建职务", tags = {"职务" }, notes = "批量新建职务")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRDutyDTO> hrdutydtos) {
hrdutyService.createBatch(hrdutyMapping.toDomain(hrdutydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrduty" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutyService.get(#hrduty_id),'iBizHumanResources-HRDuty-Update')")
@ApiOperation(value = "更新职务", tags = {"职务" }, notes = "更新职务")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/{hrduty_id}")
@Transactional
public ResponseEntity<HRDutyDTO> update(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyDTO hrdutydto) {
HRDuty domain = hrdutyMapping.toDomain(hrdutydto);
domain .setHrdutyid(hrduty_id);
hrdutyService.update(domain );
HRDutyDTO dto = hrdutyMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyService.getHrdutyByEntities(this.hrdutyMapping.toDomain(#hrdutydtos)),'iBizHumanResources-HRDuty-Update')")
@ApiOperation(value = "批量更新职务", tags = {"职务" }, notes = "批量更新职务")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRDutyDTO> hrdutydtos) {
hrdutyService.updateBatch(hrdutyMapping.toDomain(hrdutydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutyService.get(#hrduty_id),'iBizHumanResources-HRDuty-Remove')")
@ApiOperation(value = "删除职务", tags = {"职务" }, notes = "删除职务")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/{hrduty_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrduty_id") String hrduty_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyService.remove(hrduty_id));
}
@PreAuthorize("hasPermission(this.hrdutyService.getHrdutyByIds(#ids),'iBizHumanResources-HRDuty-Remove')")
@ApiOperation(value = "批量删除职务", tags = {"职务" }, notes = "批量删除职务")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrdutyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutyMapping.toDomain(returnObject.body),'iBizHumanResources-HRDuty-Get')")
@ApiOperation(value = "获取职务", tags = {"职务" }, notes = "获取职务")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/{hrduty_id}")
public ResponseEntity<HRDutyDTO> get(@PathVariable("hrduty_id") String hrduty_id) {
HRDuty domain = hrdutyService.get(hrduty_id);
HRDutyDTO dto = hrdutyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取职务草稿", tags = {"职务" }, notes = "获取职务草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/getdraft")
public ResponseEntity<HRDutyDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyMapping.toDto(hrdutyService.getDraft(new HRDuty())));
}
@ApiOperation(value = "检查职务", tags = {"职务" }, notes = "检查职务")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRDutyDTO hrdutydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyService.checkKey(hrdutyMapping.toDomain(hrdutydto)));
}
@PreAuthorize("hasPermission(this.hrdutyMapping.toDomain(#hrdutydto),'iBizHumanResources-HRDuty-Save')")
@ApiOperation(value = "保存职务", tags = {"职务" }, notes = "保存职务")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/save")
public ResponseEntity<Boolean> save(@RequestBody HRDutyDTO hrdutydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyService.save(hrdutyMapping.toDomain(hrdutydto)));
}
@PreAuthorize("hasPermission(this.hrdutyMapping.toDomain(#hrdutydtos),'iBizHumanResources-HRDuty-Save')")
@ApiOperation(value = "批量保存职务", tags = {"职务" }, notes = "批量保存职务")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRDutyDTO> hrdutydtos) {
hrdutyService.saveBatch(hrdutyMapping.toDomain(hrdutydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDuty-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDuty-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"职务" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrduties/fetchdefault")
public ResponseEntity<List<HRDutyDTO>> fetchDefault(HRDutySearchContext context) {
Page<HRDuty> domains = hrdutyService.searchDefault(context) ;
List<HRDutyDTO> list = hrdutyMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDuty-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDuty-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"职务" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrduties/searchdefault")
public ResponseEntity<Page<HRDutyDTO>> searchDefault(@RequestBody HRDutySearchContext context) {
Page<HRDuty> domains = hrdutyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRPost;
import cn.ibizlab.humanresource.core.humanresource.service.IHRPostService;
import cn.ibizlab.humanresource.core.humanresource.filter.HRPostSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"职位" })
@RestController("HRApi-hrpost")
@RequestMapping("")
public class HRPostResource {
@Autowired
public IHRPostService hrpostService;
@Autowired
@Lazy
public HRPostMapping hrpostMapping;
@PreAuthorize("hasPermission(this.hrpostMapping.toDomain(#hrpostdto),'iBizHumanResources-HRPost-Create')")
@ApiOperation(value = "新建职位", tags = {"职位" }, notes = "新建职位")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts")
@Transactional
public ResponseEntity<HRPostDTO> create(@RequestBody HRPostDTO hrpostdto) {
HRPost domain = hrpostMapping.toDomain(hrpostdto);
hrpostService.create(domain);
HRPostDTO dto = hrpostMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostMapping.toDomain(#hrpostdtos),'iBizHumanResources-HRPost-Create')")
@ApiOperation(value = "批量新建职位", tags = {"职位" }, notes = "批量新建职位")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRPostDTO> hrpostdtos) {
hrpostService.createBatch(hrpostMapping.toDomain(hrpostdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrpost" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrpostService.get(#hrpost_id),'iBizHumanResources-HRPost-Update')")
@ApiOperation(value = "更新职位", tags = {"职位" }, notes = "更新职位")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}")
@Transactional
public ResponseEntity<HRPostDTO> update(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostDTO hrpostdto) {
HRPost domain = hrpostMapping.toDomain(hrpostdto);
domain .setHrpostid(hrpost_id);
hrpostService.update(domain );
HRPostDTO dto = hrpostMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostService.getHrpostByEntities(this.hrpostMapping.toDomain(#hrpostdtos)),'iBizHumanResources-HRPost-Update')")
@ApiOperation(value = "批量更新职位", tags = {"职位" }, notes = "批量更新职位")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRPostDTO> hrpostdtos) {
hrpostService.updateBatch(hrpostMapping.toDomain(hrpostdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrpostService.get(#hrpost_id),'iBizHumanResources-HRPost-Remove')")
@ApiOperation(value = "删除职位", tags = {"职位" }, notes = "删除职位")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrpost_id") String hrpost_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostService.remove(hrpost_id));
}
@PreAuthorize("hasPermission(this.hrpostService.getHrpostByIds(#ids),'iBizHumanResources-HRPost-Remove')")
@ApiOperation(value = "批量删除职位", tags = {"职位" }, notes = "批量删除职位")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrpostService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrpostMapping.toDomain(returnObject.body),'iBizHumanResources-HRPost-Get')")
@ApiOperation(value = "获取职位", tags = {"职位" }, notes = "获取职位")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}")
public ResponseEntity<HRPostDTO> get(@PathVariable("hrpost_id") String hrpost_id) {
HRPost domain = hrpostService.get(hrpost_id);
HRPostDTO dto = hrpostMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取职位草稿", tags = {"职位" }, notes = "获取职位草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/getdraft")
public ResponseEntity<HRPostDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrpostMapping.toDto(hrpostService.getDraft(new HRPost())));
}
@ApiOperation(value = "检查职位", tags = {"职位" }, notes = "检查职位")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRPostDTO hrpostdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostService.checkKey(hrpostMapping.toDomain(hrpostdto)));
}
@PreAuthorize("hasPermission(this.hrpostMapping.toDomain(#hrpostdto),'iBizHumanResources-HRPost-Save')")
@ApiOperation(value = "保存职位", tags = {"职位" }, notes = "保存职位")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/save")
public ResponseEntity<Boolean> save(@RequestBody HRPostDTO hrpostdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostService.save(hrpostMapping.toDomain(hrpostdto)));
}
@PreAuthorize("hasPermission(this.hrpostMapping.toDomain(#hrpostdtos),'iBizHumanResources-HRPost-Save')")
@ApiOperation(value = "批量保存职位", tags = {"职位" }, notes = "批量保存职位")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRPostDTO> hrpostdtos) {
hrpostService.saveBatch(hrpostMapping.toDomain(hrpostdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPost-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPost-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"职位" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrposts/fetchdefault")
public ResponseEntity<List<HRPostDTO>> fetchDefault(HRPostSearchContext context) {
Page<HRPost> domains = hrpostService.searchDefault(context) ;
List<HRPostDTO> list = hrpostMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPost-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPost-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"职位" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrposts/searchdefault")
public ResponseEntity<Page<HRPostDTO>> searchDefault(@RequestBody HRPostSearchContext context) {
Page<HRPost> domains = hrpostService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpostMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册