Commit 77ad3248 authored by kevin's avatar kevin

Merge branch 'dev_mysql' of https://gitee.com/Memorydoc/atms into dev_mysql

parents ef170d92 ad1615a4
package pwc.taxtech.atms.common;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* author kevin
* target : Solve ThousandConvert
* version 1.0
*/
public class ThousandConvert extends JsonSerializer<BigDecimal> {
@Override
public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException {
jgen.writeString(NumberFormat.getIntegerInstance(Locale.getDefault()).format(value));
}
}
package pwc.taxtech.atms.dto.analysis; package pwc.taxtech.atms.dto.analysis;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.ThousandConvert;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
...@@ -11,16 +14,17 @@ public class AnalysisTaxDto { ...@@ -11,16 +14,17 @@ public class AnalysisTaxDto {
private String companyName; private String companyName;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment1; private BigDecimal segment1;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment2; private BigDecimal segment2;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment3; private BigDecimal segment3;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment4; private BigDecimal segment4;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment5; private BigDecimal segment5;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment6; private BigDecimal segment6;
public String getCompanyName() { public String getCompanyName() {
......
...@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -197,18 +198,19 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -197,18 +198,19 @@ public class AnalysisServiceImpl extends BaseService {
} }
public OperationResultDto importDomesitcExcelFile(MultipartFile file, String periodDate, Integer type) { public OperationResultDto importDomesitcExcelFile(MultipartFile file, String periodDate, Integer type) {
StringBuilder notOrgMatch = new StringBuilder();
switch (type) { switch (type) {
case 0: case 0:
importAnalysisTaxExcelFile(file, periodDate); notOrgMatch = importAnalysisTaxExcelFile(file, periodDate);
break; break;
case 1: case 1:
importAnalysisReturnTaxExcelFile(file, periodDate); notOrgMatch = importAnalysisReturnTaxExcelFile(file, periodDate);
break; break;
case 2: case 2:
importAnalysisGMVSubsidyExcelFile(file, periodDate); importAnalysisGMVSubsidyExcelFile(file, periodDate);
break; break;
case 3: case 3:
importAnalysisEmployeeNumExcelFile(file, periodDate); notOrgMatch = importAnalysisEmployeeNumExcelFile(file, periodDate);
break; break;
case 4: case 4:
importAnalysisDriverNumExcelFile(file, periodDate); importAnalysisDriverNumExcelFile(file, periodDate);
...@@ -216,7 +218,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -216,7 +218,7 @@ public class AnalysisServiceImpl extends BaseService {
default: default:
break; break;
} }
return OperationResultDto.success(); return OperationResultDto.success(notOrgMatch);
} }
public OperationResultDto importInterNationalExcelFile(MultipartFile file, String periodDate, Integer type, public OperationResultDto importInterNationalExcelFile(MultipartFile file, String periodDate, Integer type,
...@@ -237,7 +239,9 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -237,7 +239,9 @@ public class AnalysisServiceImpl extends BaseService {
private String[] headerArr = null; private String[] headerArr = null;
private void importAnalysisTaxExcelFile(MultipartFile file, String periodDate) { private StringBuilder importAnalysisTaxExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -263,7 +267,8 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -263,7 +267,8 @@ public class AnalysisServiceImpl extends BaseService {
example.createCriteria().andNameEqualTo(companyName); example.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example); List<Organization> orgs = organizationMapper.selectByExample(example);
if (orgs.isEmpty()) { if (orgs.isEmpty()) {
break; orgNotList.add(j + 1);
continue;
} }
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) { for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
AnalysisTax model = getAnalysisTax(selectedPer, sheet, k, j, orgs.get(0)); AnalysisTax model = getAnalysisTax(selectedPer, sheet, k, j, orgs.get(0));
...@@ -284,6 +289,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -284,6 +289,7 @@ public class AnalysisServiceImpl extends BaseService {
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException(e); throw new ServiceException(e);
} }
return notMatchOrg.append(orgNotList + "机构匹配失败");
} }
private AnalysisTax getAnalysisTax(Integer period, Sheet sheet, int k, int j, Organization org) { private AnalysisTax getAnalysisTax(Integer period, Sheet sheet, int k, int j, Organization org) {
...@@ -326,7 +332,9 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -326,7 +332,9 @@ public class AnalysisServiceImpl extends BaseService {
} }
private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) { private StringBuilder importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -351,7 +359,8 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -351,7 +359,8 @@ public class AnalysisServiceImpl extends BaseService {
example.createCriteria().andNameEqualTo(companyName); example.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example); List<Organization> orgs = organizationMapper.selectByExample(example);
if (orgs.isEmpty()) { if (orgs.isEmpty()) {
break; orgNotList.add(j + 1);
continue;
} }
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) { for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
AnalysisActualTaxReturn model = getAnalysisActualTaxReturn(selectedPer, sheet, k, j, orgs.get(0)); AnalysisActualTaxReturn model = getAnalysisActualTaxReturn(selectedPer, sheet, k, j, orgs.get(0));
...@@ -373,6 +382,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -373,6 +382,7 @@ public class AnalysisServiceImpl extends BaseService {
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException(e); throw new ServiceException(e);
} }
return notMatchOrg.append(orgNotList + "行匹配失败");
} }
private AnalysisActualTaxReturn getAnalysisActualTaxReturn(Integer period, Sheet sheet, int k, int j, Organization org) { private AnalysisActualTaxReturn getAnalysisActualTaxReturn(Integer period, Sheet sheet, int k, int j, Organization org) {
...@@ -387,7 +397,9 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -387,7 +397,9 @@ public class AnalysisServiceImpl extends BaseService {
return model; return model;
} }
private void importAnalysisEmployeeNumExcelFile(MultipartFile file, String periodDate) { private StringBuilder importAnalysisEmployeeNumExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -409,7 +421,17 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -409,7 +421,17 @@ public class AnalysisServiceImpl extends BaseService {
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) { if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) {
continue; continue;
} }
model.setCompanyName(getCellStringValue(sheet.getRow(j).getCell(0)));
//进行机构验证
String companyName = getCellStringValue(sheet.getRow(j).getCell(0));
OrganizationExample example1 = new OrganizationExample();
example1.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example1);
if (orgs.isEmpty()) {
orgNotList.add(j + 1);
continue;
}
model.setCompanyName(companyName);
try { try {
model.setSeqNo(getSeqNoByPeriod(getOrgByCompanyName(getCellStringValue(sheet.getRow(j).getCell(0))).getId(), selectedPer)); model.setSeqNo(getSeqNoByPeriod(getOrgByCompanyName(getCellStringValue(sheet.getRow(j).getCell(0))).getId(), selectedPer));
} catch (Exception e) { } catch (Exception e) {
...@@ -447,9 +469,11 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -447,9 +469,11 @@ public class AnalysisServiceImpl extends BaseService {
e.printStackTrace(); e.printStackTrace();
throw new ServiceException(e); throw new ServiceException(e);
} }
return notMatchOrg.append(orgNotList + "行匹配失败");
} }
private void importAnalysisGMVSubsidyExcelFile(MultipartFile file, String periodDate) { private void importAnalysisGMVSubsidyExcelFile(MultipartFile file, String periodDate) {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -719,7 +743,6 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -719,7 +743,6 @@ public class AnalysisServiceImpl extends BaseService {
public HttpServletResponse downloadDomesticFile(HttpServletResponse response, AnalysisDomesticlParam param, String fileName) { public HttpServletResponse downloadDomesticFile(HttpServletResponse response, AnalysisDomesticlParam param, String fileName) {
String excelTemplatePathInClassPath = EnumAnalysisExpTempPath.getPath(param.getType()); String excelTemplatePathInClassPath = EnumAnalysisExpTempPath.getPath(param.getType());
List<Object> datas = displayAnalysisImportData(param); List<Object> datas = displayAnalysisImportData(param);
try { try {
if (datas.size() < 1) { if (datas.size() < 1) {
throw new Exception("无可导出的数据"); throw new Exception("无可导出的数据");
......
...@@ -780,6 +780,7 @@ ...@@ -780,6 +780,7 @@
"ImportShipmentList": "导入发车清单", "ImportShipmentList": "导入发车清单",
"ImportShipmentListGd": "导入发车清单-GD", "ImportShipmentListGd": "导入发车清单-GD",
"ImportSuccess": "导入成功", "ImportSuccess": "导入成功",
"ImportSuccessCount": "导入成功,验证失败:",
"ImportTrialBalance": "导入试算平衡表", "ImportTrialBalance": "导入试算平衡表",
"ImportTypeTip": "需要清除本月导入的财务数据,是否确认?", "ImportTypeTip": "需要清除本月导入的财务数据,是否确认?",
"Import_AccountMapping": "科目对应", "Import_AccountMapping": "科目对应",
......
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
</div> </div>
</div> </div>
</form> </form>
<div id="progress">
<div id="progressBarStatus" dx-progress-bar="progressBarOptions"></div>
</div>
<div class="dt-init-wrapper"> <div class="dt-init-wrapper">
<div class="dx-viewport grid-container"> <div class="dx-viewport grid-container">
<div id="taxGridContainer" dx-data-grid="taxGridOptions" <div id="taxGridContainer" dx-data-grid="taxGridOptions"
......
...@@ -210,7 +210,6 @@ ...@@ -210,7 +210,6 @@
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
} }
getImportRLITStatus(); getImportRLITStatus();
}, function(resp) { }, function(resp) {
deferred.resolve(); deferred.resolve();
if (resp.statusText === 'HttpRequestValidationException') { if (resp.statusText === 'HttpRequestValidationException') {
......
...@@ -133,7 +133,6 @@ ...@@ -133,7 +133,6 @@
//todo:注册之后这里去掉注释 //todo:注册之后这里去掉注释
//var sheet = spread.getActiveSheet(); //var sheet = spread.getActiveSheet();
var sheet; var sheet;
if (constant.regesterInformation.active) { if (constant.regesterInformation.active) {
sheet = spread.getActiveSheet(); sheet = spread.getActiveSheet();
......
...@@ -1234,6 +1234,5 @@ ...@@ -1234,6 +1234,5 @@
_.extend(scope.selectOrgOptions, exp); _.extend(scope.selectOrgOptions, exp);
}; };
/*-----------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------*/
})(window) })(window)
\ 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