Commit d9a1e4b7 authored by eddie.woo's avatar eddie.woo

Merge remote-tracking branch 'origin/dev_mysql' into uat_didi

parents 88badbbd 2d9565ed
......@@ -115,8 +115,9 @@ public class TaxDocumentController {
*/
@PostMapping("/previewPDF")
@ResponseBody
public String previewPDF(HttpServletResponse response ,@RequestBody TaxDocumentDto taxDocumentDto) {
return taxDocumentService.previewPDF2(response,taxDocumentDto.getPath());
public void previewPDF(HttpServletResponse response ,@RequestBody TaxDocumentDto taxDocumentDto) {
// return taxDocumentService.previewPDF2(response,taxDocumentDto.getPath());
taxDocumentService.previewPDF(response,taxDocumentDto.getPath());
/*InputStream is = null;
ByteArrayOutputStream os = null;
try {
......
......@@ -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());
......
......@@ -83,7 +83,7 @@ public class FileTypesServiceImpl {
}
} catch (Exception e) {
log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
return false;
throw new RuntimeException("添加档案类型异常!请联系管理员! : " + e.getMessage());
}
}
......
......@@ -311,6 +311,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) {
......@@ -351,9 +360,7 @@ public class TaxDocumentServiceImpl {
}
/**
* 根据档案属性 档案类型 公司名称 档案名称 查询是否已存在数据
* 不存在则返回 true
* 已存在则返回 false
* 根据档案属性 档案类型 公司名称 查询是否已存在数据
*
* @param taxDocument
* @return
......@@ -379,10 +386,6 @@ public class TaxDocumentServiceImpl {
if (null != taxDocument.getOwnTime()) {
criteria.andOwnTimeEqualTo(taxDocument.getOwnTime());
}
//档案名称 fileName
if (StringUtils.isNotBlank(taxDocument.getFileName())) {
criteria.andFileNameEqualTo(taxDocument.getFileName());
}
//业务线 businessLine
if (StringUtils.isNotBlank(taxDocument.getBusinessLine())) {
criteria.andBusinessLineEqualTo(taxDocument.getBusinessLine());
......@@ -417,7 +420,7 @@ public class TaxDocumentServiceImpl {
}
//创建人 creator
if (StringUtils.isNotBlank(taxDocument.getCreator())) {
criteria.andCreatorEqualTo(taxDocument.getCreator());
criteria.andCreatorEqualTo( taxDocument.getCreator());
}
//设置查询可用的数据
criteria.andEnableEqualTo("T");
......@@ -438,8 +441,10 @@ public class TaxDocumentServiceImpl {
try {
sos = response.getOutputStream();
PDFToImg(sos, path, getPDFNum(path), imageType);
} catch (IOException e) {
sos.flush();
} catch (Exception e) {
log.error("PDF转换图片异常: " + e.getMessage());
throw new RuntimeException("PDF转换异常");
} finally {
try {
sos.close();
......@@ -1162,7 +1167,7 @@ public class TaxDocumentServiceImpl {
* @throws IOException
* imgType:转换后的图片类型 jpg,png
*/
private void PDFToImg(OutputStream sos,String fileUrl,int page,String imgType) throws IOException {
private void PDFToImg(OutputStream sos,String fileUrl,int page,String imgType) throws Exception {
PDDocument pdDocument = null;
/* dpi越大转换后越清晰,相对转换速度越慢 */
int dpi = 100;
......@@ -1171,12 +1176,13 @@ public class TaxDocumentServiceImpl {
PDFRenderer renderer = new PDFRenderer(pdDocument);
int pages = pdDocument.getNumberOfPages();
if (page <= pages && page > 0) {
BufferedImage image = renderer.renderImageWithDPI(page,dpi);
BufferedImage image = renderer.renderImageWithDPI(page-1,dpi);
ImageIO.write(image, imgType, sos);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(),e);
throw new RuntimeException("PDF转换异常");
} finally {
if (pdDocument != null) {
pdDocument.close();
......
......@@ -6,13 +6,10 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.grapecity.documents.excel.V;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
......@@ -59,7 +56,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
......@@ -335,7 +331,11 @@ public class ReportServiceImpl extends BaseService {
TrialBalanceFinalExample example = new TrialBalanceFinalExample();
example.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(Integer.valueOf(queryPeriod));
trialBalanceFinalMapper.deleteByExample(example);
trialBalanceFinalMapper.generateFinalData(projectId, Integer.valueOf(queryPeriod), lastProject == null ? "0" : lastProject.getId(), Integer.valueOf(lastPeriod));
List<TrialBalanceFinal> dataList = trialBalanceFinalMapper.queryGenerateFinalData(projectId, Integer.valueOf(queryPeriod), lastProject == null ? "0" : lastProject.getId(), Integer.valueOf(lastPeriod));
if (!CollectionUtils.isEmpty(dataList)) {
List<List<TrialBalanceFinal>> batchList = CommonUtils.subListWithLen(dataList, CommonUtils.BATCH_NUM_2000);
batchList.forEach(l -> trialBalanceFinalMapper.batchInsert(l));
}
}
public void assembleInvoiceRecord(String projectId, Integer period, Boolean isMergeManualData) {
......
......@@ -257,7 +257,11 @@ public class FunctionBase {
else {return new BigDecimal(0);}
}
}else{
}else if (evalStr.indexOf("${KeyIn}")>0){
if (!dss.isEmpty()) return dss.get(0).getAmount();
return new BigDecimal(0);
}
else{
try {
BigDecimal bigDecimal = new BigDecimal(evalStr);
if (!dss.isEmpty()) {
......
......@@ -48,7 +48,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
return null;
}
int certificationPeriod = getIntParam(args[0], ec);
int certificationPeriod = getIntParam(args[0], ec);//暂时不做筛选条件
int invoiceTypeParam = getIntParam(args[1], ec);
int authenticationType = getIntParam(args[2], ec);
int resultType = getIntParam(args[3], ec);
......@@ -104,32 +104,32 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
return NumberEval.ZERO;
}
if (certificationPeriod != -99 && certificationPeriod != 99
&& (certificationPeriod < 1 || certificationPeriod > 12)) {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO;
} else if (!formulaContext.getIsYear()) {
if (certificationPeriod == -99) {
calendar.set(formulaContext.getYear(), formulaContext.getPeriod(), 1);
endDate = calendar.getTime();
Date finalEndDate = endDate;
inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertifiedDate().before(finalEndDate))
.collect(Collectors.toList());
} else if (certificationPeriod != 99) {
calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1);
startDate = calendar.getTime();
calendar.set(formulaContext.getYear(), certificationPeriod, 1);
// calendar.add(Calendar.MONTH, 1);
endDate = calendar.getTime();
Date finalEndDate1 = endDate;
Date finalStartDate = startDate;
inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertifiedDate().after(finalStartDate)
&& a.getCertifiedDate().before(finalEndDate1))
.collect(Collectors.toList());
}
}
// if (certificationPeriod != -99 && certificationPeriod != 99
// && (certificationPeriod < 1 || certificationPeriod > 12)) {
// saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
// return NumberEval.ZERO;
// } else if (!formulaContext.getIsYear()) {
// if (certificationPeriod == -99) {
// calendar.set(formulaContext.getYear(), formulaContext.getPeriod(), 1);
// endDate = calendar.getTime();
// Date finalEndDate = endDate;
// inputInvoices = inputInvoices.stream()
// .filter(a -> a.getCertifiedDate().before(finalEndDate))
// .collect(Collectors.toList());
// } else if (certificationPeriod != 99) {
// calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1);
// startDate = calendar.getTime();
// calendar.set(formulaContext.getYear(), certificationPeriod, 1);
//// calendar.add(Calendar.MONTH, 1);
// endDate = calendar.getTime();
// Date finalEndDate1 = endDate;
// Date finalStartDate = startDate;
// inputInvoices = inputInvoices.stream()
// .filter(a -> a.getCertifiedDate().after(finalStartDate)
// && a.getCertifiedDate().before(finalEndDate1))
// .collect(Collectors.toList());
// }
// }
List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (CertifiedInvoicesList x : inputInvoices) {
......@@ -198,7 +198,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
public List<CertifiedInvoicesList> getInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
CertifiedInvoicesListExample example = new CertifiedInvoicesListExample();
CertifiedInvoicesListExample.Criteria criteria = example.createCriteria();
criteria.andProjectIdEqualTo(formulaContext.getProjectId());
if (period != null) {
criteria.andPeriodEqualTo(Integer.valueOf(formulaContext.getYear() + (period > 9 ? period.toString() : "0" + period.toString())));
}
......
......@@ -60,16 +60,13 @@ public class ZC extends FunctionBase implements FreeRefFunction {
BigDecimal totalData = new BigDecimal("0");
try {
List<CitAssetDetailResultDto> assetDetailResultDtos =
SpringContextUtil.assetsListMapper.getCitAssetDetialResult(assetType, assetDetailType);
SpringContextUtil.assetsListMapper.getCitAssetDetialResult(assetType, assetDetailType,formulaContext.getProjectId());
if(assetDetailResultDtos != null&&assetDetailResultDtos.size()>0){
System.out.println(assetDetailResultDtos.size());
}
for (CitAssetDetailResultDto x : assetDetailResultDtos) {
AssetDetailDataSourceDto assetDetailDataSourceDto = new AssetDetailDataSourceDto();
assetDetailDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
assetDetailDataSourceDto.setAssetNumber(x.getAssetsList().getAssetGroupName());
assetDetailDataSourceDto.setAssetGroupName(x.getAssetDetailGroup().getDetailGroupName());
assetDetailDataSourceDto.setAssetDetailGroupName(x.getAssetDetailGroup().getDetailGroupName());
assetDetailDataSourceDto.setAccountAcquisitionValue(FormulaHelper.roundValue(x.getAssetsList().getAccountAcquisitionValue(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setAccountMonthDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getAccountMonthDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setAccountYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getYearDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
......@@ -80,19 +77,16 @@ if(assetDetailResultDtos != null&&assetDetailResultDtos.size()>0){
assetDetailDataSourceDto.setTaxCurrentYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxCurrentYearDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setTotalDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getTotalDifferenceAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setYearDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getYearDifferenceAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setDepreciationPeriod(x.getAssetsList().getDepreciationPeriod());
assetDetailDataSourceDto.setTaxDepreciationPeriod(x.getAssetsList().getTaxDepreciationPeriod());
assetDetailDataSourceDto.setIsRetain(x.getAssetsList().getIsRetain()==0?false:true);
assetDetailDataSourceDto.setDataType(dataType);
assetDetailDataSourceDto.setName(Constant.DataSourceName.AssetListDataSource);
assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
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:
......
......@@ -120,7 +120,8 @@ public interface CitAssetsListMapper extends MyMapper {
List<CitAssetEamMapping> getAssetEamMapping(CitAssetsList citAsset);
List<CitAssetDetailResultDto> getCitAssetDetialResult(@Param("assetType") Integer assetType,
@Param("assetDetailType") Integer assetDetailType);
@Param("assetDetailType") Integer assetDetailType,
@Param("projectId") String projectId);
CitAssetSumDataDto getSumData(@Param("projectId") String projectId);
}
\ No newline at end of file
......@@ -122,8 +122,10 @@ public interface TrialBalanceFinalMapper extends MyVatMapper {
@Param("period") Integer period,
@Param("queryDate") String queryDate);
int generateFinalData(@Param("projectId") String projectId,
List<TrialBalanceFinal> queryGenerateFinalData(@Param("projectId") String projectId,
@Param("period") Integer period,
@Param("lastProjectId") String lastProjectId,
@Param("lastPeriod") Integer lastPeriod);
int batchInsert(List<TrialBalanceFinal> list);
}
\ No newline at end of file
......@@ -281,49 +281,17 @@
<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_acquisition_value) as account_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
......@@ -331,8 +299,7 @@
ON
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
assets_list.asset_detail_group_id IS NOT NULL and project_id=#{projectId,jdbcType=VARCHAR}
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}
......
......@@ -74,10 +74,9 @@
order by detail.emptyCode
</select>
<insert id="generateFinalData" >
insert
into trial_balance_final
select balance.id,
<select id="queryGenerateFinalData" resultMap="BaseResultMap">
select
balance.id,
balance.organization_id,
balance.project_id,
balance.date,
......@@ -124,11 +123,11 @@ select balance.id,
balance.ytd_cr,
balance.beg_bal_beq,
balance.period_dr_beq + if(adjustment.period_dr_beq is null, 0, adjustment.period_dr_beq) -
if(last_adjustment.period_dr_beq is null, 0, last_adjustment.period_dr_beq),
if(last_adjustment.period_dr_beq is null, 0, last_adjustment.period_dr_beq) as period_dr_beq,
balance.period_cr_beq + if(adjustment.period_cr_beq is null, 0, adjustment.period_cr_beq) -
if(last_adjustment.period_cr_beq is null, 0, last_adjustment.period_cr_beq),
if(last_adjustment.period_cr_beq is null, 0, last_adjustment.period_cr_beq) as period_cr_beq,
balance.end_bal_beq + if(adjustment.end_bal_beq is null, 0, adjustment.end_bal_beq) -
if(last_adjustment.end_bal_beq is null, 0, last_adjustment.end_bal_beq),
if(last_adjustment.end_bal_beq is null, 0, last_adjustment.end_bal_beq) as end_bal_beq,
balance.qtd_dr_beq,
balance.qtd_cr_beq,
balance.ytd_dr_beq,
......@@ -194,5 +193,87 @@ where balance.project_id = #{projectId}
</insert>
</select>
<insert id="batchInsert">
insert into trial_balance_final
(id, organization_id, project_id,
`date`, `source`, tms_period,
period, ledger_id, ledger_name,
currency_code, `status`, category,
account_category, acct_code1, acct_name1,
acct_name2, acct_name3, segment1,
segment2, segment3, segment4,
segment5, segment6, segment7,
segment8, segment9, segment10,
segment1_name, segment2_name, segment3_name,
segment4_name, segment5_name, segment6_name,
segment7_name, segment8_name, segment9_name,
segment10_name, beg_bal, period_dr,
period_cr, end_bal, qtd_dr,
qtd_cr, ytd_dr, ytd_cr,
beg_bal_beq, period_dr_beq, period_cr_beq,
end_bal_beq, qtd_dr_beq, qtd_cr_beq,
ytd_dr_beq, ytd_cr_beq, create_time,
update_time)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id,jdbcType=BIGINT},
#{item.organizationId,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR},
#{item.date,jdbcType=TIMESTAMP},
#{item.source,jdbcType=VARCHAR},
#{item.tmsPeriod,jdbcType=INTEGER},
#{item.period,jdbcType=INTEGER},
#{item.ledgerId,jdbcType=VARCHAR},
#{item.ledgerName,jdbcType=VARCHAR},
#{item.currencyCode,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
#{item.category,jdbcType=VARCHAR},
#{item.accountCategory,jdbcType=VARCHAR},
#{item.acctCode1,jdbcType=VARCHAR},
#{item.acctName1,jdbcType=VARCHAR},
#{item.acctName2,jdbcType=VARCHAR},
#{item.acctName3,jdbcType=VARCHAR},
#{item.segment1,jdbcType=VARCHAR},
#{item.segment2,jdbcType=VARCHAR},
#{item.segment3,jdbcType=VARCHAR},
#{item.segment4,jdbcType=VARCHAR},
#{item.segment5,jdbcType=VARCHAR},
#{item.segment6,jdbcType=VARCHAR},
#{item.segment7,jdbcType=VARCHAR},
#{item.segment8,jdbcType=VARCHAR},
#{item.segment9,jdbcType=VARCHAR},
#{item.segment10,jdbcType=VARCHAR},
#{item.segment1Name,jdbcType=VARCHAR},
#{item.segment2Name,jdbcType=VARCHAR},
#{item.segment3Name,jdbcType=VARCHAR},
#{item.segment4Name,jdbcType=VARCHAR},
#{item.segment5Name,jdbcType=VARCHAR},
#{item.segment6Name,jdbcType=VARCHAR},
#{item.segment7Name,jdbcType=VARCHAR},
#{item.segment8Name,jdbcType=VARCHAR},
#{item.segment9Name,jdbcType=VARCHAR},
#{item.segment10Name,jdbcType=VARCHAR},
#{item.begBal,jdbcType=DECIMAL},
#{item.periodDr,jdbcType=DECIMAL},
#{item.periodCr,jdbcType=DECIMAL},
#{item.endBal,jdbcType=DECIMAL},
#{item.qtdDr,jdbcType=DECIMAL},
#{item.qtdCr,jdbcType=DECIMAL},
#{item.ytdDr,jdbcType=DECIMAL},
#{item.ytdCr,jdbcType=DECIMAL},
#{item.begBalBeq,jdbcType=DECIMAL},
#{item.periodDrBeq,jdbcType=DECIMAL},
#{item.periodCrBeq,jdbcType=DECIMAL},
#{item.endBalBeq,jdbcType=DECIMAL},
#{item.qtdDrBeq,jdbcType=DECIMAL},
#{item.qtdCrBeq,jdbcType=DECIMAL},
#{item.ytdDrBeq,jdbcType=DECIMAL},
#{item.ytdCrBeq,jdbcType=DECIMAL},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -2444,6 +2444,7 @@
$scope.selectCompany.orgAttributeRowList = orgAttributeRowList;
$scope.isInternational = $scope.selectCompany.oversea;
$scope.editOrgExtraModel.unifiedSocialCreditCode = $scope.selectCompany.taxPayerNumber;
//加载用户权限list
loadUserRoleList(org.id);
......
......@@ -122,8 +122,9 @@ taxDocumentManageModule.controller('taxDocumentListController',
allowColumnReordering: true,
columns: [
{
dataField: "id",
dataField: "",
caption: "",
width: 40,
cellTemplate: function (container, options) {
var target = $('<input name="dataGridCheckBox" type="checkbox" ' +
'data-id="' + options.data.id + '" ' +
......@@ -132,8 +133,24 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.sniffCheckbox();
});
container.append(target);
if($("input[name='dataGridCheckBoxALL']").length==0){
var func = function () {
var targetall = $('<input name="dataGridCheckBoxALL" type="checkbox" data-id=""data-url=""/>');
targetall.off('click').on('click', function () {
$scope.sniffCheckboxAll();
});
$("tr td:first[role='columnheader']").append(targetall);
func= function(){};
};
func();
}
}
},
{
dataField: "id",
caption: "",
visible: false
},
{
dataField: "fileAttr",
caption: $translate.instant('DocumentAttr'),
......@@ -2121,7 +2138,19 @@ taxDocumentManageModule.directive('tempModule', function () {
});
console.info($scope.checkedItemIds.join(","));
};
$scope.sniffCheckboxAll=function(){
$("input[name='dataGridCheckBoxALL']").each(function (index, item) {
if(item.checked){
$("input[name='dataGridCheckBox']").each(function (index, item) {
item.checked=true;
});
}else{
$("input[name='dataGridCheckBox']").each(function (index, item) {
item.checked=false;
});
}
});
};
$scope.getMonthLastDate = function (year, month) {
year = year ? year : new Date().getFullYear();
month = month ? month : (new Date().getMonth() + 1);
......
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