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

xignzi006 发布系统代码

上级 119b1a25
......@@ -61,5 +61,15 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
public Purchase_order button_unlock(Purchase_order et) {
return super.button_unlock(et);
}
/**
* 自定义行为[Get_name]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public Purchase_order get_name(Purchase_order et) {
return super.get_name(et);
}
}
package cn.ibizlab.businesscentral.core.odoo_mail.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.businesscentral.util.helper.DataObject;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
/**
* 实体[关注消息类型]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",resultMap = "Mail_followers_mail_message_subtype_relResultMap")
public class Mail_followers_mail_message_subtype_rel extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@DEField(isKeyField=true)
@TableField(exist = false)
@JSONField(name = "id")
@JsonProperty("id")
private String id;
/**
* ID
*/
@DEField(name = "mail_followers_id")
@TableField(value = "mail_followers_id")
@JSONField(name = "mail_followers_id")
@JsonProperty("mail_followers_id")
private Long mailFollowersId;
/**
* ID
*/
@DEField(name = "mail_message_subtype_id")
@TableField(value = "mail_message_subtype_id")
@JSONField(name = "mail_message_subtype_id")
@JsonProperty("mail_message_subtype_id")
private Long mailMessageSubtypeId;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers odooMailFollowers;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message_subtype odooMailMessageSubtype;
/**
* 设置 [ID]
*/
public void setMailFollowersId(Long mailFollowersId){
this.mailFollowersId = mailFollowersId ;
this.modify("mail_followers_id",mailFollowersId);
}
/**
* 设置 [ID]
*/
public void setMailMessageSubtypeId(Long mailMessageSubtypeId){
this.mailMessageSubtypeId = mailMessageSubtypeId ;
this.modify("mail_message_subtype_id",mailMessageSubtypeId);
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("id");
return super.copyTo(targetEntity,bIncEmpty);
}
@TableField(exist = false)
@JsonIgnore
private String irmodel = "mail.followers.mail.message.subtype.rel" ;
@Override
public String getIrModel(){
return this.irmodel ;
}
}
package cn.ibizlab.businesscentral.core.odoo_mail.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers_mail_message_subtype_rel;
/**
* 关系型数据实体[Mail_followers_mail_message_subtype_rel] 查询条件对象
*/
@Slf4j
@Data
public class Mail_followers_mail_message_subtype_relSearchContext extends QueryWrapperContext<Mail_followers_mail_message_subtype_rel> {
private String n_id_like;//[ID]
public void setN_id_like(String n_id_like) {
this.n_id_like = n_id_like;
if(!ObjectUtils.isEmpty(this.n_id_like)){
this.getSearchCond().like("id", n_id_like);
}
}
private Long n_mail_followers_id_eq;//[ID]
public void setN_mail_followers_id_eq(Long n_mail_followers_id_eq) {
this.n_mail_followers_id_eq = n_mail_followers_id_eq;
if(!ObjectUtils.isEmpty(this.n_mail_followers_id_eq)){
this.getSearchCond().eq("mail_followers_id", n_mail_followers_id_eq);
}
}
private Long n_mail_message_subtype_id_eq;//[ID]
public void setN_mail_message_subtype_id_eq(Long n_mail_message_subtype_id_eq) {
this.n_mail_message_subtype_id_eq = n_mail_message_subtype_id_eq;
if(!ObjectUtils.isEmpty(this.n_mail_message_subtype_id_eq)){
this.getSearchCond().eq("mail_message_subtype_id", n_mail_message_subtype_id_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("id", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_mail.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers_mail_message_subtype_rel;
import cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_followers_mail_message_subtype_relSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface Mail_followers_mail_message_subtype_relMapper extends BaseMapper<Mail_followers_mail_message_subtype_rel>{
Page<Mail_followers_mail_message_subtype_rel> searchDefault(IPage page, @Param("srf") Mail_followers_mail_message_subtype_relSearchContext context, @Param("ew") Wrapper<Mail_followers_mail_message_subtype_rel> wrapper) ;
@Override
Mail_followers_mail_message_subtype_rel selectById(Serializable id);
@Override
int insert(Mail_followers_mail_message_subtype_rel entity);
@Override
int updateById(@Param(Constants.ENTITY) Mail_followers_mail_message_subtype_rel entity);
@Override
int update(@Param(Constants.ENTITY) Mail_followers_mail_message_subtype_rel entity, @Param("ew") Wrapper<Mail_followers_mail_message_subtype_rel> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Mail_followers_mail_message_subtype_rel> selectByMailFollowersId(@Param("id") Serializable id) ;
List<Mail_followers_mail_message_subtype_rel> selectByMailMessageSubtypeId(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_mail.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers_mail_message_subtype_rel;
import cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_followers_mail_message_subtype_relSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Mail_followers_mail_message_subtype_rel] 服务对象接口
*/
public interface IMail_followers_mail_message_subtype_relService extends IService<Mail_followers_mail_message_subtype_rel>{
boolean create(Mail_followers_mail_message_subtype_rel et) ;
void createBatch(List<Mail_followers_mail_message_subtype_rel> list) ;
boolean update(Mail_followers_mail_message_subtype_rel et) ;
void updateBatch(List<Mail_followers_mail_message_subtype_rel> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
Mail_followers_mail_message_subtype_rel get(String key) ;
Mail_followers_mail_message_subtype_rel getDraft(Mail_followers_mail_message_subtype_rel et) ;
boolean checkKey(Mail_followers_mail_message_subtype_rel et) ;
boolean save(Mail_followers_mail_message_subtype_rel et) ;
void saveBatch(List<Mail_followers_mail_message_subtype_rel> list) ;
Page<Mail_followers_mail_message_subtype_rel> searchDefault(Mail_followers_mail_message_subtype_relSearchContext context) ;
List<Mail_followers_mail_message_subtype_rel> selectByMailFollowersId(Long id) ;
void removeByMailFollowersId(Long id) ;
List<Mail_followers_mail_message_subtype_rel> selectByMailMessageSubtypeId(Long id) ;
void removeByMailMessageSubtypeId(Long id) ;
/**
*自定义查询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);
}
......@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("Mail_followersServiceImpl")
public class Mail_followersServiceImpl extends ServiceImpl<Mail_followersMapper, Mail_followers> implements IMail_followersService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_followers_mail_message_subtype_relService mailFollowersMailMessageSubtypeRelService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_channelService mailChannelService;
......
package cn.ibizlab.businesscentral.core.odoo_mail.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.beans.factory.annotation.Value;
import cn.ibizlab.businesscentral.util.errors.BadRequestAlertException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers_mail_message_subtype_rel;
import cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_followers_mail_message_subtype_relSearchContext;
import cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_followers_mail_message_subtype_relService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import cn.ibizlab.businesscentral.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.odoo_mail.mapper.Mail_followers_mail_message_subtype_relMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[关注消息类型] 服务对象接口实现
*/
@Slf4j
@Service("Mail_followers_mail_message_subtype_relServiceImpl")
public class Mail_followers_mail_message_subtype_relServiceImpl extends ServiceImpl<Mail_followers_mail_message_subtype_relMapper, Mail_followers_mail_message_subtype_rel> implements IMail_followers_mail_message_subtype_relService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_followersService mailFollowersService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_message_subtypeService mailMessageSubtypeService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Mail_followers_mail_message_subtype_rel et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<Mail_followers_mail_message_subtype_rel> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Mail_followers_mail_message_subtype_rel et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void updateBatch(List<Mail_followers_mail_message_subtype_rel> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Mail_followers_mail_message_subtype_rel get(String key) {
Mail_followers_mail_message_subtype_rel et = getById(key);
if(et==null){
et=new Mail_followers_mail_message_subtype_rel();
et.setId(key);
}
else{
}
return et;
}
@Override
public Mail_followers_mail_message_subtype_rel getDraft(Mail_followers_mail_message_subtype_rel et) {
return et;
}
@Override
public boolean checkKey(Mail_followers_mail_message_subtype_rel et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Mail_followers_mail_message_subtype_rel et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Mail_followers_mail_message_subtype_rel et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Mail_followers_mail_message_subtype_rel> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Mail_followers_mail_message_subtype_rel> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Mail_followers_mail_message_subtype_rel> selectByMailFollowersId(Long id) {
return baseMapper.selectByMailFollowersId(id);
}
@Override
public void removeByMailFollowersId(Long id) {
this.remove(new QueryWrapper<Mail_followers_mail_message_subtype_rel>().eq("mail_followers_id",id));
}
@Override
public List<Mail_followers_mail_message_subtype_rel> selectByMailMessageSubtypeId(Long id) {
return baseMapper.selectByMailMessageSubtypeId(id);
}
@Override
public void removeByMailMessageSubtypeId(Long id) {
this.remove(new QueryWrapper<Mail_followers_mail_message_subtype_rel>().eq("mail_message_subtype_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Mail_followers_mail_message_subtype_rel> searchDefault(Mail_followers_mail_message_subtype_relSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Mail_followers_mail_message_subtype_rel> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Mail_followers_mail_message_subtype_rel>(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;
}
}
......@@ -54,6 +54,9 @@ public class Mail_message_subtypeServiceImpl extends ServiceImpl<Mail_message_su
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_compose_messageService mailComposeMessageService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_followers_mail_message_subtype_relService mailFollowersMailMessageSubtypeRelService;
protected cn.ibizlab.businesscentral.core.odoo_mail.service.IMail_message_subtypeService mailMessageSubtypeService = this;
@Autowired
......
......@@ -85,6 +85,10 @@ public class purchase_orderFallback implements purchase_orderFeignClient{
}
public Purchase_order get_name( Long id, Purchase_order purchase_order){
return null;
}
public Boolean save(Purchase_order purchase_order){
return false;
}
......
......@@ -80,6 +80,10 @@ public interface purchase_orderFeignClient {
Boolean checkKey(@RequestBody Purchase_order purchase_order);
@RequestMapping(method = RequestMethod.GET, value = "/purchase_orders/{id}/get_name")
Purchase_order get_name(@PathVariable("id") Long id,@RequestBody Purchase_order purchase_order);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/save")
Boolean save(@RequestBody Purchase_order purchase_order);
......
......@@ -39,6 +39,7 @@ public interface IPurchase_orderService extends IService<Purchase_order>{
Purchase_order button_done(Purchase_order et) ;
Purchase_order button_unlock(Purchase_order et) ;
boolean checkKey(Purchase_order et) ;
Purchase_order get_name(Purchase_order et) ;
boolean save(Purchase_order et) ;
void saveBatch(List<Purchase_order> list) ;
Page<Purchase_order> searchDefault(Purchase_orderSearchContext context) ;
......
......@@ -88,12 +88,17 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_stock.service.IStock_picking_typeService stockPickingTypeService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.IPurchase_orderget_nameLogic get_nameLogic;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Purchase_order et) {
fillParentData(et);
get_nameLogic.execute(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
......@@ -188,6 +193,13 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
public boolean checkKey(Purchase_order et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public Purchase_order get_name(Purchase_order et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean save(Purchase_order et) {
......
package cn.ibizlab.businesscentral.core.odoo_purchase.service.logic;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
/**
* 关系型数据实体[get_name] 对象
*/
public interface IPurchase_orderget_nameLogic {
void execute(Purchase_order et) ;
}
package cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.impl;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.IPurchase_orderget_nameLogic;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
/**
* 关系型数据实体[get_name] 对象
*/
@Slf4j
@Service
public class Purchase_orderget_nameLogicImpl implements IPurchase_orderget_nameLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService purchase_orderservice;
public cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService getPurchase_orderService() {
return this.purchase_orderservice;
}
@Autowired
private cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Purchase_order et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("purchase_orderget_namedefault",et);
kieSession.setGlobal("purchase_orderservice",purchase_orderservice);
kieSession.setGlobal("iBzSysPurchase_orderDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_orderget_name");
}catch(Exception e){
throw new RuntimeException("执行[获取订单编号]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -585,6 +585,9 @@
<!--输出实体[MAIL_FOLLOWERS]数据结构 -->
<!--输出实体[MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL]数据结构 -->
<!--输出实体[MAIL_MAIL]数据结构 -->
......@@ -1414,6 +1417,7 @@
<!--输出实体[MAIL_CHANNEL_PARTNER]外键关系 -->
<!--输出实体[MAIL_COMPOSE_MESSAGE]外键关系 -->
<!--输出实体[MAIL_FOLLOWERS]外键关系 -->
<!--输出实体[MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL]外键关系 -->
<!--输出实体[MAIL_MAIL]外键关系 -->
<!--输出实体[MAIL_MAIL_STATISTICS]外键关系 -->
<!--输出实体[MAIL_MASS_MAILING]外键关系 -->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_mail.mapper.Mail_followers_mail_message_subtype_relMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Mail_followers_mail_message_subtype_relResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.MAIL_FOLLOWERS_ID, t1.MAIL_MESSAGE_SUBTYPE_ID FROM MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Mail_followers_mail_message_subtype_relResultMap" type="cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers_mail_message_subtype_rel" autoMapping="true">
<result property="mailFollowersId" column="mail_followers_id" />
<result property="mailMessageSubtypeId" column="mail_message_subtype_id" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooMailFollowers" javaType="cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_followers" column="mail_followers_id" select="cn.ibizlab.businesscentral.core.odoo_mail.mapper.Mail_followersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooMailMessageSubtype" javaType="cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message_subtype" column="mail_message_subtype_id" select="cn.ibizlab.businesscentral.core.odoo_mail.mapper.Mail_message_subtypeMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_FOLLOWERS_MAIL_FOLLOWERS_ID] -->
<select id="selectByMailFollowersId" resultMap="Mail_followers_mail_message_subtype_relResultMap">
select t1.* from (
<include refid="Default" />
) t1
where mail_followers_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_MESSAGE_SUBTYPE_MAIL_MESSAGE_SUBTYPE_ID] -->
<select id="selectByMailMessageSubtypeId" resultMap="Mail_followers_mail_message_subtype_relResultMap">
select t1.* from (
<include refid="Default" />
) t1
where mail_message_subtype_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_followers_mail_message_subtype_relSearchContext" resultMap="Mail_followers_mail_message_subtype_relResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.MAIL_FOLLOWERS_ID, t1.MAIL_MESSAGE_SUBTYPE_ID FROM MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.MAIL_FOLLOWERS_ID, t1.MAIL_MESSAGE_SUBTYPE_ID FROM MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL t1
]]>
</sql>
</mapper>
package cn.ibizlab.businesscentral.odoo_purchase.logic.purchase_orderlogic.get_name;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import cn.ibizlab.businesscentral.util.errors.BadRequestAlertException;
global cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order purchase_orderget_namedefault;
global cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService purchase_orderservice;
global cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService iBzSysPurchase_orderDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[获取订单编号]
rule "deaction1"
ruleflow-group "purchase_orderget_namedeaction1"
when
then
purchase_orderservice.get_name(purchase_orderget_namedefault);
update(purchase_orderget_namedefault);//更新fact中变量值
end
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "purchase_orderget_namebegin"
when
then
end
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_orderget_name" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_orderget_name">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="cn.ibizlab.businesscentral.util.helper.RuleUtils"/>
<tns:global identifier="purchase_orderget_namedefault" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order" />
</extensionElements>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="purchase_orderget_namedeaction1" id="deaction1" implementation="http://www.jboss.org/drools/rule" name="获取订单编号"/>
<endEvent id="deaction1_end" name="end"/>
<sequenceFlow id="deaction1_end_line" sourceRef="deaction1" targetRef="deaction1_end"/>
<startEvent id="begin" isInterrupting="true"/>
<sequenceFlow id="begin_deaction1" sourceRef="begin" targetRef="deaction1">
</sequenceFlow>
</process>
</definitions>
......@@ -79212,6 +79212,12 @@
}
],
"subEntitys":[
{"name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_FOLLOWERS_MAIL_FOLLOWERS_ID",
"relation_type":"DER1N",
"code_name":"Odoo_mail_followers",
"entity_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"ref_entity_name":"MAIL_FOLLOWERS"
}
],
"parentEntitys":[
{"name":"DER1N_MAIL_FOLLOWERS__MAIL_CHANNEL__CHANNEL_ID",
......@@ -79227,6 +79233,78 @@
"ref_entity_name":"RES_PARTNER"
}
]
}
,
{
"entity_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"logic_name":"关注消息类型",
"code_name":"Mail_followers_mail_message_subtype_rel",
"table_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"ID",
"entity_name":"Mail_followers_mail_message_subtype_rel",
"field_type":"GUID",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":200,
"key_field":1,
"major_field":1
},
{
"fieldname":"MAIL_FOLLOWERS_ID" ,
"codename":"Mail_followers_id",
"field_logic_name":"ID",
"entity_name":"Mail_followers_mail_message_subtype_rel",
"ref_de":"MAIL_FOLLOWERS",
"ref_field_name":"ID",
"relation_name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_FOLLOWERS_MAIL_FOLLOWERS_ID",
"relation_codename":"Odoo_mail_followers",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"MAIL_MESSAGE_SUBTYPE_ID" ,
"codename":"Mail_message_subtype_id",
"field_logic_name":"ID",
"entity_name":"Mail_followers_mail_message_subtype_rel",
"ref_de":"MAIL_MESSAGE_SUBTYPE",
"ref_field_name":"ID",
"relation_name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_MESSAGE_SUBTYPE_MAIL_MESSAGE_SUBTYPE_ID",
"relation_codename":"Odoo_mail_message_subtype",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_FOLLOWERS_MAIL_FOLLOWERS_ID",
"relation_type":"DER1N",
"code_name":"Odoo_mail_followers",
"entity_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"ref_entity_name":"MAIL_FOLLOWERS"
},
{"name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_MESSAGE_SUBTYPE_MAIL_MESSAGE_SUBTYPE_ID",
"relation_type":"DER1N",
"code_name":"Odoo_mail_message_subtype",
"entity_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"ref_entity_name":"MAIL_MESSAGE_SUBTYPE"
}
]
}
,
{
......@@ -84965,6 +85043,12 @@
"entity_name":"MAIL_COMPOSE_MESSAGE",
"ref_entity_name":"MAIL_MESSAGE_SUBTYPE"
},
{"name":"DER1N_MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL_MAIL_MESSAGE_SUBTYPE_MAIL_MESSAGE_SUBTYPE_ID",
"relation_type":"DER1N",
"code_name":"Odoo_mail_message_subtype",
"entity_name":"MAIL_FOLLOWERS_MAIL_MESSAGE_SUBTYPE_REL",
"ref_entity_name":"MAIL_MESSAGE_SUBTYPE"
},
{"name":"DER1N_MAIL_MESSAGE_SUBTYPE__MAIL_MESSAGE_SUBTYPE__PARENT_ID",
"relation_type":"DER1N",
"code_name":"Odoo_parent",
......@@ -165,6 +165,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Get_name-all')")
@ApiOperation(value = "获取订单编号", tags = {"采购订单" }, notes = "获取订单编号")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_orders/{purchase_order_id}/get_name")
public ResponseEntity<Purchase_orderDTO> get_name(@PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setId(purchase_order_id);
domain = purchase_orderService.get_name(domain);
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "保存采购订单", tags = {"采购订单" }, notes = "保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/save")
......@@ -355,6 +366,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Get_name-all')")
@ApiOperation(value = "根据采购申请采购订单", tags = {"采购订单" }, notes = "根据采购申请采购订单")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/get_name")
public ResponseEntity<Purchase_orderDTO> get_nameByPurchase_requisition(@PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.get_name(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据采购申请保存采购订单", tags = {"采购订单" }, notes = "根据采购申请保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_requisitions/{purchase_requisition_id}/purchase_orders/save")
......@@ -552,6 +574,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Get_name-all')")
@ApiOperation(value = "根据供应商采购订单", tags = {"采购订单" }, notes = "根据供应商采购订单")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/purchase_orders/{purchase_order_id}/get_name")
public ResponseEntity<Purchase_orderDTO> get_nameByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_supplier_id);
domain = purchase_orderService.get_name(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据供应商保存采购订单", tags = {"采购订单" }, notes = "根据供应商保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_orders/save")
......@@ -749,6 +782,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Get_name-all')")
@ApiOperation(value = "根据供应商采购申请采购订单", tags = {"采购订单" }, notes = "根据供应商采购申请采购订单")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/get_name")
public ResponseEntity<Purchase_orderDTO> get_nameByRes_supplierPurchase_requisition(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.get_name(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据供应商采购申请保存采购订单", tags = {"采购订单" }, notes = "根据供应商采购申请保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/save")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册