Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
5187f41a
Commit
5187f41a
authored
Apr 02, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改保留收入明细得收入类型配置修改
parent
31fc1458
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
184 additions
and
17 deletions
+184
-17
BillDetailResult.java
...ava/pwc/taxtech/atms/dto/billDetail/BillDetailResult.java
+21
-0
BillDetailService.java
...java/pwc/taxtech/atms/service/impl/BillDetailService.java
+15
-5
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+6
-5
BillDetailDto.java
...dao/src/main/java/pwc/taxtech/atms/dpo/BillDetailDto.java
+20
-0
InvoiceRecord.java
.../main/java/pwc/taxtech/atms/vat/entity/InvoiceRecord.java
+37
-2
InvoiceRecordExample.java
...ava/pwc/taxtech/atms/vat/entity/InvoiceRecordExample.java
+60
-0
InvoiceRecordMapper.xml
...esources/pwc/taxtech/atms/vat/dao/InvoiceRecordMapper.xml
+22
-5
InvoiceRecordExtendsMapper.xml
...xtech/atms/vat/dao/extends/InvoiceRecordExtendsMapper.xml
+3
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/billDetail/BillDetailResult.java
View file @
5187f41a
...
...
@@ -42,6 +42,27 @@ public class BillDetailResult implements Serializable {
@JsonSerialize
(
using
=
PwCIdSerialize
.
class
)
private
Long
revenueCofId
;
@JsonSerialize
(
using
=
PwCIdSerialize
.
class
)
private
Long
modifyRevenueCofId
;
private
String
modifyRevenueCofName
;
public
Long
getModifyRevenueCofId
()
{
return
modifyRevenueCofId
;
}
public
void
setModifyRevenueCofId
(
Long
modifyRevenueCofId
)
{
this
.
modifyRevenueCofId
=
modifyRevenueCofId
;
}
public
String
getModifyRevenueCofName
()
{
return
modifyRevenueCofName
;
}
public
void
setModifyRevenueCofName
(
String
modifyRevenueCofName
)
{
this
.
modifyRevenueCofName
=
modifyRevenueCofName
;
}
private
Integer
emptyCode
;
public
Long
getId
()
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/BillDetailService.java
View file @
5187f41a
...
...
@@ -21,22 +21,32 @@ public class BillDetailService extends BaseService {
private
InvoiceRecordMapper
invoiceRecordMapper
;
public
PageInfo
<
BillDetailResult
>
queryPage
(
BillDetailParam
param
)
{
Page
page
=
PageHelper
.
startPage
(
param
.
getPageInfo
().
getPageIndex
(),
param
.
getPageInfo
().
getPageSize
());
List
<
BillDetailDto
>
dataList
=
invoiceRecordMapper
.
queryBillWithRevenueConf
(
param
.
getBillType
(),
param
.
getCustomer
(),
param
.
getBillNumber
(),
param
.
getRevenueCofId
(),
param
.
getBillContent
(),
param
.
getDepartment
(),
param
.
getBillTaxRat
(),
param
.
getBillDate
(),
param
.
getProjectId
(),
param
.
getPeriod
(),
param
.
getQueryDate
());
PageInfo
<
BillDetailResult
>
pageInfo
=
new
PageInfo
<>(
dataList
.
stream
()
.
map
(
o
->
beanUtil
.
copyProperties
(
o
,
new
BillDetailResult
())).
collect
(
Collectors
.
toList
()));
.
map
(
o
->
{
BillDetailResult
detailResult
=
new
BillDetailResult
();
beanUtil
.
copyProperties
(
o
,
detailResult
);
if
(
detailResult
.
getModifyRevenueCofId
()
!=
null
)
{
detailResult
.
setRevenueCofId
(
detailResult
.
getModifyRevenueCofId
());
detailResult
.
setRevenueConfName
(
detailResult
.
getModifyRevenueCofName
());
}
return
detailResult
;
}).
collect
(
Collectors
.
toList
()));
pageInfo
.
setTotal
(
page
.
getTotal
());
return
pageInfo
;
}
public
List
<
String
>
queryBillTypeGroupBy
(
String
projectId
,
Integer
period
)
{
return
invoiceRecordMapper
.
queryBillTypeGroupBy
(
projectId
,
period
);
public
List
<
String
>
queryBillTypeGroupBy
(
String
projectId
,
Integer
period
)
{
return
invoiceRecordMapper
.
queryBillTypeGroupBy
(
projectId
,
period
);
}
public
void
updateBillDetail
(
InvoiceRecord
billDetail
)
{
if
(
billDetail
.
getRevenueCofId
()
!=
null
&&
billDetail
.
getId
()
!=
null
)
{
billDetail
.
setModifyRevenueCofId
(
billDetail
.
getRevenueCofId
());
invoiceRecordMapper
.
updateByPrimaryKeySelective
(
billDetail
);
}
invoiceRecordMapper
.
updateByPrimaryKeySelective
(
billDetail
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
5187f41a
...
...
@@ -9,12 +9,10 @@ import com.google.common.collect.Sets;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.omg.CORBA.SystemException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -57,7 +55,6 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
import
java.util.*
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
...
...
@@ -308,7 +305,7 @@ public class ReportServiceImpl extends BaseService {
private
void
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
,
List
<
Template
>
templates
,
PeriodJob
job
)
{
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
//根据收入类型映射生成开票记录关联数据
assembleInvoiceRecord
(
projectId
,
period
);
assembleInvoiceRecord
(
projectId
,
period
,
isMergeManualData
);
//生成trial_balance_final数据
assembleTrialBalanceFinal
(
projectId
,
period
);
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
,
isMergeManualData
);
...
...
@@ -336,7 +333,7 @@ public class ReportServiceImpl extends BaseService {
trialBalanceFinalMapper
.
generateFinalData
(
projectId
,
Integer
.
valueOf
(
queryPeriod
),
lastProject
==
null
?
"0"
:
lastProject
.
getId
(),
Integer
.
valueOf
(
lastPeriod
));
}
public
void
assembleInvoiceRecord
(
String
projectId
,
Integer
period
)
{
public
void
assembleInvoiceRecord
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
)
{
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
MyAsserts
.
assertNotNull
(
project
,
Exceptions
.
NOT_FOUND_REPORT_EXCEPTION
);
String
queryDate
=
project
.
getYear
()
+
"-"
+
(
period
<
10
?
(
"0"
+
period
)
:
(
period
+
""
));
...
...
@@ -359,6 +356,10 @@ public class ReportServiceImpl extends BaseService {
}
if
(
map
.
containsKey
(
mapping
.
getContent
()))
{
InvoiceRecord
destRecord
=
new
InvoiceRecord
();
//是否保存手工数据源
if
(!
isMergeManualData
){
destRecord
.
setModifyRevenueCofId
(
null
);
}
destRecord
.
setRevenueCofId
(
map
.
get
(
mapping
.
getContent
()));
InvoiceRecordExample
recordExample
=
new
InvoiceRecordExample
();
recordExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
)
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dpo/BillDetailDto.java
View file @
5187f41a
...
...
@@ -40,6 +40,26 @@ public class BillDetailDto implements Serializable {
private
Integer
emptyCode
;
private
Long
modifyRevenueCofId
;
private
String
modifyRevenueCofName
;
public
Long
getModifyRevenueCofId
()
{
return
modifyRevenueCofId
;
}
public
void
setModifyRevenueCofId
(
Long
modifyRevenueCofId
)
{
this
.
modifyRevenueCofId
=
modifyRevenueCofId
;
}
public
String
getModifyRevenueCofName
()
{
return
modifyRevenueCofName
;
}
public
void
setModifyRevenueCofName
(
String
modifyRevenueCofName
)
{
this
.
modifyRevenueCofName
=
modifyRevenueCofName
;
}
public
Long
getId
()
{
return
id
;
}
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/entity/InvoiceRecord.java
View file @
5187f41a
package
pwc
.
taxtech
.
atms
.
vat
.
entity
;
import
pwc.taxtech.atms.entity.BaseEntity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
pwc.taxtech.atms.entity.BaseEntity
;
/**
*
...
...
@@ -366,6 +365,17 @@ public class InvoiceRecord extends BaseEntity implements Serializable {
*/
private
Long
revenueCofId
;
/**
* Database Column Remarks:
* 修改后收入类型id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column invoice_record.modify_revenue_cof_id
*
* @mbg.generated
*/
private
Long
modifyRevenueCofId
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table invoice_record
...
...
@@ -1142,6 +1152,30 @@ public class InvoiceRecord extends BaseEntity implements Serializable {
this
.
revenueCofId
=
revenueCofId
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column invoice_record.modify_revenue_cof_id
*
* @return the value of invoice_record.modify_revenue_cof_id
*
* @mbg.generated
*/
public
Long
getModifyRevenueCofId
()
{
return
modifyRevenueCofId
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column invoice_record.modify_revenue_cof_id
*
* @param modifyRevenueCofId the value for invoice_record.modify_revenue_cof_id
*
* @mbg.generated
*/
public
void
setModifyRevenueCofId
(
Long
modifyRevenueCofId
)
{
this
.
modifyRevenueCofId
=
modifyRevenueCofId
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_record
...
...
@@ -1186,6 +1220,7 @@ public class InvoiceRecord extends BaseEntity implements Serializable {
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", revenueCofId="
).
append
(
revenueCofId
);
sb
.
append
(
", modifyRevenueCofId="
).
append
(
modifyRevenueCofId
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/entity/InvoiceRecordExample.java
View file @
5187f41a
...
...
@@ -2285,6 +2285,66 @@ public class InvoiceRecordExample {
addCriterion
(
"revenue_cof_id not between"
,
value1
,
value2
,
"revenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdIsNull
()
{
addCriterion
(
"modify_revenue_cof_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdIsNotNull
()
{
addCriterion
(
"modify_revenue_cof_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdEqualTo
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id ="
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id <>"
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdGreaterThan
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id >"
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id >="
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdLessThan
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id <"
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"modify_revenue_cof_id <="
,
value
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"modify_revenue_cof_id in"
,
values
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"modify_revenue_cof_id not in"
,
values
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"modify_revenue_cof_id between"
,
value1
,
value2
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andModifyRevenueCofIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"modify_revenue_cof_id not between"
,
value1
,
value2
,
"modifyRevenueCofId"
);
return
(
Criteria
)
this
;
}
}
/**
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/InvoiceRecordMapper.xml
View file @
5187f41a
...
...
@@ -38,6 +38,7 @@
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"revenue_cof_id"
jdbcType=
"BIGINT"
property=
"revenueCofId"
/>
<result
column=
"modify_revenue_cof_id"
jdbcType=
"BIGINT"
property=
"modifyRevenueCofId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -115,7 +116,7 @@
oa_application_num, contract_no, contract_amount, department, application_date, billing_date,
billing_month, invoice_code, invoice_num, invoices_amount, customer_company_tax_num,
contract_source_system, tax_rate, tax_amount, invoice_status, remarks, create_time,
update_time, revenue_cof_id
update_time, revenue_cof_id
, modify_revenue_cof_id
</sql>
<select
id=
"selectByExample"
parameterType=
"pwc.taxtech.atms.vat.entity.InvoiceRecordExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -178,7 +179,8 @@
invoice_num, invoices_amount, customer_company_tax_num,
contract_source_system, tax_rate, tax_amount,
invoice_status, remarks, create_time,
update_time, revenue_cof_id)
update_time, revenue_cof_id, modify_revenue_cof_id
)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{tmsPeriod,jdbcType=INTEGER}, #{period,jdbcType=INTEGER}, #{seqNo,jdbcType=INTEGER},
#{source,jdbcType=VARCHAR}, #{billingBody,jdbcType=VARCHAR}, #{customerCompanyName,jdbcType=VARCHAR},
...
...
@@ -189,7 +191,8 @@
#{invoiceNum,jdbcType=VARCHAR}, #{invoicesAmount,jdbcType=INTEGER}, #{customerCompanyTaxNum,jdbcType=VARCHAR},
#{contractSourceSystem,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL},
#{invoiceStatus,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{revenueCofId,jdbcType=BIGINT})
#{updateTime,jdbcType=TIMESTAMP}, #{revenueCofId,jdbcType=BIGINT}, #{modifyRevenueCofId,jdbcType=BIGINT}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"pwc.taxtech.atms.vat.entity.InvoiceRecord"
>
<!--
...
...
@@ -294,6 +297,9 @@
<if
test=
"revenueCofId != null"
>
revenue_cof_id,
</if>
<if
test=
"modifyRevenueCofId != null"
>
modify_revenue_cof_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -392,6 +398,9 @@
<if
test=
"revenueCofId != null"
>
#{revenueCofId,jdbcType=BIGINT},
</if>
<if
test=
"modifyRevenueCofId != null"
>
#{modifyRevenueCofId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"pwc.taxtech.atms.vat.entity.InvoiceRecordExample"
resultType=
"java.lang.Long"
>
...
...
@@ -507,6 +516,9 @@
<if
test=
"record.revenueCofId != null"
>
revenue_cof_id = #{record.revenueCofId,jdbcType=BIGINT},
</if>
<if
test=
"record.modifyRevenueCofId != null"
>
modify_revenue_cof_id = #{record.modifyRevenueCofId,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -549,7 +561,8 @@
remarks = #{record.remarks,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
revenue_cof_id = #{record.revenueCofId,jdbcType=BIGINT}
revenue_cof_id = #{record.revenueCofId,jdbcType=BIGINT},
modify_revenue_cof_id = #{record.modifyRevenueCofId,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -654,6 +667,9 @@
<if
test=
"revenueCofId != null"
>
revenue_cof_id = #{revenueCofId,jdbcType=BIGINT},
</if>
<if
test=
"modifyRevenueCofId != null"
>
modify_revenue_cof_id = #{modifyRevenueCofId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -693,7 +709,8 @@
remarks = #{remarks,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
revenue_cof_id = #{revenueCofId,jdbcType=BIGINT}
revenue_cof_id = #{revenueCofId,jdbcType=BIGINT},
modify_revenue_cof_id = #{modifyRevenueCofId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectByExampleWithRowbounds"
parameterType=
"pwc.taxtech.atms.vat.entity.InvoiceRecordExample"
resultMap=
"BaseResultMap"
>
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/InvoiceRecordExtendsMapper.xml
View file @
5187f41a
...
...
@@ -186,6 +186,8 @@
bd.billing_date as billDate,
bd.invoice_code as billCode,
bd.invoice_num as billNumber,
modfiy_rc.id as modifyRevenueCofId,
modfiy_rc.name as modifyRevenueCofName,
rc.id as revenueCofId,
rc.name as revenueConfName,
case
...
...
@@ -195,6 +197,7 @@
end as emptyCode
from invoice_record as bd
left join revenue_config as rc on rc.org_id = bd.organization_id and rc.id = bd.revenue_cof_id
left join revenue_config as modfiy_rc on modfiy_rc.id = bd.modify_revenue_cof_id
where bd.project_id = #{projectId}
and bd.period = #{period}
<if
test=
"billType != null and billType != ''"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment