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

jackwang 部署微服务接口

上级 b2754528
......@@ -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:
......
......@@ -31,6 +31,10 @@ zuul:
path: /hrlegals/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrdutyedu:
path: /hrdutyedus/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hromhierarchypurpose:
path: /hromhierarchypurposes/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......@@ -55,6 +59,14 @@ zuul:
path: /hrorganizations/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrdutyskill:
path: /hrdutyskills/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrdutycert:
path: /hrdutycerts/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrduty:
path: /hrduties/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......
......@@ -89,6 +89,13 @@ public class HRDuty extends EntityMP implements Serializable {
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 备注
*/
@TableField(value = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
......@@ -100,6 +107,14 @@ public class HRDuty extends EntityMP implements Serializable {
this.modify("hrdutyname",hrdutyname);
}
/**
* 设置 [备注]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
}
......
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_HRDUTYCERT",resultMap = "HRDutyCertResultMap")
public class HRDutyCert extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 证书
*/
@TableField(value = "hrdutycertname")
@JSONField(name = "hrdutycertname")
@JsonProperty("hrdutycertname")
private String hrdutycertname;
/**
* 职务证书标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrdutycertid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrdutycertid")
@JsonProperty("hrdutycertid")
private String hrdutycertid;
/**
* 建立人
*/
@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;
/**
* 建立时间
*/
@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 = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 重要性
*/
@TableField(value = "importance")
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 职务标识
*/
@TableField(value = "hrdutyid")
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 职务
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HRDuty hrduty;
/**
* 设置 [证书]
*/
public void setHrdutycertname(String hrdutycertname){
this.hrdutycertname = hrdutycertname ;
this.modify("hrdutycertname",hrdutycertname);
}
/**
* 设置 [描述]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [重要性]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [职务标识]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
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_HRDUTYEDU",resultMap = "HRDutyEduResultMap")
public class HRDutyEdu extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 职务教育标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrdutyeduid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrdutyeduid")
@JsonProperty("hrdutyeduid")
private String hrdutyeduid;
/**
* 建立人
*/
@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;
/**
* 建立时间
*/
@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 = "hrdutyeduname")
@JSONField(name = "hrdutyeduname")
@JsonProperty("hrdutyeduname")
private String hrdutyeduname;
/**
* 更新时间
*/
@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 = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 重要性
*/
@TableField(value = "importance")
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 职务标识
*/
@TableField(value = "hrdutyid")
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 职务
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HRDuty hrduty;
/**
* 设置 [教育]
*/
public void setHrdutyeduname(String hrdutyeduname){
this.hrdutyeduname = hrdutyeduname ;
this.modify("hrdutyeduname",hrdutyeduname);
}
/**
* 设置 [描述]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [重要性]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [职务标识]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
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_HRDUTYSKILL",resultMap = "HRDutySkillResultMap")
public class HRDutySkill extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 技能
*/
@TableField(value = "hrdutyskillname")
@JSONField(name = "hrdutyskillname")
@JsonProperty("hrdutyskillname")
private String hrdutyskillname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 职务技能标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrdutyskillid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrdutyskillid")
@JsonProperty("hrdutyskillid")
private String hrdutyskillid;
/**
* 更新人
*/
@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;
/**
* 建立时间
*/
@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 = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 重要性
*/
@TableField(value = "importance")
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 职务标识
*/
@TableField(value = "hrdutyid")
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 职务
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HRDuty hrduty;
/**
* 设置 [技能]
*/
public void setHrdutyskillname(String hrdutyskillname){
this.hrdutyskillname = hrdutyskillname ;
this.modify("hrdutyskillname",hrdutyskillname);
}
/**
* 设置 [描述]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [重要性]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [职务标识]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
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.HRDutyCert;
/**
* 关系型数据实体[HRDutyCert] 查询条件对象
*/
@Slf4j
@Data
public class HRDutyCertSearchContext extends QueryWrapperContext<HRDutyCert> {
private String n_hrdutycertname_like;//[证书]
public void setN_hrdutycertname_like(String n_hrdutycertname_like) {
this.n_hrdutycertname_like = n_hrdutycertname_like;
if(!ObjectUtils.isEmpty(this.n_hrdutycertname_like)){
this.getSearchCond().like("hrdutycertname", n_hrdutycertname_like);
}
}
private String n_importance_eq;//[重要性]
public void setN_importance_eq(String n_importance_eq) {
this.n_importance_eq = n_importance_eq;
if(!ObjectUtils.isEmpty(this.n_importance_eq)){
this.getSearchCond().eq("importance", n_importance_eq);
}
}
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);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrdutycertname", 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.HRDutyEdu;
/**
* 关系型数据实体[HRDutyEdu] 查询条件对象
*/
@Slf4j
@Data
public class HRDutyEduSearchContext extends QueryWrapperContext<HRDutyEdu> {
private String n_hrdutyeduname_like;//[教育]
public void setN_hrdutyeduname_like(String n_hrdutyeduname_like) {
this.n_hrdutyeduname_like = n_hrdutyeduname_like;
if(!ObjectUtils.isEmpty(this.n_hrdutyeduname_like)){
this.getSearchCond().like("hrdutyeduname", n_hrdutyeduname_like);
}
}
private String n_importance_eq;//[重要性]
public void setN_importance_eq(String n_importance_eq) {
this.n_importance_eq = n_importance_eq;
if(!ObjectUtils.isEmpty(this.n_importance_eq)){
this.getSearchCond().eq("importance", n_importance_eq);
}
}
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);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrdutyeduname", 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.HRDutySkill;
/**
* 关系型数据实体[HRDutySkill] 查询条件对象
*/
@Slf4j
@Data
public class HRDutySkillSearchContext extends QueryWrapperContext<HRDutySkill> {
private String n_hrdutyskillname_like;//[技能]
public void setN_hrdutyskillname_like(String n_hrdutyskillname_like) {
this.n_hrdutyskillname_like = n_hrdutyskillname_like;
if(!ObjectUtils.isEmpty(this.n_hrdutyskillname_like)){
this.getSearchCond().like("hrdutyskillname", n_hrdutyskillname_like);
}
}
private String n_importance_eq;//[重要性]
public void setN_importance_eq(String n_importance_eq) {
this.n_importance_eq = n_importance_eq;
if(!ObjectUtils.isEmpty(this.n_importance_eq)){
this.getSearchCond().eq("importance", n_importance_eq);
}
}
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);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrdutyskillname", 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.HRDutyCert;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyCertSearchContext;
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 HRDutyCertMapper extends BaseMapper<HRDutyCert>{
Page<HRDutyCert> searchDefault(IPage page, @Param("srf") HRDutyCertSearchContext context, @Param("ew") Wrapper<HRDutyCert> wrapper) ;
@Override
HRDutyCert selectById(Serializable id);
@Override
int insert(HRDutyCert entity);
@Override
int updateById(@Param(Constants.ENTITY) HRDutyCert entity);
@Override
int update(@Param(Constants.ENTITY) HRDutyCert entity, @Param("ew") Wrapper<HRDutyCert> 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<HRDutyCert> selectByHrdutyid(@Param("hrdutyid") Serializable hrdutyid) ;
}
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.HRDutyEdu;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyEduSearchContext;
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 HRDutyEduMapper extends BaseMapper<HRDutyEdu>{
Page<HRDutyEdu> searchDefault(IPage page, @Param("srf") HRDutyEduSearchContext context, @Param("ew") Wrapper<HRDutyEdu> wrapper) ;
@Override
HRDutyEdu selectById(Serializable id);
@Override
int insert(HRDutyEdu entity);
@Override
int updateById(@Param(Constants.ENTITY) HRDutyEdu entity);
@Override
int update(@Param(Constants.ENTITY) HRDutyEdu entity, @Param("ew") Wrapper<HRDutyEdu> 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<HRDutyEdu> selectByHrdutyid(@Param("hrdutyid") Serializable hrdutyid) ;
}
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.HRDutySkill;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySkillSearchContext;
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 HRDutySkillMapper extends BaseMapper<HRDutySkill>{
Page<HRDutySkill> searchDefault(IPage page, @Param("srf") HRDutySkillSearchContext context, @Param("ew") Wrapper<HRDutySkill> wrapper) ;
@Override
HRDutySkill selectById(Serializable id);
@Override
int insert(HRDutySkill entity);
@Override
int updateById(@Param(Constants.ENTITY) HRDutySkill entity);
@Override
int update(@Param(Constants.ENTITY) HRDutySkill entity, @Param("ew") Wrapper<HRDutySkill> 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<HRDutySkill> selectByHrdutyid(@Param("hrdutyid") Serializable hrdutyid) ;
}
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.HRDutyCert;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyCertSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRDutyCert] 服务对象接口
*/
public interface IHRDutyCertService extends IService<HRDutyCert>{
boolean create(HRDutyCert et) ;
void createBatch(List<HRDutyCert> list) ;
boolean update(HRDutyCert et) ;
void updateBatch(List<HRDutyCert> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRDutyCert get(String key) ;
HRDutyCert getDraft(HRDutyCert et) ;
boolean checkKey(HRDutyCert et) ;
boolean save(HRDutyCert et) ;
void saveBatch(List<HRDutyCert> list) ;
Page<HRDutyCert> searchDefault(HRDutyCertSearchContext context) ;
List<HRDutyCert> selectByHrdutyid(String hrdutyid) ;
void removeByHrdutyid(String hrdutyid) ;
/**
*自定义查询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<HRDutyCert> getHrdutycertByIds(List<String> ids) ;
List<HRDutyCert> getHrdutycertByEntities(List<HRDutyCert> 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.HRDutyEdu;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyEduSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRDutyEdu] 服务对象接口
*/
public interface IHRDutyEduService extends IService<HRDutyEdu>{
boolean create(HRDutyEdu et) ;
void createBatch(List<HRDutyEdu> list) ;
boolean update(HRDutyEdu et) ;
void updateBatch(List<HRDutyEdu> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRDutyEdu get(String key) ;
HRDutyEdu getDraft(HRDutyEdu et) ;
boolean checkKey(HRDutyEdu et) ;
boolean save(HRDutyEdu et) ;
void saveBatch(List<HRDutyEdu> list) ;
Page<HRDutyEdu> searchDefault(HRDutyEduSearchContext context) ;
List<HRDutyEdu> selectByHrdutyid(String hrdutyid) ;
void removeByHrdutyid(String hrdutyid) ;
/**
*自定义查询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<HRDutyEdu> getHrdutyeduByIds(List<String> ids) ;
List<HRDutyEdu> getHrdutyeduByEntities(List<HRDutyEdu> 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.HRDutySkill;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySkillSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRDutySkill] 服务对象接口
*/
public interface IHRDutySkillService extends IService<HRDutySkill>{
boolean create(HRDutySkill et) ;
void createBatch(List<HRDutySkill> list) ;
boolean update(HRDutySkill et) ;
void updateBatch(List<HRDutySkill> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRDutySkill get(String key) ;
HRDutySkill getDraft(HRDutySkill et) ;
boolean checkKey(HRDutySkill et) ;
boolean save(HRDutySkill et) ;
void saveBatch(List<HRDutySkill> list) ;
Page<HRDutySkill> searchDefault(HRDutySkillSearchContext context) ;
List<HRDutySkill> selectByHrdutyid(String hrdutyid) ;
void removeByHrdutyid(String hrdutyid) ;
/**
*自定义查询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<HRDutySkill> getHrdutyskillByIds(List<String> ids) ;
List<HRDutySkill> getHrdutyskillByEntities(List<HRDutySkill> 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.HRDutyCert;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyCertSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyCertService;
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.HRDutyCertMapper;
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("HRDutyCertServiceImpl")
public class HRDutyCertServiceImpl extends ServiceImpl<HRDutyCertMapper, HRDutyCert> implements IHRDutyCertService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService hrdutyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRDutyCert et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrdutycertid()),et);
return true;
}
@Override
public void createBatch(List<HRDutyCert> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRDutyCert et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrdutycertid",et.getHrdutycertid())))
return false;
CachedBeanCopier.copy(get(et.getHrdutycertid()),et);
return true;
}
@Override
public void updateBatch(List<HRDutyCert> 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 HRDutyCert get(String key) {
HRDutyCert et = getById(key);
if(et==null){
et=new HRDutyCert();
et.setHrdutycertid(key);
}
else{
}
return et;
}
@Override
public HRDutyCert getDraft(HRDutyCert et) {
return et;
}
@Override
public boolean checkKey(HRDutyCert et) {
return (!ObjectUtils.isEmpty(et.getHrdutycertid()))&&(!Objects.isNull(this.getById(et.getHrdutycertid())));
}
@Override
@Transactional
public boolean save(HRDutyCert et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRDutyCert et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRDutyCert> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRDutyCert> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<HRDutyCert> selectByHrdutyid(String hrdutyid) {
return baseMapper.selectByHrdutyid(hrdutyid);
}
@Override
public void removeByHrdutyid(String hrdutyid) {
this.remove(new QueryWrapper<HRDutyCert>().eq("hrdutyid",hrdutyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRDutyCert> searchDefault(HRDutyCertSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRDutyCert> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRDutyCert>(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<HRDutyCert> getHrdutycertByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRDutyCert> getHrdutycertByEntities(List<HRDutyCert> entities) {
List ids =new ArrayList();
for(HRDutyCert entity : entities){
Serializable id=entity.getHrdutycertid();
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.HRDutyEdu;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyEduSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyEduService;
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.HRDutyEduMapper;
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("HRDutyEduServiceImpl")
public class HRDutyEduServiceImpl extends ServiceImpl<HRDutyEduMapper, HRDutyEdu> implements IHRDutyEduService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService hrdutyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRDutyEdu et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrdutyeduid()),et);
return true;
}
@Override
public void createBatch(List<HRDutyEdu> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRDutyEdu et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrdutyeduid",et.getHrdutyeduid())))
return false;
CachedBeanCopier.copy(get(et.getHrdutyeduid()),et);
return true;
}
@Override
public void updateBatch(List<HRDutyEdu> 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 HRDutyEdu get(String key) {
HRDutyEdu et = getById(key);
if(et==null){
et=new HRDutyEdu();
et.setHrdutyeduid(key);
}
else{
}
return et;
}
@Override
public HRDutyEdu getDraft(HRDutyEdu et) {
return et;
}
@Override
public boolean checkKey(HRDutyEdu et) {
return (!ObjectUtils.isEmpty(et.getHrdutyeduid()))&&(!Objects.isNull(this.getById(et.getHrdutyeduid())));
}
@Override
@Transactional
public boolean save(HRDutyEdu et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRDutyEdu et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRDutyEdu> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRDutyEdu> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<HRDutyEdu> selectByHrdutyid(String hrdutyid) {
return baseMapper.selectByHrdutyid(hrdutyid);
}
@Override
public void removeByHrdutyid(String hrdutyid) {
this.remove(new QueryWrapper<HRDutyEdu>().eq("hrdutyid",hrdutyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRDutyEdu> searchDefault(HRDutyEduSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRDutyEdu> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRDutyEdu>(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<HRDutyEdu> getHrdutyeduByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRDutyEdu> getHrdutyeduByEntities(List<HRDutyEdu> entities) {
List ids =new ArrayList();
for(HRDutyEdu entity : entities){
Serializable id=entity.getHrdutyeduid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -45,6 +45,15 @@ import org.springframework.util.StringUtils;
@Service("HRDutyServiceImpl")
public class HRDutyServiceImpl extends ServiceImpl<HRDutyMapper, HRDuty> implements IHRDutyService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyCertService hrdutycertService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyEduService hrdutyeduService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutySkillService hrdutyskillService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostService hrpostService;
......
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.HRDutySkill;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySkillSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutySkillService;
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.HRDutySkillMapper;
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("HRDutySkillServiceImpl")
public class HRDutySkillServiceImpl extends ServiceImpl<HRDutySkillMapper, HRDutySkill> implements IHRDutySkillService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService hrdutyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRDutySkill et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrdutyskillid()),et);
return true;
}
@Override
public void createBatch(List<HRDutySkill> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRDutySkill et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrdutyskillid",et.getHrdutyskillid())))
return false;
CachedBeanCopier.copy(get(et.getHrdutyskillid()),et);
return true;
}
@Override
public void updateBatch(List<HRDutySkill> 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 HRDutySkill get(String key) {
HRDutySkill et = getById(key);
if(et==null){
et=new HRDutySkill();
et.setHrdutyskillid(key);
}
else{
}
return et;
}
@Override
public HRDutySkill getDraft(HRDutySkill et) {
return et;
}
@Override
public boolean checkKey(HRDutySkill et) {
return (!ObjectUtils.isEmpty(et.getHrdutyskillid()))&&(!Objects.isNull(this.getById(et.getHrdutyskillid())));
}
@Override
@Transactional
public boolean save(HRDutySkill et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRDutySkill et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRDutySkill> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRDutySkill> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<HRDutySkill> selectByHrdutyid(String hrdutyid) {
return baseMapper.selectByHrdutyid(hrdutyid);
}
@Override
public void removeByHrdutyid(String hrdutyid) {
this.remove(new QueryWrapper<HRDutySkill>().eq("hrdutyid",hrdutyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRDutySkill> searchDefault(HRDutySkillSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRDutySkill> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRDutySkill>(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<HRDutySkill> getHrdutyskillByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRDutySkill> getHrdutyskillByEntities(List<HRDutySkill> entities) {
List ids =new ArrayList();
for(HRDutySkill entity : entities){
Serializable id=entity.getHrdutyskillid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -5,7 +5,7 @@
<!--该方法用于重写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}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTY` t1 ) t1 where hrdutyid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -27,12 +27,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTY` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`MEMO`, 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
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYNAME`, t1.`MEMO`, 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.HRDutyCertMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRDutyCertResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYCERTID`, t1.`HRDUTYCERTNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYCERT` t1 ) t1 where hrdutycertid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRDutyCertResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRDutyCert" autoMapping="true">
<id property="hrdutycertid" column="hrdutycertid" /><!--主键字段映射-->
<result property="hrdutyid" column="hrdutyid" />
<!--通过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>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRDUTYCERT_HRDUTY_HRDUTYID] -->
<select id="selectByHrdutyid" resultMap="HRDutyCertResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrdutyid=#{hrdutyid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRDutyCertSearchContext" resultMap="HRDutyCertResultMap">
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.`HRDUTYCERTID`, t1.`HRDUTYCERTNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYCERT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYCERTID`, t1.`HRDUTYCERTNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYCERT` 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.HRDutyEduMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRDutyEduResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYEDUID`, t1.`HRDUTYEDUNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYEDU` t1 ) t1 where hrdutyeduid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRDutyEduResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRDutyEdu" autoMapping="true">
<id property="hrdutyeduid" column="hrdutyeduid" /><!--主键字段映射-->
<result property="hrdutyid" column="hrdutyid" />
<!--通过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>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRDUTYEDU_HRDUTY_HRDUTYID] -->
<select id="selectByHrdutyid" resultMap="HRDutyEduResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrdutyid=#{hrdutyid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRDutyEduSearchContext" resultMap="HRDutyEduResultMap">
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.`HRDUTYEDUID`, t1.`HRDUTYEDUNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYEDU` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYEDUID`, t1.`HRDUTYEDUNAME`, t1.`HRDUTYID`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYEDU` 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.HRDutySkillMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRDutySkillResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYSKILLID`, t1.`HRDUTYSKILLNAME`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYSKILL` t1 ) t1 where hrdutyskillid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRDutySkillResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRDutySkill" autoMapping="true">
<id property="hrdutyskillid" column="hrdutyskillid" /><!--主键字段映射-->
<result property="hrdutyid" column="hrdutyid" />
<!--通过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>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRDUTYSKILL_HRDUTY_HRDUTYID] -->
<select id="selectByHrdutyid" resultMap="HRDutySkillResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrdutyid=#{hrdutyid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRDutySkillSearchContext" resultMap="HRDutySkillResultMap">
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.`HRDUTYSKILLID`, t1.`HRDUTYSKILLNAME`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYSKILL` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYID`, t1.`HRDUTYSKILLID`, t1.`HRDUTYSKILLNAME`, t1.`IMPORTANCE`, t1.`MEMO`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRDUTYSKILL` t1
]]>
</sql>
</mapper>
......@@ -52,6 +52,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HRDutyEdu",
"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":"HROMHIERARCHYPURPOSE",
"delogicname":"组织层次结构应用",
"sysmoudle":{"id":"BASE","name":"基础"},
......@@ -100,6 +108,22 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HRDutySkill",
"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":"HRDutyCert",
"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":"HRDuty",
"delogicname":"职务",
"sysmoudle":{"id":"HUMANRESOURCE","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对象[HRDutyCertDTO]
*/
@Data
public class HRDutyCertDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRDUTYCERTNAME]
*
*/
@JSONField(name = "hrdutycertname")
@JsonProperty("hrdutycertname")
private String hrdutycertname;
/**
* 属性 [HRDUTYCERTID]
*
*/
@JSONField(name = "hrdutycertid")
@JsonProperty("hrdutycertid")
private String hrdutycertid;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [MEMO]
*
*/
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 属性 [IMPORTANCE]
*
*/
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 属性 [HRDUTYID]
*
*/
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 设置 [HRDUTYCERTNAME]
*/
public void setHrdutycertname(String hrdutycertname){
this.hrdutycertname = hrdutycertname ;
this.modify("hrdutycertname",hrdutycertname);
}
/**
* 设置 [MEMO]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [IMPORTANCE]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [HRDUTYID]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
......@@ -74,6 +74,14 @@ public class HRDutyDTO extends DTOBase implements Serializable {
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [MEMO]
*
*/
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 设置 [HRDUTYNAME]
......@@ -83,6 +91,14 @@ public class HRDutyDTO extends DTOBase implements Serializable {
this.modify("hrdutyname",hrdutyname);
}
/**
* 设置 [MEMO]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
}
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对象[HRDutyEduDTO]
*/
@Data
public class HRDutyEduDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRDUTYEDUID]
*
*/
@JSONField(name = "hrdutyeduid")
@JsonProperty("hrdutyeduid")
private String hrdutyeduid;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [HRDUTYEDUNAME]
*
*/
@JSONField(name = "hrdutyeduname")
@JsonProperty("hrdutyeduname")
private String hrdutyeduname;
/**
* 属性 [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;
/**
* 属性 [MEMO]
*
*/
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 属性 [IMPORTANCE]
*
*/
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 属性 [HRDUTYID]
*
*/
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 设置 [HRDUTYEDUNAME]
*/
public void setHrdutyeduname(String hrdutyeduname){
this.hrdutyeduname = hrdutyeduname ;
this.modify("hrdutyeduname",hrdutyeduname);
}
/**
* 设置 [MEMO]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [IMPORTANCE]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [HRDUTYID]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
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对象[HRDutySkillDTO]
*/
@Data
public class HRDutySkillDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRDUTYSKILLNAME]
*
*/
@JSONField(name = "hrdutyskillname")
@JsonProperty("hrdutyskillname")
private String hrdutyskillname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [HRDUTYSKILLID]
*
*/
@JSONField(name = "hrdutyskillid")
@JsonProperty("hrdutyskillid")
private String hrdutyskillid;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [MEMO]
*
*/
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 属性 [IMPORTANCE]
*
*/
@JSONField(name = "importance")
@JsonProperty("importance")
private String importance;
/**
* 属性 [HRDUTYID]
*
*/
@JSONField(name = "hrdutyid")
@JsonProperty("hrdutyid")
private String hrdutyid;
/**
* 设置 [HRDUTYSKILLNAME]
*/
public void setHrdutyskillname(String hrdutyskillname){
this.hrdutyskillname = hrdutyskillname ;
this.modify("hrdutyskillname",hrdutyskillname);
}
/**
* 设置 [MEMO]
*/
public void setMemo(String memo){
this.memo = memo ;
this.modify("memo",memo);
}
/**
* 设置 [IMPORTANCE]
*/
public void setImportance(String importance){
this.importance = importance ;
this.modify("importance",importance);
}
/**
* 设置 [HRDUTYID]
*/
public void setHrdutyid(String hrdutyid){
this.hrdutyid = hrdutyid ;
this.modify("hrdutyid",hrdutyid);
}
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDutyCert;
import cn.ibizlab.humanresource.hrapi.dto.HRDutyCertDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRDutyCertMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRDutyCertMapping extends MappingBase<HRDutyCertDTO, HRDutyCert> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDutyEdu;
import cn.ibizlab.humanresource.hrapi.dto.HRDutyEduDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRDutyEduMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRDutyEduMapping extends MappingBase<HRDutyEduDTO, HRDutyEdu> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.humanresource.domain.HRDutySkill;
import cn.ibizlab.humanresource.hrapi.dto.HRDutySkillDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRDutySkillMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRDutySkillMapping extends MappingBase<HRDutySkillDTO, HRDutySkill> {
}
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.HRDutyCert;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyCertService;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyCertSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"职务证书" })
@RestController("HRApi-hrdutycert")
@RequestMapping("")
public class HRDutyCertResource {
@Autowired
public IHRDutyCertService hrdutycertService;
@Autowired
@Lazy
public HRDutyCertMapping hrdutycertMapping;
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdto),'iBizHumanResources-HRDutyCert-Create')")
@ApiOperation(value = "新建职务证书", tags = {"职务证书" }, notes = "新建职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutycerts")
@Transactional
public ResponseEntity<HRDutyCertDTO> create(@RequestBody HRDutyCertDTO hrdutycertdto) {
HRDutyCert domain = hrdutycertMapping.toDomain(hrdutycertdto);
hrdutycertService.create(domain);
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdtos),'iBizHumanResources-HRDutyCert-Create')")
@ApiOperation(value = "批量新建职务证书", tags = {"职务证书" }, notes = "批量新建职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutycerts/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
hrdutycertService.createBatch(hrdutycertMapping.toDomain(hrdutycertdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdutycert" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutycertService.get(#hrdutycert_id),'iBizHumanResources-HRDutyCert-Update')")
@ApiOperation(value = "更新职务证书", tags = {"职务证书" }, notes = "更新职务证书")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutycerts/{hrdutycert_id}")
@Transactional
public ResponseEntity<HRDutyCertDTO> update(@PathVariable("hrdutycert_id") String hrdutycert_id, @RequestBody HRDutyCertDTO hrdutycertdto) {
HRDutyCert domain = hrdutycertMapping.toDomain(hrdutycertdto);
domain .setHrdutycertid(hrdutycert_id);
hrdutycertService.update(domain );
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutycertService.getHrdutycertByEntities(this.hrdutycertMapping.toDomain(#hrdutycertdtos)),'iBizHumanResources-HRDutyCert-Update')")
@ApiOperation(value = "批量更新职务证书", tags = {"职务证书" }, notes = "批量更新职务证书")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutycerts/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
hrdutycertService.updateBatch(hrdutycertMapping.toDomain(hrdutycertdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutycertService.get(#hrdutycert_id),'iBizHumanResources-HRDutyCert-Remove')")
@ApiOperation(value = "删除职务证书", tags = {"职务证书" }, notes = "删除职务证书")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutycerts/{hrdutycert_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrdutycert_id") String hrdutycert_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.remove(hrdutycert_id));
}
@PreAuthorize("hasPermission(this.hrdutycertService.getHrdutycertByIds(#ids),'iBizHumanResources-HRDutyCert-Remove')")
@ApiOperation(value = "批量删除职务证书", tags = {"职务证书" }, notes = "批量删除职务证书")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutycerts/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrdutycertService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutycertMapping.toDomain(returnObject.body),'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "获取职务证书", tags = {"职务证书" }, notes = "获取职务证书")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutycerts/{hrdutycert_id}")
public ResponseEntity<HRDutyCertDTO> get(@PathVariable("hrdutycert_id") String hrdutycert_id) {
HRDutyCert domain = hrdutycertService.get(hrdutycert_id);
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取职务证书草稿", tags = {"职务证书" }, notes = "获取职务证书草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutycerts/getdraft")
public ResponseEntity<HRDutyCertDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertMapping.toDto(hrdutycertService.getDraft(new HRDutyCert())));
}
@ApiOperation(value = "检查职务证书", tags = {"职务证书" }, notes = "检查职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutycerts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRDutyCertDTO hrdutycertdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.checkKey(hrdutycertMapping.toDomain(hrdutycertdto)));
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdto),'iBizHumanResources-HRDutyCert-Save')")
@ApiOperation(value = "保存职务证书", tags = {"职务证书" }, notes = "保存职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutycerts/save")
public ResponseEntity<Boolean> save(@RequestBody HRDutyCertDTO hrdutycertdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.save(hrdutycertMapping.toDomain(hrdutycertdto)));
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdtos),'iBizHumanResources-HRDutyCert-Save')")
@ApiOperation(value = "批量保存职务证书", tags = {"职务证书" }, notes = "批量保存职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutycerts/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
hrdutycertService.saveBatch(hrdutycertMapping.toDomain(hrdutycertdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDutyCert-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"职务证书" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrdutycerts/fetchdefault")
public ResponseEntity<List<HRDutyCertDTO>> fetchDefault(HRDutyCertSearchContext context) {
Page<HRDutyCert> domains = hrdutycertService.searchDefault(context) ;
List<HRDutyCertDTO> list = hrdutycertMapping.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-HRDutyCert-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"职务证书" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrdutycerts/searchdefault")
public ResponseEntity<Page<HRDutyCertDTO>> searchDefault(@RequestBody HRDutyCertSearchContext context) {
Page<HRDutyCert> domains = hrdutycertService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutycertMapping.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.HRDutyEdu;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutyEduService;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutyEduSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"职务教育" })
@RestController("HRApi-hrdutyedu")
@RequestMapping("")
public class HRDutyEduResource {
@Autowired
public IHRDutyEduService hrdutyeduService;
@Autowired
@Lazy
public HRDutyEduMapping hrdutyeduMapping;
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudto),'iBizHumanResources-HRDutyEdu-Create')")
@ApiOperation(value = "新建职务教育", tags = {"职务教育" }, notes = "新建职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyedus")
@Transactional
public ResponseEntity<HRDutyEduDTO> create(@RequestBody HRDutyEduDTO hrdutyedudto) {
HRDutyEdu domain = hrdutyeduMapping.toDomain(hrdutyedudto);
hrdutyeduService.create(domain);
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudtos),'iBizHumanResources-HRDutyEdu-Create')")
@ApiOperation(value = "批量新建职务教育", tags = {"职务教育" }, notes = "批量新建职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyedus/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
hrdutyeduService.createBatch(hrdutyeduMapping.toDomain(hrdutyedudtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdutyedu" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutyeduService.get(#hrdutyedu_id),'iBizHumanResources-HRDutyEdu-Update')")
@ApiOperation(value = "更新职务教育", tags = {"职务教育" }, notes = "更新职务教育")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutyedus/{hrdutyedu_id}")
@Transactional
public ResponseEntity<HRDutyEduDTO> update(@PathVariable("hrdutyedu_id") String hrdutyedu_id, @RequestBody HRDutyEduDTO hrdutyedudto) {
HRDutyEdu domain = hrdutyeduMapping.toDomain(hrdutyedudto);
domain .setHrdutyeduid(hrdutyedu_id);
hrdutyeduService.update(domain );
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyeduService.getHrdutyeduByEntities(this.hrdutyeduMapping.toDomain(#hrdutyedudtos)),'iBizHumanResources-HRDutyEdu-Update')")
@ApiOperation(value = "批量更新职务教育", tags = {"职务教育" }, notes = "批量更新职务教育")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutyedus/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
hrdutyeduService.updateBatch(hrdutyeduMapping.toDomain(hrdutyedudtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutyeduService.get(#hrdutyedu_id),'iBizHumanResources-HRDutyEdu-Remove')")
@ApiOperation(value = "删除职务教育", tags = {"职务教育" }, notes = "删除职务教育")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutyedus/{hrdutyedu_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrdutyedu_id") String hrdutyedu_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.remove(hrdutyedu_id));
}
@PreAuthorize("hasPermission(this.hrdutyeduService.getHrdutyeduByIds(#ids),'iBizHumanResources-HRDutyEdu-Remove')")
@ApiOperation(value = "批量删除职务教育", tags = {"职务教育" }, notes = "批量删除职务教育")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutyedus/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrdutyeduService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(returnObject.body),'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "获取职务教育", tags = {"职务教育" }, notes = "获取职务教育")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutyedus/{hrdutyedu_id}")
public ResponseEntity<HRDutyEduDTO> get(@PathVariable("hrdutyedu_id") String hrdutyedu_id) {
HRDutyEdu domain = hrdutyeduService.get(hrdutyedu_id);
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取职务教育草稿", tags = {"职务教育" }, notes = "获取职务教育草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutyedus/getdraft")
public ResponseEntity<HRDutyEduDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduMapping.toDto(hrdutyeduService.getDraft(new HRDutyEdu())));
}
@ApiOperation(value = "检查职务教育", tags = {"职务教育" }, notes = "检查职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyedus/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRDutyEduDTO hrdutyedudto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.checkKey(hrdutyeduMapping.toDomain(hrdutyedudto)));
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudto),'iBizHumanResources-HRDutyEdu-Save')")
@ApiOperation(value = "保存职务教育", tags = {"职务教育" }, notes = "保存职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyedus/save")
public ResponseEntity<Boolean> save(@RequestBody HRDutyEduDTO hrdutyedudto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.save(hrdutyeduMapping.toDomain(hrdutyedudto)));
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudtos),'iBizHumanResources-HRDutyEdu-Save')")
@ApiOperation(value = "批量保存职务教育", tags = {"职务教育" }, notes = "批量保存职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyedus/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
hrdutyeduService.saveBatch(hrdutyeduMapping.toDomain(hrdutyedudtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDutyEdu-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"职务教育" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrdutyedus/fetchdefault")
public ResponseEntity<List<HRDutyEduDTO>> fetchDefault(HRDutyEduSearchContext context) {
Page<HRDutyEdu> domains = hrdutyeduService.searchDefault(context) ;
List<HRDutyEduDTO> list = hrdutyeduMapping.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-HRDutyEdu-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"职务教育" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrdutyedus/searchdefault")
public ResponseEntity<Page<HRDutyEduDTO>> searchDefault(@RequestBody HRDutyEduSearchContext context) {
Page<HRDutyEdu> domains = hrdutyeduService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutyeduMapping.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.HRDutySkill;
import cn.ibizlab.humanresource.core.humanresource.service.IHRDutySkillService;
import cn.ibizlab.humanresource.core.humanresource.filter.HRDutySkillSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"职务技能" })
@RestController("HRApi-hrdutyskill")
@RequestMapping("")
public class HRDutySkillResource {
@Autowired
public IHRDutySkillService hrdutyskillService;
@Autowired
@Lazy
public HRDutySkillMapping hrdutyskillMapping;
@PreAuthorize("hasPermission(this.hrdutyskillMapping.toDomain(#hrdutyskilldto),'iBizHumanResources-HRDutySkill-Create')")
@ApiOperation(value = "新建职务技能", tags = {"职务技能" }, notes = "新建职务技能")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyskills")
@Transactional
public ResponseEntity<HRDutySkillDTO> create(@RequestBody HRDutySkillDTO hrdutyskilldto) {
HRDutySkill domain = hrdutyskillMapping.toDomain(hrdutyskilldto);
hrdutyskillService.create(domain);
HRDutySkillDTO dto = hrdutyskillMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyskillMapping.toDomain(#hrdutyskilldtos),'iBizHumanResources-HRDutySkill-Create')")
@ApiOperation(value = "批量新建职务技能", tags = {"职务技能" }, notes = "批量新建职务技能")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyskills/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRDutySkillDTO> hrdutyskilldtos) {
hrdutyskillService.createBatch(hrdutyskillMapping.toDomain(hrdutyskilldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdutyskill" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutyskillService.get(#hrdutyskill_id),'iBizHumanResources-HRDutySkill-Update')")
@ApiOperation(value = "更新职务技能", tags = {"职务技能" }, notes = "更新职务技能")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutyskills/{hrdutyskill_id}")
@Transactional
public ResponseEntity<HRDutySkillDTO> update(@PathVariable("hrdutyskill_id") String hrdutyskill_id, @RequestBody HRDutySkillDTO hrdutyskilldto) {
HRDutySkill domain = hrdutyskillMapping.toDomain(hrdutyskilldto);
domain .setHrdutyskillid(hrdutyskill_id);
hrdutyskillService.update(domain );
HRDutySkillDTO dto = hrdutyskillMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyskillService.getHrdutyskillByEntities(this.hrdutyskillMapping.toDomain(#hrdutyskilldtos)),'iBizHumanResources-HRDutySkill-Update')")
@ApiOperation(value = "批量更新职务技能", tags = {"职务技能" }, notes = "批量更新职务技能")
@RequestMapping(method = RequestMethod.PUT, value = "/hrdutyskills/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRDutySkillDTO> hrdutyskilldtos) {
hrdutyskillService.updateBatch(hrdutyskillMapping.toDomain(hrdutyskilldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutyskillService.get(#hrdutyskill_id),'iBizHumanResources-HRDutySkill-Remove')")
@ApiOperation(value = "删除职务技能", tags = {"职务技能" }, notes = "删除职务技能")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutyskills/{hrdutyskill_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrdutyskill_id") String hrdutyskill_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyskillService.remove(hrdutyskill_id));
}
@PreAuthorize("hasPermission(this.hrdutyskillService.getHrdutyskillByIds(#ids),'iBizHumanResources-HRDutySkill-Remove')")
@ApiOperation(value = "批量删除职务技能", tags = {"职务技能" }, notes = "批量删除职务技能")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrdutyskills/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrdutyskillService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutyskillMapping.toDomain(returnObject.body),'iBizHumanResources-HRDutySkill-Get')")
@ApiOperation(value = "获取职务技能", tags = {"职务技能" }, notes = "获取职务技能")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutyskills/{hrdutyskill_id}")
public ResponseEntity<HRDutySkillDTO> get(@PathVariable("hrdutyskill_id") String hrdutyskill_id) {
HRDutySkill domain = hrdutyskillService.get(hrdutyskill_id);
HRDutySkillDTO dto = hrdutyskillMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取职务技能草稿", tags = {"职务技能" }, notes = "获取职务技能草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrdutyskills/getdraft")
public ResponseEntity<HRDutySkillDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyskillMapping.toDto(hrdutyskillService.getDraft(new HRDutySkill())));
}
@ApiOperation(value = "检查职务技能", tags = {"职务技能" }, notes = "检查职务技能")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyskills/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRDutySkillDTO hrdutyskilldto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyskillService.checkKey(hrdutyskillMapping.toDomain(hrdutyskilldto)));
}
@PreAuthorize("hasPermission(this.hrdutyskillMapping.toDomain(#hrdutyskilldto),'iBizHumanResources-HRDutySkill-Save')")
@ApiOperation(value = "保存职务技能", tags = {"职务技能" }, notes = "保存职务技能")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyskills/save")
public ResponseEntity<Boolean> save(@RequestBody HRDutySkillDTO hrdutyskilldto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyskillService.save(hrdutyskillMapping.toDomain(hrdutyskilldto)));
}
@PreAuthorize("hasPermission(this.hrdutyskillMapping.toDomain(#hrdutyskilldtos),'iBizHumanResources-HRDutySkill-Save')")
@ApiOperation(value = "批量保存职务技能", tags = {"职务技能" }, notes = "批量保存职务技能")
@RequestMapping(method = RequestMethod.POST, value = "/hrdutyskills/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRDutySkillDTO> hrdutyskilldtos) {
hrdutyskillService.saveBatch(hrdutyskillMapping.toDomain(hrdutyskilldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDutySkill-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutySkill-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"职务技能" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrdutyskills/fetchdefault")
public ResponseEntity<List<HRDutySkillDTO>> fetchDefault(HRDutySkillSearchContext context) {
Page<HRDutySkill> domains = hrdutyskillService.searchDefault(context) ;
List<HRDutySkillDTO> list = hrdutyskillMapping.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-HRDutySkill-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutySkill-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"职务技能" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrdutyskills/searchdefault")
public ResponseEntity<Page<HRDutySkillDTO>> searchDefault(@RequestBody HRDutySkillSearchContext context) {
Page<HRDutySkill> domains = hrdutyskillService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutyskillMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册