Commit cd5babc7 by guojuxing

发票管理

parent 36045a9c
package com.gic.finance.dao.mapper;
import com.gic.finance.entity.TabInvoiceAccount;
public interface TabInvoiceAccountMapper {
/**
* 根据主键删除
*
* @param invoiceAccountId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer invoiceAccountId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabInvoiceAccount record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabInvoiceAccount record);
/**
* 根据主键查询
*
* @param invoiceAccountId 主键
* @return 实体对象
*/
TabInvoiceAccount selectByPrimaryKey(Integer invoiceAccountId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabInvoiceAccount record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabInvoiceAccount record);
}
\ No newline at end of file
package com.gic.finance.dao.mapper;
import com.gic.finance.entity.TabInvoiceManage;
import com.gic.finance.qo.InvoiceManageListQueryQO;
import java.util.List;
public interface TabInvoiceManageMapper {
/**
......@@ -50,4 +53,14 @@ public interface TabInvoiceManageMapper {
* @return 更新条目数
*/
int updateByPrimaryKey(TabInvoiceManage record);
/**
* 查询发票列表数据
* @Title: listInvoiceManage

* @Description:

 * @author guojuxing
* @param params

* @return java.util.List<com.gic.finance.entity.TabInvoiceManage>


 */
List<TabInvoiceManage> listInvoiceManage(InvoiceManageListQueryQO params);
}
\ No newline at end of file
package com.gic.finance.entity;
import java.util.Date;
/**
* tab_invoice_account
*/
public class TabInvoiceAccount {
/**
*
*/
private Integer invoiceAccountId;
/**
* 开户单位名称
*/
private String accountName;
/**
* 纳税识别号
*/
private String taxNumber;
/**
* 地址
*/
private String address;
/**
* 开户行
*/
private String bank;
/**
* 开户电话
*/
private String accountPhone;
/**
* 开户账号
*/
private String bankAccount;
/**
* 状态 0 :删除 1:启用 2:停用
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getInvoiceAccountId() {
return invoiceAccountId;
}
public void setInvoiceAccountId(Integer invoiceAccountId) {
this.invoiceAccountId = invoiceAccountId;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getTaxNumber() {
return taxNumber;
}
public void setTaxNumber(String taxNumber) {
this.taxNumber = taxNumber;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBank() {
return bank;
}
public void setBank(String bank) {
this.bank = bank;
}
public String getAccountPhone() {
return accountPhone;
}
public void setAccountPhone(String accountPhone) {
this.accountPhone = accountPhone;
}
public String getBankAccount() {
return bankAccount;
}
public void setBankAccount(String bankAccount) {
this.bankAccount = bankAccount;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.gic.finance.service;
import com.gic.finance.dto.InvoiceManageDTO;
import com.gic.finance.entity.TabInvoiceManage;
import com.gic.finance.qo.InvoiceManageListQueryQO;
import com.github.pagehelper.Page;
/**
* 发票管理
......@@ -40,4 +42,14 @@ public interface InvoiceManageService {
* @return void


 */
void update(InvoiceManageDTO invoiceManageDTO);
/**
* 分页查询发票列表
* @Title: listInvoiceManage

* @Description:

 * @author guojuxing
* @param params

* @return com.github.pagehelper.Page<com.gic.finance.entity.TabInvoiceManage>


 */
Page<TabInvoiceManage> listInvoiceManage(InvoiceManageListQueryQO params);
}
package com.gic.finance.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.finance.qo.InvoiceManageListQueryQO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -10,6 +13,7 @@ import com.gic.finance.entity.TabInvoiceManage;
import com.gic.finance.service.InvoiceManageService;
import java.util.Date;
import java.util.List;
@Service("invoiceManageService")
public class InvoiceManageServiceImpl implements InvoiceManageService{
......@@ -32,4 +36,11 @@ public class InvoiceManageServiceImpl implements InvoiceManageService{
TabInvoiceManage tabInvoiceManage = EntityUtil.changeEntityNew(TabInvoiceManage.class, invoiceManageDTO);
tabInvoiceManageMapper.updateByPrimaryKeySelective(tabInvoiceManage);
}
@Override
public Page<TabInvoiceManage> listInvoiceManage(InvoiceManageListQueryQO params) {
PageHelper.startPage(params.getCurrentPage(), params.getPageSize());
List<TabInvoiceManage> list = tabInvoiceManageMapper.listInvoiceManage(params);
return (Page<TabInvoiceManage>) list;
}
}
......@@ -6,11 +6,15 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import com.gic.finance.constant.InvoiceStatusEnum;
import com.gic.finance.dto.InvoiceManageDTO;
import com.gic.finance.entity.TabInvoiceManage;
import com.gic.finance.qo.InvoiceManageListQueryQO;
import com.gic.finance.service.InvoiceManageApiService;
import com.gic.finance.service.InvoiceManageService;
import com.gic.store.utils.CreateSerialNumberUtils;
......@@ -50,6 +54,7 @@ public class InvoiceManageApiServiceImpl implements InvoiceManageApiService{
invoiceManageDTO.setInvoiceStatus(InvoiceStatusEnum.MAILED.getCode());
}
//todo 操作人相关信息
//todo 开票户信息插入
invoiceManageService.update(invoiceManageDTO);
return ServiceResponse.success();
}
......@@ -83,4 +88,20 @@ public class InvoiceManageApiServiceImpl implements InvoiceManageApiService{
invoiceManageService.update(invoiceManageDTO);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Page<InvoiceManageDTO>> listInvoiceManage(InvoiceManageListQueryQO params) {
com.github.pagehelper.Page page = invoiceManageService.listInvoiceManage(params);
Page<InvoiceManageDTO> resultPage = PageHelperUtils.changePageHelperToCurrentPage(page, InvoiceManageDTO.class);
return ServiceResponse.success(resultPage);
}
@Override
public ServiceResponse<InvoiceManageDTO> getById(Integer invoiceManageId) {
TabInvoiceManage tabInvoiceManage = invoiceManageService.getById(invoiceManageId);
if (tabInvoiceManage == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "发票管理主键有误");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(InvoiceManageDTO.class, tabInvoiceManage));
}
}
<?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="com.gic.finance.dao.mapper.TabInvoiceAccountMapper">
<resultMap id="BaseResultMap" type="com.gic.finance.entity.TabInvoiceAccount">
<id column="invoice_account_id" jdbcType="INTEGER" property="invoiceAccountId" />
<result column="account_name" jdbcType="VARCHAR" property="accountName" />
<result column="tax_number" jdbcType="VARCHAR" property="taxNumber" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="bank" jdbcType="VARCHAR" property="bank" />
<result column="account_phone" jdbcType="VARCHAR" property="accountPhone" />
<result column="bank_account" jdbcType="VARCHAR" property="bankAccount" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
invoice_account_id, account_name, tax_number, address, bank, account_phone, bank_account,
status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_invoice_account
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_invoice_account
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabInvoiceAccount">
insert into tab_invoice_account (invoice_account_id, account_name, tax_number,
address, bank, account_phone,
bank_account, status, create_time,
update_time)
values (#{invoiceAccountId,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{bank,jdbcType=VARCHAR}, #{accountPhone,jdbcType=VARCHAR},
#{bankAccount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.finance.entity.TabInvoiceAccount">
insert into tab_invoice_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="invoiceAccountId != null">
invoice_account_id,
</if>
<if test="accountName != null">
account_name,
</if>
<if test="taxNumber != null">
tax_number,
</if>
<if test="address != null">
address,
</if>
<if test="bank != null">
bank,
</if>
<if test="accountPhone != null">
account_phone,
</if>
<if test="bankAccount != null">
bank_account,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="invoiceAccountId != null">
#{invoiceAccountId,jdbcType=INTEGER},
</if>
<if test="accountName != null">
#{accountName,jdbcType=VARCHAR},
</if>
<if test="taxNumber != null">
#{taxNumber,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="bank != null">
#{bank,jdbcType=VARCHAR},
</if>
<if test="accountPhone != null">
#{accountPhone,jdbcType=VARCHAR},
</if>
<if test="bankAccount != null">
#{bankAccount,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabInvoiceAccount">
update tab_invoice_account
<set>
<if test="accountName != null">
account_name = #{accountName,jdbcType=VARCHAR},
</if>
<if test="taxNumber != null">
tax_number = #{taxNumber,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="bank != null">
bank = #{bank,jdbcType=VARCHAR},
</if>
<if test="accountPhone != null">
account_phone = #{accountPhone,jdbcType=VARCHAR},
</if>
<if test="bankAccount != null">
bank_account = #{bankAccount,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.finance.entity.TabInvoiceAccount">
update tab_invoice_account
set account_name = #{accountName,jdbcType=VARCHAR},
tax_number = #{taxNumber,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
bank = #{bank,jdbcType=VARCHAR},
account_phone = #{accountPhone,jdbcType=VARCHAR},
bank_account = #{bankAccount,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
......@@ -388,4 +388,21 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where invoice_manage_id = #{invoiceManageId,jdbcType=INTEGER}
</update>
<select id="listInvoiceManage" parameterType="com.gic.finance.qo.InvoiceManageListQueryQO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_invoice_manage
where 1=1
<if test="search != null and search != '' ">
and ( enterprise_name like concat('%', #{search}, '%') or company_name like concat('%', #{search}, '%')
or invoice_apply_serial like concat('%', #{search}, '%'))
</if>
<if test="invoiceStatus != null">
and invoice_status = #{invoiceStatus}
</if>
<if test="platformType != null">
and platform_type = #{platformType}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -8,8 +8,10 @@ import org.springframework.web.bind.annotation.RestController;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.finance.dto.InvoiceManageDTO;
import com.gic.finance.qo.InvoiceManageListQueryQO;
import com.gic.finance.service.InvoiceManageApiService;
import com.gic.finance.web.utils.ResultControllerUtils;
import com.gic.finance.web.vo.InvoiceManageListVO;
/**
* 发票管理
......@@ -67,4 +69,20 @@ public class InvoiceManageController {
return ResultControllerUtils.commonResult(invoiceManageApiService.cancelInvoice(dto.getInvoiceManageId()));
}
/**
* 详情
* @param invoiceManageId
* @return
*/
@RequestMapping("/get-detail")
public RestResponse getDetail(Integer invoiceManageId) {
return ResultControllerUtils.commonResult(invoiceManageApiService.getById(invoiceManageId));
}
@RequestMapping("/list-invoice")
public RestResponse listInvoice(InvoiceManageListQueryQO params) {
return ResultControllerUtils.commonResult(
invoiceManageApiService.listInvoiceManage(params), InvoiceManageListVO.class);
}
}
package com.gic.finance.web.vo;
import com.gic.finance.constant.EnterprisePlatformTypeEnum;
import com.gic.finance.constant.InvoiceStatusEnum;
import java.io.Serializable;
import java.util.Date;
/**
* 发票列表VO
* @ClassName: InvoiceManageListVO

* @Description: 

* @author guojuxing

* @date 2019/8/15 9:40 AM

*/
public class InvoiceManageListVO implements Serializable{
private static final long serialVersionUID = -2907051857343527897L;
/**
*
*/
private Integer invoiceManageId;
/**
*
*/
private Date createTime;
/**
* 申请单流水号
*/
private String invoiceApplySerial;
/**
* 关联订单平台方(商户类型)1:GIC 2: 好办
*/
private Integer platformType;
/**
* 商户类型名称
*/
private String platformTypeStr;
/**
* 商户名称
*/
private String enterpriseName;
/**
* 公司名称
*/
private String companyName;
/**
* 公司logo
*/
private String logo;
/**
* 开票金额
*/
private Double billingAmount;
/**
* 发票状态 1:待开具 2:待邮寄 3:已邮寄 4:已驳回 5:已取消
*/
private Integer invoiceStatus;
/**
* 发票状态名称
*/
private String invoiceStatusStr;
/**
* 操作时间
*/
private Date operatorTime;
/**
* 快递公司
*/
private String expressMailName;
/**
* 快递单号
*/
private String expressMailNumber;
public Integer getInvoiceManageId() {
return invoiceManageId;
}
public void setInvoiceManageId(Integer invoiceManageId) {
this.invoiceManageId = invoiceManageId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getInvoiceApplySerial() {
return invoiceApplySerial;
}
public void setInvoiceApplySerial(String invoiceApplySerial) {
this.invoiceApplySerial = invoiceApplySerial;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformTypeStr() {
return EnterprisePlatformTypeEnum.getMessageByCode(platformType);
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public Double getBillingAmount() {
return billingAmount;
}
public void setBillingAmount(Double billingAmount) {
this.billingAmount = billingAmount;
}
public void setInvoiceStatus(Integer invoiceStatus) {
this.invoiceStatus = invoiceStatus;
}
public String getInvoiceStatusStr() {
return InvoiceStatusEnum.getMessageByCode(invoiceStatus);
}
public Date getOperatorTime() {
return operatorTime;
}
public void setOperatorTime(Date operatorTime) {
this.operatorTime = operatorTime;
}
public String getExpressMailName() {
return expressMailName;
}
public void setExpressMailName(String expressMailName) {
this.expressMailName = expressMailName;
}
public String getExpressMailNumber() {
return expressMailNumber;
}
public void setExpressMailNumber(String expressMailNumber) {
this.expressMailNumber = expressMailNumber;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment