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

jackwang 部署微服务接口

上级 92c7f206
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/
mvn clean package -Ppim
cd humanresource-app/humanresource-app-pim
mvn -Ppim docker:build
mvn -Ppim docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-app-pim.yaml iBizEE --with-registry-auth
mvn clean package -Phrapi
cd humanresource-provider/humanresource-provider-hrapi
mvn -Phrapi docker:build
mvn -Phrapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-provider-hrapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-app-pim.jar
EXPOSE 10327
EXPOSE 8080
ADD humanresource-app-pim.jar /humanresource-app-pim.jar
......@@ -3,25 +3,9 @@ services:
humanresource-app-pim:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest
ports:
- "10327:10327"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10327
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -19,6 +19,10 @@ zuul:
path: /hromhierarchycats/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrorgcontact:
path: /hrorgcontacts/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hremployee:
path: /hremployees/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......@@ -35,6 +39,10 @@ zuul:
path: /hromhierarchies/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrorgaddress:
path: /hrorgaddresses/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrorganization:
path: /hrorganizations/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......
......@@ -103,6 +103,21 @@ public class HROMHierarchy extends EntityMP implements Serializable {
@JSONField(name = "pomhierarchyid")
@JsonProperty("pomhierarchyid")
private String pomhierarchyid;
/**
* 结构层次类别标识
*/
@TableField(value = "hromhierarchycatid")
@JSONField(name = "hromhierarchycatid")
@JsonProperty("hromhierarchycatid")
private String hromhierarchycatid;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.base.domain.HROMHierarchyCat hromhierarchycat;
/**
*
......@@ -146,6 +161,14 @@ public class HROMHierarchy extends EntityMP implements Serializable {
this.modify("pomhierarchyid",pomhierarchyid);
}
/**
* 设置 [结构层次类别标识]
*/
public void setHromhierarchycatid(String hromhierarchycatid){
this.hromhierarchycatid = hromhierarchycatid ;
this.modify("hromhierarchycatid",hromhierarchycatid);
}
}
......
package cn.ibizlab.humanresource.core.base.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_HRORGADDRESS",resultMap = "HROrgAddressResultMap")
public class HROrgAddress extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 名称或描述
*/
@TableField(value = "hrorgaddressname")
@JSONField(name = "hrorgaddressname")
@JsonProperty("hrorgaddressname")
private String hrorgaddressname;
/**
* 组织地址标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrorgaddressid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrorgaddressid")
@JsonProperty("hrorgaddressid")
private String hrorgaddressid;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.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 = "address")
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 邮政编码
*/
@TableField(value = "postcode")
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 用途
*/
@TableField(value = "uses")
@JSONField(name = "uses")
@JsonProperty("uses")
private String uses;
/**
* 主要
*/
@TableField(value = "mainaddress")
@JSONField(name = "mainaddress")
@JsonProperty("mainaddress")
private Integer mainaddress;
/**
* 设置 [名称或描述]
*/
public void setHrorgaddressname(String hrorgaddressname){
this.hrorgaddressname = hrorgaddressname ;
this.modify("hrorgaddressname",hrorgaddressname);
}
/**
* 设置 [地址]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [邮政编码]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [用途]
*/
public void setUses(String uses){
this.uses = uses ;
this.modify("uses",uses);
}
/**
* 设置 [主要]
*/
public void setMainaddress(Integer mainaddress){
this.mainaddress = mainaddress ;
this.modify("mainaddress",mainaddress);
}
}
package cn.ibizlab.humanresource.core.base.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_HRORGCONTACT",resultMap = "HROrgContactResultMap")
public class HROrgContact extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 组织联系信息标识
*/
@DEField(isKeyField=true)
@TableId(value= "hrorgcontactid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrorgcontactid")
@JsonProperty("hrorgcontactid")
private String hrorgcontactid;
/**
* 联系人
*/
@TableField(value = "hrorgcontactname")
@JSONField(name = "hrorgcontactname")
@JsonProperty("hrorgcontactname")
private String hrorgcontactname;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 类型
*/
@TableField(value = "contacttype")
@JSONField(name = "contacttype")
@JsonProperty("contacttype")
private String contacttype;
/**
* 联系信息
*/
@TableField(value = "contactinfo")
@JSONField(name = "contactinfo")
@JsonProperty("contactinfo")
private String contactinfo;
/**
* 主要
*/
@TableField(value = "maincontact")
@JSONField(name = "maincontact")
@JsonProperty("maincontact")
private Integer maincontact;
/**
* 设置 [联系人]
*/
public void setHrorgcontactname(String hrorgcontactname){
this.hrorgcontactname = hrorgcontactname ;
this.modify("hrorgcontactname",hrorgcontactname);
}
/**
* 设置 [类型]
*/
public void setContacttype(String contacttype){
this.contacttype = contacttype ;
this.modify("contacttype",contacttype);
}
/**
* 设置 [联系信息]
*/
public void setContactinfo(String contactinfo){
this.contactinfo = contactinfo ;
this.modify("contactinfo",contactinfo);
}
/**
* 设置 [主要]
*/
public void setMaincontact(Integer maincontact){
this.maincontact = maincontact ;
this.modify("maincontact",maincontact);
}
}
......@@ -48,6 +48,13 @@ public class HROMHierarchySearchContext extends QueryWrapperContext<HROMHierarch
this.getSearchCond().eq("pomhierarchyid", n_pomhierarchyid_eq);
}
}
private String n_hromhierarchycatid_eq;//[结构层次类别标识]
public void setN_hromhierarchycatid_eq(String n_hromhierarchycatid_eq) {
this.n_hromhierarchycatid_eq = n_hromhierarchycatid_eq;
if(!ObjectUtils.isEmpty(this.n_hromhierarchycatid_eq)){
this.getSearchCond().eq("hromhierarchycatid", n_hromhierarchycatid_eq);
}
}
/**
* 启用快速搜索
......
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgAddress;
/**
* 关系型数据实体[HROrgAddress] 查询条件对象
*/
@Slf4j
@Data
public class HROrgAddressSearchContext extends QueryWrapperContext<HROrgAddress> {
private String n_hrorgaddressname_like;//[名称或描述]
public void setN_hrorgaddressname_like(String n_hrorgaddressname_like) {
this.n_hrorgaddressname_like = n_hrorgaddressname_like;
if(!ObjectUtils.isEmpty(this.n_hrorgaddressname_like)){
this.getSearchCond().like("hrorgaddressname", n_hrorgaddressname_like);
}
}
private String n_uses_eq;//[用途]
public void setN_uses_eq(String n_uses_eq) {
this.n_uses_eq = n_uses_eq;
if(!ObjectUtils.isEmpty(this.n_uses_eq)){
this.getSearchCond().eq("uses", n_uses_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrorgaddressname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgContact;
/**
* 关系型数据实体[HROrgContact] 查询条件对象
*/
@Slf4j
@Data
public class HROrgContactSearchContext extends QueryWrapperContext<HROrgContact> {
private String n_hrorgcontactname_like;//[联系人]
public void setN_hrorgcontactname_like(String n_hrorgcontactname_like) {
this.n_hrorgcontactname_like = n_hrorgcontactname_like;
if(!ObjectUtils.isEmpty(this.n_hrorgcontactname_like)){
this.getSearchCond().like("hrorgcontactname", n_hrorgcontactname_like);
}
}
private String n_contacttype_eq;//[类型]
public void setN_contacttype_eq(String n_contacttype_eq) {
this.n_contacttype_eq = n_contacttype_eq;
if(!ObjectUtils.isEmpty(this.n_contacttype_eq)){
this.getSearchCond().eq("contacttype", n_contacttype_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrorgcontactname", query)
);
}
}
}
......@@ -62,6 +62,8 @@ public interface HROMHierarchyMapper extends BaseMapper<HROMHierarchy>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<HROMHierarchy> selectByHromhierarchycatid(@Param("omhierarchycatid") Serializable omhierarchycatid) ;
List<HROMHierarchy> selectByPomhierarchyid(@Param("omhierarchyid") Serializable omhierarchyid) ;
List<HROMHierarchy> selectByOrganizationid(@Param("organizationid") Serializable organizationid) ;
......
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgAddress;
import cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext;
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 HROrgAddressMapper extends BaseMapper<HROrgAddress>{
Page<HROrgAddress> searchDefault(IPage page, @Param("srf") HROrgAddressSearchContext context, @Param("ew") Wrapper<HROrgAddress> wrapper) ;
@Override
HROrgAddress selectById(Serializable id);
@Override
int insert(HROrgAddress entity);
@Override
int updateById(@Param(Constants.ENTITY) HROrgAddress entity);
@Override
int update(@Param(Constants.ENTITY) HROrgAddress entity, @Param("ew") Wrapper<HROrgAddress> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgContact;
import cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext;
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 HROrgContactMapper extends BaseMapper<HROrgContact>{
Page<HROrgContact> searchDefault(IPage page, @Param("srf") HROrgContactSearchContext context, @Param("ew") Wrapper<HROrgContact> wrapper) ;
@Override
HROrgContact selectById(Serializable id);
@Override
int insert(HROrgContact entity);
@Override
int updateById(@Param(Constants.ENTITY) HROrgContact entity);
@Override
int update(@Param(Constants.ENTITY) HROrgContact entity, @Param("ew") Wrapper<HROrgContact> 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);
}
......@@ -37,6 +37,8 @@ public interface IHROMHierarchyService extends IService<HROMHierarchy>{
boolean save(HROMHierarchy et) ;
void saveBatch(List<HROMHierarchy> list) ;
Page<HROMHierarchy> searchDefault(HROMHierarchySearchContext context) ;
List<HROMHierarchy> selectByHromhierarchycatid(String omhierarchycatid) ;
void removeByHromhierarchycatid(String omhierarchycatid) ;
List<HROMHierarchy> selectByPomhierarchyid(String omhierarchyid) ;
void removeByPomhierarchyid(String omhierarchyid) ;
List<HROMHierarchy> selectByOrganizationid(String organizationid) ;
......
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgAddress;
import cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HROrgAddress] 服务对象接口
*/
public interface IHROrgAddressService extends IService<HROrgAddress>{
boolean create(HROrgAddress et) ;
void createBatch(List<HROrgAddress> list) ;
boolean update(HROrgAddress et) ;
void updateBatch(List<HROrgAddress> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HROrgAddress get(String key) ;
HROrgAddress getDraft(HROrgAddress et) ;
boolean checkKey(HROrgAddress et) ;
boolean save(HROrgAddress et) ;
void saveBatch(List<HROrgAddress> list) ;
Page<HROrgAddress> searchDefault(HROrgAddressSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HROrgAddress> getHrorgaddressByIds(List<String> ids) ;
List<HROrgAddress> getHrorgaddressByEntities(List<HROrgAddress> entities) ;
}
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgContact;
import cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HROrgContact] 服务对象接口
*/
public interface IHROrgContactService extends IService<HROrgContact>{
boolean create(HROrgContact et) ;
void createBatch(List<HROrgContact> list) ;
boolean update(HROrgContact et) ;
void updateBatch(List<HROrgContact> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HROrgContact get(String key) ;
HROrgContact getDraft(HROrgContact et) ;
boolean checkKey(HROrgContact et) ;
boolean save(HROrgContact et) ;
void saveBatch(List<HROrgContact> list) ;
Page<HROrgContact> searchDefault(HROrgContactSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<HROrgContact> getHrorgcontactByIds(List<String> ids) ;
List<HROrgContact> getHrorgcontactByEntities(List<HROrgContact> entities) ;
}
......@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("HROMHierarchyCatServiceImpl")
public class HROMHierarchyCatServiceImpl extends ServiceImpl<HROMHierarchyCatMapper, HROMHierarchyCat> implements IHROMHierarchyCatService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService hromhierarchyService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyPurposeRefService hromhierarchypurposerefService;
......
......@@ -49,6 +49,9 @@ public class HROMHierarchyServiceImpl extends ServiceImpl<HROMHierarchyMapper, H
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService hromhierarchyService = this;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyCatService hromhierarchycatService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrganizationService hrorganizationService;
protected int batchSize = 500;
......@@ -145,6 +148,16 @@ public class HROMHierarchyServiceImpl extends ServiceImpl<HROMHierarchyMapper, H
}
@Override
public List<HROMHierarchy> selectByHromhierarchycatid(String omhierarchycatid) {
return baseMapper.selectByHromhierarchycatid(omhierarchycatid);
}
@Override
public void removeByHromhierarchycatid(String omhierarchycatid) {
this.remove(new QueryWrapper<HROMHierarchy>().eq("hromhierarchycatid",omhierarchycatid));
}
@Override
public List<HROMHierarchy> selectByPomhierarchyid(String omhierarchyid) {
return baseMapper.selectByPomhierarchyid(omhierarchyid);
......
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgAddress;
import cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext;
import cn.ibizlab.humanresource.core.base.service.IHROrgAddressService;
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.base.mapper.HROrgAddressMapper;
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("HROrgAddressServiceImpl")
public class HROrgAddressServiceImpl extends ServiceImpl<HROrgAddressMapper, HROrgAddress> implements IHROrgAddressService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HROrgAddress et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrorgaddressid()),et);
return true;
}
@Override
public void createBatch(List<HROrgAddress> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HROrgAddress et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrorgaddressid",et.getHrorgaddressid())))
return false;
CachedBeanCopier.copy(get(et.getHrorgaddressid()),et);
return true;
}
@Override
public void updateBatch(List<HROrgAddress> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HROrgAddress get(String key) {
HROrgAddress et = getById(key);
if(et==null){
et=new HROrgAddress();
et.setHrorgaddressid(key);
}
else{
}
return et;
}
@Override
public HROrgAddress getDraft(HROrgAddress et) {
return et;
}
@Override
public boolean checkKey(HROrgAddress et) {
return (!ObjectUtils.isEmpty(et.getHrorgaddressid()))&&(!Objects.isNull(this.getById(et.getHrorgaddressid())));
}
@Override
@Transactional
public boolean save(HROrgAddress et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HROrgAddress et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HROrgAddress> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HROrgAddress> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HROrgAddress> searchDefault(HROrgAddressSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HROrgAddress> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HROrgAddress>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HROrgAddress> getHrorgaddressByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HROrgAddress> getHrorgaddressByEntities(List<HROrgAddress> entities) {
List ids =new ArrayList();
for(HROrgAddress entity : entities){
Serializable id=entity.getHrorgaddressid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.humanresource.core.base.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.base.domain.HROrgContact;
import cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext;
import cn.ibizlab.humanresource.core.base.service.IHROrgContactService;
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.base.mapper.HROrgContactMapper;
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("HROrgContactServiceImpl")
public class HROrgContactServiceImpl extends ServiceImpl<HROrgContactMapper, HROrgContact> implements IHROrgContactService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HROrgContact et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrorgcontactid()),et);
return true;
}
@Override
public void createBatch(List<HROrgContact> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HROrgContact et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrorgcontactid",et.getHrorgcontactid())))
return false;
CachedBeanCopier.copy(get(et.getHrorgcontactid()),et);
return true;
}
@Override
public void updateBatch(List<HROrgContact> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HROrgContact get(String key) {
HROrgContact et = getById(key);
if(et==null){
et=new HROrgContact();
et.setHrorgcontactid(key);
}
else{
}
return et;
}
@Override
public HROrgContact getDraft(HROrgContact et) {
return et;
}
@Override
public boolean checkKey(HROrgContact et) {
return (!ObjectUtils.isEmpty(et.getHrorgcontactid()))&&(!Objects.isNull(this.getById(et.getHrorgcontactid())));
}
@Override
@Transactional
public boolean save(HROrgContact et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HROrgContact et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HROrgContact> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HROrgContact> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HROrgContact> searchDefault(HROrgContactSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HROrgContact> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HROrgContact>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<HROrgContact> getHrorgcontactByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HROrgContact> getHrorgcontactByEntities(List<HROrgContact> entities) {
List ids =new ArrayList();
for(HROrgContact entity : entities){
Serializable id=entity.getHrorgcontactid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -66,7 +66,7 @@
<!--输出实体[HRLEGAL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrlegal-14-4">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrlegal-51-4">
<createTable tableName="LEGAL">
<column name="LEGALNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -112,7 +112,7 @@
<!--输出实体[HROMHIERARCHY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchy-5-6">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchy-6-6">
<createTable tableName="OMHIERARCHY">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -131,12 +131,14 @@
</column>
<column name="POMHIERARCHYID" remarks="" type="VARCHAR(100)">
</column>
<column name="HROMHIERARCHYCATID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[HROMHIERARCHYCAT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchycat-11-7">
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchycat-12-7">
<createTable tableName="OMHIERARCHYCAT">
<column name="OMHIERARCHYCATID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HROMHIERARCHYCAT_OMHIERARCH"/>
......@@ -180,7 +182,7 @@
<!--输出实体[HROPERATIONUNIT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hroperationunit-5-9">
<changeSet author="a_LAB01_e85d8801c" id="tab-hroperationunit-9-9">
<createTable tableName="OPERATIONUNIT">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -199,8 +201,62 @@
</changeSet>
<!--输出实体[HRORGADDRESS]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgaddress-16-10">
<createTable tableName="T_HRORGADDRESS">
<column name="HRORGADDRESSNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="HRORGADDRESSID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRORGADDRESS_HRORGADDRESSID"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="ADDRESS" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="USES" remarks="" type="VARCHAR(60)">
</column>
<column name="MAINADDRESS" remarks="" type="INT">
</column>
</createTable>
</changeSet>
<!--输出实体[HRORGCONTACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorgcontact-11-11">
<createTable tableName="T_HRORGCONTACT">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="HRORGCONTACTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRORGCONTACT_HRORGCONTACTID"/>
</column>
<column name="HRORGCONTACTNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="CONTACTTYPE" remarks="" type="VARCHAR(60)">
</column>
<column name="CONTACTINFO" remarks="" type="VARCHAR(100)">
</column>
<column name="MAINCONTACT" remarks="" type="INT">
</column>
</createTable>
</changeSet>
<!--输出实体[HRORGANIZATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-21-10">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrorganization-22-12">
<createTable tableName="ORGANIZATION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -234,25 +290,30 @@
<!--输出实体[HRATTENDANCE]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-5-11">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-5-13">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="EMPLOYEE" constraintName="DER1N_EMPLOYEE_ORGANIZATION_OR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRLEAVE]外键关系 -->
<!--输出实体[HRLEGAL]外键关系 -->
<!--输出实体[HROMHIERARCHYPURPOSE]外键关系 -->
<!--输出实体[HROMHIERARCHY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-5-12">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-6-14">
<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-6-15">
<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-5-13">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchy-6-16">
<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-14">
<changeSet author="a_LAB01_e85d8801c" id="fk-hromhierarchypurposeref-6-17">
<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]外键关系 -->
<!--输出实体[HRORGCONTACT]外键关系 -->
<!--输出实体[HRORGANIZATION]外键关系 -->
</databaseChangeLog>
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HROMHierarchyResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1 ) t1 where omhierarchyid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HROMHIERARCHYCATID`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1 ) t1 where omhierarchyid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -13,14 +13,24 @@
<id property="omhierarchyid" column="omhierarchyid" /><!--主键字段映射-->
<result property="organizationid" column="organizationid" />
<result property="pomhierarchyid" column="pomhierarchyid" />
<result property="hromhierarchycatid" column="hromhierarchycatid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hromhierarchycat" javaType="cn.ibizlab.humanresource.core.base.domain.HROMHierarchyCat" column="hromhierarchycatid" select="cn.ibizlab.humanresource.core.base.mapper.HROMHierarchyCatMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="pomhierarchy" javaType="cn.ibizlab.humanresource.core.base.domain.HROMHierarchy" column="pomhierarchyid" select="cn.ibizlab.humanresource.core.base.mapper.HROMHierarchyMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="organization" javaType="cn.ibizlab.humanresource.core.base.domain.HROrganization" column="organizationid" select="cn.ibizlab.humanresource.core.base.mapper.HROrganizationMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HROMHIERARCHY_HROMHIERARCHYCAT_HROMHIERARCHYCATID_ABD0C1] -->
<select id="selectByHromhierarchycatid" resultMap="HROMHierarchyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hromhierarchycatid=#{omhierarchycatid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_OMHIERARCHY_OMHIERARCHY_POMHIERARCHYID] -->
<select id="selectByPomhierarchyid" resultMap="HROMHierarchyResultMap">
select t1.* from (
......@@ -47,12 +57,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HROMHIERARCHYCATID`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HROMHIERARCHYCATID`, t1.`OMHIERARCHYID`, t1.`OMHIERARCHYNAME`, t1.`ORGANIZATIONID`, t1.`POMHIERARCHYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `OMHIERARCHY` t1
]]>
</sql>
</mapper>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.base.mapper.HROrgAddressMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HROrgAddressResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1 ) t1 where hrorgaddressid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HROrgAddressResultMap" type="cn.ibizlab.humanresource.core.base.domain.HROrgAddress" autoMapping="true">
<id property="hrorgaddressid" column="hrorgaddressid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext" resultMap="HROrgAddressResultMap">
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.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.humanresource.core.base.mapper.HROrgContactMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HROrgContactResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1 ) t1 where hrorgcontactid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HROrgContactResultMap" type="cn.ibizlab.humanresource.core.base.domain.HROrgContact" autoMapping="true">
<id property="hrorgcontactid" column="hrorgcontactid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext" resultMap="HROrgContactResultMap">
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.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
]]>
</sql>
</mapper>
......@@ -28,6 +28,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROrgContact",
"delogicname":"组织联系信息",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HREmployee",
"delogicname":"员工",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
......@@ -60,6 +68,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROrgAddress",
"delogicname":"组织地址",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROrganization",
"delogicname":"组织",
"sysmoudle":{"id":"BASE","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:
......
......@@ -89,6 +89,14 @@ public class HROMHierarchyDTO extends DTOBase implements Serializable {
@JsonProperty("pomhierarchyid")
private String pomhierarchyid;
/**
* 属性 [HROMHIERARCHYCATID]
*
*/
@JSONField(name = "hromhierarchycatid")
@JsonProperty("hromhierarchycatid")
private String hromhierarchycatid;
/**
* 设置 [OMHIERARCHYNAME]
......@@ -114,6 +122,14 @@ public class HROMHierarchyDTO extends DTOBase implements Serializable {
this.modify("pomhierarchyid",pomhierarchyid);
}
/**
* 设置 [HROMHIERARCHYCATID]
*/
public void setHromhierarchycatid(String hromhierarchycatid){
this.hromhierarchycatid = hromhierarchycatid ;
this.modify("hromhierarchycatid",hromhierarchycatid);
}
}
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 lombok.Data;
/**
* 服务DTO对象[HROrgAddressDTO]
*/
@Data
public class HROrgAddressDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [HRORGADDRESSNAME]
*
*/
@JSONField(name = "hrorgaddressname")
@JsonProperty("hrorgaddressname")
private String hrorgaddressname;
/**
* 属性 [HRORGADDRESSID]
*
*/
@JSONField(name = "hrorgaddressid")
@JsonProperty("hrorgaddressid")
private String hrorgaddressid;
/**
* 属性 [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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [ADDRESS]
*
*/
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 属性 [POSTCODE]
*
*/
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 属性 [USES]
*
*/
@JSONField(name = "uses")
@JsonProperty("uses")
private String uses;
/**
* 属性 [MAINADDRESS]
*
*/
@JSONField(name = "mainaddress")
@JsonProperty("mainaddress")
private Integer mainaddress;
/**
* 设置 [HRORGADDRESSNAME]
*/
public void setHrorgaddressname(String hrorgaddressname){
this.hrorgaddressname = hrorgaddressname ;
this.modify("hrorgaddressname",hrorgaddressname);
}
/**
* 设置 [ADDRESS]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [POSTCODE]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [USES]
*/
public void setUses(String uses){
this.uses = uses ;
this.modify("uses",uses);
}
/**
* 设置 [MAINADDRESS]
*/
public void setMainaddress(Integer mainaddress){
this.mainaddress = mainaddress ;
this.modify("mainaddress",mainaddress);
}
}
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 lombok.Data;
/**
* 服务DTO对象[HROrgContactDTO]
*/
@Data
public class HROrgContactDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [HRORGCONTACTID]
*
*/
@JSONField(name = "hrorgcontactid")
@JsonProperty("hrorgcontactid")
private String hrorgcontactid;
/**
* 属性 [HRORGCONTACTNAME]
*
*/
@JSONField(name = "hrorgcontactname")
@JsonProperty("hrorgcontactname")
private String hrorgcontactname;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 属性 [CONTACTTYPE]
*
*/
@JSONField(name = "contacttype")
@JsonProperty("contacttype")
private String contacttype;
/**
* 属性 [CONTACTINFO]
*
*/
@JSONField(name = "contactinfo")
@JsonProperty("contactinfo")
private String contactinfo;
/**
* 属性 [MAINCONTACT]
*
*/
@JSONField(name = "maincontact")
@JsonProperty("maincontact")
private Integer maincontact;
/**
* 设置 [HRORGCONTACTNAME]
*/
public void setHrorgcontactname(String hrorgcontactname){
this.hrorgcontactname = hrorgcontactname ;
this.modify("hrorgcontactname",hrorgcontactname);
}
/**
* 设置 [CONTACTTYPE]
*/
public void setContacttype(String contacttype){
this.contacttype = contacttype ;
this.modify("contacttype",contacttype);
}
/**
* 设置 [CONTACTINFO]
*/
public void setContactinfo(String contactinfo){
this.contactinfo = contactinfo ;
this.modify("contactinfo",contactinfo);
}
/**
* 设置 [MAINCONTACT]
*/
public void setMaincontact(Integer maincontact){
this.maincontact = maincontact ;
this.modify("maincontact",maincontact);
}
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROrgAddress;
import cn.ibizlab.humanresource.hrapi.dto.HROrgAddressDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROrgAddressMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROrgAddressMapping extends MappingBase<HROrgAddressDTO, HROrgAddress> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROrgContact;
import cn.ibizlab.humanresource.hrapi.dto.HROrgContactDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROrgContactMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROrgContactMapping extends MappingBase<HROrgContactDTO, HROrgContact> {
}
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.base.domain.HROrgAddress;
import cn.ibizlab.humanresource.core.base.service.IHROrgAddressService;
import cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织地址" })
@RestController("HRApi-hrorgaddress")
@RequestMapping("")
public class HROrgAddressResource {
@Autowired
public IHROrgAddressService hrorgaddressService;
@Autowired
@Lazy
public HROrgAddressMapping hrorgaddressMapping;
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "新建组织地址", tags = {"组织地址" }, notes = "新建组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgaddresses")
@Transactional
public ResponseEntity<HROrgAddressDTO> create(@RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
hrorgaddressService.create(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "批量新建组织地址", tags = {"组织地址" }, notes = "批量新建组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgaddresses/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
hrorgaddressService.createBatch(hrorgaddressMapping.toDomain(hrorgaddressdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgaddress" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "更新组织地址", tags = {"组织地址" }, notes = "更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<HROrgAddressDTO> update(@PathVariable("hrorgaddress_id") String hrorgaddress_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain .setHrorgaddressid(hrorgaddress_id);
hrorgaddressService.update(domain );
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByEntities(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos)),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "批量更新组织地址", tags = {"组织地址" }, notes = "批量更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorgaddresses/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
hrorgaddressService.updateBatch(hrorgaddressMapping.toDomain(hrorgaddressdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "删除组织地址", tags = {"组织地址" }, notes = "删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrorgaddress_id") String hrorgaddress_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.remove(hrorgaddress_id));
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByIds(#ids),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "批量删除组织地址", tags = {"组织地址" }, notes = "批量删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorgaddresses/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrorgaddressService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "获取组织地址", tags = {"组织地址" }, notes = "获取组织地址")
@RequestMapping(method = RequestMethod.GET, value = "/hrorgaddresses/{hrorgaddress_id}")
public ResponseEntity<HROrgAddressDTO> get(@PathVariable("hrorgaddress_id") String hrorgaddress_id) {
HROrgAddress domain = hrorgaddressService.get(hrorgaddress_id);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织地址草稿", tags = {"组织地址" }, notes = "获取组织地址草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorgaddresses/getdraft")
public ResponseEntity<HROrgAddressDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressMapping.toDto(hrorgaddressService.getDraft(new HROrgAddress())));
}
@ApiOperation(value = "检查组织地址", tags = {"组织地址" }, notes = "检查组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgaddresses/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROrgAddressDTO hrorgaddressdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.checkKey(hrorgaddressMapping.toDomain(hrorgaddressdto)));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "保存组织地址", tags = {"组织地址" }, notes = "保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgaddresses/save")
public ResponseEntity<Boolean> save(@RequestBody HROrgAddressDTO hrorgaddressdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.save(hrorgaddressMapping.toDomain(hrorgaddressdto)));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "批量保存组织地址", tags = {"组织地址" }, notes = "批量保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgaddresses/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
hrorgaddressService.saveBatch(hrorgaddressMapping.toDomain(hrorgaddressdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织地址" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorgaddresses/fetchdefault")
public ResponseEntity<List<HROrgAddressDTO>> fetchDefault(HROrgAddressSearchContext context) {
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
List<HROrgAddressDTO> list = hrorgaddressMapping.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-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织地址" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorgaddresses/searchdefault")
public ResponseEntity<Page<HROrgAddressDTO>> searchDefault(@RequestBody HROrgAddressSearchContext context) {
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROrgContact;
import cn.ibizlab.humanresource.core.base.service.IHROrgContactService;
import cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织联系信息" })
@RestController("HRApi-hrorgcontact")
@RequestMapping("")
public class HROrgContactResource {
@Autowired
public IHROrgContactService hrorgcontactService;
@Autowired
@Lazy
public HROrgContactMapping hrorgcontactMapping;
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "新建组织联系信息", tags = {"组织联系信息" }, notes = "新建组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgcontacts")
@Transactional
public ResponseEntity<HROrgContactDTO> create(@RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
hrorgcontactService.create(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "批量新建组织联系信息", tags = {"组织联系信息" }, notes = "批量新建组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgcontacts/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
hrorgcontactService.createBatch(hrorgcontactMapping.toDomain(hrorgcontactdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "更新组织联系信息", tags = {"组织联系信息" }, notes = "更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<HROrgContactDTO> update(@PathVariable("hrorgcontact_id") String hrorgcontact_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain .setHrorgcontactid(hrorgcontact_id);
hrorgcontactService.update(domain );
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByEntities(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos)),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "批量更新组织联系信息", tags = {"组织联系信息" }, notes = "批量更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorgcontacts/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
hrorgcontactService.updateBatch(hrorgcontactMapping.toDomain(hrorgcontactdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "删除组织联系信息", tags = {"组织联系信息" }, notes = "删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrorgcontact_id") String hrorgcontact_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.remove(hrorgcontact_id));
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByIds(#ids),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "批量删除组织联系信息", tags = {"组织联系信息" }, notes = "批量删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorgcontacts/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrorgcontactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "获取组织联系信息", tags = {"组织联系信息" }, notes = "获取组织联系信息")
@RequestMapping(method = RequestMethod.GET, value = "/hrorgcontacts/{hrorgcontact_id}")
public ResponseEntity<HROrgContactDTO> get(@PathVariable("hrorgcontact_id") String hrorgcontact_id) {
HROrgContact domain = hrorgcontactService.get(hrorgcontact_id);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织联系信息草稿", tags = {"组织联系信息" }, notes = "获取组织联系信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorgcontacts/getdraft")
public ResponseEntity<HROrgContactDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactMapping.toDto(hrorgcontactService.getDraft(new HROrgContact())));
}
@ApiOperation(value = "检查组织联系信息", tags = {"组织联系信息" }, notes = "检查组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgcontacts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROrgContactDTO hrorgcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.checkKey(hrorgcontactMapping.toDomain(hrorgcontactdto)));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "保存组织联系信息", tags = {"组织联系信息" }, notes = "保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgcontacts/save")
public ResponseEntity<Boolean> save(@RequestBody HROrgContactDTO hrorgcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.save(hrorgcontactMapping.toDomain(hrorgcontactdto)));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "批量保存组织联系信息", tags = {"组织联系信息" }, notes = "批量保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorgcontacts/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
hrorgcontactService.saveBatch(hrorgcontactMapping.toDomain(hrorgcontactdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织联系信息" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorgcontacts/fetchdefault")
public ResponseEntity<List<HROrgContactDTO>> fetchDefault(HROrgContactSearchContext context) {
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
List<HROrgContactDTO> list = hrorgcontactMapping.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-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织联系信息" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorgcontacts/searchdefault")
public ResponseEntity<Page<HROrgContactDTO>> searchDefault(@RequestBody HROrgContactSearchContext context) {
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册