Commit a35b8768 authored by zhkwei's avatar zhkwei

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

parents 4124b3b9 4f21b81c
......@@ -10,7 +10,6 @@ import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.entity.BalanceSheet;
import java.util.HashMap;
import java.util.Map;
......@@ -60,7 +59,8 @@ public class SpringContextUtil implements ApplicationContextAware {
public static AdjustmentTableMapper adjustmentTableMapper;
public static TrialBalanceFinalMapper trialBalanceFinalMapper;
public static ProfitLossStatementMapper profitLossStatementMapper;
public static RevenueTypeMappingMapper revenueTypeMappingMapper;
public static BillDetailMapper billDetailMapper;
......@@ -144,8 +144,8 @@ public class SpringContextUtil implements ApplicationContextAware {
citProfitPrcAdjustMapper = webApplicationContext.getBean(CitProfitPrcAdjustMapper.class);
balanceSheetMapper = webApplicationContext.getBean(BalanceSheetMapper.class);
revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class);
billDetailMapper = webApplicationContext.getBean(BillDetailMapper.class);
/* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper);
......
......@@ -48,7 +48,6 @@ public final class Constant {
public static final String IMAGE_FORMART_ = "png";
public static final String EMPTY = "";
public static final String DateTimeFormate = "%d年%d月";
public static final String DateTimeFormate1 = "%d-%d";
public static final String INPUT_RZJG_SUCCESS="1";
public static final String INPUT_RZJG_FAILED="2";
......
package pwc.taxtech.atms.constant.enums;
import java.util.HashMap;
import java.util.Map;
public class BillDetailEnum {
/**
* 发票类型
*/
public enum BillType {
ORDINARY(1, "增值税普票"),
SPECIAL(2, "增值税专票");
private Integer code;
private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>();
BillType(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
static {
for (BillDetailEnum.BillType billType : BillDetailEnum.BillType.values()) {
MAPPING.put(billType.getCode(), billType.getName());
}
}
}
}
......@@ -86,10 +86,6 @@ public class CellCommentController {
for(CitTbam citTbam1 : citTbams){
citTbam.setId(citTbam1.getId());
citTbamMapper.updateByPrimaryKey(citTbam);
for(OperationLogEntryLog operationLogEntryLog : citTbam1.getOperationLogEntryLogList()){
operationLogEntryLog.setMyId(distributedIdService.nextId());
operationLogEntryLogMapper.insert(operationLogEntryLog);
}
}
operationResultDto.setResultMsg("success");
return operationResultDto;
......@@ -105,4 +101,17 @@ public class CellCommentController {
return operationResultDto;
}
/**
* 添加日志
*/
@RequestMapping("addLog")
public OperationResultDto addLog(@RequestBody OperationLogEntryLog[] operationLogEntryLogs ){
for(OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs){
operationLogEntryLogMapper.insert(operationLogEntryLog);
}
OperationResultDto<Object> objectOperationResultDto = new OperationResultDto<>();
objectOperationResultDto.setResultMsg("success");
return objectOperationResultDto;
}
}
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
public class DeleteTemplateParam {
@JsonProperty("ID")
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private boolean isDeletePermanent;
private String path;
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.constant.enums.RoleSource;
public class NameDto {
@JsonProperty("ID")
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String name;
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.util.Date;
import java.util.List;
......@@ -8,6 +11,7 @@ import java.util.List;
*/
public class TemplateGroupDto {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String name;
private String serviceTypeId;
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
public class TemplateUniqDto {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String code;
......
......@@ -11,6 +11,8 @@ public class AnalysisDomesticlParam {
private String period;
private String companyName;
public Integer getType() {
return type;
}
......@@ -27,4 +29,11 @@ public class AnalysisDomesticlParam {
this.period = period;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
package pwc.taxtech.atms.dto.billDetail;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -7,6 +10,7 @@ public class BillDetailResult implements Serializable {
private static final long serialVersionUID = 4342336578709406470L;
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String subject;
......
package pwc.taxtech.atms.dto.organization;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.entity.BaseEntity;
import java.io.Serializable;
......@@ -22,6 +24,7 @@ public class OrganizationTaxpayerQualificationDto implements Serializable {
*
* @mbg.generated
*/
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
/**
......
package pwc.taxtech.atms.dto.vatdto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.CellDataSource;
public class DataSourceCellDataDto {
@JsonSerialize(using = PwCIdSerialize.class)
Long id;
CellData cellData;
CellDataSource cellDataSource;
......
package pwc.taxtech.atms.dto.vatdto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.dto.TemplateDto;
import java.util.List;
public class TemplateByGroupDto {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String name;
private int OrderIndex;
......
package pwc.taxtech.atms.dto.vatdto.dd;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.math.BigDecimal;
......
package pwc.taxtech.atms.dto.vatdto.dd;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.math.BigDecimal;
......
......@@ -22,6 +22,7 @@ import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportFileUpload;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
......@@ -346,6 +347,76 @@ public class TaxDocumentServiceImpl {
}
}
public void downloadAllFile(HttpServletResponse response, List<Long> ids) {
//如果只选择了一个附件,则不打包
if (null != ids &&ids.size()==1){
TaxDocumentExample example = new TaxDocumentExample();
TaxDocumentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(ids);
TaxDocument taxDocument = taxDocumentMapper.selectByExample(example).get(0);
String urlPath = taxDocument.getFilePositionUrl();
//如果url为null或空字符串而抛出异常
if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + taxDocument.getId());
}
//文件名称(带后缀)
String fileName = StringUtils.isBlank(taxDocument.getFileOriginalName()) ? "未知文件(请修改后缀名).xlsx" : taxDocument.getFileOriginalName();
//获取需要下载的文件流
InputStream is = null;
BufferedInputStream in = null;
byte[] buffer = new byte[1024];
int len;
ServletOutputStream out = null;
try {
URL httpurl = new URL(URLDecoder.decode(urlPath, "UTF-8"));
HttpURLConnection httpConn = (HttpURLConnection) httpurl.openConnection();
httpConn.setDoOutput(true);// 使用 URL 连接进行输出
httpConn.setDoInput(true);// 使用 URL 连接进行输入
httpConn.setUseCaches(false);// 忽略缓存
httpConn.setRequestMethod("GET");// 设置URL请求方法
//可设置请求头
httpConn.setRequestProperty("Content-Type", "application/octet-stream");
httpConn.setRequestProperty("Connection", "Keep-Alive");// 维持长连接
httpConn.setRequestProperty("Charset", "UTF-8");
httpConn.connect();
if (httpConn.getResponseCode() >= 400) {
is = httpConn.getErrorStream();
} else {
is = httpConn.getInputStream();
}
in = new BufferedInputStream(is);
out = response.getOutputStream();
//文件流循环写入ZipOutputStream
while ((len = in.read(buffer)) != -1) {
out.write(buffer, 0, len);
}
} catch (IOException e) {
log.error("单个附件下载异常:"+e.getMessage());
} finally {
if (null != out){
try {
out.close();
} catch (IOException e) {
log.error("关闭输出流错误:"+e.getMessage());
}
}
if (null != is) {
try {
is.close();
} catch (IOException e) {
log.error("关闭输入流错误:"+e.getMessage());
}
}
if (null != in) {
try {
in.close();
} catch (IOException e) {
log.error("关闭缓存输入流错误:"+e.getMessage());
}
}
}
return;
}
//如果选择了多个附件
String downloadName = "多选附件.zip";
try {
response.setContentType("multipart/form-data");
......@@ -353,7 +424,6 @@ public class TaxDocumentServiceImpl {
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("下载文件名编码时出现错误.", e);
}
OutputStream outputStream = null;
ZipOutputStream zos = null;
try {
......
......@@ -532,7 +532,8 @@ public class ReportGeneratorImpl {
FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new SUM2(formulaContext), new RSUMIF(formulaContext), new SUM(formulaContext)};
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext),
new SUM2(formulaContext), new RSUMIF(formulaContext), new SUM(formulaContext),new KPSR(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack);
......
......@@ -64,7 +64,7 @@ public class ReportServiceImpl extends BaseService {
private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class);
private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>();
private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX",
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR", "WPNAME", "WPTYPE", "SUM2", "RSUMIF", "SUM"};
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR", "WPNAME", "WPTYPE", "SUM2", "RSUMIF", "SUM", "KPSR"};
@Autowired
private ReportGeneratorImpl reportGenerator;
......@@ -727,7 +727,7 @@ public class ReportServiceImpl extends BaseService {
RevenueConfigExample example = new RevenueConfigExample();
String queryDate = project.getYear()+"-"+(period>=10?period:("0"+period));
example.createCriteria().andOrgIdEqualTo(project.getOrganizationId()).
andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate).andStatusEqualTo(1);
andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate).andStatusEqualTo(0);
List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example);
//合计项map
Map<Integer,List<String>> sumMap = new HashMap<>();
......@@ -759,8 +759,8 @@ public class ReportServiceImpl extends BaseService {
} else {
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",2)");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",1)");
if (1 == config.getTaxBase()) {//账载
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
} else if (2 == config.getTaxBase()) {//开票收入
......
......@@ -36,11 +36,11 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
int year = getIntParam(args[1], ec);
int period = getIntParam(args[2], ec);
int sourceDataType = getIntParam(args[3], ec);//取值数据源
String segment5 = "";
String segment5 = null;
if(!(args[4] instanceof MissingArgEval)){
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = "";
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.BillDetailEnum;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.vat.entity.BillDetail;
import pwc.taxtech.atms.vat.entity.BillDetailExample;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 根据收入类型配置查询开票收入开票金额总计
*/
public class KPSR extends FunctionBase implements FreeRefFunction {
public KPSR(FormulaContext formulaContext) {
super(formulaContext);
}
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length < 2) {
return null;
}
String revenueTypeName = getStringParam(args[0], ec);//收入类型名称
Integer billType = getIntParam(args[1], ec);//发票类型
String formulaExpression = "KPSR(\"" + revenueTypeName + "\","+billType+")";
logger.debug(formulaExpression);
List<ReportCellDataSourceDto> dataSource = Lists.newArrayList();
double result = countForTrialBalance(revenueTypeName,dataSource,billType);
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, new BigDecimal(result), dataSoureId, formulaContext.getProjectId());
return new NumberEval(result);
}
private double countForTrialBalance(String revenueTypeName, List<ReportCellDataSourceDto> contain, Integer billType) {
String queryDate = formulaContext.getYear()+(formulaContext.getPeriod()<10?("0"+formulaContext.getPeriod()):(formulaContext.getPeriod()+""));
RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
typeMappingExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId())
.andRevenueTypeNameEqualTo(revenueTypeName).andStartDateLessThanOrEqualTo(queryDate)
.andEndDateGreaterThanOrEqualTo(queryDate);
List<RevenueTypeMapping> typeMappingList = SpringContextUtil.revenueTypeMappingMapper.selectByExample(typeMappingExample);
if (CollectionUtils.isEmpty(typeMappingList)) {
return 0.0;
}
List<String> contens = typeMappingList.stream()
.map(o -> o.getContent()).collect(Collectors.toList());
if (CollectionUtils.isEmpty(contens)) {
return 0.0;
}
BillDetailExample billDetailExample = new BillDetailExample();
BillDetailExample.Criteria c = billDetailExample.createCriteria().andBillContentIn(contens).andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate))
.andBillTypeEqualTo(BillDetailEnum.BillType.MAPPING.get(billType));
List<BillDetail> billDetails = SpringContextUtil.billDetailMapper.selectByExample(billDetailExample);
for (BillDetail billDetail : billDetails) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(billDetail.getBillAmount());
dto.setPeriod(formulaContext.getPeriod());
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.Report.getCode());
contain.add(dto);
}
return billDetails.stream().mapToDouble(a -> a.getBillAmount().doubleValue()).sum();
}
}
......@@ -40,8 +40,8 @@ public class PC extends FunctionBase implements FreeRefFunction {
case "FilterDate":
return new StringEval(String.format(Constant.DateTimeFormate, formulaContext.getYear(), formulaContext.getPeriod()));
case "FilterDate1":
// String month = formulaContext.getPeriod()<10?"0"+formulaContext.getPeriod():formulaContext.getPeriod()+"";
return new StringEval(String.format(Constant.DateTimeFormate1, formulaContext.getYear(), formulaContext.getPeriod()));
String month = formulaContext.getPeriod()<10?("0"+formulaContext.getPeriod()):(formulaContext.getPeriod()+"");
return new StringEval(formulaContext.getYear()+"-"+month);
case "TimeInterval":
Date beginOfPeriod = new Date(formulaContext.getYear(), formulaContext.getIsYear() ? 1 : formulaContext.getPeriod(), 1);
calendar.setTime(beginOfPeriod);
......
......@@ -36,7 +36,6 @@ public class CitTbam extends BaseEntity implements Serializable {
private String organizationId;
private Long adjustAccount;
private OperationLogEntryLog[] operationLogEntryLogList;
public Long getAdjustAccount() {
return adjustAccount;
......@@ -46,13 +45,6 @@ public class CitTbam extends BaseEntity implements Serializable {
this.adjustAccount = adjustAccount;
}
public OperationLogEntryLog[] getOperationLogEntryLogList() {
return operationLogEntryLogList;
}
public void setOperationLogEntryLogList(OperationLogEntryLog[] operationLogEntryLogList) {
this.operationLogEntryLogList = operationLogEntryLogList;
}
/**
* Database Column Remarks:
......
......@@ -154,8 +154,17 @@ 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
......
......@@ -403,6 +403,7 @@
SELECT
id,file_attr, file_type
FROM file_types
WHERE status = 1
ORDER BY file_attr
</select>
</mapper>
\ No newline at end of file
......@@ -9,7 +9,7 @@
// 根据ServiceType判断当前实际Period
var getActualPeriod = function () {
return $scope.serviceType === enums.serviceType.VAT ? vatSessionService.month : 0;
return $scope.serviceType === enums.serviceType.CIT ? vatSessionService.month : 0;
};
//Voucher Comments:
......@@ -1329,7 +1329,6 @@
} else {
$scope.manualDataSources.push({item1: manualData.cellTemplateId, item2: manualData});
}
// 刷新spreadsheet,获取操作数据源后最新的计算结果,并拿来与当前所有单元格value比较,得到value修改前后的值对比
var updatedCells = $scope.reportApi.refreshReport();
loadCellData(getActualPeriod());
......@@ -1606,7 +1605,6 @@
return $q.when();
});
}
return $q.reject();
}
});
......
......@@ -51,17 +51,29 @@
});
$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){
_in.operate = "增";
_in.accountingDate = selectedItems.currentSelectedRowKeys[0];
_in.voucherNum = selectedItems.currentSelectedRowKeys[0];
_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.operate = "减";
_in.accountingDate = selectedItems.currentDeselectedRowKeys[0];
_in.voucherNum = selectedItems.currentDeselectedRowKeys[0];
_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.subjectCode = $scope.relObj.entryLogIdByCode;
$scope.relObj.logs.push(_in);
},
allowColumnResizing: true,
......
......@@ -79,7 +79,5 @@
$scope.hideCellAttachmentModel = function () {
$('#entryListModal').modal('hide');
}
}
]);
\ No newline at end of file
......@@ -239,8 +239,11 @@
});
}
});
updateAdjustDto.push($scope.relObj.logs);
cellCommentService.updateAdjust(updateAdjustDto).success(function (res) {
cellCommentService.updateAdjust(updateAdjustDto).success(function (res1) {
if (res1.resultMsg == "success") {
cellCommentService.addLog($scope.relObj.logs).success(function (res) {
});
}
}).error(function (error) {
if (error) {
alert("调整金额数据更新失败");
......@@ -249,7 +252,6 @@
}
};
//确定点击事件的处理函数
var confirmEventHandler = function () {
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.AccountMapSubmitted) {
......@@ -463,7 +465,6 @@
if (!$scope.selectedAccountCodes) {
$scope.selectedAccountCodes = [];
}
if (!_.isEmpty($scope.selectedAccountCodes)) {
var selectedData = _.filter($scope.accountDataSource, function (data) {
return $scope.selectedAccountCodes.indexOf(data.code) > -1;
......@@ -639,6 +640,7 @@
}
};
//弹框表格右下角合计值
var getConclusionVal = function () {
var precition = 2;
//如果数值是份数类型,则精度为0,否则为2
......@@ -709,11 +711,7 @@
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
} else if ($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM) {
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
return memo + x.endingBalance;
}, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
calculateSum(null);
}
else { // For 报表数据源 and BSPL数据源
if ($scope.detail.dataGridSource && $scope.detail.dataGridSource.length > 0) {
......@@ -1542,22 +1540,45 @@
$scope.$watch('relObj.checkRadio', function (n, o) {
if ($scope.detail.entryIndex != undefined) {
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustBack = n;
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack = true;
calculateSum(n);
}
});
//重新计算合计值
var calculateSum = function (n) {
var evalVal = _.reduce($scope.detail.dataGridSourceBind, function (memo, x) {
if ((x.accountCode == $scope.relObj.account) && x.accountCode != undefined && $scope.relObj.account != undefined) {
memo + n;
} else {
return memo + x.endingBalance;
var evalVal = 0;
var s;
if (n != null) {
for (var i = 0, j = $scope.detail.dataGridSourceBind.length; i < j; i++) {
if (i == $scope.detail.entryIndex) {
continue;
}
evalVal += Number($scope.detail.dataGridSourceBind[i].endingBalance);
}
evalVal = evalVal + Number(n);
$scope.detail.penValue = evalVal;
var _v1 = 0;
if ($scope.detail.keyinData != null && $scope.detail.keyinData != undefined) {
_v1 = Number($scope.detail.keyinData);
}
}, 0);
$scope.detail.cellInfo.money = _v1.formatAmount((_v1 + evalVal), true);
} else {
for (var i = 0, j = $scope.detail.dataGridSourceBind.length; i < j; i++) {
s = $scope.detail.dataGridSourceBind[i].adjustAccount;
if (s == null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].endingBalance;
} else if (s != null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += s;
} else {
evalVal += s;
}
}
}
var va = evalVal.formatAmount(evalVal, true);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(evalVal, true));
$scope.detail.penValue = evalVal.formatAmount(evalVal, true);
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + va);
}
$scope.showLog = function () {//显示日志
......@@ -1576,6 +1597,7 @@
$scope.loadEntryListDataList = function (e) {
$scope.detail.entryIndex = e.dataIndex;
$scope.detail.entryLogIdByCode = e.data.accountCode;
$scope.relObj.entryLogIdByCode = e.data.accountCode;
cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) {
$scope.relObj.account = e.data.accountCode;
if (res.resultMsg == "success") {
......@@ -1588,7 +1610,6 @@
}
//-------------------------------------------------------------------- end --------------------------------------------------------------
//设置数据源表格的列
......@@ -2279,7 +2300,6 @@
});
var getBlowGridData = function (data) {
cellCommentService.getCellInformation(data).success(function (res) {
debugger;
if (res.resultMsg) {
$scope.detail.dataGridSourceBind = res.data;
calculateSum(null);
......
......@@ -302,7 +302,7 @@
<!--分录弹框-->
<entry-list-modal id ="entryListId" rel-obj = "relObj" show-log = "showLog()" ></entry-list-modal>
<entry-list-modal id ="entryListId" rel-obj = "relObj" show-log = "showLog()" detail = "detail" ></entry-list-modal>
<entry-log id ="entryLogId" rel-obj = "relObj" ></entry-log>
</div>
......
......@@ -9,9 +9,6 @@
$scope.isWriteBackUpdate = false;
$scope.projectYear = vatSessionService.year;
$scope.projectPeriod = vatSessionService.month;
$scope.relObj = {};
//关闭数据源弹出框
var hidePanel = function () {
$scope.selectedDataSourceTabIndex = 1;
......@@ -604,9 +601,6 @@
}
}]
},
onInitialized: function (e) {
dxDataGridService.registerRowDbClick(e.component);
},
paging: {
enabled: false
},
......
......@@ -273,9 +273,6 @@
break;
case enums.formulaDataSourceType.InvoiceFilter:
break;
case enums.formulaDataSourceType.CIT_TBAM:
obj.relSql = sourceData.rel_sql;
}
if (sourceData.type === 0 && sourceData.dataSourceType === enums.cellDataSourceType.RelatedModel) {
......
......@@ -52,7 +52,7 @@
if (!Number.prototype.formatAmount) {
Number.prototype.formatAmount = function (decPlaces, type) {
if(type){
return Number(decPlaces.toString().match(/^\d+(?:\.\d{0,2})?/));
return Number(decPlaces.toString().match(/^\d+(?:\.\d{2})?/));
}
decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces;
var n = this.toFixed(decPlaces);
......
......@@ -22,6 +22,9 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
},
selectEntryLog : function (code) {
return $http.get('/CellComment/selectEntryLog?code=' + code, apiConfig.createVat());
}
},
addLog :function(data){
return $http.post('/CellComment/addLog', data, apiConfig.createVat());
}
};
}]);
\ No newline at end of file
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