|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.dxhy.erp.service.impl; |
|
|
|
|
|
|
|
|
|
import com.dxhy.common.enums.KjkmTaxEnmu; |
|
|
|
|
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
|
|
|
|
import com.dxhy.erp.dao.VoucherRecordDao; |
|
|
|
|
import com.dxhy.erp.dao.VoucherRecordItemDao; |
|
|
|
@ -8,11 +9,13 @@ import com.dxhy.erp.entity.VoucherRecordItem; |
|
|
|
|
import com.dxhy.erp.service.VoucherRecordItemService; |
|
|
|
|
import com.dxhy.erp.service.VoucherRecordService; |
|
|
|
|
import com.dxhy.erp.utils.DistributedKeyMaker; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -101,7 +104,18 @@ public class VoucherRecordServiceImpl extends MpBaseServiceImpl<VoucherRecordDao |
|
|
|
|
} |
|
|
|
|
this.saveBatch(newRecordList); |
|
|
|
|
this.saveBatch(repeatRecordList); |
|
|
|
|
b = voucherRecordItemService.inserBatch(addItems); |
|
|
|
|
//处理sap传输报文税率不正确问题
|
|
|
|
|
Map<String, String> taxMap = KjkmTaxEnmu.getTaxMap(); |
|
|
|
|
for (VoucherRecordItem addItem : addItems) { |
|
|
|
|
if (StringUtils.isNotBlank(taxMap.get(addItem.getRacct()))) { |
|
|
|
|
addItem.setKbetr(taxMap.get(addItem.getRacct())); |
|
|
|
|
} |
|
|
|
|
//将主营业务收入税率的格式统一为整数
|
|
|
|
|
if (StringUtils.isNotBlank(addItem.getRacct()) && addItem.getRacct().startsWith("6001")){ |
|
|
|
|
addItem.setKbetr(StringUtils.isBlank(addItem.getKbetr()) ? addItem.getKbetr() : new BigDecimal(addItem.getKbetr()).stripTrailingZeros().toString()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
b = voucherRecordItemService.inserBatch(addItems); |
|
|
|
|
} |
|
|
|
|
return b; |
|
|
|
|
} |
|
|
|
|