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

xignzi006 发布系统代码

上级 dd08f560
package cn.ibizlab.businesscentral.core.extensions.service;
import cn.ibizlab.businesscentral.core.odoo_ir.service.impl.Ir_sequenceServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[序列] 自定义服务对象
*/
@Slf4j
@Primary
@Service("Ir_sequenceExService")
public class Ir_sequenceExService extends Ir_sequenceServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[Next_by_code]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public Ir_sequence next_by_code(Ir_sequence et) {
return super.next_by_code(et);
}
}
......@@ -176,6 +176,9 @@ public class Res_companyServiceImpl extends ServiceImpl<Res_companyMapper, Res_c
protected cn.ibizlab.businesscentral.core.odoo_iap.service.IIap_accountService iapAccountService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequenceService irSequenceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_lunch.service.ILunch_orderService lunchOrderService;
@Autowired
@Lazy
......
......@@ -536,6 +536,12 @@ public class Res_usersServiceImpl extends ServiceImpl<Res_usersMapper, Res_users
protected cn.ibizlab.businesscentral.core.odoo_im_livechat.service.IIm_livechat_channelService imLivechatChannelService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequence_date_rangeService irSequenceDateRangeService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequenceService irSequenceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_lunch.service.ILunch_alertService lunchAlertService;
@Autowired
@Lazy
......
package cn.ibizlab.businesscentral.core.odoo_ir.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.businesscentral.util.helper.DataObject;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
/**
* 实体[序列]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IR_SEQUENCE",resultMap = "Ir_sequenceResultMap")
public class Ir_sequence 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;
/**
* 代码
*/
@TableField(value = "code")
@JSONField(name = "code")
@JsonProperty("code")
private String code;
/**
* 实施
*/
@TableField(value = "implementation")
@JSONField(name = "implementation")
@JsonProperty("implementation")
private String implementation;
/**
* 活动
*/
@TableField(value = "active")
@JSONField(name = "active")
@JsonProperty("active")
private Boolean active;
/**
* 前缀
*/
@TableField(value = "prefix")
@JSONField(name = "prefix")
@JsonProperty("prefix")
private String prefix;
/**
* 后缀
*/
@TableField(value = "suffix")
@JSONField(name = "suffix")
@JsonProperty("suffix")
private String suffix;
/**
* Next
*/
@DEField(name = "number_next")
@TableField(value = "number_next")
@JSONField(name = "number_next")
@JsonProperty("number_next")
private Integer numberNext;
/**
* 增量
*/
@DEField(name = "number_increment")
@TableField(value = "number_increment")
@JSONField(name = "number_increment")
@JsonProperty("number_increment")
private Integer numberIncrement;
/**
* Padding
*/
@TableField(value = "padding")
@JSONField(name = "padding")
@JsonProperty("padding")
private Integer padding;
/**
* 每个日期范围使用不同序号
*/
@DEField(name = "use_date_range")
@TableField(value = "use_date_range")
@JSONField(name = "use_date_range")
@JsonProperty("use_date_range")
private Boolean useDateRange;
/**
* 创建人
*/
@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)
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
private String writeUname;
/**
* 最后更新人
*/
@DEField(name = "write_uid")
@TableField(value = "write_uid")
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
private Long writeUid;
/**
* 公司
*/
@DEField(name = "company_id")
@TableField(value = "company_id")
@JSONField(name = "company_id")
@JsonProperty("company_id")
private Long companyId;
/**
* 创建时间
*/
@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;
/**
* next_code_value
*/
@TableField(exist = false)
@JSONField(name = "next_code_value")
@JsonProperty("next_code_value")
private String nextCodeValue;
/**
* 公司
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_company odooCompany;
/**
*
*/
@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 setCode(String code){
this.code = code ;
this.modify("code",code);
}
/**
* 设置 [实施]
*/
public void setImplementation(String implementation){
this.implementation = implementation ;
this.modify("implementation",implementation);
}
/**
* 设置 [活动]
*/
public void setActive(Boolean active){
this.active = active ;
this.modify("active",active);
}
/**
* 设置 [前缀]
*/
public void setPrefix(String prefix){
this.prefix = prefix ;
this.modify("prefix",prefix);
}
/**
* 设置 [后缀]
*/
public void setSuffix(String suffix){
this.suffix = suffix ;
this.modify("suffix",suffix);
}
/**
* 设置 [Next]
*/
public void setNumberNext(Integer numberNext){
this.numberNext = numberNext ;
this.modify("number_next",numberNext);
}
/**
* 设置 [增量]
*/
public void setNumberIncrement(Integer numberIncrement){
this.numberIncrement = numberIncrement ;
this.modify("number_increment",numberIncrement);
}
/**
* 设置 [Padding]
*/
public void setPadding(Integer padding){
this.padding = padding ;
this.modify("padding",padding);
}
/**
* 设置 [每个日期范围使用不同序号]
*/
public void setUseDateRange(Boolean useDateRange){
this.useDateRange = useDateRange ;
this.modify("use_date_range",useDateRange);
}
/**
* 设置 [创建人]
*/
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 setCompanyId(Long companyId){
this.companyId = companyId ;
this.modify("company_id",companyId);
}
/**
* 设置 [创建时间]
*/
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);
}
@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_ir.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.businesscentral.util.helper.DataObject;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
/**
* 实体[序列日期范围]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IR_SEQUENCE_DATE_RANGE",resultMap = "Ir_sequence_date_rangeResultMap")
public class Ir_sequence_date_range extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 创建人
*/
@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;
/**
* 最后更新人
*/
@TableField(exist = false)
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
private String writeUname;
/**
* 最后更新人
*/
@DEField(name = "write_uid")
@TableField(value = "write_uid")
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
private Long writeUid;
/**
* ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.AUTO)
@JSONField(name = "id")
@JsonProperty("id")
private Long id;
/**
* 起始日期
*/
@DEField(name = "date_from")
@TableField(value = "date_from")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "date_from" , format="yyyy-MM-dd")
@JsonProperty("date_from")
private Timestamp dateFrom;
/**
* 结束日期
*/
@DEField(name = "date_to")
@TableField(value = "date_to")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "date_to" , format="yyyy-MM-dd")
@JsonProperty("date_to")
private Timestamp dateTo;
/**
* Next
*/
@DEField(name = "number_next")
@TableField(value = "number_next")
@JSONField(name = "number_next")
@JsonProperty("number_next")
private Integer numberNext;
/**
* ID
*/
@DEField(name = "sequence_id")
@TableField(value = "sequence_id")
@JSONField(name = "sequence_id")
@JsonProperty("sequence_id")
private Long sequenceId;
/**
* 创建时间
*/
@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;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence odooSequence;
/**
*
*/
@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 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 setDateFrom(Timestamp dateFrom){
this.dateFrom = dateFrom ;
this.modify("date_from",dateFrom);
}
/**
* 格式化日期 [起始日期]
*/
public String formatDateFrom(){
if (this.dateFrom == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(dateFrom);
}
/**
* 设置 [结束日期]
*/
public void setDateTo(Timestamp dateTo){
this.dateTo = dateTo ;
this.modify("date_to",dateTo);
}
/**
* 格式化日期 [结束日期]
*/
public String formatDateTo(){
if (this.dateTo == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(dateTo);
}
/**
* 设置 [Next]
*/
public void setNumberNext(Integer numberNext){
this.numberNext = numberNext ;
this.modify("number_next",numberNext);
}
/**
* 设置 [ID]
*/
public void setSequenceId(Long sequenceId){
this.sequenceId = sequenceId ;
this.modify("sequence_id",sequenceId);
}
/**
* 设置 [创建时间]
*/
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);
}
@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_ir.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_ir.domain.Ir_sequence;
/**
* 关系型数据实体[Ir_sequence] 查询条件对象
*/
@Slf4j
@Data
public class Ir_sequenceSearchContext extends QueryWrapperContext<Ir_sequence> {
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_code_eq;//[代码]
public void setN_code_eq(String n_code_eq) {
this.n_code_eq = n_code_eq;
if(!ObjectUtils.isEmpty(this.n_code_eq)){
this.getSearchCond().eq("code", n_code_eq);
}
}
private String n_implementation_eq;//[实施]
public void setN_implementation_eq(String n_implementation_eq) {
this.n_implementation_eq = n_implementation_eq;
if(!ObjectUtils.isEmpty(this.n_implementation_eq)){
this.getSearchCond().eq("implementation", n_implementation_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_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_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_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_company_id_eq;//[公司]
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);
}
}
/**
* 启用快速搜索
*/
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_ir.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_ir.domain.Ir_sequence_date_range;
/**
* 关系型数据实体[Ir_sequence_date_range] 查询条件对象
*/
@Slf4j
@Data
public class Ir_sequence_date_rangeSearchContext extends QueryWrapperContext<Ir_sequence_date_range> {
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 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_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_sequence_id_eq;//[ID]
public void setN_sequence_id_eq(Long n_sequence_id_eq) {
this.n_sequence_id_eq = n_sequence_id_eq;
if(!ObjectUtils.isEmpty(this.n_sequence_id_eq)){
this.getSearchCond().eq("sequence_id", n_sequence_id_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
}
}
}
package cn.ibizlab.businesscentral.core.odoo_ir.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_ir.domain.Ir_sequence;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequenceSearchContext;
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 Ir_sequenceMapper extends BaseMapper<Ir_sequence>{
Page<Ir_sequence> searchDefault(IPage page, @Param("srf") Ir_sequenceSearchContext context, @Param("ew") Wrapper<Ir_sequence> wrapper) ;
@Override
Ir_sequence selectById(Serializable id);
@Override
int insert(Ir_sequence entity);
@Override
int updateById(@Param(Constants.ENTITY) Ir_sequence entity);
@Override
int update(@Param(Constants.ENTITY) Ir_sequence entity, @Param("ew") Wrapper<Ir_sequence> 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<Ir_sequence> selectByCompanyId(@Param("id") Serializable id) ;
List<Ir_sequence> selectByCreateUid(@Param("id") Serializable id) ;
List<Ir_sequence> selectByWriteUid(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_ir.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_ir.domain.Ir_sequence_date_range;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequence_date_rangeSearchContext;
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 Ir_sequence_date_rangeMapper extends BaseMapper<Ir_sequence_date_range>{
Page<Ir_sequence_date_range> searchDefault(IPage page, @Param("srf") Ir_sequence_date_rangeSearchContext context, @Param("ew") Wrapper<Ir_sequence_date_range> wrapper) ;
@Override
Ir_sequence_date_range selectById(Serializable id);
@Override
int insert(Ir_sequence_date_range entity);
@Override
int updateById(@Param(Constants.ENTITY) Ir_sequence_date_range entity);
@Override
int update(@Param(Constants.ENTITY) Ir_sequence_date_range entity, @Param("ew") Wrapper<Ir_sequence_date_range> 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<Ir_sequence_date_range> selectBySequenceId(@Param("id") Serializable id) ;
List<Ir_sequence_date_range> selectByCreateUid(@Param("id") Serializable id) ;
List<Ir_sequence_date_range> selectByWriteUid(@Param("id") Serializable id) ;
}
package cn.ibizlab.businesscentral.core.odoo_ir.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_ir.domain.Ir_sequence;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequenceSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Ir_sequence] 服务对象接口
*/
public interface IIr_sequenceService extends IService<Ir_sequence>{
boolean create(Ir_sequence et) ;
void createBatch(List<Ir_sequence> list) ;
boolean update(Ir_sequence et) ;
void updateBatch(List<Ir_sequence> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Ir_sequence get(Long key) ;
Ir_sequence getDraft(Ir_sequence et) ;
boolean checkKey(Ir_sequence et) ;
Ir_sequence next_by_code(Ir_sequence et) ;
boolean save(Ir_sequence et) ;
void saveBatch(List<Ir_sequence> list) ;
Page<Ir_sequence> searchDefault(Ir_sequenceSearchContext context) ;
List<Ir_sequence> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Ir_sequence> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Ir_sequence> 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_ir.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_ir.domain.Ir_sequence_date_range;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequence_date_rangeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Ir_sequence_date_range] 服务对象接口
*/
public interface IIr_sequence_date_rangeService extends IService<Ir_sequence_date_range>{
boolean create(Ir_sequence_date_range et) ;
void createBatch(List<Ir_sequence_date_range> list) ;
boolean update(Ir_sequence_date_range et) ;
void updateBatch(List<Ir_sequence_date_range> list) ;
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Ir_sequence_date_range get(Long key) ;
Ir_sequence_date_range getDraft(Ir_sequence_date_range et) ;
boolean checkKey(Ir_sequence_date_range et) ;
boolean save(Ir_sequence_date_range et) ;
void saveBatch(List<Ir_sequence_date_range> list) ;
Page<Ir_sequence_date_range> searchDefault(Ir_sequence_date_rangeSearchContext context) ;
List<Ir_sequence_date_range> selectBySequenceId(Long id) ;
void removeBySequenceId(Long id) ;
List<Ir_sequence_date_range> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Ir_sequence_date_range> 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_ir.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_ir.domain.Ir_sequence;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequenceSearchContext;
import cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequenceService;
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_ir.mapper.Ir_sequenceMapper;
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("Ir_sequenceServiceImpl")
public class Ir_sequenceServiceImpl extends ServiceImpl<Ir_sequenceMapper, Ir_sequence> implements IIr_sequenceService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequence_date_rangeService irSequenceDateRangeService;
@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;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Ir_sequence 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<Ir_sequence> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Ir_sequence 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<Ir_sequence> 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 Ir_sequence get(Long key) {
Ir_sequence et = getById(key);
if(et==null){
et=new Ir_sequence();
et.setId(key);
}
else{
}
return et;
}
@Override
public Ir_sequence getDraft(Ir_sequence et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Ir_sequence et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public Ir_sequence next_by_code(Ir_sequence et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean save(Ir_sequence et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Ir_sequence et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Ir_sequence> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Ir_sequence> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Ir_sequence> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Ir_sequence>().eq("company_id",id));
}
@Override
public List<Ir_sequence> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Ir_sequence>().eq("create_uid",id));
}
@Override
public List<Ir_sequence> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Ir_sequence>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Ir_sequence> searchDefault(Ir_sequenceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Ir_sequence> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Ir_sequence>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Ir_sequence et){
//实体关系[DER1N_IR_SEQUENCE_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_IR_SEQUENCE_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_ir.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_ir.domain.Ir_sequence_date_range;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequence_date_rangeSearchContext;
import cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequence_date_rangeService;
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_ir.mapper.Ir_sequence_date_rangeMapper;
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("Ir_sequence_date_rangeServiceImpl")
public class Ir_sequence_date_rangeServiceImpl extends ServiceImpl<Ir_sequence_date_rangeMapper, Ir_sequence_date_range> implements IIr_sequence_date_rangeService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequenceService irSequenceService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_base.service.IRes_usersService resUsersService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Ir_sequence_date_range 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<Ir_sequence_date_range> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Ir_sequence_date_range 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<Ir_sequence_date_range> 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 Ir_sequence_date_range get(Long key) {
Ir_sequence_date_range et = getById(key);
if(et==null){
et=new Ir_sequence_date_range();
et.setId(key);
}
else{
}
return et;
}
@Override
public Ir_sequence_date_range getDraft(Ir_sequence_date_range et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Ir_sequence_date_range et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Ir_sequence_date_range et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Ir_sequence_date_range et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Ir_sequence_date_range> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Ir_sequence_date_range> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Ir_sequence_date_range> selectBySequenceId(Long id) {
return baseMapper.selectBySequenceId(id);
}
@Override
public void removeBySequenceId(Long id) {
this.remove(new QueryWrapper<Ir_sequence_date_range>().eq("sequence_id",id));
}
@Override
public List<Ir_sequence_date_range> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Ir_sequence_date_range>().eq("create_uid",id));
}
@Override
public List<Ir_sequence_date_range> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Ir_sequence_date_range>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Ir_sequence_date_range> searchDefault(Ir_sequence_date_rangeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Ir_sequence_date_range> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Ir_sequence_date_range>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Ir_sequence_date_range et){
//实体关系[DER1N_IR_SEQUENCE_DATE_RANGE_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_IR_SEQUENCE_DATE_RANGE_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;
}
}
......@@ -221,6 +221,13 @@ public class Purchase_requisition_line extends EntityMP implements Serializable
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
* 已订购数量
*/
@TableField(exist = false)
@JSONField(name = "qty_ordered")
@JsonProperty("qty_ordered")
private Integer qtyOrdered;
/**
*
......
......@@ -513,6 +513,12 @@
<!--输出实体[IM_LIVECHAT_REPORT_OPERATOR]数据结构 -->
<!--输出实体[IR_SEQUENCE]数据结构 -->
<!--输出实体[IR_SEQUENCE_DATE_RANGE]数据结构 -->
<!--输出实体[LUNCH_ALERT]数据结构 -->
......@@ -1366,6 +1372,8 @@
<!--输出实体[IM_LIVECHAT_CHANNEL_RULE]外键关系 -->
<!--输出实体[IM_LIVECHAT_REPORT_CHANNEL]外键关系 -->
<!--输出实体[IM_LIVECHAT_REPORT_OPERATOR]外键关系 -->
<!--输出实体[IR_SEQUENCE]外键关系 -->
<!--输出实体[IR_SEQUENCE_DATE_RANGE]外键关系 -->
<!--输出实体[LUNCH_ALERT]外键关系 -->
<!--输出实体[LUNCH_CASHMOVE]外键关系 -->
<!--输出实体[LUNCH_ORDER]外键关系 -->
......
<?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_ir.mapper.Ir_sequenceMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Ir_sequenceResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t1.CODE, t1.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.ID, t1.IMPLEMENTATION, t1.NAME, t1.NUMBER_INCREMENT, t1.NUMBER_NEXT, t1.PADDING, t1.PREFIX, t1.SUFFIX, t1.USE_DATE_RANGE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE 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 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Ir_sequenceResultMap" type="cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="numberNext" column="number_next" />
<result property="numberIncrement" column="number_increment" />
<result property="useDateRange" column="use_date_range" />
<result property="createUid" column="create_uid" />
<result property="createUname" column="create_uname" />
<result property="writeUname" column="write_uname" />
<result property="writeUid" column="write_uid" />
<result property="companyId" column="company_id" />
<result property="createDate" column="create_date" />
<result property="writeDate" column="write_date" />
<result property="nextCodeValue" column="next_code_value" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooCompany" 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>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_RES_COMPANY_COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Ir_sequenceResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_RES_USERS_CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Ir_sequenceResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Ir_sequenceResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequenceSearchContext" resultMap="Ir_sequenceResultMap">
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.ACTIVE, t1.CODE, t1.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.ID, t1.IMPLEMENTATION, t1.NAME, t1.NUMBER_INCREMENT, t1.NUMBER_NEXT, t1.PADDING, t1.PREFIX, t1.SUFFIX, t1.USE_DATE_RANGE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE 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
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.CODE, t1.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.ID, t1.IMPLEMENTATION, t1.NAME, t1.NUMBER_INCREMENT, t1.NUMBER_NEXT, t1.PADDING, t1.PREFIX, t1.SUFFIX, t1.USE_DATE_RANGE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE 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
]]>
</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_ir.mapper.Ir_sequence_date_rangeMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Ir_sequence_date_rangeResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.DATE_FROM, t1.DATE_TO, t1.ID, t1.NUMBER_NEXT, t1.SEQUENCE_ID, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE_DATE_RANGE 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 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Ir_sequence_date_rangeResultMap" type="cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence_date_range" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="createUname" column="create_uname" />
<result property="createUid" column="create_uid" />
<result property="writeUname" column="write_uname" />
<result property="writeUid" column="write_uid" />
<result property="dateFrom" column="date_from" />
<result property="dateTo" column="date_to" />
<result property="numberNext" column="number_next" />
<result property="sequenceId" column="sequence_id" />
<result property="createDate" column="create_date" />
<result property="writeDate" column="write_date" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooSequence" javaType="cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence" column="sequence_id" select="cn.ibizlab.businesscentral.core.odoo_ir.mapper.Ir_sequenceMapper.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>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_DATE_RANGE_IR_SEQUENCE_SEQUENCE_ID] -->
<select id="selectBySequenceId" resultMap="Ir_sequence_date_rangeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where sequence_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_DATE_RANGE_RES_USERS_CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Ir_sequence_date_rangeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_IR_SEQUENCE_DATE_RANGE_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Ir_sequence_date_rangeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequence_date_rangeSearchContext" resultMap="Ir_sequence_date_rangeResultMap">
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, t21.NAME AS CREATE_UNAME, t1.DATE_FROM, t1.DATE_TO, t1.ID, t1.NUMBER_NEXT, t1.SEQUENCE_ID, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE_DATE_RANGE 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
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UNAME, t1.DATE_FROM, t1.DATE_TO, t1.ID, t1.NUMBER_NEXT, t1.SEQUENCE_ID, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UNAME FROM IR_SEQUENCE_DATE_RANGE 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
]]>
</sql>
</mapper>
......@@ -33,6 +33,7 @@
<result property="moveDestName" column="move_dest_name" />
<result property="productUomName" column="product_uom_name" />
<result property="LastUpdate" column="__last_update" />
<result property="qtyOrdered" column="qty_ordered" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......
package cn.ibizlab.businesscentral.core.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import cn.ibizlab.businesscentral.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[Ir_sequenceDTO]
*/
@Data
public class Ir_sequenceDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 属性 [NAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@NotBlank(message = "[序列名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [CODE]
*
*/
@JSONField(name = "code")
@JsonProperty("code")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String code;
/**
* 属性 [IMPLEMENTATION]
*
*/
@JSONField(name = "implementation")
@JsonProperty("implementation")
@Size(min = 0, max = 60, message = "内容长度必须小于等于[60]")
private String implementation;
/**
* 属性 [ACTIVE]
*
*/
@JSONField(name = "active")
@JsonProperty("active")
private Boolean active;
/**
* 属性 [PREFIX]
*
*/
@JSONField(name = "prefix")
@JsonProperty("prefix")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String prefix;
/**
* 属性 [SUFFIX]
*
*/
@JSONField(name = "suffix")
@JsonProperty("suffix")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String suffix;
/**
* 属性 [NUMBER_NEXT]
*
*/
@JSONField(name = "number_next")
@JsonProperty("number_next")
private Integer numberNext;
/**
* 属性 [NUMBER_INCREMENT]
*
*/
@JSONField(name = "number_increment")
@JsonProperty("number_increment")
private Integer numberIncrement;
/**
* 属性 [PADDING]
*
*/
@JSONField(name = "padding")
@JsonProperty("padding")
private Integer padding;
/**
* 属性 [USE_DATE_RANGE]
*
*/
@JSONField(name = "use_date_range")
@JsonProperty("use_date_range")
private Boolean useDateRange;
/**
* 属性 [CREATE_UID]
*
*/
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long createUid;
/**
* 属性 [CREATE_UNAME]
*
*/
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String createUname;
/**
* 属性 [WRITE_UNAME]
*
*/
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String writeUname;
/**
* 属性 [WRITE_UID]
*
*/
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long writeUid;
/**
* 属性 [COMPANY_ID]
*
*/
@JSONField(name = "company_id")
@JsonProperty("company_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long companyId;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 属性 [NEXT_CODE_VALUE]
*
*/
@JSONField(name = "next_code_value")
@JsonProperty("next_code_value")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String nextCodeValue;
/**
* 设置 [NAME]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [CODE]
*/
public void setCode(String code){
this.code = code ;
this.modify("code",code);
}
/**
* 设置 [IMPLEMENTATION]
*/
public void setImplementation(String implementation){
this.implementation = implementation ;
this.modify("implementation",implementation);
}
/**
* 设置 [ACTIVE]
*/
public void setActive(Boolean active){
this.active = active ;
this.modify("active",active);
}
/**
* 设置 [PREFIX]
*/
public void setPrefix(String prefix){
this.prefix = prefix ;
this.modify("prefix",prefix);
}
/**
* 设置 [SUFFIX]
*/
public void setSuffix(String suffix){
this.suffix = suffix ;
this.modify("suffix",suffix);
}
/**
* 设置 [NUMBER_NEXT]
*/
public void setNumberNext(Integer numberNext){
this.numberNext = numberNext ;
this.modify("number_next",numberNext);
}
/**
* 设置 [NUMBER_INCREMENT]
*/
public void setNumberIncrement(Integer numberIncrement){
this.numberIncrement = numberIncrement ;
this.modify("number_increment",numberIncrement);
}
/**
* 设置 [PADDING]
*/
public void setPadding(Integer padding){
this.padding = padding ;
this.modify("padding",padding);
}
/**
* 设置 [USE_DATE_RANGE]
*/
public void setUseDateRange(Boolean useDateRange){
this.useDateRange = useDateRange ;
this.modify("use_date_range",useDateRange);
}
/**
* 设置 [CREATE_UID]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
/**
* 设置 [WRITE_UID]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [COMPANY_ID]
*/
public void setCompanyId(Long companyId){
this.companyId = companyId ;
this.modify("company_id",companyId);
}
/**
* 设置 [CREATE_DATE]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 设置 [WRITE_DATE]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
}
package cn.ibizlab.businesscentral.core.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import cn.ibizlab.businesscentral.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[Ir_sequence_date_rangeDTO]
*/
@Data
public class Ir_sequence_date_rangeDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CREATE_UNAME]
*
*/
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String createUname;
/**
* 属性 [CREATE_UID]
*
*/
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long createUid;
/**
* 属性 [WRITE_UNAME]
*
*/
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String writeUname;
/**
* 属性 [WRITE_UID]
*
*/
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long writeUid;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 属性 [DATE_FROM]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "date_from" , format="yyyy-MM-dd")
@JsonProperty("date_from")
private Timestamp dateFrom;
/**
* 属性 [DATE_TO]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "date_to" , format="yyyy-MM-dd")
@JsonProperty("date_to")
private Timestamp dateTo;
/**
* 属性 [NUMBER_NEXT]
*
*/
@JSONField(name = "number_next")
@JsonProperty("number_next")
private Integer numberNext;
/**
* 属性 [SEQUENCE_ID]
*
*/
@JSONField(name = "sequence_id")
@JsonProperty("sequence_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long sequenceId;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 设置 [CREATE_UID]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
/**
* 设置 [WRITE_UID]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [DATE_FROM]
*/
public void setDateFrom(Timestamp dateFrom){
this.dateFrom = dateFrom ;
this.modify("date_from",dateFrom);
}
/**
* 设置 [DATE_TO]
*/
public void setDateTo(Timestamp dateTo){
this.dateTo = dateTo ;
this.modify("date_to",dateTo);
}
/**
* 设置 [NUMBER_NEXT]
*/
public void setNumberNext(Integer numberNext){
this.numberNext = numberNext ;
this.modify("number_next",numberNext);
}
/**
* 设置 [SEQUENCE_ID]
*/
public void setSequenceId(Long sequenceId){
this.sequenceId = sequenceId ;
this.modify("sequence_id",sequenceId);
}
/**
* 设置 [CREATE_DATE]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 设置 [WRITE_DATE]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
}
......@@ -234,6 +234,14 @@ public class Purchase_requisition_lineDTO extends DTOBase implements Serializabl
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
* 属性 [QTY_ORDERED]
*
*/
@JSONField(name = "qty_ordered")
@JsonProperty("qty_ordered")
private Integer qtyOrdered;
/**
* 设置 [CREATE_DATE]
......
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence;
import cn.ibizlab.businesscentral.core.dto.Ir_sequenceDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CoreIr_sequenceMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Ir_sequenceMapping extends MappingBase<Ir_sequenceDTO, Ir_sequence> {
}
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence_date_range;
import cn.ibizlab.businesscentral.core.dto.Ir_sequence_date_rangeDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CoreIr_sequence_date_rangeMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Ir_sequence_date_rangeMapping extends MappingBase<Ir_sequence_date_rangeDTO, Ir_sequence_date_range> {
}
package cn.ibizlab.businesscentral.core.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.core.dto.*;
import cn.ibizlab.businesscentral.core.mapping.*;
import cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_sequence;
import cn.ibizlab.businesscentral.core.odoo_ir.service.IIr_sequenceService;
import cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_sequenceSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"序列" })
@RestController("Core-ir_sequence")
@RequestMapping("")
public class Ir_sequenceResource {
@Autowired
public IIr_sequenceService ir_sequenceService;
@Autowired
@Lazy
public Ir_sequenceMapping ir_sequenceMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Create-all')")
@ApiOperation(value = "新建序列", tags = {"序列" }, notes = "新建序列")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences")
public ResponseEntity<Ir_sequenceDTO> create(@Validated @RequestBody Ir_sequenceDTO ir_sequencedto) {
Ir_sequence domain = ir_sequenceMapping.toDomain(ir_sequencedto);
ir_sequenceService.create(domain);
Ir_sequenceDTO dto = ir_sequenceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Create-all')")
@ApiOperation(value = "批量新建序列", tags = {"序列" }, notes = "批量新建序列")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<Ir_sequenceDTO> ir_sequencedtos) {
ir_sequenceService.createBatch(ir_sequenceMapping.toDomain(ir_sequencedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Update-all')")
@ApiOperation(value = "更新序列", tags = {"序列" }, notes = "更新序列")
@RequestMapping(method = RequestMethod.PUT, value = "/ir_sequences/{ir_sequence_id}")
public ResponseEntity<Ir_sequenceDTO> update(@PathVariable("ir_sequence_id") Long ir_sequence_id, @RequestBody Ir_sequenceDTO ir_sequencedto) {
Ir_sequence domain = ir_sequenceMapping.toDomain(ir_sequencedto);
domain .setId(ir_sequence_id);
ir_sequenceService.update(domain );
Ir_sequenceDTO dto = ir_sequenceMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Update-all')")
@ApiOperation(value = "批量更新序列", tags = {"序列" }, notes = "批量更新序列")
@RequestMapping(method = RequestMethod.PUT, value = "/ir_sequences/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<Ir_sequenceDTO> ir_sequencedtos) {
ir_sequenceService.updateBatch(ir_sequenceMapping.toDomain(ir_sequencedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Remove-all')")
@ApiOperation(value = "删除序列", tags = {"序列" }, notes = "删除序列")
@RequestMapping(method = RequestMethod.DELETE, value = "/ir_sequences/{ir_sequence_id}")
public ResponseEntity<Boolean> remove(@PathVariable("ir_sequence_id") Long ir_sequence_id) {
return ResponseEntity.status(HttpStatus.OK).body(ir_sequenceService.remove(ir_sequence_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Remove-all')")
@ApiOperation(value = "批量删除序列", tags = {"序列" }, notes = "批量删除序列")
@RequestMapping(method = RequestMethod.DELETE, value = "/ir_sequences/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<Long> ids) {
ir_sequenceService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Get-all')")
@ApiOperation(value = "获取序列", tags = {"序列" }, notes = "获取序列")
@RequestMapping(method = RequestMethod.GET, value = "/ir_sequences/{ir_sequence_id}")
public ResponseEntity<Ir_sequenceDTO> get(@PathVariable("ir_sequence_id") Long ir_sequence_id) {
Ir_sequence domain = ir_sequenceService.get(ir_sequence_id);
Ir_sequenceDTO dto = ir_sequenceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取序列草稿", tags = {"序列" }, notes = "获取序列草稿")
@RequestMapping(method = RequestMethod.GET, value = "/ir_sequences/getdraft")
public ResponseEntity<Ir_sequenceDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(ir_sequenceMapping.toDto(ir_sequenceService.getDraft(new Ir_sequence())));
}
@ApiOperation(value = "检查序列", tags = {"序列" }, notes = "检查序列")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Ir_sequenceDTO ir_sequencedto) {
return ResponseEntity.status(HttpStatus.OK).body(ir_sequenceService.checkKey(ir_sequenceMapping.toDomain(ir_sequencedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Next_by_code-all')")
@ApiOperation(value = "next_by_code", tags = {"序列" }, notes = "next_by_code")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences/{ir_sequence_id}/next_by_code")
public ResponseEntity<Ir_sequenceDTO> next_by_code(@PathVariable("ir_sequence_id") Long ir_sequence_id, @RequestBody Ir_sequenceDTO ir_sequencedto) {
Ir_sequence domain = ir_sequenceMapping.toDomain(ir_sequencedto);
domain.setId(ir_sequence_id);
domain = ir_sequenceService.next_by_code(domain);
ir_sequencedto = ir_sequenceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(ir_sequencedto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Save-all')")
@ApiOperation(value = "保存序列", tags = {"序列" }, notes = "保存序列")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences/save")
public ResponseEntity<Boolean> save(@RequestBody Ir_sequenceDTO ir_sequencedto) {
return ResponseEntity.status(HttpStatus.OK).body(ir_sequenceService.save(ir_sequenceMapping.toDomain(ir_sequencedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-Save-all')")
@ApiOperation(value = "批量保存序列", tags = {"序列" }, notes = "批量保存序列")
@RequestMapping(method = RequestMethod.POST, value = "/ir_sequences/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Ir_sequenceDTO> ir_sequencedtos) {
ir_sequenceService.saveBatch(ir_sequenceMapping.toDomain(ir_sequencedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"序列" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/ir_sequences/fetchdefault")
public ResponseEntity<List<Ir_sequenceDTO>> fetchDefault(Ir_sequenceSearchContext context) {
Page<Ir_sequence> domains = ir_sequenceService.searchDefault(context) ;
List<Ir_sequenceDTO> list = ir_sequenceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_sequence-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"序列" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/ir_sequences/searchdefault")
public ResponseEntity<Page<Ir_sequenceDTO>> searchDefault(@RequestBody Ir_sequenceSearchContext context) {
Page<Ir_sequence> domains = ir_sequenceService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ir_sequenceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册