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

jackwang 部署微服务接口

上级 502947a7
......@@ -37,6 +37,11 @@
git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/
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>
......
......@@ -39,6 +39,10 @@ zuul:
path: /hrempstates/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrtransferapply:
path: /hrtransferapplies/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrtechnicaltitle:
path: /hrtechnicaltitles/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......
......@@ -59,6 +59,9 @@ public class HROrganizationServiceImpl extends ServiceImpl<HROrganizationMapper,
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostService hrpostService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.pcm.service.IHRTransferApplyService hrtransferapplyService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService hromhierarchyService;
protected int batchSize = 500;
......
......@@ -86,6 +86,9 @@ public class HREmployeeServiceImpl extends ServiceImpl<HREmployeeMapper, HREmplo
protected cn.ibizlab.humanresource.core.humanresource.service.IHRTrainingRecordService hrtrainingrecordService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.pcm.service.IHRTransferApplyService hrtransferapplyService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRWorkRecordService hrworkrecordService;
@Autowired
@Lazy
......
......@@ -56,6 +56,9 @@ public class HRPostServiceImpl extends ServiceImpl<HRPostMapper, HRPost> impleme
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostRelService hrpostrelService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.pcm.service.IHRTransferApplyService hrtransferapplyService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRDutyService hrdutyService;
@Autowired
@Lazy
......
package cn.ibizlab.humanresource.core.pcm.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_HRTRANSFERAPPLY",resultMap = "HRTransferApplyResultMap")
public class HRTransferApply extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 调动申请标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrtransferapplyid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrtransferapplyid")
@JsonProperty("hrtransferapplyid")
private String hrtransferapplyid;
/**
* 调动申请名称
*/
@TableField(value = "hrtransferapplyname")
@JSONField(name = "hrtransferapplyname")
@JsonProperty("hrtransferapplyname")
private String hrtransferapplyname;
/**
* 更新人
*/
@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.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 员工标识
*/
@TableField(value = "hremployeeid")
@JSONField(name = "hremployeeid")
@JsonProperty("hremployeeid")
private String hremployeeid;
/**
* 员工姓名
*/
@TableField(exist = false)
@JSONField(name = "hremployeename")
@JsonProperty("hremployeename")
private String hremployeename;
/**
* 部门ID
*/
@TableField(exist = false)
@JSONField(name = "organizationid")
@JsonProperty("organizationid")
private String organizationid;
/**
* 部门
*/
@TableField(exist = false)
@JSONField(name = "organizationname")
@JsonProperty("organizationname")
private String organizationname;
/**
* 职务
*/
@TableField(value = "hrdutyname")
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 职位
*/
@TableField(value = "hrpostname")
@JSONField(name = "hrpostname")
@JsonProperty("hrpostname")
private String hrpostname;
/**
* 新组织ID
*/
@TableField(value = "hrorganizationid2")
@JSONField(name = "hrorganizationid2")
@JsonProperty("hrorganizationid2")
private String hrorganizationid2;
/**
* 新部门
*/
@TableField(exist = false)
@JSONField(name = "hrorganizationname2")
@JsonProperty("hrorganizationname2")
private String hrorganizationname2;
/**
* 新职位标识
*/
@TableField(value = "hrpostid2")
@JSONField(name = "hrpostid2")
@JsonProperty("hrpostid2")
private String hrpostid2;
/**
* 新职位
*/
@TableField(exist = false)
@JSONField(name = "hrpostname2")
@JsonProperty("hrpostname2")
private String hrpostname2;
/**
* 新职务
*/
@TableField(value = "hrdutyname2")
@JSONField(name = "hrdutyname2")
@JsonProperty("hrdutyname2")
private String hrdutyname2;
/**
* 生效日期
*/
@TableField(value = "activetime")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "activetime" , format="yyyy-MM-dd")
@JsonProperty("activetime")
private Timestamp activetime;
/**
* 任职文件
*/
@TableField(value = "attachment")
@JSONField(name = "attachment")
@JsonProperty("attachment")
private String attachment;
/**
* 员工
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HREmployee hremployee;
/**
* 新单位
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization2;
/**
* 新职位
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.humanresource.domain.HRPost hrpost2;
/**
* 设置 [调动申请名称]
*/
public void setHrtransferapplyname(String hrtransferapplyname){
this.hrtransferapplyname = hrtransferapplyname ;
this.modify("hrtransferapplyname",hrtransferapplyname);
}
/**
* 设置 [员工标识]
*/
public void setHremployeeid(String hremployeeid){
this.hremployeeid = hremployeeid ;
this.modify("hremployeeid",hremployeeid);
}
/**
* 设置 [职务]
*/
public void setHrdutyname(String hrdutyname){
this.hrdutyname = hrdutyname ;
this.modify("hrdutyname",hrdutyname);
}
/**
* 设置 [职位]
*/
public void setHrpostname(String hrpostname){
this.hrpostname = hrpostname ;
this.modify("hrpostname",hrpostname);
}
/**
* 设置 [新组织ID]
*/
public void setHrorganizationid2(String hrorganizationid2){
this.hrorganizationid2 = hrorganizationid2 ;
this.modify("hrorganizationid2",hrorganizationid2);
}
/**
* 设置 [新职位标识]
*/
public void setHrpostid2(String hrpostid2){
this.hrpostid2 = hrpostid2 ;
this.modify("hrpostid2",hrpostid2);
}
/**
* 设置 [新职务]
*/
public void setHrdutyname2(String hrdutyname2){
this.hrdutyname2 = hrdutyname2 ;
this.modify("hrdutyname2",hrdutyname2);
}
/**
* 设置 [生效日期]
*/
public void setActivetime(Timestamp activetime){
this.activetime = activetime ;
this.modify("activetime",activetime);
}
/**
* 格式化日期 [生效日期]
*/
public String formatActivetime(){
if (this.activetime == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(activetime);
}
/**
* 设置 [任职文件]
*/
public void setAttachment(String attachment){
this.attachment = attachment ;
this.modify("attachment",attachment);
}
}
package cn.ibizlab.humanresource.core.pcm.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.pcm.domain.HRTransferApply;
/**
* 关系型数据实体[HRTransferApply] 查询条件对象
*/
@Slf4j
@Data
public class HRTransferApplySearchContext extends QueryWrapperContext<HRTransferApply> {
private String n_hrtransferapplyname_like;//[调动申请名称]
public void setN_hrtransferapplyname_like(String n_hrtransferapplyname_like) {
this.n_hrtransferapplyname_like = n_hrtransferapplyname_like;
if(!ObjectUtils.isEmpty(this.n_hrtransferapplyname_like)){
this.getSearchCond().like("hrtransferapplyname", n_hrtransferapplyname_like);
}
}
private String n_hremployeeid_eq;//[员工标识]
public void setN_hremployeeid_eq(String n_hremployeeid_eq) {
this.n_hremployeeid_eq = n_hremployeeid_eq;
if(!ObjectUtils.isEmpty(this.n_hremployeeid_eq)){
this.getSearchCond().eq("hremployeeid", n_hremployeeid_eq);
}
}
private String n_hremployeename_eq;//[员工姓名]
public void setN_hremployeename_eq(String n_hremployeename_eq) {
this.n_hremployeename_eq = n_hremployeename_eq;
if(!ObjectUtils.isEmpty(this.n_hremployeename_eq)){
this.getSearchCond().eq("hremployeename", n_hremployeename_eq);
}
}
private String n_hremployeename_like;//[员工姓名]
public void setN_hremployeename_like(String n_hremployeename_like) {
this.n_hremployeename_like = n_hremployeename_like;
if(!ObjectUtils.isEmpty(this.n_hremployeename_like)){
this.getSearchCond().like("hremployeename", n_hremployeename_like);
}
}
private String n_hrorganizationid2_eq;//[新组织ID]
public void setN_hrorganizationid2_eq(String n_hrorganizationid2_eq) {
this.n_hrorganizationid2_eq = n_hrorganizationid2_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationid2_eq)){
this.getSearchCond().eq("hrorganizationid2", n_hrorganizationid2_eq);
}
}
private String n_hrorganizationname2_eq;//[新部门]
public void setN_hrorganizationname2_eq(String n_hrorganizationname2_eq) {
this.n_hrorganizationname2_eq = n_hrorganizationname2_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationname2_eq)){
this.getSearchCond().eq("hrorganizationname2", n_hrorganizationname2_eq);
}
}
private String n_hrorganizationname2_like;//[新部门]
public void setN_hrorganizationname2_like(String n_hrorganizationname2_like) {
this.n_hrorganizationname2_like = n_hrorganizationname2_like;
if(!ObjectUtils.isEmpty(this.n_hrorganizationname2_like)){
this.getSearchCond().like("hrorganizationname2", n_hrorganizationname2_like);
}
}
private String n_hrpostid2_eq;//[新职位标识]
public void setN_hrpostid2_eq(String n_hrpostid2_eq) {
this.n_hrpostid2_eq = n_hrpostid2_eq;
if(!ObjectUtils.isEmpty(this.n_hrpostid2_eq)){
this.getSearchCond().eq("hrpostid2", n_hrpostid2_eq);
}
}
private String n_hrpostname2_eq;//[新职位]
public void setN_hrpostname2_eq(String n_hrpostname2_eq) {
this.n_hrpostname2_eq = n_hrpostname2_eq;
if(!ObjectUtils.isEmpty(this.n_hrpostname2_eq)){
this.getSearchCond().eq("hrpostname2", n_hrpostname2_eq);
}
}
private String n_hrpostname2_like;//[新职位]
public void setN_hrpostname2_like(String n_hrpostname2_like) {
this.n_hrpostname2_like = n_hrpostname2_like;
if(!ObjectUtils.isEmpty(this.n_hrpostname2_like)){
this.getSearchCond().like("hrpostname2", n_hrpostname2_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrtransferapplyname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.pcm.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.pcm.domain.HRTransferApply;
import cn.ibizlab.humanresource.core.pcm.filter.HRTransferApplySearchContext;
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 HRTransferApplyMapper extends BaseMapper<HRTransferApply>{
Page<HRTransferApply> searchDefault(IPage page, @Param("srf") HRTransferApplySearchContext context, @Param("ew") Wrapper<HRTransferApply> wrapper) ;
@Override
HRTransferApply selectById(Serializable id);
@Override
int insert(HRTransferApply entity);
@Override
int updateById(@Param(Constants.ENTITY) HRTransferApply entity);
@Override
int update(@Param(Constants.ENTITY) HRTransferApply entity, @Param("ew") Wrapper<HRTransferApply> 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<HRTransferApply> selectByHremployeeid(@Param("employeeid") Serializable employeeid) ;
List<HRTransferApply> selectByHrorganizationid2(@Param("organizationid") Serializable organizationid) ;
List<HRTransferApply> selectByHrpostid2(@Param("hrpostid") Serializable hrpostid) ;
}
package cn.ibizlab.humanresource.core.pcm.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.pcm.domain.HRTransferApply;
import cn.ibizlab.humanresource.core.pcm.filter.HRTransferApplySearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRTransferApply] 服务对象接口
*/
public interface IHRTransferApplyService extends IService<HRTransferApply>{
boolean create(HRTransferApply et) ;
void createBatch(List<HRTransferApply> list) ;
boolean update(HRTransferApply et) ;
void updateBatch(List<HRTransferApply> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRTransferApply get(String key) ;
HRTransferApply getDraft(HRTransferApply et) ;
boolean checkKey(HRTransferApply et) ;
boolean save(HRTransferApply et) ;
void saveBatch(List<HRTransferApply> list) ;
Page<HRTransferApply> searchDefault(HRTransferApplySearchContext context) ;
List<HRTransferApply> selectByHremployeeid(String employeeid) ;
void removeByHremployeeid(String employeeid) ;
List<HRTransferApply> selectByHrorganizationid2(String organizationid) ;
void removeByHrorganizationid2(String organizationid) ;
List<HRTransferApply> selectByHrpostid2(String hrpostid) ;
void removeByHrpostid2(String hrpostid) ;
/**
*自定义查询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<HRTransferApply> getHrtransferapplyByIds(List<String> ids) ;
List<HRTransferApply> getHrtransferapplyByEntities(List<HRTransferApply> entities) ;
}
package cn.ibizlab.humanresource.core.pcm.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.pcm.domain.HRTransferApply;
import cn.ibizlab.humanresource.core.pcm.filter.HRTransferApplySearchContext;
import cn.ibizlab.humanresource.core.pcm.service.IHRTransferApplyService;
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.pcm.mapper.HRTransferApplyMapper;
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("HRTransferApplyServiceImpl")
public class HRTransferApplyServiceImpl extends ServiceImpl<HRTransferApplyMapper, HRTransferApply> implements IHRTransferApplyService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHREmployeeService hremployeeService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrganizationService hrorganizationService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.humanresource.service.IHRPostService hrpostService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRTransferApply et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrtransferapplyid()),et);
return true;
}
@Override
public void createBatch(List<HRTransferApply> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRTransferApply et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrtransferapplyid",et.getHrtransferapplyid())))
return false;
CachedBeanCopier.copy(get(et.getHrtransferapplyid()),et);
return true;
}
@Override
public void updateBatch(List<HRTransferApply> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRTransferApply get(String key) {
HRTransferApply et = getById(key);
if(et==null){
et=new HRTransferApply();
et.setHrtransferapplyid(key);
}
else{
}
return et;
}
@Override
public HRTransferApply getDraft(HRTransferApply et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(HRTransferApply et) {
return (!ObjectUtils.isEmpty(et.getHrtransferapplyid()))&&(!Objects.isNull(this.getById(et.getHrtransferapplyid())));
}
@Override
@Transactional
public boolean save(HRTransferApply et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRTransferApply et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRTransferApply> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRTransferApply> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<HRTransferApply> selectByHremployeeid(String employeeid) {
return baseMapper.selectByHremployeeid(employeeid);
}
@Override
public void removeByHremployeeid(String employeeid) {
this.remove(new QueryWrapper<HRTransferApply>().eq("hremployeeid",employeeid));
}
@Override
public List<HRTransferApply> selectByHrorganizationid2(String organizationid) {
return baseMapper.selectByHrorganizationid2(organizationid);
}
@Override
public void removeByHrorganizationid2(String organizationid) {
this.remove(new QueryWrapper<HRTransferApply>().eq("hrorganizationid2",organizationid));
}
@Override
public List<HRTransferApply> selectByHrpostid2(String hrpostid) {
return baseMapper.selectByHrpostid2(hrpostid);
}
@Override
public void removeByHrpostid2(String hrpostid) {
this.remove(new QueryWrapper<HRTransferApply>().eq("hrpostid2",hrpostid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRTransferApply> searchDefault(HRTransferApplySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRTransferApply> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRTransferApply>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(HRTransferApply et){
//实体关系[DER1N_HRTRANSFERAPPLY_HREMPLOYEE_HREMPLOYEEID_327A4D]
if(!ObjectUtils.isEmpty(et.getHremployeeid())){
cn.ibizlab.humanresource.core.humanresource.domain.HREmployee hremployee=et.getHremployee();
if(ObjectUtils.isEmpty(hremployee)){
cn.ibizlab.humanresource.core.humanresource.domain.HREmployee majorEntity=hremployeeService.get(et.getHremployeeid());
et.setHremployee(majorEntity);
hremployee=majorEntity;
}
et.setHremployeename(hremployee.getEmployeename());
et.setOrganizationid(hremployee.getOrganizationid());
et.setOrganizationname(hremployee.getOrganizationname());
et.setHrdutyname(hremployee.getHrdutyname());
et.setHrpostname(hremployee.getHrpostname());
}
//实体关系[DER1N_HRTRANSFERAPPLY_HRORGANIZATION_HRORGANIZATIONID2_6BD9DC]
if(!ObjectUtils.isEmpty(et.getHrorganizationid2())){
cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization2=et.getHrorganization2();
if(ObjectUtils.isEmpty(hrorganization2)){
cn.ibizlab.humanresource.core.base.domain.HROrganization majorEntity=hrorganizationService.get(et.getHrorganizationid2());
et.setHrorganization2(majorEntity);
hrorganization2=majorEntity;
}
et.setHrorganizationname2(hrorganization2.getOrganizationname());
}
//实体关系[DER1N_HRTRANSFERAPPLY_HRPOST_HRPOSTID2]
if(!ObjectUtils.isEmpty(et.getHrpostid2())){
cn.ibizlab.humanresource.core.humanresource.domain.HRPost hrpost2=et.getHrpost2();
if(ObjectUtils.isEmpty(hrpost2)){
cn.ibizlab.humanresource.core.humanresource.domain.HRPost majorEntity=hrpostService.get(et.getHrpostid2());
et.setHrpost2(majorEntity);
hrpost2=majorEntity;
}
et.setHrpostname2(hrpost2.getHrpostname());
et.setHrdutyname2(hrpost2.getHrdutyname());
}
}
@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<HRTransferApply> getHrtransferapplyByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRTransferApply> getHrtransferapplyByEntities(List<HRTransferApply> entities) {
List ids =new ArrayList();
for(HRTransferApply entity : entities){
Serializable id=entity.getHrtransferapplyid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -220,7 +220,7 @@
<!--输出实体[HREDUCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hreducation-27-10">
<changeSet author="a_LAB01_e85d8801c" id="tab-hreducation-30-10">
<createTable tableName="T_HREDUCATION">
<column name="HREDUCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HREDUCATION_HREDUCATIONID"/>
......@@ -296,7 +296,7 @@
<!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-224-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-227-12">
<createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -640,7 +640,7 @@
<!--输出实体[HRORGANIZATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-32-24">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-33-24">
<createTable tableName="ORGANIZATION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -718,7 +718,7 @@
<!--输出实体[HRPOST]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-107-27">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-108-27">
<createTable tableName="T_HRPOST">
<column name="HRPOSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/>
......@@ -867,8 +867,44 @@
</changeSet>
<!--输出实体[HRTRANSFERAPPLY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrtransferapply-30-33">
<createTable tableName="T_HRTRANSFERAPPLY">
<column name="HRTRANSFERAPPLYID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRTRANSFERAPPLY_HRTRANSFERA"/>
</column>
<column name="HRTRANSFERAPPLYNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="HREMPLOYEEID" remarks="" type="VARCHAR(100)">
</column>
<column name="HRDUTYNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="HRPOSTNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="HRORGANIZATIONID2" remarks="" type="VARCHAR(60)">
</column>
<column name="HRPOSTID2" remarks="" type="VARCHAR(100)">
</column>
<column name="HRDUTYNAME2" remarks="" type="VARCHAR(200)">
</column>
<column name="ACTIVETIME" remarks="" type="DATETIME">
</column>
<column name="ATTACHMENT" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[HRWORKRECORD]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrworkrecord-8-33">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrworkrecord-8-34">
<createTable tableName="T_HRWORKRECORD">
<column name="HRWORKRECORDID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRWORKRECORD_HRWORKRECORDID"/>
......@@ -889,129 +925,139 @@
</changeSet>
<!--输出实体[HRARCHIVES]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrarchives-8-34">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrarchives-8-35">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRARCHIVES" constraintName="DER1N_HRARCHIVES_HREMPLOYEE_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRATTENDANCE]外键关系 -->
<!--输出实体[HRCERTIFICATE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcertificate-8-35">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcertificate-8-36">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRCERTIFICATE" constraintName="DER1N_HRCERTIFICATE_HREMPLOYEE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRCONTRACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-8-36">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-8-37">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRCONTRACT" constraintName="DER1N_HRCONTRACT_HREMPLOYEE_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRDISTRIBUTION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-39-37">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-39-38">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HREMPLOYE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-39-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-39-39">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HRPOST_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRDUTY]外键关系 -->
<!--输出实体[HRDUTYCERT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutycert-23-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutycert-23-40">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRDUTYCERT" constraintName="DER1N_HRDUTYCERT_HRDUTY_HRDUTY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<!--输出实体[HRDUTYEDU]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutyedu-22-40">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutyedu-22-41">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRDUTYEDU" constraintName="DER1N_HRDUTYEDU_HRDUTY_HRDUTYI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<!--输出实体[HRDUTYSKILL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutyskill-21-41">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdutyskill-21-42">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRDUTYSKILL" constraintName="DER1N_HRDUTYSKILL_HRDUTY_HRDUT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<!--输出实体[HREDUCATION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hreducation-27-42">
<changeSet author="a_LAB01_e85d8801c" id="fk-hreducation-30-43">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HREDUCATION" constraintName="DER1N_HREDUCATION_HREMPLOYEE_H" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HREMPSTATE]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-224-43">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-227-44">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="EMPLOYEE" constraintName="DER1N_EMPLOYEE_ORGANIZATION_OR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-224-44">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-227-45">
<addForeignKeyConstraint baseColumnNames="EMPSTATE" baseTableName="EMPLOYEE" constraintName="DER1N_HREMPLOYEE_HREMPSTATE_EM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HREMPSTATEID" referencedTableName="T_HREMPSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-224-45">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-227-46">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="EMPLOYEE" constraintName="DER1N_HREMPLOYEE_HRPOST_HRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRFAMILY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrfamily-8-46">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrfamily-8-47">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRFAMILY" constraintName="DER1N_HRFAMILY_HREMPLOYEE_HREM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRLANGUAGEABILITY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrlanguageability-8-47">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrlanguageability-8-48">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRLANGUAGEABILITY" constraintName="DER1N_HRLANGUAGEABILITY_HREMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRLEAVE]外键关系 -->
<!--输出实体[HRLEGAL]外键关系 -->
<!--输出实体[HROMHIERARCHYPURPOSE]外键关系 -->
<!--输出实体[HROMHIERARCHY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-48">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-49">
<addForeignKeyConstraint baseColumnNames="HROMHIERARCHYCATID" baseTableName="OMHIERARCHY" constraintName="DER1N_HROMHIERARCHY_HROMHIERAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYCATID" referencedTableName="OMHIERARCHYCAT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-49">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-50">
<addForeignKeyConstraint baseColumnNames="POMHIERARCHYID" baseTableName="OMHIERARCHY" constraintName="DER1N_OMHIERARCHY_OMHIERARCHY_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYID" referencedTableName="OMHIERARCHY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-50">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-76-51">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="OMHIERARCHY" constraintName="DER1N_OMHIERARCHY_ORGANIZATION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HROMHIERARCHYCAT]外键关系 -->
<!--输出实体[HROMHIERARCHYPURPOSEREF]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchypurposeref-6-51">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchypurposeref-6-52">
<addForeignKeyConstraint baseColumnNames="OMHIERARCHYCATID" baseTableName="OMHIERARCHYPURPOSEREF" constraintName="DER1N_OMHIERARCHYPURPOSEREF_OM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OMHIERARCHYCATID" referencedTableName="OMHIERARCHYCAT" validate="true"/>
</changeSet>
<!--输出实体[HROPERATIONUNIT]外键关系 -->
<!--输出实体[HRORGADDRESS]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgaddress-29-53">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgaddress-29-54">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGADDRESS" constraintName="DER1N_HRORGADDRESS_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGCONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgcontact-24-54">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgcontact-24-55">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGCONTACT" constraintName="DER1N_HRORGCONTACT_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGANIZATION]外键关系 -->
<!--输出实体[HRPAPER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpaper-6-55">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpaper-6-56">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRPAPER" constraintName="DER1N_HRPAPER_HREMPLOYEE_HREMP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRPATENT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpatent-7-56">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpatent-7-57">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRPATENT" constraintName="DER1N_HRPATENT_HREMPLOYEE_HREM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRPOST]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-107-57">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-108-58">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRDUTY_HRDUTYID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-107-58">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-108-59">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRORGANIZATION_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRPOSTREL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-29-59">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-29-60">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_HRPOSTI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-29-60">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-29-61">
<addForeignKeyConstraint baseColumnNames="PHRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_PHRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRRESEARCH]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrresearch-8-61">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrresearch-8-62">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRRESEARCH" constraintName="DER1N_HRRESEARCH_HREMPLOYEE_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRREWARD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrreward-8-62">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrreward-8-63">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRREWARD" constraintName="DER1N_HRREWARD_HREMPLOYEE_HREM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRTECHNICALTITLE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtechnicaltitle-8-63">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtechnicaltitle-8-64">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRTECHNICALTITLE" constraintName="DER1N_HRTECHNICALTITLE_HREMPLO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRTRAININGRECORD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtrainingrecord-8-64">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtrainingrecord-8-65">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRTRAININGRECORD" constraintName="DER1N_HRTRAININGRECORD_HREMPLO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRTRANSFERAPPLY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-30-66">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HREMPLOY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-30-67">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID2" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HRORGANI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-30-68">
<addForeignKeyConstraint baseColumnNames="HRPOSTID2" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HRPOST_H" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRWORKRECORD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrworkrecord-8-65">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrworkrecord-8-69">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRWORKRECORD" constraintName="DER1N_HRWORKRECORD_HREMPLOYEE_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
......
<?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.pcm.mapper.HRTransferApplyMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRTransferApplyResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ACTIVETIME`, t1.`ATTACHMENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYNAME`, t1.`HRDUTYNAME2`, t1.`HREMPLOYEEID`, t11.`EMPLOYEENAME` AS `HREMPLOYEENAME`, t1.`HRORGANIZATIONID2`, t31.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME2`, t1.`HRPOSTID2`, t1.`HRPOSTNAME`, t41.`HRPOSTNAME` AS `HRPOSTNAME2`, t1.`HRTRANSFERAPPLYID`, t1.`HRTRANSFERAPPLYNAME`, t11.`ORGANIZATIONID`, t21.`ORGANIZATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRTRANSFERAPPLY` t1 LEFT JOIN EMPLOYEE t11 ON t1.HREMPLOYEEID = t11.EMPLOYEEID LEFT JOIN ORGANIZATION t21 ON t11.ORGANIZATIONID = t21.ORGANIZATIONID LEFT JOIN ORGANIZATION t31 ON t1.HRORGANIZATIONID2 = t31.ORGANIZATIONID LEFT JOIN T_HRPOST t41 ON t1.HRPOSTID2 = t41.HRPOSTID ) t1 where hrtransferapplyid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRTransferApplyResultMap" type="cn.ibizlab.humanresource.core.pcm.domain.HRTransferApply" autoMapping="true">
<id property="hrtransferapplyid" column="hrtransferapplyid" /><!--主键字段映射-->
<result property="hremployeeid" column="hremployeeid" />
<result property="hrorganizationid2" column="hrorganizationid2" />
<result property="hrpostid2" column="hrpostid2" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hremployee" javaType="cn.ibizlab.humanresource.core.humanresource.domain.HREmployee" column="hremployeeid" select="cn.ibizlab.humanresource.core.humanresource.mapper.HREmployeeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrorganization2" javaType="cn.ibizlab.humanresource.core.base.domain.HROrganization" column="hrorganizationid2" select="cn.ibizlab.humanresource.core.base.mapper.HROrganizationMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrpost2" javaType="cn.ibizlab.humanresource.core.humanresource.domain.HRPost" column="hrpostid2" select="cn.ibizlab.humanresource.core.humanresource.mapper.HRPostMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRTRANSFERAPPLY_HREMPLOYEE_HREMPLOYEEID_327A4D] -->
<select id="selectByHremployeeid" resultMap="HRTransferApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hremployeeid=#{employeeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRTRANSFERAPPLY_HRORGANIZATION_HRORGANIZATIONID2_6BD9DC] -->
<select id="selectByHrorganizationid2" resultMap="HRTransferApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrorganizationid2=#{organizationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRTRANSFERAPPLY_HRPOST_HRPOSTID2] -->
<select id="selectByHrpostid2" resultMap="HRTransferApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrpostid2=#{hrpostid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.pcm.filter.HRTransferApplySearchContext" resultMap="HRTransferApplyResultMap">
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.`ACTIVETIME`, t1.`ATTACHMENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYNAME`, t1.`HRDUTYNAME2`, t1.`HREMPLOYEEID`, t11.`EMPLOYEENAME` AS `HREMPLOYEENAME`, t1.`HRORGANIZATIONID2`, t31.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME2`, t1.`HRPOSTID2`, t1.`HRPOSTNAME`, t41.`HRPOSTNAME` AS `HRPOSTNAME2`, t1.`HRTRANSFERAPPLYID`, t1.`HRTRANSFERAPPLYNAME`, t11.`ORGANIZATIONID`, t21.`ORGANIZATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRTRANSFERAPPLY` t1 LEFT JOIN EMPLOYEE t11 ON t1.HREMPLOYEEID = t11.EMPLOYEEID LEFT JOIN ORGANIZATION t21 ON t11.ORGANIZATIONID = t21.ORGANIZATIONID LEFT JOIN ORGANIZATION t31 ON t1.HRORGANIZATIONID2 = t31.ORGANIZATIONID LEFT JOIN T_HRPOST t41 ON t1.HRPOSTID2 = t41.HRPOSTID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ACTIVETIME`, t1.`ATTACHMENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRDUTYNAME`, t1.`HRDUTYNAME2`, t1.`HREMPLOYEEID`, t11.`EMPLOYEENAME` AS `HREMPLOYEENAME`, t1.`HRORGANIZATIONID2`, t31.`ORGANIZATIONNAME` AS `HRORGANIZATIONNAME2`, t1.`HRPOSTID2`, t1.`HRPOSTNAME`, t41.`HRPOSTNAME` AS `HRPOSTNAME2`, t1.`HRTRANSFERAPPLYID`, t1.`HRTRANSFERAPPLYNAME`, t11.`ORGANIZATIONID`, t21.`ORGANIZATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRTRANSFERAPPLY` t1 LEFT JOIN EMPLOYEE t11 ON t1.HREMPLOYEEID = t11.EMPLOYEEID LEFT JOIN ORGANIZATION t21 ON t11.ORGANIZATIONID = t21.ORGANIZATIONID LEFT JOIN ORGANIZATION t31 ON t1.HRORGANIZATIONID2 = t31.ORGANIZATIONID LEFT JOIN T_HRPOST t41 ON t1.HRPOSTID2 = t41.HRPOSTID
]]>
</sql>
</mapper>
......@@ -69,6 +69,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HRTransferApply",
"delogicname":"调动申请",
"sysmoudle":{"id":"PCM","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":"HRTechnicalTitle",
"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对象[HRTransferApplyDTO]
*/
@Data
public class HRTransferApplyDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRTRANSFERAPPLYID]
*
*/
@JSONField(name = "hrtransferapplyid")
@JsonProperty("hrtransferapplyid")
private String hrtransferapplyid;
/**
* 属性 [HRTRANSFERAPPLYNAME]
*
*/
@JSONField(name = "hrtransferapplyname")
@JsonProperty("hrtransferapplyname")
private String hrtransferapplyname;
/**
* 属性 [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;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [HREMPLOYEEID]
*
*/
@JSONField(name = "hremployeeid")
@JsonProperty("hremployeeid")
private String hremployeeid;
/**
* 属性 [HREMPLOYEENAME]
*
*/
@JSONField(name = "hremployeename")
@JsonProperty("hremployeename")
private String hremployeename;
/**
* 属性 [ORGANIZATIONID]
*
*/
@JSONField(name = "organizationid")
@JsonProperty("organizationid")
private String organizationid;
/**
* 属性 [ORGANIZATIONNAME]
*
*/
@JSONField(name = "organizationname")
@JsonProperty("organizationname")
private String organizationname;
/**
* 属性 [HRDUTYNAME]
*
*/
@JSONField(name = "hrdutyname")
@JsonProperty("hrdutyname")
private String hrdutyname;
/**
* 属性 [HRPOSTNAME]
*
*/
@JSONField(name = "hrpostname")
@JsonProperty("hrpostname")
private String hrpostname;
/**
* 属性 [HRORGANIZATIONID2]
*
*/
@JSONField(name = "hrorganizationid2")
@JsonProperty("hrorganizationid2")
private String hrorganizationid2;
/**
* 属性 [HRORGANIZATIONNAME2]
*
*/
@JSONField(name = "hrorganizationname2")
@JsonProperty("hrorganizationname2")
private String hrorganizationname2;
/**
* 属性 [HRPOSTID2]
*
*/
@JSONField(name = "hrpostid2")
@JsonProperty("hrpostid2")
private String hrpostid2;
/**
* 属性 [HRPOSTNAME2]
*
*/
@JSONField(name = "hrpostname2")
@JsonProperty("hrpostname2")
private String hrpostname2;
/**
* 属性 [HRDUTYNAME2]
*
*/
@JSONField(name = "hrdutyname2")
@JsonProperty("hrdutyname2")
private String hrdutyname2;
/**
* 属性 [ACTIVETIME]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "activetime" , format="yyyy-MM-dd")
@JsonProperty("activetime")
private Timestamp activetime;
/**
* 属性 [ATTACHMENT]
*
*/
@JSONField(name = "attachment")
@JsonProperty("attachment")
private String attachment;
/**
* 设置 [HRTRANSFERAPPLYNAME]
*/
public void setHrtransferapplyname(String hrtransferapplyname){
this.hrtransferapplyname = hrtransferapplyname ;
this.modify("hrtransferapplyname",hrtransferapplyname);
}
/**
* 设置 [HREMPLOYEEID]
*/
public void setHremployeeid(String hremployeeid){
this.hremployeeid = hremployeeid ;
this.modify("hremployeeid",hremployeeid);
}
/**
* 设置 [HRDUTYNAME]
*/
public void setHrdutyname(String hrdutyname){
this.hrdutyname = hrdutyname ;
this.modify("hrdutyname",hrdutyname);
}
/**
* 设置 [HRPOSTNAME]
*/
public void setHrpostname(String hrpostname){
this.hrpostname = hrpostname ;
this.modify("hrpostname",hrpostname);
}
/**
* 设置 [HRORGANIZATIONID2]
*/
public void setHrorganizationid2(String hrorganizationid2){
this.hrorganizationid2 = hrorganizationid2 ;
this.modify("hrorganizationid2",hrorganizationid2);
}
/**
* 设置 [HRPOSTID2]
*/
public void setHrpostid2(String hrpostid2){
this.hrpostid2 = hrpostid2 ;
this.modify("hrpostid2",hrpostid2);
}
/**
* 设置 [HRDUTYNAME2]
*/
public void setHrdutyname2(String hrdutyname2){
this.hrdutyname2 = hrdutyname2 ;
this.modify("hrdutyname2",hrdutyname2);
}
/**
* 设置 [ACTIVETIME]
*/
public void setActivetime(Timestamp activetime){
this.activetime = activetime ;
this.modify("activetime",activetime);
}
/**
* 设置 [ATTACHMENT]
*/
public void setAttachment(String attachment){
this.attachment = attachment ;
this.modify("attachment",attachment);
}
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.pcm.domain.HRTransferApply;
import cn.ibizlab.humanresource.hrapi.dto.HRTransferApplyDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHRTransferApplyMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HRTransferApplyMapping extends MappingBase<HRTransferApplyDTO, HRTransferApply> {
}
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.pcm.domain.HRTransferApply;
import cn.ibizlab.humanresource.core.pcm.service.IHRTransferApplyService;
import cn.ibizlab.humanresource.core.pcm.filter.HRTransferApplySearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"调动申请" })
@RestController("HRApi-hrtransferapply")
@RequestMapping("")
public class HRTransferApplyResource {
@Autowired
public IHRTransferApplyService hrtransferapplyService;
@Autowired
@Lazy
public HRTransferApplyMapping hrtransferapplyMapping;
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "新建调动申请", tags = {"调动申请" }, notes = "新建调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrtransferapplies")
@Transactional
public ResponseEntity<HRTransferApplyDTO> create(@RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
hrtransferapplyService.create(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "批量新建调动申请", tags = {"调动申请" }, notes = "批量新建调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrtransferapplies/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
hrtransferapplyService.createBatch(hrtransferapplyMapping.toDomain(hrtransferapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtransferapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "更新调动申请", tags = {"调动申请" }, notes = "更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<HRTransferApplyDTO> update(@PathVariable("hrtransferapply_id") String hrtransferapply_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain .setHrtransferapplyid(hrtransferapply_id);
hrtransferapplyService.update(domain );
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByEntities(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos)),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "批量更新调动申请", tags = {"调动申请" }, notes = "批量更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrtransferapplies/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
hrtransferapplyService.updateBatch(hrtransferapplyMapping.toDomain(hrtransferapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "删除调动申请", tags = {"调动申请" }, notes = "删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrtransferapply_id") String hrtransferapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.remove(hrtransferapply_id));
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByIds(#ids),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "批量删除调动申请", tags = {"调动申请" }, notes = "批量删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrtransferapplies/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrtransferapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(returnObject.body),'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "获取调动申请", tags = {"调动申请" }, notes = "获取调动申请")
@RequestMapping(method = RequestMethod.GET, value = "/hrtransferapplies/{hrtransferapply_id}")
public ResponseEntity<HRTransferApplyDTO> get(@PathVariable("hrtransferapply_id") String hrtransferapply_id) {
HRTransferApply domain = hrtransferapplyService.get(hrtransferapply_id);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取调动申请草稿", tags = {"调动申请" }, notes = "获取调动申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrtransferapplies/getdraft")
public ResponseEntity<HRTransferApplyDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyMapping.toDto(hrtransferapplyService.getDraft(new HRTransferApply())));
}
@ApiOperation(value = "检查调动申请", tags = {"调动申请" }, notes = "检查调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrtransferapplies/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HRTransferApplyDTO hrtransferapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.checkKey(hrtransferapplyMapping.toDomain(hrtransferapplydto)));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "保存调动申请", tags = {"调动申请" }, notes = "保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrtransferapplies/save")
public ResponseEntity<Boolean> save(@RequestBody HRTransferApplyDTO hrtransferapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.save(hrtransferapplyMapping.toDomain(hrtransferapplydto)));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "批量保存调动申请", tags = {"调动申请" }, notes = "批量保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrtransferapplies/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
hrtransferapplyService.saveBatch(hrtransferapplyMapping.toDomain(hrtransferapplydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"调动申请" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrtransferapplies/fetchdefault")
public ResponseEntity<List<HRTransferApplyDTO>> fetchDefault(HRTransferApplySearchContext context) {
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
List<HRTransferApplyDTO> list = hrtransferapplyMapping.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-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"调动申请" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrtransferapplies/searchdefault")
public ResponseEntity<Page<HRTransferApplyDTO>> searchDefault(@RequestBody HRTransferApplySearchContext context) {
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtransferapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册