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

lab_qyk 发布系统代码

上级 f4919721
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzrt/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzrt/
mvn clean package -Pweb
cd ibzrt-app/ibzrt-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzrt-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzrt-app-web.jar
EXPOSE 30000
EXPOSE 8080
ADD ibzrt-app-web.jar /ibzrt-app-web.jar
......@@ -3,21 +3,9 @@ services:
ibzrt-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzrt-app-web:latest
ports:
- "30000:30000"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=30000
- 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
......
......@@ -5,11 +5,11 @@ zuul:
routes:
sys_role_permission:
path: /sysrolepermissions/**
serviceId: ibzrt-api
serviceId: ibzuaa-api
stripPrefix: false
sys_user:
path: /sysusers/**
serviceId: ibzrt-api
serviceId: ibzuaa-api
stripPrefix: false
wf_group_member:
path: /wfmembers/**
......@@ -21,7 +21,7 @@ zuul:
stripPrefix: false
ibzorg:
path: /ibzorganizations/**
serviceId: ibzrt-api
serviceId: ibzou-api
stripPrefix: false
wf_group:
path: /wfgroups/**
......@@ -29,23 +29,23 @@ zuul:
stripPrefix: false
sys_user_role:
path: /sysuserroles/**
serviceId: ibzrt-api
serviceId: ibzuaa-api
stripPrefix: false
sys_role:
path: /sysroles/**
serviceId: ibzrt-api
serviceId: ibzuaa-api
stripPrefix: false
ibzdeptmember:
path: /ibzdeptmembers/**
serviceId: ibzrt-api
serviceId: ibzou-api
stripPrefix: false
ibzdept:
path: /ibzdepartments/**
serviceId: ibzrt-api
serviceId: ibzou-api
stripPrefix: false
ibzemp:
path: /ibzemployees/**
serviceId: ibzrt-api
serviceId: ibzou-api
stripPrefix: false
loginv7:
path: /v7/login
......
......@@ -4,6 +4,14 @@ server:
#zuul网关路由设置
zuul:
routes:
wf_pssystem:
path: /wf_pssystems/**
serviceId: ibzwf-api
stripPrefix: false
ibzorg:
path: /ibzorgs/**
serviceId: ibzou-api
stripPrefix: false
wf_instance:
path: /wf_instances/**
serviceId: ibzwf-api
......@@ -12,30 +20,74 @@ zuul:
path: /wf_models/**
serviceId: ibzwf-api
stripPrefix: false
wf_group_member:
path: /wf_group_members/**
ibzdictitem:
path: /ibzdictitems/**
serviceId: ibzdict-api
stripPrefix: false
wf_task_way:
path: /wf_task_ways/**
serviceId: ibzwf-api
stripPrefix: false
wf_task:
path: /wf_tasks/**
serviceId: ibzwf-api
stripPrefix: false
wf_group_member:
path: /wf_group_members/**
serviceId: ibzwf-api
stripPrefix: false
sys_authlog:
path: /sys_authlogs/**
serviceId: ibzuaa-api
stripPrefix: false
wf_definition_node:
path: /wf_definition_nodes/**
serviceId: ibzwf-api
stripPrefix: false
wf_pssystem:
path: /wf_pssystems/**
serviceId: ibzwf-api
sys_role_permission:
path: /sys_role_permissions/**
serviceId: ibzuaa-api
stripPrefix: false
wf_task_way:
path: /wf_task_ways/**
serviceId: ibzwf-api
sys_user:
path: /sys_users/**
serviceId: ibzuaa-api
stripPrefix: false
ibzdict:
path: /ibzdicts/**
serviceId: ibzdict-api
stripPrefix: false
ibzemp:
path: /ibzemps/**
serviceId: ibzou-api
stripPrefix: false
sys_user_role:
path: /sys_user_roles/**
serviceId: ibzuaa-api
stripPrefix: false
wf_definition:
path: /wf_definitions/**
serviceId: ibzwf-api
stripPrefix: false
sys_role:
path: /sys_roles/**
serviceId: ibzuaa-api
stripPrefix: false
ibzdeptmember:
path: /ibzdeptmembers/**
serviceId: ibzou-api
stripPrefix: false
sys_pssystem:
path: /sys_pssystems/**
serviceId: ibzuaa-api
stripPrefix: false
sys_permission:
path: /sys_permissions/**
serviceId: ibzuaa-api
stripPrefix: false
ibzdept:
path: /ibzdepts/**
serviceId: ibzou-api
stripPrefix: false
loginv7:
path: /v7/login
serviceId: ibzuaa-api
......
package cn.ibizlab.core.dict.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.dict.domain.IBZDict;
import cn.ibizlab.core.dict.filter.IBZDictSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZDict] 服务对象接口
*/
@Component
public class IBZDictFallback implements IBZDictFeignClient{
public Page<IBZDict> select(){
return null;
}
public IBZDict create(IBZDict ibzdict){
return null;
}
public Boolean createBatch(List<IBZDict> ibzdicts){
return false;
}
public Boolean remove(String dictid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public IBZDict update(String dictid, IBZDict ibzdict){
return null;
}
public Boolean updateBatch(List<IBZDict> ibzdicts){
return false;
}
public IBZDict getDraft(){
return null;
}
public Boolean save(IBZDict ibzdict){
return false;
}
public Boolean saveBatch(List<IBZDict> ibzdicts){
return false;
}
public IBZDict get(String dictid){
return null;
}
public Boolean checkKey(IBZDict ibzdict){
return false;
}
public Page<IBZDict> searchDefault(IBZDictSearchContext context){
return null;
}
}
package cn.ibizlab.core.dict.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.dict.domain.IBZDict;
import cn.ibizlab.core.dict.filter.IBZDictSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZDict] 服务对象接口
*/
@FeignClient(value = "ibzdict-api", contextId = "IBZDict", fallback = IBZDictFallback.class)
public interface IBZDictFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzdicts/select")
Page<IBZDict> select();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts")
IBZDict create(@RequestBody IBZDict ibzdict);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts/batch")
Boolean createBatch(@RequestBody List<IBZDict> ibzdicts);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdicts/{dictid}")
Boolean remove(@PathVariable("dictid") String dictid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdicts/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdicts/{dictid}")
IBZDict update(@PathVariable("dictid") String dictid,@RequestBody IBZDict ibzdict);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdicts/batch")
Boolean updateBatch(@RequestBody List<IBZDict> ibzdicts);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdicts/getdraft")
IBZDict getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts/save")
Boolean save(@RequestBody IBZDict ibzdict);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts/save")
Boolean saveBatch(@RequestBody List<IBZDict> ibzdicts);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdicts/{dictid}")
IBZDict get(@PathVariable("dictid") String dictid);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts/checkkey")
Boolean checkKey(@RequestBody IBZDict ibzdict);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdicts/searchdefault")
Page<IBZDict> searchDefault(@RequestBody IBZDictSearchContext context);
}
package cn.ibizlab.core.dict.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.dict.domain.IBZDictItem;
import cn.ibizlab.core.dict.filter.IBZDictItemSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZDictItem] 服务对象接口
*/
@Component
public class IBZDictItemFallback implements IBZDictItemFeignClient{
public Page<IBZDictItem> select(){
return null;
}
public IBZDictItem update(String itemid, IBZDictItem ibzdictitem){
return null;
}
public Boolean updateBatch(List<IBZDictItem> ibzdictitems){
return false;
}
public Boolean checkKey(IBZDictItem ibzdictitem){
return false;
}
public Boolean save(IBZDictItem ibzdictitem){
return false;
}
public Boolean saveBatch(List<IBZDictItem> ibzdictitems){
return false;
}
public Boolean remove(String itemid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public IBZDictItem get(String itemid){
return null;
}
public IBZDictItem create(IBZDictItem ibzdictitem){
return null;
}
public Boolean createBatch(List<IBZDictItem> ibzdictitems){
return false;
}
public IBZDictItem getDraft(){
return null;
}
public Page<IBZDictItem> searchDefault(IBZDictItemSearchContext context){
return null;
}
}
package cn.ibizlab.core.dict.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.dict.domain.IBZDictItem;
import cn.ibizlab.core.dict.filter.IBZDictItemSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZDictItem] 服务对象接口
*/
@FeignClient(value = "ibzdict-api", contextId = "IBZDictItem", fallback = IBZDictItemFallback.class)
public interface IBZDictItemFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzdictitems/select")
Page<IBZDictItem> select();
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdictitems/{itemid}")
IBZDictItem update(@PathVariable("itemid") String itemid,@RequestBody IBZDictItem ibzdictitem);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdictitems/batch")
Boolean updateBatch(@RequestBody List<IBZDictItem> ibzdictitems);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems/checkkey")
Boolean checkKey(@RequestBody IBZDictItem ibzdictitem);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems/save")
Boolean save(@RequestBody IBZDictItem ibzdictitem);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems/save")
Boolean saveBatch(@RequestBody List<IBZDictItem> ibzdictitems);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdictitems/{itemid}")
Boolean remove(@PathVariable("itemid") String itemid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdictitems/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdictitems/{itemid}")
IBZDictItem get(@PathVariable("itemid") String itemid);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems")
IBZDictItem create(@RequestBody IBZDictItem ibzdictitem);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems/batch")
Boolean createBatch(@RequestBody List<IBZDictItem> ibzdictitems);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdictitems/getdraft")
IBZDictItem getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdictitems/searchdefault")
Page<IBZDictItem> searchDefault(@RequestBody IBZDictItemSearchContext context);
}
......@@ -21,90 +21,83 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[数据字典]
* ServiceApi [数据字典] 对象
*/
@Data
@TableName(value = "IBZDICT",resultMap = "IBZDictResultMap")
public class IBZDict extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZDict extends EntityClient implements Serializable {
/**
* 字典标识
*/
@DEField(name = "ibzdictid" , isKeyField=true)
@TableId(value= "ibzdictid",type=IdType.UUID)
@JSONField(name = "dictid")
@JsonProperty("dictid")
private String dictid;
/**
* 字典名称
*/
@DEField(name = "ibzdictname")
@TableField(value = "ibzdictname")
@JSONField(name = "dictname")
@JsonProperty("dictname")
private String dictname;
/**
* 逻辑有效标志
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 字典项目
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "items")
@JsonProperty("items")
private List<cn.ibizlab.core.dict.domain.IBZDictItem> items;
/**
* 设置 [字典名称]
*/
......
......@@ -21,133 +21,127 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[字典项目]
* ServiceApi [字典项目] 对象
*/
@Data
@TableName(value = "IBZDICTITEM",resultMap = "IBZDictItemResultMap")
public class IBZDictItem extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZDictItem extends EntityClient implements Serializable {
/**
* 字典项目标识
*/
@DEField(name = "ibzdictitemid" , isKeyField=true)
@TableId(value= "ibzdictitemid",type=IdType.UUID)
@JSONField(name = "itemid")
@JsonProperty("itemid")
private String itemid;
/**
* 栏目显示值
*/
@DEField(name = "ibzdictitemname")
@TableField(value = "ibzdictitemname")
@JSONField(name = "itemname")
@JsonProperty("itemname")
private String itemname;
/**
* 栏目值
*/
@DEField(name = "dictitemval")
@TableField(value = "dictitemval")
@JSONField(name = "itemval")
@JsonProperty("itemval")
private String itemval;
/**
* 字典标识
*/
@TableField(value = "dictid")
@JSONField(name = "dictid")
@JsonProperty("dictid")
private String dictid;
/**
* 父栏目值
*/
@TableField(value = "pitemval")
@JSONField(name = "pitemval")
@JsonProperty("pitemval")
private String pitemval;
/**
* 过滤项
*/
@TableField(value = "itemfilter")
@JSONField(name = "itemfilter")
@JsonProperty("itemfilter")
private String itemfilter;
/**
* 栏目样式
*/
@DEField(defaultValue = "itemcls" , defaultValueType = DEFieldDefaultValueType.PARAM)
@TableField(value = "itemcls")
@JSONField(name = "itemcls")
@JsonProperty("itemcls")
private String itemcls;
/**
* 图标
*/
@DEField(defaultValue = "no,png")
@TableField(value = "itemicon")
@JSONField(name = "itemicon")
@JsonProperty("itemicon")
private String itemicon;
/**
* 排序
*/
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
private Integer showorder;
/**
* 建立时间
*/
@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(defaultValueType = DEFieldDefaultValueType.CURTIME , 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(defaultValue = "SRFPERSONID" , defaultValueType = DEFieldDefaultValueType.SESSION , 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;
/**
* 字典
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "dict")
@JsonProperty("dict")
private cn.ibizlab.core.dict.domain.IBZDict dict;
/**
* 设置 [栏目显示值]
*/
......@@ -205,22 +199,6 @@ public class IBZDictItem extends EntityMP implements Serializable {
this.modify("showorder",showorder);
}
/**
* 获取 [字典项目标识]
*/
public String getItemid(){
if(ObjectUtils.isEmpty(itemid)){
itemid=(String)getDefaultKey(true);
}
return itemid;
}
@Override
public Serializable getDefaultKey(boolean gen) {
if((!ObjectUtils.isEmpty(this.getDictid()))&&(!ObjectUtils.isEmpty(this.getItemval())))
return DigestUtils.md5DigestAsHex(String.format("%s||%s" ,this.getDictid(),this.getItemval()).getBytes());
return null;
}
}
......@@ -17,50 +17,21 @@ 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.dict.domain.IBZDictItem;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZDictItem] 查询条件对象
* ServiceApi数据实体[IBZDictItem] 查询条件对象
*/
@Slf4j
@Data
public class IBZDictItemSearchContext extends QueryWrapperContext<IBZDictItem> {
public class IBZDictItemSearchContext extends SearchContextBase {
private String n_ibzdictitemname_like;//[栏目显示值]
public void setN_ibzdictitemname_like(String n_ibzdictitemname_like) {
this.n_ibzdictitemname_like = n_ibzdictitemname_like;
if(!ObjectUtils.isEmpty(this.n_ibzdictitemname_like)){
this.getSelectCond().like("ibzdictitemname", n_ibzdictitemname_like);
}
}
private String n_dictitemval_like;//[栏目值]
public void setN_dictitemval_like(String n_dictitemval_like) {
this.n_dictitemval_like = n_dictitemval_like;
if(!ObjectUtils.isEmpty(this.n_dictitemval_like)){
this.getSelectCond().like("dictitemval", n_dictitemval_like);
}
}
private String n_dictid_eq;//[字典标识]
public void setN_dictid_eq(String n_dictid_eq) {
this.n_dictid_eq = n_dictid_eq;
if(!ObjectUtils.isEmpty(this.n_dictid_eq)){
this.getSelectCond().eq("dictid", n_dictid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("ibzdictitemname",query);
}
}
}
......@@ -17,43 +17,19 @@ 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.dict.domain.IBZDict;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZDict] 查询条件对象
* ServiceApi数据实体[IBZDict] 查询条件对象
*/
@Slf4j
@Data
public class IBZDictSearchContext extends QueryWrapperContext<IBZDict> {
public class IBZDictSearchContext extends SearchContextBase {
private String n_ibzdictid_like;//[字典标识]
public void setN_ibzdictid_like(String n_ibzdictid_like) {
this.n_ibzdictid_like = n_ibzdictid_like;
if(!ObjectUtils.isEmpty(this.n_ibzdictid_like)){
this.getSelectCond().like("ibzdictid", n_ibzdictid_like);
}
}
private String n_ibzdictname_like;//[字典名称]
public void setN_ibzdictname_like(String n_ibzdictname_like) {
this.n_ibzdictname_like = n_ibzdictname_like;
if(!ObjectUtils.isEmpty(this.n_ibzdictname_like)){
this.getSelectCond().like("ibzdictname", n_ibzdictname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("ibzdictname",query);
}
}
}
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.dict.domain.IBZDictItem;
import cn.ibizlab.core.dict.filter.IBZDictItemSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZDictItem] 服务对象接口
*/
public interface IIBZDictItemService extends IService<IBZDictItem>{
public interface IIBZDictItemService{
boolean update(IBZDictItem et) ;
void updateBatch(List<IBZDictItem> list) ;
......@@ -40,24 +38,8 @@ public interface IIBZDictItemService extends IService<IBZDictItem>{
List<IBZDictItem> selectByDictid(String dictid) ;
void removeByDictid(String dictid) ;
void saveByDictid(String dictid,List<IBZDictItem> list) ;
/**
*自定义查询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<IBZDictItem> getIbzdictitemByIds(List<String> ids) ;
List<IBZDictItem> getIbzdictitemByEntities(List<IBZDictItem> entities) ;
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.dict.domain.IBZDict;
import cn.ibizlab.core.dict.filter.IBZDictSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZDict] 服务对象接口
*/
public interface IIBZDictService extends IService<IBZDict>{
public interface IIBZDictService{
boolean create(IBZDict et) ;
void createBatch(List<IBZDict> list) ;
......@@ -37,24 +35,8 @@ public interface IIBZDictService extends IService<IBZDict>{
IBZDict get(String key) ;
boolean checkKey(IBZDict et) ;
Page<IBZDict> searchDefault(IBZDictSearchContext 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<IBZDict> getIbzdictByIds(List<String> ids) ;
List<IBZDict> getIbzdictByEntities(List<IBZDict> entities) ;
}
......@@ -30,129 +30,110 @@ import cn.ibizlab.core.dict.service.IIBZDictItemService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.dict.mapper.IBZDictItemMapper;
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;
import cn.ibizlab.core.dict.client.IBZDictItemFeignClient;
/**
* 实体[字典项目] 服务对象接口实现
*/
@Slf4j
@Service("IBZDictItemServiceImpl")
public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDictItem> implements IIBZDictItemService {
@Service
public class IBZDictItemServiceImpl implements IIBZDictItemService {
@Autowired
@Lazy
private cn.ibizlab.core.dict.service.IIBZDictService ibzdictService;
IBZDictItemFeignClient iBZDictItemFeignClient;
private int batchSize = 500;
@Override
@Transactional
public boolean update(IBZDictItem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("ibzdictitemid",et.getItemid())))
IBZDictItem rt = iBZDictItemFeignClient.update(et.getItemid(),et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getItemid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void updateBatch(List<IBZDictItem> list) {
updateBatchById(list,batchSize);
public void updateBatch(List<IBZDictItem> list){
iBZDictItemFeignClient.updateBatch(list) ;
}
@Override
public boolean checkKey(IBZDictItem et) {
return (!ObjectUtils.isEmpty(et.getItemid()))&&(!Objects.isNull(this.getById(et.getItemid())));
return iBZDictItemFeignClient.checkKey(et);
}
@Override
@Transactional
public boolean save(IBZDictItem et) {
if(!saveOrUpdate(et))
if(et.getItemid()==null) et.setItemid((String)et.getDefaultKey(true));
if(!iBZDictItemFeignClient.save(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZDictItem et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZDictItem> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZDictItem> list) {
saveOrUpdateBatch(list,batchSize);
iBZDictItemFeignClient.saveBatch(list) ;
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean remove(String itemid) {
boolean result=iBZDictItemFeignClient.remove(itemid) ;
return result;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void removeBatch(Collection<String> idList){
iBZDictItemFeignClient.removeBatch(idList);
}
@Override
@Transactional
public IBZDictItem get(String key) {
IBZDictItem et = getById(key);
public IBZDictItem get(String itemid) {
IBZDictItem et=iBZDictItemFeignClient.get(itemid);
if(et==null){
et=new IBZDictItem();
et.setItemid(key);
et.setItemid(itemid);
}
else{
}
return et;
return et;
}
@Override
@Transactional
public boolean create(IBZDictItem et) {
if(!this.retBool(this.baseMapper.insert(et)))
IBZDictItem rt = iBZDictItemFeignClient.create(et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getItemid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void createBatch(List<IBZDictItem> list) {
this.saveOrUpdateBatch(list,batchSize);
public void createBatch(List<IBZDictItem> list){
iBZDictItemFeignClient.createBatch(list) ;
}
@Override
public IBZDictItem getDraft(IBZDictItem et) {
et=iBZDictItemFeignClient.getDraft();
return et;
}
@Override
public List<IBZDictItem> selectByDictid(String dictid) {
return baseMapper.selectByDictid(dictid);
IBZDictItemSearchContext context=new IBZDictItemSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_dictid_eq(dictid);
return iBZDictItemFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByDictid(String dictid) {
this.remove(new QueryWrapper<IBZDictItem>().eq("dictid",dictid));
Set<String> delIds=new HashSet<String>();
for(IBZDictItem before:selectByDictid(dictid)){
delIds.add(before.getItemid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Override
......@@ -185,62 +166,17 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZDictItem> searchDefault(IBZDictItemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZDictItem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZDictItem>(pages.getRecords(), context.getPageable(), pages.getTotal());
Page<IBZDictItem> iBZDictItems=iBZDictItemFeignClient.searchDefault(context);
return iBZDictItems;
}
@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<IBZDictItem> getIbzdictitemByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<IBZDictItem> getIbzdictitemByEntities(List<IBZDictItem> entities) {
List ids =new ArrayList();
for(IBZDictItem entity : entities){
Serializable id=entity.getItemid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -30,182 +30,106 @@ import cn.ibizlab.core.dict.service.IIBZDictService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.dict.mapper.IBZDictMapper;
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;
import cn.ibizlab.core.dict.client.IBZDictFeignClient;
/**
* 实体[数据字典] 服务对象接口实现
*/
@Slf4j
@Service("IBZDictServiceImpl")
public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> implements IIBZDictService {
@Service
public class IBZDictServiceImpl implements IIBZDictService {
@Autowired
@Lazy
private cn.ibizlab.core.dict.service.IIBZDictItemService ibzdictitemService;
IBZDictFeignClient iBZDictFeignClient;
private int batchSize = 500;
@Override
@Transactional
public boolean create(IBZDict et) {
if(!this.retBool(this.baseMapper.insert(et)))
IBZDict rt = iBZDictFeignClient.create(et);
if(rt==null)
return false;
ibzdictitemService.saveByDictid(et.getDictid(),et.getItems());
CachedBeanCopier.copy(get(et.getDictid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void createBatch(List<IBZDict> list) {
this.saveBatch(list,batchSize);
public void createBatch(List<IBZDict> list){
iBZDictFeignClient.createBatch(list) ;
}
@Override
@Transactional
public boolean remove(String key) {
ibzdictitemService.removeByDictid(key) ;
boolean result=removeById(key);
return result ;
public boolean remove(String dictid) {
boolean result=iBZDictFeignClient.remove(dictid) ;
return result;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void removeBatch(Collection<String> idList){
iBZDictFeignClient.removeBatch(idList);
}
@Override
@Transactional
public boolean update(IBZDict et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("ibzdictid",et.getDictid())))
IBZDict rt = iBZDictFeignClient.update(et.getDictid(),et);
if(rt==null)
return false;
ibzdictitemService.saveByDictid(et.getDictid(),et.getItems());
CachedBeanCopier.copy(get(et.getDictid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void updateBatch(List<IBZDict> list) {
updateBatchById(list,batchSize);
public void updateBatch(List<IBZDict> list){
iBZDictFeignClient.updateBatch(list) ;
}
@Override
public IBZDict getDraft(IBZDict et) {
et=iBZDictFeignClient.getDraft();
return et;
}
@Override
@Transactional
public boolean save(IBZDict et) {
if(!saveOrUpdate(et))
if(et.getDictid()==null) et.setDictid((String)et.getDefaultKey(true));
if(!iBZDictFeignClient.save(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZDict et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZDict> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZDict> list) {
saveOrUpdateBatch(list,batchSize);
iBZDictFeignClient.saveBatch(list) ;
}
@Override
@Transactional
public IBZDict get(String key) {
IBZDict et = getById(key);
public IBZDict get(String dictid) {
IBZDict et=iBZDictFeignClient.get(dictid);
if(et==null){
et=new IBZDict();
et.setDictid(key);
et.setDictid(dictid);
}
else{
et.setItems(ibzdictitemService.selectByDictid(key));
}
return et;
return et;
}
@Override
public boolean checkKey(IBZDict et) {
return (!ObjectUtils.isEmpty(et.getDictid()))&&(!Objects.isNull(this.getById(et.getDictid())));
return iBZDictFeignClient.checkKey(et);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZDict> searchDefault(IBZDictSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZDict> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZDict>(pages.getRecords(), context.getPageable(), pages.getTotal());
Page<IBZDict> iBZDicts=iBZDictFeignClient.searchDefault(context);
return iBZDicts;
}
@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<IBZDict> getIbzdictByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<IBZDict> getIbzdictByEntities(List<IBZDict> entities) {
List ids =new ArrayList();
for(IBZDict entity : entities){
Serializable id=entity.getDictid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZDepartment;
import cn.ibizlab.core.ou.filter.IBZDepartmentSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZDepartment] 服务对象接口
*/
@Component
public class IBZDepartmentFallback implements IBZDepartmentFeignClient{
public Page<IBZDepartment> select(){
return null;
}
public Boolean save(IBZDepartment ibzdepartment){
return false;
}
public Boolean saveBatch(List<IBZDepartment> ibzdepartments){
return false;
}
public IBZDepartment get(String deptid){
return null;
}
public Boolean remove(String deptid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public Boolean checkKey(IBZDepartment ibzdepartment){
return false;
}
public IBZDepartment update(String deptid, IBZDepartment ibzdepartment){
return null;
}
public Boolean updateBatch(List<IBZDepartment> ibzdepartments){
return false;
}
public IBZDepartment create(IBZDepartment ibzdepartment){
return null;
}
public Boolean createBatch(List<IBZDepartment> ibzdepartments){
return false;
}
public IBZDepartment getDraft(){
return null;
}
public Page<IBZDepartment> searchCurDept(IBZDepartmentSearchContext context){
return null;
}
public Page<IBZDepartment> searchDefault(IBZDepartmentSearchContext context){
return null;
}
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZDepartment;
import cn.ibizlab.core.ou.filter.IBZDepartmentSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZDepartment] 服务对象接口
*/
@FeignClient(value = "ibzou-api", contextId = "IBZDepartment", fallback = IBZDepartmentFallback.class)
public interface IBZDepartmentFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/select")
Page<IBZDepartment> select();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/save")
Boolean save(@RequestBody IBZDepartment ibzdepartment);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/save")
Boolean saveBatch(@RequestBody List<IBZDepartment> ibzdepartments);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{deptid}")
IBZDepartment get(@PathVariable("deptid") String deptid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{deptid}")
Boolean remove(@PathVariable("deptid") String deptid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/checkkey")
Boolean checkKey(@RequestBody IBZDepartment ibzdepartment);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{deptid}")
IBZDepartment update(@PathVariable("deptid") String deptid,@RequestBody IBZDepartment ibzdepartment);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/batch")
Boolean updateBatch(@RequestBody List<IBZDepartment> ibzdepartments);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments")
IBZDepartment create(@RequestBody IBZDepartment ibzdepartment);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/batch")
Boolean createBatch(@RequestBody List<IBZDepartment> ibzdepartments);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/getdraft")
IBZDepartment getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/searchcurdept")
Page<IBZDepartment> searchCurDept(@RequestBody IBZDepartmentSearchContext context);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/searchdefault")
Page<IBZDepartment> searchDefault(@RequestBody IBZDepartmentSearchContext context);
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZDeptMember;
import cn.ibizlab.core.ou.filter.IBZDeptMemberSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZDeptMember] 服务对象接口
*/
@Component
public class IBZDeptMemberFallback implements IBZDeptMemberFeignClient{
public Page<IBZDeptMember> select(){
return null;
}
public IBZDeptMember update(String memberid, IBZDeptMember ibzdeptmember){
return null;
}
public Boolean updateBatch(List<IBZDeptMember> ibzdeptmembers){
return false;
}
public IBZDeptMember get(String memberid){
return null;
}
public Boolean checkKey(IBZDeptMember ibzdeptmember){
return false;
}
public Boolean remove(String memberid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public IBZDeptMember create(IBZDeptMember ibzdeptmember){
return null;
}
public Boolean createBatch(List<IBZDeptMember> ibzdeptmembers){
return false;
}
public IBZDeptMember getDraft(){
return null;
}
public Boolean save(IBZDeptMember ibzdeptmember){
return false;
}
public Boolean saveBatch(List<IBZDeptMember> ibzdeptmembers){
return false;
}
public Page<IBZDeptMember> searchDefault(IBZDeptMemberSearchContext context){
return null;
}
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZDeptMember;
import cn.ibizlab.core.ou.filter.IBZDeptMemberSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZDeptMember] 服务对象接口
*/
@FeignClient(value = "ibzou-api", contextId = "IBZDeptMember", fallback = IBZDeptMemberFallback.class)
public interface IBZDeptMemberFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzdeptmembers/select")
Page<IBZDeptMember> select();
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdeptmembers/{memberid}")
IBZDeptMember update(@PathVariable("memberid") String memberid,@RequestBody IBZDeptMember ibzdeptmember);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdeptmembers/batch")
Boolean updateBatch(@RequestBody List<IBZDeptMember> ibzdeptmembers);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdeptmembers/{memberid}")
IBZDeptMember get(@PathVariable("memberid") String memberid);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/checkkey")
Boolean checkKey(@RequestBody IBZDeptMember ibzdeptmember);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdeptmembers/{memberid}")
Boolean remove(@PathVariable("memberid") String memberid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdeptmembers/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers")
IBZDeptMember create(@RequestBody IBZDeptMember ibzdeptmember);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/batch")
Boolean createBatch(@RequestBody List<IBZDeptMember> ibzdeptmembers);
@RequestMapping(method = RequestMethod.GET, value = "/ibzdeptmembers/getdraft")
IBZDeptMember getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/save")
Boolean save(@RequestBody IBZDeptMember ibzdeptmember);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/save")
Boolean saveBatch(@RequestBody List<IBZDeptMember> ibzdeptmembers);
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/searchdefault")
Page<IBZDeptMember> searchDefault(@RequestBody IBZDeptMemberSearchContext context);
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZEmployee;
import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZEmployee] 服务对象接口
*/
@Component
public class IBZEmployeeFallback implements IBZEmployeeFeignClient{
public Page<IBZEmployee> select(){
return null;
}
public Boolean remove(String userid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public IBZEmployee update(String userid, IBZEmployee ibzemployee){
return null;
}
public Boolean updateBatch(List<IBZEmployee> ibzemployees){
return false;
}
public Boolean checkKey(IBZEmployee ibzemployee){
return false;
}
public IBZEmployee get(String userid){
return null;
}
public Boolean save(IBZEmployee ibzemployee){
return false;
}
public Boolean saveBatch(List<IBZEmployee> ibzemployees){
return false;
}
public IBZEmployee initPwd( String userid, IBZEmployee ibzemployee){
return null;
}
public IBZEmployee getDraft(){
return null;
}
public IBZEmployee create(IBZEmployee ibzemployee){
return null;
}
public Boolean createBatch(List<IBZEmployee> ibzemployees){
return false;
}
public Page<IBZEmployee> searchDefault(IBZEmployeeSearchContext context){
return null;
}
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZEmployee;
import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZEmployee] 服务对象接口
*/
@FeignClient(value = "ibzou-api", contextId = "IBZEmployee", fallback = IBZEmployeeFallback.class)
public interface IBZEmployeeFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/select")
Page<IBZEmployee> select();
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/{userid}")
Boolean remove(@PathVariable("userid") String userid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/{userid}")
IBZEmployee update(@PathVariable("userid") String userid,@RequestBody IBZEmployee ibzemployee);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/batch")
Boolean updateBatch(@RequestBody List<IBZEmployee> ibzemployees);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/checkkey")
Boolean checkKey(@RequestBody IBZEmployee ibzemployee);
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{userid}")
IBZEmployee get(@PathVariable("userid") String userid);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/save")
Boolean save(@RequestBody IBZEmployee ibzemployee);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/save")
Boolean saveBatch(@RequestBody List<IBZEmployee> ibzemployees);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{userid}/initpwd")
IBZEmployee initPwd(@PathVariable("userid") String userid,@RequestBody IBZEmployee ibzemployee);
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/getdraft")
IBZEmployee getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees")
IBZEmployee create(@RequestBody IBZEmployee ibzemployee);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/batch")
Boolean createBatch(@RequestBody List<IBZEmployee> ibzemployees);
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/searchdefault")
Page<IBZEmployee> searchDefault(@RequestBody IBZEmployeeSearchContext context);
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZOrganization;
import cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[IBZOrganization] 服务对象接口
*/
@Component
public class IBZOrganizationFallback implements IBZOrganizationFeignClient{
public Page<IBZOrganization> select(){
return null;
}
public Boolean save(IBZOrganization ibzorganization){
return false;
}
public Boolean saveBatch(List<IBZOrganization> ibzorganizations){
return false;
}
public Boolean checkKey(IBZOrganization ibzorganization){
return false;
}
public IBZOrganization get(String orgid){
return null;
}
public IBZOrganization create(IBZOrganization ibzorganization){
return null;
}
public Boolean createBatch(List<IBZOrganization> ibzorganizations){
return false;
}
public Boolean remove(String orgid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public IBZOrganization getDraft(){
return null;
}
public IBZOrganization update(String orgid, IBZOrganization ibzorganization){
return null;
}
public Boolean updateBatch(List<IBZOrganization> ibzorganizations){
return false;
}
public Page<IBZOrganization> searchDefault(IBZOrganizationSearchContext context){
return null;
}
public Page<IBZOrganization> searchSelectPOrg(IBZOrganizationSearchContext context){
return null;
}
public Page<IBZOrganization> searchSelectSOrg(IBZOrganizationSearchContext context){
return null;
}
}
package cn.ibizlab.core.ou.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.ou.domain.IBZOrganization;
import cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[IBZOrganization] 服务对象接口
*/
@FeignClient(value = "ibzou-api", contextId = "IBZOrganization", fallback = IBZOrganizationFallback.class)
public interface IBZOrganizationFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/select")
Page<IBZOrganization> select();
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/save")
Boolean save(@RequestBody IBZOrganization ibzorganization);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/save")
Boolean saveBatch(@RequestBody List<IBZOrganization> ibzorganizations);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/checkkey")
Boolean checkKey(@RequestBody IBZOrganization ibzorganization);
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{orgid}")
IBZOrganization get(@PathVariable("orgid") String orgid);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations")
IBZOrganization create(@RequestBody IBZOrganization ibzorganization);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/batch")
Boolean createBatch(@RequestBody List<IBZOrganization> ibzorganizations);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{orgid}")
Boolean remove(@PathVariable("orgid") String orgid);
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/getdraft")
IBZOrganization getDraft();
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{orgid}")
IBZOrganization update(@PathVariable("orgid") String orgid,@RequestBody IBZOrganization ibzorganization);
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/batch")
Boolean updateBatch(@RequestBody List<IBZOrganization> ibzorganizations);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/searchdefault")
Page<IBZOrganization> searchDefault(@RequestBody IBZOrganizationSearchContext context);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/searchselectporg")
Page<IBZOrganization> searchSelectPOrg(@RequestBody IBZOrganizationSearchContext context);
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/searchselectsorg")
Page<IBZOrganization> searchSelectSOrg(@RequestBody IBZOrganizationSearchContext context);
}
......@@ -21,160 +21,152 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[部门]
* ServiceApi [部门] 对象
*/
@Data
@TableName(value = "IBZDEPT",resultMap = "IBZDepartmentResultMap")
public class IBZDepartment extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZDepartment extends EntityClient implements Serializable {
/**
* 部门标识
*/
@DEField(isKeyField=true)
@TableId(value= "deptid",type=IdType.UUID)
@JSONField(name = "deptid")
@JsonProperty("deptid")
private String deptid;
/**
* 部门代码
*/
@TableField(value = "deptcode")
@JSONField(name = "deptcode")
@JsonProperty("deptcode")
private String deptcode;
/**
* 部门名称
*/
@TableField(value = "deptname")
@JSONField(name = "deptname")
@JsonProperty("deptname")
private String deptname;
/**
* 单位
*/
@DEField(preType = DEPredefinedFieldType.ORGID)
@TableField(value = "orgid")
@JSONField(name = "orgid")
@JsonProperty("orgid")
private String orgid;
/**
* 上级部门
*/
@DEField(name = "pdeptid")
@TableField(value = "pdeptid")
@JSONField(name = "parentdeptid")
@JsonProperty("parentdeptid")
private String parentdeptid;
/**
* 部门简称
*/
@TableField(value = "shortname")
@JSONField(name = "shortname")
@JsonProperty("shortname")
private String shortname;
/**
* 部门级别
*/
@TableField(value = "deptlevel")
@JSONField(name = "deptlevel")
@JsonProperty("deptlevel")
private Integer deptlevel;
/**
* 排序
*/
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
private Integer showorder;
/**
* 业务编码
*/
@TableField(value = "bcode")
@JSONField(name = "bcode")
@JsonProperty("bcode")
private String bcode;
/**
* 分管领导标识
*/
@TableField(value = "leaderid")
@JSONField(name = "leaderid")
@JsonProperty("leaderid")
private String leaderid;
/**
* 分管领导
*/
@TableField(value = "leadername")
@JSONField(name = "leadername")
@JsonProperty("leadername")
private String leadername;
/**
* 逻辑有效
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 单位
*/
@TableField(exist = false)
@JSONField(name = "orgname")
@JsonProperty("orgname")
private String orgname;
/**
* 上级部门
*/
@TableField(exist = false)
@JSONField(name = "parentdeptname")
@JsonProperty("parentdeptname")
private String parentdeptname;
/**
* 创建时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 最后修改时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "parentdept")
@JsonProperty("parentdept")
private cn.ibizlab.core.ou.domain.IBZDepartment parentdept;
/**
* 单位
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "org")
@JsonProperty("org")
private cn.ibizlab.core.ou.domain.IBZOrganization org;
/**
* 设置 [部门代码]
*/
......
......@@ -21,75 +21,68 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[部门成员]
* ServiceApi [部门成员] 对象
*/
@Data
@TableName(value = "IBZDEPTMEMBER",resultMap = "IBZDeptMemberResultMap")
public class IBZDeptMember extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZDeptMember extends EntityClient implements Serializable {
/**
* 标识
*/
@DEField(isKeyField=true)
@TableId(value= "memberid",type=IdType.UUID)
@JSONField(name = "memberid")
@JsonProperty("memberid")
private String memberid;
/**
* 部门标识
*/
@TableField(value = "deptid")
@JSONField(name = "deptid")
@JsonProperty("deptid")
private String deptid;
/**
* 部门名称
*/
@TableField(exist = false)
@JSONField(name = "deptname")
@JsonProperty("deptname")
private String deptname;
/**
* 用户标识
*/
@TableField(value = "userid")
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 成员
*/
@TableField(exist = false)
@JSONField(name = "personname")
@JsonProperty("personname")
private String personname;
/**
* 部门
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "dept")
@JsonProperty("dept")
private cn.ibizlab.core.ou.domain.IBZDepartment dept;
/**
* 人员
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "emp")
@JsonProperty("emp")
private cn.ibizlab.core.ou.domain.IBZEmployee emp;
/**
* 设置 [部门标识]
*/
......@@ -105,22 +98,6 @@ public class IBZDeptMember extends EntityMP implements Serializable {
this.modify("userid",userid);
}
/**
* 获取 [标识]
*/
public String getMemberid(){
if(ObjectUtils.isEmpty(memberid)){
memberid=(String)getDefaultKey(true);
}
return memberid;
}
@Override
public Serializable getDefaultKey(boolean gen) {
if((!ObjectUtils.isEmpty(this.getDeptid()))&&(!ObjectUtils.isEmpty(this.getUserid())))
return DigestUtils.md5DigestAsHex(String.format("%s||%s" ,this.getDeptid(),this.getUserid()).getBytes());
return null;
}
}
......@@ -21,301 +21,293 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[人员]
* ServiceApi [人员] 对象
*/
@Data
@TableName(value = "IBZEMP",resultMap = "IBZEmployeeResultMap")
public class IBZEmployee extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZEmployee extends EntityClient implements Serializable {
/**
* 用户标识
*/
@DEField(isKeyField=true)
@TableId(value= "userid",type=IdType.UUID)
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 用户全局名
*/
@TableField(value = "username")
@JSONField(name = "username")
@JsonProperty("username")
private String username;
/**
* 姓名
*/
@TableField(value = "personname")
@JSONField(name = "personname")
@JsonProperty("personname")
private String personname;
/**
* 用户工号
*/
@TableField(value = "usercode")
@JSONField(name = "usercode")
@JsonProperty("usercode")
private String usercode;
/**
* 登录名
*/
@TableField(value = "loginname")
@JSONField(name = "loginname")
@JsonProperty("loginname")
private String loginname;
/**
* 密码
*/
@TableField(value = "password")
@JSONField(name = "password")
@JsonProperty("password")
private String password;
/**
* 区属
*/
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
private String domains;
/**
* 主部门
*/
@TableField(value = "mdeptid")
@JSONField(name = "mdeptid")
@JsonProperty("mdeptid")
private String mdeptid;
/**
* 主部门代码
*/
@TableField(value = "mdeptcode")
@JSONField(name = "mdeptcode")
@JsonProperty("mdeptcode")
private String mdeptcode;
/**
* 主部门名称
*/
@TableField(value = "mdeptname")
@JSONField(name = "mdeptname")
@JsonProperty("mdeptname")
private String mdeptname;
/**
* 业务编码
*/
@TableField(value = "bcode")
@JSONField(name = "bcode")
@JsonProperty("bcode")
private String bcode;
/**
* 岗位
*/
@TableField(value = "postid")
@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;
/**
* 单位
*/
@DEField(preType = DEPredefinedFieldType.ORGID)
@TableField(value = "orgid")
@JSONField(name = "orgid")
@JsonProperty("orgid")
private String orgid;
/**
* 单位代码
*/
@TableField(value = "orgcode")
@JSONField(name = "orgcode")
@JsonProperty("orgcode")
private String orgcode;
/**
* 单位名称
*/
@DEField(preType = DEPredefinedFieldType.ORGNAME)
@TableField(value = "orgname")
@JSONField(name = "orgname")
@JsonProperty("orgname")
private String orgname;
/**
* 昵称别名
*/
@TableField(value = "nickname")
@JSONField(name = "nickname")
@JsonProperty("nickname")
private String nickname;
/**
* 性别
*/
@TableField(value = "sex")
@JSONField(name = "sex")
@JsonProperty("sex")
private String sex;
/**
* 证件号码
*/
@TableField(value = "certcode")
@JSONField(name = "certcode")
@JsonProperty("certcode")
private String certcode;
/**
* 联系方式
*/
@TableField(value = "phone")
@JSONField(name = "phone")
@JsonProperty("phone")
private String phone;
/**
* 出生日期
*/
@TableField(value = "birthday")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "birthday" , format="yyyy-MM-dd")
@JsonProperty("birthday")
private Timestamp birthday;
/**
* 邮件
*/
@TableField(value = "email")
@JSONField(name = "email")
@JsonProperty("email")
private String email;
/**
* 社交账号
*/
@TableField(value = "avatar")
@JSONField(name = "avatar")
@JsonProperty("avatar")
private String avatar;
/**
* 地址
*/
@TableField(value = "addr")
@JSONField(name = "addr")
@JsonProperty("addr")
private String addr;
/**
* 照片
*/
@TableField(value = "usericon")
@JSONField(name = "usericon")
@JsonProperty("usericon")
private String usericon;
/**
* ip地址
*/
@TableField(value = "ipaddr")
@JSONField(name = "ipaddr")
@JsonProperty("ipaddr")
private String ipaddr;
/**
* 样式
*/
@TableField(value = "theme")
@JSONField(name = "theme")
@JsonProperty("theme")
private String theme;
/**
* 语言
*/
@TableField(value = "lang")
@JSONField(name = "lang")
@JsonProperty("lang")
private String lang;
/**
* 字号
*/
@TableField(value = "fontsize")
@JSONField(name = "fontsize")
@JsonProperty("fontsize")
private String fontsize;
/**
* 备注
*/
@TableField(value = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 保留
*/
@TableField(value = "reserver")
@JSONField(name = "reserver")
@JsonProperty("reserver")
private String reserver;
/**
* 排序
*/
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
private Integer showorder;
/**
* 逻辑有效
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 创建时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 最后修改时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "maindept")
@JsonProperty("maindept")
private cn.ibizlab.core.ou.domain.IBZDepartment maindept;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "org")
@JsonProperty("org")
private cn.ibizlab.core.ou.domain.IBZOrganization org;
/**
* 设置 [用户全局名]
*/
......
......@@ -21,125 +21,117 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[单位机构]
* ServiceApi [单位机构] 对象
*/
@Data
@TableName(value = "IBZORG",resultMap = "IBZOrganizationResultMap")
public class IBZOrganization extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class IBZOrganization extends EntityClient implements Serializable {
/**
* 单位标识
*/
@DEField(defaultValue = "orgcode" , defaultValueType = DEFieldDefaultValueType.PARAM , isKeyField=true)
@TableId(value= "orgid",type=IdType.UUID)
@JSONField(name = "orgid")
@JsonProperty("orgid")
private String orgid;
/**
* 单位代码
*/
@TableField(value = "orgcode")
@JSONField(name = "orgcode")
@JsonProperty("orgcode")
private String orgcode;
/**
* 名称
*/
@DEField(preType = DEPredefinedFieldType.ORGNAME)
@TableField(value = "orgname")
@JSONField(name = "orgname")
@JsonProperty("orgname")
private String orgname;
/**
* 上级单位
*/
@DEField(name = "porgid")
@TableField(value = "porgid")
@JSONField(name = "parentorgid")
@JsonProperty("parentorgid")
private String parentorgid;
/**
* 单位简称
*/
@TableField(value = "shortname")
@JSONField(name = "shortname")
@JsonProperty("shortname")
private String shortname;
/**
* 单位级别
*/
@TableField(value = "orglevel")
@JSONField(name = "orglevel")
@JsonProperty("orglevel")
private Integer orglevel;
/**
* 排序
*/
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
private Integer showorder;
/**
* 上级单位
*/
@TableField(exist = false)
@JSONField(name = "parentorgname")
@JsonProperty("parentorgname")
private String parentorgname;
/**
* 逻辑有效
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 创建时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 最后修改时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "parentorg")
@JsonProperty("parentorg")
private cn.ibizlab.core.ou.domain.IBZOrganization parentorg;
/**
* 部门
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "depts")
@JsonProperty("depts")
private List<cn.ibizlab.core.ou.domain.IBZDepartment> depts;
/**
* 设置 [单位代码]
*/
......
......@@ -17,92 +17,33 @@ 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.IBZDepartment;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZDepartment] 查询条件对象
* ServiceApi数据实体[IBZDepartment] 查询条件对象
*/
@Slf4j
@Data
public class IBZDepartmentSearchContext extends QueryWrapperContext<IBZDepartment> {
public class IBZDepartmentSearchContext extends SearchContextBase {
private String n_deptcode_like;//[部门代码]
public void setN_deptcode_like(String n_deptcode_like) {
this.n_deptcode_like = n_deptcode_like;
if(!ObjectUtils.isEmpty(this.n_deptcode_like)){
this.getSelectCond().like("deptcode", n_deptcode_like);
}
}
private String n_deptname_like;//[部门名称]
public void setN_deptname_like(String n_deptname_like) {
this.n_deptname_like = n_deptname_like;
if(!ObjectUtils.isEmpty(this.n_deptname_like)){
this.getSelectCond().like("deptname", n_deptname_like);
}
}
private String n_orgid_eq;//[单位]
public void setN_orgid_eq(String n_orgid_eq) {
this.n_orgid_eq = n_orgid_eq;
if(!ObjectUtils.isEmpty(this.n_orgid_eq)){
this.getSelectCond().eq("orgid", n_orgid_eq);
}
}
private String n_pdeptid_eq;//[上级部门]
public void setN_pdeptid_eq(String n_pdeptid_eq) {
this.n_pdeptid_eq = n_pdeptid_eq;
if(!ObjectUtils.isEmpty(this.n_pdeptid_eq)){
this.getSelectCond().eq("pdeptid", n_pdeptid_eq);
}
}
private String n_bcode_like;//[业务编码]
public void setN_bcode_like(String n_bcode_like) {
this.n_bcode_like = n_bcode_like;
if(!ObjectUtils.isEmpty(this.n_bcode_like)){
this.getSelectCond().like("bcode", n_bcode_like);
}
}
private String n_orgname_eq;//[单位]
public void setN_orgname_eq(String n_orgname_eq) {
this.n_orgname_eq = n_orgname_eq;
if(!ObjectUtils.isEmpty(this.n_orgname_eq)){
this.getSelectCond().eq("orgname", n_orgname_eq);
}
}
private String n_orgname_like;//[单位]
public void setN_orgname_like(String n_orgname_like) {
this.n_orgname_like = n_orgname_like;
if(!ObjectUtils.isEmpty(this.n_orgname_like)){
this.getSelectCond().like("orgname", n_orgname_like);
}
}
private String n_pdeptname_eq;//[上级部门]
public void setN_pdeptname_eq(String n_pdeptname_eq) {
this.n_pdeptname_eq = n_pdeptname_eq;
if(!ObjectUtils.isEmpty(this.n_pdeptname_eq)){
this.getSelectCond().eq("pdeptname", n_pdeptname_eq);
}
}
private String n_pdeptname_like;//[上级部门]
public void setN_pdeptname_like(String n_pdeptname_like) {
this.n_pdeptname_like = n_pdeptname_like;
if(!ObjectUtils.isEmpty(this.n_pdeptname_like)){
this.getSelectCond().like("pdeptname", n_pdeptname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("deptname",query);
}
}
}
}
......@@ -17,71 +17,27 @@ 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.IBZDeptMember;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZDeptMember] 查询条件对象
* ServiceApi数据实体[IBZDeptMember] 查询条件对象
*/
@Slf4j
@Data
public class IBZDeptMemberSearchContext extends QueryWrapperContext<IBZDeptMember> {
public class IBZDeptMemberSearchContext extends SearchContextBase {
private String n_deptid_eq;//[部门标识]
public void setN_deptid_eq(String n_deptid_eq) {
this.n_deptid_eq = n_deptid_eq;
if(!ObjectUtils.isEmpty(this.n_deptid_eq)){
this.getSelectCond().eq("deptid", n_deptid_eq);
}
}
private String n_deptname_eq;//[部门名称]
public void setN_deptname_eq(String n_deptname_eq) {
this.n_deptname_eq = n_deptname_eq;
if(!ObjectUtils.isEmpty(this.n_deptname_eq)){
this.getSelectCond().eq("deptname", n_deptname_eq);
}
}
private String n_deptname_like;//[部门名称]
public void setN_deptname_like(String n_deptname_like) {
this.n_deptname_like = n_deptname_like;
if(!ObjectUtils.isEmpty(this.n_deptname_like)){
this.getSelectCond().like("deptname", n_deptname_like);
}
}
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_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().or().like("personname",query);
}
}
}
......@@ -17,85 +17,31 @@ 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.IBZEmployee;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZEmployee] 查询条件对象
* ServiceApi数据实体[IBZEmployee] 查询条件对象
*/
@Slf4j
@Data
public class IBZEmployeeSearchContext extends QueryWrapperContext<IBZEmployee> {
public class IBZEmployeeSearchContext extends SearchContextBase {
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);
}
}
private String n_usercode_like;//[用户工号]
public void setN_usercode_like(String n_usercode_like) {
this.n_usercode_like = n_usercode_like;
if(!ObjectUtils.isEmpty(this.n_usercode_like)){
this.getSelectCond().like("usercode", n_usercode_like);
}
}
private String n_mdeptid_eq;//[主部门]
public void setN_mdeptid_eq(String n_mdeptid_eq) {
this.n_mdeptid_eq = n_mdeptid_eq;
if(!ObjectUtils.isEmpty(this.n_mdeptid_eq)){
this.getSelectCond().eq("mdeptid", n_mdeptid_eq);
}
}
private String n_mdeptname_like;//[主部门名称]
public void setN_mdeptname_like(String n_mdeptname_like) {
this.n_mdeptname_like = n_mdeptname_like;
if(!ObjectUtils.isEmpty(this.n_mdeptname_like)){
this.getSelectCond().like("mdeptname", n_mdeptname_like);
}
}
private String n_bcode_like;//[业务编码]
public void setN_bcode_like(String n_bcode_like) {
this.n_bcode_like = n_bcode_like;
if(!ObjectUtils.isEmpty(this.n_bcode_like)){
this.getSelectCond().like("bcode", n_bcode_like);
}
}
private String n_orgid_eq;//[单位]
public void setN_orgid_eq(String n_orgid_eq) {
this.n_orgid_eq = n_orgid_eq;
if(!ObjectUtils.isEmpty(this.n_orgid_eq)){
this.getSelectCond().eq("orgid", n_orgid_eq);
}
}
private String n_orgcode_leftlike;//[单位代码]
public void setN_orgcode_leftlike(String n_orgcode_leftlike) {
this.n_orgcode_leftlike = n_orgcode_leftlike;
if(!ObjectUtils.isEmpty(this.n_orgcode_leftlike)){
this.getSelectCond().likeRight("orgcode", n_orgcode_leftlike);
}
}
private String n_sex_eq;//[性别]
public void setN_sex_eq(String n_sex_eq) {
this.n_sex_eq = n_sex_eq;
if(!ObjectUtils.isEmpty(this.n_sex_eq)){
this.getSelectCond().eq("sex", n_sex_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("personname",query);
}
}
}
}
......@@ -17,92 +17,33 @@ 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.IBZOrganization;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[IBZOrganization] 查询条件对象
* ServiceApi数据实体[IBZOrganization] 查询条件对象
*/
@Slf4j
@Data
public class IBZOrganizationSearchContext extends QueryWrapperContext<IBZOrganization> {
public class IBZOrganizationSearchContext extends SearchContextBase {
private String n_orgid_like;//[单位标识]
public void setN_orgid_like(String n_orgid_like) {
this.n_orgid_like = n_orgid_like;
if(!ObjectUtils.isEmpty(this.n_orgid_like)){
this.getSelectCond().like("orgid", n_orgid_like);
}
}
private String n_orgcode_leftlike;//[单位代码]
public void setN_orgcode_leftlike(String n_orgcode_leftlike) {
this.n_orgcode_leftlike = n_orgcode_leftlike;
if(!ObjectUtils.isEmpty(this.n_orgcode_leftlike)){
this.getSelectCond().likeRight("orgcode", n_orgcode_leftlike);
}
}
private String n_orgname_like;//[名称]
public void setN_orgname_like(String n_orgname_like) {
this.n_orgname_like = n_orgname_like;
if(!ObjectUtils.isEmpty(this.n_orgname_like)){
this.getSelectCond().like("orgname", n_orgname_like);
}
}
private String n_porgid_eq;//[上级单位]
public void setN_porgid_eq(String n_porgid_eq) {
this.n_porgid_eq = n_porgid_eq;
if(!ObjectUtils.isEmpty(this.n_porgid_eq)){
this.getSelectCond().eq("porgid", n_porgid_eq);
}
}
private String n_shortname_like;//[单位简称]
public void setN_shortname_like(String n_shortname_like) {
this.n_shortname_like = n_shortname_like;
if(!ObjectUtils.isEmpty(this.n_shortname_like)){
this.getSelectCond().like("shortname", n_shortname_like);
}
}
private Integer n_orglevel_gtandeq;//[单位级别]
public void setN_orglevel_gtandeq(Integer n_orglevel_gtandeq) {
this.n_orglevel_gtandeq = n_orglevel_gtandeq;
if(!ObjectUtils.isEmpty(this.n_orglevel_gtandeq)){
this.getSelectCond().ge("orglevel", n_orglevel_gtandeq);
}
}
private Integer n_orglevel_ltandeq;//[单位级别]
public void setN_orglevel_ltandeq(Integer n_orglevel_ltandeq) {
this.n_orglevel_ltandeq = n_orglevel_ltandeq;
if(!ObjectUtils.isEmpty(this.n_orglevel_ltandeq)){
this.getSelectCond().le("orglevel", n_orglevel_ltandeq);
}
}
private String n_porgname_eq;//[上级单位]
public void setN_porgname_eq(String n_porgname_eq) {
this.n_porgname_eq = n_porgname_eq;
if(!ObjectUtils.isEmpty(this.n_porgname_eq)){
this.getSelectCond().eq("porgname", n_porgname_eq);
}
}
private String n_porgname_like;//[上级单位]
public void setN_porgname_like(String n_porgname_like) {
this.n_porgname_like = n_porgname_like;
if(!ObjectUtils.isEmpty(this.n_porgname_like)){
this.getSelectCond().like("porgname", n_porgname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("orgname",query);
}
}
}
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.ou.domain.IBZDepartment;
import cn.ibizlab.core.ou.filter.IBZDepartmentSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZDepartment] 服务对象接口
*/
public interface IIBZDepartmentService extends IService<IBZDepartment>{
public interface IIBZDepartmentService{
boolean save(IBZDepartment et) ;
@CacheEvict(value="ibzdepartment",allEntries=true)
......@@ -50,24 +48,8 @@ public interface IIBZDepartmentService extends IService<IBZDepartment>{
void removeByOrgid(String orgid) ;
@CacheEvict(value="ibzdepartment",allEntries=true)
void saveByOrgid(String orgid,List<IBZDepartment> list) ;
/**
*自定义查询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<IBZDepartment> getIbzdepartmentByIds(List<String> ids) ;
List<IBZDepartment> getIbzdepartmentByEntities(List<IBZDepartment> entities) ;
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.ou.domain.IBZDeptMember;
import cn.ibizlab.core.ou.filter.IBZDeptMemberSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZDeptMember] 服务对象接口
*/
public interface IIBZDeptMemberService extends IService<IBZDeptMember>{
public interface IIBZDeptMemberService{
boolean update(IBZDeptMember et) ;
void updateBatch(List<IBZDeptMember> list) ;
......@@ -41,22 +39,8 @@ public interface IIBZDeptMemberService extends IService<IBZDeptMember>{
void removeByDeptid(String deptid) ;
List<IBZDeptMember> selectByUserid(String userid) ;
void removeByUserid(String userid) ;
/**
*自定义查询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);
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.ou.domain.IBZEmployee;
import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZEmployee] 服务对象接口
*/
public interface IIBZEmployeeService extends IService<IBZEmployee>{
public interface IIBZEmployeeService{
boolean remove(String key) ;
@CacheEvict(value="ibzemployee",allEntries=true)
......@@ -48,24 +46,8 @@ public interface IIBZEmployeeService extends IService<IBZEmployee>{
List<IBZEmployee> selectByOrgid(String orgid) ;
@CacheEvict(value="ibzemployee",allEntries=true)
void removeByOrgid(String orgid) ;
/**
*自定义查询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<IBZEmployee> getIbzemployeeByIds(List<String> ids) ;
List<IBZEmployee> getIbzemployeeByEntities(List<IBZEmployee> entities) ;
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.ou.domain.IBZOrganization;
import cn.ibizlab.core.ou.filter.IBZOrganizationSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZOrganization] 服务对象接口
*/
public interface IIBZOrganizationService extends IService<IBZOrganization>{
public interface IIBZOrganizationService{
boolean save(IBZOrganization et) ;
@CacheEvict(value="ibzorganization",allEntries=true)
......@@ -46,24 +44,8 @@ public interface IIBZOrganizationService extends IService<IBZOrganization>{
List<IBZOrganization> selectByParentorgid(String orgid) ;
@CacheEvict(value="ibzorganization",allEntries=true)
void removeByParentorgid(String orgid) ;
/**
*自定义查询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<IBZOrganization> getIbzorganizationByIds(List<String> ids) ;
List<IBZOrganization> getIbzorganizationByEntities(List<IBZOrganization> entities) ;
}
......@@ -30,212 +30,139 @@ import cn.ibizlab.core.ou.service.IIBZDeptMemberService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZDeptMemberMapper;
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;
import cn.ibizlab.core.ou.client.IBZDeptMemberFeignClient;
/**
* 实体[部门成员] 服务对象接口实现
*/
@Slf4j
@Service("IBZDeptMemberServiceImpl")
public class IBZDeptMemberServiceImpl extends ServiceImpl<IBZDeptMemberMapper, IBZDeptMember> implements IIBZDeptMemberService {
@Service
public class IBZDeptMemberServiceImpl implements IIBZDeptMemberService {
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZDepartmentService ibzdepartmentService;
@Autowired
@Lazy
private cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
IBZDeptMemberFeignClient iBZDeptMemberFeignClient;
private int batchSize = 500;
@Override
@Transactional
public boolean update(IBZDeptMember et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("memberid",et.getMemberid())))
IBZDeptMember rt = iBZDeptMemberFeignClient.update(et.getMemberid(),et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getMemberid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void updateBatch(List<IBZDeptMember> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
public void updateBatch(List<IBZDeptMember> list){
iBZDeptMemberFeignClient.updateBatch(list) ;
}
@Override
@Transactional
public IBZDeptMember get(String key) {
IBZDeptMember et = getById(key);
public IBZDeptMember get(String memberid) {
IBZDeptMember et=iBZDeptMemberFeignClient.get(memberid);
if(et==null){
et=new IBZDeptMember();
et.setMemberid(key);
et.setMemberid(memberid);
}
else{
}
return et;
return et;
}
@Override
public boolean checkKey(IBZDeptMember et) {
return (!ObjectUtils.isEmpty(et.getMemberid()))&&(!Objects.isNull(this.getById(et.getMemberid())));
return iBZDeptMemberFeignClient.checkKey(et);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean remove(String memberid) {
boolean result=iBZDeptMemberFeignClient.remove(memberid) ;
return result;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void removeBatch(Collection<String> idList){
iBZDeptMemberFeignClient.removeBatch(idList);
}
@Override
@Transactional
public boolean create(IBZDeptMember et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
IBZDeptMember rt = iBZDeptMemberFeignClient.create(et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getMemberid()),et);
CachedBeanCopier.copy(rt,et);
return true;
}
@Override
public void createBatch(List<IBZDeptMember> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
public void createBatch(List<IBZDeptMember> list){
iBZDeptMemberFeignClient.createBatch(list) ;
}
@Override
public IBZDeptMember getDraft(IBZDeptMember et) {
fillParentData(et);
et=iBZDeptMemberFeignClient.getDraft();
return et;
}
@Override
@Transactional
public boolean save(IBZDeptMember et) {
if(!saveOrUpdate(et))
if(et.getMemberid()==null) et.setMemberid((String)et.getDefaultKey(true));
if(!iBZDeptMemberFeignClient.save(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZDeptMember et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBZDeptMember> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZDeptMember> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
iBZDeptMemberFeignClient.saveBatch(list) ;
}
@Override
public List<IBZDeptMember> selectByDeptid(String deptid) {
return baseMapper.selectByDeptid(deptid);
IBZDeptMemberSearchContext context=new IBZDeptMemberSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_deptid_eq(deptid);
return iBZDeptMemberFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByDeptid(String deptid) {
this.remove(new QueryWrapper<IBZDeptMember>().eq("deptid",deptid));
Set<String> delIds=new HashSet<String>();
for(IBZDeptMember before:selectByDeptid(deptid)){
delIds.add(before.getMemberid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Override
public List<IBZDeptMember> selectByUserid(String userid) {
return baseMapper.selectByUserid(userid);
IBZDeptMemberSearchContext context=new IBZDeptMemberSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_userid_eq(userid);
return iBZDeptMemberFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByUserid(String userid) {
this.remove(new QueryWrapper<IBZDeptMember>().eq("userid",userid));
Set<String> delIds=new HashSet<String>();
for(IBZDeptMember before:selectByUserid(userid)){
delIds.add(before.getMemberid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZDeptMember> searchDefault(IBZDeptMemberSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZDeptMember> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZDeptMember>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZDeptMember et){
//实体关系[DER1N_IBZDEPTMEMBER_IBZDEPT_DEPTID]
if(!ObjectUtils.isEmpty(et.getDeptid())){
cn.ibizlab.core.ou.domain.IBZDepartment dept=et.getDept();
if(ObjectUtils.isEmpty(dept)){
cn.ibizlab.core.ou.domain.IBZDepartment majorEntity=ibzdepartmentService.get(et.getDeptid());
et.setDept(majorEntity);
dept=majorEntity;
}
et.setDeptname(dept.getDeptname());
}
//实体关系[DER1N_IBZDEPTMEMBER_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());
}
}
@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;
Page<IBZDeptMember> iBZDeptMembers=iBZDeptMemberFeignClient.searchDefault(context);
return iBZDeptMembers;
}
......
package cn.ibizlab.core.uaa.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.uaa.domain.SysAuthLog;
import cn.ibizlab.core.uaa.filter.SysAuthLogSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[SysAuthLog] 服务对象接口
*/
@Component
public class SysAuthLogFallback implements SysAuthLogFeignClient{
public Page<SysAuthLog> select(){
return null;
}
public Boolean checkKey(SysAuthLog sysauthlog){
return false;
}
public Boolean remove(String logid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public SysAuthLog getDraft(){
return null;
}
public SysAuthLog update(String logid, SysAuthLog sysauthlog){
return null;
}
public Boolean updateBatch(List<SysAuthLog> sysauthlogs){
return false;
}
public Boolean save(SysAuthLog sysauthlog){
return false;
}
public Boolean saveBatch(List<SysAuthLog> sysauthlogs){
return false;
}
public SysAuthLog create(SysAuthLog sysauthlog){
return null;
}
public Boolean createBatch(List<SysAuthLog> sysauthlogs){
return false;
}
public SysAuthLog get(String logid){
return null;
}
public Page<SysAuthLog> searchDefault(SysAuthLogSearchContext context){
return null;
}
}
package cn.ibizlab.core.uaa.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.uaa.domain.SysAuthLog;
import cn.ibizlab.core.uaa.filter.SysAuthLogSearchContext;
import org.springframework.cloud.openfeign.FeignClient;
/**
* 实体[SysAuthLog] 服务对象接口
*/
@FeignClient(value = "ibzuaa-api", contextId = "SysAuthLog", fallback = SysAuthLogFallback.class)
public interface SysAuthLogFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/select")
Page<SysAuthLog> select();
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/checkkey")
Boolean checkKey(@RequestBody SysAuthLog sysauthlog);
@RequestMapping(method = RequestMethod.DELETE, value = "/sysauthlogs/{logid}")
Boolean remove(@PathVariable("logid") String logid);
@RequestMapping(method = RequestMethod.DELETE, value = "/sysauthlogs/batch}")
Boolean removeBatch(@RequestBody Collection<String> idList);
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/getdraft")
SysAuthLog getDraft();
@RequestMapping(method = RequestMethod.PUT, value = "/sysauthlogs/{logid}")
SysAuthLog update(@PathVariable("logid") String logid,@RequestBody SysAuthLog sysauthlog);
@RequestMapping(method = RequestMethod.PUT, value = "/sysauthlogs/batch")
Boolean updateBatch(@RequestBody List<SysAuthLog> sysauthlogs);
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/save")
Boolean save(@RequestBody SysAuthLog sysauthlog);
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/save")
Boolean saveBatch(@RequestBody List<SysAuthLog> sysauthlogs);
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs")
SysAuthLog create(@RequestBody SysAuthLog sysauthlog);
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/batch")
Boolean createBatch(@RequestBody List<SysAuthLog> sysauthlogs);
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/{logid}")
SysAuthLog get(@PathVariable("logid") String logid);
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/searchdefault")
Page<SysAuthLog> searchDefault(@RequestBody SysAuthLogSearchContext context);
}
package cn.ibizlab.core.uaa.client;
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 org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.core.uaa.domain.SysPSSystem;
import cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext;
import org.springframework.stereotype.Component;
/**
* 实体[SysPSSystem] 服务对象接口
*/
@Component
public class SysPSSystemFallback implements SysPSSystemFeignClient{
public Page<SysPSSystem> select(){
return null;
}
public SysPSSystem get(String pssystemid){
return null;
}
public SysPSSystem update(String pssystemid, SysPSSystem syspssystem){
return null;
}
public Boolean updateBatch(List<SysPSSystem> syspssystems){
return false;
}
public Boolean checkKey(SysPSSystem syspssystem){
return false;
}
public Boolean remove(String pssystemid){
return false;
}
public Boolean removeBatch(Collection<String> idList){
return false;
}
public SysPSSystem create(SysPSSystem syspssystem){
return null;
}
public Boolean createBatch(List<SysPSSystem> syspssystems){
return false;
}
public SysPSSystem getDraft(){
return null;
}
public Boolean save(SysPSSystem syspssystem){
return false;
}
public Boolean saveBatch(List<SysPSSystem> syspssystems){
return false;
}
public Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context){
return null;
}
}
......@@ -21,45 +21,40 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[实体]
* ServiceApi [实体] 对象
*/
@Data
@TableName(value = "IBZPSSYSTEM",resultMap = "SysPSSystemResultMap")
public class SysPSSystem extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class SysPSSystem extends EntityClient implements Serializable {
/**
* 系统标识
*/
@DEField(isKeyField=true)
@TableId(value= "pssystemid",type=IdType.UUID)
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
/**
* 系统名称
*/
@TableField(value = "pssystemname")
@JSONField(name = "pssystemname")
@JsonProperty("pssystemname")
private String pssystemname;
/**
* 结构
*/
@TableField(value = "sysstructure")
@JSONField(name = "sysstructure")
@JsonProperty("sysstructure")
private String sysstructure;
/**
* 设置 [系统名称]
*/
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册