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

xignzi006 发布系统代码

上级 721a0dc9
server:
port: 8080
#zuul网关路由设置
zuul:
routes:
loginv7:
path: /v7/login
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
changepwd:
path: /v7/changepwd
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
uaa:
path: /uaa/**
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
config:
path: /config/**
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
oucore:
path: /ibzorganizations/**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
oudict:
path: /dictionarys/**/Ibzou**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
ou:
path: /ibzdepartments/**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
uaadict:
path: /dictionarys/**/SysOperator
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
dict:
path: /dictionarys/**
serviceId: ${ibiz.ref.service.dict:ibzdict-api}
stripPrefix: false
disk:
path: /net-disk/**
serviceId: ${ibiz.ref.service.disk:ibzdisk-api}
stripPrefix: false
ou_sys_org:
path: /sysorganizations/**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
ou_sys_dept:
path: /sysdepartments/**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
lite-core:
path: /lite/**
serviceId: ${ibiz.ref.service.lite:ibzlite-api}
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
......@@ -80,6 +80,9 @@ public class Account_analytic_accountServiceImpl extends ServiceImpl<Account_ana
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_reportService purchaseReportService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_sale.service.ISale_orderService saleOrderService;
@Autowired
@Lazy
......
......@@ -1172,6 +1172,22 @@ public class Res_partner extends EntityMP implements Serializable {
@JSONField(name = "country_id")
@JsonProperty("country_id")
private Long countryId;
/**
* supplier rank
*/
@DEField(name = "supplier_rank")
@TableField(value = "supplier_rank")
@JSONField(name = "supplier_rank")
@JsonProperty("supplier_rank")
private Integer supplierRank;
/**
* customer rank
*/
@DEField(name = "customer_rank")
@TableField(value = "customer_rank")
@JSONField(name = "customer_rank")
@JsonProperty("customer_rank")
private Integer customerRank;
/**
*
......@@ -1799,6 +1815,22 @@ public class Res_partner extends EntityMP implements Serializable {
this.modify("country_id",countryId);
}
/**
* 设置 [supplier rank]
*/
public void setSupplierRank(Integer supplierRank){
this.supplierRank = supplierRank ;
this.modify("supplier_rank",supplierRank);
}
/**
* 设置 [customer rank]
*/
public void setCustomerRank(Integer customerRank){
this.customerRank = customerRank ;
this.modify("customer_rank",customerRank);
}
@Override
public Serializable getDefaultKey(boolean gen) {
......
package cn.ibizlab.businesscentral.core.odoo_base.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.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 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 = "RES_PARTNER",resultMap = "Res_supplierResultMap")
public class Res_supplier extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.AUTO)
@JSONField(name = "id")
@JsonProperty("id")
private Long id;
/**
* 名称
*/
@TableField(value = "name")
@JSONField(name = "name")
@JsonProperty("name")
private String name;
/**
* 设置 [名称]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
@Override
public Serializable getDefaultKey(boolean gen) {
return IdWorker.getId();
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("id");
return super.copyTo(targetEntity,bIncEmpty);
}
}
package cn.ibizlab.businesscentral.core.odoo_base.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier;
/**
* 关系型数据实体[Res_supplier] 查询条件对象
*/
@Slf4j
@Data
public class Res_supplierSearchContext extends QueryWrapperContext<Res_supplier> {
private String n_name_like;//[名称]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_base.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier;
import cn.ibizlab.businesscentral.core.odoo_base.filter.Res_supplierSearchContext;
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 Res_supplierMapper extends BaseMapper<Res_supplier>{
Page<Res_supplier> searchDefault(IPage page, @Param("srf") Res_supplierSearchContext context, @Param("ew") Wrapper<Res_supplier> wrapper) ;
@Override
Res_supplier selectById(Serializable id);
@Override
int insert(Res_supplier entity);
@Override
int updateById(@Param(Constants.ENTITY) Res_supplier entity);
@Override
int update(@Param(Constants.ENTITY) Res_supplier entity, @Param("ew") Wrapper<Res_supplier> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.odoo_base.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier;
import cn.ibizlab.businesscentral.core.odoo_base.filter.Res_supplierSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Res_supplier] 服务对象接口
*/
public interface IRes_supplierService extends IService<Res_supplier>{
boolean create(Res_supplier et) ;
void createBatch(List<Res_supplier> list) ;
boolean update(Res_supplier et) ;
void updateBatch(List<Res_supplier> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Res_supplier get(Long key) ;
Res_supplier getDraft(Res_supplier et) ;
boolean checkKey(Res_supplier et) ;
boolean save(Res_supplier et) ;
void saveBatch(List<Res_supplier> list) ;
Page<Res_supplier> searchDefault(Res_supplierSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
......@@ -248,6 +248,9 @@ public class Res_companyServiceImpl extends ServiceImpl<Res_companyMapper, Res_c
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_reportService purchaseReportService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_repair.service.IRepair_orderService repairOrderService;
@Autowired
@Lazy
......
package cn.ibizlab.businesscentral.core.odoo_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.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_base.domain.Res_supplier;
import cn.ibizlab.businesscentral.core.odoo_base.filter.Res_supplierSearchContext;
import cn.ibizlab.businesscentral.core.odoo_base.service.IRes_supplierService;
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_base.mapper.Res_supplierMapper;
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("Res_supplierServiceImpl")
public class Res_supplierServiceImpl extends ServiceImpl<Res_supplierMapper, Res_supplier> implements IRes_supplierService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Res_supplier et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<Res_supplier> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Res_supplier 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<Res_supplier> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(Long key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<Long> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Res_supplier get(Long key) {
Res_supplier et = getById(key);
if(et==null){
et=new Res_supplier();
et.setId(key);
}
else{
}
return et;
}
@Override
public Res_supplier getDraft(Res_supplier et) {
return et;
}
@Override
public boolean checkKey(Res_supplier et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Res_supplier et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Res_supplier et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Res_supplier> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Res_supplier> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 数据集
*/
@Override
public Page<Res_supplier> searchDefault(Res_supplierSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Res_supplier> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Res_supplier>(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;
}
}
......@@ -860,6 +860,15 @@ public class Res_usersServiceImpl extends ServiceImpl<Res_usersMapper, Res_users
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_reportService purchaseReportService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisitionService purchaseRequisitionService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_typeService purchaseRequisitionTypeService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_rating.service.IRating_ratingService ratingRatingService;
@Autowired
@Lazy
......
......@@ -116,6 +116,9 @@ public class Product_productServiceImpl extends ServiceImpl<Product_productMappe
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_reportService purchaseReportService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_repair.service.IRepair_feeService repairFeeService;
@Autowired
@Lazy
......
package cn.ibizlab.businesscentral.core.odoo_purchase.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 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 = "PURCHASE_REQUISITION",resultMap = "Purchase_requisitionResultMap")
public class Purchase_requisition extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.AUTO)
@JSONField(name = "id")
@JsonProperty("id")
private Long id;
/**
* 申请编号
*/
@TableField(value = "name")
@JSONField(name = "name")
@JsonProperty("name")
private String name;
/**
* 创建时间
*/
@DEField(name = "create_date")
@TableField(value = "create_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "create_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("create_date")
private Timestamp createDate;
/**
* 最后更新时间
*/
@DEField(name = "write_date")
@TableField(value = "write_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "write_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("write_date")
private Timestamp writeDate;
/**
* 最后更新人
*/
@DEField(name = "write_uid")
@TableField(value = "write_uid")
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
private Long writeUid;
/**
* 创建人
*/
@DEField(name = "create_uid")
@TableField(value = "create_uid")
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
private Long createUid;
/**
* 最后更新人
*/
@TableField(exist = false)
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
private String writeUname;
/**
* 创建人
*/
@TableField(exist = false)
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
private String createUname;
/**
* 最后修改日
*/
@TableField(exist = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
* 活动状态
*/
@DEField(name = "activity_state")
@TableField(value = "activity_state")
@JSONField(name = "activity_state")
@JsonProperty("activity_state")
private String activityState;
/**
* 下一活动截止日期
*/
@DEField(name = "activity_date_deadline")
@TableField(value = "activity_date_deadline")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "activity_date_deadline" , format="yyyy-MM-dd")
@JsonProperty("activity_date_deadline")
private Timestamp activityDateDeadline;
/**
* 源单据
*/
@TableField(value = "origin")
@JSONField(name = "origin")
@JsonProperty("origin")
private String origin;
/**
* 采购订单数
*/
@DEField(name = "order_count")
@TableField(value = "order_count")
@JSONField(name = "order_count")
@JsonProperty("order_count")
private Integer orderCount;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite;
/**
* 设置 [申请编号]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [创建时间]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 格式化日期 [创建时间]
*/
public String formatCreateDate(){
if (this.createDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(createDate);
}
/**
* 设置 [最后更新时间]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
/**
* 格式化日期 [最后更新时间]
*/
public String formatWriteDate(){
if (this.writeDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(writeDate);
}
/**
* 设置 [最后更新人]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [创建人]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
/**
* 设置 [活动状态]
*/
public void setActivityState(String activityState){
this.activityState = activityState ;
this.modify("activity_state",activityState);
}
/**
* 设置 [下一活动截止日期]
*/
public void setActivityDateDeadline(Timestamp activityDateDeadline){
this.activityDateDeadline = activityDateDeadline ;
this.modify("activity_date_deadline",activityDateDeadline);
}
/**
* 格式化日期 [下一活动截止日期]
*/
public String formatActivityDateDeadline(){
if (this.activityDateDeadline == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(activityDateDeadline);
}
/**
* 设置 [源单据]
*/
public void setOrigin(String origin){
this.origin = origin ;
this.modify("origin",origin);
}
/**
* 设置 [采购订单数]
*/
public void setOrderCount(Integer orderCount){
this.orderCount = orderCount ;
this.modify("order_count",orderCount);
}
@Override
public Serializable getDefaultKey(boolean gen) {
return IdWorker.getId();
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("id");
return super.copyTo(targetEntity,bIncEmpty);
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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 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 = "PURCHASE_REQUISITION_LINE",resultMap = "Purchase_requisition_lineResultMap")
public class Purchase_requisition_line extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.AUTO)
@JSONField(name = "id")
@JsonProperty("id")
private Long id;
/**
* 创建时间
*/
@DEField(name = "create_date")
@TableField(value = "create_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "create_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("create_date")
private Timestamp createDate;
/**
* 最后更新时间
*/
@DEField(name = "write_date")
@TableField(value = "write_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "write_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("write_date")
private Timestamp writeDate;
/**
* 申请编号
*/
@TableField(value = "name")
@JSONField(name = "name")
@JsonProperty("name")
private String name;
/**
* 创建人
*/
@TableField(exist = false)
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
private String createUname;
/**
* 创建人
*/
@DEField(name = "create_uid")
@TableField(value = "create_uid")
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
private Long createUid;
/**
* 最后更新人
*/
@DEField(name = "write_uid")
@TableField(value = "write_uid")
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
private Long writeUid;
/**
* 最后更新人
*/
@TableField(exist = false)
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
private String writeUname;
/**
* 数量
*/
@DEField(name = "product_qty")
@TableField(value = "product_qty")
@JSONField(name = "product_qty")
@JsonProperty("product_qty")
private Double productQty;
/**
* 价格
*/
@DEField(name = "price_unit")
@TableField(value = "price_unit")
@JSONField(name = "price_unit")
@JsonProperty("price_unit")
private Double priceUnit;
/**
* 已订购数量
*/
@DEField(name = "qty_ordered")
@TableField(value = "qty_ordered")
@JSONField(name = "qty_ordered")
@JsonProperty("qty_ordered")
private Double qtyOrdered;
/**
* 安排的日期
*/
@DEField(name = "schedule_date")
@TableField(value = "schedule_date")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "schedule_date" , format="yyyy-MM-dd")
@JsonProperty("schedule_date")
private Timestamp scheduleDate;
/**
* 显示名称
*/
@DEField(name = "display_name")
@TableField(value = "display_name")
@JSONField(name = "display_name")
@JsonProperty("display_name")
private String displayName;
/**
* 产品
*/
@DEField(name = "product_id")
@TableField(value = "product_id")
@JSONField(name = "product_id")
@JsonProperty("product_id")
private Long productId;
/**
* 采购申请
*/
@DEField(name = "requisition_id")
@TableField(value = "requisition_id")
@JSONField(name = "requisition_id")
@JsonProperty("requisition_id")
private Long requisitionId;
/**
* 采购申请
*/
@TableField(exist = false)
@JSONField(name = "requisition_name")
@JsonProperty("requisition_name")
private String requisitionName;
/**
* 产品
*/
@TableField(exist = false)
@JSONField(name = "product_name")
@JsonProperty("product_name")
private String productName;
/**
* ID
*/
@DEField(name = "company_id")
@TableField(value = "company_id")
@JSONField(name = "company_id")
@JsonProperty("company_id")
private Long companyId;
/**
* ID
*/
@DEField(name = "move_dest_id")
@TableField(value = "move_dest_id")
@JSONField(name = "move_dest_id")
@JsonProperty("move_dest_id")
private Long moveDestId;
/**
* ID
*/
@DEField(name = "product_uom_category_id")
@TableField(value = "product_uom_category_id")
@JSONField(name = "product_uom_category_id")
@JsonProperty("product_uom_category_id")
private Long productUomCategoryId;
/**
* ID
*/
@DEField(name = "product_uom_id")
@TableField(value = "product_uom_id")
@JSONField(name = "product_uom_id")
@JsonProperty("product_uom_id")
private Long productUomId;
/**
* ID
*/
@DEField(name = "account_analytic_id")
@TableField(value = "account_analytic_id")
@JSONField(name = "account_analytic_id")
@JsonProperty("account_analytic_id")
private Long accountAnalyticId;
/**
* 分析账户
*/
@TableField(exist = false)
@JSONField(name = "account_analytic_name")
@JsonProperty("account_analytic_name")
private String accountAnalyticName;
/**
* 公司名称
*/
@TableField(exist = false)
@JSONField(name = "company_name")
@JsonProperty("company_name")
private String companyName;
/**
* 说明
*/
@TableField(exist = false)
@JSONField(name = "move_dest_name")
@JsonProperty("move_dest_name")
private String moveDestName;
/**
* 计量单位类别
*/
@TableField(exist = false)
@JSONField(name = "product_uom_category_name")
@JsonProperty("product_uom_category_name")
private String productUomCategoryName;
/**
* 单位
*/
@TableField(exist = false)
@JSONField(name = "product_uom_name")
@JsonProperty("product_uom_name")
private String productUomName;
/**
* 最后修改日
*/
@TableField(exist = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_account.domain.Account_analytic_account accountanalytic;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product product;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition requisition;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_company company;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_stock.domain.Stock_move movedest;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_category productuomcategory;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom productuom;
/**
* 设置 [创建时间]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 格式化日期 [创建时间]
*/
public String formatCreateDate(){
if (this.createDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(createDate);
}
/**
* 设置 [最后更新时间]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
/**
* 格式化日期 [最后更新时间]
*/
public String formatWriteDate(){
if (this.writeDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(writeDate);
}
/**
* 设置 [申请编号]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [创建人]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
/**
* 设置 [最后更新人]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [数量]
*/
public void setProductQty(Double productQty){
this.productQty = productQty ;
this.modify("product_qty",productQty);
}
/**
* 设置 [价格]
*/
public void setPriceUnit(Double priceUnit){
this.priceUnit = priceUnit ;
this.modify("price_unit",priceUnit);
}
/**
* 设置 [已订购数量]
*/
public void setQtyOrdered(Double qtyOrdered){
this.qtyOrdered = qtyOrdered ;
this.modify("qty_ordered",qtyOrdered);
}
/**
* 设置 [安排的日期]
*/
public void setScheduleDate(Timestamp scheduleDate){
this.scheduleDate = scheduleDate ;
this.modify("schedule_date",scheduleDate);
}
/**
* 格式化日期 [安排的日期]
*/
public String formatScheduleDate(){
if (this.scheduleDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(scheduleDate);
}
/**
* 设置 [显示名称]
*/
public void setDisplayName(String displayName){
this.displayName = displayName ;
this.modify("display_name",displayName);
}
/**
* 设置 [产品]
*/
public void setProductId(Long productId){
this.productId = productId ;
this.modify("product_id",productId);
}
/**
* 设置 [采购申请]
*/
public void setRequisitionId(Long requisitionId){
this.requisitionId = requisitionId ;
this.modify("requisition_id",requisitionId);
}
/**
* 设置 [ID]
*/
public void setCompanyId(Long companyId){
this.companyId = companyId ;
this.modify("company_id",companyId);
}
/**
* 设置 [ID]
*/
public void setMoveDestId(Long moveDestId){
this.moveDestId = moveDestId ;
this.modify("move_dest_id",moveDestId);
}
/**
* 设置 [ID]
*/
public void setProductUomCategoryId(Long productUomCategoryId){
this.productUomCategoryId = productUomCategoryId ;
this.modify("product_uom_category_id",productUomCategoryId);
}
/**
* 设置 [ID]
*/
public void setProductUomId(Long productUomId){
this.productUomId = productUomId ;
this.modify("product_uom_id",productUomId);
}
/**
* 设置 [ID]
*/
public void setAccountAnalyticId(Long accountAnalyticId){
this.accountAnalyticId = accountAnalyticId ;
this.modify("account_analytic_id",accountAnalyticId);
}
@Override
public Serializable getDefaultKey(boolean gen) {
return IdWorker.getId();
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("id");
return super.copyTo(targetEntity,bIncEmpty);
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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 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 = "PURCHASE_REQUISITION_TYPE",resultMap = "Purchase_requisition_typeResultMap")
public class Purchase_requisition_type extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 申请类型
*/
@TableField(value = "name")
@JSONField(name = "name")
@JsonProperty("name")
private String name;
/**
* 创建时间
*/
@DEField(name = "create_date")
@TableField(value = "create_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "create_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("create_date")
private Timestamp createDate;
/**
* ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.AUTO)
@JSONField(name = "id")
@JsonProperty("id")
private Long id;
/**
* 最后更新时间
*/
@DEField(name = "write_date")
@TableField(value = "write_date")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "write_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("write_date")
private Timestamp writeDate;
/**
* 最后更新人
*/
@DEField(name = "write_uid")
@TableField(value = "write_uid")
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
private Long writeUid;
/**
* 最后更新人
*/
@TableField(exist = false)
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
private String writeUname;
/**
* 创建人
*/
@DEField(name = "create_uid")
@TableField(value = "create_uid")
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
private Long createUid;
/**
* 创建人
*/
@TableField(exist = false)
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
private String createUname;
/**
* 最后修改日
*/
@TableField(exist = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite;
/**
* 设置 [申请类型]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [创建时间]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 格式化日期 [创建时间]
*/
public String formatCreateDate(){
if (this.createDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(createDate);
}
/**
* 设置 [最后更新时间]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
/**
* 格式化日期 [最后更新时间]
*/
public String formatWriteDate(){
if (this.writeDate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(writeDate);
}
/**
* 设置 [最后更新人]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [创建人]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
@Override
public Serializable getDefaultKey(boolean gen) {
return IdWorker.getId();
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("id");
return super.copyTo(targetEntity,bIncEmpty);
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition;
/**
* 关系型数据实体[Purchase_requisition] 查询条件对象
*/
@Slf4j
@Data
public class Purchase_requisitionSearchContext extends QueryWrapperContext<Purchase_requisition> {
private String n_name_like;//[申请编号]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
private Long n_write_uid_eq;//[最后更新人]
public void setN_write_uid_eq(Long n_write_uid_eq) {
this.n_write_uid_eq = n_write_uid_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_eq)){
this.getSearchCond().eq("write_uid", n_write_uid_eq);
}
}
private Long n_create_uid_eq;//[创建人]
public void setN_create_uid_eq(Long n_create_uid_eq) {
this.n_create_uid_eq = n_create_uid_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_eq)){
this.getSearchCond().eq("create_uid", n_create_uid_eq);
}
}
private String n_write_uname_eq;//[最后更新人]
public void setN_write_uname_eq(String n_write_uname_eq) {
this.n_write_uname_eq = n_write_uname_eq;
if(!ObjectUtils.isEmpty(this.n_write_uname_eq)){
this.getSearchCond().eq("write_uname", n_write_uname_eq);
}
}
private String n_write_uname_like;//[最后更新人]
public void setN_write_uname_like(String n_write_uname_like) {
this.n_write_uname_like = n_write_uname_like;
if(!ObjectUtils.isEmpty(this.n_write_uname_like)){
this.getSearchCond().like("write_uname", n_write_uname_like);
}
}
private String n_create_uname_eq;//[创建人]
public void setN_create_uname_eq(String n_create_uname_eq) {
this.n_create_uname_eq = n_create_uname_eq;
if(!ObjectUtils.isEmpty(this.n_create_uname_eq)){
this.getSearchCond().eq("create_uname", n_create_uname_eq);
}
}
private String n_create_uname_like;//[创建人]
public void setN_create_uname_like(String n_create_uname_like) {
this.n_create_uname_like = n_create_uname_like;
if(!ObjectUtils.isEmpty(this.n_create_uname_like)){
this.getSearchCond().like("create_uname", n_create_uname_like);
}
}
private String n_activity_state_eq;//[活动状态]
public void setN_activity_state_eq(String n_activity_state_eq) {
this.n_activity_state_eq = n_activity_state_eq;
if(!ObjectUtils.isEmpty(this.n_activity_state_eq)){
this.getSearchCond().eq("activity_state", n_activity_state_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_line;
/**
* 关系型数据实体[Purchase_requisition_line] 查询条件对象
*/
@Slf4j
@Data
public class Purchase_requisition_lineSearchContext extends QueryWrapperContext<Purchase_requisition_line> {
private String n_name_like;//[申请编号]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
private String n_create_uname_eq;//[创建人]
public void setN_create_uname_eq(String n_create_uname_eq) {
this.n_create_uname_eq = n_create_uname_eq;
if(!ObjectUtils.isEmpty(this.n_create_uname_eq)){
this.getSearchCond().eq("create_uname", n_create_uname_eq);
}
}
private String n_create_uname_like;//[创建人]
public void setN_create_uname_like(String n_create_uname_like) {
this.n_create_uname_like = n_create_uname_like;
if(!ObjectUtils.isEmpty(this.n_create_uname_like)){
this.getSearchCond().like("create_uname", n_create_uname_like);
}
}
private Long n_create_uid_eq;//[创建人]
public void setN_create_uid_eq(Long n_create_uid_eq) {
this.n_create_uid_eq = n_create_uid_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_eq)){
this.getSearchCond().eq("create_uid", n_create_uid_eq);
}
}
private Long n_write_uid_eq;//[最后更新人]
public void setN_write_uid_eq(Long n_write_uid_eq) {
this.n_write_uid_eq = n_write_uid_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_eq)){
this.getSearchCond().eq("write_uid", n_write_uid_eq);
}
}
private String n_write_uname_eq;//[最后更新人]
public void setN_write_uname_eq(String n_write_uname_eq) {
this.n_write_uname_eq = n_write_uname_eq;
if(!ObjectUtils.isEmpty(this.n_write_uname_eq)){
this.getSearchCond().eq("write_uname", n_write_uname_eq);
}
}
private String n_write_uname_like;//[最后更新人]
public void setN_write_uname_like(String n_write_uname_like) {
this.n_write_uname_like = n_write_uname_like;
if(!ObjectUtils.isEmpty(this.n_write_uname_like)){
this.getSearchCond().like("write_uname", n_write_uname_like);
}
}
private Long n_product_id_eq;//[产品]
public void setN_product_id_eq(Long n_product_id_eq) {
this.n_product_id_eq = n_product_id_eq;
if(!ObjectUtils.isEmpty(this.n_product_id_eq)){
this.getSearchCond().eq("product_id", n_product_id_eq);
}
}
private Long n_requisition_id_eq;//[采购申请]
public void setN_requisition_id_eq(Long n_requisition_id_eq) {
this.n_requisition_id_eq = n_requisition_id_eq;
if(!ObjectUtils.isEmpty(this.n_requisition_id_eq)){
this.getSearchCond().eq("requisition_id", n_requisition_id_eq);
}
}
private String n_requisition_name_eq;//[采购申请]
public void setN_requisition_name_eq(String n_requisition_name_eq) {
this.n_requisition_name_eq = n_requisition_name_eq;
if(!ObjectUtils.isEmpty(this.n_requisition_name_eq)){
this.getSearchCond().eq("requisition_name", n_requisition_name_eq);
}
}
private String n_requisition_name_like;//[采购申请]
public void setN_requisition_name_like(String n_requisition_name_like) {
this.n_requisition_name_like = n_requisition_name_like;
if(!ObjectUtils.isEmpty(this.n_requisition_name_like)){
this.getSearchCond().like("requisition_name", n_requisition_name_like);
}
}
private String n_product_name_eq;//[产品]
public void setN_product_name_eq(String n_product_name_eq) {
this.n_product_name_eq = n_product_name_eq;
if(!ObjectUtils.isEmpty(this.n_product_name_eq)){
this.getSearchCond().eq("product_name", n_product_name_eq);
}
}
private String n_product_name_like;//[产品]
public void setN_product_name_like(String n_product_name_like) {
this.n_product_name_like = n_product_name_like;
if(!ObjectUtils.isEmpty(this.n_product_name_like)){
this.getSearchCond().like("product_name", n_product_name_like);
}
}
private Long n_company_id_eq;//[ID]
public void setN_company_id_eq(Long n_company_id_eq) {
this.n_company_id_eq = n_company_id_eq;
if(!ObjectUtils.isEmpty(this.n_company_id_eq)){
this.getSearchCond().eq("company_id", n_company_id_eq);
}
}
private Long n_move_dest_id_eq;//[ID]
public void setN_move_dest_id_eq(Long n_move_dest_id_eq) {
this.n_move_dest_id_eq = n_move_dest_id_eq;
if(!ObjectUtils.isEmpty(this.n_move_dest_id_eq)){
this.getSearchCond().eq("move_dest_id", n_move_dest_id_eq);
}
}
private Long n_product_uom_category_id_eq;//[ID]
public void setN_product_uom_category_id_eq(Long n_product_uom_category_id_eq) {
this.n_product_uom_category_id_eq = n_product_uom_category_id_eq;
if(!ObjectUtils.isEmpty(this.n_product_uom_category_id_eq)){
this.getSearchCond().eq("product_uom_category_id", n_product_uom_category_id_eq);
}
}
private Long n_product_uom_id_eq;//[ID]
public void setN_product_uom_id_eq(Long n_product_uom_id_eq) {
this.n_product_uom_id_eq = n_product_uom_id_eq;
if(!ObjectUtils.isEmpty(this.n_product_uom_id_eq)){
this.getSearchCond().eq("product_uom_id", n_product_uom_id_eq);
}
}
private Long n_account_analytic_id_eq;//[ID]
public void setN_account_analytic_id_eq(Long n_account_analytic_id_eq) {
this.n_account_analytic_id_eq = n_account_analytic_id_eq;
if(!ObjectUtils.isEmpty(this.n_account_analytic_id_eq)){
this.getSearchCond().eq("account_analytic_id", n_account_analytic_id_eq);
}
}
private String n_account_analytic_name_eq;//[分析账户]
public void setN_account_analytic_name_eq(String n_account_analytic_name_eq) {
this.n_account_analytic_name_eq = n_account_analytic_name_eq;
if(!ObjectUtils.isEmpty(this.n_account_analytic_name_eq)){
this.getSearchCond().eq("account_analytic_name", n_account_analytic_name_eq);
}
}
private String n_account_analytic_name_like;//[分析账户]
public void setN_account_analytic_name_like(String n_account_analytic_name_like) {
this.n_account_analytic_name_like = n_account_analytic_name_like;
if(!ObjectUtils.isEmpty(this.n_account_analytic_name_like)){
this.getSearchCond().like("account_analytic_name", n_account_analytic_name_like);
}
}
private String n_company_name_eq;//[公司名称]
public void setN_company_name_eq(String n_company_name_eq) {
this.n_company_name_eq = n_company_name_eq;
if(!ObjectUtils.isEmpty(this.n_company_name_eq)){
this.getSearchCond().eq("company_name", n_company_name_eq);
}
}
private String n_company_name_like;//[公司名称]
public void setN_company_name_like(String n_company_name_like) {
this.n_company_name_like = n_company_name_like;
if(!ObjectUtils.isEmpty(this.n_company_name_like)){
this.getSearchCond().like("company_name", n_company_name_like);
}
}
private String n_move_dest_name_eq;//[说明]
public void setN_move_dest_name_eq(String n_move_dest_name_eq) {
this.n_move_dest_name_eq = n_move_dest_name_eq;
if(!ObjectUtils.isEmpty(this.n_move_dest_name_eq)){
this.getSearchCond().eq("move_dest_name", n_move_dest_name_eq);
}
}
private String n_move_dest_name_like;//[说明]
public void setN_move_dest_name_like(String n_move_dest_name_like) {
this.n_move_dest_name_like = n_move_dest_name_like;
if(!ObjectUtils.isEmpty(this.n_move_dest_name_like)){
this.getSearchCond().like("move_dest_name", n_move_dest_name_like);
}
}
private String n_product_uom_category_name_eq;//[计量单位类别]
public void setN_product_uom_category_name_eq(String n_product_uom_category_name_eq) {
this.n_product_uom_category_name_eq = n_product_uom_category_name_eq;
if(!ObjectUtils.isEmpty(this.n_product_uom_category_name_eq)){
this.getSearchCond().eq("product_uom_category_name", n_product_uom_category_name_eq);
}
}
private String n_product_uom_category_name_like;//[计量单位类别]
public void setN_product_uom_category_name_like(String n_product_uom_category_name_like) {
this.n_product_uom_category_name_like = n_product_uom_category_name_like;
if(!ObjectUtils.isEmpty(this.n_product_uom_category_name_like)){
this.getSearchCond().like("product_uom_category_name", n_product_uom_category_name_like);
}
}
private String n_product_uom_name_eq;//[单位]
public void setN_product_uom_name_eq(String n_product_uom_name_eq) {
this.n_product_uom_name_eq = n_product_uom_name_eq;
if(!ObjectUtils.isEmpty(this.n_product_uom_name_eq)){
this.getSearchCond().eq("product_uom_name", n_product_uom_name_eq);
}
}
private String n_product_uom_name_like;//[单位]
public void setN_product_uom_name_like(String n_product_uom_name_like) {
this.n_product_uom_name_like = n_product_uom_name_like;
if(!ObjectUtils.isEmpty(this.n_product_uom_name_like)){
this.getSearchCond().like("product_uom_name", n_product_uom_name_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_type;
/**
* 关系型数据实体[Purchase_requisition_type] 查询条件对象
*/
@Slf4j
@Data
public class Purchase_requisition_typeSearchContext extends QueryWrapperContext<Purchase_requisition_type> {
private String n_name_like;//[申请类型]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
private Long n_write_uid_eq;//[最后更新人]
public void setN_write_uid_eq(Long n_write_uid_eq) {
this.n_write_uid_eq = n_write_uid_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_eq)){
this.getSearchCond().eq("write_uid", n_write_uid_eq);
}
}
private String n_write_uname_eq;//[最后更新人]
public void setN_write_uname_eq(String n_write_uname_eq) {
this.n_write_uname_eq = n_write_uname_eq;
if(!ObjectUtils.isEmpty(this.n_write_uname_eq)){
this.getSearchCond().eq("write_uname", n_write_uname_eq);
}
}
private String n_write_uname_like;//[最后更新人]
public void setN_write_uname_like(String n_write_uname_like) {
this.n_write_uname_like = n_write_uname_like;
if(!ObjectUtils.isEmpty(this.n_write_uname_like)){
this.getSearchCond().like("write_uname", n_write_uname_like);
}
}
private Long n_create_uid_eq;//[创建人]
public void setN_create_uid_eq(Long n_create_uid_eq) {
this.n_create_uid_eq = n_create_uid_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_eq)){
this.getSearchCond().eq("create_uid", n_create_uid_eq);
}
}
private String n_create_uname_eq;//[创建人]
public void setN_create_uname_eq(String n_create_uname_eq) {
this.n_create_uname_eq = n_create_uname_eq;
if(!ObjectUtils.isEmpty(this.n_create_uname_eq)){
this.getSearchCond().eq("create_uname", n_create_uname_eq);
}
}
private String n_create_uname_like;//[创建人]
public void setN_create_uname_like(String n_create_uname_like) {
this.n_create_uname_like = n_create_uname_like;
if(!ObjectUtils.isEmpty(this.n_create_uname_like)){
this.getSearchCond().like("create_uname", n_create_uname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisitionSearchContext;
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 Purchase_requisitionMapper extends BaseMapper<Purchase_requisition>{
Page<Purchase_requisition> searchDefault(IPage page, @Param("srf") Purchase_requisitionSearchContext context, @Param("ew") Wrapper<Purchase_requisition> wrapper) ;
@Override
Purchase_requisition selectById(Serializable id);
@Override
int insert(Purchase_requisition entity);
@Override
int updateById(@Param(Constants.ENTITY) Purchase_requisition entity);
@Override
int update(@Param(Constants.ENTITY) Purchase_requisition entity, @Param("ew") Wrapper<Purchase_requisition> 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<Purchase_requisition> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_requisition> selectByWriteUid(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_line;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_lineSearchContext;
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 Purchase_requisition_lineMapper extends BaseMapper<Purchase_requisition_line>{
Page<Purchase_requisition_line> searchDefault(IPage page, @Param("srf") Purchase_requisition_lineSearchContext context, @Param("ew") Wrapper<Purchase_requisition_line> wrapper) ;
@Override
Purchase_requisition_line selectById(Serializable id);
@Override
int insert(Purchase_requisition_line entity);
@Override
int updateById(@Param(Constants.ENTITY) Purchase_requisition_line entity);
@Override
int update(@Param(Constants.ENTITY) Purchase_requisition_line entity, @Param("ew") Wrapper<Purchase_requisition_line> 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<Purchase_requisition_line> selectByAccountAnalyticId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByProductId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByRequisitionId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByCompanyId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByWriteUid(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByMoveDestId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByProductUomCategoryId(@Param("id") Serializable id) ;
List<Purchase_requisition_line> selectByProductUomId(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_type;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_typeSearchContext;
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 Purchase_requisition_typeMapper extends BaseMapper<Purchase_requisition_type>{
Page<Purchase_requisition_type> searchDefault(IPage page, @Param("srf") Purchase_requisition_typeSearchContext context, @Param("ew") Wrapper<Purchase_requisition_type> wrapper) ;
@Override
Purchase_requisition_type selectById(Serializable id);
@Override
int insert(Purchase_requisition_type entity);
@Override
int updateById(@Param(Constants.ENTITY) Purchase_requisition_type entity);
@Override
int update(@Param(Constants.ENTITY) Purchase_requisition_type entity, @Param("ew") Wrapper<Purchase_requisition_type> 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<Purchase_requisition_type> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_requisition_type> selectByWriteUid(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisitionSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Purchase_requisition] 服务对象接口
*/
public interface IPurchase_requisitionService extends IService<Purchase_requisition>{
boolean create(Purchase_requisition et) ;
void createBatch(List<Purchase_requisition> list) ;
boolean update(Purchase_requisition et) ;
void updateBatch(List<Purchase_requisition> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_requisition get(Long key) ;
Purchase_requisition getDraft(Purchase_requisition et) ;
boolean checkKey(Purchase_requisition et) ;
boolean save(Purchase_requisition et) ;
void saveBatch(List<Purchase_requisition> list) ;
Page<Purchase_requisition> searchDefault(Purchase_requisitionSearchContext context) ;
List<Purchase_requisition> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Purchase_requisition> selectByWriteUid(Long id) ;
void removeByWriteUid(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);
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_line;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_lineSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Purchase_requisition_line] 服务对象接口
*/
public interface IPurchase_requisition_lineService extends IService<Purchase_requisition_line>{
boolean create(Purchase_requisition_line et) ;
void createBatch(List<Purchase_requisition_line> list) ;
boolean update(Purchase_requisition_line et) ;
void updateBatch(List<Purchase_requisition_line> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_requisition_line get(Long key) ;
Purchase_requisition_line getDraft(Purchase_requisition_line et) ;
boolean checkKey(Purchase_requisition_line et) ;
boolean save(Purchase_requisition_line et) ;
void saveBatch(List<Purchase_requisition_line> list) ;
Page<Purchase_requisition_line> searchDefault(Purchase_requisition_lineSearchContext context) ;
List<Purchase_requisition_line> selectByAccountAnalyticId(Long id) ;
void removeByAccountAnalyticId(Long id) ;
List<Purchase_requisition_line> selectByProductId(Long id) ;
void removeByProductId(Long id) ;
List<Purchase_requisition_line> selectByRequisitionId(Long id) ;
void removeByRequisitionId(Long id) ;
List<Purchase_requisition_line> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Purchase_requisition_line> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Purchase_requisition_line> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
List<Purchase_requisition_line> selectByMoveDestId(Long id) ;
void removeByMoveDestId(Long id) ;
List<Purchase_requisition_line> selectByProductUomCategoryId(Long id) ;
void removeByProductUomCategoryId(Long id) ;
List<Purchase_requisition_line> selectByProductUomId(Long id) ;
void removeByProductUomId(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);
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_type;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_typeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Purchase_requisition_type] 服务对象接口
*/
public interface IPurchase_requisition_typeService extends IService<Purchase_requisition_type>{
boolean create(Purchase_requisition_type et) ;
void createBatch(List<Purchase_requisition_type> list) ;
boolean update(Purchase_requisition_type et) ;
void updateBatch(List<Purchase_requisition_type> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_requisition_type get(Long key) ;
Purchase_requisition_type getDraft(Purchase_requisition_type et) ;
boolean checkKey(Purchase_requisition_type et) ;
boolean save(Purchase_requisition_type et) ;
void saveBatch(List<Purchase_requisition_type> list) ;
Page<Purchase_requisition_type> searchDefault(Purchase_requisition_typeSearchContext context) ;
List<Purchase_requisition_type> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Purchase_requisition_type> selectByWriteUid(Long id) ;
void removeByWriteUid(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);
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisitionSearchContext;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisitionService;
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_purchase.mapper.Purchase_requisitionMapper;
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("Purchase_requisitionServiceImpl")
public class Purchase_requisitionServiceImpl extends ServiceImpl<Purchase_requisitionMapper, Purchase_requisition> implements IPurchase_requisitionService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Purchase_requisition et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<Purchase_requisition> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Purchase_requisition et) {
fillParentData(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<Purchase_requisition> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(Long key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<Long> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Purchase_requisition get(Long key) {
Purchase_requisition et = getById(key);
if(et==null){
et=new Purchase_requisition();
et.setId(key);
}
else{
}
return et;
}
@Override
public Purchase_requisition getDraft(Purchase_requisition et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_requisition et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_requisition et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_requisition et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_requisition> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_requisition> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_requisition> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition>().eq("create_uid",id));
}
@Override
public List<Purchase_requisition> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_requisition> searchDefault(Purchase_requisitionSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_requisition> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_requisition>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Purchase_requisition et){
//实体关系[DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID]
if(!ObjectUtils.isEmpty(et.getCreateUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate=et.getOdooCreate();
if(ObjectUtils.isEmpty(odooCreate)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getCreateUid());
et.setOdooCreate(majorEntity);
odooCreate=majorEntity;
}
et.setCreateUname(odooCreate.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID]
if(!ObjectUtils.isEmpty(et.getWriteUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite=et.getOdooWrite();
if(ObjectUtils.isEmpty(odooWrite)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getWriteUid());
et.setOdooWrite(majorEntity);
odooWrite=majorEntity;
}
et.setWriteUname(odooWrite.getName());
}
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_line;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_lineSearchContext;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService;
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_purchase.mapper.Purchase_requisition_lineMapper;
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("Purchase_requisition_lineServiceImpl")
public class Purchase_requisition_lineServiceImpl extends ServiceImpl<Purchase_requisition_lineMapper, Purchase_requisition_line> implements IPurchase_requisition_lineService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_account.service.IAccount_analytic_accountService accountAnalyticAccountService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_product.service.IProduct_productService productProductService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisitionService purchaseRequisitionService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_companyService resCompanyService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_stock.service.IStock_moveService stockMoveService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_uom.service.IUom_categoryService uomCategoryService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_uom.service.IUom_uomService uomUomService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Purchase_requisition_line et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<Purchase_requisition_line> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Purchase_requisition_line et) {
fillParentData(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<Purchase_requisition_line> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(Long key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<Long> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Purchase_requisition_line get(Long key) {
Purchase_requisition_line et = getById(key);
if(et==null){
et=new Purchase_requisition_line();
et.setId(key);
}
else{
}
return et;
}
@Override
public Purchase_requisition_line getDraft(Purchase_requisition_line et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_requisition_line et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_requisition_line et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_requisition_line et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_requisition_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_requisition_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_requisition_line> selectByAccountAnalyticId(Long id) {
return baseMapper.selectByAccountAnalyticId(id);
}
@Override
public void removeByAccountAnalyticId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("account_analytic_id",id));
}
@Override
public List<Purchase_requisition_line> selectByProductId(Long id) {
return baseMapper.selectByProductId(id);
}
@Override
public void removeByProductId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("product_id",id));
}
@Override
public List<Purchase_requisition_line> selectByRequisitionId(Long id) {
return baseMapper.selectByRequisitionId(id);
}
@Override
public void removeByRequisitionId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("requisition_id",id));
}
@Override
public List<Purchase_requisition_line> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("company_id",id));
}
@Override
public List<Purchase_requisition_line> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("create_uid",id));
}
@Override
public List<Purchase_requisition_line> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("write_uid",id));
}
@Override
public List<Purchase_requisition_line> selectByMoveDestId(Long id) {
return baseMapper.selectByMoveDestId(id);
}
@Override
public void removeByMoveDestId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("move_dest_id",id));
}
@Override
public List<Purchase_requisition_line> selectByProductUomCategoryId(Long id) {
return baseMapper.selectByProductUomCategoryId(id);
}
@Override
public void removeByProductUomCategoryId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("product_uom_category_id",id));
}
@Override
public List<Purchase_requisition_line> selectByProductUomId(Long id) {
return baseMapper.selectByProductUomId(id);
}
@Override
public void removeByProductUomId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_line>().eq("product_uom_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_requisition_line> searchDefault(Purchase_requisition_lineSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_requisition_line> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_requisition_line>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Purchase_requisition_line et){
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID]
if(!ObjectUtils.isEmpty(et.getAccountAnalyticId())){
cn.ibizlab.businesscentral.core.odoo_account.domain.Account_analytic_account accountanalytic=et.getAccountanalytic();
if(ObjectUtils.isEmpty(accountanalytic)){
cn.ibizlab.businesscentral.core.odoo_account.domain.Account_analytic_account majorEntity=accountAnalyticAccountService.get(et.getAccountAnalyticId());
et.setAccountanalytic(majorEntity);
accountanalytic=majorEntity;
}
et.setAccountAnalyticName(accountanalytic.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID]
if(!ObjectUtils.isEmpty(et.getProductId())){
cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product product=et.getProduct();
if(ObjectUtils.isEmpty(product)){
cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product majorEntity=productProductService.get(et.getProductId());
et.setProduct(majorEntity);
product=majorEntity;
}
et.setProductName(product.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID]
if(!ObjectUtils.isEmpty(et.getRequisitionId())){
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition requisition=et.getRequisition();
if(ObjectUtils.isEmpty(requisition)){
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition majorEntity=purchaseRequisitionService.get(et.getRequisitionId());
et.setRequisition(majorEntity);
requisition=majorEntity;
}
et.setRequisitionName(requisition.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID]
if(!ObjectUtils.isEmpty(et.getCompanyId())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_company company=et.getCompany();
if(ObjectUtils.isEmpty(company)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_company majorEntity=resCompanyService.get(et.getCompanyId());
et.setCompany(majorEntity);
company=majorEntity;
}
et.setCompanyName(company.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID]
if(!ObjectUtils.isEmpty(et.getCreateUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate=et.getOdooCreate();
if(ObjectUtils.isEmpty(odooCreate)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getCreateUid());
et.setOdooCreate(majorEntity);
odooCreate=majorEntity;
}
et.setCreateUname(odooCreate.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID]
if(!ObjectUtils.isEmpty(et.getWriteUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite=et.getOdooWrite();
if(ObjectUtils.isEmpty(odooWrite)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getWriteUid());
et.setOdooWrite(majorEntity);
odooWrite=majorEntity;
}
et.setWriteUname(odooWrite.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID]
if(!ObjectUtils.isEmpty(et.getMoveDestId())){
cn.ibizlab.businesscentral.core.odoo_stock.domain.Stock_move movedest=et.getMovedest();
if(ObjectUtils.isEmpty(movedest)){
cn.ibizlab.businesscentral.core.odoo_stock.domain.Stock_move majorEntity=stockMoveService.get(et.getMoveDestId());
et.setMovedest(majorEntity);
movedest=majorEntity;
}
et.setMoveDestName(movedest.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID]
if(!ObjectUtils.isEmpty(et.getProductUomCategoryId())){
cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_category productuomcategory=et.getProductuomcategory();
if(ObjectUtils.isEmpty(productuomcategory)){
cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_category majorEntity=uomCategoryService.get(et.getProductUomCategoryId());
et.setProductuomcategory(majorEntity);
productuomcategory=majorEntity;
}
et.setProductUomCategoryName(productuomcategory.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID]
if(!ObjectUtils.isEmpty(et.getProductUomId())){
cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom productuom=et.getProductuom();
if(ObjectUtils.isEmpty(productuom)){
cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom majorEntity=uomUomService.get(et.getProductUomId());
et.setProductuom(majorEntity);
productuom=majorEntity;
}
et.setProductUomName(productuom.getName());
}
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.businesscentral.core.odoo_purchase.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_purchase.domain.Purchase_requisition_type;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_typeSearchContext;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_typeService;
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_purchase.mapper.Purchase_requisition_typeMapper;
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("Purchase_requisition_typeServiceImpl")
public class Purchase_requisition_typeServiceImpl extends ServiceImpl<Purchase_requisition_typeMapper, Purchase_requisition_type> implements IPurchase_requisition_typeService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Purchase_requisition_type et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<Purchase_requisition_type> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Purchase_requisition_type et) {
fillParentData(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<Purchase_requisition_type> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(Long key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<Long> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Purchase_requisition_type get(Long key) {
Purchase_requisition_type et = getById(key);
if(et==null){
et=new Purchase_requisition_type();
et.setId(key);
}
else{
}
return et;
}
@Override
public Purchase_requisition_type getDraft(Purchase_requisition_type et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_requisition_type et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_requisition_type et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_requisition_type et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_requisition_type> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_requisition_type> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_requisition_type> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_type>().eq("create_uid",id));
}
@Override
public List<Purchase_requisition_type> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Purchase_requisition_type>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_requisition_type> searchDefault(Purchase_requisition_typeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_requisition_type> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_requisition_type>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Purchase_requisition_type et){
//实体关系[DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID]
if(!ObjectUtils.isEmpty(et.getCreateUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate=et.getOdooCreate();
if(ObjectUtils.isEmpty(odooCreate)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getCreateUid());
et.setOdooCreate(majorEntity);
odooCreate=majorEntity;
}
et.setCreateUname(odooCreate.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID]
if(!ObjectUtils.isEmpty(et.getWriteUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite=et.getOdooWrite();
if(ObjectUtils.isEmpty(odooWrite)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getWriteUid());
et.setOdooWrite(majorEntity);
odooWrite=majorEntity;
}
et.setWriteUname(odooWrite.getName());
}
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.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;
/**
* 关系型数据实体[A] 对象
*/
public interface IPurchase_orderALogic {
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_orderALogic;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
/**
* 关系型数据实体[A] 对象
*/
@Slf4j
@Service
public class Purchase_orderALogicImpl implements IPurchase_orderALogic{
@Autowired
private KieContainer kieContainer;
@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_orderadefault",et);
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_ordera");
}catch(Exception e){
throw new RuntimeException("执行[A]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -56,6 +56,9 @@ public class Stock_moveServiceImpl extends ServiceImpl<Stock_moveMapper, Stock_m
protected cn.ibizlab.businesscentral.core.odoo_mrp.service.IMrp_product_produce_lineService mrpProductProduceLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_repair.service.IRepair_lineService repairLineService;
@Autowired
@Lazy
......
......@@ -48,6 +48,9 @@ import org.springframework.util.StringUtils;
@Service("Uom_categoryServiceImpl")
public class Uom_categoryServiceImpl extends ServiceImpl<Uom_categoryMapper, Uom_category> implements IUom_categoryService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_uom.service.IUom_uomService uomUomService;
......
......@@ -101,6 +101,9 @@ public class Uom_uomServiceImpl extends ServiceImpl<Uom_uomMapper, Uom_uom> impl
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_reportService purchaseReportService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService purchaseRequisitionLineService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_repair.service.IRepair_feeService repairFeeService;
@Autowired
@Lazy
......
......@@ -867,6 +867,15 @@
<!--输出实体[PURCHASE_REPORT]数据结构 -->
<!--输出实体[PURCHASE_REQUISITION]数据结构 -->
<!--输出实体[PURCHASE_REQUISITION_LINE]数据结构 -->
<!--输出实体[PURCHASE_REQUISITION_TYPE]数据结构 -->
<!--输出实体[RATING_MIXIN]数据结构 -->
......@@ -942,6 +951,9 @@
<!--输出实体[RES_PARTNER_TITLE]数据结构 -->
<!--输出实体[RES_SUPPLIER]数据结构 -->
<!--输出实体[RES_USERS]数据结构 -->
......@@ -1472,6 +1484,9 @@
<!--输出实体[PURCHASE_ORDER]外键关系 -->
<!--输出实体[PURCHASE_ORDER_LINE]外键关系 -->
<!--输出实体[PURCHASE_REPORT]外键关系 -->
<!--输出实体[PURCHASE_REQUISITION]外键关系 -->
<!--输出实体[PURCHASE_REQUISITION_LINE]外键关系 -->
<!--输出实体[PURCHASE_REQUISITION_TYPE]外键关系 -->
<!--输出实体[RATING_MIXIN]外键关系 -->
<!--输出实体[RATING_RATING]外键关系 -->
<!--输出实体[REPAIR_CANCEL]外键关系 -->
......@@ -1497,6 +1512,7 @@
<!--输出实体[RES_PARTNER_CATEGORY]外键关系 -->
<!--输出实体[RES_PARTNER_INDUSTRY]外键关系 -->
<!--输出实体[RES_PARTNER_TITLE]外键关系 -->
<!--输出实体[RES_SUPPLIER]外键关系 -->
<!--输出实体[RES_USERS]外键关系 -->
<!--输出实体[RES_USERS_LOG]外键关系 -->
<!--输出实体[RESOURCE_CALENDAR]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Res_partnerResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMENT, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.INVOICE_WARN_MSG, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PICKING_WARN_MSG, t1.PURCHASE_WARN, t1.PURCHASE_WARN_MSG, t1.REF, t1.SALE_WARN, t1.SALE_WARN_MSG, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SHORT_DESCRIPTION, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMENT, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.CUSTOMER_RANK, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.INVOICE_WARN_MSG, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PICKING_WARN_MSG, t1.PURCHASE_WARN, t1.PURCHASE_WARN_MSG, t1.REF, t1.SALE_WARN, t1.SALE_WARN_MSG, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.SUPPLIER_RANK, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SHORT_DESCRIPTION, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -138,6 +138,8 @@
<result property="industryId" column="industry_id" />
<result property="companyId" column="company_id" />
<result property="countryId" column="country_id" />
<result property="supplierRank" column="supplier_rank" />
<result property="customerRank" column="customer_rank" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......@@ -253,12 +255,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PURCHASE_WARN, t1.REF, t1.SALE_WARN, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_ID, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID
<![CDATA[ SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.CUSTOMER_RANK, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PURCHASE_WARN, t1.REF, t1.SALE_WARN, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.SUPPLIER_RANK, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_ID, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMENT, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.INVOICE_WARN_MSG, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PICKING_WARN_MSG, t1.PURCHASE_WARN, t1.PURCHASE_WARN_MSG, t1.REF, t1.SALE_WARN, t1.SALE_WARN_MSG, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SHORT_DESCRIPTION, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID
<![CDATA[ SELECT t1.ACTIVE, t1.ADDITIONAL_INFO, t1.BARCODE, t1.CALENDAR_LAST_NOTIF_ACK, t1.CITY, t1.COLOR, t1.COMMENT, t1.COMMERCIAL_COMPANY_NAME, t1.COMMERCIAL_PARTNER_ID, t81.NAME AS COMMERCIAL_PARTNER_ID_TEXT, t1.COMPANY_ID, t51.NAME AS COMPANY_ID_TEXT, t1.COMPANY_NAME, t1.COUNTRY_ID, t61.NAME AS COUNTRY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t131.NAME AS CREATE_UID_TEXT, t1.CREDIT_LIMIT, t1.CUSTOMER_RANK, t1.DATE, t1.DEBIT_LIMIT, t1.DISPLAY_NAME, t1.EMAIL, t1.EMPLOYEE, t1.FUNCTION AS IBIZFUNCTION, t1.ID, t1.INDUSTRY_ID, t141.NAME AS INDUSTRY_ID_TEXT, t1.INVOICE_WARN, t1.INVOICE_WARN_MSG, t1.IS_COMPANY, t1.IS_PUBLISHED, t1.LANG, t1.LAST_TIME_ENTRIES_CHECKED, t1.MESSAGE_BOUNCE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.MOBILE, t1.NAME, t1.PARENT_ID, t91.NAME AS PARENT_NAME, t1.PARTNER_GID, t1.PARTNER_SHARE, t1.PHONE, t1.PICKING_WARN, t1.PICKING_WARN_MSG, t1.PURCHASE_WARN, t1.PURCHASE_WARN_MSG, t1.REF, t1.SALE_WARN, t1.SALE_WARN_MSG, t1.SIGNUP_EXPIRATION, t1.SIGNUP_TOKEN, t1.SIGNUP_TYPE, t1.STATE_ID, t71.NAME AS STATE_ID_TEXT, t1.STREET, t1.STREET2, t1.SUPPLIER_RANK, t1.TEAM_ID, t151.NAME AS TEAM_ID_TEXT, t1.TITLE, t31.NAME AS TITLE_TEXT, t1.TYPE, t1.TZ, t1.USER_ID, t111.NAME AS USER_ID_TEXT, t1.VAT, t1.WEBSITE, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SHORT_DESCRIPTION, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT, t1.ZIP FROM RES_PARTNER t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_PARTNER_TITLE t31 ON t1.TITLE = t31.ID LEFT JOIN RES_COMPANY t41 ON t1.COMPANY_ID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN RES_COUNTRY t61 ON t1.COUNTRY_ID = t61.ID LEFT JOIN RES_COUNTRY_STATE t71 ON t1.STATE_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t1.COMMERCIAL_PARTNER_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t1.PARENT_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.USER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN RES_USERS t121 ON t1.CREATE_UID = t121.ID LEFT JOIN RES_PARTNER t131 ON t121.PARTNER_ID = t131.ID LEFT JOIN RES_PARTNER_INDUSTRY t141 ON t1.INDUSTRY_ID = t141.ID LEFT JOIN CRM_TEAM t151 ON t1.TEAM_ID = t151.ID
]]>
</sql>
</mapper>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_supplierMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Res_supplierResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ID, t1.NAME FROM RES_PARTNER t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Res_supplierResultMap" type="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_base.filter.Res_supplierSearchContext" resultMap="Res_supplierResultMap">
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.ID, t1.NAME FROM RES_PARTNER t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ID, t1.NAME FROM RES_PARTNER t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_requisitionMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_requisitionResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVITY_DATE_DEADLINE, t1.ACTIVITY_STATE, t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.ORDER_COUNT, t1.ORIGIN, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Purchase_requisitionResultMap" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="createDate" column="create_date" />
<result property="writeDate" column="write_date" />
<result property="writeUid" column="write_uid" />
<result property="createUid" column="create_uid" />
<result property="writeUname" column="write_uname" />
<result property="createUname" column="create_uname" />
<result property="LastUpdate" column="__last_update" />
<result property="activityState" column="activity_state" />
<result property="activityDateDeadline" column="activity_date_deadline" />
<result property="orderCount" column="order_count" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooCreate" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="create_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooWrite" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="write_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Purchase_requisitionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Purchase_requisitionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisitionSearchContext" resultMap="Purchase_requisitionResultMap">
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.ACTIVITY_DATE_DEADLINE, t1.ACTIVITY_STATE, t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.ORDER_COUNT, t1.ORIGIN, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVITY_DATE_DEADLINE, t1.ACTIVITY_STATE, t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.ORDER_COUNT, t1.ORIGIN, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_requisition_lineMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_requisition_lineResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACCOUNT_ANALYTIC_ID, t81.NAME AS ACCOUNT_ANALYTIC_NAME, t1.COMPANY_ID, t101.NAME AS COMPANY_NAME, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.DISPLAY_NAME, t1.ID, t1.MOVE_DEST_ID, t111.NAME AS MOVE_DEST_NAME, t1.NAME, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_NAME, t1.PRODUCT_QTY, t1.PRODUCT_UOM_CATEGORY_ID, t121.NAME AS PRODUCT_UOM_CATEGORY_NAME, t1.PRODUCT_UOM_ID, t131.NAME AS PRODUCT_UOM_NAME, t1.QTY_ORDERED, t1.REQUISITION_ID, t51.NAME AS REQUISITION_NAME, t1.SCHEDULE_DATE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_LINE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION t51 ON t1.REQUISITION_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t81 ON t1.ACCOUNT_ANALYTIC_ID = t81.ID LEFT JOIN RES_COMPANY t91 ON t1.COMPANY_ID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN STOCK_MOVE t111 ON t1.MOVE_DEST_ID = t111.ID LEFT JOIN UOM_CATEGORY t121 ON t1.PRODUCT_UOM_CATEGORY_ID = t121.ID LEFT JOIN UOM_UOM t131 ON t1.PRODUCT_UOM_ID = t131.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Purchase_requisition_lineResultMap" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_line" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="createDate" column="create_date" />
<result property="writeDate" column="write_date" />
<result property="createUname" column="create_uname" />
<result property="createUid" column="create_uid" />
<result property="writeUid" column="write_uid" />
<result property="writeUname" column="write_uname" />
<result property="productQty" column="product_qty" />
<result property="priceUnit" column="price_unit" />
<result property="qtyOrdered" column="qty_ordered" />
<result property="scheduleDate" column="schedule_date" />
<result property="displayName" column="display_name" />
<result property="productId" column="product_id" />
<result property="requisitionId" column="requisition_id" />
<result property="requisitionName" column="requisition_name" />
<result property="productName" column="product_name" />
<result property="companyId" column="company_id" />
<result property="moveDestId" column="move_dest_id" />
<result property="productUomCategoryId" column="product_uom_category_id" />
<result property="productUomId" column="product_uom_id" />
<result property="accountAnalyticId" column="account_analytic_id" />
<result property="accountAnalyticName" column="account_analytic_name" />
<result property="companyName" column="company_name" />
<result property="moveDestName" column="move_dest_name" />
<result property="productUomCategoryName" column="product_uom_category_name" />
<result property="productUomName" column="product_uom_name" />
<result property="LastUpdate" column="__last_update" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="accountanalytic" javaType="cn.ibizlab.businesscentral.core.odoo_account.domain.Account_analytic_account" column="account_analytic_id" select="cn.ibizlab.businesscentral.core.odoo_account.mapper.Account_analytic_accountMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="product" javaType="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product" column="product_id" select="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_productMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="requisition" javaType="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition" column="requisition_id" select="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_requisitionMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="company" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_company" column="company_id" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_companyMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooCreate" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="create_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooWrite" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="write_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="movedest" javaType="cn.ibizlab.businesscentral.core.odoo_stock.domain.Stock_move" column="move_dest_id" select="cn.ibizlab.businesscentral.core.odoo_stock.mapper.Stock_moveMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="productuomcategory" javaType="cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_category" column="product_uom_category_id" select="cn.ibizlab.businesscentral.core.odoo_uom.mapper.Uom_categoryMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="productuom" javaType="cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom" column="product_uom_id" select="cn.ibizlab.businesscentral.core.odoo_uom.mapper.Uom_uomMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID] -->
<select id="selectByAccountAnalyticId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where account_analytic_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID] -->
<select id="selectByProductId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID] -->
<select id="selectByRequisitionId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where requisition_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID] -->
<select id="selectByMoveDestId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where move_dest_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID] -->
<select id="selectByProductUomCategoryId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_uom_category_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID] -->
<select id="selectByProductUomId" resultMap="Purchase_requisition_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_uom_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_lineSearchContext" resultMap="Purchase_requisition_lineResultMap">
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.ACCOUNT_ANALYTIC_ID, t81.NAME AS ACCOUNT_ANALYTIC_NAME, t1.COMPANY_ID, t101.NAME AS COMPANY_NAME, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.DISPLAY_NAME, t1.ID, t1.MOVE_DEST_ID, t111.NAME AS MOVE_DEST_NAME, t1.NAME, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_NAME, t1.PRODUCT_QTY, t1.PRODUCT_UOM_CATEGORY_ID, t121.NAME AS PRODUCT_UOM_CATEGORY_NAME, t1.PRODUCT_UOM_ID, t131.NAME AS PRODUCT_UOM_NAME, t1.QTY_ORDERED, t1.REQUISITION_ID, t51.NAME AS REQUISITION_NAME, t1.SCHEDULE_DATE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_LINE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION t51 ON t1.REQUISITION_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t81 ON t1.ACCOUNT_ANALYTIC_ID = t81.ID LEFT JOIN RES_COMPANY t91 ON t1.COMPANY_ID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN STOCK_MOVE t111 ON t1.MOVE_DEST_ID = t111.ID LEFT JOIN UOM_CATEGORY t121 ON t1.PRODUCT_UOM_CATEGORY_ID = t121.ID LEFT JOIN UOM_UOM t131 ON t1.PRODUCT_UOM_ID = t131.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACCOUNT_ANALYTIC_ID, t81.NAME AS ACCOUNT_ANALYTIC_NAME, t1.COMPANY_ID, t101.NAME AS COMPANY_NAME, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.DISPLAY_NAME, t1.ID, t1.MOVE_DEST_ID, t111.NAME AS MOVE_DEST_NAME, t1.NAME, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_NAME, t1.PRODUCT_QTY, t1.PRODUCT_UOM_CATEGORY_ID, t121.NAME AS PRODUCT_UOM_CATEGORY_NAME, t1.PRODUCT_UOM_ID, t131.NAME AS PRODUCT_UOM_NAME, t1.QTY_ORDERED, t1.REQUISITION_ID, t51.NAME AS REQUISITION_NAME, t1.SCHEDULE_DATE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_LINE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION t51 ON t1.REQUISITION_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t81 ON t1.ACCOUNT_ANALYTIC_ID = t81.ID LEFT JOIN RES_COMPANY t91 ON t1.COMPANY_ID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN STOCK_MOVE t111 ON t1.MOVE_DEST_ID = t111.ID LEFT JOIN UOM_CATEGORY t121 ON t1.PRODUCT_UOM_CATEGORY_ID = t121.ID LEFT JOIN UOM_UOM t131 ON t1.PRODUCT_UOM_ID = t131.ID
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_requisition_typeMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_requisition_typeResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_TYPE t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Purchase_requisition_typeResultMap" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_type" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="createDate" column="create_date" />
<result property="writeDate" column="write_date" />
<result property="writeUid" column="write_uid" />
<result property="writeUname" column="write_uname" />
<result property="createUid" column="create_uid" />
<result property="createUname" column="create_uname" />
<result property="LastUpdate" column="__last_update" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooCreate" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="create_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooWrite" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="write_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Purchase_requisition_typeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Purchase_requisition_typeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_typeSearchContext" resultMap="Purchase_requisition_typeResultMap">
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.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_TYPE t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.ID, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION_TYPE t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
</mapper>
package cn.ibizlab.businesscentral.odoo_purchase.logic.purchase_orderlogic.a;
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_orderadefault;
global cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_orderService iBzSysPurchase_orderDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "purchase_orderabegin"
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_ordera" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.odoo_purchase.service.logic.purchase_ordera">
<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_orderadefault" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order" />
</extensionElements>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="begin_end" name="end"/>
<sequenceFlow id="begin_end_line" sourceRef="begin" targetRef="begin_end"/>
</process>
</definitions>
......@@ -2664,6 +2664,12 @@
"entity_name":"PURCHASE_REPORT",
"ref_entity_name":"ACCOUNT_ANALYTIC_ACCOUNT"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID",
"relation_type":"DER1N",
"code_name":"AccountAnalytic",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"ACCOUNT_ANALYTIC_ACCOUNT"
},
{"name":"DER1N_SALE_ORDER__ACCOUNT_ANALYTIC_ACCOUNT__ANALYTIC_ACCOUNT_ID",
"relation_type":"DER1N",
"code_name":"Odoo_analytic_account",
......@@ -112963,6 +112969,12 @@
"entity_name":"PURCHASE_REPORT",
"ref_entity_name":"PRODUCT_PRODUCT"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID",
"relation_type":"DER1N",
"code_name":"Product",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"PRODUCT_PRODUCT"
},
{"name":"DER1N_REPAIR_FEE__PRODUCT_PRODUCT__PRODUCT_ID",
"relation_type":"DER1N",
"code_name":"Odoo_product",
......@@ -123767,6 +123779,862 @@
"ref_entity_name":"UOM_UOM"
}
]
}
,
{
"entity_name":"PURCHASE_REQUISITION",
"logic_name":"采购申请",
"code_name":"Purchase_requisition",
"table_name":"PURCHASE_REQUISITION",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition",
"field_type":"ACID",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":1,
"major_field":0
},
{
"fieldname":"NAME" ,
"codename":"Name",
"field_logic_name":"申请编号",
"entity_name":"Purchase_requisition",
"field_type":"TEXT",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":1
},
{
"fieldname":"CREATE_DATE" ,
"codename":"Create_date",
"field_logic_name":"创建时间",
"entity_name":"Purchase_requisition",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_DATE" ,
"codename":"Write_date",
"field_logic_name":"最后更新时间",
"entity_name":"Purchase_requisition",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UID" ,
"codename":"Write_uid",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"CREATE_UID" ,
"codename":"Create_uid",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UNAME" ,
"codename":"Write_uname",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"CREATE_UNAME" ,
"codename":"Create_uname",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"__LAST_UPDATE" ,
"codename":"__last_update",
"field_logic_name":"最后修改日",
"entity_name":"Purchase_requisition",
"field_type":"DATETIME",
"nullable":1,
"physical_field":0,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"ACTIVITY_STATE" ,
"codename":"Activity_state",
"field_logic_name":"活动状态",
"entity_name":"Purchase_requisition",
"field_type":"SSCODELIST",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":60,
"key_field":0,
"major_field":0
},
{
"fieldname":"ACTIVITY_DATE_DEADLINE" ,
"codename":"Activity_date_deadline",
"field_logic_name":"下一活动截止日期",
"entity_name":"Purchase_requisition",
"field_type":"DATE",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"ORIGIN" ,
"codename":"Origin",
"field_logic_name":"源单据",
"entity_name":"Purchase_requisition",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"ORDER_COUNT" ,
"codename":"Order_count",
"field_logic_name":"采购订单数",
"entity_name":"Purchase_requisition",
"field_type":"INT",
"nullable":1,
"physical_field":1,
"data_type":"INT",
"key_field":0,
"major_field":0
}
],
"subEntitys":[
{"name":"DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID",
"relation_type":"DER1N",
"code_name":"Requisition",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"PURCHASE_REQUISITION"
}
],
"parentEntitys":[
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
}
]
}
,
{
"entity_name":"PURCHASE_REQUISITION_LINE",
"logic_name":"采购申请行",
"code_name":"Purchase_requisition_line",
"table_name":"PURCHASE_REQUISITION_LINE",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"field_type":"ACID",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":1,
"major_field":0
},
{
"fieldname":"CREATE_DATE" ,
"codename":"Create_date",
"field_logic_name":"创建时间",
"entity_name":"Purchase_requisition_line",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_DATE" ,
"codename":"Write_date",
"field_logic_name":"最后更新时间",
"entity_name":"Purchase_requisition_line",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"NAME" ,
"codename":"Name",
"field_logic_name":"申请编号",
"entity_name":"Purchase_requisition_line",
"field_type":"TEXT",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":1
},
{
"fieldname":"CREATE_UNAME" ,
"codename":"Create_uname",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"CREATE_UID" ,
"codename":"Create_uid",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UID" ,
"codename":"Write_uid",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UNAME" ,
"codename":"Write_uname",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_QTY" ,
"codename":"Product_qty",
"field_logic_name":"数量",
"entity_name":"Purchase_requisition_line",
"field_type":"FLOAT",
"nullable":1,
"physical_field":1,
"data_type":"FLOAT",
"key_field":0,
"major_field":0
},
{
"fieldname":"PRICE_UNIT" ,
"codename":"Price_unit",
"field_logic_name":"价格",
"entity_name":"Purchase_requisition_line",
"field_type":"FLOAT",
"nullable":1,
"physical_field":1,
"data_type":"FLOAT",
"key_field":0,
"major_field":0
},
{
"fieldname":"QTY_ORDERED" ,
"codename":"Qty_ordered",
"field_logic_name":"已订购数量",
"entity_name":"Purchase_requisition_line",
"field_type":"FLOAT",
"nullable":1,
"physical_field":1,
"data_type":"FLOAT",
"key_field":0,
"major_field":0
},
{
"fieldname":"SCHEDULE_DATE" ,
"codename":"Schedule_date",
"field_logic_name":"安排的日期",
"entity_name":"Purchase_requisition_line",
"field_type":"DATE",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"DISPLAY_NAME" ,
"codename":"Display_name",
"field_logic_name":"显示名称",
"entity_name":"Purchase_requisition_line",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_ID" ,
"codename":"Product_id",
"field_logic_name":"产品",
"entity_name":"Purchase_requisition_line",
"ref_de":"PRODUCT_PRODUCT",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID",
"relation_codename":"Product",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"REQUISITION_ID" ,
"codename":"Requisition_id",
"field_logic_name":"采购申请",
"entity_name":"Purchase_requisition_line",
"ref_de":"PURCHASE_REQUISITION",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID",
"relation_codename":"Requisition",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":0,
"major_field":0
},
{
"fieldname":"REQUISITION_NAME" ,
"codename":"Requisition_name",
"field_logic_name":"采购申请",
"entity_name":"Purchase_requisition_line",
"ref_de":"PURCHASE_REQUISITION",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID",
"relation_codename":"Requisition",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_NAME" ,
"codename":"Product_name",
"field_logic_name":"产品",
"entity_name":"Purchase_requisition_line",
"ref_de":"PRODUCT_PRODUCT",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID",
"relation_codename":"Product",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"COMPANY_ID" ,
"codename":"Company_id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_COMPANY",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID",
"relation_codename":"Company",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"MOVE_DEST_ID" ,
"codename":"Move_dest_id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"ref_de":"STOCK_MOVE",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID",
"relation_codename":"MoveDest",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_UOM_CATEGORY_ID" ,
"codename":"Product_uom_category_id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"ref_de":"UOM_CATEGORY",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID",
"relation_codename":"ProductUomCategory",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_UOM_ID" ,
"codename":"Product_uom_id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"ref_de":"UOM_UOM",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID",
"relation_codename":"ProductUom",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"ACCOUNT_ANALYTIC_ID" ,
"codename":"Account_analytic_id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_line",
"ref_de":"ACCOUNT_ANALYTIC_ACCOUNT",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID",
"relation_codename":"AccountAnalytic",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"ACCOUNT_ANALYTIC_NAME" ,
"codename":"Account_analytic_name",
"field_logic_name":"分析账户",
"entity_name":"Purchase_requisition_line",
"ref_de":"ACCOUNT_ANALYTIC_ACCOUNT",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID",
"relation_codename":"AccountAnalytic",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"COMPANY_NAME" ,
"codename":"Company_name",
"field_logic_name":"公司名称",
"entity_name":"Purchase_requisition_line",
"ref_de":"RES_COMPANY",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID",
"relation_codename":"Company",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"MOVE_DEST_NAME" ,
"codename":"Move_dest_name",
"field_logic_name":"说明",
"entity_name":"Purchase_requisition_line",
"ref_de":"STOCK_MOVE",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID",
"relation_codename":"MoveDest",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_UOM_CATEGORY_NAME" ,
"codename":"Product_uom_category_name",
"field_logic_name":"计量单位类别",
"entity_name":"Purchase_requisition_line",
"ref_de":"UOM_CATEGORY",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID",
"relation_codename":"ProductUomCategory",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"PRODUCT_UOM_NAME" ,
"codename":"Product_uom_name",
"field_logic_name":"单位",
"entity_name":"Purchase_requisition_line",
"ref_de":"UOM_UOM",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID",
"relation_codename":"ProductUom",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"__LAST_UPDATE" ,
"codename":"__last_update",
"field_logic_name":"最后修改日",
"entity_name":"Purchase_requisition_line",
"field_type":"DATETIME",
"nullable":1,
"physical_field":0,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_PURCHASE_REQUISITION_LINE_ACCOUNT_ANALYTIC_ACCOUNT_ACCOUNT_ANALYTIC_ID",
"relation_type":"DER1N",
"code_name":"AccountAnalytic",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"ACCOUNT_ANALYTIC_ACCOUNT"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_PRODUCT_PRODUCT_PRODUCT_ID",
"relation_type":"DER1N",
"code_name":"Product",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"PRODUCT_PRODUCT"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_PURCHASE_REQUISITION_REQUISITION_ID",
"relation_type":"DER1N",
"code_name":"Requisition",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"PURCHASE_REQUISITION"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID",
"relation_type":"DER1N",
"code_name":"Company",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_COMPANY"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID",
"relation_type":"DER1N",
"code_name":"MoveDest",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"STOCK_MOVE"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID",
"relation_type":"DER1N",
"code_name":"ProductUomCategory",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"UOM_CATEGORY"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID",
"relation_type":"DER1N",
"code_name":"ProductUom",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"UOM_UOM"
}
]
}
,
{
"entity_name":"PURCHASE_REQUISITION_TYPE",
"logic_name":"采购申请类型",
"code_name":"Purchase_requisition_type",
"table_name":"PURCHASE_REQUISITION_TYPE",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"NAME" ,
"codename":"Name",
"field_logic_name":"申请类型",
"entity_name":"Purchase_requisition_type",
"field_type":"TEXT",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":1
},
{
"fieldname":"CREATE_DATE" ,
"codename":"Create_date",
"field_logic_name":"创建时间",
"entity_name":"Purchase_requisition_type",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"ID",
"entity_name":"Purchase_requisition_type",
"field_type":"ACID",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":1,
"major_field":0
},
{
"fieldname":"WRITE_DATE" ,
"codename":"Write_date",
"field_logic_name":"最后更新时间",
"entity_name":"Purchase_requisition_type",
"field_type":"DATETIME",
"nullable":1,
"physical_field":1,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UID" ,
"codename":"Write_uid",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition_type",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"WRITE_UNAME" ,
"codename":"Write_uname",
"field_logic_name":"最后更新人",
"entity_name":"Purchase_requisition_type",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID",
"relation_codename":"Odoo_write",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"CREATE_UID" ,
"codename":"Create_uid",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition_type",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"CREATE_UNAME" ,
"codename":"Create_uname",
"field_logic_name":"创建人",
"entity_name":"Purchase_requisition_type",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID",
"relation_codename":"Odoo_create",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"__LAST_UPDATE" ,
"codename":"__last_update",
"field_logic_name":"最后修改日",
"entity_name":"Purchase_requisition_type",
"field_type":"DATETIME",
"nullable":1,
"physical_field":0,
"data_type":"DATETIME",
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION_TYPE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION_TYPE",
"ref_entity_name":"RES_USERS"
}
]
}
,
{
......@@ -129255,6 +130123,12 @@
"entity_name":"PURCHASE_REPORT",
"ref_entity_name":"RES_COMPANY"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_COMPANY_COMPANY_ID",
"relation_type":"DER1N",
"code_name":"Company",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_COMPANY"
},
{"name":"DER1N_REPAIR_ORDER__RES_COMPANY__COMPANY_ID",
"relation_type":"DER1N",
"code_name":"Odoo_company",
......@@ -137642,6 +138516,30 @@
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"SUPPLIER_RANK" ,
"codename":"Supplier_rank",
"field_logic_name":"supplier rank",
"entity_name":"Res_partner",
"field_type":"INT",
"nullable":1,
"physical_field":1,
"data_type":"INT",
"key_field":0,
"major_field":0
},
{
"fieldname":"CUSTOMER_RANK" ,
"codename":"Customer_rank",
"field_logic_name":"customer rank",
"entity_name":"Res_partner",
"field_type":"INT",
"nullable":1,
"physical_field":1,
"data_type":"INT",
"key_field":0,
"major_field":0
}
],
"subEntitys":[
......@@ -139681,6 +140579,47 @@
"ref_entity_name":"RES_USERS"
}
]
}
,
{
"entity_name":"RES_SUPPLIER",
"logic_name":"供应商",
"code_name":"Res_supplier",
"table_name":"RES_PARTNER",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"ID",
"entity_name":"Res_supplier",
"field_type":"ACID",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":1,
"major_field":0
},
{
"fieldname":"NAME" ,
"codename":"Name",
"field_logic_name":"名称",
"entity_name":"Res_supplier",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":1
}
],
"subEntitys":[
],
"parentEntitys":[
]
}
,
{
......@@ -146022,6 +146961,42 @@
"entity_name":"PURCHASE_REPORT",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
"entity_name":"PURCHASE_REQUISITION_TYPE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_TYPE_RES_USERS_WRITE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_write",
"entity_name":"PURCHASE_REQUISITION_TYPE",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_RATING_RATING__RES_USERS__CREATE_UID",
"relation_type":"DER1N",
"code_name":"Odoo_create",
......@@ -161291,6 +162266,12 @@
"entity_name":"MRP_PRODUCT_PRODUCE_LINE",
"ref_entity_name":"STOCK_MOVE"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_STOCK_MOVE_MOVE_DEST_ID",
"relation_type":"DER1N",
"code_name":"MoveDest",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"STOCK_MOVE"
},
{"name":"DER1N_REPAIR_LINE__STOCK_MOVE__MOVE_ID",
"relation_type":"DER1N",
"code_name":"Odoo_move",
......@@ -176827,6 +177808,12 @@
}
],
"subEntitys":[
{"name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_CATEGORY_PRODUCT_UOM_CATEGORY_ID",
"relation_type":"DER1N",
"code_name":"ProductUomCategory",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"UOM_CATEGORY"
},
{"name":"DER1N_UOM_UOM__UOM_CATEGORY__CATEGORY_ID",
"relation_type":"DER1N",
"code_name":"Odoo_category",
......@@ -177241,6 +178228,12 @@
"entity_name":"PURCHASE_REPORT",
"ref_entity_name":"UOM_UOM"
},
{"name":"DER1N_PURCHASE_REQUISITION_LINE_UOM_UOM_PRODUCT_UOM_ID",
"relation_type":"DER1N",
"code_name":"ProductUom",
"entity_name":"PURCHASE_REQUISITION_LINE",
"ref_entity_name":"UOM_UOM"
},
{"name":"DER1N_REPAIR_FEE__UOM_UOM__PRODUCT_UOM",
"relation_type":"DER1N",
"code_name":"Odoo_product_uom",
......@@ -1360,6 +1360,22 @@ public class Res_partnerDTO extends DTOBase implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long countryId;
/**
* 属性 [SUPPLIER_RANK]
*
*/
@JSONField(name = "supplier_rank")
@JsonProperty("supplier_rank")
private Integer supplierRank;
/**
* 属性 [CUSTOMER_RANK]
*
*/
@JSONField(name = "customer_rank")
@JsonProperty("customer_rank")
private Integer customerRank;
/**
* 设置 [TYPE]
......@@ -1857,6 +1873,22 @@ public class Res_partnerDTO extends DTOBase implements Serializable {
this.modify("country_id",countryId);
}
/**
* 设置 [SUPPLIER_RANK]
*/
public void setSupplierRank(Integer supplierRank){
this.supplierRank = supplierRank ;
this.modify("supplier_rank",supplierRank);
}
/**
* 设置 [CUSTOMER_RANK]
*/
public void setCustomerRank(Integer customerRank){
this.customerRank = customerRank ;
this.modify("customer_rank",customerRank);
}
}
......
......@@ -19,7 +19,7 @@ import java.util.Optional;
import java.util.function.Function;
@Component
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.token.util:SimpleTokenUtil}'.equals('SimpleTokenUtil')")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.token.util:UAATokenUtil}'.equals('SimpleTokenUtil')")
public class SimpleTokenUtil implements AuthTokenUtil,Serializable {
private static final long serialVersionUID = -3301605591108950415L;
......
......@@ -30,7 +30,7 @@ import java.util.Map;
import java.util.function.Function;
@Component
@ConditionalOnExpression("${ibiz.enablePermissionValid:false}||'${ibiz.auth.token.util:SimpleTokenUtil}'.equals('UAATokenUtil')")
@ConditionalOnExpression("${ibiz.enablePermissionValid:false}||'${ibiz.auth.token.util:UAATokenUtil}'.equals('UAATokenUtil')")
public class UAATokenUtil implements AuthTokenUtil, Serializable {
private static final long serialVersionUID = -3301605591108950415L;
......
......@@ -15,12 +15,12 @@ public interface AuthenticationUserService extends UserDetailsService {
@Override
@Cacheable( value="businesscentral_users",key = "'getByUsername:'+#p0")
@Cacheable( value="ibzuaa_users",key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByUsername(String username);
@Cacheable( value="businesscentral_users",key = "'getByUsername:'+#p0")
@Cacheable( value="ibzuaa_users",key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByLogin(String username,String password);
@CacheEvict( value="businesscentral_users",key = "'getByUsername:'+#p0")
@CacheEvict( value="ibzuaa_users",key = "'getByUsername:'+#p0")
void resetByUsername(String username);
}
......@@ -26,7 +26,7 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
@Value("${ibiz.admin.userid:0100}")
private String adminuserid;
@Cacheable( value="businesscentral_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
@Cacheable( value="ibzrt_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public JSONObject getConfig(String cfgType,String targetType,String userId)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
......@@ -41,7 +41,7 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
return JSON.parseObject(config.getCfg());
}
@CacheEvict( value="businesscentral_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
@CacheEvict( value="ibzrt_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public boolean saveConfig(String cfgType,String targetType,String userId,JSONObject config)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
......@@ -52,7 +52,7 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
return this.saveOrUpdate(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).cfg(cfg).updateDate(DataObject.getNow()).build());
}
@CacheEvict( value="businesscentral_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
@CacheEvict( value="ibzrt_configs",key = "'cfgid:'+#p0+'||'+#p1+'||'+#p2")
public void resetConfig(String cfgType,String targetType,String userId)
{
if(StringUtils.isEmpty(userId)||StringUtils.isEmpty(cfgType)||StringUtils.isEmpty(targetType))
......
......@@ -18,7 +18,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
* 实体[IBZUSER] 服务对象接口实现
*/
@Service("IBZUAAUserService")
@ConditionalOnExpression("${ibiz.enablePermissionValid:false}||'${ibiz.auth.service:SimpleUserService}'.equals('IBZUAAUserService')")
@ConditionalOnExpression("${ibiz.enablePermissionValid:false}||'${ibiz.auth.service:IBZUAAUserService}'.equals('IBZUAAUserService')")
public class IBZUAAUserService implements AuthenticationUserService{
@Autowired
......
......@@ -20,7 +20,7 @@ import org.springframework.security.core.authority.AuthorityUtils;
* 实体[IBZUSER] 服务对象接口实现
*/
@Service("IBZUSERService")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('IBZUSERService')")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:IBZUAAUserService}'.equals('IBZUSERService')")
public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> implements IBZUSERService,AuthenticationUserService{
@Value("${ibiz.auth.pwencrymode:0}")
......
......@@ -18,7 +18,7 @@ import org.springframework.security.core.authority.AuthorityUtils;
*/
@Primary
@Service("SimpleUserService")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('SimpleUserService')")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:IBZUAAUserService}'.equals('SimpleUserService')")
public class SimpleUserService implements AuthenticationUserService{
@Override
......
......@@ -89,7 +89,7 @@ ribbon:
#系统是否开启权限验证、是否开启缓存
#缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz:
enablePermissionValid: false
enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
### jobs
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册