开始
This commit is contained in:
@@ -92,5 +92,9 @@
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.56" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -2,21 +2,19 @@ package com.cwhelp.modules.business.domain;
|
||||
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
import org.hibernate.annotations.Where;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
@@ -38,19 +36,27 @@ public class BssGoods implements Serializable {
|
||||
// 数量
|
||||
private Integer num;
|
||||
// 细节金额
|
||||
private BigDecimal detail_amount;
|
||||
@Column(name = "detail_amount")
|
||||
private BigDecimal detailAmount;
|
||||
// 税额
|
||||
private BigDecimal tax_amount;
|
||||
@Column(name = "tax_amount")
|
||||
private BigDecimal taxAmount;
|
||||
// 税率
|
||||
private String tax_rate;
|
||||
@Column(name = "tax_rate")
|
||||
private String taxRate;
|
||||
// 单位
|
||||
private String unit;
|
||||
// 单价
|
||||
private String unit_price;
|
||||
@Column(name = "unit_price")
|
||||
private String unitPrice;
|
||||
// 规格型号
|
||||
private String specification;
|
||||
// 增值税
|
||||
private Integer vat_invoice_id;
|
||||
@OneToOne(fetch=FetchType.LAZY)
|
||||
@NotFound(action= NotFoundAction.IGNORE)
|
||||
@JoinColumn(name="vat_invoice_id")
|
||||
@JsonIgnore
|
||||
private BssVatInvoice vatInvoice;
|
||||
// 创建时间
|
||||
@CreatedDate
|
||||
private Date createDate;
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.cwhelp.modules.business.domain;
|
||||
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
import org.hibernate.annotations.Where;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/26
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name="bss_vat_invoice")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Where(clause = StatusUtil.notDelete)
|
||||
public class BssVatInvoice implements Serializable {
|
||||
// 主键ID
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
// 发票代码
|
||||
@Column(name = "invoice_code")
|
||||
private String invoiceCode;
|
||||
// 发票号码
|
||||
@Column(name = "invoice_no")
|
||||
private String invoiceNo;
|
||||
// 发票日期
|
||||
@Column(name = "invoice_date")
|
||||
private String invoiceDate;
|
||||
// 校验码
|
||||
@Column(name = "check_code")
|
||||
private String checkCode;
|
||||
// 机器编码
|
||||
@Column(name = "machine_no")
|
||||
private String machineNo;
|
||||
// 发票金额
|
||||
@Column(name = "invoice_money")
|
||||
private BigDecimal invoiceMoney;
|
||||
// 税额
|
||||
@Column(name = "tax_amount")
|
||||
private BigDecimal taxAmount;
|
||||
// 总金额
|
||||
@Column(name = "total_amount")
|
||||
private BigDecimal totalAmount;
|
||||
// 总金额(大写)
|
||||
@Column(name = "total_amount_cn")
|
||||
private String totalAmountCn;
|
||||
@Column(name = "invoice_type")
|
||||
private Integer invoiceType;
|
||||
|
||||
// 备注
|
||||
private String remark;
|
||||
// 购买方纳税人信息
|
||||
@OneToOne(fetch=FetchType.LAZY)
|
||||
@NotFound(action= NotFoundAction.IGNORE)
|
||||
@JoinColumn(name="buy_tax_info_id")
|
||||
@JsonIgnore
|
||||
private BssTaxinfo buyTaxInfo;
|
||||
// 销售方纳税人信息
|
||||
// 购买方纳税人信息
|
||||
@OneToOne(fetch=FetchType.LAZY)
|
||||
@NotFound(action= NotFoundAction.IGNORE)
|
||||
@JoinColumn(name="saler_tax_info_id")
|
||||
@JsonIgnore
|
||||
private BssTaxinfo salerTaxInfo;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
|
||||
@JoinColumn(name="vatInvoice",referencedColumnName = "id")
|
||||
private List<BssGoods> bssGoods;
|
||||
// 状态
|
||||
private Byte status = StatusEnum.OK.getCode();
|
||||
// 创建时间
|
||||
@CreatedDate
|
||||
private Date createDate;
|
||||
// 更新时间
|
||||
@LastModifiedDate
|
||||
private Date updateDate;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.cwhelp.modules.business.repository;
|
||||
|
||||
import com.cwhelp.modules.business.domain.BssVatInvoice;
|
||||
import com.cwhelp.modules.system.repository.BaseRepository;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/26
|
||||
*/
|
||||
public interface BssVatInvoiceRepository extends BaseRepository<BssVatInvoice, Long> {
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.cwhelp.modules.business.service;
|
||||
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.modules.business.domain.BssVatInvoice;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/26
|
||||
*/
|
||||
public interface BssVatInvoiceService {
|
||||
|
||||
/**
|
||||
* 获取分页列表数据
|
||||
* @param example 查询实例
|
||||
* @return 返回分页数据
|
||||
*/
|
||||
Page<BssVatInvoice> getPageList(Example<BssVatInvoice> example);
|
||||
|
||||
/**
|
||||
* 根据ID查询数据
|
||||
* @param id 主键ID
|
||||
*/
|
||||
BssVatInvoice getById(Long id);
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @param bssVatInvoice 实体对象
|
||||
*/
|
||||
BssVatInvoice save(BssVatInvoice bssVatInvoice);
|
||||
|
||||
/**
|
||||
* 状态(启用,冻结,删除)/批量状态处理
|
||||
*/
|
||||
@Transactional
|
||||
Boolean updateStatus(StatusEnum statusEnum, List<Long> idList);
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.cwhelp.modules.business.service.impl;
|
||||
|
||||
import com.cwhelp.common.data.PageSort;
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.modules.business.domain.BssVatInvoice;
|
||||
import com.cwhelp.modules.business.repository.BssVatInvoiceRepository;
|
||||
import com.cwhelp.modules.business.service.BssVatInvoiceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/26
|
||||
*/
|
||||
@Service
|
||||
public class BssVatInvoiceServiceImpl implements BssVatInvoiceService {
|
||||
|
||||
@Autowired
|
||||
private BssVatInvoiceRepository bssVatInvoiceRepository;
|
||||
|
||||
/**
|
||||
* 根据ID查询数据
|
||||
* @param id 主键ID
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public BssVatInvoice getById(Long id) {
|
||||
return bssVatInvoiceRepository.findById(id).orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表数据
|
||||
* @param example 查询实例
|
||||
* @return 返回分页数据
|
||||
*/
|
||||
@Override
|
||||
public Page<BssVatInvoice> getPageList(Example<BssVatInvoice> example) {
|
||||
// 创建分页对象
|
||||
PageRequest page = PageSort.pageRequest();
|
||||
return bssVatInvoiceRepository.findAll(example, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @param bssVatInvoice 实体对象
|
||||
*/
|
||||
@Override
|
||||
public BssVatInvoice save(BssVatInvoice bssVatInvoice) {
|
||||
return bssVatInvoiceRepository.save(bssVatInvoice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态(启用,冻结,删除)/批量状态处理
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean updateStatus(StatusEnum statusEnum, List<Long> idList) {
|
||||
return bssVatInvoiceRepository.updateStatus(statusEnum.getCode(), idList) > 0;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@
|
||||
<orderEntry type="module" module-name="excel" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
|
||||
@@ -113,5 +112,9 @@
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.56" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Reference in New Issue
Block a user