Commit 7e174a80 authored by chase's avatar chase

文件上传接口及报表上传下载

parent 725227db
...@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller; ...@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.google.common.collect.Lists;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dpo.PagingDto; import pwc.taxtech.atms.dpo.PagingDto;
...@@ -15,6 +14,7 @@ import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto; ...@@ -15,6 +14,7 @@ import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam; import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.DataImportService; import pwc.taxtech.atms.service.impl.DataImportService;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.LgGlBalanceService; import pwc.taxtech.atms.service.impl.LgGlBalanceService;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -29,6 +29,8 @@ public class DataImportController extends BaseController { ...@@ -29,6 +29,8 @@ public class DataImportController extends BaseController {
@Resource @Resource
private LgGlBalanceService lgGlBalanceService; private LgGlBalanceService lgGlBalanceService;
@Resource
private DidiFileUploadService didiFileUploadService;
@PostMapping("GetBalanceDataForDisplay") @PostMapping("GetBalanceDataForDisplay")
public PagingResultDto<TrialBalanceDto> getBalanceDataForDisplay(@RequestBody TrialBalanceParam param) { public PagingResultDto<TrialBalanceDto> getBalanceDataForDisplay(@RequestBody TrialBalanceParam param) {
PagingResultDto<TrialBalanceDto> resultDto = new PagingResultDto<>(); PagingResultDto<TrialBalanceDto> resultDto = new PagingResultDto<>();
...@@ -91,6 +93,7 @@ public class DataImportController extends BaseController { ...@@ -91,6 +93,7 @@ public class DataImportController extends BaseController {
@RequestMapping(value = "RLITExcelFile", method = RequestMethod.POST) @RequestMapping(value = "RLITExcelFile", method = RequestMethod.POST)
public OperationResultDto importRLITExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) { public OperationResultDto importRLITExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) {
try { try {
didiFileUploadService.uploadFile(file,"aaaa.xlsx","didi");
List<String> orgList = (List<String>)JSONArray.parse(orgIds); List<String> orgList = (List<String>)JSONArray.parse(orgIds);
String valMsg = valParameter(file,orgList,periodDate); String valMsg = valParameter(file,orgList,periodDate);
if(StringUtils.isNotEmpty(valMsg)){ if(StringUtils.isNotEmpty(valMsg)){
......
package pwc.taxtech.atms.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.reportUpload.ReportUploadParam;
import pwc.taxtech.atms.dto.reportUpload.ReportUploadResult;
import pwc.taxtech.atms.service.impl.ReportUploadService;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "api/v1/reportUploadDetail")
public class ReportUploadDetailController extends BaseController {
@Resource
private ReportUploadService reportUploadService;
@PostMapping("queryPage")
public CamelPagingResultDto<ReportUploadResult> queryPage(@RequestBody ReportUploadParam param) {
return new CamelPagingResultDto<>(reportUploadService.queryPage(param));
}
}
...@@ -3,26 +3,17 @@ package pwc.taxtech.atms.controller; ...@@ -3,26 +3,17 @@ package pwc.taxtech.atms.controller;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMapping; import pwc.taxtech.atms.common.message.ErrorMessage;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ServletContextAware;
import pwc.taxtech.atms.common.util.MyAsserts; import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.constant.enums.EnumImportType; import pwc.taxtech.atms.constant.enums.EnumImportType;
...@@ -33,8 +24,11 @@ import pwc.taxtech.atms.entity.Template; ...@@ -33,8 +24,11 @@ import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.exception.BadParameterException; import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.NotFoundException; import pwc.taxtech.atms.exception.NotFoundException;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.HttpFileService; import pwc.taxtech.atms.service.impl.HttpFileService;
import pwc.taxtech.atms.service.impl.ReportUploadService;
import pwc.taxtech.atms.service.impl.TemplateServiceImpl; import pwc.taxtech.atms.service.impl.TemplateServiceImpl;
import pwc.taxtech.atms.vat.entity.ReportUpload;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -46,7 +40,7 @@ import java.util.List; ...@@ -46,7 +40,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping(value = "api/v1/template") @RequestMapping(value = "api/v1/template")
public class TemplateController extends BaseController{ public class TemplateController extends BaseController {
private ServletContext servletContext; private ServletContext servletContext;
...@@ -56,6 +50,9 @@ public class TemplateController extends BaseController{ ...@@ -56,6 +50,9 @@ public class TemplateController extends BaseController{
@Autowired @Autowired
private HttpFileService httpFileService; private HttpFileService httpFileService;
@Autowired
ReportUploadService reportUploadService;
@RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
List<TemplateDto> get(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "reportType") String reportType) { List<TemplateDto> get(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "reportType") String reportType) {
...@@ -71,32 +68,32 @@ public class TemplateController extends BaseController{ ...@@ -71,32 +68,32 @@ public class TemplateController extends BaseController{
return Collections.emptyList(); return Collections.emptyList();
} }
private InputStream handleFomularView(InputStream is){ private InputStream handleFomularView(InputStream is) {
Workbook workbook = null; Workbook workbook = null;
try { try {
workbook = new XSSFWorkbook(is); workbook = new XSSFWorkbook(is);
} catch (IOException e ) { } catch (IOException e) {
logger.error("failed to read workbook!", e); logger.error("failed to read workbook!", e);
throw new ApplicationException("failed to read workbook!"); throw new ApplicationException("failed to read workbook!");
} }
for(int i = 0; i < workbook.getNumberOfSheets(); i++){ for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i); Sheet sheet = workbook.getSheetAt(i);
for(int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++){ for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r); Row row = sheet.getRow(r);
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) { for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
Cell cell = row.getCell(c); Cell cell = row.getCell(c);
if(cell != null && !cell.getCellStyle().getLocked()){ if (cell != null && !cell.getCellStyle().getLocked()) {
cell.setCellValue(StringUtils.EMPTY); cell.setCellValue(StringUtils.EMPTY);
} }
} }
} }
} }
ByteArrayOutputStream baos = new ByteArrayOutputStream (); ByteArrayOutputStream baos = new ByteArrayOutputStream();
try{ try {
workbook.write(baos); workbook.write(baos);
byte[] content = baos.toByteArray(); byte[] content = baos.toByteArray();
return new ByteArrayInputStream(content); return new ByteArrayInputStream(content);
} catch (Exception e){ } catch (Exception e) {
logger.error("failed write workbook!", e); logger.error("failed write workbook!", e);
throw new ApplicationException("failed write workbook!"); throw new ApplicationException("failed write workbook!");
} finally { } finally {
...@@ -228,9 +225,9 @@ public class TemplateController extends BaseController{ ...@@ -228,9 +225,9 @@ public class TemplateController extends BaseController{
@RequestMapping(value = "addExistTemplate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "addExistTemplate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
OperationResultDto<Boolean> addExistTemplate(@RequestBody TemplateAddExistDto templateAddExistDto){ OperationResultDto<Boolean> addExistTemplate(@RequestBody TemplateAddExistDto templateAddExistDto) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
if(templateAddExistDto.getTemplateGroupId() == null || CollectionUtils.isEmpty(templateAddExistDto.getTemplateIdList())){ if (templateAddExistDto.getTemplateGroupId() == null || CollectionUtils.isEmpty(templateAddExistDto.getTemplateIdList())) {
resultDto.setResult(false); resultDto.setResult(false);
return resultDto; return resultDto;
} }
...@@ -240,73 +237,90 @@ public class TemplateController extends BaseController{ ...@@ -240,73 +237,90 @@ public class TemplateController extends BaseController{
} }
@RequestMapping(value = "file/downloadTemplate", method = RequestMethod.GET) @RequestMapping(value = "file/downloadTemplate", method = RequestMethod.GET)
public void fileDownload(@RequestParam Integer fileType, @RequestParam(required=false) Integer serviceType, HttpServletResponse response){ public void fileDownload(@RequestParam Integer fileType, @RequestParam(required = false) Integer serviceType, HttpServletResponse response) {
//获取网站部署路径(通过ServletContext对象),用于确定下载文件位置,从而实现下载 //获取网站部署路径(通过ServletContext对象),用于确定下载文件位置,从而实现下载
String fileName = ""; String fileName = "";
if(serviceType == null){ if (serviceType == null) {
fileName = getFileName(fileType); fileName = getFileName(fileType);
}else{ } else {
fileName = getCitFileName(fileType); fileName = getCitFileName(fileType);
} }
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName="+fileName+".xlsx"); response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".xlsx");
ServletOutputStream out; ServletOutputStream out;
try { try {
InputStream inputStream = this.getClass().getResourceAsStream("/document/DataImport/" + fileName+".xlsx"); InputStream inputStream = this.getClass().getResourceAsStream("/document/DataImport/" + fileName + ".xlsx");
out = response.getOutputStream(); out = response.getOutputStream();
int b = 0; int b = 0;
byte[] buffer = new byte[512]; byte[] buffer = new byte[512];
while (b != -1){ while (b != -1) {
b = inputStream.read(buffer); b = inputStream.read(buffer);
out.write(buffer,0,b); out.write(buffer, 0, b);
} }
inputStream.close(); inputStream.close();
out.close(); out.close();
out.flush(); out.flush();
} catch (Exception e){ } catch (Exception e) {
logger.error(String.format("下载模板异常:%s",e.getMessage())); logger.error(String.format("下载模板异常:%s", e.getMessage()));
}
}
@ResponseBody
@RequestMapping(value = "upload", method = RequestMethod.POST)
public OperationResultDto upload(@RequestParam MultipartFile file, @RequestParam String projectId, @RequestParam Integer period) {
try {
ReportUpload data = new ReportUpload();
data.setProjectId(projectId);
data.setPeriod(period);
reportUploadService.saveData(file, data);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importRLITExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
} }
} }
private String getFileName(Integer fileType) { private String getFileName(Integer fileType) {
if(EnumImportType.ProfitLoss.getCode().equals(fileType)){ if (EnumImportType.ProfitLoss.getCode().equals(fileType)) {
return EnumImportType.ProfitLoss.name(); return EnumImportType.ProfitLoss.name();
}else if(EnumImportType.BalanceSheet.getCode().equals(fileType)){ } else if (EnumImportType.BalanceSheet.getCode().equals(fileType)) {
return EnumImportType.BalanceSheet.name(); return EnumImportType.BalanceSheet.name();
}else if(EnumImportType.RedLetterInfoTable.getCode().equals(fileType)){ } else if (EnumImportType.RedLetterInfoTable.getCode().equals(fileType)) {
return EnumImportType.RedLetterInfoTable.name(); return EnumImportType.RedLetterInfoTable.name();
}else if(EnumImportType.AdjustmentTable.getCode().equals(fileType)){ } else if (EnumImportType.AdjustmentTable.getCode().equals(fileType)) {
return EnumImportType.AdjustmentTable.name(); return EnumImportType.AdjustmentTable.name();
}else if(EnumImportType.CashFlow.getCode().equals(fileType)){ } else if (EnumImportType.CashFlow.getCode().equals(fileType)) {
return EnumImportType.CashFlow.name(); return EnumImportType.CashFlow.name();
}else if(EnumImportType.CoupaPurchasingReport.getCode().equals(fileType)){ } else if (EnumImportType.CoupaPurchasingReport.getCode().equals(fileType)) {
return EnumImportType.CoupaPurchasingReport.name(); return EnumImportType.CoupaPurchasingReport.name();
}else if(EnumImportType.InvoiceData.getCode().equals(fileType)){ } else if (EnumImportType.InvoiceData.getCode().equals(fileType)) {
return EnumImportType.InvoiceData.name(); return EnumImportType.InvoiceData.name();
}else if(EnumImportType.CertifiedInvoicesList.getCode().equals(fileType)){ } else if (EnumImportType.CertifiedInvoicesList.getCode().equals(fileType)) {
return EnumImportType.CertifiedInvoicesList.name(); return EnumImportType.CertifiedInvoicesList.name();
}else if(EnumImportType.InvoiceRecord.getCode().equals(fileType)){ } else if (EnumImportType.InvoiceRecord.getCode().equals(fileType)) {
return EnumImportType.InvoiceRecord.name(); return EnumImportType.InvoiceRecord.name();
}else if(EnumImportType.Undefined.getCode().equals(fileType)){ } else if (EnumImportType.Undefined.getCode().equals(fileType)) {
return EnumImportType.Undefined.name(); return EnumImportType.Undefined.name();
} }
return null; return null;
} }
private String getCitFileName(Integer fileType) { private String getCitFileName(Integer fileType) {
if(EnumCitImportType.JournalAdjust.getCode().equals(fileType)){ if (EnumCitImportType.JournalAdjust.getCode().equals(fileType)) {
return EnumCitImportType.JournalAdjust.name(); return EnumCitImportType.JournalAdjust.name();
}else if(EnumCitImportType.TrialBalance.getCode().equals(fileType)){ } else if (EnumCitImportType.TrialBalance.getCode().equals(fileType)) {
return EnumCitImportType.TrialBalance.name(); return EnumCitImportType.TrialBalance.name();
}else if(EnumCitImportType.DraftAccountMapping.getCode().equals(fileType)){ } else if (EnumCitImportType.DraftAccountMapping.getCode().equals(fileType)) {
return EnumCitImportType.DraftAccountMapping.name(); return EnumCitImportType.DraftAccountMapping.name();
}else if(EnumCitImportType.BalanceSheetPrcAdjust.getCode().equals(fileType)){ } else if (EnumCitImportType.BalanceSheetPrcAdjust.getCode().equals(fileType)) {
return EnumCitImportType.BalanceSheetPrcAdjust.name(); return EnumCitImportType.BalanceSheetPrcAdjust.name();
}else if(EnumCitImportType.ProfitPrcAdjust.getCode().equals(fileType)){ } else if (EnumCitImportType.ProfitPrcAdjust.getCode().equals(fileType)) {
return EnumCitImportType.ProfitPrcAdjust.name(); return EnumCitImportType.ProfitPrcAdjust.name();
}else if(EnumCitImportType.EAMAssetsDisposal.getCode().equals(fileType)){ } else if (EnumCitImportType.EAMAssetsDisposal.getCode().equals(fileType)) {
return EnumCitImportType.EAMAssetsDisposal.name(); return EnumCitImportType.EAMAssetsDisposal.name();
}else if(EnumCitImportType.SalaryAdvance.getCode().equals(fileType)){ } else if (EnumCitImportType.SalaryAdvance.getCode().equals(fileType)) {
return EnumCitImportType.SalaryAdvance.name(); return EnumCitImportType.SalaryAdvance.name();
} }
return null; return null;
......
package pwc.taxtech.atms.dto.reportUpload;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import java.io.Serializable;
public class ReportUploadParam implements Serializable {
private static final long serialVersionUID = -6945211413340301685L;
private CamelPagingDto pageInfo;
private String projectId;
private Integer period;
public String getProjectId() {
return projectId;
}
public Integer getPeriod() {
return period;
}
public CamelPagingDto getPageInfo() {
return this.pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.reportUpload;
import pwc.taxtech.atms.vat.entity.ReportUpload;
public class ReportUploadResult extends ReportUpload {
private static final long serialVersionUID = -2559545351825736401L;
private String fileUrl;
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
}
...@@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper; ...@@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpDelete;
...@@ -18,12 +19,10 @@ import org.apache.http.entity.mime.content.ByteArrayBody; ...@@ -18,12 +19,10 @@ import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.StringBody; import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.config.FileServiceConfig;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
...@@ -49,8 +48,6 @@ import java.util.stream.Collectors; ...@@ -49,8 +48,6 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class DidiFileUploadService extends BaseService { public class DidiFileUploadService extends BaseService {
@Autowired
private FileServiceConfig config;
@Resource @Resource
private FileUploadMapper fileUploadMapper; private FileUploadMapper fileUploadMapper;
...@@ -77,7 +74,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -77,7 +74,7 @@ public class DidiFileUploadService extends BaseService {
private static final String PROXY_PORT = "11007"; private static final String PROXY_PORT = "11007";
public FileUpload uploadFile(MultipartFile file, String bizSource) throws ServiceException { public FileUpload uploadFile(MultipartFile file, String fileName,String bizSource) throws ServiceException {
CloseableHttpClient httpClient = null; CloseableHttpClient httpClient = null;
String requestKey = CommonUtils.getUUID(); String requestKey = CommonUtils.getUUID();
String requestUrl = upload_post_url + "/" + requestKey; String requestUrl = upload_post_url + "/" + requestKey;
...@@ -89,7 +86,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -89,7 +86,7 @@ public class DidiFileUploadService extends BaseService {
httpClient = HttpClients.createDefault(); httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl); HttpPost httpPost = new HttpPost(requestUrl);
String md5Str = getFileMD5String(file); String md5Str = getFileMD5String(file);
ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, file.getOriginalFilename()); ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName)?file.getOriginalFilename():fileName);
StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain")); StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build(); HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build();
httpPost.setEntity(httpEntity); httpPost.setEntity(httpEntity);
...@@ -101,7 +98,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -101,7 +98,7 @@ public class DidiFileUploadService extends BaseService {
fileUpload = new FileUpload(); fileUpload = new FileUpload();
fileUpload.setBizSource(bizSource); fileUpload.setBizSource(bizSource);
fileUpload.setUid(CommonUtils.getUUID()); fileUpload.setUid(CommonUtils.getUUID());
fileUpload.setFileName(file.getOriginalFilename()); fileUpload.setFileName(StringUtils.isBlank(fileName)?file.getOriginalFilename():fileName);
fileUpload.setResourceKey(requestKey); fileUpload.setResourceKey(requestKey);
assemblyModel(resultDto, fileUpload); assemblyModel(resultDto, fileUpload);
uploadLog.setFileUploadId(fileUpload.getUid()); uploadLog.setFileUploadId(fileUpload.getUid());
......
package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.reportUpload.ReportUploadParam;
import pwc.taxtech.atms.dto.reportUpload.ReportUploadResult;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.vat.dao.ReportUploadMapper;
import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class ReportUploadService extends BaseService {
@Resource
private ReportUploadMapper reportUploadMapper;
@Autowired
protected AuthUserHelper authUserHelper;
@Resource
private UserMapper userMapper;
@Resource
private ProjectMapper projectMapper;
@Autowired
DidiFileUploadService didiFileUploadService;
public PageInfo<ReportUploadResult> queryPage(ReportUploadParam param) {
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
ReportUploadExample example = new ReportUploadExample();
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod());
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String,String> urlMap = null;
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
}
List<ReportUploadResult> resultList = new ArrayList<ReportUploadResult>();
for(ReportUpload data:dataList){
ReportUploadResult result = beanUtil.copyProperties(data, new ReportUploadResult());
result.setFileUrl(urlMap.get(data.getFileUploadId()));
resultList.add(result);
}
PageInfo<ReportUploadResult> pageInfo = new PageInfo<>(resultList);
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
public void saveData(MultipartFile file, ReportUpload data) {
String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid);
data.setCreator(user.getUserName());
String fileName = "";
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
fileName += project.getName();
fileName += "-";
fileName += data.getPeriod();
fileName += "-V";
ReportUploadExample example = new ReportUploadExample();
example.createCriteria().andProjectIdEqualTo(data.getProjectId()).andPeriodEqualTo(data.getPeriod());
example.setOrderByClause("version desc");
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(dataList)) {
fileName += (dataList.get(0).getVersion() + 1);
data.setVersion(dataList.get(0).getVersion() + 1);
} else {
fileName += 1;
data.setVersion(1);
}
fileName += ".xlsx";
data.setReportName(fileName);
FileUpload fileUpload = didiFileUploadService.uploadFile(file, fileName, "ReportUpload");
data.setFileUploadId(fileUpload.getUid());
data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date());
reportUploadMapper.insert(data);
}
}
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample;
@Mapper
public interface ReportUploadMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
long countByExample(ReportUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
int deleteByExample(ReportUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
int insert(ReportUpload record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
int insertSelective(ReportUpload record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
List<ReportUpload> selectByExampleWithRowbounds(ReportUploadExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
List<ReportUpload> selectByExample(ReportUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") ReportUpload record, @Param("example") ReportUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
int updateByExample(@Param("record") ReportUpload record, @Param("example") ReportUploadExample example);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import java.util.Date;
import pwc.taxtech.atms.entity.BaseEntity;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table report_upload
*
* @mbg.generated do_not_delete_during_merge
*/
public class ReportUpload extends BaseEntity implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.uid
*
* @mbg.generated
*/
private String uid;
/**
* Database Column Remarks:
* 组织id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.org_id
*
* @mbg.generated
*/
private String orgId;
/**
* Database Column Remarks:
* 项目id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.project_id
*
* @mbg.generated
*/
private String projectId;
/**
* Database Column Remarks:
* 期数
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.period
*
* @mbg.generated
*/
private Integer period;
/**
* Database Column Remarks:
* 创建人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.creator
*
* @mbg.generated
*/
private String creator;
/**
* Database Column Remarks:
* 创建时间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
* Database Column Remarks:
* 报表名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.report_name
*
* @mbg.generated
*/
private String reportName;
/**
* Database Column Remarks:
* 版本号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.version
*
* @mbg.generated
*/
private Integer version;
/**
* Database Column Remarks:
* 文件上传表id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column report_upload.file_upload_id
*
* @mbg.generated
*/
private String fileUploadId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table report_upload
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.uid
*
* @return the value of report_upload.uid
*
* @mbg.generated
*/
public String getUid() {
return uid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.uid
*
* @param uid the value for report_upload.uid
*
* @mbg.generated
*/
public void setUid(String uid) {
this.uid = uid == null ? null : uid.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.org_id
*
* @return the value of report_upload.org_id
*
* @mbg.generated
*/
public String getOrgId() {
return orgId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.org_id
*
* @param orgId the value for report_upload.org_id
*
* @mbg.generated
*/
public void setOrgId(String orgId) {
this.orgId = orgId == null ? null : orgId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.project_id
*
* @return the value of report_upload.project_id
*
* @mbg.generated
*/
public String getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.project_id
*
* @param projectId the value for report_upload.project_id
*
* @mbg.generated
*/
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.period
*
* @return the value of report_upload.period
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.period
*
* @param period the value for report_upload.period
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.creator
*
* @return the value of report_upload.creator
*
* @mbg.generated
*/
public String getCreator() {
return creator;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.creator
*
* @param creator the value for report_upload.creator
*
* @mbg.generated
*/
public void setCreator(String creator) {
this.creator = creator == null ? null : creator.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.create_time
*
* @return the value of report_upload.create_time
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.create_time
*
* @param createTime the value for report_upload.create_time
*
* @mbg.generated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.report_name
*
* @return the value of report_upload.report_name
*
* @mbg.generated
*/
public String getReportName() {
return reportName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.report_name
*
* @param reportName the value for report_upload.report_name
*
* @mbg.generated
*/
public void setReportName(String reportName) {
this.reportName = reportName == null ? null : reportName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.version
*
* @return the value of report_upload.version
*
* @mbg.generated
*/
public Integer getVersion() {
return version;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.version
*
* @param version the value for report_upload.version
*
* @mbg.generated
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column report_upload.file_upload_id
*
* @return the value of report_upload.file_upload_id
*
* @mbg.generated
*/
public String getFileUploadId() {
return fileUploadId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column report_upload.file_upload_id
*
* @param fileUploadId the value for report_upload.file_upload_id
*
* @mbg.generated
*/
public void setFileUploadId(String fileUploadId) {
this.fileUploadId = fileUploadId == null ? null : fileUploadId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", uid=").append(uid);
sb.append(", orgId=").append(orgId);
sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period);
sb.append(", creator=").append(creator);
sb.append(", createTime=").append(createTime);
sb.append(", reportName=").append(reportName);
sb.append(", version=").append(version);
sb.append(", fileUploadId=").append(fileUploadId);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ReportUploadExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table report_upload
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table report_upload
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table report_upload
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public ReportUploadExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table report_upload
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table report_upload
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andUidIsNull() {
addCriterion("`uid` is null");
return (Criteria) this;
}
public Criteria andUidIsNotNull() {
addCriterion("`uid` is not null");
return (Criteria) this;
}
public Criteria andUidEqualTo(String value) {
addCriterion("`uid` =", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotEqualTo(String value) {
addCriterion("`uid` <>", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThan(String value) {
addCriterion("`uid` >", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThanOrEqualTo(String value) {
addCriterion("`uid` >=", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThan(String value) {
addCriterion("`uid` <", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThanOrEqualTo(String value) {
addCriterion("`uid` <=", value, "uid");
return (Criteria) this;
}
public Criteria andUidLike(String value) {
addCriterion("`uid` like", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotLike(String value) {
addCriterion("`uid` not like", value, "uid");
return (Criteria) this;
}
public Criteria andUidIn(List<String> values) {
addCriterion("`uid` in", values, "uid");
return (Criteria) this;
}
public Criteria andUidNotIn(List<String> values) {
addCriterion("`uid` not in", values, "uid");
return (Criteria) this;
}
public Criteria andUidBetween(String value1, String value2) {
addCriterion("`uid` between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andUidNotBetween(String value1, String value2) {
addCriterion("`uid` not between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andOrgIdIsNull() {
addCriterion("org_id is null");
return (Criteria) this;
}
public Criteria andOrgIdIsNotNull() {
addCriterion("org_id is not null");
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(String value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(String value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(String value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(String value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(String value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(String value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLike(String value) {
addCriterion("org_id like", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotLike(String value) {
addCriterion("org_id not like", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<String> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<String> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(String value1, String value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(String value1, String value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andPeriodIsNull() {
addCriterion("period is null");
return (Criteria) this;
}
public Criteria andPeriodIsNotNull() {
addCriterion("period is not null");
return (Criteria) this;
}
public Criteria andPeriodEqualTo(Integer value) {
addCriterion("period =", value, "period");
return (Criteria) this;
}
public Criteria andPeriodNotEqualTo(Integer value) {
addCriterion("period <>", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThan(Integer value) {
addCriterion("period >", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("period >=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThan(Integer value) {
addCriterion("period <", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThanOrEqualTo(Integer value) {
addCriterion("period <=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodIn(List<Integer> values) {
addCriterion("period in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodNotIn(List<Integer> values) {
addCriterion("period not in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodBetween(Integer value1, Integer value2) {
addCriterion("period between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("period not between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andCreatorIsNull() {
addCriterion("creator is null");
return (Criteria) this;
}
public Criteria andCreatorIsNotNull() {
addCriterion("creator is not null");
return (Criteria) this;
}
public Criteria andCreatorEqualTo(String value) {
addCriterion("creator =", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotEqualTo(String value) {
addCriterion("creator <>", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThan(String value) {
addCriterion("creator >", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThanOrEqualTo(String value) {
addCriterion("creator >=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThan(String value) {
addCriterion("creator <", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThanOrEqualTo(String value) {
addCriterion("creator <=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLike(String value) {
addCriterion("creator like", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotLike(String value) {
addCriterion("creator not like", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorIn(List<String> values) {
addCriterion("creator in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotIn(List<String> values) {
addCriterion("creator not in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorBetween(String value1, String value2) {
addCriterion("creator between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotBetween(String value1, String value2) {
addCriterion("creator not between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andReportNameIsNull() {
addCriterion("report_name is null");
return (Criteria) this;
}
public Criteria andReportNameIsNotNull() {
addCriterion("report_name is not null");
return (Criteria) this;
}
public Criteria andReportNameEqualTo(String value) {
addCriterion("report_name =", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameNotEqualTo(String value) {
addCriterion("report_name <>", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameGreaterThan(String value) {
addCriterion("report_name >", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameGreaterThanOrEqualTo(String value) {
addCriterion("report_name >=", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameLessThan(String value) {
addCriterion("report_name <", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameLessThanOrEqualTo(String value) {
addCriterion("report_name <=", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameLike(String value) {
addCriterion("report_name like", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameNotLike(String value) {
addCriterion("report_name not like", value, "reportName");
return (Criteria) this;
}
public Criteria andReportNameIn(List<String> values) {
addCriterion("report_name in", values, "reportName");
return (Criteria) this;
}
public Criteria andReportNameNotIn(List<String> values) {
addCriterion("report_name not in", values, "reportName");
return (Criteria) this;
}
public Criteria andReportNameBetween(String value1, String value2) {
addCriterion("report_name between", value1, value2, "reportName");
return (Criteria) this;
}
public Criteria andReportNameNotBetween(String value1, String value2) {
addCriterion("report_name not between", value1, value2, "reportName");
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(Integer value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(Integer value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(Integer value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(Integer value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(Integer value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(Integer value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<Integer> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<Integer> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(Integer value1, Integer value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(Integer value1, Integer value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andFileUploadIdIsNull() {
addCriterion("file_upload_id is null");
return (Criteria) this;
}
public Criteria andFileUploadIdIsNotNull() {
addCriterion("file_upload_id is not null");
return (Criteria) this;
}
public Criteria andFileUploadIdEqualTo(String value) {
addCriterion("file_upload_id =", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotEqualTo(String value) {
addCriterion("file_upload_id <>", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdGreaterThan(String value) {
addCriterion("file_upload_id >", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdGreaterThanOrEqualTo(String value) {
addCriterion("file_upload_id >=", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLessThan(String value) {
addCriterion("file_upload_id <", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLessThanOrEqualTo(String value) {
addCriterion("file_upload_id <=", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLike(String value) {
addCriterion("file_upload_id like", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotLike(String value) {
addCriterion("file_upload_id not like", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdIn(List<String> values) {
addCriterion("file_upload_id in", values, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotIn(List<String> values) {
addCriterion("file_upload_id not in", values, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdBetween(String value1, String value2) {
addCriterion("file_upload_id between", value1, value2, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotBetween(String value1, String value2) {
addCriterion("file_upload_id not between", value1, value2, "fileUploadId");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table report_upload
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table report_upload
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.ReportUploadMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.ReportUpload">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="uid" jdbcType="VARCHAR" property="uid" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="report_name" jdbcType="VARCHAR" property="reportName" />
<result column="version" jdbcType="INTEGER" property="version" />
<result column="file_upload_id" jdbcType="VARCHAR" property="fileUploadId" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
`uid`, org_id, project_id, period, creator, create_time, report_name, version, file_upload_id
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.ReportUploadExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from report_upload
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.ReportUploadExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from report_upload
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.ReportUpload">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into report_upload (`uid`, org_id, project_id,
period, creator, create_time,
report_name, version, file_upload_id
)
values (#{uid,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{reportName,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{fileUploadId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.ReportUpload">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into report_upload
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
`uid`,
</if>
<if test="orgId != null">
org_id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="period != null">
period,
</if>
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="reportName != null">
report_name,
</if>
<if test="version != null">
version,
</if>
<if test="fileUploadId != null">
file_upload_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
#{orgId,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="reportName != null">
#{reportName,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=INTEGER},
</if>
<if test="fileUploadId != null">
#{fileUploadId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.ReportUploadExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from report_upload
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update report_upload
<set>
<if test="record.uid != null">
`uid` = #{record.uid,jdbcType=VARCHAR},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.creator != null">
creator = #{record.creator,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.reportName != null">
report_name = #{record.reportName,jdbcType=VARCHAR},
</if>
<if test="record.version != null">
version = #{record.version,jdbcType=INTEGER},
</if>
<if test="record.fileUploadId != null">
file_upload_id = #{record.fileUploadId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update report_upload
set `uid` = #{record.uid,jdbcType=VARCHAR},
org_id = #{record.orgId,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
creator = #{record.creator,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
report_name = #{record.reportName,jdbcType=VARCHAR},
version = #{record.version,jdbcType=INTEGER},
file_upload_id = #{record.fileUploadId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.ReportUploadExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from report_upload
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
</mapper>
\ No newline at end of file
...@@ -1072,7 +1072,23 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g ...@@ -1072,7 +1072,23 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
deepStateRedirect: false, deepStateRedirect: false,
sticky: false sticky: false
}); });
//report upload list view
$stateProvider.state({
name: 'vat.generateReport.reportUploadView',
url: '/reportUploadView',
views: {
'@vat.generateReport': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-report-upload-detail></vat-report-upload-detail>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
/**********a beautiful separated line for analyzeReport*********/ /**********a beautiful separated line for analyzeReport*********/
$stateProvider.state({ $stateProvider.state({
......
...@@ -654,6 +654,7 @@ ...@@ -654,6 +654,7 @@
"Expand": "展开", "Expand": "展开",
"ExportBtn": "导出", "ExportBtn": "导出",
"ExportExcel": "导出Excel", "ExportExcel": "导出Excel",
"UploadExcel": "上传保存Excel",
"ExportReportRequiredCheck": "至少选择一个报表导出", "ExportReportRequiredCheck": "至少选择一个报表导出",
"FCompany": "F 公司", "FCompany": "F 公司",
"FaceAmountNoTax": "票面金额(不含税)", "FaceAmountNoTax": "票面金额(不含税)",
...@@ -2214,5 +2215,11 @@ ...@@ -2214,5 +2215,11 @@
"Operater": "操作员", "Operater": "操作员",
"OperateTime": "操作时间", "OperateTime": "操作时间",
"ReportUploadDetail": "历史版本计算表",
"RepUploadDtlColSerialNo": "序号",
"RepUploadDtlColCreateTime": "保存时间",
"RepUploadDtlColCreator": "存档用户",
"RepUploadDtlColFileName": "计算表名称-系统生成",
"RepUploadDtlColDownload": "下载",
"~MustBeEndOneApp": "我必须是最后一个!" "~MustBeEndOneApp": "我必须是最后一个!"
} }
vatModule.controller('vatReportUploadDetailController', ['$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q',
'$interval', 'dxDataGridService', '$http', 'apiConfig', 'vatSessionService',
function ($scope, $log, $translate, $timeout, SweetAlert, $q, $interval, dxDataGridService, $http, apiConfig, vatSessionService) {
'use strict';
$log.debug('vatReportUploadDetailController.ctor()...');
//表格配置
$scope.revenueGridOptions = $.extend(true, {}, dxDataGridService.BASIC_GRID_OPTIONS, {
columns: [
{
dataField: 'serialNo',
caption: $translate.instant('RepUploadDtlColSerialNo'),
fixed: true,
allowHeaderFiltering: true, cellTemplate: function (container, options) {
try {
$("<span>" + (options.rowIndex + 1) + "</span>")
.appendTo(container);
} catch (e) {
$log.error(e);
}
}
},
{
dataField: 'createTime',
caption: $translate.instant('RepUploadDtlColCreateTime'),
fixed: true,
allowHeaderFiltering: true,
dataType: "date",
format: "yyyy-MM-dd HH:mm:ss",
},
{
dataField: 'creator',
caption: $translate.instant('RepUploadDtlColCreator'),
fixed: true,
allowHeaderFiltering: true
},
{
dataField: 'reportName',
caption: $translate.instant('RepUploadDtlColFileName'),
fixed: true,
allowHeaderFiltering: true
},
{
dataField: 'fileUrl',
caption: $translate.instant('RepUploadDtlColDownload'),
fixed: true,
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$("<a href='"+options.data.fileUrl+"'>下载</a>")
.appendTo(container);
} catch (e) {
$log.error(e);
}
}
}
],
bindingOptions: {
dataSource: 'pageConfDataSource'
}
});
//刷新页面
$scope.refreshGrid = function () {
$scope.searchParam.projectId = vatSessionService.project.id;
var month = vatSessionService.month < 10 ? ("0" + vatSessionService.month) : vatSessionService.month;
$scope.searchParam.period = "" + vatSessionService.year + month;
$scope.searchParam.pageInfo = {
pageIndex: $scope.pagingOptions.pageIndex,
totalItems: $scope.pagingOptions.totalItems,
pageSize: $scope.pagingOptions.pageSize
};
$http.post('/reportUploadDetail/queryPage', $scope.searchParam, apiConfig.createVat())
.success(function (res) {
if (res && res.list) {
$scope.pageConfDataSource = res.list;
$scope.pagingOptions.totalItems = res.pageInfo.totalCount;
} else {
SweetAlert.error($translate.instant('SystemError'));
}
})
};
(function initialize() {
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 20 //每页多少条数据
};
$scope.searchParam = {};
function init() {
$scope.refreshGrid();
}
init()
})();
}
]);
\ No newline at end of file
vatModule.directive('vatReportUploadDetail', ['$log', 'browserService', '$translate', 'region', '$timeout',
function ($log, browserService, $translate, region, $timeout) {
$log.debug('vatReportUploadDetail.ctor()...');
return {
restrict: 'E',
templateUrl: 'app/common/controls/vat-report-upload-view/vat-report-upload.html' + '?_=' + Math.random(),
scope: {},
controller: 'vatReportUploadDetailController'
}
}
]);
\ No newline at end of file

@border-color: #d4d4d4;
@margin-left: 60px;
@container-width: 970px;
@control-width: 120px;
//sharing
.header {
padding: 15px;
img {
margin-top: 3px;
}
.search-panel {
border: 1px solid #CDCDCD;
border-radius: 5px;
padding: 5px;
.row {
margin: 10px 0;
.filter-item {
display: inline-block;
vertical-align: middle;
height: 32px;
}
.fileter-label {
text-align: right;
height: 32px;
padding-top: 5px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
padding-left: 0;
}
.invoice-btn {
min-width: 90px;
height: 34px;
}
}
.table-bottom {
margin-bottom: 0px !important;
.lbl-name {
word-break: keep-all;
}
td {
vertical-align: middle;
}
}
}
}
.table-bottom {
margin-bottom: 0px !important;
.lbl-name {
word-break: keep-all;
}
td {
vertical-align: middle;
}
}
.red-color {
color: #d04a02;
/*vertical-align: middle;*/
}
.dx-widget {
font-size: 13px;
}
//share
.header-title {
padding: 10px;
.sub-title {
font-family: "Microsoft YaHei";
font-weight: 400;
font-size: 12px;
color: rgb(153, 153, 153);
}
.title-name {
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular", "Microsoft YaHei";
font-weight: 700;
font-style: normal;
}
}
.inline-block {
display: inline-block;
.left-side {
display: inline-block;
}
.right-side {
float: right;
display: inline-block;
}
}
.invoice-btn {
min-width: 80px;
height: 28px;
margin-right: 10px;
font-weight: normal;
font-size: 13px;
font-family: 'Microsoft YaHei';
}
.invoice-card {
width: 120px;
height: 130px;
border: 1px dashed @border-color;
border: 1px dashed rgba(0, 0, 0, 0.2);
border-radius: 5px;
background-color: #fff; /*#fbfbfb;*/
text-align: center;
cursor: pointer;
float: left;
margin: 10px;
position: relative;
&:hover {
background-color: #fff !important;
box-shadow: #a06748 1px 1px;
}
//卡片顶部的绝对定位
.dx-checkbox-container {
position: absolute;
left: 59px;
top: -8px;
}
}
.span-btn {
color: #6699CC;
padding: 0px 4px;
cursor: pointer;
font-size: 12px;
}
.borderless td, .borderless th {
border: none !important;
vertical-align: middle !important;
}
.page-footer {
display: inline-block;
float: right;
/*padding-right: 20px;*/
}
.invoice-table-dialog {
.modal-dialog {
min-width: 650px;
.modal-title {
color: red;
}
}
}
.invoiceNumber-link {
cursor: pointer;
/*color:#6699cc;*/
}
.vat-bill-detail {
height: 100% !important;
padding-top: 0px !important;
position: relative;
font-size: 13px;
.period-picker {
width: 150px;
border: 1px solid #c7c5c0;
display: inline-block;
line-height: 20px;
margin-top: 7px;
}
.imp-subheader {
display: inline-block;
font-size: 15px;
height: 30px;
line-height: 30px;
vertical-align: middle;
border: none;
select {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
background: transparent;
}
}
.dx-datagrid-group-closed:before {
/* font-family: "ui-grid"; */
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em;
content: inherit!important;
}
.header-title {
padding: 10px;
.title-name {
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular", "Microsoft YaHei";
font-weight: 700;
font-style: normal;
}
}
.custom-control {
width: @control-width !important;
height: 25px;
line-height: 25px;
}
.btn-search {
width: @control-width !important;
}
.content-container {
height: calc(~'100% - 40px');
position: relative;
.body {
.buttom-row {
padding: 15px;
display: inline-block;
width: 100%;
.left-side {
display: inline-block;
/*padding-left:5px;*/
.select-title {
margin-left: 20px;
}
.select-number {
padding: 0 1px;
color: red;
}
}
.right-side {
float: right;
display: inline-block;
/*padding-right:5px;*/
.btn {
margin-left: 20px;
}
}
}
.grid-container {
padding: 0px 15px;
/*height: 350px;*/
/*height:100%;*/
#invoiceGridContainer {
max-height: 100%;
}
.dx-datagrid-rowsview .dx-row > .dx-master-detail-cell {
padding: 0px !important;
}
.dx-datagrid-nowrap.dx-datagrid-headers .dx-header-row > td > .dx-datagrid-text-content {
white-space: normal !important;
}
.internal-grid-container {
padding: 10px 10px 10px 0;
& > div:first-child {
padding: 0 0 5px 10px;
font-size: 13px;
/*font-weight: bold;*/
}
}
}
}
}
.importVerifyInvoiceModal {
.modal-dialog {
height: 200px;
width: 610px;
}
.modal-footer {
text-align: left;
}
}
}
<div class="vat-bill-detail">
<div class="header-title">
<div style="display:inline-block"><span class="title-name">{{'ReportUploadDetail' | translate }}</span></div>
</div>
<div class="content-container">
<div class="body">
<div class="grid-container">
<div id="invoiceGridContainer" dx-data-grid="revenueGridOptions">
<div data-options="dxTemplate:{ name:'editCellTemplate' }">
</div>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshGrid()"></ack-pagination>
</div>
</div>
</div>
</div>
commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams', commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams',
'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService', 'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService', 'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService', 'vatApproveService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService, function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
vatReportService, vatReportCacheService, vatSessionService, loginContext, enums, vatCommonService, vatWorkflowService, projectService, vatReportService, vatReportCacheService, vatSessionService, loginContext, enums, vatCommonService, vatWorkflowService, projectService,
$uibModal, $cookies, Upload, vatImportService, vatApproveService) { $uibModal, $cookies, Upload, vatImportService, vatApproveService) {
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
$scope.file = null; $scope.file = null;
$scope.activeSheet = { $scope.activeSheet = {
activeCol : null, activeCol: null,
activeRow : null, activeRow: null,
activeTemplateId : null activeTemplateId: null
}; };
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
return invoiceType; return invoiceType;
} }
var getDataSourceModel = function (sourceData,type) { var getDataSourceModel = function (sourceData, type) {
var obj = new Object(); var obj = new Object();
switch (type) { switch (type) {
//进项数据源 //进项数据源
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
case enums.formulaDataSourceType.Report: case enums.formulaDataSourceType.Report:
obj.period = sourceData.period; obj.period = sourceData.period;
obj.year = sourceData.year; obj.year = sourceData.year;
obj.reportName=sourceData.reportName; obj.reportName = sourceData.reportName;
obj.project = sourceData.rowName; obj.project = sourceData.rowName;
obj.reportColumn = sourceData.columnName; obj.reportColumn = sourceData.columnName;
obj.reportID = sourceData.reportID; obj.reportID = sourceData.reportID;
...@@ -247,8 +247,7 @@ ...@@ -247,8 +247,7 @@
$scope.taxCellDetail.summaryExp = $translate.instant('Conclusion'); $scope.taxCellDetail.summaryExp = $translate.instant('Conclusion');
$scope.taxCellDetail.summaryValue = $scope.taxCellDetail.summaryValue.replace(sourceData.internalCode, '(' + obj.cellConditionValue + ')') $scope.taxCellDetail.summaryValue = $scope.taxCellDetail.summaryValue.replace(sourceData.internalCode, '(' + obj.cellConditionValue + ')')
.replace('IF(True/False,', 'Math.min('); .replace('IF(True/False,', 'Math.min(');
} } else {
else {
$scope.taxCellDetail.summaryExp = $translate.instant('Conclusion') + '&nbsp;&nbsp;&nbsp;&nbsp;' $scope.taxCellDetail.summaryExp = $translate.instant('Conclusion') + '&nbsp;&nbsp;&nbsp;&nbsp;'
+ $scope.taxCellDetail.summaryExp.replace(sourceData.internalCode, obj.cellIndex); + $scope.taxCellDetail.summaryExp.replace(sourceData.internalCode, obj.cellIndex);
$scope.taxCellDetail.summaryValue = $scope.taxCellDetail.summaryValue.replace(sourceData.internalCode, '(' + obj.cellConditionValue + ')') $scope.taxCellDetail.summaryValue = $scope.taxCellDetail.summaryValue.replace(sourceData.internalCode, '(' + obj.cellConditionValue + ')')
...@@ -385,7 +384,7 @@ ...@@ -385,7 +384,7 @@
if (filterItems && filterItems.length > 0) { if (filterItems && filterItems.length > 0) {
$scope.taxCellDetail.items = _.map($scope.taxCellDetail.items, function (item) { $scope.taxCellDetail.items = _.map($scope.taxCellDetail.items, function (item) {
if (item.id === voucher.dataSourceId && item.name === voucher.dataSourceName) { if (item.id === voucher.dataSourceId && item.name === voucher.dataSourceName) {
item.dataSource.push(getDataSourceModel(voucher,enums.formulaDataSourceType.Voucher)); item.dataSource.push(getDataSourceModel(voucher, enums.formulaDataSourceType.Voucher));
} }
return item; return item;
}); });
...@@ -402,7 +401,7 @@ ...@@ -402,7 +401,7 @@
createTime: voucher.CreateTime, createTime: voucher.CreateTime,
name: voucher.dataSourceName, name: voucher.dataSourceName,
id: voucher.dataSourceId, id: voucher.dataSourceId,
dataSource: [getDataSourceModel(voucher,enums.formulaDataSourceType.Voucher)] dataSource: [getDataSourceModel(voucher, enums.formulaDataSourceType.Voucher)]
}) })
} }
}); });
...@@ -458,8 +457,7 @@ ...@@ -458,8 +457,7 @@
var tagInfo = sheets[0].getTag(row, column); var tagInfo = sheets[0].getTag(row, column);
if (constant.regesterInformation.active) { if (constant.regesterInformation.active) {
tagInfo = sheets[0].getTag(row, column); tagInfo = sheets[0].getTag(row, column);
} } else {
else {
tagInfo = sheets[1].getTag(row, column); tagInfo = sheets[1].getTag(row, column);
} }
if (tagInfo) { if (tagInfo) {
...@@ -597,17 +595,16 @@ ...@@ -597,17 +595,16 @@
index: row.index, index: row.index,
name: row.name, name: row.name,
amount: row.value, amount: row.value,
keyinData:row.keyinData keyinData: row.keyinData
}; };
modelItem.dataSource.push(parseItem); modelItem.dataSource.push(parseItem);
}); });
} } else if (jsonTagInfo.entriesCheckResultList && jsonTagInfo.entriesCheckResultList.length > 0) {
else if (jsonTagInfo.entriesCheckResultList && jsonTagInfo.entriesCheckResultList.length > 0) {
jsonTagInfo.entriesCheckResultList.forEach(function (row) { jsonTagInfo.entriesCheckResultList.forEach(function (row) {
var parseItem = { var parseItem = {
index: row.index, index: row.index,
name: row.name, name: row.name,
keyinData:row.keyinData, keyinData: row.keyinData,
amount: row.amount amount: row.amount
}; };
modelItem.dataSource.push(parseItem); modelItem.dataSource.push(parseItem);
...@@ -616,18 +613,16 @@ ...@@ -616,18 +613,16 @@
$scope.taxCellDetail.cellType = enums.cellDataSourceType.ModelDatasource; $scope.taxCellDetail.cellType = enums.cellDataSourceType.ModelDatasource;
$scope.taxCellDetail.items.push(modelItem); $scope.taxCellDetail.items.push(modelItem);
$scope.taxCellDetail.dataSourceCount++; $scope.taxCellDetail.dataSourceCount++;
} } else if (element.dataSourceType === enums.cellDataSourceType.Voucher
else if (element.dataSourceType === enums.cellDataSourceType.Voucher
|| element.dataSourceType === enums.cellDataSourceType.InputInvoice || element.dataSourceType === enums.cellDataSourceType.InputInvoice
|| element.dataSourceType === enums.cellDataSourceType.OutputInvoice) { || element.dataSourceType === enums.cellDataSourceType.OutputInvoice) {
var flag = true; var flag = true;
//todo: according to element to get the detail data //todo: according to element to get the detail data
var outItems; var outItems;
var convert = false; var convert = false;
if(element.items.length===1){ if (element.items.length === 1) {
outItems = JSON.parse(element.items[0]); outItems = JSON.parse(element.items[0]);
} } else {
else{
outItems = element.items; outItems = element.items;
convert = true; convert = true;
} }
...@@ -635,13 +630,12 @@ ...@@ -635,13 +630,12 @@
//todo: according to element to get the detail data //todo: according to element to get the detail data
angular.forEach(outItems, function (jsonData) { angular.forEach(outItems, function (jsonData) {
var item; var item;
if(convert){ if (convert) {
item = JSON.parse(jsonData); item = JSON.parse(jsonData);
} } else {
else{
item = jsonData; item = jsonData;
} }
var model = getDataSourceModel(item,element.type); var model = getDataSourceModel(item, element.type);
$($scope.taxCellDetail.items).each(function (itemIndex, item) { $($scope.taxCellDetail.items).each(function (itemIndex, item) {
if (item.type === element.type && item.name === element.name) { if (item.type === element.type && item.name === element.name) {
item.dataSource.push(model); item.dataSource.push(model);
...@@ -666,10 +660,9 @@ ...@@ -666,10 +660,9 @@
} }
}); });
// $scope.taxCellDetail.items = [_.first($scope.taxCellDetail.items)]; // $scope.taxCellDetail.items = [_.first($scope.taxCellDetail.items)];
} } else {
else {
var flag = true; var flag = true;
var model = getDataSourceModel(element,element.type); var model = getDataSourceModel(element, element.type);
//var element = $scope.element; //var element = $scope.element;
//SAP日报数据源和未开票数据源需要设置需要显示的款项列 //SAP日报数据源和未开票数据源需要设置需要显示的款项列
if ((enums.formulaDataSourceType.Unbilled === element.type if ((enums.formulaDataSourceType.Unbilled === element.type
...@@ -682,8 +675,7 @@ ...@@ -682,8 +675,7 @@
if (element.reportTemplateID != $scope.templateId || element.period != $scope.period) { if (element.reportTemplateID != $scope.templateId || element.period != $scope.period) {
$scope.taxCellDetail.showFormulaSummary = false; $scope.taxCellDetail.showFormulaSummary = false;
} }
} } else if (element.type == enums.formulaDataSourceType.BSPL
else if (element.type == enums.formulaDataSourceType.BSPL
|| element.type == enums.formulaDataSourceType.Judgment) { || element.type == enums.formulaDataSourceType.Judgment) {
$scope.taxCellDetail.showFormulaSummary = false; $scope.taxCellDetail.showFormulaSummary = false;
} }
...@@ -879,6 +871,7 @@ ...@@ -879,6 +871,7 @@
////////////////////// //////////////////////
$scope.spread; $scope.spread;
$scope.evenType;
$scope.spreads = []; $scope.spreads = [];
$scope.exportReportData = []; $scope.exportReportData = [];
$scope.templateIds = []; $scope.templateIds = [];
...@@ -915,7 +908,8 @@ ...@@ -915,7 +908,8 @@
}; };
//打开导出文件弹出框 //打开导出文件弹出框
$scope.openExportPop = function () { $scope.openExportPop = function (evenType) {
$scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) { var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturn'; return g.name == 'TaxReturn';
}); });
...@@ -941,6 +935,22 @@ ...@@ -941,6 +935,22 @@
}); });
} }
$scope.uploadReportTreeOptions = {
dataSource: [{id: '0', templateId: '0', name: '纳税申报表', items: [], expanded: true}],
displayExpr: 'name',
keyExpr: 'id',
selectionMode: 'Multiple',
showCheckBoxesMode: 'normal',
dataStructure: "plain",
selectByClick: true,
selectNodesRecursive: true,
expandAllEnabled: true,
expandNodesRecursive: true,
onSelectionChanged: function (args) {
$scope.selectedReportIds = args.component.getSelectedNodesKeys();
}
};
//批量导出EXCEL //批量导出EXCEL
$scope.export = function () { $scope.export = function () {
var grp = _.find($scope.$parent.$parent.groups, function (g) { var grp = _.find($scope.$parent.$parent.groups, function (g) {
...@@ -1044,7 +1054,7 @@ ...@@ -1044,7 +1054,7 @@
for (var index = 0; index < $scope.spreads.length; index++) { for (var index = 0; index < $scope.spreads.length; index++) {
var currentSheet = $scope.spreads[index].getActiveSheet(); var currentSheet = $scope.spreads[index].getActiveSheet();
currentSheet.options.isProtected=false; currentSheet.options.isProtected = false;
for (var rowIndex = 0; rowIndex < currentSheet.getRowCount(); rowIndex++) { for (var rowIndex = 0; rowIndex < currentSheet.getRowCount(); rowIndex++) {
for (var columnIndex = 0; columnIndex < currentSheet.getColumnCount(); columnIndex++) { for (var columnIndex = 0; columnIndex < currentSheet.getColumnCount(); columnIndex++) {
var cellStyle = currentSheet.getActualStyle(rowIndex, columnIndex, GC.Spread.Sheets.SheetArea.viewport, true); var cellStyle = currentSheet.getActualStyle(rowIndex, columnIndex, GC.Spread.Sheets.SheetArea.viewport, true);
...@@ -1059,11 +1069,38 @@ ...@@ -1059,11 +1069,38 @@
var excelIo = new GC.Spread.Excel.IO(); var excelIo = new GC.Spread.Excel.IO();
// here is excel IO API // here is excel IO API
excelIo.save(mainSpread.toJSON(), function (blob) { excelIo.save(mainSpread.toJSON(), function (blob) {
saveAs(blob, vatSessionService.project.name+'-'+vatSessionService.month+'-纳税申报.xlsx'); if ('export' == $scope.evenType) {
saveAs(blob, vatSessionService.project.name + '-' + vatSessionService.month + '-纳税申报.xlsx');
$('#busy-indicator-container').hide();
} else if ('upload' == $scope.evenType) {
var month = vatSessionService.month < 10 ? ("0" + vatSessionService.month) : vatSessionService.month;
Upload.upload({
url: apiInterceptor.webApiHostUrl + '/template/upload',
data: {
projectId: vatSessionService.project.id,
period: "" + vatSessionService.year + month
},
file: blob,
headers: {
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
withCredentials: true
},
withCredentials: true
}).then(function (resp) {
alert("上传保存成功");
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
}, function (resp) {
alert("上传保存失败");
$('#busy-indicator-container').hide();
}, function (evt) {
});
}
}, function (e) { }, function (e) {
alert(e); alert(e);
$('#busy-indicator-container').hide();
}); });
// vatExportService.exportReport(content).success(function (data) { // vatExportService.exportReport(content).success(function (data) {
...@@ -1076,6 +1113,7 @@ ...@@ -1076,6 +1113,7 @@
}, 500); }, 500);
} }
/////////////////////// ///////////////////////
$scope.testGetReportData = function () { $scope.testGetReportData = function () {
...@@ -1145,15 +1183,14 @@ ...@@ -1145,15 +1183,14 @@
if (report && report.result && report.data) { if (report && report.result && report.data) {
$scope.reportId = report.data.id; $scope.reportId = report.data.id;
getReportData(); getReportData();
} else if(!(report.result && report.data)){ } else if (!(report.result && report.data)) {
$scope.reportData = []; $scope.reportData = [];
$scope.formulaBlocks = []; $scope.formulaBlocks = [];
$scope.manualDataSources = []; $scope.manualDataSources = [];
} }
}); });
} }
} } else {
else {
getReportData(); getReportData();
} }
} }
...@@ -1183,8 +1220,8 @@ ...@@ -1183,8 +1220,8 @@
for (var i = 0; i < $scope.reportData.length; i++) { for (var i = 0; i < $scope.reportData.length; i++) {
var reportD = $scope.reportData[i]; var reportD = $scope.reportData[i];
if(manualData.keyinData && reportD.rowIndex === cellData.rowIndex if (manualData.keyinData && reportD.rowIndex === cellData.rowIndex
&& reportD.columnIndex === cellData.columnIndex){ && reportD.columnIndex === cellData.columnIndex) {
reportD.keyinData = manualData.keyinData; reportD.keyinData = manualData.keyinData;
} }
for (var j = 0; j < reportD.dataSourceList.length; j++) { for (var j = 0; j < reportD.dataSourceList.length; j++) {
...@@ -1224,8 +1261,7 @@ ...@@ -1224,8 +1261,7 @@
manualDs.name = manualData.name; manualDs.name = manualData.name;
manualDs.keyinData = manualData.keyinData; manualDs.keyinData = manualData.keyinData;
manualDs.description = manualData.description; manualDs.description = manualData.description;
} } else {
else {
cellData.dataSourceList.push(manualData); cellData.dataSourceList.push(manualData);
} }
...@@ -1245,8 +1281,7 @@ ...@@ -1245,8 +1281,7 @@
if (!_.isEmpty(invoiceDs)) { if (!_.isEmpty(invoiceDs)) {
cellData.dataInvoiceList = cellData.dataInvoiceList.concat(invoiceDs); cellData.dataInvoiceList = cellData.dataInvoiceList.concat(invoiceDs);
} }
} } else if (manualData.dataSourceType === enums.cellDataSourceType.Voucher) {
else if (manualData.dataSourceType === enums.cellDataSourceType.Voucher) {
var voucherDs = manualData.extraItems && _.chain(manualData.extraItems).reject(function (x) { var voucherDs = manualData.extraItems && _.chain(manualData.extraItems).reject(function (x) {
return _.some(cellData.dataVoucherList, {id: x.id}); return _.some(cellData.dataVoucherList, {id: x.id});
}).map(function (x) { }).map(function (x) {
...@@ -1284,8 +1319,7 @@ ...@@ -1284,8 +1319,7 @@
manualDataSource.item2.keyinData = manualData.keyinData; manualDataSource.item2.keyinData = manualData.keyinData;
manualDataSource.item2.name = manualData.name; manualDataSource.item2.name = manualData.name;
manualDataSource.item2.description = manualData.description; manualDataSource.item2.description = manualData.description;
} } else {
else {
$scope.manualDataSources.push({item1: manualData.cellTemplateId, item2: manualData}); $scope.manualDataSources.push({item1: manualData.cellTemplateId, item2: manualData});
} }
...@@ -1428,8 +1462,7 @@ ...@@ -1428,8 +1462,7 @@
manualDs.amount = manualData.amount; manualDs.amount = manualData.amount;
manualDs.name = manualData.name; manualDs.name = manualData.name;
manualDs.description = manualData.description; manualDs.description = manualData.description;
} } else {
else {
cellData.dataSourceList.push(manualData); cellData.dataSourceList.push(manualData);
} }
...@@ -1503,8 +1536,7 @@ ...@@ -1503,8 +1536,7 @@
manualDataSource.item2.amount = manualData.amount; manualDataSource.item2.amount = manualData.amount;
manualDataSource.item2.name = manualData.name; manualDataSource.item2.name = manualData.name;
manualDataSource.item2.description = manualData.description; manualDataSource.item2.description = manualData.description;
} } else {
else {
$scope.manualDataSources.push({item1: manualData.cellTemplateID, item2: manualData}); $scope.manualDataSources.push({item1: manualData.cellTemplateID, item2: manualData});
} }
...@@ -1517,17 +1549,17 @@ ...@@ -1517,17 +1549,17 @@
//单元格详细信息点击确定时执行 //单元格详细信息点击确定时执行
$scope.confirm = function () { $scope.confirm = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) {
if(result&&result=='committed'){ if (result && result == 'committed') {
SweetAlert.error('报表提审中!'); SweetAlert.error('报表提审中!');
}else{ } else {
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo; $scope.handInputModel.name = $scope.taxCellDetail.inputMemo;
var r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/; var r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/;
if ($scope.taxCellDetail.keyinData) { if ($scope.taxCellDetail.keyinData) {
$scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData; $scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData;
}else { } else {
$scope.handInputModel.amount = $scope.taxCellDetail.inputValue; $scope.handInputModel.amount = $scope.taxCellDetail.inputValue;
} }
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo; $scope.handInputModel.description = $scope.taxCellDetail.inputMemo;
...@@ -1969,8 +2001,7 @@ ...@@ -1969,8 +2001,7 @@
if (or.result) { if (or.result) {
if (!or.data) {//不存在任何'提交审核'的记录,说明还未做过任何报表审批操作。此时不显示'备注'按钮 if (!or.data) {//不存在任何'提交审核'的记录,说明还未做过任何报表审批操作。此时不显示'备注'按钮
$scope.showRemarksBt = false; $scope.showRemarksBt = false;
} } else {
else {
$scope.showRemarksBt = true; $scope.showRemarksBt = true;
} }
setRemarkBtTitle($scope.showRemarksBt); setRemarkBtTitle($scope.showRemarksBt);
...@@ -1990,8 +2021,7 @@ ...@@ -1990,8 +2021,7 @@
}); });
if ($scope.approveLevel > 0 && $scope.approveLevel <= maxLevelDto.orderIndex && !maxLevelDto.isDone) { if ($scope.approveLevel > 0 && $scope.approveLevel <= maxLevelDto.orderIndex && !maxLevelDto.isDone) {
$scope.showRemarksBt = true; $scope.showRemarksBt = true;
} } else {//'审核通过'最后一级后,不显示'备注'
else {//'审核通过'最后一级后,不显示'备注'
$scope.showRemarksBt = false; $scope.showRemarksBt = false;
} }
setRemarkBtTitle($scope.showRemarksBt); setRemarkBtTitle($scope.showRemarksBt);
...@@ -2256,8 +2286,7 @@ ...@@ -2256,8 +2286,7 @@
var task = _.where(node.workflowTaskList, {dictionaryKey: taskKey})[0]; var task = _.where(node.workflowTaskList, {dictionaryKey: taskKey})[0];
return task; return task;
} }
} } else {
else {
return null; return null;
} }
} }
...@@ -2293,8 +2322,7 @@ ...@@ -2293,8 +2322,7 @@
if ($scope.reportId === args.reportID) { if ($scope.reportId === args.reportID) {
$scope.initRow = range.row; $scope.initRow = range.row;
$scope.initCol = range.col; $scope.initCol = range.col;
} } else {
else {
var serviceTypeRouteStr = $state.current.name; var serviceTypeRouteStr = $state.current.name;
serviceTypeRouteStr = serviceTypeRouteStr.split('.')[0]; serviceTypeRouteStr = serviceTypeRouteStr.split('.')[0];
$state.go(serviceTypeRouteStr + '.generateReport.reportView', { $state.go(serviceTypeRouteStr + '.generateReport.reportView', {
...@@ -2308,7 +2336,7 @@ ...@@ -2308,7 +2336,7 @@
} }
}); });
var loadData = $rootScope.$on("loadData",function(event,args){ var loadData = $rootScope.$on("loadData", function (event, args) {
$log.debug('loadData: ' + JSON.stringify(args)); $log.debug('loadData: ' + JSON.stringify(args));
loadCellData(vatSessionService.month); loadCellData(vatSessionService.month);
}); });
...@@ -2472,8 +2500,7 @@ ...@@ -2472,8 +2500,7 @@
if (data.length > 0) { if (data.length > 0) {
$scope.voucherList = data; $scope.voucherList = data;
$scope.evidenceTotalCount = '(' + data.length + ')'; $scope.evidenceTotalCount = '(' + data.length + ')';
} } else if (data.length === 0) {
else if (data.length === 0) {
$scope.evidenceTotalCount = ''; $scope.evidenceTotalCount = '';
} }
}).error(function () { }).error(function () {
...@@ -2486,8 +2513,7 @@ ...@@ -2486,8 +2513,7 @@
searchEvidence(); searchEvidence();
if ($scope.voucherList.length > 0) { if ($scope.voucherList.length > 0) {
return $translate.instant('EvidenceTab') + '(' + $scope.voucherList.length + ')'; return $translate.instant('EvidenceTab') + '(' + $scope.voucherList.length + ')';
} } else {
else {
return $translate.instant('EvidenceTab'); return $translate.instant('EvidenceTab');
} }
} }
...@@ -2584,13 +2610,13 @@ ...@@ -2584,13 +2610,13 @@
} }
}; };
$scope.commitApprove = function(){ $scope.commitApprove = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) {
if(result&&result=='committed'){ if (result && result == 'committed') {
SweetAlert.error('报表提审中!'); SweetAlert.error('报表提审中!');
}else{ } else {
SweetAlert.swal({ SweetAlert.swal({
title: "warning!", title: "warning!",
text: $translate.instant('报表提审后不能手工录入和重新生成!'), text: $translate.instant('报表提审后不能手工录入和重新生成!'),
...@@ -2604,7 +2630,7 @@ ...@@ -2604,7 +2630,7 @@
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
var approveParam={}; var approveParam = {};
approveParam.projectId = vatSessionService.project.id; approveParam.projectId = vatSessionService.project.id;
approveParam.periodDate = vatSessionService.project.periodDate; approveParam.periodDate = vatSessionService.project.periodDate;
vatApproveService.commitNewApproval(approveParam); vatApproveService.commitNewApproval(approveParam);
...@@ -2616,31 +2642,31 @@ ...@@ -2616,31 +2642,31 @@
}); });
} }
$scope.doApprove = function(){ $scope.doApprove = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) {
if(result&&result=='committed'){ if (result && result == 'committed') {
$("#ApprovalComment").modal('show') $("#ApprovalComment").modal('show')
}else{ } else {
SweetAlert.warning('当前报表未提审,请先提审!'); SweetAlert.warning('当前报表未提审,请先提审!');
} }
}); });
; ;
} }
$scope.rejectApproval =function(){ $scope.rejectApproval = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.checkTask(vatSessionService.project.id,vatSessionService.project.period,'disagreed',$scope.comment).success(function(){ vatApproveService.checkTask(vatSessionService.project.id, vatSessionService.project.period, 'disagreed', $scope.comment).success(function () {
$("#ApprovalComment").modal('hide'); $("#ApprovalComment").modal('hide');
}); });
} }
$scope.agreeApproval =function(){ $scope.agreeApproval = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.checkTask(vatSessionService.project.id,vatSessionService.project.period,'agreed',$scope.comment).success(function(){ vatApproveService.checkTask(vatSessionService.project.id, vatSessionService.project.period, 'agreed', $scope.comment).success(function () {
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Completed vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Completed
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished); , constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
$("#ApprovalComment").modal('hide'); $("#ApprovalComment").modal('hide');
...@@ -2655,8 +2681,7 @@ ...@@ -2655,8 +2681,7 @@
orderfileName = false; orderfileName = false;
var list = _.sortBy($scope.voucherList, 'fileName'); var list = _.sortBy($scope.voucherList, 'fileName');
$scope.voucherList = list; $scope.voucherList = list;
} } else {
else {
orderfileName = true; orderfileName = true;
var list = _.sortBy($scope.voucherList, 'fileName'); var list = _.sortBy($scope.voucherList, 'fileName');
$scope.voucherList = list.reverse(); $scope.voucherList = list.reverse();
...@@ -2667,8 +2692,7 @@ ...@@ -2667,8 +2692,7 @@
orderperiodId = false; orderperiodId = false;
var list = _.sortBy($scope.voucherList, 'periodID'); var list = _.sortBy($scope.voucherList, 'periodID');
$scope.voucherList = list; $scope.voucherList = list;
} } else {
else {
orderperiodId = true; orderperiodId = true;
var list = _.sortBy($scope.voucherList, 'periodID'); var list = _.sortBy($scope.voucherList, 'periodID');
$scope.voucherList = list.reverse(); $scope.voucherList = list.reverse();
...@@ -2679,8 +2703,7 @@ ...@@ -2679,8 +2703,7 @@
orderfileType = false; orderfileType = false;
var list = _.sortBy($scope.voucherList, 'fileType'); var list = _.sortBy($scope.voucherList, 'fileType');
$scope.voucherList = list; $scope.voucherList = list;
} } else {
else {
orderfileType = true; orderfileType = true;
var list = _.sortBy($scope.voucherList, 'fileType'); var list = _.sortBy($scope.voucherList, 'fileType');
$scope.voucherList = list.reverse(); $scope.voucherList = list.reverse();
...@@ -2715,19 +2738,19 @@ ...@@ -2715,19 +2738,19 @@
$scope.voucherFileID = evidence.fileID; $scope.voucherFileID = evidence.fileID;
}; };
$scope.upLoadManual = function(){ $scope.upLoadManual = function () {
if(vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) {
if(result&&result=='committed'){ if (result && result == 'committed') {
SweetAlert.error('报表提审中!'); SweetAlert.error('报表提审中!');
}else{ } else {
var text= $(".li").find(".active").text(); var text = $(".li").find(".active").text();
$log.debug(text); $log.debug(text);
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){ if (text == '海关专用缴款书' || text == '代扣代缴税收通用缴款书取数') {
var excelIo = new GC.Spread.Excel.IO(); var excelIo = new GC.Spread.Excel.IO();
$("#importExcellFile").modal('show'); $("#importExcellFile").modal('show');
}else{ } else {
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数"); SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数");
} }
} }
...@@ -2736,39 +2759,37 @@ ...@@ -2736,39 +2759,37 @@
}; };
$scope.loadMyExcel = function(){ $scope.loadMyExcel = function () {
if($scope.file){ if ($scope.file) {
if($scope.hasManualLoad){ if ($scope.hasManualLoad) {
SweetAlert.warning("已载入文件,如需重新载入请先清空!"); SweetAlert.warning("已载入文件,如需重新载入请先清空!");
}else{ } else {
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1}); $scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount: 1});
var excelIo = new GC.Spread.Excel.IO(); var excelIo = new GC.Spread.Excel.IO();
var excelFile = $scope.file; var excelFile = $scope.file;
excelIo.open(excelFile, function(json) { excelIo.open(excelFile, function (json) {
var workbookObj = json; var workbookObj = json;
$scope.manualSpread.fromJSON(workbookObj); $scope.manualSpread.fromJSON(workbookObj);
}, function(e) { }, function (e) {
alert(e.errorMessage); alert(e.errorMessage);
if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/ ) { if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
document.getElementById('password').onselect = null; document.getElementById('password').onselect = null;
} }
}, { }, {});
});
$scope.hasManualLoad = true; $scope.hasManualLoad = true;
} }
}else{ } else {
SweetAlert.warning("请先选择文件!"); SweetAlert.warning("请先选择文件!");
} }
}; };
$scope.multiWrite = function(){ $scope.multiWrite = function () {
if($scope.hasManualLoad){ if ($scope.hasManualLoad) {
var manualSheet = $scope.manualSpread.getActiveSheet(); var manualSheet = $scope.manualSpread.getActiveSheet();
var currentSheet = $scope.spread.getActiveSheet() var currentSheet = $scope.spread.getActiveSheet()
currentSheet.options.isProtected=false; currentSheet.options.isProtected = false;
var text= $(".li").find(".active").text(); var text = $(".li").find(".active").text();
for (var rowIndex = 0; rowIndex < currentSheet.getRowCount(); rowIndex++) { for (var rowIndex = 0; rowIndex < currentSheet.getRowCount(); rowIndex++) {
for (var columnIndex = 0; columnIndex < currentSheet.getColumnCount(); columnIndex++) { for (var columnIndex = 0; columnIndex < currentSheet.getColumnCount(); columnIndex++) {
var tagInfo = currentSheet.getTag(rowIndex, columnIndex); var tagInfo = currentSheet.getTag(rowIndex, columnIndex);
...@@ -2776,29 +2797,29 @@ ...@@ -2776,29 +2797,29 @@
var jsonTagInfo = JSON.parse(tagInfo); var jsonTagInfo = JSON.parse(tagInfo);
if (jsonTagInfo.isReadOnly) if (jsonTagInfo.isReadOnly)
continue; continue;
var cellValue= manualSheet.getValue(rowIndex,columnIndex); var cellValue = manualSheet.getValue(rowIndex, columnIndex);
var cellString=''; var cellString = '';
if(typeof(cellValue) == "string") cellValue = cellValue.trim(); if (typeof (cellValue) == "string") cellValue = cellValue.trim();
var r = /^00\d*|^\.\d+|\.$/; var r = /^00\d*|^\.\d+|\.$/;
if (typeof cellValue == "undefined" || cellValue == null || cellValue == "" || cellValue == "NaN")continue; if (typeof cellValue == "undefined" || cellValue == null || cellValue == "" || cellValue == "NaN") continue;
if (cellValue && (isNaN(cellValue) || r.test(cellValue)) || (text == '代扣代缴税收通用缴款书取数' && columnIndex == 0)) { if (cellValue && (isNaN(cellValue) || r.test(cellValue)) || (text == '代扣代缴税收通用缴款书取数' && columnIndex == 0)) {
cellString=cellValue; cellString = cellValue;
} else if (cellValue && parseFloat(cellValue).toFixed(2) > 9999999999999) { } else if (cellValue && parseFloat(cellValue).toFixed(2) > 9999999999999) {
SweetAlert.warning($translate.instant('CheckInputValueLength')); SweetAlert.warning($translate.instant('CheckInputValueLength'));
return; return;
} }
cellValue = jsonTagInfo.dataType === 5 ? parseInt(cellValue): parseFloat(cellValue).toFixed(2); cellValue = jsonTagInfo.dataType === 5 ? parseInt(cellValue) : parseFloat(cellValue).toFixed(2);
var handInputModel = {}; var handInputModel = {};
if(cellString){ if (cellString) {
handInputModel = { handInputModel = {
cellID: jsonTagInfo.cellID, cellID: jsonTagInfo.cellID,
cellTemplateID: jsonTagInfo.cellTemplateID, cellTemplateID: jsonTagInfo.cellTemplateID,
reportID: jsonTagInfo.reportID, reportID: jsonTagInfo.reportID,
keyinData: cellString keyinData: cellString
}; };
}else{ } else {
handInputModel = { handInputModel = {
cellID: jsonTagInfo.cellID, cellID: jsonTagInfo.cellID,
cellTemplateID: jsonTagInfo.cellTemplateID, cellTemplateID: jsonTagInfo.cellTemplateID,
...@@ -2811,7 +2832,7 @@ ...@@ -2811,7 +2832,7 @@
} }
} }
} }
}else{ } else {
SweetAlert.warning("文件未载入!"); SweetAlert.warning("文件未载入!");
} }
}; };
...@@ -2846,8 +2867,8 @@ ...@@ -2846,8 +2867,8 @@
return $q.reject(); return $q.reject();
}; };
$scope.cleanManual = function(){ $scope.cleanManual = function () {
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1}); $scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount: 1});
$('#ss').html(''); $('#ss').html('');
$scope.hasManualLoad = false; $scope.hasManualLoad = false;
$scope.file = null; $scope.file = null;
......
<div class='vat-report-view'> <div class='vat-report-view'>
<!--Report SpreadJS--> <!--Report SpreadJS-->
<div ng-if="!isDocumentList" class="row"> <div ng-if="!isDocumentList" class="row">
<span ng-if="!isBSPL" ng-click="openExportPop();"><i class="fa fa-download"></i>&nbsp;{{'ExportExcel' | translate}}</span> <span ng-if="!isBSPL" ng-click="openExportPop('export');"><i class="fa fa-download"></i>&nbsp;{{'ExportExcel' | translate}}</span>
<span ng-if="!isBSPL" ng-click="commitApprove();"><i <span ng-if="!isBSPL" ng-click="commitApprove();"><i
class="fa fa-floppy-o"></i>&nbsp;{{'报表提审'}}</span> class="fa fa-floppy-o"></i>&nbsp;{{'报表提审'}}</span>
<span ng-if="!isBSPL" ng-click="doApprove();"><i <span ng-if="!isBSPL" ng-click="doApprove();"><i
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<span ng-if="!isBSPL" ng-click="upLoadManual();"><i <span ng-if="!isBSPL" ng-click="upLoadManual();"><i
class="fa fa-floppy-o"></i>&nbsp;{{'上传手工数据'}} class="fa fa-floppy-o"></i>&nbsp;{{'上传手工数据'}}
</span> </span>
<span ng-if="!isBSPL" ng-click="openExportPop('upload');"><i class="fa fa-upload"></i>&nbsp;{{'UploadExcel' | translate}}</span>
<!--<span ng-if="!isBSPL" ng-click="saveReportCache();"><i--> <!--<span ng-if="!isBSPL" ng-click="saveReportCache();"><i-->
<!--class="fa fa-floppy-o"></i>&nbsp;{{'Save' | translate}}</span>--> <!--class="fa fa-floppy-o"></i>&nbsp;{{'Save' | translate}}</span>-->
</div> </div>
...@@ -96,6 +97,10 @@ ...@@ -96,6 +97,10 @@
</script> </script>
</div> </div>
<!-- File Vouchers Upload Popup --> <!-- File Vouchers Upload Popup -->
<div class="modal fade" id="showVoucherUploadPortal" tabindex="-1" role="dialog" aria-labelledby="myModal" <div class="modal fade" id="showVoucherUploadPortal" tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false"> data-backdrop="static" data-keyboard="false">
......
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
var toggleGroup = function (group) { var toggleGroup = function (group) {
group.isExpand = !group.isExpand; group.isExpand = !group.isExpand;
}; };
$scope.uploadliShow = false;
(function initialize() { (function initialize() {
checkUserOrganizationPermissionList(); checkUserOrganizationPermissionList();
loadTemplateMenu(); loadTemplateMenu();
......
...@@ -13,16 +13,35 @@ ...@@ -13,16 +13,35 @@
<div class="divider"></div> <div class="divider"></div>
<div ng-show="group.isExpand" class="animate-show-hide"> <div ng-show="group.isExpand" class="animate-show-hide">
<div class="li tree" ng-repeat="menu in group.children"> <div class="li tree" ng-repeat="menu in group.children">
<a ui-sref-active="active" data-template-id="{{menu.id}}" ng-class="{'active':selectedTemplateId===menu.id}" <a ui-sref-active="active" data-template-id="{{menu.id}}"
ng-class="{'active':selectedTemplateId===menu.id}"
ui-sref=".reportView({ id: menu.reportId, templateid: menu.id, name:menu.name,templatecode:menu.code })" ui-sref=".reportView({ id: menu.reportId, templateid: menu.id, name:menu.name,templatecode:menu.code })"
ng-bind-html="::menu.name"></a> ng-bind-html="::menu.name"></a>
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
<ul class="nav nav-report">
<li>
<div class="group-section" ng-click="uploadliShow=!uploadliShow;">
<i class="fa toggle-group-icon" ng-class="'fa-chevron-down'"
aria-hidden="true"></i>
<label class="tree-toggle nav-header" translate="">历史版本</label>
</div>
<div class="divider"></div>
<div class="animate-show-hide" ng-show="uploadliShow">
<div class="li tree">
<a ng-class="'active'" ui-sref-active="active"
ui-sref=".reportUploadView()"
class="active">历史版本计算表</a>
</div>
</div>
</li>
</ul>
</perfect-scrollbar> </perfect-scrollbar>
</div> </div>
<div id="vat-report-content" style="overflow:hidden;height:100%" > <div id="vat-report-content" style="overflow:hidden;height:100%">
<div class="vat-report-content" ui-view></div> <div class="vat-report-content" ui-view></div>
</div> </div>
......
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