Commit 2a99e04d authored by chase's avatar chase

fix bug

parent a3b88a86
...@@ -342,17 +342,15 @@ public class ReportServiceImpl extends BaseService { ...@@ -342,17 +342,15 @@ public class ReportServiceImpl extends BaseService {
andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate). andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate).
andStatusEqualTo(0); andStatusEqualTo(0);
List<RevenueTypeMapping> mappingList = revenueTypeMappingMapper.selectByExample(mappingExample); List<RevenueTypeMapping> mappingList = revenueTypeMappingMapper.selectByExample(mappingExample);
//先清除数据
InvoiceRecord delRecord = new InvoiceRecord();
delRecord.setRevenueCofId(null);
if(!isMergeManualData){
delRecord.setModifyRevenueCofId(null);
}
InvoiceRecordExample delExample = new InvoiceRecordExample(); InvoiceRecordExample delExample = new InvoiceRecordExample();
delExample.createCriteria().andProjectIdEqualTo(projectId) delExample.createCriteria().andProjectIdEqualTo(projectId).
.andProjectIdEqualTo(projectId).
andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", ""))); andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", "")));
invoiceRecordMapper.deleteByExample(delExample); if(isMergeManualData){
invoiceRecordMapper.clearRevenueCof(true,false,delExample);
}else{
invoiceRecordMapper.clearRevenueCof(true,true,delExample);
}
Map<String, Long> map = new HashMap<>(); Map<String, Long> map = new HashMap<>();
for (RevenueTypeMapping mapping : mappingList) { for (RevenueTypeMapping mapping : mappingList) {
if (!map.containsKey(mapping.getContent())) { if (!map.containsKey(mapping.getContent())) {
......
...@@ -129,4 +129,6 @@ public interface InvoiceRecordMapper extends MyVatMapper { ...@@ -129,4 +129,6 @@ public interface InvoiceRecordMapper extends MyVatMapper {
List<String> queryBillTypeGroupBy(@Param("projectId") String projectId, List<String> queryBillTypeGroupBy(@Param("projectId") String projectId,
@Param("period") Integer period); @Param("period") Integer period);
int clearRevenueCof(@Param("clearRevenue") boolean clearRevenue, @Param("clearModifyRevenue") boolean clearModifyRevenue,@Param("example") InvoiceRecordExample example);
} }
\ No newline at end of file
...@@ -15,15 +15,17 @@ ...@@ -15,15 +15,17 @@
</if> </if>
</sql> </sql>
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultMap="BaseResultMap"> <select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from invoice_record from invoice_record
where where
<include refid="QueryCondition"/> <include refid="QueryCondition"/>
</select> </select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultType="Integer"> <select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultType="Integer">
select select
count(*) count(*)
from invoice_record from invoice_record
...@@ -135,7 +137,8 @@ ...@@ -135,7 +137,8 @@
<otherwise>0,</otherwise> <otherwise>0,</otherwise>
</choose> </choose>
<choose> <choose>
<when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},</when> <when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},
</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose> <choose>
...@@ -167,7 +170,8 @@ ...@@ -167,7 +170,8 @@
<otherwise>CURRENT_TIMESTAMP,</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose> </choose>
</trim> </trim>
</foreach>; </foreach>
;
SELECT 1 FROM DUAL; SELECT 1 FROM DUAL;
</insert> </insert>
...@@ -210,7 +214,8 @@ ...@@ -210,7 +214,8 @@
and bd.invoice_num like concat('%',#{billNumber},'%') and bd.invoice_num like concat('%',#{billNumber},'%')
</if> </if>
<if test="revenueCofId != null"> <if test="revenueCofId != null">
and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id = #{revenueCofId}) and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id =
#{revenueCofId})
</if> </if>
<if test="billContent != null and billContent != ''"> <if test="billContent != null and billContent != ''">
and bd.billing_content like concat('%',#{billContent},'%') and bd.billing_content like concat('%',#{billContent},'%')
...@@ -238,4 +243,18 @@ ...@@ -238,4 +243,18 @@
group by invoice_type; group by invoice_type;
</select> </select>
<update id="clearRevenueCof">
update invoice_record
<set>
<if test="clearRevenue">
revenue_cof_id = null,
</if>
<if test="clearModifyRevenue">
modify_revenue_cof_id = null,
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
</mapper> </mapper>
\ No newline at end of file
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