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;
}
} }
/** /**
......
...@@ -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 {
......
<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'
......
...@@ -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