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

xignzi006 发布系统代码

上级 cac9d02b
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.ActivityMimeatTachment;
import cn.ibizlab.businesscentral.core.base.filter.ActivityMimeatTachmentSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IActivityMimeatTachmentService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.ActivityMimeatTachmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[活动时间附件] 服务对象接口实现
*/
@Slf4j
@Service("ActivityMimeatTachmentServiceImpl")
public class ActivityMimeatTachmentServiceImpl extends ServiceImpl<ActivityMimeatTachmentMapper, ActivityMimeatTachment> implements IActivityMimeatTachmentService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(ActivityMimeatTachment et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivitymimeattachmentid()),et);
return true;
}
@Override
public void createBatch(List<ActivityMimeatTachment> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(ActivityMimeatTachment et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activitymimeattachmentid",et.getActivitymimeattachmentid())))
return false;
CachedBeanCopier.copy(get(et.getActivitymimeattachmentid()),et);
return true;
}
@Override
public void updateBatch(List<ActivityMimeatTachment> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public ActivityMimeatTachment get(String key) {
ActivityMimeatTachment et = getById(key);
if(et==null){
et=new ActivityMimeatTachment();
et.setActivitymimeattachmentid(key);
}
else{
}
return et;
}
@Override
public ActivityMimeatTachment getDraft(ActivityMimeatTachment et) {
return et;
}
@Override
public boolean checkKey(ActivityMimeatTachment et) {
return (!ObjectUtils.isEmpty(et.getActivitymimeattachmentid()))&&(!Objects.isNull(this.getById(et.getActivitymimeattachmentid())));
}
@Override
@Transactional
public boolean save(ActivityMimeatTachment et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(ActivityMimeatTachment et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<ActivityMimeatTachment> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<ActivityMimeatTachment> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<ActivityMimeatTachment> searchDefault(ActivityMimeatTachmentSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityMimeatTachment> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<ActivityMimeatTachment>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<ActivityMimeatTachment> getActivitymimeattachmentByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<ActivityMimeatTachment> getActivitymimeattachmentByEntities(List<ActivityMimeatTachment> entities) {
List ids =new ArrayList();
for(ActivityMimeatTachment entity : entities){
Serializable id=entity.getActivitymimeattachmentid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.ActivityParty;
import cn.ibizlab.businesscentral.core.base.filter.ActivityPartySearchContext;
import cn.ibizlab.businesscentral.core.base.service.IActivityPartyService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.ActivityPartyMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[活动方] 服务对象接口实现
*/
@Slf4j
@Service("ActivityPartyServiceImpl")
public class ActivityPartyServiceImpl extends ServiceImpl<ActivityPartyMapper, ActivityParty> implements IActivityPartyService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IActivityPointerService activitypointerService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IResourceSpecService resourcespecService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(ActivityParty et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivitypartyid()),et);
return true;
}
@Override
public void createBatch(List<ActivityParty> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(ActivityParty et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activitypartyid",et.getActivitypartyid())))
return false;
CachedBeanCopier.copy(get(et.getActivitypartyid()),et);
return true;
}
@Override
public void updateBatch(List<ActivityParty> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public ActivityParty get(String key) {
ActivityParty et = getById(key);
if(et==null){
et=new ActivityParty();
et.setActivitypartyid(key);
}
else{
}
return et;
}
@Override
public ActivityParty getDraft(ActivityParty et) {
return et;
}
@Override
public boolean checkKey(ActivityParty et) {
return (!ObjectUtils.isEmpty(et.getActivitypartyid()))&&(!Objects.isNull(this.getById(et.getActivitypartyid())));
}
@Override
@Transactional
public boolean save(ActivityParty et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(ActivityParty et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<ActivityParty> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<ActivityParty> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<ActivityParty> selectByActivityid(String activityid) {
return baseMapper.selectByActivityid(activityid);
}
@Override
public void removeByActivityid(String activityid) {
this.remove(new QueryWrapper<ActivityParty>().eq("activityid",activityid));
}
@Override
public List<ActivityParty> selectByResourcespecid(String resourcespecid) {
return baseMapper.selectByResourcespecid(resourcespecid);
}
@Override
public void removeByResourcespecid(String resourcespecid) {
this.remove(new QueryWrapper<ActivityParty>().eq("resourcespecid",resourcespecid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<ActivityParty> searchDefault(ActivityPartySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityParty> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<ActivityParty>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<ActivityParty> getActivitypartyByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<ActivityParty> getActivitypartyByEntities(List<ActivityParty> entities) {
List ids =new ArrayList();
for(ActivityParty entity : entities){
Serializable id=entity.getActivitypartyid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.ActivityPointer;
import cn.ibizlab.businesscentral.core.base.filter.ActivityPointerSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IActivityPointerService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.ActivityPointerMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[活动] 服务对象接口实现
*/
@Slf4j
@Service("ActivityPointerServiceImpl")
public class ActivityPointerServiceImpl extends ServiceImpl<ActivityPointerMapper, ActivityPointer> implements IActivityPointerService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IActivityPartyService activitypartyService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.runtime.service.IBulkOperationLogService bulkoperationlogService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIBizServiceService ibizserviceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(ActivityPointer et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void createBatch(List<ActivityPointer> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(ActivityPointer et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activityid",et.getActivityid())))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void updateBatch(List<ActivityPointer> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public ActivityPointer get(String key) {
ActivityPointer et = getById(key);
if(et==null){
et=new ActivityPointer();
et.setActivityid(key);
}
else{
}
return et;
}
@Override
public ActivityPointer getDraft(ActivityPointer et) {
return et;
}
@Override
public boolean checkKey(ActivityPointer et) {
return (!ObjectUtils.isEmpty(et.getActivityid()))&&(!Objects.isNull(this.getById(et.getActivityid())));
}
@Override
@Transactional
public boolean save(ActivityPointer et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(ActivityPointer et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<ActivityPointer> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<ActivityPointer> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<ActivityPointer> selectByServiceid(String serviceid) {
return baseMapper.selectByServiceid(serviceid);
}
@Override
public void removeByServiceid(String serviceid) {
this.remove(new QueryWrapper<ActivityPointer>().eq("serviceid",serviceid));
}
@Override
public List<ActivityPointer> selectBySlaid(String slaid) {
return baseMapper.selectBySlaid(slaid);
}
@Override
public void removeBySlaid(String slaid) {
this.remove(new QueryWrapper<ActivityPointer>().eq("slaid",slaid));
}
@Override
public List<ActivityPointer> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<ActivityPointer>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 ByParentKey
*/
@Override
public Page<ActivityPointer> searchByParentKey(ActivityPointerSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityPointer> pages=baseMapper.searchByParentKey(context.getPages(),context,context.getSelectCond());
return new PageImpl<ActivityPointer>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<ActivityPointer> searchDefault(ActivityPointerSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ActivityPointer> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<ActivityPointer>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<ActivityPointer> getActivitypointerByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<ActivityPointer> getActivitypointerByEntities(List<ActivityPointer> entities) {
List ids =new ArrayList();
for(ActivityPointer entity : entities){
Serializable id=entity.getActivityid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Annotation;
import cn.ibizlab.businesscentral.core.base.filter.AnnotationSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IAnnotationService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.AnnotationMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[注释] 服务对象接口实现
*/
@Slf4j
@Service("AnnotationServiceImpl")
public class AnnotationServiceImpl extends ServiceImpl<AnnotationMapper, Annotation> implements IAnnotationService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Annotation et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getAnnotationid()),et);
return true;
}
@Override
public void createBatch(List<Annotation> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Annotation et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("annotationid",et.getAnnotationid())))
return false;
CachedBeanCopier.copy(get(et.getAnnotationid()),et);
return true;
}
@Override
public void updateBatch(List<Annotation> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Annotation get(String key) {
Annotation et = getById(key);
if(et==null){
et=new Annotation();
et.setAnnotationid(key);
}
else{
}
return et;
}
@Override
public Annotation getDraft(Annotation et) {
return et;
}
@Override
public boolean checkKey(Annotation et) {
return (!ObjectUtils.isEmpty(et.getAnnotationid()))&&(!Objects.isNull(this.getById(et.getAnnotationid())));
}
@Override
@Transactional
public boolean save(Annotation et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Annotation et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Annotation> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Annotation> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Annotation> searchDefault(AnnotationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Annotation> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Annotation>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Annotation> getAnnotationByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Annotation> getAnnotationByEntities(List<Annotation> entities) {
List ids =new ArrayList();
for(Annotation entity : entities){
Serializable id=entity.getAnnotationid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Appointment;
import cn.ibizlab.businesscentral.core.base.filter.AppointmentSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IAppointmentService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.AppointmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[约会] 服务对象接口实现
*/
@Slf4j
@Service("AppointmentServiceImpl")
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements IAppointmentService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIBizServiceService ibizserviceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Appointment et) {
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void createBatch(List<Appointment> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Appointment et) {
activitypointerService.update(appointmentInheritMapping.toActivitypointer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activityid",et.getActivityid())))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void updateBatch(List<Appointment> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Appointment get(String key) {
Appointment et = getById(key);
if(et==null){
et=new Appointment();
et.setActivityid(key);
}
else{
}
return et;
}
@Override
public Appointment getDraft(Appointment et) {
return et;
}
@Override
public boolean checkKey(Appointment et) {
return (!ObjectUtils.isEmpty(et.getActivityid()))&&(!Objects.isNull(this.getById(et.getActivityid())));
}
@Override
@Transactional
public boolean save(Appointment et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Appointment et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Appointment> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Appointment> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Appointment> selectByServiceid(String serviceid) {
return baseMapper.selectByServiceid(serviceid);
}
@Override
public void removeByServiceid(String serviceid) {
this.remove(new QueryWrapper<Appointment>().eq("serviceid",serviceid));
}
@Override
public List<Appointment> selectBySlaid(String slaid) {
return baseMapper.selectBySlaid(slaid);
}
@Override
public void removeBySlaid(String slaid) {
this.remove(new QueryWrapper<Appointment>().eq("slaid",slaid));
}
@Override
public List<Appointment> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<Appointment>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Appointment> searchDefault(AppointmentSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Appointment> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Appointment>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Autowired
cn.ibizlab.businesscentral.core.base.mapping.AppointmentInheritMapping appointmentInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IActivityPointerService activitypointerService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(Appointment et){
if(ObjectUtils.isEmpty(et.getActivityid()))
et.setActivityid((String)et.getDefaultKey(true));
cn.ibizlab.businesscentral.core.base.domain.ActivityPointer activitypointer =appointmentInheritMapping.toActivitypointer(et);
activitypointer.set("activitytypecode","APPOINTMENT");
activitypointerService.create(activitypointer);
}
@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<Appointment> getAppointmentByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Appointment> getAppointmentByEntities(List<Appointment> entities) {
List ids =new ArrayList();
for(Appointment entity : entities){
Serializable id=entity.getActivityid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.BusinessUnitNewsArticle;
import cn.ibizlab.businesscentral.core.base.filter.BusinessUnitNewsArticleSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IBusinessUnitNewsArticleService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.BusinessUnitNewsArticleMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[公告] 服务对象接口实现
*/
@Slf4j
@Service("BusinessUnitNewsArticleServiceImpl")
public class BusinessUnitNewsArticleServiceImpl extends ServiceImpl<BusinessUnitNewsArticleMapper, BusinessUnitNewsArticle> implements IBusinessUnitNewsArticleService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(BusinessUnitNewsArticle et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getBusinessunitnewsarticleid()),et);
return true;
}
@Override
public void createBatch(List<BusinessUnitNewsArticle> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(BusinessUnitNewsArticle et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("businessunitnewsarticleid",et.getBusinessunitnewsarticleid())))
return false;
CachedBeanCopier.copy(get(et.getBusinessunitnewsarticleid()),et);
return true;
}
@Override
public void updateBatch(List<BusinessUnitNewsArticle> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public BusinessUnitNewsArticle get(String key) {
BusinessUnitNewsArticle et = getById(key);
if(et==null){
et=new BusinessUnitNewsArticle();
et.setBusinessunitnewsarticleid(key);
}
else{
}
return et;
}
@Override
public BusinessUnitNewsArticle getDraft(BusinessUnitNewsArticle et) {
return et;
}
@Override
public boolean checkKey(BusinessUnitNewsArticle et) {
return (!ObjectUtils.isEmpty(et.getBusinessunitnewsarticleid()))&&(!Objects.isNull(this.getById(et.getBusinessunitnewsarticleid())));
}
@Override
@Transactional
public boolean save(BusinessUnitNewsArticle et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(BusinessUnitNewsArticle et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<BusinessUnitNewsArticle> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<BusinessUnitNewsArticle> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<BusinessUnitNewsArticle> searchDefault(BusinessUnitNewsArticleSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<BusinessUnitNewsArticle> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<BusinessUnitNewsArticle>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<BusinessUnitNewsArticle> getBusinessunitnewsarticleByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<BusinessUnitNewsArticle> getBusinessunitnewsarticleByEntities(List<BusinessUnitNewsArticle> entities) {
List ids =new ArrayList();
for(BusinessUnitNewsArticle entity : entities){
Serializable id=entity.getBusinessunitnewsarticleid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.BusinessUnit;
import cn.ibizlab.businesscentral.core.base.filter.BusinessUnitSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IBusinessUnitService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.BusinessUnitMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[业务部门] 服务对象接口实现
*/
@Slf4j
@Service("BusinessUnitServiceImpl")
public class BusinessUnitServiceImpl extends ServiceImpl<BusinessUnitMapper, BusinessUnit> implements IBusinessUnitService {
protected cn.ibizlab.businesscentral.core.base.service.IBusinessUnitService businessunitService = this;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ICalendarService calendarService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IConstraintBasedGroupService constraintbasedgroupService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IEquipmentService equipmentService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.runtime.service.IQueueService queueService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IResourceGroupService resourcegroupService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IResourceSpecService resourcespecService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IResourceService resourceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaKpiInstanceService slakpiinstanceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITeamService teamService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(BusinessUnit et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getBusinessunitid()),et);
return true;
}
@Override
public void createBatch(List<BusinessUnit> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(BusinessUnit et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("businessunitid",et.getBusinessunitid())))
return false;
CachedBeanCopier.copy(get(et.getBusinessunitid()),et);
return true;
}
@Override
public void updateBatch(List<BusinessUnit> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public BusinessUnit get(String key) {
BusinessUnit et = getById(key);
if(et==null){
et=new BusinessUnit();
et.setBusinessunitid(key);
}
else{
}
return et;
}
@Override
public BusinessUnit getDraft(BusinessUnit et) {
return et;
}
@Override
public boolean checkKey(BusinessUnit et) {
return (!ObjectUtils.isEmpty(et.getBusinessunitid()))&&(!Objects.isNull(this.getById(et.getBusinessunitid())));
}
@Override
@Transactional
public boolean save(BusinessUnit et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(BusinessUnit et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<BusinessUnit> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<BusinessUnit> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<BusinessUnit> selectByParentbusinessunitid(String businessunitid) {
return baseMapper.selectByParentbusinessunitid(businessunitid);
}
@Override
public void removeByParentbusinessunitid(String businessunitid) {
this.remove(new QueryWrapper<BusinessUnit>().eq("parentbusinessunitid",businessunitid));
}
@Override
public List<BusinessUnit> selectByCalendarid(String calendarid) {
return baseMapper.selectByCalendarid(calendarid);
}
@Override
public void removeByCalendarid(String calendarid) {
this.remove(new QueryWrapper<BusinessUnit>().eq("calendarid",calendarid));
}
@Override
public List<BusinessUnit> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<BusinessUnit>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<BusinessUnit> searchDefault(BusinessUnitSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<BusinessUnit> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<BusinessUnit>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<BusinessUnit> getBusinessunitByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<BusinessUnit> getBusinessunitByEntities(List<BusinessUnit> entities) {
List ids =new ArrayList();
for(BusinessUnit entity : entities){
Serializable id=entity.getBusinessunitid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Calendar;
import cn.ibizlab.businesscentral.core.base.filter.CalendarSearchContext;
import cn.ibizlab.businesscentral.core.base.service.ICalendarService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.CalendarMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[日历] 服务对象接口实现
*/
@Slf4j
@Service("CalendarServiceImpl")
public class CalendarServiceImpl extends ServiceImpl<CalendarMapper, Calendar> implements ICalendarService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.scheduling.service.IBookableResourceService bookableresourceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IBusinessUnitService businessunitService;
protected cn.ibizlab.businesscentral.core.base.service.ICalendarService calendarService = this;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IEquipmentService equipmentService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Calendar et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getCalendarid()),et);
return true;
}
@Override
public void createBatch(List<Calendar> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Calendar et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("calendarid",et.getCalendarid())))
return false;
CachedBeanCopier.copy(get(et.getCalendarid()),et);
return true;
}
@Override
public void updateBatch(List<Calendar> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Calendar get(String key) {
Calendar et = getById(key);
if(et==null){
et=new Calendar();
et.setCalendarid(key);
}
else{
}
return et;
}
@Override
public Calendar getDraft(Calendar et) {
return et;
}
@Override
public boolean checkKey(Calendar et) {
return (!ObjectUtils.isEmpty(et.getCalendarid()))&&(!Objects.isNull(this.getById(et.getCalendarid())));
}
@Override
@Transactional
public boolean save(Calendar et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Calendar et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Calendar> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Calendar> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Calendar> selectByBusinessunitid(String businessunitid) {
return baseMapper.selectByBusinessunitid(businessunitid);
}
@Override
public void removeByBusinessunitid(String businessunitid) {
this.remove(new QueryWrapper<Calendar>().eq("businessunitid",businessunitid));
}
@Override
public List<Calendar> selectByHolidayschedulecalendarid(String calendarid) {
return baseMapper.selectByHolidayschedulecalendarid(calendarid);
}
@Override
public void removeByHolidayschedulecalendarid(String calendarid) {
this.remove(new QueryWrapper<Calendar>().eq("holidayschedulecalendarid",calendarid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Calendar> searchDefault(CalendarSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Calendar> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Calendar>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Calendar> getCalendarByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Calendar> getCalendarByEntities(List<Calendar> entities) {
List ids =new ArrayList();
for(Calendar entity : entities){
Serializable id=entity.getCalendarid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Category;
import cn.ibizlab.businesscentral.core.base.filter.CategorySearchContext;
import cn.ibizlab.businesscentral.core.base.service.ICategoryService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.CategoryMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[类别] 服务对象接口实现
*/
@Slf4j
@Service("CategoryServiceImpl")
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements ICategoryService {
protected cn.ibizlab.businesscentral.core.base.service.ICategoryService categoryService = this;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Category et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getCategoryid()),et);
return true;
}
@Override
public void createBatch(List<Category> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Category et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("categoryid",et.getCategoryid())))
return false;
CachedBeanCopier.copy(get(et.getCategoryid()),et);
return true;
}
@Override
public void updateBatch(List<Category> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Category get(String key) {
Category et = getById(key);
if(et==null){
et=new Category();
et.setCategoryid(key);
}
else{
}
return et;
}
@Override
public Category getDraft(Category et) {
return et;
}
@Override
public boolean checkKey(Category et) {
return (!ObjectUtils.isEmpty(et.getCategoryid()))&&(!Objects.isNull(this.getById(et.getCategoryid())));
}
@Override
@Transactional
public boolean save(Category et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Category et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Category> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Category> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Category> selectByParentcategoryid(String categoryid) {
return baseMapper.selectByParentcategoryid(categoryid);
}
@Override
public void removeByParentcategoryid(String categoryid) {
this.remove(new QueryWrapper<Category>().eq("parentcategoryid",categoryid));
}
@Override
public List<Category> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<Category>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Category> searchDefault(CategorySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Category> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Category>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Category> getCategoryByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Category> getCategoryByEntities(List<Category> entities) {
List ids =new ArrayList();
for(Category entity : entities){
Serializable id=entity.getCategoryid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.CustomerAddress;
import cn.ibizlab.businesscentral.core.base.filter.CustomerAddressSearchContext;
import cn.ibizlab.businesscentral.core.base.service.ICustomerAddressService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.CustomerAddressMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[地址] 服务对象接口实现
*/
@Slf4j
@Service("CustomerAddressServiceImpl")
public class CustomerAddressServiceImpl extends ServiceImpl<CustomerAddressMapper, CustomerAddress> implements ICustomerAddressService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IContractDetailService contractdetailService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IContractService contractService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(CustomerAddress et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getCustomeraddressid()),et);
return true;
}
@Override
public void createBatch(List<CustomerAddress> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(CustomerAddress et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("customeraddressid",et.getCustomeraddressid())))
return false;
CachedBeanCopier.copy(get(et.getCustomeraddressid()),et);
return true;
}
@Override
public void updateBatch(List<CustomerAddress> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public CustomerAddress get(String key) {
CustomerAddress et = getById(key);
if(et==null){
et=new CustomerAddress();
et.setCustomeraddressid(key);
}
else{
}
return et;
}
@Override
public CustomerAddress getDraft(CustomerAddress et) {
return et;
}
@Override
public boolean checkKey(CustomerAddress et) {
return (!ObjectUtils.isEmpty(et.getCustomeraddressid()))&&(!Objects.isNull(this.getById(et.getCustomeraddressid())));
}
@Override
@Transactional
public boolean save(CustomerAddress et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(CustomerAddress et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<CustomerAddress> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<CustomerAddress> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<CustomerAddress> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<CustomerAddress>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<CustomerAddress> searchDefault(CustomerAddressSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CustomerAddress> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<CustomerAddress>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<CustomerAddress> getCustomeraddressByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<CustomerAddress> getCustomeraddressByEntities(List<CustomerAddress> entities) {
List ids =new ArrayList();
for(CustomerAddress entity : entities){
Serializable id=entity.getCustomeraddressid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Email;
import cn.ibizlab.businesscentral.core.base.filter.EmailSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IEmailService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.EmailMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[电子邮件] 服务对象接口实现
*/
@Slf4j
@Service("EmailServiceImpl")
public class EmailServiceImpl extends ServiceImpl<EmailMapper, Email> implements IEmailService {
protected cn.ibizlab.businesscentral.core.base.service.IEmailService emailService = this;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIBizServiceService ibizserviceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITemplateService templateService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Email et) {
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void createBatch(List<Email> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Email et) {
activitypointerService.update(emailInheritMapping.toActivitypointer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activityid",et.getActivityid())))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void updateBatch(List<Email> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Email get(String key) {
Email et = getById(key);
if(et==null){
et=new Email();
et.setActivityid(key);
}
else{
}
return et;
}
@Override
public Email getDraft(Email et) {
return et;
}
@Override
public boolean checkKey(Email et) {
return (!ObjectUtils.isEmpty(et.getActivityid()))&&(!Objects.isNull(this.getById(et.getActivityid())));
}
@Override
@Transactional
public boolean save(Email et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Email et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Email> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Email> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Email> selectByParentactivityid(String activityid) {
return baseMapper.selectByParentactivityid(activityid);
}
@Override
public void removeByParentactivityid(String activityid) {
this.remove(new QueryWrapper<Email>().eq("parentactivityid",activityid));
}
@Override
public List<Email> selectByServiceid(String serviceid) {
return baseMapper.selectByServiceid(serviceid);
}
@Override
public void removeByServiceid(String serviceid) {
this.remove(new QueryWrapper<Email>().eq("serviceid",serviceid));
}
@Override
public List<Email> selectBySlaid(String slaid) {
return baseMapper.selectBySlaid(slaid);
}
@Override
public void removeBySlaid(String slaid) {
this.remove(new QueryWrapper<Email>().eq("slaid",slaid));
}
@Override
public List<Email> selectByTemplateid(String templateid) {
return baseMapper.selectByTemplateid(templateid);
}
@Override
public void removeByTemplateid(String templateid) {
this.remove(new QueryWrapper<Email>().eq("templateid",templateid));
}
@Override
public List<Email> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<Email>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Email> searchDefault(EmailSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Email> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Email>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Autowired
cn.ibizlab.businesscentral.core.base.mapping.EmailInheritMapping emailInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IActivityPointerService activitypointerService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(Email et){
if(ObjectUtils.isEmpty(et.getActivityid()))
et.setActivityid((String)et.getDefaultKey(true));
cn.ibizlab.businesscentral.core.base.domain.ActivityPointer activitypointer =emailInheritMapping.toActivitypointer(et);
activitypointer.set("activitytypecode","EMAIL");
activitypointerService.create(activitypointer);
}
@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<Email> getEmailByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Email> getEmailByEntities(List<Email> entities) {
List ids =new ArrayList();
for(Email entity : entities){
Serializable id=entity.getActivityid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Fax;
import cn.ibizlab.businesscentral.core.base.filter.FaxSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IFaxService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.FaxMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[传真] 服务对象接口实现
*/
@Slf4j
@Service("FaxServiceImpl")
public class FaxServiceImpl extends ServiceImpl<FaxMapper, Fax> implements IFaxService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIBizServiceService ibizserviceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ISlaService slaService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Fax et) {
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void createBatch(List<Fax> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Fax et) {
activitypointerService.update(faxInheritMapping.toActivitypointer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("activityid",et.getActivityid())))
return false;
CachedBeanCopier.copy(get(et.getActivityid()),et);
return true;
}
@Override
public void updateBatch(List<Fax> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Fax get(String key) {
Fax et = getById(key);
if(et==null){
et=new Fax();
et.setActivityid(key);
}
else{
}
return et;
}
@Override
public Fax getDraft(Fax et) {
return et;
}
@Override
public boolean checkKey(Fax et) {
return (!ObjectUtils.isEmpty(et.getActivityid()))&&(!Objects.isNull(this.getById(et.getActivityid())));
}
@Override
@Transactional
public boolean save(Fax et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Fax et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Fax> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Fax> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Fax> selectByServiceid(String serviceid) {
return baseMapper.selectByServiceid(serviceid);
}
@Override
public void removeByServiceid(String serviceid) {
this.remove(new QueryWrapper<Fax>().eq("serviceid",serviceid));
}
@Override
public List<Fax> selectBySlaid(String slaid) {
return baseMapper.selectBySlaid(slaid);
}
@Override
public void removeBySlaid(String slaid) {
this.remove(new QueryWrapper<Fax>().eq("slaid",slaid));
}
@Override
public List<Fax> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<Fax>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Fax> searchDefault(FaxSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Fax> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Fax>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Autowired
cn.ibizlab.businesscentral.core.base.mapping.FaxInheritMapping faxInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IActivityPointerService activitypointerService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(Fax et){
if(ObjectUtils.isEmpty(et.getActivityid()))
et.setActivityid((String)et.getDefaultKey(true));
cn.ibizlab.businesscentral.core.base.domain.ActivityPointer activitypointer =faxInheritMapping.toActivitypointer(et);
activitypointer.set("activitytypecode","FAX");
activitypointerService.create(activitypointer);
}
@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<Fax> getFaxByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Fax> getFaxByEntities(List<Fax> entities) {
List ids =new ArrayList();
for(Fax entity : entities){
Serializable id=entity.getActivityid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.Feedback;
import cn.ibizlab.businesscentral.core.base.filter.FeedbackSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IFeedbackService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.FeedbackMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[反馈] 服务对象接口实现
*/
@Slf4j
@Service("FeedbackServiceImpl")
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.IContactService contactService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Feedback et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getFeedbackid()),et);
return true;
}
@Override
public void createBatch(List<Feedback> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Feedback et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("feedbackid",et.getFeedbackid())))
return false;
CachedBeanCopier.copy(get(et.getFeedbackid()),et);
return true;
}
@Override
public void updateBatch(List<Feedback> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Feedback get(String key) {
Feedback et = getById(key);
if(et==null){
et=new Feedback();
et.setFeedbackid(key);
}
else{
}
return et;
}
@Override
public Feedback getDraft(Feedback et) {
return et;
}
@Override
public boolean checkKey(Feedback et) {
return (!ObjectUtils.isEmpty(et.getFeedbackid()))&&(!Objects.isNull(this.getById(et.getFeedbackid())));
}
@Override
@Transactional
public boolean save(Feedback et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Feedback et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Feedback> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Feedback> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Feedback> selectByCreatedbycontact(String contactid) {
return baseMapper.selectByCreatedbycontact(contactid);
}
@Override
public void removeByCreatedbycontact(String contactid) {
this.remove(new QueryWrapper<Feedback>().eq("createdbycontact",contactid));
}
@Override
public List<Feedback> selectByCreatedonbehalfbycontact(String contactid) {
return baseMapper.selectByCreatedonbehalfbycontact(contactid);
}
@Override
public void removeByCreatedonbehalfbycontact(String contactid) {
this.remove(new QueryWrapper<Feedback>().eq("createdonbehalfbycontact",contactid));
}
@Override
public List<Feedback> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<Feedback>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Feedback> searchDefault(FeedbackSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Feedback> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Feedback>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Feedback> getFeedbackByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Feedback> getFeedbackByEntities(List<Feedback> entities) {
List ids =new ArrayList();
for(Feedback entity : entities){
Serializable id=entity.getFeedbackid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
!!!!模版产生代码错误:Syntax error in template "CODETEMPL_zh_CN" in line 43, column 13:
Encountered "<", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
"["
"("
"{"
<ID>
\ No newline at end of file
package cn.ibizlab.businesscentral.core.base.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.base.domain.IBizAudit;
import cn.ibizlab.businesscentral.core.base.filter.IBizAuditSearchContext;
import cn.ibizlab.businesscentral.core.base.service.IIBizAuditService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.base.mapper.IBizAuditMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[审核] 服务对象接口实现
*/
@Slf4j
@Service("IBizAuditServiceImpl")
public class IBizAuditServiceImpl extends ServiceImpl<IBizAuditMapper, IBizAudit> implements IIBizAuditService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(IBizAudit et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getAuditid()),et);
return true;
}
@Override
public void createBatch(List<IBizAudit> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(IBizAudit et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("auditid",et.getAuditid())))
return false;
CachedBeanCopier.copy(get(et.getAuditid()),et);
return true;
}
@Override
public void updateBatch(List<IBizAudit> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public IBizAudit get(String key) {
IBizAudit et = getById(key);
if(et==null){
et=new IBizAudit();
et.setAuditid(key);
}
else{
}
return et;
}
@Override
public IBizAudit getDraft(IBizAudit et) {
return et;
}
@Override
public boolean checkKey(IBizAudit et) {
return (!ObjectUtils.isEmpty(et.getAuditid()))&&(!Objects.isNull(this.getById(et.getAuditid())));
}
@Override
@Transactional
public boolean save(IBizAudit et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBizAudit et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<IBizAudit> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBizAudit> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBizAudit> searchDefault(IBizAuditSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBizAudit> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBizAudit>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<IBizAudit> getIbizauditByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<IBizAudit> getIbizauditByEntities(List<IBizAudit> entities) {
List ids =new ArrayList();
for(IBizAudit entity : entities){
Serializable id=entity.getAuditid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册