Commit a0f4d5d8 authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 6c2e039a dda9822c
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -244,7 +245,12 @@ public class UserController {
public @ResponseBody
UserDto getUserByName(
@RequestBody UserDto userParam) {
return userRoleService.GetUserByUserName(userParam);
UserDto dto = userRoleService.GetUserByUserName(userParam);
if (null != dto) {
// 去掉password字段,安全问题 不需要返回给前端
dto.setPassword(StringUtils.EMPTY);
}
return dto;
}
@RequestMapping(value = "downloadFile/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -1568,6 +1568,7 @@ public class DataImportService extends BaseService {
private List<InvoiceRecord> generalIRs(Sheet sheet) {
List<InvoiceRecord> irs = Lists.newArrayList();
Set<String> orgsNot=new HashSet<>();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
InvoiceRecord ir = new InvoiceRecord();
Long irId = idService.nextId();
......@@ -1577,6 +1578,14 @@ public class DataImportService extends BaseService {
}
ir.setId(irId);
ir.setSeqNo(getCellIntegerValue(row.getCell(0)));
//所属机构
if(StringUtils.isBlank(getCellStringValue(row.getCell(1)))){
continue;
}
//如果存在有错误的机构也跳过
if(validIRExcelCell(row,orgsNot).contains(getCellStringValue(row.getCell(1)))){
continue;
}
ir.setBillingBody(getCellStringValue(row.getCell(1)));
ir.setCustomerCompanyName(getCellStringValue(row.getCell(2)));
ir.setInvoiceType(getCellStringValue(row.getCell(3)));
......@@ -1606,6 +1615,38 @@ public class DataImportService extends BaseService {
return irs;
}
/**
* 导入分发-已开增值税发票记录,校验1-发票类型、开票内容、所属机构、税率、税额、开票金额任意不为空;
* 且校验2-校验发票类型的值只能包含“增值税专用发票”、“增值税普通发票”、“增值税电子发票”和“机动车发票”,
* 存在校验1或校验2不通过的机构不进行导入
* @param row
* @return
*/
private Set<String> validIRExcelCell(Row row,Set<String> orgsNot ){
List<String> invoiceTypes=Arrays.asList(new String[]{"增值税专用发票","增值税普通发票","增值税电子发票","机动车发票"});
String orgName=getCellStringValue(row.getCell(1));
//发票类型
if(StringUtils.isBlank(getCellStringValue(row.getCell(3)))){
orgsNot.add(orgName);
}
else if(!invoiceTypes.contains(getCellStringValue(row.getCell(3)))){
orgsNot.add(orgName);
}
//开票内容
if(StringUtils.isBlank(getCellStringValue(row.getCell(4)))){
orgsNot.add(orgName);
}
//开票金额
if(StringUtils.isBlank(getCellStringValue(row.getCell(5)))){
orgsNot.add(orgName);
}
//税额
if(StringUtils.isBlank(getCellStringValue(row.getCell(20)))){
orgsNot.add(orgName);
}
return orgsNot;
}
private List<AdjustmentTable> generalATs(Sheet sheet) {
List<AdjustmentTable> ats = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
......
......@@ -358,6 +358,14 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
}
};
$rootScope.changeLanguage(region);
waterMark({
systemId: '2500',
//当前用户ID
userId: loginContext.localName,
textStyle: 'rgba(0,0,0,0.15)',
containerEl: document.querySelector('body')
});
// publish unbeforeunload event to child scopes
$scope.onbeforeunload = function () {
......
......@@ -116,8 +116,8 @@
<script type="text/javascript" src="bundles/ivh-treeview.js"></script>
<script type="text/javascript" src="bundles/ui-select.js"></script>
<script type="text/javascript" src="bundles/month-picker.js"></script>
<script src="http://sec-aegisfe.didistatic.com/static/aegisfe/water-mark1.0.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.10.1/xlsx.full.min.js"></script>
<!--<script type="text/javascript" src="bundles/hubs.js">-->
<script type="text/javascript">
GC.Spread.Sheets.LicenseKey = constant.regesterInformation.userKey;
......
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