提交 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;
}
}
<?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> {
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册