Commit 77d46e28 authored by eddie.woo's avatar eddie.woo

modify

parent 732042b1
......@@ -113,6 +113,7 @@ public final class Constant {
public static class DateFormat {
public static final String DEFAULT = "yyyy-MM-dd";
public static final String YEAR_MONTH = "yyyy-MM";
public static final String YYYYMM = "yyyyMM";
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
}
......
......@@ -44,6 +44,7 @@ public class InputInvoiceDao {
// criteria1.andRZJGEqualTo(pass);
// example.or(criteria1);
}
criteria.andFPZTNotEqualTo("1"); // 过滤作废状态
List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> {
return x.getRZSQ().endsWith("-" + (period.intValue() > 9 ? period.toString() : "0" + period.toString()));
......
......@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.constant.enums.EnumValidationType;
import pwc.taxtech.atms.dao.OrganizationMapper;
......@@ -58,17 +59,18 @@ public class InputInvoiceDataImportServiceImpl {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
InputInvoiceExample invoiceExample = new InputInvoiceExample();
invoiceExample.createCriteria().andGFSHEqualTo(organization.getTaxPayerNumber()).andRZSJBetween(DateUtils.getPeriodBeginFormat(
project.getYear(), paras.getPeriodStart()), DateUtils.getPeriodEndFormat(project.getYear(), paras.getPeriodEnd()))
.andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER);
invoiceExample.createCriteria().andGFSHEqualTo(organization.getTaxPayerNumber()).andRZSQBetween(DateUtils.getPeriodBeginFormat(
project.getYear(), paras.getPeriodStart(), Constant.DateFormat.YYYYMM), DateUtils.getPeriodEndFormat(project.getYear(),
paras.getPeriodEnd(), Constant.DateFormat.YYYYMM)).andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER)
.andFPZTNotEqualTo("1");
PageHelper.startPage(paras.getPageInfo().getPageIndex(), paras.getPageInfo().getPageSize());
List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
x.setRZJG(convertRzjg(x.getRZJG()));
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
x.setRZJG(convertRzjg(x.getRZJG()));
}
);
PageInfo<InputInvoice> pageInfo = new PageInfo<>(invoices);
......
......@@ -78,14 +78,16 @@ public class OutputInvoiceServiceImpl {
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
if(organization.getTaxPayerNumber() == null){
if (organization.getTaxPayerNumber() == null) {
outputInvoiceExample.createCriteria().andXFSHIsNull().andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
} else {
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
}
......@@ -260,7 +262,7 @@ public class OutputInvoiceServiceImpl {
private List<OutputVATInvoiceInfoDto> getQueryList(QueryOutputDto queryDto, String projectId) {
List<OutputVATInvoiceInfoDto> rList = outputInvoiceMapper.selectOutputInvoiceInfoLeftJoinItem(queryDto);
Organization organization = organizationMapper.selectByPrimaryKey(projectMapper.selectByPrimaryKey(projectId).getOrganizationId());
if(organization == null){
if (organization == null) {
return Lists.newArrayList();
}
OutputInvoiceExample e = new OutputInvoiceExample();
......@@ -268,14 +270,14 @@ public class OutputInvoiceServiceImpl {
List<String> fpqqlshList = outputInvoiceMapper.selectByExample(e).stream().map(OutputInvoice::getFPQQLSH).collect(Collectors.toList());
rList = rList.stream().filter(a -> fpqqlshList.contains(a.getFpqqlsh())).collect(Collectors.toList());
rList.forEach(x -> {
if(x.getInvoiceDate() != null){
if (x.getInvoiceDate() != null) {
CAL.setTime(x.getInvoiceDate());
x.setPeriodId(CAL.get(Calendar.MONTH) + 1);
}
if(x.getTaxAmount() == null || x.getAmount() == null || x.getTaxRate() == null){
if (x.getTaxAmount() == null || x.getAmount() == null || x.getTaxRate() == null) {
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
outputInvoiceExample.createCriteria().andIDEqualTo(x.getInvoiceId());
OutputInvoice outputInvoice = outputInvoiceMapper.selectByExample(outputInvoiceExample).get(0);
OutputInvoice outputInvoice = outputInvoiceMapper.selectByExample(outputInvoiceExample).get(0);
x.setAmount(outputInvoice.getHJJE() == null ? BigDecimal.ZERO : new BigDecimal(outputInvoice.getHJJE()));
x.setTaxRate(outputInvoice.getSLV() == null ? BigDecimal.ZERO : new BigDecimal(outputInvoice.getSLV()));
x.setTaxAmount(outputInvoice.getHJSE() == null ? BigDecimal.ZERO : new BigDecimal(outputInvoice.getHJSE()));
......
......@@ -284,7 +284,7 @@
JOIN
OUTPUT_INVOICE_DETAIL INVOICEDETAIL
ON
INVOICE.FPQQLSH = INVOICEDETAIL.FPQQLSH
INVOICE.FPQQLSH = INVOICEDETAIL.FPQQLSH and INVOICE.FPZT != '1'
ORDER BY
INVOICE.FPHM
</select>
......
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