Commit 782e07a0 authored by kevin's avatar kevin

# fix

parent 52ffcc3c
......@@ -24,6 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.locks.ReentrantLock;
@RestController
@RequestMapping(value = "api/v1/CellComment")
......@@ -104,10 +105,11 @@ public class CellCommentController {
}
@RequestMapping("selectEntryLog")
public OperationResultDto selectEntryLog(String code) {
public OperationResultDto selectEntryLog(String code, Long id ) {
OperationResultDto operationResultDto = new OperationResultDto();
OperationLogEntryLogExample operationLogEntryLogExample = new OperationLogEntryLogExample();
OperationLogEntryLogExample.Criteria criteria = operationLogEntryLogExample.createCriteria();
criteria.andIdEqualTo(id);
criteria.andSubjectCodeEqualTo(code);
operationResultDto.setData(operationLogEntryLogMapper.selectByExample(operationLogEntryLogExample));
return operationResultDto;
......@@ -118,6 +120,8 @@ public class CellCommentController {
*/
@RequestMapping("addLog")
public OperationResultDto addLog(@RequestBody List<OperationLogEntryLog> operationLogEntryLogs) {
for (OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs) {
operationLogEntryLog.setMyId(distributedIdService.nextId());
operationLogEntryLogMapper.insert(operationLogEntryLog);
......
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -12,7 +13,9 @@ 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.vatdto.ManualDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.PeriodJobDto;
import pwc.taxtech.atms.dto.vatdto.ReportDataDto;
import pwc.taxtech.atms.service.impl.CitReportServiceImpl;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
......@@ -34,7 +37,7 @@ public class CitReportController {
private static Logger logger = LoggerFactory.getLogger(CitReportController.class);
@Autowired
ReportServiceImpl reportService;
CitReportServiceImpl reportService;
@Autowired
CitReportServiceImpl citReportService;
......@@ -134,6 +137,23 @@ public class CitReportController {
}
}
@RequestMapping(value = "reportData/{reportId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDataDto> getReportData(@PathVariable Long reportId, @RequestHeader String from) {
OperationResultDto resultDto = new OperationResultDto();
if (reportId == null || reportId == 0L) {
resultDto.setResult(false);
return resultDto;
}
return reportService.getCellData(reportId, from);
}
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity addCellManualDataSource(@RequestBody ManualDataSourceDto data, @RequestHeader String from) {
String projectId = StringUtils.EMPTY;
if (StringUtils.isNotBlank(from) && from.split("@").length > 0) {
projectId = from.split("@")[0];
}
return ResponseEntity.ok(reportService.addCellManualDataSource(data, from));
}
}
\ No newline at end of file
......@@ -42,12 +42,14 @@ import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.ReportGeneratorImpl;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.locks.LockSupport;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
......@@ -64,59 +66,82 @@ public class CitReportServiceImpl extends BaseService {
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR", "WPNAME", "WPTYPE", "SUM2", "RSUMIF", "QMYE", "ZC"};
@Autowired
private OrganizationServiceTemplateGroupMapper orgServiceTemplateGroupMapper;
@Autowired
private ProjectMapper projectMapper;
@Autowired
private TemplateMapper templateMapper;
@Autowired
private PeriodJobMapper periodJobMapper;
@Autowired
private PeriodApproveMapper periodApprovalMapper;
@Autowired
private PeriodFormulaBlockMapper periodFormulaBlockMapper;
@Autowired
private PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper;
@Autowired
private PeriodCellTemplateMapper periodCellTemplateMapper;
@Autowired
private PeriodTemplateMapper periodTemplateMapper;
@Autowired
private ReportGeneratorImpl reportGenerator;
@Resource
private PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
@Autowired
@Resource
private PeriodTaxPayerReportRuleMapper periodTaxPayerReportRuleMapper;
@Resource
private PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
@Autowired
private PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
@Autowired
private PeriodDataSourceMapper periodDataSourceMapper;
@Autowired
private PeriodCellDataMapper periodCellDataMapper;
private InputVatInvoiceMapper inputVATInvoiceMapper;
@Autowired
private OutputVatInvoiceMapper outputVATInvoiceMapper;
@Resource
private CustomsInvoiceMapper customsInvoiceMapper;
@Resource
private PeriodCellDataSourceMapper periodCellDataSourceMapper;
@Autowired
@Resource
private KeyValueConfigMapper keyValueConfigMapper;
@Autowired
@Resource
private PeriodModifiedReportCellMapper periodModifiedReportCellMapper;
@Resource
private PeriodReportMapper periodReportMapper;
@Autowired
private DistributedIdService distributedIdService;
@Autowired
@Resource
private EnterpriseAccountMapper enterpriseAccountMapper;
@Resource
private CellTemplateConfigMapper cellTemplateConfigMapper;
@Autowired
@Resource
private CellTemplateMapper cellTemplateMapper;
@Resource
private PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
@Resource
private PeriodDataSourceMapper periodDataSourceMapper;
@Resource
private PeriodCellDataMapper periodCellDataMapper;
@Resource
private PeriodFormulaBlockMapper periodFormulaBlockMapper;
@Resource
private PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper;
@Resource
private PeriodCellTemplateMapper periodCellTemplateMapper;
@Resource
private PeriodTemplateMapper periodTemplateMapper;
@Resource
private TemplateMapper templateMapper;
@Resource
private ProjectServiceTypeMapper projectServiceTypeMapper;
@Resource
private TaxPayerReportRuleMapper taxPayerReportRuleMapper;
@Resource
private ProjectMapper projectMapper;
@Resource
private DistributedIdService distributedIdService;
@Resource
private PeriodJobMapper periodJobMapper;
@Resource
private PeriodApproveMapper periodApprovalMapper;
@Resource
RevenueConfigMapper revenueConfigMapper;
@Autowired
private EnterpriseAccountMapper enterpriseAccountMapper;
@Autowired
private ReportGeneratorImpl reportGenerator;
private HttpFileService httpFileService;
@Autowired
DidiFileUploadService didiFileUploadService;
@Resource
private TrialBalanceMapper trialBalanceMapper;
@Resource
private AdjustmentTableMapper adjustmentTableMapper;
@Autowired
@Resource
private ProfitLossStatementMapper profitLossStatementMapper;
@Resource
private JournalEntryMapper journalEntryMapper;
@Autowired
private DataValidateLogMapper dataValidateLogMapper;
@Autowired
private DataUtil dataUtil;
@Autowired
private CitAssetsListMapper assetsListMapper;
private OrganizationServiceTemplateGroupMapper orgServiceTemplateGroupMapper;
public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) {
OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>();
......@@ -354,6 +379,8 @@ public class CitReportServiceImpl extends BaseService {
dataValidateLogMapper.insert(dataValidateLog);
}
@Resource
private DataValidateLogMapper dataValidateLogMapper;
/**
* 清除配置,复制配置
*
......@@ -707,6 +734,8 @@ public class CitReportServiceImpl extends BaseService {
return result;
}
@Autowired
private CitAssetsListMapper assetsListMapper;
/**
* 获取固定资产及EAM Mapping的数据
*/
......@@ -777,4 +806,503 @@ public class CitReportServiceImpl extends BaseService {
}
return citAssetsListDtos;
}
public OperationResultDto<ReportDataDto> getCellData(Long reportId, String projectId) {
OperationResultDto resultDto = new OperationResultDto();
ReportDataDto dataDto = new ReportDataDto();
try {
PeriodReport report = periodReportMapper.selectByPrimaryKey(reportId);
if (report == null) {
resultDto.setResult(false);
resultDto.setResultMsg("NoReport");
return resultDto;
}
PeriodTemplateExample example = new PeriodTemplateExample();
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(report.getTemplateId()).andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> reportTemplate = periodTemplateMapper.selectByExample(example).stream().findFirst();
if (!reportTemplate.isPresent()) {
resultDto.setResult(false);
resultDto.setResultMsg("NoReportTemplate");
return resultDto;
}
Project project = projectMapper.selectByPrimaryKey(report.getProjectId());
if (project == null) {
resultDto.setResult(false);
resultDto.setResultMsg("NoProject");
return resultDto;
}
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria()
.andProjectIdEqualTo(projectId)
.andTemplateGroupIdEqualTo(reportTemplate.get().getTemplateGroupId())
.andPeriodEqualTo(report.getPeriod())
.andIsActiveAssociationEqualTo(true);
List<Long> templateIds = new ArrayList<>();
templateIds.add(report.getTemplateId());
List<CellCalcInfoDto> cellCfgList = reportGenerator.getCellCalcInfo(templateIds, report.getPeriod(), project.getId());
PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); //这是取的是单元格中显示的值
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.andReportIdEqualTo(reportId);
/* Map<String, Object> map = new HashMap<>();
map.put("projectId", projectId);
map.put("period", report.getPeriod());
map.put("reportId", reportId);
*/
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks);
//todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源
//todo: 模型数据源稍后再加
// 获取通过ModelBackFillAmount关联的数据源,即模型数据源
// TODO: Check模型回填数据源是否会有多对多的情况出现,如有需distinct
//公式计算数据源 20180711 完成
List<DataSourceExtendDto> manualDataSourceList = periodDataSourceMapper.getFormulaDataSource(reportId);
//loop the datasource to add datasource detail information
for (DataSourceExtendDto dseo : manualDataSourceList) {
//只处理有明细数据的DataSource
if (dseo.getType().equals(FormulaDataSourceType.InputInvoice.getCode())
|| dseo.getType().equals(FormulaDataSourceType.OutputInvoice.getCode())
|| dseo.getType().equals(FormulaDataSourceType.Voucher.getCode())) {
//todo: add json datasource detail @ here. not only itemValue
List<String> itemValues = new ArrayList<>();
itemValues.add(getDataSourceDetailList(dseo.getId()).getData());
dseo.setItems(itemValues);
} else if (dseo.getType().equals(FormulaDataSourceType.Report.getCode())) {
List<String> itemValues = new ArrayList<>();
//todo: get the datasource detail to add the items property
PeriodDataSourceDetailExample dataSourceDetailExample = new PeriodDataSourceDetailExample();
dataSourceDetailExample.createCriteria().andDataSourceIdEqualTo(dseo.getId());
List<PeriodDataSourceDetail> dataSourceDetailList = SpringContextUtil.periodDataSourceDetailMapper.selectByExample(dataSourceDetailExample);
dataSourceDetailList.forEach(a -> {
if (StringUtils.isNotBlank(a.getItemValue())) {
itemValues.add(a.getItemValue());
}
});
if (dataSourceDetailList.size() > 0 && dataSourceDetailList.get(0).getDataSourceType() != 6) {
dseo.setDataSourceType(convertType(dataSourceDetailList.get(0).getDataSourceType()));
}
dseo.setItems(itemValues);
}
}
List<DataSourceDtoExtend> datasource = new ArrayList<>();
manualDataSourceList.forEach(a -> {
DataSourceDto dataSourceDto = new DataSourceDto();
dataSourceDto.setId(a.getId().toString());
dataSourceDto.setAmount(a.getAmount());
dataSourceDto.setKeyinData(a.getKeyinData());
dataSourceDto.setName(a.getName());
dataSourceDto.setOperationType(a.getOperationType());
dataSourceDto.setDescription(a.getDescription());
dataSourceDto.setCreateTime(a.getCreateTime());
if (a.getDataSourceType() != null && a.getDataSourceType() > 0) {
dataSourceDto.setType(convetToFType(a.getDataSourceType()));
} else {
dataSourceDto.setType(a.getType());
}
dataSourceDto.setItems(a.getItems());
dataSourceDto.setPeriod(a.getPeriod());
dataSourceDto.setRowIndex(a.getRowIndex());
dataSourceDto.setRowName(a.getRowName());
dataSourceDto.setColumnIndex(a.getColumnIndex());
dataSourceDto.setColumnName(a.getColumnName());
dataSourceDto.setReportTemplateId(a.getReportTemplateId().toString());
dataSourceDto.setRel_sql(a.getRelSql());
if (a.getType().equals(FormulaDataSourceType.Report.getCode())) {
if (a.getItems().size() == 0) {
dataSourceDto.setDataSourceType(CellDataSourceType.Formula.getCode());
} else {
dataSourceDto.setDataSourceType(a.getDataSourceType());
}
} else if (a.getType().equals(FormulaDataSourceType.KeyInSource.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.KeyIn.getCode());
} else if (a.getType().equals(FormulaDataSourceType.InputInvoice.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode());
} else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode());
} else if (a.getType().equals(FormulaDataSourceType.OutputInvoice.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.OutputInvoice.getCode());
} else {
dataSourceDto.setDataSourceType(0);
}
DataSourceDtoExtend dataSourceDtoExtend = new DataSourceDtoExtend();
dataSourceDtoExtend.setItem1(a.getCellTemplateId().toString());
dataSourceDtoExtend.setItem2(dataSourceDto);
datasource.add(dataSourceDtoExtend);
});
dataDto.setManualDataSources(datasource);
List<CellDataDto> cellDataDtoList = new ArrayList<>();
cellCfgList.forEach(a -> {
CellDataDto cellDataDto = new CellDataDto();
cellDataDto.setColumnIndex(a.getColumnIndex());
cellDataDto.setColumnName(a.getColumnName());
cellDataDto.setRowIndex(a.getRowIndex());
cellDataDto.setRowName(a.getRowName());
cellDataDto.setCellTemplateId(a.getCellTemplateId().toString());
cellDataDto.setReportTemplateId(a.getReportTemplateId().toString());
cellDataDto.setDataType(a.getDataType());
cellDataDto.setReportId(reportId.toString());
cellDataDto.setIsReadOnly(a.getIsReadOnly());
Optional<PeriodCellData> celldata = currentCellDataList.stream()
.filter(x -> x.getCellTemplateId().toString().equals(a.getCellTemplateId())).findFirst();
celldata.ifPresent(cellData -> cellDataDto.setCellId(cellData.getId().toString()));
cellDataDto.setFormula(a.getFormula());
celldata.ifPresent(cellData -> cellDataDto.setCellValue(cellData.getData()));
celldata.ifPresent(cellData -> cellDataDto.setKeyinData(cellData.getKeyinData()));
celldata.ifPresent(cellData -> cellDataDto.setFormulaExp(cellData.getFormulaExp()));
cellDataDto.setCellTemplateConfig(CellConfigTranslater.getConfigDto(a));
List<DataSourceDtoExtend> entryList = datasource.stream()
.filter(y -> y.getItem1().equals(a.getCellTemplateId())).collect(Collectors.toList());
List<DataSourceDto> dataSourceDtoList = new ArrayList<>();
entryList.forEach(z -> {
if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) {
z.getItem2().getItems().forEach(m -> {
ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class);
if (dto != null && dto.getReportTemplateId() != null && !Pattern.compile("\\D").matcher(dto.getReportTemplateId()).find()) {
PeriodTemplateExample periodTemplateExample1 = new PeriodTemplateExample();
periodTemplateExample1.createCriteria().andTemplateIdEqualTo(Long.parseLong(dto.getReportTemplateId()))
.andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> optional = periodTemplateMapper.selectByExample(periodTemplateExample1).stream().findFirst();
if (optional.isPresent()) {
dto.setReportName(optional.get().getName());
}
}
dataSourceDtoList.add(dto);
});
} else
dataSourceDtoList.add(z.getItem2());
});
cellDataDto.setDataSourceList(dataSourceDtoList);
cellDataDtoList.add(cellDataDto);
});
PeriodModifiedReportCellExample modifiedReportCellExample = new PeriodModifiedReportCellExample();
modifiedReportCellExample.createCriteria().andReportIdEqualTo(reportId);
List<PeriodModifiedReportCell> modifiedReportCellList = periodModifiedReportCellMapper.selectByExample(modifiedReportCellExample);
modifiedReportCellList.forEach(mrc -> {
Optional<CellDataDto> cdd = cellDataDtoList.stream()
.filter(cellDataDto -> cellDataDto.getReportId().equals(mrc.getReportId())
&& cellDataDto.getRowIndex() == mrc.getRow()
&& cellDataDto.getColumnIndex() == mrc.getCol()).findFirst();
if (cdd.isPresent()) {
if (!mrc.getOriginalValue().equals(mrc.getValue())) {
cdd.get().setModifiedReportCell(mrc);
cdd.get().setCellValue(mrc.getValue());
cdd.get().setIsModified(true);
}
}
});
dataDto.setCellData(cellDataDtoList);
resultDto.setData(dataDto);
resultDto.setResult(true);
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
resultDto.setResult(false);
}
return resultDto;
}
private Integer convertType(Integer dataSourceType) {
if (dataSourceType.equals(FormulaDataSourceDetailType.InputInvoiceDataSourceDto.getCode())) {
return CellDataSourceType.InputInvoice.getCode();
} else if (dataSourceType.equals(FormulaDataSourceDetailType.OutputInvoiceDataSourceDto.getCode())) {
return CellDataSourceType.OutputInvoice.getCode();
} else {
return CellDataSourceType.Formula.getCode();
}
}
public OperationResultDto<String> getDataSourceDetailList(Long datasSourceId) {
OperationResultDto<String> operationResultDto = new OperationResultDto<>();
PeriodDataSource dataSource = periodDataSourceMapper.selectByPrimaryKey(datasSourceId);
String itemStrValue = StringUtils.EMPTY;
if (dataSource.getType().equals(FormulaDataSourceType.InputInvoice.getCode())) {
PeriodDataSourceDetailExample dataSourceDetailExample = new PeriodDataSourceDetailExample();
dataSourceDetailExample.createCriteria().andDataSourceIdEqualTo(datasSourceId).andDataSourceTypeEqualTo(CellDataSourceType.InputInvoice.getCode());
List<PeriodDataSourceDetail> dataSourceDetails = periodDataSourceDetailMapper.selectByExample(dataSourceDetailExample);
List<InputVATInvoiceItemExtendDto> inputVATInvoiceItemExtendDtos = new ArrayList<>();
for (PeriodDataSourceDetail dataSourceDetail : dataSourceDetails) {
if (StringUtils.isNotBlank(dataSourceDetail.getItemValue())) {
InputVATInvoiceItemExtendDto inputVATInvoiceItemExtendDto = inputVATInvoiceMapper.selectInvoiceExtendDto(dataSourceDetail.getItemValue());
inputVATInvoiceItemExtendDtos.add(inputVATInvoiceItemExtendDto);
}
}
itemStrValue = JSON.toJSONString(inputVATInvoiceItemExtendDtos);
} else {
itemStrValue = StringUtils.EMPTY;
}
operationResultDto.setData(itemStrValue);
operationResultDto.setResult(true);
return operationResultDto;
}
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) {
OperationResultDto operationResultDto = new OperationResultDto();
try {
if (data.getCellId() == null) {
//todo: insert celldata for manual datasource
PeriodCellData cellData = new PeriodCellData();
cellData.setId(distributedIdService.nextId());
cellData.setReportId(data.getReportId());
cellData.setCellTemplateId(Long.parseLong(data.getCellTemplateId()));
cellData.setData(data.getAmount() == null ? null : data.getAmount().toString());
cellData.setKeyinData(data.getKeyinData());
cellData.setFormulaExp(data.getAmount() == null ? "0.0" : data.getAmount().toString());
cellData.setCreateBy("admin");
cellData.setCreateTime(new Date());
cellData.setUpdateBy("admin");
cellData.setUpdateTime(new Date());
cellData.setProjectId(projectId);
cellData.setPeriod(data.getPeriod());
periodCellDataMapper.insertSelective(cellData);
data.setCellId(cellData.getId());
} else {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId());
/*if (StringUtils.isNotBlank(data.getKeyinData())) {
cellData.setKeyinData(data.getKeyinData());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getKeyinData());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/ /*else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
cellData.setData(data.getAmount().toString());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*//* else if (StringUtils.isNotBlank(data.getPenValue())) {//穿透调整数据
cellData.setData(data.getPenValue());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/
boolean boo1 = StringUtils.isNotBlank(data.getPenValue());//穿透合并值
boolean boo2 = StringUtils.isNotBlank(data.getKeyinData());//手工输入
String sumValue = null;
if (boo1 && boo2) {
sumValue = String.valueOf((Double.parseDouble(data.getPenValue()) + Double.parseDouble(data.getKeyinData())));
} else if (boo1 && !boo2) {
sumValue = String.valueOf((Double.parseDouble(data.getPenValue())));
} else if (!boo1 && boo2) {
sumValue = String.valueOf((Double.parseDouble(data.getKeyinData())));
}
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
cellData.setData(sumValue);
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
/*kevin insert */ // TODO: 3/21/2019 需要验证
PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
criteria.andProjectIdEqualTo(data.getProjectId());
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setParsedFormula(sumValue);
periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
}
List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()))
.andPeriodEqualTo(data.getPeriod()).andProjectIdEqualTo(projectId);
Optional<PeriodCellTemplate> periodCellTemplate = periodCellTemplateMapper.selectByExample(periodCellTemplateExample).stream().findFirst();
BigDecimal originalAmount = new BigDecimal("0");
PeriodDataSource dataSourceModel = null;
if (dataSourceExtendDtos.size() > 0) {
dataSourceModel = dataSourceExtendDtos.get(0).getDataSource();
if (StringUtils.isBlank(data.getKeyinData()))
updateCellValueForDataSourceChange(dataSourceModel, data.getAmount());
originalAmount = dataSourceModel.getAmount() != null ? dataSourceModel.getAmount() : new BigDecimal("0");
dataSourceModel.setName(data.getName());
dataSourceModel.setDescription(data.getDescription());
dataSourceModel.setAmount(data.getAmount());
dataSourceModel.setUpdateBy("Admin");
dataSourceModel.setKeyinData(data.getKeyinData());
dataSourceModel.setUpdateTime(new Date());
periodDataSourceMapper.updateByPrimaryKeySelective(dataSourceModel);
} else {
dataSourceModel = new PeriodDataSource();
Long cellDataSourceId = distributedIdService.nextId();
dataSourceModel.setId(cellDataSourceId);
dataSourceModel.setType(FormulaDataSourceType.KeyInSource.getCode());
dataSourceModel.setName(data.getName());
dataSourceModel.setDescription(data.getDescription());
dataSourceModel.setCellTemplateId(Long.parseLong(data.getCellTemplateId()));
dataSourceModel.setAmount(data.getAmount());
if (periodCellTemplate.isPresent()) {
dataSourceModel.setRowIndex(periodCellTemplate.get().getRowIndex());
dataSourceModel.setColumnIndex(periodCellTemplate.get().getColumnIndex());
}
dataSourceModel.setCreateTime(new Date());
dataSourceModel.setUpdateTime(new Date());
dataSourceModel.setCreateBy("admin");
dataSourceModel.setKeyinData(data.getKeyinData());
dataSourceModel.setUpdateBy("admin");
dataSourceModel.setProjectId(projectId);
dataSourceModel.setPeriod(data.getPeriod());
PeriodCellDataSource cellDataSource = new PeriodCellDataSource();
cellDataSource.setId(distributedIdService.nextId());
cellDataSource.setCellDataId(data.getCellId());
cellDataSource.setDataSourceId(cellDataSourceId);
cellDataSource.setCellTemplateId(Long.parseLong(data.getCellTemplateId()));
cellDataSource.setCreateTime(new Date());
cellDataSource.setUpdateTime(new Date());
cellDataSource.setProjectId(projectId);
cellDataSource.setPeriod(data.getPeriod());
updateCellValueForDataSourceChange(cellDataSource.getCellDataId(), new BigDecimal("0"), data.getAmount());
periodDataSourceMapper.insertSelective(dataSourceModel);
periodCellDataSourceMapper.insertSelective(cellDataSource);
dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
}
//todo: update the reference cell's data, such as if formula is ND(1)+A2,
//todo: if A2 is changed manually, ND(1)+A2 result to changed, and datasource of A2 should be updated
//1. use celltemplateid and period get template id, the change should be in the same sheet.if not in the same sheet, the report should be recalculate, can't changed in time.
//2. use the celltemplateid get col and row number, get the cell name such as A2,B3 etc.
String cellName = StringUtils.EMPTY;
Long templateId = 0L;
if (periodCellTemplate.isPresent()) {
Integer colNum = periodCellTemplate.get().getColumnIndex();
Integer rowNum = periodCellTemplate.get().getRowIndex() + 1;
cellName = FormulaHelper.excelColIndexToStr(colNum + 1) + rowNum.toString();
templateId = periodCellTemplate.get().getReportTemplateId();
}
//3. use the template id get the reportid, use the reportid get the celltemplateids, then use the celltemplateids and cell name get the datasource which should be updated.
PeriodReportExample reportExample = new PeriodReportExample();
reportExample.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(data.getPeriod());
Optional<PeriodReport> report = periodReportMapper.selectByExample(reportExample).stream().findFirst();
if (report.isPresent()) {
Long reportId = report.get().getId();
PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
cellDataExample.createCriteria().andReportIdEqualTo(reportId);
List<PeriodCellData> cellDataList = periodCellDataMapper.selectByExample(cellDataExample);
for (PeriodCellData cellData : cellDataList) {
if (cellData.getId() != data.getCellId() && cellData.getFormulaExp().contains(cellName)) {
PeriodCellDataSourceExample cellDataSourceExample = new PeriodCellDataSourceExample();
cellDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(cellData.getPeriod()).andCellDataIdEqualTo(cellData.getId()).andCellTemplateIdEqualTo(cellData.getCellTemplateId());
List<PeriodCellDataSource> cellDataSourceList = periodCellDataSourceMapper.selectByExample(cellDataSourceExample);
for (PeriodCellDataSource cellDataSource : cellDataSourceList) {
Long dataSourceId = cellDataSource.getDataSourceId();
PeriodDataSource dataSource = periodDataSourceMapper.selectByPrimaryKey(dataSourceId);
if (dataSource.getDescription().equals(cellName) && StringUtils.isBlank(data.getKeyinData())) {
BigDecimal changeValue = data.getAmount().subtract(dataSource.getAmount());
dataSource.setAmount(data.getAmount());
dataSource.setUpdateBy("admin");
dataSource.setUpdateTime(new Date());
periodDataSourceMapper.updateByPrimaryKeySelective(dataSource);
if (!cellData.getData().equals("#VALUE!")) {
if (StringUtils.isBlank(cellData.getData())) cellData.setData("0");
cellData.setData(new BigDecimal(cellData.getData()).add(changeValue).toString());
} else {
cellData.setData(new BigDecimal("0.0").add(changeValue).toString());
}
//cellData.setFormulaExp(cellData.getData());
cellData.setUpdateTime(new Date());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} else if (dataSource.getDescription().equals(cellName) && StringUtils.isNotBlank(data.getKeyinData())) {
dataSource.setKeyinData(data.getKeyinData());
dataSource.setUpdateBy("admin");
dataSource.setUpdateTime(new Date());
periodDataSourceMapper.updateByPrimaryKeySelective(dataSource);
}
}
}
}
}
//4. before you do the setp3 ,you should get the changed value of datasource. then update the celldata use this change. just add the change value to celldata amount.
//5. then save the datasource and save the celldata.
data.setId(dataSourceExtendDtos.get(0).getId());
operationResultDto.setResult(true);
operationResultDto.setData(data);
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
operationResultDto.setResult(false);
}
return operationResultDto;
}
private void updateCellValueForDataSourceChange(PeriodDataSource dataSourceEntity, BigDecimal amount) {
BigDecimal originalAmount = dataSourceEntity.getAmount();
dataSourceEntity.setAmount(amount);
BigDecimal aValue = dataSourceEntity.getAmount() != null ? dataSourceEntity.getAmount() : new BigDecimal("0");
BigDecimal bValue = originalAmount != null ? originalAmount : new BigDecimal("0");
BigDecimal amountChange = aValue.subtract(bValue);
DataSourceCellDataDto dataSourceCellDataDto =
periodDataSourceMapper.getManualDataSource2(dataSourceEntity.getId());
BigDecimal cellVal = new BigDecimal("0");
if (dataSourceCellDataDto != null && dataSourceCellDataDto.getCellData().getData() != null) {
if (dataSourceCellDataDto.getCellDataSource().getOperationType().equals(EnumOperationType.Sub)) {
amountChange = BigDecimal.ZERO.subtract(amountChange);
}
try {
cellVal = new BigDecimal(dataSourceCellDataDto.getCellData().getData());
if (StringUtils.isNotBlank(dataSourceCellDataDto.getCellData().getData())) {
Integer cellDataType = periodCellTemplateMapper
.getDataType(dataSourceCellDataDto.getCellData().getCellTemplateId()
, dataSourceCellDataDto.getCellData().getReportId());
dataSourceCellDataDto.getCellData().setData(
FormulaHelper.roundValue(cellVal.add(amountChange),
KeyValueConfigResultType.values()[cellDataType],
false,
null).toString());
}
} catch (NumberFormatException ex) {
logger.error(ex.getMessage(), ex);
}
}
}
private void updateCellValueForDataSourceChange(Long cellDataId, BigDecimal originalAmount, BigDecimal newAmount) {
BigDecimal aValue = newAmount != null ? newAmount : new BigDecimal("0");
BigDecimal bValue = originalAmount != null ? originalAmount : new BigDecimal("0");
BigDecimal amountChange = aValue.subtract(bValue);
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(cellDataId);
BigDecimal cellVal = new BigDecimal("0");
try {
if (cellData != null && StringUtils.isEmpty(cellData.getKeyinData())) {
cellVal = new BigDecimal(cellData.getData());
Integer cellDataType = periodCellTemplateMapper
.getDataType(cellData.getCellTemplateId()
, cellData.getReportId());
cellData.setData(FormulaHelper.roundValue(cellVal.add(amountChange)
, KeyValueConfigResultType.values()[cellDataType], false, null).toString());
}
} catch (NumberFormatException ex) {
logger.error(ex.getMessage(), ex);
}
}
private Integer convetToFType(Integer cellDataSourceType) {
if (cellDataSourceType.equals(CellDataSourceType.InputInvoice.getCode())) {
return FormulaDataSourceType.InputInvoice.getCode();
}
if (cellDataSourceType.equals(CellDataSourceType.OutputInvoice.getCode())) {
return FormulaDataSourceType.OutputInvoice.getCode();
} else {
return FormulaDataSourceType.Other.getCode();
}
}
}
......@@ -1353,35 +1353,17 @@ public class ReportServiceImpl extends BaseService {
data.setCellId(cellData.getId());
} else {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId());
/*if (StringUtils.isNotBlank(data.getKeyinData())) {
if(StringUtils.isNotBlank(data.getKeyinData())){
cellData.setKeyinData(data.getKeyinData());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getKeyinData());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/ /*else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
}else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
cellData.setData(data.getAmount().toString());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*//* else if (StringUtils.isNotBlank(data.getPenValue())) {//穿透调整数据
cellData.setData(data.getPenValue());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/
boolean boo1 = StringUtils.isNotBlank(data.getPenValue());//穿透合并值
boolean boo2 = StringUtils.isNotBlank(data.getKeyinData());//手工输入
if (boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()) + Double.parseDouble(data.getKeyinData()))));
} else if (boo1 && !boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()))));
} else if (!boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getKeyinData()))));
}
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}
......@@ -1397,7 +1379,7 @@ public class ReportServiceImpl extends BaseService {
PeriodDataSource dataSourceModel = null;
if (dataSourceExtendDtos.size() > 0) {
dataSourceModel = dataSourceExtendDtos.get(0).getDataSource();
if (StringUtils.isBlank(data.getKeyinData()))
if(StringUtils.isBlank(data.getKeyinData()))
updateCellValueForDataSourceChange(dataSourceModel, data.getAmount());
originalAmount = dataSourceModel.getAmount() != null ? dataSourceModel.getAmount() : new BigDecimal("0");
dataSourceModel.setName(data.getName());
......@@ -1479,7 +1461,7 @@ public class ReportServiceImpl extends BaseService {
dataSource.setUpdateTime(new Date());
periodDataSourceMapper.updateByPrimaryKeySelective(dataSource);
if (!cellData.getData().equals("#VALUE!")) {
if (StringUtils.isBlank(cellData.getData())) cellData.setData("0");
if(StringUtils.isBlank(cellData.getData())) cellData.setData("0");
cellData.setData(new BigDecimal(cellData.getData()).add(changeValue).toString());
} else {
cellData.setData(new BigDecimal("0.0").add(changeValue).toString());
......@@ -1487,7 +1469,7 @@ public class ReportServiceImpl extends BaseService {
//cellData.setFormulaExp(cellData.getData());
cellData.setUpdateTime(new Date());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} else if (dataSource.getDescription().equals(cellName) && StringUtils.isNotBlank(data.getKeyinData())) {
} else if(dataSource.getDescription().equals(cellName) && StringUtils.isNotBlank(data.getKeyinData())){
dataSource.setKeyinData(data.getKeyinData());
dataSource.setUpdateBy("admin");
dataSource.setUpdateTime(new Date());
......
......@@ -26,14 +26,6 @@ public interface OperationLogEntryLogMapper extends MyMapper {
*/
int deleteByExample(OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int deleteByPrimaryKey(String subjectCode);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
......@@ -66,14 +58,6 @@ public interface OperationLogEntryLogMapper extends MyMapper {
*/
List<OperationLogEntryLog> selectByExample(OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
OperationLogEntryLog selectByPrimaryKey(String subjectCode);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
......@@ -89,20 +73,4 @@ public interface OperationLogEntryLogMapper extends MyMapper {
* @mbg.generated
*/
int updateByExample(@Param("record") OperationLogEntryLog record, @Param("example") OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OperationLogEntryLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByPrimaryKey(OperationLogEntryLog record);
}
\ No newline at end of file
......@@ -11,15 +11,6 @@ import java.util.Date;
* @mbg.generated do_not_delete_during_merge
*/
public class OperationLogEntryLog extends BaseEntity implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column operation_log_entry_log.subject_code
*
* @mbg.generated
*/
private String subjectCode;
/**
*
* This field was generated by MyBatis Generator.
......@@ -119,6 +110,15 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
*/
private String source;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column operation_log_entry_log.subject_code
*
* @mbg.generated
*/
private String subjectCode;
/**
*
* This field was generated by MyBatis Generator.
......@@ -154,23 +154,15 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
* @mbg.generated
*/
private String orgCode;
private String operate;
public String getOperate() {
return operate;
}
public void setOperate(String operate) {
this.operate = operate;
}
/**
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column operation_log_entry_log.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
*
......@@ -191,36 +183,21 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
private String updateBy;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column operation_log_entry_log.subject_code
*
* @return the value of operation_log_entry_log.subject_code
* This field was generated by MyBatis Generator.
* This field corresponds to the database column operation_log_entry_log.operate
*
* @mbg.generated
*/
public String getSubjectCode() {
return subjectCode;
}
private String operate;
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column operation_log_entry_log.subject_code
*
* @param subjectCode the value for operation_log_entry_log.subject_code
* This field was generated by MyBatis Generator.
* This field corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
public void setSubjectCode(String subjectCode) {
this.subjectCode = subjectCode == null ? null : subjectCode.trim();
}
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
......@@ -486,6 +463,30 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column operation_log_entry_log.subject_code
*
* @return the value of operation_log_entry_log.subject_code
*
* @mbg.generated
*/
public String getSubjectCode() {
return subjectCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column operation_log_entry_log.subject_code
*
* @param subjectCode the value for operation_log_entry_log.subject_code
*
* @mbg.generated
*/
public void setSubjectCode(String subjectCode) {
this.subjectCode = subjectCode == null ? null : subjectCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column operation_log_entry_log.subject_name
......@@ -590,6 +591,9 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
......@@ -599,6 +603,9 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
......@@ -648,6 +655,30 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column operation_log_entry_log.operate
*
* @return the value of operation_log_entry_log.operate
*
* @mbg.generated
*/
public String getOperate() {
return operate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column operation_log_entry_log.operate
*
* @param operate the value for operation_log_entry_log.operate
*
* @mbg.generated
*/
public void setOperate(String operate) {
this.operate = operate == null ? null : operate.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
......@@ -660,7 +691,6 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", subjectCode=").append(subjectCode);
sb.append(", myId=").append(myId);
sb.append(", organizationId=").append(organizationId);
sb.append(", accountPeriod=").append(accountPeriod);
......@@ -672,12 +702,15 @@ public class OperationLogEntryLog extends BaseEntity implements Serializable {
sb.append(", id=").append(id);
sb.append(", period=").append(period);
sb.append(", source=").append(source);
sb.append(", subjectCode=").append(subjectCode);
sb.append(", subjectName=").append(subjectName);
sb.append(", updateTime=").append(updateTime);
sb.append(", voucherNum=").append(voucherNum);
sb.append(", orgCode=").append(orgCode);
sb.append(", createTime=").append(createTime);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append(", operate=").append(operate);
sb.append("]");
return sb.toString();
}
......
......@@ -195,76 +195,6 @@ public class OperationLogEntryLogExample {
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andSubjectCodeIsNull() {
addCriterion("subject_code is null");
return (Criteria) this;
}
public Criteria andSubjectCodeIsNotNull() {
addCriterion("subject_code is not null");
return (Criteria) this;
}
public Criteria andSubjectCodeEqualTo(String value) {
addCriterion("subject_code =", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotEqualTo(String value) {
addCriterion("subject_code <>", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeGreaterThan(String value) {
addCriterion("subject_code >", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeGreaterThanOrEqualTo(String value) {
addCriterion("subject_code >=", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLessThan(String value) {
addCriterion("subject_code <", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLessThanOrEqualTo(String value) {
addCriterion("subject_code <=", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLike(String value) {
addCriterion("subject_code like", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotLike(String value) {
addCriterion("subject_code not like", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeIn(List<String> values) {
addCriterion("subject_code in", values, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotIn(List<String> values) {
addCriterion("subject_code not in", values, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeBetween(String value1, String value2) {
addCriterion("subject_code between", value1, value2, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotBetween(String value1, String value2) {
addCriterion("subject_code not between", value1, value2, "subjectCode");
return (Criteria) this;
}
public Criteria andMyIdIsNull() {
addCriterion("my_id is null");
return (Criteria) this;
......@@ -975,6 +905,76 @@ public class OperationLogEntryLogExample {
return (Criteria) this;
}
public Criteria andSubjectCodeIsNull() {
addCriterion("subject_code is null");
return (Criteria) this;
}
public Criteria andSubjectCodeIsNotNull() {
addCriterion("subject_code is not null");
return (Criteria) this;
}
public Criteria andSubjectCodeEqualTo(String value) {
addCriterion("subject_code =", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotEqualTo(String value) {
addCriterion("subject_code <>", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeGreaterThan(String value) {
addCriterion("subject_code >", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeGreaterThanOrEqualTo(String value) {
addCriterion("subject_code >=", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLessThan(String value) {
addCriterion("subject_code <", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLessThanOrEqualTo(String value) {
addCriterion("subject_code <=", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeLike(String value) {
addCriterion("subject_code like", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotLike(String value) {
addCriterion("subject_code not like", value, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeIn(List<String> values) {
addCriterion("subject_code in", values, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotIn(List<String> values) {
addCriterion("subject_code not in", values, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeBetween(String value1, String value2) {
addCriterion("subject_code between", value1, value2, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectCodeNotBetween(String value1, String value2) {
addCriterion("subject_code not between", value1, value2, "subjectCode");
return (Criteria) this;
}
public Criteria andSubjectNameIsNull() {
addCriterion("subject_name is null");
return (Criteria) this;
......@@ -1255,62 +1255,52 @@ public class OperationLogEntryLogExample {
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(String value) {
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(String value) {
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(String value) {
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(String value) {
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(String value) {
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(String value) {
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLike(String value) {
addCriterion("create_time like", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotLike(String value) {
addCriterion("create_time not like", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<String> values) {
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<String> values) {
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(String value1, String value2) {
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(String value1, String value2) {
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
......@@ -1454,6 +1444,76 @@ public class OperationLogEntryLogExample {
addCriterion("update_by not between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andOperateIsNull() {
addCriterion("operate is null");
return (Criteria) this;
}
public Criteria andOperateIsNotNull() {
addCriterion("operate is not null");
return (Criteria) this;
}
public Criteria andOperateEqualTo(String value) {
addCriterion("operate =", value, "operate");
return (Criteria) this;
}
public Criteria andOperateNotEqualTo(String value) {
addCriterion("operate <>", value, "operate");
return (Criteria) this;
}
public Criteria andOperateGreaterThan(String value) {
addCriterion("operate >", value, "operate");
return (Criteria) this;
}
public Criteria andOperateGreaterThanOrEqualTo(String value) {
addCriterion("operate >=", value, "operate");
return (Criteria) this;
}
public Criteria andOperateLessThan(String value) {
addCriterion("operate <", value, "operate");
return (Criteria) this;
}
public Criteria andOperateLessThanOrEqualTo(String value) {
addCriterion("operate <=", value, "operate");
return (Criteria) this;
}
public Criteria andOperateLike(String value) {
addCriterion("operate like", value, "operate");
return (Criteria) this;
}
public Criteria andOperateNotLike(String value) {
addCriterion("operate not like", value, "operate");
return (Criteria) this;
}
public Criteria andOperateIn(List<String> values) {
addCriterion("operate in", values, "operate");
return (Criteria) this;
}
public Criteria andOperateNotIn(List<String> values) {
addCriterion("operate not in", values, "operate");
return (Criteria) this;
}
public Criteria andOperateBetween(String value1, String value2) {
addCriterion("operate between", value1, value2, "operate");
return (Criteria) this;
}
public Criteria andOperateNotBetween(String value1, String value2) {
addCriterion("operate not between", value1, value2, "operate");
return (Criteria) this;
}
}
/**
......
......@@ -6,7 +6,6 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="subject_code" jdbcType="VARCHAR" property="subjectCode" />
<result column="my_id" jdbcType="BIGINT" property="myId" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="account_period" jdbcType="VARCHAR" property="accountPeriod" />
......@@ -18,13 +17,15 @@
<result column="id" jdbcType="BIGINT" property="id" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="subject_code" jdbcType="VARCHAR" property="subjectCode" />
<result column="subject_name" jdbcType="VARCHAR" property="subjectName" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="voucher_num" jdbcType="VARCHAR" property="voucherNum" />
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="operate" jdbcType="VARCHAR" property="operate" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -97,9 +98,9 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
subject_code, my_id, organization_id, account_period, accounted_dr, accounted_cr,
accounting_date, approval_status, category, id, period, source, subject_name, update_time,
voucher_num, org_code, create_time, create_by, update_by
my_id, organization_id, account_period, accounted_dr, accounted_cr, accounting_date,
approval_status, category, id, period, source, subject_code, subject_name, update_time,
voucher_num, org_code, create_time, create_by, update_by, operate
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLogExample" resultMap="BaseResultMap">
<!--
......@@ -119,24 +120,6 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from operation_log_entry_log
where subject_code = #{subjectCode,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from operation_log_entry_log
where subject_code = #{subjectCode,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLogExample">
<!--
WARNING - @mbg.generated
......@@ -152,20 +135,20 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into operation_log_entry_log (subject_code, my_id, organization_id,
account_period, accounted_dr, accounted_cr,
accounting_date, approval_status, category,
id, period, source,
insert into operation_log_entry_log (my_id, organization_id, account_period,
accounted_dr, accounted_cr, accounting_date,
approval_status, category, id,
period, source, subject_code,
subject_name, update_time, voucher_num,
org_code, create_time, create_by,
update_by)
values (#{subjectCode,jdbcType=VARCHAR}, #{myId,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR},
#{accountPeriod,jdbcType=VARCHAR}, #{accountedDr,jdbcType=BIGINT}, #{accountedCr,jdbcType=BIGINT},
#{accountingDate,jdbcType=TIMESTAMP}, #{approvalStatus,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
#{id,jdbcType=BIGINT}, #{period,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR},
update_by, operate)
values (#{myId,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=VARCHAR},
#{accountedDr,jdbcType=BIGINT}, #{accountedCr,jdbcType=BIGINT}, #{accountingDate,jdbcType=TIMESTAMP},
#{approvalStatus,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, #{id,jdbcType=BIGINT},
#{period,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{subjectCode,jdbcType=VARCHAR},
#{subjectName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{voucherNum,jdbcType=VARCHAR},
#{orgCode,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR})
#{orgCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{operate,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLog">
<!--
......@@ -174,9 +157,6 @@
-->
insert into operation_log_entry_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectCode != null">
subject_code,
</if>
<if test="myId != null">
my_id,
</if>
......@@ -210,6 +190,9 @@
<if test="source != null">
source,
</if>
<if test="subjectCode != null">
subject_code,
</if>
<if test="subjectName != null">
subject_name,
</if>
......@@ -231,11 +214,11 @@
<if test="updateBy != null">
update_by,
</if>
<if test="operate != null">
operate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subjectCode != null">
#{subjectCode,jdbcType=VARCHAR},
</if>
<if test="myId != null">
#{myId,jdbcType=BIGINT},
</if>
......@@ -269,6 +252,9 @@
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="subjectCode != null">
#{subjectCode,jdbcType=VARCHAR},
</if>
<if test="subjectName != null">
#{subjectName,jdbcType=VARCHAR},
</if>
......@@ -282,7 +268,7 @@
#{orgCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
......@@ -290,6 +276,9 @@
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="operate != null">
#{operate,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLogExample" resultType="java.lang.Long">
......@@ -309,9 +298,6 @@
-->
update operation_log_entry_log
<set>
<if test="record.subjectCode != null">
subject_code = #{record.subjectCode,jdbcType=VARCHAR},
</if>
<if test="record.myId != null">
my_id = #{record.myId,jdbcType=BIGINT},
</if>
......@@ -345,6 +331,9 @@
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.subjectCode != null">
subject_code = #{record.subjectCode,jdbcType=VARCHAR},
</if>
<if test="record.subjectName != null">
subject_name = #{record.subjectName,jdbcType=VARCHAR},
</if>
......@@ -358,7 +347,7 @@
org_code = #{record.orgCode,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
......@@ -366,6 +355,9 @@
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.operate != null">
operate = #{record.operate,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -377,8 +369,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
update operation_log_entry_log
set subject_code = #{record.subjectCode,jdbcType=VARCHAR},
my_id = #{record.myId,jdbcType=BIGINT},
set my_id = #{record.myId,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
account_period = #{record.accountPeriod,jdbcType=VARCHAR},
accounted_dr = #{record.accountedDr,jdbcType=BIGINT},
......@@ -389,107 +380,19 @@
id = #{record.id,jdbcType=BIGINT},
period = #{record.period,jdbcType=INTEGER},
source = #{record.source,jdbcType=VARCHAR},
subject_code = #{record.subjectCode,jdbcType=VARCHAR},
subject_name = #{record.subjectName,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
voucher_num = #{record.voucherNum,jdbcType=VARCHAR},
org_code = #{record.orgCode,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR}
update_by = #{record.updateBy,jdbcType=VARCHAR},
operate = #{record.operate,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLog">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update operation_log_entry_log
<set>
<if test="myId != null">
my_id = #{myId,jdbcType=BIGINT},
</if>
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="accountPeriod != null">
account_period = #{accountPeriod,jdbcType=VARCHAR},
</if>
<if test="accountedDr != null">
accounted_dr = #{accountedDr,jdbcType=BIGINT},
</if>
<if test="accountedCr != null">
accounted_cr = #{accountedCr,jdbcType=BIGINT},
</if>
<if test="accountingDate != null">
accounting_date = #{accountingDate,jdbcType=TIMESTAMP},
</if>
<if test="approvalStatus != null">
approval_status = #{approvalStatus,jdbcType=VARCHAR},
</if>
<if test="category != null">
category = #{category,jdbcType=VARCHAR},
</if>
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="subjectName != null">
subject_name = #{subjectName,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="voucherNum != null">
voucher_num = #{voucherNum,jdbcType=VARCHAR},
</if>
<if test="orgCode != null">
org_code = #{orgCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
</set>
where subject_code = #{subjectCode,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLog">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update operation_log_entry_log
set my_id = #{myId,jdbcType=BIGINT},
organization_id = #{organizationId,jdbcType=VARCHAR},
account_period = #{accountPeriod,jdbcType=VARCHAR},
accounted_dr = #{accountedDr,jdbcType=BIGINT},
accounted_cr = #{accountedCr,jdbcType=BIGINT},
accounting_date = #{accountingDate,jdbcType=TIMESTAMP},
approval_status = #{approvalStatus,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR},
id = #{id,jdbcType=BIGINT},
period = #{period,jdbcType=INTEGER},
source = #{source,jdbcType=VARCHAR},
subject_name = #{subjectName,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
voucher_num = #{voucherNum,jdbcType=VARCHAR},
org_code = #{orgCode,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR}
where subject_code = #{subjectCode,jdbcType=VARCHAR}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.OperationLogEntryLogExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
......
......@@ -170,7 +170,7 @@
});
});
//给单元格增加单击事件
//给单元格增加单击事件ActiveSheetChanged
sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
scope.$apply(function () {
if (window.event.ctrlKey) {
......@@ -330,7 +330,7 @@
};
manualFunc.prototype = new GC.Spread.CalcEngine.Functions.Function("_Manual", 1, 1);
manualFunc.prototype.evaluate = function (args) {
debugger;
if (!_.isString(args)) {
return "#VALUE!";
}
......@@ -448,7 +448,6 @@
// 根据已有信息通过spreadJS计算各单元格的值
var setData = function () {
debugger;
var sheet = scope.spread.sheets[0];
var isExportData = false;
if (angular.isArray(scope.reportSource)) {
......@@ -458,7 +457,7 @@
}
scope.reportSource.forEach(function (data) {
debugger;
//fix bug11737 导出需要显示千分位
// 避免直接使用data.value = parseFloat(data.value)导致非数字型value无法显示
data.value = PWC.tryParseStringToNum(data.value);
......@@ -493,7 +492,6 @@
) { // 存在用户手工输入值,需要改变底色
cell.backColor('#fbe8cc');
}
if (!_.isEmpty(data.dataSourceList)) {
var reports = _.chain(data.dataSourceList)
.where({type: enums.formulaDataSourceType.Report})
......@@ -558,7 +556,7 @@
}
if (!_.isEmpty(parsedFormula)) {
debugger;
// parsedFormula = 'IFERROR(' + parsedFormula + ', "")';
sheet.setFormula(data.rowIndex, data.columnIndex, '=' + parsedFormula);
// sheet.setValue(data.rowIndex, data.columnIndex, data.value);
......@@ -574,12 +572,10 @@
sheet.setValue(data.rowIndex, data.columnIndex, data.value); // 只有数值,设置为数值
}
}
sheet.setTag(data.rowIndex, data.columnIndex, JSON.stringify(data));
//设置 tooltip 和 图标信息
spreadJsTipService.setCellTipByCellData(sheet.getCell(data.rowIndex, data.columnIndex), data);
});
debugger;
// 设置破折号单元格的值和显示格式,将其替换为带破折号格式的0值,这样引用到的其他单元格才能正常计算
var rowCount = sheet.getRowCount();
var columnCount = sheet.getColumnCount();
......@@ -599,7 +595,7 @@ debugger;
// 更新数据源后,通过调用该方法计算所有当前sheet单元格,并通过比较原数据列表与spreadJS计算的新值列表,获取保存时需要修改库中Value的单元格信息列表
var updateCells = function () {
debugger;
setData();
var sheet = getSpreadControl().sheets[0];
var cells = [];
......@@ -607,7 +603,7 @@ debugger;
.pluck('dataSourceList')
.flatten(true).value();
angular.forEach(scope.reportSource, function (x) {
debugger;
// 比较刷新前后报表中的值的变化
// 优先将单元格转换成数值比较,如果不能则转换为字符串比较
var cell = sheet.getCell(x.rowIndex, x.columnIndex);
......@@ -643,7 +639,6 @@ debugger;
newVal = PWC.tryParseStringToNum(newVal);
ds.amount = newVal;
});
sheet.setTag(x.rowIndex, x.columnIndex, JSON.stringify(x));
}
});
......
citModule.controller('citReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams',
'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService', 'vatApproveService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService', 'vatApproveService', 'citReportService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
vatReportService, vatReportCacheService, vatSessionService, loginContext, enums, vatCommonService, vatWorkflowService, projectService,
$uibModal, $cookies, Upload, vatImportService, vatApproveService) {
$uibModal, $cookies, Upload, vatImportService, vatApproveService, citReportService) {
'use strict';
$log.debug('citReportViewController.ctor()...');
......@@ -796,6 +796,7 @@
};
var cellDoubleClick = function ($event) {
var row = $event.args.row;
var column = $event.args.col;
if ($scope.isBSPL) {
......@@ -994,11 +995,11 @@
if (!node) {
return;
}
var reportPromiss = vatReportService.getReportData(node.reportId).success(function (reportData) {
debugger;
var reportPromiss = citReportService.getReportData(node.reportId).success(function (reportData) {
if (reportData && reportData.data && reportData.data.cellData) {
_.each(reportData.data.cellData, function (x) {
debugger;
x.value = x.cellValue;
if (x.formula && reg.test(x.formula)) {
x.isFormula = true;
......@@ -1125,9 +1126,9 @@
};
var getReportData = function () {
debugger;
vatReportService.getReportData($scope.reportId).success(function (reportData) {
debugger;
if (reportData && reportData.data && reportData.data.cellData) {
_.each(reportData.data.cellData, function (x) {
x.value = x.cellValue;
......@@ -1597,7 +1598,7 @@
}
if ($scope.handInputModel.amount || $scope.handInputModel.name || $scope.handInputModel.keyinData || $scope.handInputModel.penValue ) {
// 前端保存数据
return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
return citReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
var obj = manualData.data.data;
obj.dataSourceType = manualData.dataSourceType;
$scope.updateCellByManualChange(obj);
......
citModule.controller('entryListModalController', ['$log', 'apiInterceptor', 'Upload', '$scope', '$q', '$translate', '$uibModal', '$document', '$rootScope', 'SweetAlert', 'enums',
'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService','commonWebService',
'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService', 'commonWebService',
function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext,
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService,commonWebService) {
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService, commonWebService) {
var _ra = null;
var entityInit = function () {
//初始化值
$scope.entry = {
......@@ -13,8 +13,8 @@
QMYETotalend: ""
}
}
var _logIndex =0;
if($scope.relObj.logs == undefined || $scope.relObj.logs.length == 0){
var _logIndex = 0;
if ($scope.relObj.logs == undefined || $scope.relObj.logs.length == 0) {
$scope.relObj.logs = [];
}
entityInit();
......@@ -51,27 +51,22 @@
});
$log.debug($scope.selectedItems);*/
name: "124600SYSADMIN20180900025 社保公积金 CNY"
orgCode: "124600"
orgName: "滴滴智慧交通科技有限公司"
organizationId: "5bbd739c-1a13-4b0f-aba6-32ba41e4de69"
period: 2018
$scope.doCalcute(selectedItems.selectedRowsData);
var _in = {};
if(selectedItems.currentDeselectedRowKeys.length == 0){
if (selectedItems.currentDeselectedRowKeys.length == 0) {
_in.operate = "增";
_in.accountingDate = selectedItems.currentSelectedRowKeys[0].accountingDate;
_in.voucherNum = selectedItems.currentSelectedRowKeys[0].voucherNum;
_in.orgCode = selectedItems.currentSelectedRowKeys[0].orgCode;
_in.organizationId = selectedItems.currentSelectedRowKeys[0].organizationId;
}else{
_in.id = selectedItems.currentSelectedRowKeys[0].id;
} else {
_in.operate = "减";
_in.accountingDate = selectedItems.currentDeselectedRowKeys[0].accountingDate;
_in.voucherNum = selectedItems.currentDeselectedRowKeys[0].voucherNum;
_in.orgCode = selectedItems.currentDeselectedRowKeys[0].orgCode;
_in.organizationId = selectedItems.currentDeselectedRowKeys[0].organizationId;
_in.id = selectedItems.currentDeselectedRowKeys[0].id;
}
_in.subjectCode = $scope.relObj.entryLogIdByCode;
$scope.relObj.logs.push(_in);
......@@ -85,8 +80,7 @@
//设置数据源表格的列
var getEntryListColumns = function () {
var dataGridColumns;
dataGridColumns = [
return [
{
dataField: 'index',
caption: $translate.instant('ImportErrorPopUpNoCol'),
......@@ -125,17 +119,21 @@
alignment: 'right'
},
];
return dataGridColumns;
};
$scope.entryListColumns = getEntryListColumns();
//确定
$scope.makeSure = function () {
$scope.relObj.checkRadio = $scope.check;
$scope.relObj.checkRadio = _ra;
$('#entryListModal').modal('hide');
}
$scope.selectRadio = function(event){
debugger;
_ra = event.target.value;
}
$scope.cancel = function () {
$('#entryListModal').modal('hide');
//entityInit();
......
......@@ -28,17 +28,17 @@
</div>
<div class="row backColor" style="margin-right: 0px;">
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "check.checkRadio1" ng-value="entry.JFFSETotal" > <h4 translate="JFFSETotal"></h4>:{{entry.JFFSETotal}}
<input type="radio" name ="checkRadio" ng-click ="selectRadio($event)" ng-value="entry.JFFSETotal" > <h4 translate="JFFSETotal"></h4>:{{entry.JFFSETotal}}
</div>
<div class="col-sm-3 ">
<span><input type="radio" name ="checkRadio" ng-model = "check.checkRadio2" ng-value="entry.DFFSETotal" > <h4 translate="DFFSETotal"></h4>:{{entry.DFFSETotal}}</span>
<span><input type="radio" name ="checkRadio" ng-click ="selectRadio($event)" ng-value="entry.DFFSETotal" > <h4 translate="DFFSETotal"></h4>:{{entry.DFFSETotal}}</span>
</div>
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "check.checkRadio3" ng-value="entry.QMYETotalFirst" > <h4 translate="QMYETotalFirst"></h4>:{{entry.QMYETotalFirst}}
<input type="radio" name ="checkRadio" ng-click ="selectRadio($event)" ng-value="entry.QMYETotalFirst" > <h4 translate="QMYETotalFirst"></h4>:{{entry.QMYETotalFirst}}
</div>
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "check.checkRadio4" ng-value="entry.QMYETotalend" > <h4 translate="QMYETotalend"></h4>:{{entry.QMYETotalend}}
<input type="radio" name ="checkRadio" ng-click ="selectRadio($event)" ng-value="entry.QMYETotalend" > <h4 translate="QMYETotalend"></h4>:{{entry.QMYETotalend}}
</div>
</div>
<div class="row">
......
......@@ -232,10 +232,10 @@
if ($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM) {
var updateAdjustDto = [];
$scope.detail.dataGridSourceBind.forEach(function (e, index) {
if (e.adjustBack != undefined && e.adjustBack != null) {
if (e.adjustAccount != undefined && e.adjustAccount != null) {
updateAdjustDto.push({
"id": e.id,
"adjustAccount": Number(e.adjustBack)
"adjustAccount": Number(e.adjustAccount)
});
}
});
......@@ -366,6 +366,7 @@
};
//---------------------------凭证范围-------------------------//start
$scope.formulaList = [];
$scope.keyValueList = [];
$scope.accountDataSource = [];
......@@ -1543,7 +1544,7 @@
}
});
var addWatch = function(target){
/* var addWatch = function(target){
$scope.$watch(target, function (n, o) {
if ($scope.detail.entryIndex != undefined) {
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustAccount = n;
......@@ -1554,8 +1555,11 @@
addWatch('relObj.checkRadio.checkRadio1');
addWatch('relObj.checkRadio.checkRadio2');
addWatch('relObj.checkRadio.checkRadio3');
addWatch('relObj.checkRadio.checkRadio4');
addWatch('relObj.checkRadio.checkRadio4');*/
//
$scope.detail.relObj = $scope.relObj;
//重新计算合计值
var calculateSum = function (n) {
var evalVal = 0;
......@@ -1565,7 +1569,11 @@
if (i == $scope.detail.entryIndex) {
continue;
}
if($scope.detail.dataGridSourceBind[i].adjustAccount == null){
evalVal += Number($scope.detail.dataGridSourceBind[i].endingBalance);
}else{
evalVal += Number($scope.detail.dataGridSourceBind[i].adjustAccount);
}
}
evalVal = evalVal + Number(n);
$scope.detail.penValue = evalVal;
......@@ -1588,11 +1596,12 @@
var va = evalVal.formatAmount(evalVal, true);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + va);
$scope.detail.cellInfo.money = evalVal.formatAmount(evalVal, true);
}
$scope.showLog = function () {//显示日志
//在点击日志前 科目代码下是否有日志
cellCommentService.selectEntryLog($scope.detail.entryLogIdByCode).success(function (res) {
cellCommentService.selectEntryLog($scope.detail.entryLogIdByCode, $scope.detail.entryLogIdById).success(function (res) {
if (res.data) {
$scope.relObj.logs = commonWebService._index(res.data.concat($scope.relObj.logs));
$('#entryLogModal').modal('show');
......@@ -1606,6 +1615,7 @@
$scope.loadEntryListDataList = function (e) {
$scope.detail.entryIndex = e.dataIndex;
$scope.detail.entryLogIdByCode = e.data.accountCode;
$scope.detail.entryLogIdById = e.data.id;
$scope.relObj.entryLogIdByCode = e.data.accountCode;
cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) {
$scope.relObj.account = e.data.accountCode;
......@@ -1896,6 +1906,7 @@
$scope.config = config;
$scope.choiceGroupButton = choiceGroupButton;
$scope.confirmAddDataSource = function (config) {
if (config.contentStatus === 'dataSourceTitle') {
saveDataSource(config);
......
......@@ -20,8 +20,8 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
updateAdjust : function (data) {
return $http.post('/CellComment/updateAdjust', JSON.stringify(data), apiConfig.createVat({contentType: 'application/json;charset=UTF-8'}));
},
selectEntryLog : function (code) {
return $http.get('/CellComment/selectEntryLog?code=' + code, apiConfig.createVat());
selectEntryLog : function (code, id ) {
return $http.get('/CellComment/selectEntryLog?code=' + code +'&id=' +id, apiConfig.createVat());
},
addLog :function(data){
return $http.post('/CellComment/addLog', data, apiConfig.createVat());
......
......@@ -58,7 +58,7 @@
return $http.get('/Report/getJobStatus/' + projectId + '/' + period + '/' + jobId, apiConfig.createVat({ignoreLoadingBar: true}));
},
getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
return $http.get('/citReport/reportData/' + reportId, apiConfig.createVat());
},
calculateKeyValue: function (projectId, period) {
return $http.post('/Report/calculateKeyValue/' + projectId + '/' + period, {}, apiConfig.createVat({ignoreLoadingBar: true}));
......@@ -86,7 +86,7 @@
return $http.get('/Report/cellInvoice/' + cellDataID + '/' + invoiceType, apiConfig.createVat());
},
addCellManualData: function (manualData, logInfo) {
return $http.post('/Report/addCellManualData', manualData, apiConfig.createVat()).then(function (data) {
return $http.post('/citReport/addCellManualData', manualData, apiConfig.createVat()).then(function (data) {
logInfo.UpdateState = $translate.instant('ManualInputSuccess');
vatOperationLogService.addOperationLog(logInfo);
data.dataSourceType = enums.cellDataSourceType.KeyIn;
......
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