Commit 2a9945c4 authored by weizhikai's avatar weizhikai

1、固资导入分类bug;2、预提重分类数据预览界面千分位及导出bug;3、报表导出数值千分位

parent 2b6738a8
......@@ -95,7 +95,7 @@ public class AssetListController {
}
/**
*
* 获取资产类别
* @return
*/
@RequestMapping(value = "/getAssetGroupResultData", method = RequestMethod.GET)
......
......@@ -131,12 +131,16 @@ public class AssetListServiceImpl extends BaseService {
}
/**
* 根据卡片获取之前映射好的资产类别
* @param projectId
* @return
* @throws Exception
*/
public List<CitAssetGroupResultDto> getAssetGroupResultData(String projectId) throws Exception {
logger.debug("根据projectId获取该资产类别相关数据");
CitAssetGroupResultExample assetGroupResultExample = new CitAssetGroupResultExample();
CitAssetGroupResultExample.Criteria criteria = assetGroupResultExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
List<CitAssetGroupResult> citAssetGroupResults = assetGroupResultMapper.selectByExample(assetGroupResultExample);
List<CitAssetGroupResult> citAssetGroupResults = assetGroupResultMapper.getAssetGroupResult(projectId);
List<CitAssetGroupResultDto> citAssetGroupResultDtos = new ArrayList<>();
for (CitAssetGroupResult citAssetGroupResult:citAssetGroupResults){
......@@ -271,7 +275,9 @@ public class AssetListServiceImpl extends BaseService {
deleteByExample(projectId);
}
//循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
if(citAssetsLists != null && citAssetsLists.size()>0){
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
}
//处理资产类别
//1、根据projectId查询数据库中已有的资产类别,并和新导入的资产类别进行比较
// for (CitAssetGroupResult groupResult : citAssetGroupResults) {
......@@ -279,11 +285,15 @@ public class AssetListServiceImpl extends BaseService {
// }
Iterator<String> it = assetNameSet.iterator();
while (it.hasNext()) {
String next = it.next();
CitAssetGroupResultExample citAssetGroupResultExample = new CitAssetGroupResultExample();
citAssetGroupResultExample.createCriteria().andProjectIdEqualTo(projectId).andAssetNameEqualTo(next);
assetGroupResultMapper.deleteByExample(citAssetGroupResultExample);
CitAssetGroupResult citAssetGroupResult = new CitAssetGroupResult();
citAssetGroupResult.setId(idService.nextId());
citAssetGroupResult.setProjectId(projectId);
citAssetGroupResult.setPeriod(project.getYear());
citAssetGroupResult.setAssetName(it.next());
citAssetGroupResult.setAssetName(next);
assetGroupResultMapper.insertSelective(citAssetGroupResult);
}
importResult.setResult(true);
......
......@@ -190,6 +190,8 @@ public class CitPreviewDataServiceImpl extends BaseService {
public int exportDataSalaryAdvance(CitSalaryDataDto citSalaryDataDto , HttpServletResponse response) {
CitSalaryAdvanceExample example = new CitSalaryAdvanceExample();
CitSalaryAdvanceExample.Criteria criteria = example.createCriteria();
criteria.andProjectIdEqualTo(citSalaryDataDto.getProjectId());
criteria.andPeriodEqualTo(citSalaryDataDto.getPeriod());
if(!"".equals(citSalaryDataDto.getPoSubjectName()) && citSalaryDataDto.getPoSubjectName() != null){//根据PO主体名称进行查询
criteria.andPoSubjectNameEqualTo(citSalaryDataDto.getPoSubjectName());
}
......@@ -210,6 +212,7 @@ public class CitPreviewDataServiceImpl extends BaseService {
if(periodStart != null && periodEnd == null ){
criteria.andPeriodGreaterThanOrEqualTo(periodStart);
}
List<CitSalaryAdvance> list = citSalaryAdvanceMapper.selectByExample(example);
if(list.size()==0){
return 0;
......
......@@ -581,7 +581,7 @@ public class ReportGeneratorImpl {
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......@@ -657,10 +657,8 @@ public class ReportGeneratorImpl {
List<AnalysisSalesValueDto> dataList = periodCellDataMapper.selectReportData(a.getTemplateId(),a.getProjectId(),a.getPeriod());
for(AnalysisSalesValueDto cellData:dataList){
Sheet sheet = tWorkbook.getSheetAt(0);
Cell cell = sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex());
sheet.getRow(cellData.getRowIndex()).removeCell(cell);
sheet.getRow(cellData.getRowIndex()).createCell(cellData.getColumnIndex());
try{
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).getCellTypeEnum();
BigDecimal amount = new BigDecimal(cellData.getData());
BigDecimal manualAmount = new BigDecimal("0");
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......@@ -668,7 +666,8 @@ public class ReportGeneratorImpl {
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......
......@@ -105,4 +105,6 @@ public interface CitAssetGroupResultMapper extends MyMapper {
* @mbg.generated
*/
int updateByPrimaryKey(CitAssetGroupResult record);
List<CitAssetGroupResult> getAssetGroupResult(@Param("projectId") String projectId);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitAssetGroupResultMapper">
<select id="getAssetGroupResult" resultMap="BaseResultMap">
select gr.* from asset_group_result gr
where gr.project_id=#{projectId,jdbcType=VARCHAR}
and gr.asset_name in
(SELECT DISTINCT(l.asset_group_name) from assets_list l where l.project_id=#{projectId,jdbcType=VARCHAR})
</select>
</mapper>
\ No newline at end of file
......@@ -43,16 +43,16 @@
{ caption: $translate.instant('item'), dataField: "item", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('standardMoney'), dataField: "standardMoney", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('currency'), dataField: "currency", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('orderAmount'), dataField: "orderAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('executedServiceSchedule'), dataField: "executedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('coupaTotalAccept'), dataField: "coupaTotalAccept", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advance'), dataField: "advance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('unexecutedServiceSchedule'), dataField: "unexecutedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('approvedStandardInvoiceAmount'), dataField: "approvedStandardInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('paidInvoiceAmount'), dataField: "paidInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableInvoiceAmount'), dataField: "usableInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableBalance'), dataField: "usableBalance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advanceWriteOff'), dataField: "advanceWriteOff", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('orderAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "orderAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('executedServiceSchedule'),format: {type: 'fixedPoint', precision: 2}, dataField: "executedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('coupaTotalAccept'),format: {type: 'fixedPoint', precision: 2}, dataField: "coupaTotalAccept", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advance'), format: {type: 'fixedPoint', precision: 2}, dataField: "advance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('unexecutedServiceSchedule'),format: {type: 'fixedPoint', precision: 2}, dataField: "unexecutedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('approvedStandardInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "approvedStandardInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('paidInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "paidInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "usableInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableBalance'),format: {type: 'fixedPoint', precision: 2}, dataField: "usableBalance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advanceWriteOff'),format: {type: 'fixedPoint', precision: 2}, dataField: "advanceWriteOff", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('Account'), dataField: "subjectCode", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('AccountDescription'), dataField: "subjectDescription", allowEditing: false, fixed: true ,width: 150},
......@@ -106,9 +106,6 @@
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%',
width: '98%',
filterRow: {
visible: true
},
onRowUpdating: function (e) {
},
onToolbarPreparing: function (e) {
......
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