Commit 0d95b3da authored by eddie.woo's avatar eddie.woo

modify

parent 4d9bda71
......@@ -10,10 +10,12 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.constant.enums.EnumValidationType;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dto.FieldsMapper;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.invoice.InputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
......@@ -46,11 +48,14 @@ public class InputInvoiceDataImportServiceImpl {
private ProjectMapper projectMapper;
@Autowired
private InputInvoiceDetailMapper inputInvoiceDetailMapper;
@Autowired
private OrganizationMapper organizationMapper;
public PageInfo<InputInvoice> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
InputInvoiceExample invoiceExample = new InputInvoiceExample();
invoiceExample.createCriteria().andCOMPANYIDEqualTo(project.getCode()).andRZSJBetween(DateUtils.getPeriodBegin(
invoiceExample.createCriteria().andGFSHEqualTo(organization.getTaxPayerNumber()).andRZSJBetween(DateUtils.getPeriodBegin(
project.getYear(), paras.getPeriodStart()), DateUtils.getPeriodEnd(project.getYear(), paras.getPeriodEnd()))
.andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER);
......
package pwc.taxtech.atms.common;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.entity.StandardAccount;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
public class DataInitTest extends CommonIT {
@Test
public void initStandardAccount() {
try {
List<String> lines = FileUtils.readLines(new File("C:\\Users\\Eddie Wu\\Desktop\\隆基科目整理.csv"), StandardCharsets.UTF_8);
lines.remove(0);
String[] parent = null;
for (String line : lines) {
if (StringUtils.isBlank(line)) {
continue;
}
String[] cols = line.split(",");
String name = StringUtils.substringAfterLast(cols[7], "-");
StandardAccount account = new StandardAccount();
account.setId(CommonUtils.getUUID());
account.setCode(cols[6]);
account.setName(StringUtils.isBlank(name) ? cols[7] : name);
if (StringUtils.isNotBlank(cols[0])) {
parent = cols;
} else {
account.setParentCode(parent[6]);
}
account.setFullName(cols[7]);
account.setAcctProp(Integer.valueOf(cols[9]));
int acctLevel = 1;
if (StringUtils.isNotBlank(cols[1])) {
acctLevel = 2;
} else if (StringUtils.isNotBlank(cols[2])) {
acctLevel = 3;
} else if (StringUtils.isNotBlank(cols[3])) {
acctLevel = 4;
} else if (StringUtils.isNotBlank(cols[4])) {
acctLevel = 5;
}
account.setAcctLevel(acctLevel);
account.setDirection(Integer.valueOf(cols[10]) == 1 ? 1 : -1);
account.setIsLeaf(acctLevel != 1);
account.setRuleType(2);
account.setIsActive(true);
account.setEnglishName(cols[8]);
account.setIndustryId("0");
standardAccountMapper.insertSelective(account);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
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