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

ibiz4j 部署微服务接口

上级 91b9599e
......@@ -37,6 +37,11 @@
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
mvn clean package -Papi
cd ibzou-provider/ibzou-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -2,11 +2,11 @@
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
IBIZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
EXPOSE 8080
......
......@@ -7,6 +7,10 @@ zuul:
path: /ibzdeptmembers/**
serviceId: ibzou-api
stripPrefix: false
ibzteammember:
path: /ibzteammembers/**
serviceId: ibzou-api
stripPrefix: false
ibzdept:
path: /ibzdepartments/**
serviceId: ibzou-api
......@@ -19,6 +23,10 @@ zuul:
path: /ibzorganizations/**
serviceId: ibzou-api
stripPrefix: false
ibzteam:
path: /ibzteams/**
serviceId: ibzou-api
stripPrefix: false
loginv7:
path: /v7/login
serviceId: ibzuaa-api
......
package cn.ibizlab.core.ou.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 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.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[岗位]
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "IBZPOST",resultMap = "IBZPostResultMap")
public class IBZPost extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* POSTID
*/
@DEField(isKeyField=true)
@TableId(value= "postid",type=IdType.UUID)
@JSONField(name = "postid")
@JsonProperty("postid")
private String postid;
/**
* 岗位编码
*/
@TableField(value = "postcode")
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 岗位名称
*/
@TableField(value = "postname")
@JSONField(name = "postname")
@JsonProperty("postname")
private String postname;
/**
* 设置 [岗位编码]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [岗位名称]
*/
public void setPostname(String postname){
this.postname = postname ;
this.modify("postname",postname);
}
}
package cn.ibizlab.core.ou.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 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.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[组]
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "IBZTEAM",resultMap = "IBZTeamResultMap")
public class IBZTeam extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* TEAMID
*/
@DEField(isKeyField=true)
@TableId(value= "teamid",type=IdType.UUID)
@JSONField(name = "teamid")
@JsonProperty("teamid")
private String teamid;
/**
* 组名称
*/
@TableField(value = "teamname")
@JSONField(name = "teamname")
@JsonProperty("teamname")
private String teamname;
/**
* 设置 [组名称]
*/
public void setTeamname(String teamname){
this.teamname = teamname ;
this.modify("teamname",teamname);
}
}
package cn.ibizlab.core.ou.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 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.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[组成员]
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "IBZTEAMMEMBER",resultMap = "IBZTeamMemberResultMap")
public class IBZTeamMember extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* TEAMMEMBER
*/
@DEField(isKeyField=true)
@TableId(value= "teammemberid",type=IdType.UUID)
@JSONField(name = "teammemberid")
@JsonProperty("teammemberid")
private String teammemberid;
/**
* TEAMID
*/
@TableField(value = "teamid")
@JSONField(name = "teamid")
@JsonProperty("teamid")
private String teamid;
/**
* 用户标识
*/
@TableField(value = "userid")
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 组名称
*/
@TableField(exist = false)
@JSONField(name = "teamname")
@JsonProperty("teamname")
private String teamname;
/**
* 姓名
*/
@TableField(exist = false)
@JSONField(name = "personname")
@JsonProperty("personname")
private String personname;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.ou.domain.IBZEmployee emp;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.ou.domain.IBZTeam team;
/**
* 设置 [TEAMID]
*/
public void setTeamid(String teamid){
this.teamid = teamid ;
this.modify("teamid",teamid);
}
/**
* 设置 [用户标识]
*/
public void setUserid(String userid){
this.userid = userid ;
this.modify("userid",userid);
}
}
package cn.ibizlab.core.ou.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.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.ou.domain.IBZPost;
/**
* 关系型数据实体[IBZPost] 查询条件对象
*/
@Slf4j
@Data
public class IBZPostSearchContext extends QueryWrapperContext<IBZPost> {
private String n_postcode_like;//[岗位编码]
public void setN_postcode_like(String n_postcode_like) {
this.n_postcode_like = n_postcode_like;
if(!ObjectUtils.isEmpty(this.n_postcode_like)){
this.getSelectCond().like("postcode", n_postcode_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
wrapper.like("postcode", query)
);
}
}
}
package cn.ibizlab.core.ou.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.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.ou.domain.IBZTeamMember;
/**
* 关系型数据实体[IBZTeamMember] 查询条件对象
*/
@Slf4j
@Data
public class IBZTeamMemberSearchContext extends QueryWrapperContext<IBZTeamMember> {
private String n_teammemberid_like;//[TEAMMEMBER]
public void setN_teammemberid_like(String n_teammemberid_like) {
this.n_teammemberid_like = n_teammemberid_like;
if(!ObjectUtils.isEmpty(this.n_teammemberid_like)){
this.getSelectCond().like("teammemberid", n_teammemberid_like);
}
}
private String n_teamid_eq;//[TEAMID]
public void setN_teamid_eq(String n_teamid_eq) {
this.n_teamid_eq = n_teamid_eq;
if(!ObjectUtils.isEmpty(this.n_teamid_eq)){
this.getSelectCond().eq("teamid", n_teamid_eq);
}
}
private String n_userid_eq;//[用户标识]
public void setN_userid_eq(String n_userid_eq) {
this.n_userid_eq = n_userid_eq;
if(!ObjectUtils.isEmpty(this.n_userid_eq)){
this.getSelectCond().eq("userid", n_userid_eq);
}
}
private String n_teamname_eq;//[组名称]
public void setN_teamname_eq(String n_teamname_eq) {
this.n_teamname_eq = n_teamname_eq;
if(!ObjectUtils.isEmpty(this.n_teamname_eq)){
this.getSelectCond().eq("teamname", n_teamname_eq);
}
}
private String n_teamname_like;//[组名称]
public void setN_teamname_like(String n_teamname_like) {
this.n_teamname_like = n_teamname_like;
if(!ObjectUtils.isEmpty(this.n_teamname_like)){
this.getSelectCond().like("teamname", n_teamname_like);
}
}
private String n_personname_eq;//[姓名]
public void setN_personname_eq(String n_personname_eq) {
this.n_personname_eq = n_personname_eq;
if(!ObjectUtils.isEmpty(this.n_personname_eq)){
this.getSelectCond().eq("personname", n_personname_eq);
}
}
private String n_personname_like;//[姓名]
public void setN_personname_like(String n_personname_like) {
this.n_personname_like = n_personname_like;
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSelectCond().like("personname", n_personname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
wrapper.like("teammemberid", query)
);
}
}
}
package cn.ibizlab.core.ou.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.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.ou.domain.IBZTeam;
/**
* 关系型数据实体[IBZTeam] 查询条件对象
*/
@Slf4j
@Data
public class IBZTeamSearchContext extends QueryWrapperContext<IBZTeam> {
private String n_teamid_like;//[TEAMID]
public void setN_teamid_like(String n_teamid_like) {
this.n_teamid_like = n_teamid_like;
if(!ObjectUtils.isEmpty(this.n_teamid_like)){
this.getSelectCond().like("teamid", n_teamid_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
wrapper.like("teamname", query)
);
}
}
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZPost;
import cn.ibizlab.core.ou.filter.IBZPostSearchContext;
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 IBZPostMapper extends BaseMapper<IBZPost>{
Page<IBZPost> searchDefault(IPage page, @Param("srf") IBZPostSearchContext context, @Param("ew") Wrapper<IBZPost> wrapper) ;
@Override
IBZPost selectById(Serializable id);
@Override
int insert(IBZPost entity);
@Override
int updateById(@Param(Constants.ENTITY) IBZPost entity);
@Override
int update(@Param(Constants.ENTITY) IBZPost entity, @Param("ew") Wrapper<IBZPost> 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.core.ou.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.core.ou.domain.IBZTeam;
import cn.ibizlab.core.ou.filter.IBZTeamSearchContext;
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 IBZTeamMapper extends BaseMapper<IBZTeam>{
Page<IBZTeam> searchDefault(IPage page, @Param("srf") IBZTeamSearchContext context, @Param("ew") Wrapper<IBZTeam> wrapper) ;
@Override
IBZTeam selectById(Serializable id);
@Override
int insert(IBZTeam entity);
@Override
int updateById(@Param(Constants.ENTITY) IBZTeam entity);
@Override
int update(@Param(Constants.ENTITY) IBZTeam entity, @Param("ew") Wrapper<IBZTeam> 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.core.ou.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.core.ou.domain.IBZTeamMember;
import cn.ibizlab.core.ou.filter.IBZTeamMemberSearchContext;
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 IBZTeamMemberMapper extends BaseMapper<IBZTeamMember>{
Page<IBZTeamMember> searchDefault(IPage page, @Param("srf") IBZTeamMemberSearchContext context, @Param("ew") Wrapper<IBZTeamMember> wrapper) ;
@Override
IBZTeamMember selectById(Serializable id);
@Override
int insert(IBZTeamMember entity);
@Override
int updateById(@Param(Constants.ENTITY) IBZTeamMember entity);
@Override
int update(@Param(Constants.ENTITY) IBZTeamMember entity, @Param("ew") Wrapper<IBZTeamMember> 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<IBZTeamMember> selectByUserid(@Param("userid") Serializable userid) ;
List<IBZTeamMember> selectByTeamid(@Param("teamid") Serializable teamid) ;
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZPost;
import cn.ibizlab.core.ou.filter.IBZPostSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZPost] 服务对象接口
*/
public interface IIBZPostService extends IService<IBZPost>{
boolean update(IBZPost et) ;
void updateBatch(List<IBZPost> list) ;
IBZPost getDraft(IBZPost et) ;
boolean save(IBZPost et) ;
void saveBatch(List<IBZPost> list) ;
boolean checkKey(IBZPost et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
IBZPost get(String key) ;
boolean create(IBZPost et) ;
void createBatch(List<IBZPost> list) ;
Page<IBZPost> searchDefault(IBZPostSearchContext 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);
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZTeamMember;
import cn.ibizlab.core.ou.filter.IBZTeamMemberSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZTeamMember] 服务对象接口
*/
public interface IIBZTeamMemberService extends IService<IBZTeamMember>{
boolean checkKey(IBZTeamMember et) ;
boolean save(IBZTeamMember et) ;
void saveBatch(List<IBZTeamMember> list) ;
IBZTeamMember getDraft(IBZTeamMember et) ;
boolean update(IBZTeamMember et) ;
void updateBatch(List<IBZTeamMember> list) ;
IBZTeamMember get(String key) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean create(IBZTeamMember et) ;
void createBatch(List<IBZTeamMember> list) ;
Page<IBZTeamMember> searchDefault(IBZTeamMemberSearchContext context) ;
List<IBZTeamMember> selectByUserid(String userid) ;
void removeByUserid(String userid) ;
List<IBZTeamMember> selectByTeamid(String teamid) ;
void removeByTeamid(String teamid) ;
/**
*自定义查询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);
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZTeam;
import cn.ibizlab.core.ou.filter.IBZTeamSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZTeam] 服务对象接口
*/
public interface IIBZTeamService extends IService<IBZTeam>{
boolean update(IBZTeam et) ;
void updateBatch(List<IBZTeam> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
IBZTeam get(String key) ;
boolean save(IBZTeam et) ;
void saveBatch(List<IBZTeam> list) ;
IBZTeam getDraft(IBZTeam et) ;
boolean checkKey(IBZTeam et) ;
boolean create(IBZTeam et) ;
void createBatch(List<IBZTeam> list) ;
Page<IBZTeam> searchDefault(IBZTeamSearchContext 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);
}
......@@ -49,6 +49,9 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
private cn.ibizlab.core.ou.service.IIBZDeptMemberService ibzdeptmemberService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZTeamMemberService ibzteammemberService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZDepartmentService ibzdepartmentService;
@Autowired
@Lazy
......
package cn.ibizlab.core.ou.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.core.ou.domain.IBZPost;
import cn.ibizlab.core.ou.filter.IBZPostSearchContext;
import cn.ibizlab.core.ou.service.IIBZPostService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZPostMapper;
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("IBZPostServiceImpl")
public class IBZPostServiceImpl extends ServiceImpl<IBZPostMapper, IBZPost> implements IIBZPostService {
private int batchSize = 500;
@Override
@Transactional
public boolean update(IBZPost et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("postid",et.getPostid())))
return false;
CachedBeanCopier.copy(get(et.getPostid()),et);
return true;
}
@Override
public void updateBatch(List<IBZPost> list) {
updateBatchById(list,batchSize);
}
@Override
public IBZPost getDraft(IBZPost et) {
return et;
}
@Override
@Transactional
public boolean save(IBZPost et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZPost et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZPost> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZPost> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public boolean checkKey(IBZPost et) {
return (!ObjectUtils.isEmpty(et.getPostid()))&&(!Objects.isNull(this.getById(et.getPostid())));
}
@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 IBZPost get(String key) {
IBZPost et = getById(key);
if(et==null){
et=new IBZPost();
et.setPostid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(IBZPost et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPostid()),et);
return true;
}
@Override
public void createBatch(List<IBZPost> list) {
this.saveBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZPost> searchDefault(IBZPostSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZPost> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZPost>(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;
}
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZTeamMember;
import cn.ibizlab.core.ou.filter.IBZTeamMemberSearchContext;
import cn.ibizlab.core.ou.service.IIBZTeamMemberService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZTeamMemberMapper;
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("IBZTeamMemberServiceImpl")
public class IBZTeamMemberServiceImpl extends ServiceImpl<IBZTeamMemberMapper, IBZTeamMember> implements IIBZTeamMemberService {
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZTeamService ibzteamService;
private int batchSize = 500;
@Override
public boolean checkKey(IBZTeamMember et) {
return (!ObjectUtils.isEmpty(et.getTeammemberid()))&&(!Objects.isNull(this.getById(et.getTeammemberid())));
}
@Override
@Transactional
public boolean save(IBZTeamMember et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZTeamMember et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZTeamMember> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZTeamMember> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public IBZTeamMember getDraft(IBZTeamMember et) {
fillParentData(et);
return et;
}
@Override
@Transactional
public boolean update(IBZTeamMember et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("teammemberid",et.getTeammemberid())))
return false;
CachedBeanCopier.copy(get(et.getTeammemberid()),et);
return true;
}
@Override
public void updateBatch(List<IBZTeamMember> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public IBZTeamMember get(String key) {
IBZTeamMember et = getById(key);
if(et==null){
et=new IBZTeamMember();
et.setTeammemberid(key);
}
else{
}
return et;
}
@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 boolean create(IBZTeamMember et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getTeammemberid()),et);
return true;
}
@Override
public void createBatch(List<IBZTeamMember> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
public List<IBZTeamMember> selectByUserid(String userid) {
return baseMapper.selectByUserid(userid);
}
@Override
public void removeByUserid(String userid) {
this.remove(new QueryWrapper<IBZTeamMember>().eq("userid",userid));
}
@Override
public List<IBZTeamMember> selectByTeamid(String teamid) {
return baseMapper.selectByTeamid(teamid);
}
@Override
public void removeByTeamid(String teamid) {
this.remove(new QueryWrapper<IBZTeamMember>().eq("teamid",teamid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZTeamMember> searchDefault(IBZTeamMemberSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZTeamMember> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZTeamMember>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZTeamMember et){
//实体关系[DER1N_IBZTEAMMEMBER_IBZEMP_USERID]
if(!ObjectUtils.isEmpty(et.getUserid())){
cn.ibizlab.core.ou.domain.IBZEmployee emp=et.getEmp();
if(ObjectUtils.isEmpty(emp)){
cn.ibizlab.core.ou.domain.IBZEmployee majorEntity=ibzemployeeService.get(et.getUserid());
et.setEmp(majorEntity);
emp=majorEntity;
}
et.setPersonname(emp.getPersonname());
}
//实体关系[DER1N_IBZTEAMMEMBER_IBZTEAM_TEAMID]
if(!ObjectUtils.isEmpty(et.getTeamid())){
cn.ibizlab.core.ou.domain.IBZTeam team=et.getTeam();
if(ObjectUtils.isEmpty(team)){
cn.ibizlab.core.ou.domain.IBZTeam majorEntity=ibzteamService.get(et.getTeamid());
et.setTeam(majorEntity);
team=majorEntity;
}
et.setTeamname(team.getTeamname());
}
}
@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;
}
}
package cn.ibizlab.core.ou.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.core.ou.domain.IBZTeam;
import cn.ibizlab.core.ou.filter.IBZTeamSearchContext;
import cn.ibizlab.core.ou.service.IIBZTeamService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZTeamMapper;
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("IBZTeamServiceImpl")
public class IBZTeamServiceImpl extends ServiceImpl<IBZTeamMapper, IBZTeam> implements IIBZTeamService {
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZTeamMemberService ibzteammemberService;
private int batchSize = 500;
@Override
@Transactional
public boolean update(IBZTeam et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("teamid",et.getTeamid())))
return false;
CachedBeanCopier.copy(get(et.getTeamid()),et);
return true;
}
@Override
public void updateBatch(List<IBZTeam> 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 IBZTeam get(String key) {
IBZTeam et = getById(key);
if(et==null){
et=new IBZTeam();
et.setTeamid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean save(IBZTeam et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZTeam et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZTeam> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZTeam> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public IBZTeam getDraft(IBZTeam et) {
return et;
}
@Override
public boolean checkKey(IBZTeam et) {
return (!ObjectUtils.isEmpty(et.getTeamid()))&&(!Objects.isNull(this.getById(et.getTeamid())));
}
@Override
@Transactional
public boolean create(IBZTeam et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getTeamid()),et);
return true;
}
@Override
public void createBatch(List<IBZTeam> list) {
this.saveBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZTeam> searchDefault(IBZTeamSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZTeam> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZTeam>(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;
}
}
package cn.ibizlab.core.util.config;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
/**
* xxl-job config
* 分布式任务调度平台XXL-JOB配置加载
* @author xuxueli 2017-04-28
*/
@Configuration
public class XxlJobConfig {
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@Value("${xxl.job.admin.addresses:}")
private String adminAddresses;
@Value("${xxl.job.accessToken:}")
private String accessToken;
@Value("${xxl.job.executor.appname:ibzou}")
private String appName;
@Value("${xxl.job.executor.ip:127.0.0.1}")
private String ip;
@Value("${xxl.job.executor.port:9999}")
private int port;
@Value("${xxl.job.executor.logpath:/app/joblog}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays:-1}")
private int logRetentionDays;
@Bean(initMethod = "start", destroyMethod = "destroy")
public XxlJobSpringExecutor xxlJobExecutor() {
if(!StringUtils.isEmpty(adminAddresses)){
logger.info(">>>>>>>>>>> xxl-job config init.");
logger.info(">>>>>>>>>>> adminAddresses:"+adminAddresses);
logger.info(">>>>>>>>>>> appName:"+appName);
logger.info(">>>>>>>>>>> ip:"+ip);
logger.info(">>>>>>>>>>> port:"+port);
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppName(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
logger.info(">>>>>>>>>>> xxl-job config not init.");
return null;
}
/**
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
*
* 1、引入依赖:
* <dependency>
* <groupId>org.springframework.cloud</groupId>
* <artifactId>spring-cloud-commons</artifactId>
* <version>${version}"</version>
* </dependency>
*
* 2、配置文件,或者容器启动变量
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
*
* 3、获取IP
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
*/
}
......@@ -31,8 +31,20 @@
</changeSet>
<!--输出实体[IBZTEAM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzteam-32-2">
<createTable tableName="IBZTEAM">
<column name="TEAMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZTEAM_TEAMID"/>
</column>
<column name="TEAMNAME" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[IBZEMP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzemp-644-2">
<changeSet author="a_A_5d9d78509" id="tab-ibzemp-647-3">
<createTable tableName="IBZEMP">
<column name="USERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZEMP_USERID"/>
......@@ -111,8 +123,22 @@
</changeSet>
<!--输出实体[IBZPOST]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzpost-7-4">
<createTable tableName="IBZPOST">
<column name="POSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZPOST_POSTID"/>
</column>
<column name="POSTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTNAME" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[IBZDEPTMEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzdeptmember-30-3">
<changeSet author="a_A_5d9d78509" id="tab-ibzdeptmember-30-5">
<createTable tableName="IBZDEPTMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZDEPTMEMBER_MEMBERID"/>
......@@ -126,7 +152,7 @@
<!--输出实体[IBZDEPT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzdept-701-4">
<changeSet author="a_A_5d9d78509" id="tab-ibzdept-701-6">
<createTable tableName="IBZDEPT">
<column name="DEPTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZDEPT_DEPTID"/>
......@@ -160,30 +186,53 @@
</createTable>
</changeSet>
<!--输出实体[IBZTEAMMEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzteammember-24-7">
<createTable tableName="IBZTEAMMEMBER">
<column name="TEAMMEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZTEAMMEMBER_TEAMMEMBERID"/>
</column>
<column name="TEAMID" remarks="" type="VARCHAR(100)">
</column>
<column name="USERID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[IBZORG]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzorg-445-5">
<changeSet author="a_A_5d9d78509" id="fk-ibzorg-445-8">
<addForeignKeyConstraint baseColumnNames="PORGID" baseTableName="IBZORG" constraintName="DER1N_IBZORG_IBZORG_PORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<!--输出实体[IBZTEAM]外键关系 -->
<!--输出实体[IBZEMP]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-644-6">
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-647-9">
<addForeignKeyConstraint baseColumnNames="MDEPTID" baseTableName="IBZEMP" constraintName="DER1N_IBZEMP_IBZDEPT_MDEPTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-644-7">
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-647-10">
<addForeignKeyConstraint baseColumnNames="ORGID" baseTableName="IBZEMP" constraintName="DER1N_IBZEMP_IBZORG_ORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<!--输出实体[IBZPOST]外键关系 -->
<!--输出实体[IBZDEPTMEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-30-8">
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-30-11">
<addForeignKeyConstraint baseColumnNames="DEPTID" baseTableName="IBZDEPTMEMBER" constraintName="DER1N_IBZDEPTMEMBER_IBZDEPT_DE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-30-9">
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-30-12">
<addForeignKeyConstraint baseColumnNames="USERID" baseTableName="IBZDEPTMEMBER" constraintName="DER1N_IBZDEPTMEMBER_IBZEMP_USE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="USERID" referencedTableName="IBZEMP" validate="true"/>
</changeSet>
<!--输出实体[IBZDEPT]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-701-10">
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-701-13">
<addForeignKeyConstraint baseColumnNames="PDEPTID" baseTableName="IBZDEPT" constraintName="DER1N_IBZDEPT_IBZDEPT_PDEPTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-701-11">
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-701-14">
<addForeignKeyConstraint baseColumnNames="ORGID" baseTableName="IBZDEPT" constraintName="DER1N_IBZDEPT_IBZORG_ORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<!--输出实体[IBZTEAMMEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzteammember-24-15">
<addForeignKeyConstraint baseColumnNames="USERID" baseTableName="IBZTEAMMEMBER" constraintName="DER1N_IBZTEAMMEMBER_IBZEMP_USE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="USERID" referencedTableName="IBZEMP" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzteammember-24-16">
<addForeignKeyConstraint baseColumnNames="TEAMID" baseTableName="IBZTEAMMEMBER" constraintName="DER1N_IBZTEAMMEMBER_IBZTEAM_TE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TEAMID" referencedTableName="IBZTEAM" validate="true"/>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.ou.mapper.IBZPostMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IBZPostResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`POSTCODE`, t1.`POSTID`, t1.`POSTNAME` FROM `IBZPOST` t1 ) t1 where postid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IBZPostResultMap" type="cn.ibizlab.core.ou.domain.IBZPost" autoMapping="true">
<id property="postid" column="postid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.ou.filter.IBZPostSearchContext" resultMap="IBZPostResultMap">
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.`POSTCODE`, t1.`POSTID`, t1.`POSTNAME` FROM `IBZPOST` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`POSTCODE`, t1.`POSTID`, t1.`POSTNAME` FROM `IBZPOST` 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.core.ou.mapper.IBZTeamMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IBZTeamResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`TEAMID`, t1.`TEAMNAME` FROM `IBZTEAM` t1 ) t1 where teamid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IBZTeamResultMap" type="cn.ibizlab.core.ou.domain.IBZTeam" autoMapping="true">
<id property="teamid" column="teamid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.ou.filter.IBZTeamSearchContext" resultMap="IBZTeamResultMap">
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.`TEAMID`, t1.`TEAMNAME` FROM `IBZTEAM` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`TEAMID`, t1.`TEAMNAME` FROM `IBZTEAM` 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.core.ou.mapper.IBZTeamMemberMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IBZTeamMemberResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t21.`PERSONNAME`, t1.`TEAMID`, t1.`TEAMMEMBERID`, t11.`TEAMNAME`, t1.`USERID` FROM `IBZTEAMMEMBER` t1 LEFT JOIN IBZTEAM t11 ON t1.TEAMID = t11.TEAMID LEFT JOIN IBZEMP t21 ON t1.USERID = t21.USERID ) t1 where teammemberid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IBZTeamMemberResultMap" type="cn.ibizlab.core.ou.domain.IBZTeamMember" autoMapping="true">
<id property="teammemberid" column="teammemberid" /><!--主键字段映射-->
<result property="teamid" column="teamid" />
<result property="userid" column="userid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="emp" javaType="cn.ibizlab.core.ou.domain.IBZEmployee" column="userid" select="cn.ibizlab.core.ou.mapper.IBZEmployeeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="team" javaType="cn.ibizlab.core.ou.domain.IBZTeam" column="teamid" select="cn.ibizlab.core.ou.mapper.IBZTeamMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IBZTEAMMEMBER_IBZEMP_USERID] -->
<select id="selectByUserid" resultMap="IBZTeamMemberResultMap">
select t1.* from (
<include refid="Default" />
) t1
where userid=#{userid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IBZTEAMMEMBER_IBZTEAM_TEAMID] -->
<select id="selectByTeamid" resultMap="IBZTeamMemberResultMap">
select t1.* from (
<include refid="Default" />
) t1
where teamid=#{teamid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.ou.filter.IBZTeamMemberSearchContext" resultMap="IBZTeamMemberResultMap">
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 t21.`PERSONNAME`, t1.`TEAMID`, t1.`TEAMMEMBERID`, t11.`TEAMNAME`, t1.`USERID` FROM `IBZTEAMMEMBER` t1 LEFT JOIN IBZTEAM t11 ON t1.TEAMID = t11.TEAMID LEFT JOIN IBZEMP t21 ON t1.USERID = t21.USERID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t21.`PERSONNAME`, t1.`TEAMID`, t1.`TEAMMEMBERID`, t11.`TEAMNAME`, t1.`USERID` FROM `IBZTEAMMEMBER` t1 LEFT JOIN IBZTEAM t11 ON t1.TEAMID = t11.TEAMID LEFT JOIN IBZEMP t21 ON t1.USERID = t21.USERID
]]>
</sql>
</mapper>
......@@ -12,6 +12,14 @@
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"IBZTeamMember",
"delogicname":"组成员",
"sysmoudle":{"id":"OU","name":"ou"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"IBZDepartment",
"delogicname":"部门",
"sysmoudle":{"id":"OU","name":"ou"},
......@@ -35,6 +43,14 @@
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"curorg","name":"当前单位"},{"id":"porg","name":"上级单位"},{"id":"sorg","name":"下级单位"} ]
}
, {
"dename":"IBZTeam",
"delogicname":"组",
"sysmoudle":{"id":"OU","name":"ou"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
],
"appmenus":[
......
......@@ -74,6 +74,9 @@
<!--httpClient -->
<openfeign-httpclient.version>11.0</openfeign-httpclient.version>
<!--xxl-job定时服务 -->
<xxl-job.version>2.1.0</xxl-job.version>
</properties>
<dependencyManagement>
......@@ -249,6 +252,12 @@
<version>${openfeign-httpclient.version}</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>${xxl-job.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
......@@ -308,6 +317,12 @@
<artifactId>h2</artifactId>
</dependency>
<!--xxl-job定时服务 -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<!-- Error -->
<!-- Security -->
......
......@@ -2,13 +2,13 @@
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
IBIZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
EXPOSE 8081
EXPOSE 40001
ADD ibzou-provider-api.jar /ibzou-provider-api.jar
......@@ -3,9 +3,21 @@ services:
ibzou-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports:
- "8081:8081"
- "40001:40001"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=40001
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
deploy:
mode: replicated
replicas: 1
......
package cn.ibizlab.api.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.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[IBZPostDTO]
*/
@Data
public class IBZPostDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [POSTID]
*
*/
@JSONField(name = "postid")
@JsonProperty("postid")
private String postid;
/**
* 属性 [POSTCODE]
*
*/
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 属性 [POSTNAME]
*
*/
@JSONField(name = "postname")
@JsonProperty("postname")
private String postname;
/**
* 设置 [POSTCODE]
*/
public void setPostcode(String postcode){
this.postcode = postcode ;
this.modify("postcode",postcode);
}
/**
* 设置 [POSTNAME]
*/
public void setPostname(String postname){
this.postname = postname ;
this.modify("postname",postname);
}
}
package cn.ibizlab.api.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.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[IBZTeamDTO]
*/
@Data
public class IBZTeamDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [TEAMID]
*
*/
@JSONField(name = "teamid")
@JsonProperty("teamid")
private String teamid;
/**
* 属性 [TEAMNAME]
*
*/
@JSONField(name = "teamname")
@JsonProperty("teamname")
private String teamname;
/**
* 设置 [TEAMNAME]
*/
public void setTeamname(String teamname){
this.teamname = teamname ;
this.modify("teamname",teamname);
}
}
package cn.ibizlab.api.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.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[IBZTeamMemberDTO]
*/
@Data
public class IBZTeamMemberDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [TEAMMEMBERID]
*
*/
@JSONField(name = "teammemberid")
@JsonProperty("teammemberid")
private String teammemberid;
/**
* 属性 [TEAMID]
*
*/
@JSONField(name = "teamid")
@JsonProperty("teamid")
private String teamid;
/**
* 属性 [USERID]
*
*/
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 属性 [TEAMNAME]
*
*/
@JSONField(name = "teamname")
@JsonProperty("teamname")
private String teamname;
/**
* 属性 [PERSONNAME]
*
*/
@JSONField(name = "personname")
@JsonProperty("personname")
private String personname;
/**
* 设置 [TEAMID]
*/
public void setTeamid(String teamid){
this.teamid = teamid ;
this.modify("teamid",teamid);
}
/**
* 设置 [USERID]
*/
public void setUserid(String userid){
this.userid = userid ;
this.modify("userid",userid);
}
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.ou.domain.IBZPost;
import cn.ibizlab.api.dto.IBZPostDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface IBZPostMapping extends MappingBase<IBZPostDTO, IBZPost> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.ou.domain.IBZTeam;
import cn.ibizlab.api.dto.IBZTeamDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface IBZTeamMapping extends MappingBase<IBZTeamDTO, IBZTeam> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.ou.domain.IBZTeamMember;
import cn.ibizlab.api.dto.IBZTeamMemberDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface IBZTeamMemberMapping extends MappingBase<IBZTeamMemberDTO, IBZTeamMember> {
}
package cn.ibizlab.api.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.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.ou.domain.IBZPost;
import cn.ibizlab.core.ou.service.IIBZPostService;
import cn.ibizlab.core.ou.filter.IBZPostSearchContext;
@Slf4j
@Api(tags = {"岗位" })
@RestController("api-ibzpost")
@RequestMapping("")
public class IBZPostResource {
@Autowired
public IIBZPostService ibzpostService;
@Autowired
@Lazy
public IBZPostMapping ibzpostMapping;
}
package cn.ibizlab.api.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.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.ou.domain.IBZTeamMember;
import cn.ibizlab.core.ou.service.IIBZTeamMemberService;
import cn.ibizlab.core.ou.filter.IBZTeamMemberSearchContext;
@Slf4j
@Api(tags = {"组成员" })
@RestController("api-ibzteammember")
@RequestMapping("")
public class IBZTeamMemberResource {
@Autowired
public IIBZTeamMemberService ibzteammemberService;
@Autowired
@Lazy
public IBZTeamMemberMapping ibzteammemberMapping;
}
package cn.ibizlab.api.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.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.ou.domain.IBZTeam;
import cn.ibizlab.core.ou.service.IIBZTeamService;
import cn.ibizlab.core.ou.filter.IBZTeamSearchContext;
@Slf4j
@Api(tags = {"组" })
@RestController("api-ibzteam")
@RequestMapping("")
public class IBZTeamResource {
@Autowired
public IIBZTeamService ibzteamService;
@Autowired
@Lazy
public IBZTeamMapping ibzteamMapping;
}
package cn.ibizlab.util.domain;
import cn.ibizlab.util.helper.DataObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.sql.Timestamp;
@TableName(value = "IBZCFG")
@JsonIgnoreProperties(ignoreUnknown = true)
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class IBZConfig {
/**
* 配置标识
* 系统+配置类型+引用对象+用户标识联合主键
*/
@TableId
private String cfgId;
/**
* 系统标识
*/
private String systemId;
/**
* 配置类型
* 门户配置/表格自定义配置/自定义查询...消费方自定义
*/
private String cfgType;
/**
* 引用对象
* 门户页标识/具体表格视图标识...消费方具体使用位置的标识
*/
private String targetType;
/**
* 用户标识
* 默认当前登录者
*/
private String userId;
/**
* 配置
* JSONObject
*/
private String cfg;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Timestamp updateDate;
public String getCfgId()
{
if(StringUtils.isEmpty(cfgId)&&
(!(StringUtils.isEmpty(systemId)))&&
(!(StringUtils.isEmpty(cfgType)))&&
(!(StringUtils.isEmpty(targetType)))&&
(!(StringUtils.isEmpty(userId))))
{
cfgId= DigestUtils.md5DigestAsHex((systemId+"||"+cfgType+"||"+targetType+"||"+userId).getBytes());
}
return cfgId;
}
}
package cn.ibizlab.util.mapper;
import cn.ibizlab.util.domain.IBZConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface IBZConfigMapper extends BaseMapper<IBZConfig>{
}
\ No newline at end of file
package cn.ibizlab.util.rest;
import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.service.IBZConfigService;
import com.alibaba.fastjson.JSONObject;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.service.AuthenticationUserService;
......@@ -8,9 +10,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
......@@ -23,6 +24,10 @@ public class AppController {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:ibzou}")
private String systemId;
@Autowired
private AuthenticationUserService userDetailsService;
......@@ -39,10 +44,10 @@ public class AppController {
while(it.hasNext()) {
GrantedAuthority authority = (GrantedAuthority)it.next();
String strAuthority=authority.getAuthority();
if(strAuthority.startsWith("UNIRES"))
uniRes.add(strAuthority);
else if(strAuthority.startsWith("APPMENU"))
appMenu.add(strAuthority);
if(strAuthority.startsWith("UNIRES_"+systemId))
uniRes.add(strAuthority.substring(systemId.length()+8));
else if(strAuthority.startsWith("APPMENU_"+systemId))
appMenu.add(strAuthority.substring(systemId.length()+9));
}
}
appData.put("unires",uniRes);
......@@ -57,4 +62,23 @@ public class AppController {
userDetailsService.resetByUsername(AuthenticationUser.getAuthenticationUser().getUsername());
}
}
@Autowired
private IBZConfigService ibzConfigService;
@RequestMapping(method = RequestMethod.PUT, value = "/configs/{configType}/{targetType}")
public ResponseEntity<Boolean> saveConfig(@PathVariable("configType") String configType, @PathVariable("targetType") String targetType, @RequestBody JSONObject config) {
String userId=AuthenticationUser.getAuthenticationUser().getUserid();
if(StringUtils.isEmpty(userId))
throw new BadRequestAlertException("保存配置失败,参数缺失","IBZConfig",configType);
return ResponseEntity.ok(ibzConfigService.saveConfig(configType,targetType,userId,config));
}
@RequestMapping(method = RequestMethod.GET, value = "/configs/{configType}/{targetType}")
public ResponseEntity<JSONObject> getConfig(@PathVariable("configType") String configType, @PathVariable("targetType") String targetType) {
String userId=AuthenticationUser.getAuthenticationUser().getUserid();
if(StringUtils.isEmpty(userId))
throw new BadRequestAlertException("获取配置失败,参数缺失","IBZConfig",configType);
return ResponseEntity.ok(ibzConfigService.getConfig(configType,targetType,userId));
}
}
package cn.ibizlab.util.service;
import cn.ibizlab.util.domain.IBZConfig;
import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.mapper.IBZConfigMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@Slf4j
@Service
public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> implements IService<IBZConfig> {
@Value("${ibiz.systemid:ibzou}")
private String systemId;
@Cacheable( value="ibzou_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public JSONObject getConfig(String cfgType,String targetType,String userId)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
throw new BadRequestAlertException("获取配置失败,参数缺失","IBZConfig",cfgType);
IBZConfig config=this.getOne(Wrappers.query(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).build()),false);
if(config==null)
return new JSONObject();
else
return JSON.parseObject(config.getCfg());
}
@CacheEvict( value="ibzou_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public boolean saveConfig(String cfgType,String targetType,String userId,JSONObject config)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
throw new BadRequestAlertException("保存配置失败,参数缺失","IBZConfig",cfgType);
String cfg="{}";
if(config!=null)
cfg=JSONObject.toJSONString(config);
return this.saveOrUpdate(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).cfg(cfg).updateDate(DataObject.getNow()).build());
}
@CacheEvict( value="ibzou_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public void resetConfig(String cfgType,String targetType,String userId)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
throw new BadRequestAlertException("重置配置失败,参数缺失","IBZConfig",cfgType);
this.remove(Wrappers.query(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).build()));
}
}
\ No newline at end of file
......@@ -85,3 +85,16 @@ ibiz:
enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
#xxl-job定时服务
xxl:
job:
accessToken:
admin:
addresses: #127.0.0.1
executor:
appname: ibzou
ip:
port: 9999
logpath: /app/joblog
logretentiondays: -1
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册