Commit 02a09b6f authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 169546f8 00d31024
......@@ -249,7 +249,7 @@ public class AssetListServiceImpl extends BaseService {
citAsset.setDisposedDate(sdf.parse(value.toString()));
}
//先判断该条数据是否需要直接舍弃掉,筛选条件:报废类型是完全报废,报废日期小于去年年底最后一天的就剔除。
if("完全报废".equals(citAsset.getScrapType()) && endOfLastYearDate.after(citAsset.getDisposedDate())){
if("完全报废".equals(citAsset.getScrapType()) && (citAsset.getDisposedDate()==null || endOfLastYearDate.after(citAsset.getDisposedDate()))){
errorMsgSb.append(rowNum+",");
continue;
}
......@@ -381,9 +381,17 @@ public class AssetListServiceImpl extends BaseService {
//目前已经进行税法分类,标注状态
citAsset.setStatus(1);
AssetDetailGroup assetDetailGroup = selectAssetDetailGroup(groupResults.get(0).getAssetDetailGroupId());
if(assetDetailGroup == null){
//目前没有进行税法分类,标注状态
citAsset.setStatus(0);
//没有进行过分类,放入Set集合里面
assetNameSet.add(assetName);
}else{
// Integer assetGroupType = selectAssetDetailGroup(groupResults.get(0).getAssetDetailGroupId()).getAssetGroupType();
//进行税务的计算
setCitAssetTaxData(citAsset,groupResults.get(0),assetDetailGroup, year);
//进行税务的计算
setCitAssetTaxData(citAsset,groupResults.get(0),assetDetailGroup, year);
}
}else{
//目前没有进行税法分类,标注状态
citAsset.setStatus(0);
......@@ -486,11 +494,10 @@ public class AssetListServiceImpl extends BaseService {
citAsset.setTaxToCurrentYearDepreciationPeriod((year-cal.get(Calendar.YEAR))*12+12-cal.get(Calendar.MONTH));
}
calendar.setTime(new Date());
calendar.add(Calendar.MONTH,1);
cal.add(Calendar.MONTH,1);
//计算开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化
//开始折旧日期计算逻辑是固定资产和长期待摊费用是购入日期的次月,无形资产的开始折旧日期等于购入日期
citAsset.setDepreciationDate(calendar.getTime());
citAsset.setDepreciationDate(cal.getTime());
break;
case LongTermPrepaid:
......@@ -509,11 +516,10 @@ public class AssetListServiceImpl extends BaseService {
citAsset.setTaxToCurrentYearDepreciationPeriod((year-cal.get(Calendar.YEAR))*12+12-cal.get(Calendar.MONTH));
}
calendar.setTime(new Date());
calendar.add(Calendar.MONTH,1);
cal.add(Calendar.MONTH,1);
//计算开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化
//开始折旧日期计算逻辑是固定资产和长期待摊费用是购入日期的次月,无形资产的开始折旧日期等于购入日期
citAsset.setDepreciationDate(calendar.getTime());
citAsset.setDepreciationDate(cal.getTime());
break;
case InvisibleAssets:
......
......@@ -307,16 +307,16 @@ public class CitImportExcelServiceImpl extends BaseService {
//覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg = "覆盖导入成功";
CitJournalEntryAdjustExample citJEAExample = new CitJournalEntryAdjustExample();
citJEAExample.createCriteria().andCreatedByEqualTo(currentUserName).andPeriodEqualTo(period).andProjectIdEqualTo(project.getId());
citJEAExample.createCriteria().andPeriodEqualTo(period).andProjectIdEqualTo(project.getId());
logger.info("删除符合条件的日记账");
citJournalEntryAdjustMapper.deleteByExample(citJEAExample);
//删除自动生成的试算平衡表相关数据
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
citTbExample.createCriteria().andPeriodEqualTo(period).andCreateByEqualTo(currentUserName).andProjectIdEqualTo(project.getId());
citTbExample.createCriteria().andPeriodEqualTo(period).andProjectIdEqualTo(project.getId());
int deleteByExample = citTrialBalanceMapper.deleteByExample(citTbExample);
logger.info("删除符合条件的试算平衡表数据");
CitTbamExample citTbamExample = new CitTbamExample();
citTbamExample.createCriteria().andPeriodEqualTo(period).andCreateByEqualTo(currentUserName).andProjectIdEqualTo(project.getId());
citTbamExample.createCriteria().andPeriodEqualTo(period).andProjectIdEqualTo(project.getId());
logger.info("删除符合条件的试算平衡表Mapping数据");
citTbamMapper.deleteByExample(citTbamExample);
updateImportLog(EnumCitImportType.JournalAdjust.getCode());
......@@ -504,7 +504,6 @@ public class CitImportExcelServiceImpl extends BaseService {
msg = "覆盖导入成功";
CitTrialBalanceExample citTrialBalanceExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria criteria = citTrialBalanceExample.createCriteria();
criteria.andCreateByEqualTo(currentUserName);
criteria.andPeriodEqualTo(period);
criteria.andProjectIdIn(projectIdList);
citTrialBalanceMapper.deleteByExample(citTrialBalanceExample);
......@@ -1448,11 +1447,11 @@ public class CitImportExcelServiceImpl extends BaseService {
Project project = projectMapper.selectByPrimaryKey(projectId);
//删除自动生成的试算平衡表相关数据
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
citTbExample.createCriteria().andPeriodEqualTo(project.getYear()).andCreateByEqualTo(authUserHelper.getCurrentAuditor().get()).andProjectIdEqualTo(projectId);
citTbExample.createCriteria().andPeriodEqualTo(project.getYear()).andProjectIdEqualTo(projectId);
citTrialBalanceMapper.deleteByExample(citTbExample);
logger.info("删除符合条件的试算平衡表数据");
CitTbamExample citTbamExample = new CitTbamExample();
citTbamExample.createCriteria().andPeriodEqualTo(project.getYear()).andCreateByEqualTo(authUserHelper.getCurrentAuditor().get()).andProjectIdEqualTo(projectId);
citTbamExample.createCriteria().andPeriodEqualTo(project.getYear()).andProjectIdEqualTo(projectId);
logger.info("删除符合条件的试算平衡表Mapping数据");
citTbamMapper.deleteByExample(citTbamExample);
updateImportLog(EnumCitImportType.JournalAdjust.getCode());
......
......@@ -193,6 +193,15 @@ public class TaxDocumentServiceImpl {
@Transactional
public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) {
try {
TaxDocumentExample taxDocumentExample = new TaxDocumentExample();
taxDocumentExample.createCriteria().andFileNameEqualTo(taxDocument.getFileName());
List<TaxDocument> list = taxDocumentMapper.selectByExample(taxDocumentExample);
if (list.size() > 0) {
return false;
}
//上传文件
if (StringUtils.isBlank(taxDocument.getFileUploadId())) {
......@@ -311,6 +320,15 @@ public class TaxDocumentServiceImpl {
public boolean editFilesType(TaxDocument taxDocument) {
try {
TaxDocumentExample taxDocumentExample = new TaxDocumentExample();
taxDocumentExample.createCriteria().andFileNameEqualTo(taxDocument.getFileName());
List<TaxDocument> list = taxDocumentMapper.selectByExample(taxDocumentExample);
if (list.size() > 0) {
return false;
}
taxDocument.setUpdateTime(new Date());
int num = taxDocumentMapper.updateByPrimaryKey(taxDocument);
if (num > 0) {
......
......@@ -89,10 +89,10 @@ if(assetDetailResultDtos != null&&assetDetailResultDtos.size()>0){
dataSource.add(assetDetailDataSourceDto);
}
dataSource = dataSource.stream()
.sorted(Comparator.comparing(AssetDetailDataSourceDto::getAssetGroupName)
.thenComparing(AssetDetailDataSourceDto::getAssetDetailGroupName))
.collect(Collectors.toList());
// dataSource = dataSource.stream()
// .sorted(Comparator.comparing(AssetDetailDataSourceDto::getAssetGroupName)
// .thenComparing(AssetDetailDataSourceDto::getAssetDetailGroupName))
// .collect(Collectors.toList());
switch (dataType) {
case 1:
......
......@@ -281,49 +281,16 @@
<select id="getCitAssetDetialResult" resultMap="citAssetDetailResultDto">
SELECT
assets_list.id AS id,
assets_list.id,
assets_list.asset_number,
assets_list.asset_group_name,
assets_list.asset_detail_group_id,
assets_list.asset_description,
assets_list.buy_date,
assets_list.depreciation_date,
assets_list.depreciation_period,
assets_list.acquisition_value,
assets_list.adjustment_value,
assets_list.disposed_date,
assets_list.residual_rate,
assets_list.year_depreciation_amount,
assets_list.year_adjustment_amount,
assets_list.year_end_value,
assets_list.status,
assets_list.account_acquisition_value,
assets_list.account_month_depreciation_amount,
assets_list.account_year_depreciation_amount,
assets_list.account_total_depreciation_amount,
assets_list.tax_depreciation_period,
assets_list.tax_to_last_year_depreciation_period,
assets_list.tax_to_current_year_depreciation_period,
assets_list.tax_year_depreciation_period,
assets_list.tax_month_depreciation_amount,
assets_list.tax_to_current_year_depreciation_amount,
assets_list.tax_current_year_depreciation_amount,
assets_list.total_difference_amount,
assets_list.year_difference_amount,
assets_list.is_retain,
assets_list.create_time,
assets_list.update_time,
assets_list.asset_type,
asset_detail_group.id,
asset_detail_group.asset_group_id,
asset_detail_group.detail_group_name,
asset_detail_group.asset_group_type,
asset_detail_group.group_year,
asset_detail_group.create_time,
asset_detail_group.update_time,
asset_detail_group.detail_group_type,
asset_detail_group.key_values
sum(acquisition_value) as acquisition_value,
sum(account_year_depreciation_amount) as account_year_depreciation_amount,
sum(account_total_depreciation_amount) as account_total_depreciation_amount,
sum(account_month_depreciation_amount) as account_month_depreciation_amount,
sum(year_end_value) as year_end_value,
sum(tax_month_depreciation_amount) as tax_month_depreciation_amount,
sum(tax_to_current_year_depreciation_amount) as tax_to_current_year_depreciation_amount,
sum(tax_current_year_depreciation_amount) as tax_current_year_depreciation_amount,
sum(total_difference_amount) as total_difference_amount,
sum(year_difference_amount) as year_difference_amount
FROM
assets_list
JOIN
......@@ -332,7 +299,6 @@
assets_list.asset_detail_group_id = asset_detail_group.id
WHERE
assets_list.asset_detail_group_id IS NOT NULL
AND assets_list.asset_type IS NOT NULL
AND assets_list.asset_type = #{assetType,jdbcType=INTEGER}
AND asset_detail_group.asset_group_type = #{assetType,jdbcType=INTEGER}
AND asset_detail_group.detail_group_type = #{assetDetailType,jdbcType=INTEGER}
......
......@@ -2444,6 +2444,7 @@
$scope.selectCompany.orgAttributeRowList = orgAttributeRowList;
$scope.isInternational = $scope.selectCompany.oversea;
$scope.editOrgExtraModel.unifiedSocialCreditCode = $scope.selectCompany.taxPayerNumber;
//加载用户权限list
loadUserRoleList(org.id);
......
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