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

modify

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