Commit aaebc8df authored by zhkwei's avatar zhkwei

1、CIT固资申报表相关,2、bug修改

parent a13a5497
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
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.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.enums.EnumServiceType; import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto; import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.CitAssetsListDto;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.PeriodJobDto; import pwc.taxtech.atms.dto.vatdto.PeriodJobDto;
import pwc.taxtech.atms.service.impl.CitReportServiceImpl; import pwc.taxtech.atms.service.impl.CitReportServiceImpl;
import pwc.taxtech.atms.vat.entity.PeriodJob; import pwc.taxtech.atms.vat.entity.PeriodJob;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl; import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
/** /**
* @author zhikai.z.wei * @author zhikai.z.wei
* @description CIT报表生成(数据处理) * @description CIT报表生成(数据处理)
...@@ -22,6 +31,8 @@ import java.util.Optional; ...@@ -22,6 +31,8 @@ import java.util.Optional;
@RestController @RestController
@RequestMapping(value = "api/v1/citReport") @RequestMapping(value = "api/v1/citReport")
public class CitReportController { public class CitReportController {
private static Logger logger = LoggerFactory.getLogger(CitReportController.class);
@Autowired @Autowired
ReportServiceImpl reportService; ReportServiceImpl reportService;
...@@ -37,6 +48,7 @@ public class CitReportController { ...@@ -37,6 +48,7 @@ public class CitReportController {
*/ */
@RequestMapping(value = "citTemplate/{projectId}/{serviceType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "citTemplate/{projectId}/{serviceType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getCitTemplate(@PathVariable String projectId, @PathVariable int serviceType) { public OperationResultDto<List<ReportDto>> getCitTemplate(@PathVariable String projectId, @PathVariable int serviceType) {
logger.info("获取CIT所有要生成的报表模板相关信息,参数");
return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType),0); return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType),0);
} }
...@@ -54,11 +66,24 @@ public class CitReportController { ...@@ -54,11 +66,24 @@ public class CitReportController {
return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator)); return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator));
} }
/**
* 获取当前卡片所拥有的模板
* @param projectId
* @param serviceType
* @param period
* @return
*/
@RequestMapping(value = "filterTemplate/{projectId}/{serviceType}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "filterTemplate/{projectId}/{serviceType}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getFilterTemplate(@PathVariable String projectId, @PathVariable int serviceType, @PathVariable Integer period) { public OperationResultDto<List<ReportDto>> getFilterTemplate(@PathVariable String projectId, @PathVariable int serviceType, @PathVariable Integer period) {
return citReportService.getFilterReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period); return citReportService.getFilterReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period);
} }
/**
* 获取当前卡片的线程任务
* @param projectId
* @param period
* @return
*/
@RequestMapping(value = "getPeriodJob/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getPeriodJob/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody @ResponseBody
public PeriodJobDto getPeriodJob(@PathVariable String projectId, @PathVariable Integer period) { public PeriodJobDto getPeriodJob(@PathVariable String projectId, @PathVariable Integer period) {
...@@ -70,4 +95,45 @@ public class CitReportController { ...@@ -70,4 +95,45 @@ public class CitReportController {
} }
} }
/**
* 获取固定资产及EAM Mapping的数据
* @param citAssetsListDto
* @return
*/
@RequestMapping(value = "/getAssetEamMappingsPage", method = RequestMethod.POST)
public @ResponseBody
ApiResultDto getAssetEamMappingsPage(@RequestBody CitAssetsListDto citAssetsListDto){
logger.info("获取固定资产及EAM Mapping的数据");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(citReportService.getAssetEamMappingPage(citAssetsListDto));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 日记账合并版导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportAEMData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportAEMData(@RequestBody CitAssetsListDto paras, HttpServletResponse response) {
int count = citReportService.exportAEMData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
}
} }
\ No newline at end of file
...@@ -60,6 +60,17 @@ public class CitAssetsListDto implements Serializable { ...@@ -60,6 +60,17 @@ public class CitAssetsListDto implements Serializable {
*/ */
private String assetNumber; private String assetNumber;
/**
* Database Column Remarks:
* 序列号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.serial_number
*
* @mbg.generated
*/
private String serialNumber;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 资产类别-页面 * 资产类别-页面
...@@ -426,6 +437,50 @@ public class CitAssetsListDto implements Serializable { ...@@ -426,6 +437,50 @@ public class CitAssetsListDto implements Serializable {
private PagingDto pageInfo; private PagingDto pageInfo;
/**
* EAM 资产里面的赔偿/变卖金额
*/
private BigDecimal compensationSaleAmount;
/**
* 处置损益
*/
private BigDecimal disposalProfitAndLoss;
/**
* 资产的税务净值
*/
private BigDecimal taxNetValue;
/**
* 处置的税收损益
*/
private BigDecimal disposalTaxBenefit;
public BigDecimal getDisposalProfitAndLoss() {
return disposalProfitAndLoss;
}
public void setDisposalProfitAndLoss(BigDecimal disposalProfitAndLoss) {
this.disposalProfitAndLoss = disposalProfitAndLoss;
}
public BigDecimal getTaxNetValue() {
return taxNetValue;
}
public void setTaxNetValue(BigDecimal taxNetValue) {
this.taxNetValue = taxNetValue;
}
public BigDecimal getDisposalTaxBenefit() {
return disposalTaxBenefit;
}
public void setDisposalTaxBenefit(BigDecimal disposalTaxBenefit) {
this.disposalTaxBenefit = disposalTaxBenefit;
}
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table assets_list * This field corresponds to the database table assets_list
...@@ -530,6 +585,14 @@ public class CitAssetsListDto implements Serializable { ...@@ -530,6 +585,14 @@ public class CitAssetsListDto implements Serializable {
this.assetNumber = assetNumber == null ? null : assetNumber.trim(); this.assetNumber = assetNumber == null ? null : assetNumber.trim();
} }
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.asset_group_name * This method returns the value of the database column assets_list.asset_group_name
...@@ -1322,56 +1385,13 @@ public class CitAssetsListDto implements Serializable { ...@@ -1322,56 +1385,13 @@ public class CitAssetsListDto implements Serializable {
this.pageInfo = pageInfo; this.pageInfo = pageInfo;
} }
/** public BigDecimal getCompensationSaleAmount() {
* This method was generated by MyBatis Generator. return compensationSaleAmount;
* This method corresponds to the database table assets_list }
*
* @mbg.generated public void setCompensationSaleAmount(BigDecimal compensationSaleAmount) {
*/ this.compensationSaleAmount = compensationSaleAmount;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period);
sb.append(", assetNumber=").append(assetNumber);
sb.append(", assetGroupName=").append(assetGroupName);
sb.append(", assetDetailGroupId=").append(assetDetailGroupId);
sb.append(", assetDescription=").append(assetDescription);
sb.append(", buyDate=").append(buyDate);
sb.append(", depreciationDate=").append(depreciationDate);
sb.append(", depreciationPeriod=").append(depreciationPeriod);
sb.append(", acquisitionValue=").append(acquisitionValue);
sb.append(", adjustmentValue=").append(adjustmentValue);
sb.append(", disposedDate=").append(disposedDate);
sb.append(", residualRate=").append(residualRate);
sb.append(", yearDepreciationAmount=").append(yearDepreciationAmount);
sb.append(", yearAdjustmentAmount=").append(yearAdjustmentAmount);
sb.append(", yearEndValue=").append(yearEndValue);
sb.append(", status=").append(status);
sb.append(", accountAcquisitionValue=").append(accountAcquisitionValue);
sb.append(", accountMonthDepreciationAmount=").append(accountMonthDepreciationAmount);
sb.append(", accountYearDepreciationAmount=").append(accountYearDepreciationAmount);
sb.append(", accountTotalDepreciationAmount=").append(accountTotalDepreciationAmount);
sb.append(", taxDepreciationPeriod=").append(taxDepreciationPeriod);
sb.append(", taxToLastYearDepreciationPeriod=").append(taxToLastYearDepreciationPeriod);
sb.append(", taxToCurrentYearDepreciationPeriod=").append(taxToCurrentYearDepreciationPeriod);
sb.append(", taxYearDepreciationPeriod=").append(taxYearDepreciationPeriod);
sb.append(", taxMonthDepreciationAmount=").append(taxMonthDepreciationAmount);
sb.append(", taxToCurrentYearDepreciationAmount=").append(taxToCurrentYearDepreciationAmount);
sb.append(", taxCurrentYearDepreciationAmount=").append(taxCurrentYearDepreciationAmount);
sb.append(", totalDifferenceAmount=").append(totalDifferenceAmount);
sb.append(", yearDifferenceAmount=").append(yearDifferenceAmount);
sb.append(", isRetain=").append(isRetain);
sb.append(", assetType=").append(assetType);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", taxAccountCompare=").append(taxAccountCompare);
sb.append(", taxGroupName=").append(taxGroupName);
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file
...@@ -180,6 +180,7 @@ public class AssetListServiceImpl extends BaseService { ...@@ -180,6 +180,7 @@ public class AssetListServiceImpl extends BaseService {
//定义返回变量 //定义返回变量
OperationResultDto<Object> importResult = new OperationResultDto<>(); OperationResultDto<Object> importResult = new OperationResultDto<>();
importResult.setResult(true); importResult.setResult(true);
StringBuilder errorMsgSb = new StringBuilder("第");
//通过输入流获取当前workbook //通过输入流获取当前workbook
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citAsset"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citAsset");
...@@ -202,7 +203,7 @@ public class AssetListServiceImpl extends BaseService { ...@@ -202,7 +203,7 @@ public class AssetListServiceImpl extends BaseService {
Integer period = CitCommonUtil.getPeriod(); Integer period = CitCommonUtil.getPeriod();
List<CitAssetsList> citAssetsLists = new ArrayList<>(); List<CitAssetsList> citAssetsLists = new ArrayList<>();
StringBuilder errorMsgSb = new StringBuilder("第");
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
CitAssetsList citAsset = new CitAssetsList(); CitAssetsList citAsset = new CitAssetsList();
...@@ -217,8 +218,8 @@ public class AssetListServiceImpl extends BaseService { ...@@ -217,8 +218,8 @@ public class AssetListServiceImpl extends BaseService {
//因模板固定,则按照写死的做法处理数据单元格数据 //因模板固定,则按照写死的做法处理数据单元格数据
citAsset = cellToCitAsset(rowData, citAsset, assetNameSet, citAssetGroupResults); citAsset = cellToCitAsset(rowData, citAsset, assetNameSet, citAssetGroupResults);
if(citAsset == null){ if(citAsset == null){
importResult.setResult(false);
errorMsgSb.append(rowNum+","); errorMsgSb.append(rowNum+",");
continue;
} }
if(!importResult.getResult()){ if(!importResult.getResult()){
importResult.setResultMsg("行数据为空或格式错误!"); importResult.setResultMsg("行数据为空或格式错误!");
...@@ -263,41 +264,49 @@ public class AssetListServiceImpl extends BaseService { ...@@ -263,41 +264,49 @@ public class AssetListServiceImpl extends BaseService {
//获取单元格数据,并set进入实体 //获取单元格数据,并set进入实体
//获取资产编号 //获取资产编号
Cell cell = rowData.getCell(1); Object value = CitCommonUtil.getValue(rowData.getCell(1));
Object value = CitCommonUtil.getValue(cell);
if (value == null) { if (value == null) {
return null; return null;
} }
citAsset.setAssetNumber(value.toString()); citAsset.setAssetNumber(value.toString());
citAsset.setSerialNumber(String.valueOf(CitCommonUtil.getValue(rowData.getCell(2))));
//获取资产描述 //获取资产描述
citAsset.setAssetDescription(CitCommonUtil.getValue(rowData.getCell(5)).toString()); citAsset.setAssetDescription(String.valueOf(CitCommonUtil.getValue(rowData.getCell(5))));
//获取资产类别 //获取资产类别
String assetName = CitCommonUtil.getValue(rowData.getCell(7)).toString(); value = CitCommonUtil.getValue(rowData.getCell(7));
if (value == null) {
return null;
}
String assetName = value.toString();
citAsset.setAssetGroupName(assetName); citAsset.setAssetGroupName(assetName);
//获取购入日期 //获取购入日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
citAsset.setBuyDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(15)).toString())); value = CitCommonUtil.getValue(rowData.getCell(15));
citAsset.setBuyDate(value==null?null:sdf.parse(value.toString()));
//获取开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化 //获取开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化
// citAsset.setDepreciationDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(15)).toString())); // citAsset.setDepreciationDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(15)).toString()));
//获取折旧期限,接下来计算需要用到,所以赋给一个对象 //获取折旧期限,接下来计算需要用到,所以赋给一个对象
Integer depreciationPeriod = Integer.valueOf(CitCommonUtil.getValue(rowData.getCell(30)).toString()); value = CitCommonUtil.getValue(rowData.getCell(30));
Integer depreciationPeriod = Integer.valueOf(value==null?"0":value.toString());
citAsset.setDepreciationPeriod(depreciationPeriod); citAsset.setDepreciationPeriod(depreciationPeriod);
//获取原值,接下来计算需要用到,所以赋给一个对象 //获取原值,接下来计算需要用到,所以赋给一个对象
BigDecimal acquisitionValue = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(16)).toString()); value = CitCommonUtil.getValue(rowData.getCell(16));
if (value == null) {
return null;
}
BigDecimal acquisitionValue = new BigDecimal(value.toString());
citAsset.setAcquisitionValue(acquisitionValue); citAsset.setAcquisitionValue(acquisitionValue);
//获取原值调整值0----列数待定,滴滴无调整值 //获取原值调整值0----列数待定,滴滴无调整值
// citAsset.setAdjustmentValue(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(32)).toString())); // citAsset.setAdjustmentValue(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(32)).toString()));
//获取报废日期 //获取报废日期
Cell cell1 = rowData.getCell(37); value = CitCommonUtil.getValue(rowData.getCell(37));
if (rowData.getCell(37) != null && CitCommonUtil.getValue(rowData.getCell(37)) != null) { citAsset.setDisposedDate(value==null?null:sdf.parse(value.toString()));
citAsset.setDisposedDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(37)).toString())); citAsset.setScrapType(String.valueOf(CitCommonUtil.getValue(rowData.getCell(38))));
}
//获取残值额,原为残值率现为残值额,接下来计算需要用到,所以赋给一个对象 //获取残值额,原为残值率现为残值额,接下来计算需要用到,所以赋给一个对象
BigDecimal residualRate = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(20)).toString()); BigDecimal residualRate = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(20)).toString());
citAsset.setResidualRate(residualRate); citAsset.setResidualRate(residualRate);
...@@ -316,7 +325,7 @@ public class AssetListServiceImpl extends BaseService { ...@@ -316,7 +325,7 @@ public class AssetListServiceImpl extends BaseService {
//获取财务累计折旧额,接下来计算需要用到,所以赋给一个对象 //获取财务累计折旧额,接下来计算需要用到,所以赋给一个对象
BigDecimal accountTotalDepreciationAmount = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(25)).toString()); BigDecimal accountTotalDepreciationAmount = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(25)).toString());
citAsset.setAccountTotalDepreciationAmount(accountTotalDepreciationAmount); citAsset.setAccountTotalDepreciationAmount(accountTotalDepreciationAmount);
//年终剩余价值, //年终剩余价值,原值-累计折旧
citAsset.setYearEndValue(acquisitionValue.subtract(accountTotalDepreciationAmount)); citAsset.setYearEndValue(acquisitionValue.subtract(accountTotalDepreciationAmount));
//过滤查询出的资产类别,若已对该资产类别进行过分类直接进行税务数据的计算 //过滤查询出的资产类别,若已对该资产类别进行过分类直接进行税务数据的计算
List<CitAssetGroupResult> groupResults = citAssetGroupResults.stream() List<CitAssetGroupResult> groupResults = citAssetGroupResults.stream()
......
...@@ -77,7 +77,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -77,7 +77,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
/** /**
* 日记账导出(第一种方式) * 日记账导出(第一种方式)--暂时不使用
* @param citJournalAdjustDto * @param citJournalAdjustDto
* @param os * @param os
* @return * @return
...@@ -103,7 +103,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -103,7 +103,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
/** /**
* 日记账导出(第二种方式) * 日记账导出(第二种方式)--正在使用
* @param citJournalAdjustDto * @param citJournalAdjustDto
* @param response * @param response
* @return * @return
......
...@@ -870,14 +870,14 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -870,14 +870,14 @@ public class CitImportExcelServiceImpl extends BaseService {
CitEAMAssetsDisposal citEAMAssetsDisposal = new CitEAMAssetsDisposal(); CitEAMAssetsDisposal citEAMAssetsDisposal = new CitEAMAssetsDisposal();
citEAMAssetsDisposal.setId(idService.nextId()); citEAMAssetsDisposal.setId(idService.nextId());
citEAMAssetsDisposal.setPeriod(Integer.valueOf(CitCommonUtil.getPeriod().toString())); citEAMAssetsDisposal.setPeriod(period);
citEAMAssetsDisposal.setCreatedBy(currentUserName); citEAMAssetsDisposal.setCreatedBy(currentUserName);
String[] split = CitCommonUtil.getValue(rowData.getCell(1)).toString().split("-"); String[] split = CitCommonUtil.getValue(rowData.getCell(1)).toString().split("-");
StringBuilder sb = new StringBuilder(split[0]); StringBuilder sb = new StringBuilder(split[0]);
if(new Integer(split[1]) + 1 < 10){ // if(new Integer(split[1]) + 1 < 10){
sb.append(0); // sb.append(0);
} // }
sb.append(split[1]); sb.append(split[1]);
citEAMAssetsDisposal.setOccurPeriod(new Integer(sb.toString())); citEAMAssetsDisposal.setOccurPeriod(new Integer(sb.toString()));
citEAMAssetsDisposal.setAssetLabelNumber(CitCommonUtil.getValue(rowData.getCell(6)).toString()); citEAMAssetsDisposal.setAssetLabelNumber(CitCommonUtil.getValue(rowData.getCell(6)).toString());
......
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.service.impl; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -12,21 +13,23 @@ import org.apache.poi.ss.usermodel.FormulaEvaluator; ...@@ -12,21 +13,23 @@ import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
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.util.DataUtil; import pwc.taxtech.atms.common.util.DataUtil;
import pwc.taxtech.atms.common.util.FileUploadUtil; import pwc.taxtech.atms.common.util.FileUploadUtil;
import pwc.taxtech.atms.common.util.JxlsUtils;
import pwc.taxtech.atms.common.util.MyAsserts; import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.*; import pwc.taxtech.atms.constant.enums.*;
import pwc.taxtech.atms.dao.*; import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dpo.CitAssetEamMappingDto;
import pwc.taxtech.atms.dpo.ReportDto; import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.export.ExportDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.vatdto.*; import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
...@@ -39,6 +42,7 @@ import pwc.taxtech.atms.vat.entity.*; ...@@ -39,6 +42,7 @@ import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.ReportGeneratorImpl; import pwc.taxtech.atms.vat.service.impl.ReportGeneratorImpl;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper; import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper;
import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -111,6 +115,8 @@ public class CitReportServiceImpl extends BaseService { ...@@ -111,6 +115,8 @@ public class CitReportServiceImpl extends BaseService {
private DataValidateLogMapper dataValidateLogMapper; private DataValidateLogMapper dataValidateLogMapper;
@Autowired @Autowired
private DataUtil dataUtil; private DataUtil dataUtil;
@Autowired
private CitAssetsListMapper assetsListMapper;
public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) { public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) {
OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>(); OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>();
...@@ -700,4 +706,75 @@ public class CitReportServiceImpl extends BaseService { ...@@ -700,4 +706,75 @@ public class CitReportServiceImpl extends BaseService {
result.setData(reportDtos); result.setData(reportDtos);
return result; return result;
} }
/**
* 获取固定资产及EAM Mapping的数据
*/
public PageInfo<CitAssetsListDto> getAssetEamMappingPage(CitAssetsListDto citAssetsListDto) throws Exception {
logger.debug("获取固定资产及EAM Mapping的数据");
Page page = PageHelper.startPage(citAssetsListDto.getPageInfo().getPageIndex(),citAssetsListDto.getPageInfo().getPageSize());
CitAssetsList citAssetsList = new CitAssetsList();
BeanUtils.copyProperties(citAssetsListDto,citAssetsList);
List<CitAssetEamMappingDto> citAssetsLists = assetsListMapper.getAssetEamMapping(citAssetsList);
List<CitAssetsListDto> citAssetsListDtos = new ArrayList<>();
citAssetsListDtos = assetToAssetEamMapping(citAssetsListDtos,citAssetsLists);
// for (CitAssetsList citAssetsListTemp:citAssetsLists){
// CitAssetsListDto temp = new CitAssetsListDto();
// BeanUtils.copyProperties(citAssetsListTemp,temp);
//
// //计算处置损益 处置/赔偿收入-账面净值(年终剩余价值)
// temp.setDisposalProfitAndLoss(temp.getCompensationSaleAmount().subtract(temp.getYearEndValue()));
// //计算资产的税务净值 taxNetValue 原值-累计税务折旧/摊销
// temp.setTaxNetValue(temp.getAcquisitionValue().subtract(temp.getTaxToCurrentYearDepreciationAmount()));
// //处置的税收损益 处置/赔偿收入-资产的税务净值
// temp.setDisposalTaxBenefit(temp.getCompensationSaleAmount().subtract(temp.getTaxNetValue()));
// citAssetsListDtos.add(temp);
// }
PageInfo<CitAssetsListDto> pageInfo =new PageInfo<>(citAssetsListDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citAssetsListDto.getPageInfo().getPageIndex());
return pageInfo;
}
/**
* 固资申报表导出(第二种方式)--正在使用
* @param citAssetsListDto
* @param response
* @return
*/
public int exportAEMData2(CitAssetsListDto citAssetsListDto, HttpServletResponse response){
CitAssetsList citAssetsList = new CitAssetsList();
BeanUtils.copyProperties(citAssetsListDto,citAssetsList);
List<CitAssetEamMappingDto> citAssetsLists = assetsListMapper.getAssetEamMapping(citAssetsList);
if(citAssetsLists.size()==0){
return 0;
}
List<CitAssetsListDto> citAssetsListDtos = new ArrayList<>();
assetToAssetEamMapping(citAssetsListDtos,citAssetsLists);
ExportDto exportDto = new ExportDto();
exportDto.setFileName("固资申报表");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/assetEamMapping.xlsx");
exportDto.setResponse(response);
exportDto.setList(citAssetsListDtos);
exportDto.setRelation(null);
JxlsUtils.export(exportDto);
return 1;
}
public List<CitAssetsListDto> assetToAssetEamMapping(List<CitAssetsListDto> citAssetsListDtos, List<CitAssetEamMappingDto> citAssetsLists){
for (CitAssetsList citAssetsListTemp:citAssetsLists){
CitAssetsListDto temp = new CitAssetsListDto();
BeanUtils.copyProperties(citAssetsListTemp,temp);
//计算处置损益 处置/赔偿收入-账面净值(年终剩余价值)
temp.setDisposalProfitAndLoss(temp.getCompensationSaleAmount().subtract(temp.getYearEndValue()));
//计算资产的税务净值 taxNetValue 原值-累计税务折旧/摊销
temp.setTaxNetValue(temp.getAcquisitionValue().subtract(temp.getTaxToCurrentYearDepreciationAmount()));
//处置的税收损益 处置/赔偿收入-资产的税务净值
temp.setDisposalTaxBenefit(temp.getCompensationSaleAmount().subtract(temp.getTaxNetValue()));
citAssetsListDtos.add(temp);
}
return citAssetsListDtos;
}
} }
...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dpo.CitAssetEamMappingDto;
import pwc.taxtech.atms.entity.CitAssetsList; import pwc.taxtech.atms.entity.CitAssetsList;
import pwc.taxtech.atms.entity.CitAssetsListExample; import pwc.taxtech.atms.entity.CitAssetsListExample;
...@@ -107,4 +108,12 @@ public interface CitAssetsListMapper extends MyMapper { ...@@ -107,4 +108,12 @@ public interface CitAssetsListMapper extends MyMapper {
int updateByPrimaryKey(CitAssetsList record); int updateByPrimaryKey(CitAssetsList record);
int insertBatch(List<CitAssetsList> citAssetsLists); int insertBatch(List<CitAssetsList> citAssetsLists);
/**
* fetch data by citAsset
*
* @param citAsset
* @return Result<XxxxDO>
*/
List<CitAssetEamMappingDto> getAssetEamMapping(CitAssetsList citAsset);
} }
\ No newline at end of file
package pwc.taxtech.atms.dpo;
import pwc.taxtech.atms.entity.CitAssetsList;
import java.math.BigDecimal;
/**
* @author zhikai.z.wei
*/
public class CitAssetEamMappingDto extends CitAssetsList {
/**
* EAM 资产里面的赔偿/变卖金额
*/
private BigDecimal compensationSaleAmount;
public BigDecimal getCompensationSaleAmount() {
return compensationSaleAmount;
}
public void setCompensationSaleAmount(BigDecimal compensationSaleAmount) {
this.compensationSaleAmount = compensationSaleAmount;
}
}
...@@ -54,6 +54,17 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -54,6 +54,17 @@ public class CitAssetsList extends BaseEntity implements Serializable {
*/ */
private String assetNumber; private String assetNumber;
/**
* Database Column Remarks:
* 序列号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.serial_number
*
* @mbg.generated
*/
private String serialNumber;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 资产类别-页面 * 资产类别-页面
...@@ -417,6 +428,17 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -417,6 +428,17 @@ public class CitAssetsList extends BaseEntity implements Serializable {
*/ */
private String taxGroupName; private String taxGroupName;
/**
* Database Column Remarks:
* 报废类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column assets_list.scrap_type
*
* @mbg.generated
*/
private String scrapType;
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table assets_list * This field corresponds to the database table assets_list
...@@ -521,6 +543,30 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -521,6 +543,30 @@ public class CitAssetsList extends BaseEntity implements Serializable {
this.assetNumber = assetNumber == null ? null : assetNumber.trim(); this.assetNumber = assetNumber == null ? null : assetNumber.trim();
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.serial_number
*
* @return the value of assets_list.serial_number
*
* @mbg.generated
*/
public String getSerialNumber() {
return serialNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.serial_number
*
* @param serialNumber the value for assets_list.serial_number
*
* @mbg.generated
*/
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber == null ? null : serialNumber.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.asset_group_name * This method returns the value of the database column assets_list.asset_group_name
...@@ -1313,6 +1359,30 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -1313,6 +1359,30 @@ public class CitAssetsList extends BaseEntity implements Serializable {
this.taxGroupName = taxGroupName == null ? null : taxGroupName.trim(); this.taxGroupName = taxGroupName == null ? null : taxGroupName.trim();
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column assets_list.scrap_type
*
* @return the value of assets_list.scrap_type
*
* @mbg.generated
*/
public String getScrapType() {
return scrapType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column assets_list.scrap_type
*
* @param scrapType the value for assets_list.scrap_type
*
* @mbg.generated
*/
public void setScrapType(String scrapType) {
this.scrapType = scrapType == null ? null : scrapType.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table assets_list * This method corresponds to the database table assets_list
...@@ -1329,6 +1399,7 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -1329,6 +1399,7 @@ public class CitAssetsList extends BaseEntity implements Serializable {
sb.append(", projectId=").append(projectId); sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period); sb.append(", period=").append(period);
sb.append(", assetNumber=").append(assetNumber); sb.append(", assetNumber=").append(assetNumber);
sb.append(", serialNumber=").append(serialNumber);
sb.append(", assetGroupName=").append(assetGroupName); sb.append(", assetGroupName=").append(assetGroupName);
sb.append(", assetDetailGroupId=").append(assetDetailGroupId); sb.append(", assetDetailGroupId=").append(assetDetailGroupId);
sb.append(", assetDescription=").append(assetDescription); sb.append(", assetDescription=").append(assetDescription);
...@@ -1362,6 +1433,7 @@ public class CitAssetsList extends BaseEntity implements Serializable { ...@@ -1362,6 +1433,7 @@ public class CitAssetsList extends BaseEntity implements Serializable {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", taxAccountCompare=").append(taxAccountCompare); sb.append(", taxAccountCompare=").append(taxAccountCompare);
sb.append(", taxGroupName=").append(taxGroupName); sb.append(", taxGroupName=").append(taxGroupName);
sb.append(", scrapType=").append(scrapType);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
......
...@@ -456,6 +456,76 @@ public class CitAssetsListExample { ...@@ -456,6 +456,76 @@ public class CitAssetsListExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSerialNumberIsNull() {
addCriterion("serial_number is null");
return (Criteria) this;
}
public Criteria andSerialNumberIsNotNull() {
addCriterion("serial_number is not null");
return (Criteria) this;
}
public Criteria andSerialNumberEqualTo(String value) {
addCriterion("serial_number =", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberNotEqualTo(String value) {
addCriterion("serial_number <>", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberGreaterThan(String value) {
addCriterion("serial_number >", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberGreaterThanOrEqualTo(String value) {
addCriterion("serial_number >=", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberLessThan(String value) {
addCriterion("serial_number <", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberLessThanOrEqualTo(String value) {
addCriterion("serial_number <=", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberLike(String value) {
addCriterion("serial_number like", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberNotLike(String value) {
addCriterion("serial_number not like", value, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberIn(List<String> values) {
addCriterion("serial_number in", values, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberNotIn(List<String> values) {
addCriterion("serial_number not in", values, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberBetween(String value1, String value2) {
addCriterion("serial_number between", value1, value2, "serialNumber");
return (Criteria) this;
}
public Criteria andSerialNumberNotBetween(String value1, String value2) {
addCriterion("serial_number not between", value1, value2, "serialNumber");
return (Criteria) this;
}
public Criteria andAssetGroupNameIsNull() { public Criteria andAssetGroupNameIsNull() {
addCriterion("asset_group_name is null"); addCriterion("asset_group_name is null");
return (Criteria) this; return (Criteria) this;
...@@ -2465,6 +2535,76 @@ public class CitAssetsListExample { ...@@ -2465,6 +2535,76 @@ public class CitAssetsListExample {
addCriterion("tax_group_name not between", value1, value2, "taxGroupName"); addCriterion("tax_group_name not between", value1, value2, "taxGroupName");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andScrapTypeIsNull() {
addCriterion("scrap_type is null");
return (Criteria) this;
}
public Criteria andScrapTypeIsNotNull() {
addCriterion("scrap_type is not null");
return (Criteria) this;
}
public Criteria andScrapTypeEqualTo(String value) {
addCriterion("scrap_type =", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeNotEqualTo(String value) {
addCriterion("scrap_type <>", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeGreaterThan(String value) {
addCriterion("scrap_type >", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeGreaterThanOrEqualTo(String value) {
addCriterion("scrap_type >=", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeLessThan(String value) {
addCriterion("scrap_type <", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeLessThanOrEqualTo(String value) {
addCriterion("scrap_type <=", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeLike(String value) {
addCriterion("scrap_type like", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeNotLike(String value) {
addCriterion("scrap_type not like", value, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeIn(List<String> values) {
addCriterion("scrap_type in", values, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeNotIn(List<String> values) {
addCriterion("scrap_type not in", values, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeBetween(String value1, String value2) {
addCriterion("scrap_type between", value1, value2, "scrapType");
return (Criteria) this;
}
public Criteria andScrapTypeNotBetween(String value1, String value2) {
addCriterion("scrap_type not between", value1, value2, "scrapType");
return (Criteria) this;
}
} }
/** /**
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="project_id" jdbcType="VARCHAR" property="projectId" /> <result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="period" jdbcType="INTEGER" property="period" /> <result column="period" jdbcType="INTEGER" property="period" />
<result column="asset_number" jdbcType="VARCHAR" property="assetNumber" /> <result column="asset_number" jdbcType="VARCHAR" property="assetNumber" />
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
<result column="asset_group_name" jdbcType="VARCHAR" property="assetGroupName" /> <result column="asset_group_name" jdbcType="VARCHAR" property="assetGroupName" />
<result column="asset_detail_group_id" jdbcType="BIGINT" property="assetDetailGroupId" /> <result column="asset_detail_group_id" jdbcType="BIGINT" property="assetDetailGroupId" />
<result column="asset_description" jdbcType="VARCHAR" property="assetDescription" /> <result column="asset_description" jdbcType="VARCHAR" property="assetDescription" />
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="tax_account_compare" jdbcType="INTEGER" property="taxAccountCompare" /> <result column="tax_account_compare" jdbcType="INTEGER" property="taxAccountCompare" />
<result column="tax_group_name" jdbcType="VARCHAR" property="taxGroupName" /> <result column="tax_group_name" jdbcType="VARCHAR" property="taxGroupName" />
<result column="scrap_type" jdbcType="VARCHAR" property="scrapType" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -115,15 +117,15 @@ ...@@ -115,15 +117,15 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, project_id, period, asset_number, asset_group_name, asset_detail_group_id, asset_description, id, project_id, period, asset_number, serial_number, asset_group_name, asset_detail_group_id,
buy_date, depreciation_date, depreciation_period, acquisition_value, adjustment_value, asset_description, buy_date, depreciation_date, depreciation_period, acquisition_value,
disposed_date, residual_rate, year_depreciation_amount, year_adjustment_amount, year_end_value, adjustment_value, disposed_date, residual_rate, year_depreciation_amount, year_adjustment_amount,
status, account_acquisition_value, account_month_depreciation_amount, account_year_depreciation_amount, year_end_value, status, account_acquisition_value, account_month_depreciation_amount,
account_total_depreciation_amount, tax_depreciation_period, tax_to_last_year_depreciation_period, account_year_depreciation_amount, account_total_depreciation_amount, tax_depreciation_period,
tax_to_current_year_depreciation_period, tax_year_depreciation_period, tax_month_depreciation_amount, tax_to_last_year_depreciation_period, tax_to_current_year_depreciation_period, tax_year_depreciation_period,
tax_to_current_year_depreciation_amount, tax_current_year_depreciation_amount, total_difference_amount, tax_month_depreciation_amount, tax_to_current_year_depreciation_amount, tax_current_year_depreciation_amount,
year_difference_amount, is_retain, asset_type, create_time, update_time, tax_account_compare, total_difference_amount, year_difference_amount, is_retain, asset_type, create_time,
tax_group_name update_time, tax_account_compare, tax_group_name, scrap_type
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -177,35 +179,37 @@ ...@@ -177,35 +179,37 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into assets_list (id, project_id, period, insert into assets_list (id, project_id, period,
asset_number, asset_group_name, asset_detail_group_id, asset_number, serial_number, asset_group_name,
asset_description, buy_date, depreciation_date, asset_detail_group_id, asset_description, buy_date,
depreciation_period, acquisition_value, adjustment_value, depreciation_date, depreciation_period,
disposed_date, residual_rate, year_depreciation_amount, acquisition_value, adjustment_value, disposed_date,
year_adjustment_amount, year_end_value, status, residual_rate, year_depreciation_amount, year_adjustment_amount,
account_acquisition_value, account_month_depreciation_amount, year_end_value, status, account_acquisition_value,
account_year_depreciation_amount, account_total_depreciation_amount, account_month_depreciation_amount, account_year_depreciation_amount,
tax_depreciation_period, tax_to_last_year_depreciation_period, account_total_depreciation_amount, tax_depreciation_period,
tax_to_current_year_depreciation_period, tax_year_depreciation_period, tax_to_last_year_depreciation_period, tax_to_current_year_depreciation_period,
tax_month_depreciation_amount, tax_to_current_year_depreciation_amount, tax_year_depreciation_period, tax_month_depreciation_amount,
tax_current_year_depreciation_amount, total_difference_amount, tax_to_current_year_depreciation_amount, tax_current_year_depreciation_amount,
year_difference_amount, is_retain, asset_type, total_difference_amount, year_difference_amount,
create_time, update_time, tax_account_compare, is_retain, asset_type, create_time,
tax_group_name) update_time, tax_account_compare, tax_group_name,
scrap_type)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{assetNumber,jdbcType=VARCHAR}, #{assetGroupName,jdbcType=VARCHAR}, #{assetDetailGroupId,jdbcType=BIGINT}, #{assetNumber,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, #{assetGroupName,jdbcType=VARCHAR},
#{assetDescription,jdbcType=VARCHAR}, #{buyDate,jdbcType=TIMESTAMP}, #{depreciationDate,jdbcType=TIMESTAMP}, #{assetDetailGroupId,jdbcType=BIGINT}, #{assetDescription,jdbcType=VARCHAR}, #{buyDate,jdbcType=TIMESTAMP},
#{depreciationPeriod,jdbcType=INTEGER}, #{acquisitionValue,jdbcType=DECIMAL}, #{adjustmentValue,jdbcType=DECIMAL}, #{depreciationDate,jdbcType=TIMESTAMP}, #{depreciationPeriod,jdbcType=INTEGER},
#{disposedDate,jdbcType=TIMESTAMP}, #{residualRate,jdbcType=DECIMAL}, #{yearDepreciationAmount,jdbcType=DECIMAL}, #{acquisitionValue,jdbcType=DECIMAL}, #{adjustmentValue,jdbcType=DECIMAL}, #{disposedDate,jdbcType=TIMESTAMP},
#{yearAdjustmentAmount,jdbcType=DECIMAL}, #{yearEndValue,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, #{residualRate,jdbcType=DECIMAL}, #{yearDepreciationAmount,jdbcType=DECIMAL}, #{yearAdjustmentAmount,jdbcType=DECIMAL},
#{accountAcquisitionValue,jdbcType=DECIMAL}, #{accountMonthDepreciationAmount,jdbcType=DECIMAL}, #{yearEndValue,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, #{accountAcquisitionValue,jdbcType=DECIMAL},
#{accountYearDepreciationAmount,jdbcType=DECIMAL}, #{accountTotalDepreciationAmount,jdbcType=DECIMAL}, #{accountMonthDepreciationAmount,jdbcType=DECIMAL}, #{accountYearDepreciationAmount,jdbcType=DECIMAL},
#{taxDepreciationPeriod,jdbcType=INTEGER}, #{taxToLastYearDepreciationPeriod,jdbcType=INTEGER}, #{accountTotalDepreciationAmount,jdbcType=DECIMAL}, #{taxDepreciationPeriod,jdbcType=INTEGER},
#{taxToCurrentYearDepreciationPeriod,jdbcType=INTEGER}, #{taxYearDepreciationPeriod,jdbcType=INTEGER}, #{taxToLastYearDepreciationPeriod,jdbcType=INTEGER}, #{taxToCurrentYearDepreciationPeriod,jdbcType=INTEGER},
#{taxMonthDepreciationAmount,jdbcType=DECIMAL}, #{taxToCurrentYearDepreciationAmount,jdbcType=DECIMAL}, #{taxYearDepreciationPeriod,jdbcType=INTEGER}, #{taxMonthDepreciationAmount,jdbcType=DECIMAL},
#{taxCurrentYearDepreciationAmount,jdbcType=DECIMAL}, #{totalDifferenceAmount,jdbcType=DECIMAL}, #{taxToCurrentYearDepreciationAmount,jdbcType=DECIMAL}, #{taxCurrentYearDepreciationAmount,jdbcType=DECIMAL},
#{yearDifferenceAmount,jdbcType=DECIMAL}, #{isRetain,jdbcType=INTEGER}, #{assetType,jdbcType=INTEGER}, #{totalDifferenceAmount,jdbcType=DECIMAL}, #{yearDifferenceAmount,jdbcType=DECIMAL},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{taxAccountCompare,jdbcType=INTEGER}, #{isRetain,jdbcType=INTEGER}, #{assetType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{taxGroupName,jdbcType=VARCHAR}) #{updateTime,jdbcType=TIMESTAMP}, #{taxAccountCompare,jdbcType=INTEGER}, #{taxGroupName,jdbcType=VARCHAR},
#{scrapType,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitAssetsList"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitAssetsList">
<!-- <!--
...@@ -226,6 +230,9 @@ ...@@ -226,6 +230,9 @@
<if test="assetNumber != null"> <if test="assetNumber != null">
asset_number, asset_number,
</if> </if>
<if test="serialNumber != null">
serial_number,
</if>
<if test="assetGroupName != null"> <if test="assetGroupName != null">
asset_group_name, asset_group_name,
</if> </if>
...@@ -325,6 +332,9 @@ ...@@ -325,6 +332,9 @@
<if test="taxGroupName != null"> <if test="taxGroupName != null">
tax_group_name, tax_group_name,
</if> </if>
<if test="scrapType != null">
scrap_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -339,6 +349,9 @@ ...@@ -339,6 +349,9 @@
<if test="assetNumber != null"> <if test="assetNumber != null">
#{assetNumber,jdbcType=VARCHAR}, #{assetNumber,jdbcType=VARCHAR},
</if> </if>
<if test="serialNumber != null">
#{serialNumber,jdbcType=VARCHAR},
</if>
<if test="assetGroupName != null"> <if test="assetGroupName != null">
#{assetGroupName,jdbcType=VARCHAR}, #{assetGroupName,jdbcType=VARCHAR},
</if> </if>
...@@ -438,6 +451,9 @@ ...@@ -438,6 +451,9 @@
<if test="taxGroupName != null"> <if test="taxGroupName != null">
#{taxGroupName,jdbcType=VARCHAR}, #{taxGroupName,jdbcType=VARCHAR},
</if> </if>
<if test="scrapType != null">
#{scrapType,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultType="java.lang.Long">
...@@ -469,6 +485,9 @@ ...@@ -469,6 +485,9 @@
<if test="record.assetNumber != null"> <if test="record.assetNumber != null">
asset_number = #{record.assetNumber,jdbcType=VARCHAR}, asset_number = #{record.assetNumber,jdbcType=VARCHAR},
</if> </if>
<if test="record.serialNumber != null">
serial_number = #{record.serialNumber,jdbcType=VARCHAR},
</if>
<if test="record.assetGroupName != null"> <if test="record.assetGroupName != null">
asset_group_name = #{record.assetGroupName,jdbcType=VARCHAR}, asset_group_name = #{record.assetGroupName,jdbcType=VARCHAR},
</if> </if>
...@@ -568,6 +587,9 @@ ...@@ -568,6 +587,9 @@
<if test="record.taxGroupName != null"> <if test="record.taxGroupName != null">
tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR}, tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR},
</if> </if>
<if test="record.scrapType != null">
scrap_type = #{record.scrapType,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -583,6 +605,7 @@ ...@@ -583,6 +605,7 @@
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER}, period = #{record.period,jdbcType=INTEGER},
asset_number = #{record.assetNumber,jdbcType=VARCHAR}, asset_number = #{record.assetNumber,jdbcType=VARCHAR},
serial_number = #{record.serialNumber,jdbcType=VARCHAR},
asset_group_name = #{record.assetGroupName,jdbcType=VARCHAR}, asset_group_name = #{record.assetGroupName,jdbcType=VARCHAR},
asset_detail_group_id = #{record.assetDetailGroupId,jdbcType=BIGINT}, asset_detail_group_id = #{record.assetDetailGroupId,jdbcType=BIGINT},
asset_description = #{record.assetDescription,jdbcType=VARCHAR}, asset_description = #{record.assetDescription,jdbcType=VARCHAR},
...@@ -615,7 +638,8 @@ ...@@ -615,7 +638,8 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
tax_account_compare = #{record.taxAccountCompare,jdbcType=INTEGER}, tax_account_compare = #{record.taxAccountCompare,jdbcType=INTEGER},
tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR} tax_group_name = #{record.taxGroupName,jdbcType=VARCHAR},
scrap_type = #{record.scrapType,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -636,6 +660,9 @@ ...@@ -636,6 +660,9 @@
<if test="assetNumber != null"> <if test="assetNumber != null">
asset_number = #{assetNumber,jdbcType=VARCHAR}, asset_number = #{assetNumber,jdbcType=VARCHAR},
</if> </if>
<if test="serialNumber != null">
serial_number = #{serialNumber,jdbcType=VARCHAR},
</if>
<if test="assetGroupName != null"> <if test="assetGroupName != null">
asset_group_name = #{assetGroupName,jdbcType=VARCHAR}, asset_group_name = #{assetGroupName,jdbcType=VARCHAR},
</if> </if>
...@@ -735,6 +762,9 @@ ...@@ -735,6 +762,9 @@
<if test="taxGroupName != null"> <if test="taxGroupName != null">
tax_group_name = #{taxGroupName,jdbcType=VARCHAR}, tax_group_name = #{taxGroupName,jdbcType=VARCHAR},
</if> </if>
<if test="scrapType != null">
scrap_type = #{scrapType,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -747,6 +777,7 @@ ...@@ -747,6 +777,7 @@
set project_id = #{projectId,jdbcType=VARCHAR}, set project_id = #{projectId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER}, period = #{period,jdbcType=INTEGER},
asset_number = #{assetNumber,jdbcType=VARCHAR}, asset_number = #{assetNumber,jdbcType=VARCHAR},
serial_number = #{serialNumber,jdbcType=VARCHAR},
asset_group_name = #{assetGroupName,jdbcType=VARCHAR}, asset_group_name = #{assetGroupName,jdbcType=VARCHAR},
asset_detail_group_id = #{assetDetailGroupId,jdbcType=BIGINT}, asset_detail_group_id = #{assetDetailGroupId,jdbcType=BIGINT},
asset_description = #{assetDescription,jdbcType=VARCHAR}, asset_description = #{assetDescription,jdbcType=VARCHAR},
...@@ -779,7 +810,8 @@ ...@@ -779,7 +810,8 @@
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
tax_account_compare = #{taxAccountCompare,jdbcType=INTEGER}, tax_account_compare = #{taxAccountCompare,jdbcType=INTEGER},
tax_group_name = #{taxGroupName,jdbcType=VARCHAR} tax_group_name = #{taxGroupName,jdbcType=VARCHAR},
scrap_type = #{scrapType,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap"> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.CitAssetsListExample" resultMap="BaseResultMap">
......
...@@ -2,6 +2,52 @@ ...@@ -2,6 +2,52 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitAssetsListMapper"> <mapper namespace="pwc.taxtech.atms.dao.CitAssetsListMapper">
<resultMap id="assetEamMap" type="pwc.taxtech.atms.dpo.CitAssetEamMappingDto">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="asset_number" jdbcType="VARCHAR" property="assetNumber" />
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
<result column="asset_group_name" jdbcType="VARCHAR" property="assetGroupName" />
<result column="asset_detail_group_id" jdbcType="BIGINT" property="assetDetailGroupId" />
<result column="asset_description" jdbcType="VARCHAR" property="assetDescription" />
<result column="buy_date" jdbcType="TIMESTAMP" property="buyDate" />
<result column="depreciation_date" jdbcType="TIMESTAMP" property="depreciationDate" />
<result column="depreciation_period" jdbcType="INTEGER" property="depreciationPeriod" />
<result column="acquisition_value" jdbcType="DECIMAL" property="acquisitionValue" />
<result column="adjustment_value" jdbcType="DECIMAL" property="adjustmentValue" />
<result column="disposed_date" jdbcType="TIMESTAMP" property="disposedDate" />
<result column="residual_rate" jdbcType="DECIMAL" property="residualRate" />
<result column="year_depreciation_amount" jdbcType="DECIMAL" property="yearDepreciationAmount" />
<result column="year_adjustment_amount" jdbcType="DECIMAL" property="yearAdjustmentAmount" />
<result column="year_end_value" jdbcType="DECIMAL" property="yearEndValue" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="account_acquisition_value" jdbcType="DECIMAL" property="accountAcquisitionValue" />
<result column="account_month_depreciation_amount" jdbcType="DECIMAL" property="accountMonthDepreciationAmount" />
<result column="account_year_depreciation_amount" jdbcType="DECIMAL" property="accountYearDepreciationAmount" />
<result column="account_total_depreciation_amount" jdbcType="DECIMAL" property="accountTotalDepreciationAmount" />
<result column="tax_depreciation_period" jdbcType="INTEGER" property="taxDepreciationPeriod" />
<result column="tax_to_last_year_depreciation_period" jdbcType="INTEGER" property="taxToLastYearDepreciationPeriod" />
<result column="tax_to_current_year_depreciation_period" jdbcType="INTEGER" property="taxToCurrentYearDepreciationPeriod" />
<result column="tax_year_depreciation_period" jdbcType="INTEGER" property="taxYearDepreciationPeriod" />
<result column="tax_month_depreciation_amount" jdbcType="DECIMAL" property="taxMonthDepreciationAmount" />
<result column="tax_to_current_year_depreciation_amount" jdbcType="DECIMAL" property="taxToCurrentYearDepreciationAmount" />
<result column="tax_current_year_depreciation_amount" jdbcType="DECIMAL" property="taxCurrentYearDepreciationAmount" />
<result column="total_difference_amount" jdbcType="DECIMAL" property="totalDifferenceAmount" />
<result column="year_difference_amount" jdbcType="DECIMAL" property="yearDifferenceAmount" />
<result column="is_retain" jdbcType="INTEGER" property="isRetain" />
<result column="asset_type" jdbcType="INTEGER" property="assetType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="tax_account_compare" jdbcType="INTEGER" property="taxAccountCompare" />
<result column="tax_group_name" jdbcType="VARCHAR" property="taxGroupName" />
<result column="compensation_sale_amount" jdbcType="VARCHAR" property="compensationSaleAmount" />
</resultMap>
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
insert into assets_list insert into assets_list
(<include refid="Base_Column_List"/>) (<include refid="Base_Column_List"/>)
...@@ -24,6 +70,10 @@ ...@@ -24,6 +70,10 @@
<when test="item.assetNumber != null">#{item.assetNumber,jdbcType=VARCHAR},</when> <when test="item.assetNumber != null">#{item.assetNumber,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose>
<when test="item.serialNumber != null">#{item.serialNumber,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose> <choose>
<when test="item.assetGroupName != null">#{item.assetGroupName,jdbcType=VARCHAR},</when> <when test="item.assetGroupName != null">#{item.assetGroupName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
...@@ -156,9 +206,19 @@ ...@@ -156,9 +206,19 @@
<when test="item.taxGroupName != null">#{item.taxGroupName,jdbcType=VARCHAR},</when> <when test="item.taxGroupName != null">#{item.taxGroupName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose>
<when test="item.scrapType != null">#{item.scrapType,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
</trim> </trim>
</foreach>; </foreach>;
SELECT 1 FROM DUAL; SELECT 1 FROM DUAL;
</insert> </insert>
<select id="getAssetEamMapping" parameterType="map" resultMap="assetEamMap">
select
assets_list.* , cit_eam_assets_disposal.compensation_sale_amount
from assets_list join cit_eam_assets_disposal on serial_number = asset_label_number where scrap_type='完全报废'
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -993,6 +993,23 @@ init-row="initRow" init-col="initCol" service-type="\'6\'" is-document-list="tru ...@@ -993,6 +993,23 @@ init-row="initRow" init-col="initCol" service-type="\'6\'" is-document-list="tru
sticky: true sticky: true
}); });
$stateProvider.state({
name: 'cit.reductionData.assetEamMapping',
url: '/assetEamMapping',
views: {
'@cit.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]);
}],
template: '<cit-asset-eam-mapping></cit-asset-eam-mapping>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({ $stateProvider.state({
name: 'cit.reductionData.inputInvoice', name: 'cit.reductionData.inputInvoice',
url: '/inputInvoice', url: '/inputInvoice',
......
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
"ManufacturingIndustry": "Manufacturing Industry", "ManufacturingIndustry": "Manufacturing Industry",
"MappingInvoice": "Association management", "MappingInvoice": "Association management",
"MenuAMVAT": "Asset Management VAT Return", "MenuAMVAT": "Asset Management VAT Return",
"MenuCIT": "Corporate Income Tax Return", "MenuCIT": "CIT Return",
"MenuCashFlow": "Tax Cash Flow", "MenuCashFlow": "Tax Cash Flow",
"MenuIndexAnalytics": "Tax Indicator Analysis", "MenuIndexAnalytics": "Tax Indicator Analysis",
"MenuInvoiceManagement": "Invoice Management", "MenuInvoiceManagement": "Invoice Management",
......
...@@ -1132,5 +1132,9 @@ ...@@ -1132,5 +1132,9 @@
"BeginningBalance": "Beginning Balance", "BeginningBalance": "Beginning Balance",
"EndingBalance": "Ending Balance", "EndingBalance": "Ending Balance",
"Attribute": "Attribute", "Attribute": "Attribute",
"MainBodyCode": "Main Body Code" "MainBodyCode": "Main Body Code",
"AssetEamMapping": "Asset Eam Mapping",
"DisposalProfitAndLoss": "Disposal Profit And Loss",
"TaxNetValue": "Tax Net Value",
"DisposalTaxBenefit": "Disposal Tax Benefit"
} }
\ No newline at end of file
...@@ -1184,5 +1184,14 @@ ...@@ -1184,5 +1184,14 @@
"QMYETotalend" : "期末余额合计(贷-借)", "QMYETotalend" : "期末余额合计(贷-借)",
"Backfill any adjusted total value back to the adjusted amount" : "单选任意合计值回填至调整后金额", "Backfill any adjusted total value back to the adjusted amount" : "单选任意合计值回填至调整后金额",
"BackAdjustAmount" : "调整后金额" "BackAdjustAmount" : "调整后金额"
"gatheringCompanyAccount":"收款公司账号",
"AssetEamMapping": "CIT.WP01901_固定资产",
"DisposalProfitAndLoss": "处置损益",
"TaxNetValue": "资产的税务净值",
"DisposalTaxBenefit": "处置的税收损益"
} }
\ No newline at end of file
...@@ -312,7 +312,17 @@ function ($scope, $rootScope, $location, $q, $log, $timeout, $state, $translate, ...@@ -312,7 +312,17 @@ function ($scope, $rootScope, $location, $q, $log, $timeout, $state, $translate,
name: 'reductionData.accountMapping', state: 'reductionData.accountMapping', num: 3, name: 'reductionData.accountMapping', state: 'reductionData.accountMapping', num: 3,
permission: constant.citPermission.dataManage.accountMappingCode, url: '#/cit/reductionData/accountMapping' permission: constant.citPermission.dataManage.accountMappingCode, url: '#/cit/reductionData/accountMapping'
}); });
} }
else if (data[constant.citPermission.dataManage.assetEamMapping]) {
$scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3,
permission: constant.citPermission.dataManage.dataManageCode, url: '#/cit/reductionData'
});
subMenus.push({
name: 'reductionData.assetEamMapping', state: 'reductionData.assetEamMapping', num: 3,
permission: constant.citPermission.dataManage.assetEamMapping, url: '#/cit/reductionData/assetEamMapping'
});
}
if (data[constant.citPermission.reportView.bsplCode] if (data[constant.citPermission.reportView.bsplCode]
|| data[constant.citPermission.reportView.quarterlyFilingReturnTypeCode] || data[constant.citPermission.reportView.quarterlyFilingReturnTypeCode]
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}, withCredentials: true }, withCredentials: true
}).then(function(resp){ }).success(function(resp){
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) { assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
$scope.assetGroupResultDataSource = groupResultData.data; $scope.assetGroupResultDataSource = groupResultData.data;
...@@ -248,6 +248,8 @@ ...@@ -248,6 +248,8 @@
scope: $scope, scope: $scope,
windowClass: "set-asset-list-modal" windowClass: "set-asset-list-modal"
}); });
}).error(function(resp){
SweetAlert.error("文件导入出现错误,请重试");
}); });
}; };
...@@ -877,11 +879,16 @@ ...@@ -877,11 +879,16 @@
{ {
assetListService.saveAssetGroupInfo($scope.assetGroupResultDataSource, $scope.saveGroupType, projectId).success(function (data) { assetListService.saveAssetGroupInfo($scope.assetGroupResultDataSource, $scope.saveGroupType, projectId).success(function (data) {
if (data) { if (data.data) {
SweetAlert.success($translate.instant('SaveSuccess')); SweetAlert.success($translate.instant('SaveSuccess'));
if ($scope.modalInstance) { if ($scope.modalInstance) {
$scope.modalInstance.close(); $scope.modalInstance.close();
} }
}else {
SweetAlert.error("设置二级分类失败,请联系系统管理员");
if ($scope.modalInstance) {
$scope.modalInstance.close();
}
} }
}).error(function () { }).error(function () {
SweetAlert.error(serviceErrorMsg); SweetAlert.error(serviceErrorMsg);
......
...@@ -72,6 +72,7 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi ...@@ -72,6 +72,7 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi
else if ($location && $location.absUrl().indexOf('reductionData') > -1) { else if ($location && $location.absUrl().indexOf('reductionData') > -1) {
$scope.nodeDicKey = constant.DictionaryDictKey.DataProcess; $scope.nodeDicKey = constant.DictionaryDictKey.DataProcess;
$scope.linkShort = enums.linkShort.ReductionData; $scope.linkShort = enums.linkShort.ReductionData;
debugger;
$scope.menus = [ $scope.menus = [
{ {
name: 'caculateData', permission: constant.citPermission.dataManage.caculateDataCode, name: 'caculateData', permission: constant.citPermission.dataManage.caculateDataCode,
...@@ -80,7 +81,11 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi ...@@ -80,7 +81,11 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi
{ {
name: 'accountMapping', permission: constant.citPermission.dataManage.accountMappingCode, name: 'accountMapping', permission: constant.citPermission.dataManage.accountMappingCode,
text: $translate.instant('accountMapping'), icon: 'fa fa-map' text: $translate.instant('accountMapping'), icon: 'fa fa-map'
}, },
{
name: 'assetEamMapping', permission: constant.citPermission.dataManage.assetEamMapping,
text: $translate.instant('AssetEamMapping'), icon: 'fa fa-map'
},
]; ];
} }
else { else {
......
vatModule.controller('citAssetEamMappingController', ['$rootScope','$scope', '$log', '$filter','$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'citPreviewService', 'citReportService','browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope, $log,$filter, $translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, citPreviewService, citReportService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
$scope.endDate = new Date(vatSessionService.project.year, 11, 31);
$scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.startMonth = vatSessionService.month;
$scope.endMonth = vatSessionService.month;
$scope.totalMoneyAmount = 0;
$scope.totalTaxAmount = 0;
var minDate = [1, vatSessionService.project.year];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, vatSessionService.project.year];
var setDate = [
[vatSessionService.project.year],
[vatSessionService.project.year]];
//初始化期间
var initPeriods = function () {
var curMonth = new Date().getMonth() + 1;
$scope.queryParams = {
pageInfo: {},
periodStart: '',
periodEnd: '',
subjectCode: null,
subjectName: null,
orgCode: null,
orgName: null,
documentDate: null,
projectId: vatSessionService.project.id
};
};
//从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize,
totalPage: 0
};
$scope.getDataFromDatabase($scope.queryParams);
};
$scope.getDataFromDatabase = function (queryParams){
citReportService.getAssetEamMappings(queryParams).success(function (resp) {
debugger;
if (resp.data) {
// minDate = data.
var index = 1;
resp.data.list.forEach(function (v) {
v.index = index++;
});
$scope.gridOptions.data = resp.data.list;
$scope.queryJournalEntryResult.pageInfo = resp.data;
computeJournalEntryPage();
// $scope.ledgerName = data.list[0].ledgerName;
// $scope.currencyCode = data.list[0].currencyCode;
// $scope.status = data.list[0].status;
// $scope.importDate = $filter('date')(data.list[0].date, "yyyy-MM-dd hh:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadJournalEntryDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeJournalEntryPage = function () {
if ($scope.queryJournalEntryResult.pageInfo && $scope.queryJournalEntryResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryJournalEntryResult.pageInfo.total / $scope.queryJournalEntryResult.pageInfo.pageSize);
totalPage = $scope.queryJournalEntryResult.pageInfo.totalCount % $scope.queryJournalEntryResult.pageInfo.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryJournalEntryResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.total % $scope.queryJournalEntryResult.pageInfo.pageSize;
}
else {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.pageSize;
}
$scope.queryJournalEntryResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
}
}
$scope.curJournalEntryPage = 1;
};
//将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) {
if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
$scope.queryParams.periodEnd = $scope.queryParams.periodStart;
}
//设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
if ($scope.queryParams.subjectCode === null) {
$scope.queryParams.subjectCode = '';
}
if ($scope.queryParams.subjectName === null) {
$scope.queryParams.subjectName = '';
}
if ($scope.queryParams.orgCode === null) {
$scope.queryParams.orgCode = '';
}
if ($scope.queryParams.orgName === null) {
$scope.queryParams.orgName = '';
}
if ($scope.queryParams.documentDate === null) {
$scope.queryParams.documentDate = '';
}
});
}
loadJournalEntryDataFromDB(1);
if ($scope.criteriaList.length > 6) {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
$scope.criteriaListSecondRow = $scope.criteriaList.slice(6, $scope.criteriaList.length);
}
else {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, $scope.criteriaList.length);
}
$('.filter-button').popover("hide");
};
//去掉所有的查询条件,重新load数据
var doDataFilterReset = function () {
$scope.queryParams = {
pageInfo: {},
periodStart: '',
periodEnd: '',
subjectCode: null,
subjectName: null,
orgCode: null,
orgName: null,
documentDate: null,
projectId: vatSessionService.project.id
};
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
loadJournalEntryDataFromDB(1);
$('.filter-button').popover("hide");
};
var prepareSummary = function () {
// do something before show popover
};
//在popover打开时执行事件
var showPopover = function () {
$timeout(function () {
initDatePickers();
}, 500);
};
//初始化时间控件
var initDatePickers = function () {
//认证开始时间
var ele1 = $("#certificationDateStart");
ele1.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: true,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
});
ele1.datepicker("setDate", $scope.queryParams.certificationDateStart);
//认证结束时间
var ele2 = $("#certificationDateEnd");
ele2.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: true,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
})
ele2.datepicker("setDate", $scope.queryParams.certificationDateEnd);
};
var downloadJE = function () {
citReportService.initExportAEMData($scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
vatExportService.exportToExcel(data, status, headers, 'CIT.WP01901_固定资产.xlsx');
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
(function initialize() {
$log.debug('VatPreviewInputInvoiceController.ctor()...');
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
//初始化month-picker
$('#input-invoice-period-picker').rangePicker({
minDate: minDate,
maxDate: maxDate,
setDate: setDate,
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
})
.on('datePicker.done', function (e, result) {
//开始月份
var startMonth = result[0][1] * 100 + result[0][0];
//结束月份
var endMonth = result[1][1] * 100 + result[1][0];
$scope.startMonth = startMonth;
$scope.endMonth = endMonth;
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1);
});
$scope.gridOptions = {
rowHeight: constant.UIGrid.rowHeight,
selectionRowHeaderWidth: constant.UIGrid.rowHeight,
// expandableRowTemplate: '<div ui-grid="row.entity.subGridOptions" style="height:150px;"></div>',
virtualizationThreshold: 50,//默认加载50条数据,避免在数据展示时,只显示前面4条
enableSorting: false,
enableColumnMenus: false,
enableHorizontalScrollbar : 1,
columnDefs: [
{ name: $translate.instant('AssetType'), width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.assetType}}<span></div>' },
{ name: $translate.instant('AssetNumber'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.assetNumber}}<span></div>' },
{ name: $translate.instant('AssetDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.assetDescription}}</span></div>' },
{ name: $translate.instant('BuyDate'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.buyDate | date:"yyyy-MM-dd"}}</span></div>' },
{ name: $translate.instant('DepreciationDate'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.depreciationDate | date:"yyyy-MM-dd"}}</span></div>' },
{ name: $translate.instant('AssetGroupName'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.assetGroupName}}</span></div>' },
{ name: $translate.instant('AcquisitionValue'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.acquisitionValue}}</span></div>' },
{ name: $translate.instant('ResidualRate'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.residualRate}}</span></div>' },
{ name: $translate.instant('YearEndValue'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.yearEndValue}}</span></div>' },
{ name: $translate.instant('CompensationSaleAmount'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.compensationSaleAmount}}</span></div>' },
{ name: $translate.instant('CompensationSaleAmount'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.compensationSaleAmount}}</span></div>' },
{ name: $translate.instant('DisposalProfitAndLoss'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.disposalProfitAndLoss}}</span></div>' },
{ name: $translate.instant('TaxGroupName'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.taxGroupName}}</span></div>' },
{ name: $translate.instant('DepreciationPeriod'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.depreciationPeriod}}</span></div>' },
{ name: $translate.instant('PerMonthDepreciationAmount'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.perMonthDepreciationAmount}}</span></div>' },
{ name: $translate.instant('TaxToCurrentYearDepreciationPeriod'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.taxToCurrentYearDepreciationPeriod}}</span></div>' },
{ name: $translate.instant('AccountTotalepreciationAmount'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.taxToCurrentYearDepreciationAmount}}</span></div>' },
{ name: $translate.instant('TaxNetValue'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.taxNetValue}}</span></div>' },
{ name: $translate.instant('DisposalTaxBenefit'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.disposalTaxBenefit}}</span></div>' }
]
};
$scope.doDataFilter = doDataFilter;
$scope.doDataFilterReset = doDataFilterReset;
$scope.prepareSummary = prepareSummary;
$scope.showPopover = showPopover;
$scope.downloadJE = downloadJE;
initPeriods();
initJournalEntryPagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.organizationId = vatSessionService.project.organizationID;
if($rootScope.currentLanguage === 'en-us'){
$('.periodInput')[0].style.left = "280px";
}else{
$('.periodInput')[0].style.left = "150px";
}
loadJournalEntryDataFromDB(1);
})();
}
]);
<div class="cit-asset-eam-mapping" id="mainPreviewDiv">
<div class="top-area-wrapper" style="margin-top: 10px">
<span translate="JournalTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;" id="input-invoice-period-picker" />
<span ng-click="downloadJE()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">-->
<!--{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'IsCloseAccount' | translate}}<span class="numAmount">{{status}}</span>-->
<!--{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>-->
<!--</div>-->
<div id="filterCriteriaDiv" style="max-width:98%;margin-bottom:2px;" ng-show="criteriaList.length>0">
<span class="text-bold margin-left20" translate="FilterCriteriaTags"></span>:
<span class="tag label label-default" ng-repeat="criteria in criteriaListFirstRow">
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
<span ng-if="criteriaList.length>6"><br /></span>
<span ng-if="criteriaList.length>6" style="margin-left: 81px; margin-top: 19px; display: inline-block;"></span>
<span ng-if="criteriaList.length>6" class="tag label label-default" ng-repeat="criteria in criteriaListSecondRow">
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
</div>
<div id="mainAreaDiv" class="main-area">
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
</div>
</div>
citModule.directive('citAssetEamMapping', ['$log',
function ($log) {
$log.debug('citPreviewJournalMerge.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/cit/reduction/cit-asset-eam-mapping/cit-asset-eam-mapping.html' + '?_=' + Math.random(),
scope: {},
controller: 'citAssetEamMappingController',
link: function ($scope, element) {
}
};
}
]);
@import "~/app-resources/less/theme.less";
.cit-asset-eam-mapping {
background-color: white;
height: 100%;
.numAmount {
padding: 0 3px;
height: 21px;
margin-left: 5px;
/* font-family: 'Arial'; */
font-weight: 600;
border-radius: 2px;
font-style: normal;
outline: none;
border: none;
min-width: 20px;
background-color: #DDDDDD;
color: #AA0000;
}
.top-area-wrapper {
height: 60px;
width: 98%;
margin: 0 20px;
.filter-button {
width: 30px;
margin-top: 16px;
}
.operation-wrapper {
margin: 15px 25px 10px 10px;
span {
cursor: pointer;
}
}
}
.filter-popup-wrapper {
display: none;
}
.margin-left20 {
margin-left: 20px;
}
/*******************************************/
/*Filter Criteria tags:*/
.tag {
font-size: 12px;
padding: .3em .4em .4em;
margin: 0 .1em;
a {
color: #bbb;
cursor: pointer;
opacity: 0.6;
margin: 0 0 0 .3em;
&:hover {
opacity: 1.0;
}
.glyphicon-white {
color: #fff;
margin-bottom: 2px;
}
}
.remove {
vertical-align: bottom;
top: 0;
}
}
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
position: absolute;
top: 50%;
transform: translateY(-50%);
opacity: .25;
font-size: 3em;
width: 100%;
text-align: center;
z-index: 1000;
}
.inputInvoiceGrid {
width: 100%;
height: calc(~'100% - 158px');
.ui-grid-header-cell-wrapper .ui-grid-header-cell-row .ui-grid-cell-contents {
height: 40px;
i {
display: none;
}
}
}
}
.form-control {
&:focus {
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
}
}
.input-width-middle {
width: 217px;
}
}
.popover {
min-width: 370px;
left: 119px !important;
.arrow {
left: 5% !important;
}
}
.popover-content {
td {
text-align: right;
padding: 6px;
span {
float: left;
}
}
.form-control {
display: inline-block;
&:focus {
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
}
}
.input-width-small {
width: 100px;
}
.input-width-middle {
width: 217px;
}
}
...@@ -650,6 +650,7 @@ constant.citPermission = { ...@@ -650,6 +650,7 @@ constant.citPermission = {
dataManage: { dataManage: {
dataManageCode: '03.003', dataManageCode: '03.003',
accountMappingCode: '03.003.001', accountMappingCode: '03.003.001',
assetEamMapping: '03.003.002',
accountMapping: { accountMapping: {
queryCode: '03.003.001.001', queryCode: '03.003.001.001',
importCode: '03.003.001.002' importCode: '03.003.001.002'
......
...@@ -52,271 +52,7 @@ webservices.factory('citPreviewService', ['$http', 'apiConfig','FileSaver', func ...@@ -52,271 +52,7 @@ webservices.factory('citPreviewService', ['$http', 'apiConfig','FileSaver', func
return $http.post('/citDataPreview/exportTbMappingVerData', citTbMappingVerDto, apiConfig.create({ responseType: 'arraybuffer' })); return $http.post('/citDataPreview/exportTbMappingVerData', citTbMappingVerDto, apiConfig.create({ responseType: 'arraybuffer' }));
}, },
queryOutputInvoiceAllList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
Tag: param.tag,
}, apiConfig.createVat());
},
queryOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceList', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
Tag: param.tag,
}, apiConfig.createVat());
},
queryOutputInvoiceItemList: function (invoiceID,tag) {
return $http.get('/outputInvoiceImport/queryOutputInvoiceItemList/' + invoiceID+'?tag='+tag, apiConfig.createVat());
},
getExportOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/getExportOutputInvoiceList', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
}, apiConfig.createVat({ responseType: 'arraybuffer' }));
},
queryInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewList', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat());
},
queryInputInvoiceAllList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat());
},
queryInputInvoiceItemList: function (inputInvoiceID) {
return $http.get('/inputInvoiceImport/inputInvoiceItemPreviewList/' + inputInvoiceID, apiConfig.createVat());
},
//导出进项发票数据
getExportInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/exportQueryData/get', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat({ responseType: 'arraybuffer' }));
},
voucherSelectAdvancedByEntry: function (mainRelation, allJe, pagingInfo, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedByEntry', {
MainRelation: mainRelation,
AllJe: allJe,
PagingInfo: pagingInfo,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
voucherSelectAdvancedByVoucher: function (mainRelation, allJe, pagingInfo, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedByVoucher', {
MainRelation: mainRelation,
AllJe: allJe,
PagingInfo: pagingInfo,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
voucherSelectAdvancedCount: function (mainRelation, isEntryShow, allJe, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedCount', {
MainRelation: mainRelation,
AllJe: allJe,
IsEntryShow: isEntryShow,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getVoucherByConditon: function (mainRelation, allJe, period, vID, group, listQueryCondition) {
return $http.post('/voucher/getVoucherByConditon', {
MainRelation: mainRelation,
AllJe: allJe,
Period: period,
VID: vID,
Group: group,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getSelectWhereString: function (mainRelation, allJe, listQueryCondition) {
return $http.post('/voucher/getSelectWhereString', {
MainRelation: mainRelation,
AllJe: allJe,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getEnterpriseAccount: function () {
return $http.get('/voucher/getEnterpriseAccount', apiConfig.create());
},
/****************************************************************************************************/ /****************************************************************************************************/
/* Tony's Beatup services */
getTBDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getTBDataForDisplay', queryParams, apiConfig.createVat());
},
initExportTBData: function (queryParams) {
return $http.post('/dataPreview/exportTBData/get', queryParams, apiConfig.create({ responseType: 'arraybuffer' }));
},
getCFDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCFDataForDisplay', queryParams, apiConfig.createVat());
},
//服务器导出
initExportCFData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCFData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getPLDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getPLDataForDisplay', queryParams, apiConfig.createVat());
},
initExportPLData: function (queryParams) {
return $http.post('/dataPreview/exportPLData/get', queryParams, apiConfig.create({ responseType: 'arraybuffer' }));
},
getJEDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getJEDataForDisplay', queryParams, apiConfig.createVat());
},
initExportJEData: function (queryParams) {
return $http.post('/dataPreview/exportJEData/get', queryParams, apiConfig.create({ responseType: 'arraybuffer' }));
},
getBSDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getBSDataForDisplay', queryParams, apiConfig.createVat());
},
initExportBSData: function (queryParams) {
return $http.post('/dataPreview/exportBSData/get', queryParams, apiConfig.create({ responseType: 'arraybuffer' }));
},
getIRDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getIRDataForDisplay', queryParams, apiConfig.createVat());
},
initExportIRData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getCPRDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCPRDataForDisplay', queryParams, apiConfig.createVat());
},
initExportCPRData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCPRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getRLITDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getRLITDataForDisplay', queryParams, apiConfig.createVat());
},
initExportRLITData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportRLITData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getCILDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCILDataForDisplay', queryParams, apiConfig.createVat());
},
initExportCILData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCILData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
},
getIDDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getIDDataForDisplay', queryParams, apiConfig.createVat());
},
initExportIDData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIDData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
}
}; };
}]); }]);
\ No newline at end of file
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
// citGetTemplate: function (projectId, period?) // citGetTemplate: function (projectId, period?)
updateConfig: function (projectId, ifDeleteManualDataSource, period, generator, isMergeManualDataSource) { updateConfig: function (projectId, ifDeleteManualDataSource, period, generator, isMergeManualDataSource) {
return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator+ '&mergeManual='+isMergeManualDataSource, {}, apiConfig.createVat({ignoreLoadingBar: true})); return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator + '&mergeManual=' + isMergeManualDataSource, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) { generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true})); return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
generateAllCitReport: function (projectId, isMergeManualDataSource, generator) { generateAllCitReport: function (projectId, isMergeManualDataSource, generator) {
return $http.post('/citReport/generateByTotal/' + projectId + '/' + isMergeManualDataSource + '?generator=' + generator , {}, apiConfig.createVat({ignoreLoadingBar: true})); return $http.post('/citReport/generateByTotal/' + projectId + '/' + isMergeManualDataSource + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
getRunningJob: function (projectId, period) { getRunningJob: function (projectId, period) {
return $http.get('/citReport/getPeriodJob/' + projectId+'/'+period, apiConfig.createVat()); return $http.get('/citReport/getPeriodJob/' + projectId + '/' + period, apiConfig.createVat());
}, },
getJobStatus: function (projectId, period, jobId) { getJobStatus: function (projectId, period, jobId) {
return $http.get('/Report/getJobStatus/' + projectId +'/'+ period +'/'+ jobId, apiConfig.createVat({ignoreLoadingBar: true})); return $http.get('/Report/getJobStatus/' + projectId + '/' + period + '/' + jobId, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
getReportData: function (reportId) { getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat()); return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
}, },
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
vatOperationLogService.addOperationLog(logInfo); vatOperationLogService.addOperationLog(logInfo);
data.dataSourceType = enums.cellDataSourceType.KeyIn; data.dataSourceType = enums.cellDataSourceType.KeyIn;
return $q.when(data); return $q.when(data);
},function (data) { }, function (data) {
logInfo.UpdateState = $translate.instant('ManualInputFail'); logInfo.UpdateState = $translate.instant('ManualInputFail');
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
return vatOperationLogService.addOperationLog(logInfo); return vatOperationLogService.addOperationLog(logInfo);
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
return $http.post('/Report/citGenerate/byTotal/' + projectId + '/' + ifDeleteManualDataSource + '/' + 0 return $http.post('/Report/citGenerate/byTotal/' + projectId + '/' + ifDeleteManualDataSource + '/' + 0
// 暂时将生成预缴表的period设置为0,等待完成新的预缴表生成逻辑 + period // 暂时将生成预缴表的period设置为0,等待完成新的预缴表生成逻辑 + period
+ '/' + enums.reportType.prepay + '/' + enums.reportType.prepay
+ '?generator=' + generator, {}, apiConfig.createVat({ ignoreLoadingBar: true })); + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
citGenerateByType: function (projectId, ifDeleteManualDataSource, reportType, generator) { citGenerateByType: function (projectId, ifDeleteManualDataSource, reportType, generator) {
var paramStr = ''; var paramStr = '';
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
paramStr = '/' + reportType; paramStr = '/' + reportType;
} }
return $http.post('/Report/citGenerate/byTotal/' + projectId + '/' + ifDeleteManualDataSource + '/0' + paramStr + '?generator=' + generator, {}, apiConfig.createVat({ ignoreLoadingBar: true })); return $http.post('/Report/citGenerate/byTotal/' + projectId + '/' + ifDeleteManualDataSource + '/0' + paramStr + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
citGetTemplate: function (projectId, period) { citGetTemplate: function (projectId, period) {
if (!_.isNumber(period)) { if (!_.isNumber(period)) {
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
reportTypeParam = '/' + reportType; reportTypeParam = '/' + reportType;
} }
return $http.post('/Report/citCalculateKeyValue/' + projectId + '/0' + reportTypeParam, {}, apiConfig.createVat({ ignoreLoadingBar: true })); return $http.post('/Report/citCalculateKeyValue/' + projectId + '/0' + reportTypeParam, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
getReportByTemplateId: function (templateId, period) { getReportByTemplateId: function (templateId, period) {
if (!_.isNumber(period)) { if (!_.isNumber(period)) {
...@@ -201,15 +201,30 @@ ...@@ -201,15 +201,30 @@
return $http.get('/Report/getDataSourceDetailList/' + dataSourceId, apiConfig.createVat()); return $http.get('/Report/getDataSourceDetailList/' + dataSourceId, apiConfig.createVat());
}, },
hasManualDataSource: function (projectId, period) { hasManualDataSource: function (projectId, period) {
return $http.get('/Report/hasManualDataSource/' + projectId+ '/' +period, apiConfig.createVat()); return $http.get('/Report/hasManualDataSource/' + projectId + '/' + period, apiConfig.createVat());
},
loadAttachList: function (activeSheet) {
return $http.post('/Report/loadAttachList', activeSheet, apiConfig.createVat());
},
deleteAttach: function (id) {
var config = {isBusyRequest: true};
return $http.get('/Report/deleteAttach?id=' + id, apiConfig.create(config));
},
/**
获取固定资产及EAM对应的数据
*/
getAssetEamMappings : function(citAssetsListDto){
return $http.post('/citReport/getAssetEamMappingsPage', citAssetsListDto, apiConfig.create());
}, },
loadAttachList : function(activeSheet){ /**
return $http.post('/Report/loadAttachList' , activeSheet, apiConfig.createVat()); * 导出固定资产及EAM对应的数据
* @param citAssetsListDto
* @returns {HttpPromise}
*/
initExportAEMData: function (citAssetsListDto) {
return $http.post('/citReport/exportAEMData', citAssetsListDto, apiConfig.create({ responseType: 'arraybuffer' }));
}, },
deleteAttach : function(id){
var config = { isBusyRequest: true };
return $http.get('/Report/deleteAttach?id=' + id, apiConfig.create(config));
}
}; };
......
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