Commit 300673ff authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

keyin chinese

See merge request root/atms!222
parents 7894635f 5a51fcff
......@@ -29,6 +29,9 @@ public class CellDataDto {
private Boolean isCalculated;
private String cellValue;
private String keyinData;
@JsonProperty("cellTemplateID")
private String cellTemplateId;
@JsonProperty("reportTemplateID")
......
......@@ -25,6 +25,7 @@ public class DataSourceDto {
// 1: Formula, 2: Voucher, 3: OutputInvoice, 4: InputInvoice, 5: CustomInvoice, 6: KeyIn, 7: RelatedModel, 8: SapDaily
Integer dataSourceType;
private String keyinData;
private BigDecimal amount;
String description;
......
......@@ -13,6 +13,7 @@ public class ManualDataSourceDto {
String name;
String description;
BigDecimal amount;
String keyinData;
String projectId;
String serviceTypeId;
Integer period;
......
......@@ -625,6 +625,7 @@ public class ReportServiceImpl {
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());
......@@ -685,6 +686,7 @@ public class ReportServiceImpl {
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()
......@@ -880,8 +882,9 @@ public class ReportServiceImpl {
cellData.setId(distributedIdService.nextId());
cellData.setReportId(data.getReportId());
cellData.setCellTemplateId(Long.parseLong(data.getCellTemplateId()));
cellData.setData(data.getAmount().toString());
cellData.setFormulaExp(data.getAmount().toString());
cellData.setData(data.getAmount() == null ? null : data.getAmount().toString());
cellData.setKeyinData(data.getKeyinData());
cellData.setFormulaExp(data.getAmount() == null ? null : data.getAmount().toString());
cellData.setCreateBy("admin");
cellData.setCreateTime(new Date());
cellData.setUpdateBy("admin");
......@@ -892,12 +895,16 @@ public class ReportServiceImpl {
data.setCellId(cellData.getId());
} else {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId());
if (cellData.getData() != data.getAmount().toString()) {
if(StringUtils.isNotBlank(data.getKeyinData())){
cellData.setKeyinData(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);
}
}
List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
......@@ -912,12 +919,14 @@ public class ReportServiceImpl {
PeriodDataSource dataSourceModel = null;
if (dataSourceExtendDtos.size() > 0) {
dataSourceModel = dataSourceExtendDtos.get(0).getDataSource();
updateCellValueForDataSourceChange(dataSourceModel, data.getAmount());
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 {
......@@ -936,6 +945,7 @@ public class ReportServiceImpl {
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());
......@@ -984,7 +994,7 @@ public class ReportServiceImpl {
for (PeriodCellDataSource cellDataSource : cellDataSourceList) {
Long dataSourceId = cellDataSource.getDataSourceId();
PeriodDataSource dataSource = periodDataSourceMapper.selectByPrimaryKey(dataSourceId);
if (dataSource.getDescription().equals(cellName)) {
if (dataSource.getDescription().equals(cellName) && StringUtils.isBlank(data.getKeyinData())) {
BigDecimal changeValue = data.getAmount().subtract(dataSource.getAmount());
dataSource.setAmount(data.getAmount());
dataSource.setUpdateBy("admin");
......@@ -999,6 +1009,11 @@ public class ReportServiceImpl {
//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);
}
}
}
......@@ -1121,7 +1136,8 @@ public class ReportServiceImpl {
operationResultDto.setResult(false);
return operationResultDto;
}
updateCellValueForDataSourceChange(datasourceEntity, dataSource.getAmount());
if(StringUtils.isEmpty(datasourceEntity.getKeyinData()))
updateCellValueForDataSourceChange(datasourceEntity, dataSource.getAmount());
periodDataSourceMapper.updateByPrimaryKeySelective(datasourceEntity);
//todo:MarkProjectModelDirty(dataSource.projectId, dataSource.serviceTypeId, dataSource.Updater);
......@@ -1189,7 +1205,7 @@ public class ReportServiceImpl {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(cellDataId);
BigDecimal cellVal = new BigDecimal("0");
try {
if (cellData != null) {
if (cellData != null && StringUtils.isEmpty(cellData.getKeyinData())) {
cellVal = new BigDecimal(cellData.getData());
Integer cellDataType = periodCellTemplateMapper
.getDataType(cellData.getCellTemplateId()
......
......@@ -319,4 +319,6 @@ public abstract class CommonIT {
MenuExample example = new MenuExample();
menuMapper.deleteByExample(example);
}
}
\ No newline at end of file
......@@ -110,6 +110,8 @@ public class PeriodCellData implements Serializable {
*/
private Integer period;
private String keyinData;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_ADMIN.PERIOD_CELL_DATA
......@@ -118,6 +120,14 @@ public class PeriodCellData implements Serializable {
*/
private static final long serialVersionUID = 1L;
public String getKeyinData() {
return keyinData;
}
public void setKeyinData(String keyinData) {
this.keyinData = keyinData;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_CELL_DATA.ID
......
......@@ -174,6 +174,8 @@ public class PeriodDataSource implements Serializable {
*/
private String projectId;
private String keyinData;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_ADMIN.PERIOD_DATA_SOURCE
......@@ -182,6 +184,14 @@ public class PeriodDataSource implements Serializable {
*/
private static final long serialVersionUID = 1L;
public String getKeyinData() {
return keyinData;
}
public void setKeyinData(String keyinData) {
this.keyinData = keyinData;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_DATA_SOURCE.ID
......
......@@ -10,6 +10,7 @@
<result column="REPORT_ID" jdbcType="DECIMAL" property="reportId" />
<result column="CELL_TEMPLATE_ID" jdbcType="DECIMAL" property="cellTemplateId" />
<result column="DATA" jdbcType="VARCHAR" property="data" />
<result column="KEYIN_DATA" jdbcType="VARCHAR" property="keyinData" />
<result column="FORMULA_EXP" jdbcType="VARCHAR" property="formulaExp" />
<result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" />
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
......@@ -89,7 +90,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, REPORT_ID, CELL_TEMPLATE_ID, "DATA", FORMULA_EXP, CREATE_BY, CREATE_TIME, UPDATE_BY,
ID, REPORT_ID, CELL_TEMPLATE_ID, "DATA", FORMULA_EXP, CREATE_BY, CREATE_TIME, UPDATE_BY, KEYIN_DATA,
UPDATE_TIME, PROJECT_ID, PERIOD
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellDataExample" resultMap="BaseResultMap">
......@@ -144,11 +145,11 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into PERIOD_CELL_DATA (ID, REPORT_ID, CELL_TEMPLATE_ID,
"DATA", FORMULA_EXP, CREATE_BY,
"DATA", KEYIN_DATA, FORMULA_EXP, CREATE_BY,
CREATE_TIME, UPDATE_BY, UPDATE_TIME,
PROJECT_ID, PERIOD)
values (#{id,jdbcType=DECIMAL}, #{reportId,jdbcType=DECIMAL}, #{cellTemplateId,jdbcType=DECIMAL},
#{data,jdbcType=VARCHAR}, #{formulaExp,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{data,jdbcType=VARCHAR}, #{keyinData,jdbcType=VARCHAR}, #{formulaExp,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{projectId,jdbcType=VARCHAR}, #{period,jdbcType=DECIMAL})
</insert>
......@@ -171,6 +172,9 @@
<if test="data != null">
"DATA",
</if>
<if test="keyinData != null">
KEYIN_DATA,
</if>
<if test="formulaExp != null">
FORMULA_EXP,
</if>
......@@ -206,6 +210,9 @@
<if test="data != null">
#{data,jdbcType=VARCHAR},
</if>
<if test="keyinData != null">
#{keyinData,jdbcType=VARCHAR},
</if>
<if test="formulaExp != null">
#{formulaExp,jdbcType=VARCHAR},
</if>
......@@ -256,7 +263,10 @@
CELL_TEMPLATE_ID = #{record.cellTemplateId,jdbcType=DECIMAL},
</if>
<if test="record.data != null">
"DATA" = #{record.data,jdbcType=VARCHAR},
"DATA" = #{record.data,jdbcType=VARCHAR},
</if>
<if test="record.keyinData != null">
KEYIN_DATA = #{record.keyinData,jdbcType=VARCHAR},
</if>
<if test="record.formulaExp != null">
FORMULA_EXP = #{record.formulaExp,jdbcType=VARCHAR},
......@@ -294,6 +304,7 @@
REPORT_ID = #{record.reportId,jdbcType=DECIMAL},
CELL_TEMPLATE_ID = #{record.cellTemplateId,jdbcType=DECIMAL},
"DATA" = #{record.data,jdbcType=VARCHAR},
KEYIN_DATA = #{record.keyinData,jdbcType=VARCHAR},
FORMULA_EXP = #{record.formulaExp,jdbcType=VARCHAR},
CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -321,6 +332,9 @@
<if test="data != null">
"DATA" = #{data,jdbcType=VARCHAR},
</if>
<if test="keyinData != null">
KEYIN_DATA = #{keyinData,jdbcType=VARCHAR},
</if>
<if test="formulaExp != null">
FORMULA_EXP = #{formulaExp,jdbcType=VARCHAR},
</if>
......@@ -354,6 +368,7 @@
set REPORT_ID = #{reportId,jdbcType=DECIMAL},
CELL_TEMPLATE_ID = #{cellTemplateId,jdbcType=DECIMAL},
"DATA" = #{data,jdbcType=VARCHAR},
KEYIN_DATA = #{keinData,jdbcType=VARCHAR},
FORMULA_EXP = #{formulaExp,jdbcType=VARCHAR},
CREATE_BY = #{createBy,jdbcType=VARCHAR},
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
......
......@@ -10,6 +10,7 @@
<result column="TYPE" jdbcType="DECIMAL" property="type" />
<result column="NAME" jdbcType="VARCHAR" property="name" />
<result column="AMOUNT" jdbcType="DECIMAL" property="amount" />
<result column="KEYIN_DATA" jdbcType="VARCHAR" property="keyinData" />
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
<result column="KEY_VALUE_DATA_ID" jdbcType="VARCHAR" property="keyValueDataId" />
<result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" />
......@@ -96,7 +97,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, "TYPE", "NAME", AMOUNT, DESCRIPTION, KEY_VALUE_DATA_ID, CREATE_BY, CREATE_TIME,
ID, "TYPE", "NAME", AMOUNT, KEYIN_DATA, DESCRIPTION, KEY_VALUE_DATA_ID, CREATE_BY, CREATE_TIME,
UPDATE_BY, UPDATE_TIME, ROW_NAME, "COLUMN_NAME", ROW_INDEX, REMAP_BATCH_ID, COLUMN_INDEX,
CELL_TEMPLATE_ID, PERIOD, PROJECT_ID
</sql>
......@@ -152,14 +153,14 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into PERIOD_DATA_SOURCE (ID, "TYPE", "NAME",
AMOUNT, DESCRIPTION, KEY_VALUE_DATA_ID,
AMOUNT, KEYIN_DATA, DESCRIPTION, KEY_VALUE_DATA_ID,
CREATE_BY, CREATE_TIME, UPDATE_BY,
UPDATE_TIME, ROW_NAME, "COLUMN_NAME",
ROW_INDEX, REMAP_BATCH_ID, COLUMN_INDEX,
CELL_TEMPLATE_ID, PERIOD, PROJECT_ID
)
values (#{id,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{description,jdbcType=VARCHAR}, #{keyValueDataId,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{keyinData,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{keyValueDataId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{rowName,jdbcType=VARCHAR}, #{columnName,jdbcType=VARCHAR},
#{rowIndex,jdbcType=DECIMAL}, #{remapBatchId,jdbcType=VARCHAR}, #{columnIndex,jdbcType=DECIMAL},
......@@ -185,6 +186,9 @@
<if test="amount != null">
AMOUNT,
</if>
<if test="keyinData != null">
KEYIN_DATA,
</if>
<if test="description != null">
DESCRIPTION,
</if>
......@@ -241,6 +245,9 @@
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="keyinData != null">
#{keyinData,jdbcType=DECIMAL},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
......@@ -314,6 +321,9 @@
<if test="record.amount != null">
AMOUNT = #{record.amount,jdbcType=DECIMAL},
</if>
<if test="record.keyinData != null">
KEYIN_DATA = #{record.keyinData,jdbcType=DECIMAL},
</if>
<if test="record.description != null">
DESCRIPTION = #{record.description,jdbcType=VARCHAR},
</if>
......@@ -371,6 +381,7 @@
"TYPE" = #{record.type,jdbcType=DECIMAL},
"NAME" = #{record.name,jdbcType=VARCHAR},
AMOUNT = #{record.amount,jdbcType=DECIMAL},
KEYIN_DATA = #{record.keyinData,jdbcType=VARCHAR},
DESCRIPTION = #{record.description,jdbcType=VARCHAR},
KEY_VALUE_DATA_ID = #{record.keyValueDataId,jdbcType=VARCHAR},
CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
......@@ -405,6 +416,9 @@
<if test="amount != null">
AMOUNT = #{amount,jdbcType=DECIMAL},
</if>
<if test="keyinData != null">
KEYIN_DATA = #{keyinData,jdbcType=DECIMAL},
</if>
<if test="description != null">
DESCRIPTION = #{description,jdbcType=VARCHAR},
</if>
......@@ -459,6 +473,7 @@
set "TYPE" = #{type,jdbcType=DECIMAL},
"NAME" = #{name,jdbcType=VARCHAR},
AMOUNT = #{amount,jdbcType=DECIMAL},
KEYIN_DATA = #{keyinData,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR},
KEY_VALUE_DATA_ID = #{keyValueDataId,jdbcType=VARCHAR},
CREATE_BY = #{createBy,jdbcType=VARCHAR},
......
......@@ -10,6 +10,7 @@
#{item.reportId,jdbcType=DECIMAL},
#{item.cellTemplateId,jdbcType=DECIMAL},
#{item.data,jdbcType=VARCHAR},
#{item.keyinData,jdbcType=VARCHAR},
#{item.formulaExp,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP},
......@@ -31,6 +32,7 @@
REPORT_ID,
CELL_TEMPLATE_ID,
"DATA",
KEYIN_DATA,
FORMULA_EXP,
CREATE_TIME,
UPDATE_TIME,
......@@ -59,6 +61,9 @@
<when test="item.data != null">#{item.data,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
<choose>
<when test="item.keyinData != null">#{item.keyinData,jdbcType=VARCHAR},</when>
</choose>
<choose>
<when test="item.formulaExp != null">#{item.formulaExp,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
......
......@@ -229,6 +229,7 @@
<result column="TYPE" jdbcType="INTEGER" property="type"/>
<result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="AMOUNT" jdbcType="DECIMAL" property="amount"/>
<result column="KEYIN_DATA" jdbcType="VARCHAR" property="keyinData"/>
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>
<result column="KEY_VALUE_DATA_ID" jdbcType="VARCHAR" property="keyValueDataId"/>
<result column="CREATE_BY" jdbcType="VARCHAR" property="createBy"/>
......@@ -282,6 +283,7 @@
DS.TYPE,
DS.NAME,
DS.AMOUNT,
DS.KEYIN_DATA,
DS.DESCRIPTION,
DS.KEY_VALUE_DATA_ID,
DS.CREATE_BY,
......@@ -311,6 +313,7 @@
<association property="cellData" javaType="pwc.taxtech.atms.vat.entity.CellData">
<id column="CELL_DATA_ID" jdbcType="BIGINT" property="id"/>
<result column="CELL_DATA_DATA" property="data" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="CELL_DATA_DATA" property="data" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="CELL_DATA_TEMPLATE_ID" property="cellTemplateId" javaType="java.lang.Long" jdbcType="BIGINT"/>
<result column="CELL_DATA_REPORT_ID" property="reportId" javaType="java.lang.Long" jdbcType="BIGINT"/>
</association>
......@@ -375,6 +378,11 @@
0,
</otherwise>
</choose>
<choose>
<when test="item.keyinData != null">
#{item.keyinData,jdbcType=VARCHAR},
</when>
</choose>
<choose>
<when test="item.description != null">
#{item.description,jdbcType=VARCHAR},
......
......@@ -174,12 +174,9 @@
};
function doConfirmEventHandler() {
swal.close();
var r = /^00\d*|^\.\d+|\.$/;
if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
SweetAlert.warning($translate.instant('CheckInputValueFormat'));
return;
} else if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
SweetAlert.warning($translate.instant('CheckInputValueLength'));
return;
}
......@@ -200,9 +197,17 @@
if (!$scope.detail.inputValue) {
$scope.detail.inputValue = "0";
}
$scope.detail.inputValue = $scope.detail.dataType === 5 ?
parseInt($scope.detail.inputValue) :
parseFloat($scope.detail.inputValue).toFixed(2);
if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
// $scope.detail.inputValue;
$scope.detail.keyinData = $scope.detail.inputValue;
} else {
$scope.detail.inputValue = $scope.detail.dataType === 5 ?
parseInt($scope.detail.inputValue) :
parseFloat($scope.detail.inputValue).toFixed(2);
}
$scope.onConfirm();
......@@ -242,9 +247,10 @@
if(isConfirm){
var message;
var r = /^00\d*|^\.\d+|\.$/;
if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
message = $translate.instant('CheckInputValueFormat');
} else if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
// if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
// message = $translate.instant('CheckInputValueFormat');
// } else
if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
message = $translate.instant('CheckInputValueLength');
} else if ($scope.detail.dataType === 5) {
r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/;
......@@ -1223,7 +1229,7 @@
dataGridColumns = [
{
dataField: 'period',
caption: $translate.instant('InvoiceQJ'),
caption: $translate.instant ('InvoiceQJ'),
alignment: 'center',
width: '10%',
visible: vatSessionService.citFlag ? false : true
......
......@@ -122,7 +122,8 @@
<div class="hand-input-container" ng-if="detail.cellType === 19">
<div class="hand-input-line">
<span>{{'HandInputValue' | translate}}:</span>
<span>{{detail.dataGridSource[0].money}}</span>
<span ng-if="!detail.keyinData">{{detail.dataGridSource[0].money}}</span>
<span ng-if="detail.keyinData">{{detail.dataGridSource[0].keyinData}}</span>
</div>
<div class="hand-input-line">
<span>{{'Memo' | translate}}:</span>
......@@ -134,7 +135,8 @@
<div class="hand-input-container" ng-show="selectedDataSourceTabIndex == 2 || (detail.dataSourceCount == 1 && detail.hasKeyIn)">
<div class="hand-input-line">
<span>{{'HandInputValue' | translate}}:</span>
<span><input id="hand-input-value" name="hand-input-value" ng-model="detail.inputValue" type="text" class="hand-input-value" /></span>
<span><input id="hand-input-value" ng-if="!detail.keyinData" name="hand-input-value" ng-model="detail.inputValue" type="text" class="hand-input-value" /></span>
<span><input id="hand-input-value" ng-if="detail.keyinData" name="hand-input-value" ng-model="detail.keyinData" type="text" class="hand-input-value" /></span>
</div>
<div class="hand-input-line">
<span>{{'Memo' | translate}}:</span>
......
......@@ -512,7 +512,11 @@
// 设置顺序: 非数值字符串 -> 单元格值覆盖修改 -> 公式或手工数据源 -> 数值
var ifShowParseFloat = true; // 用于标识单元格是否设置成数值
if (_.isString(data.value) && data.value.length > 0 && isNaN(Number(data.value))) {
if(_.isString(data.keyinData) && data.keyinData.length > 0 && isNaN(Number(data.keyinData))){
sheet.setValue(data.rowIndex, data.columnIndex, data.keyinData);
ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串
}
else if (_.isString(data.value) && data.value.length > 0 && isNaN(Number(data.value))) {
sheet.setValue(data.rowIndex, data.columnIndex, data.value);
ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串
}
......@@ -598,6 +602,10 @@
newVal = newVal.toFixed(4);
}
if(x.keyinData){
}
var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) {
......
......@@ -569,6 +569,7 @@
if (jsonTagInfo.cellTemplateConfig.hasKeyIn) {
$scope.taxCellDetail.inputValue = element.amount;
$scope.taxCellDetail.inputMemo = element.name;
$scope.taxCellDetail.keyinData = element.keyinData;
}
} else if (element.dataSourceType === enums.cellDataSourceType.ModelDatasource) {
var modelItem = {
......@@ -1170,7 +1171,12 @@
for (var j = 0; j < reportD.dataSourceList.length; j++) {
if (reportD.dataSourceList[j].rowIndex === cellData.rowIndex
&& reportD.dataSourceList[j].columnIndex === cellData.columnIndex) {
reportD.dataSourceList[j].amount = manualData.amount;
if(manualData.keyinData){
reportD.keyinData = manualData.keyinData;
reportD.dataSourceList[j].keyinData = manualData.keyinData;
} else {
reportD.dataSourceList[j].amount = manualData.amount;
}
}
}
}
......@@ -1201,6 +1207,7 @@
if (manualDs) {
manualDs.amount = manualData.amount;
manualDs.name = manualData.name;
manualDs.keyinData = manualData.keyinData;
manualDs.description = manualData.description;
}
else {
......@@ -1259,6 +1266,7 @@
if (manualDataSource) {
manualDataSource.item2.amount = manualData.amount;
manualDataSource.item2.keyinData = manualData.keyinData;
manualDataSource.item2.name = manualData.name;
manualDataSource.item2.description = manualData.description;
}
......@@ -1497,24 +1505,29 @@
if(result&&result=='committed'){
SweetAlert.error('报表提审中!');
}else{
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo;
$scope.handInputModel.amount = $scope.taxCellDetail.inputValue;
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo;
var r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/;
if ($scope.taxCellDetail.keyinData) {
$scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData;
}else {
$scope.handInputModel.amount = $scope.taxCellDetail.inputValue;
}
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo;
$scope.handInputModel.projectID = vatSessionService.project.id;
$scope.handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID;
$scope.handInputModel.period = vatSessionService.month;
if ($scope.handInputModel.amount || $scope.handInputModel.name) {
//日志对象
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = "Amount: " + $scope.handInputModel.amount
+ "; Description: " + $scope.handInputModel.description;
logDto.OperationName = $translate.instant('ManualInputDataSource');
logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID
+ ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")";
logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput;
if ($scope.handInputModel.amount || $scope.handInputModel.name || $scope.handInputModel.keyinData) {
//日志对象
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = "Amount: " + $scope.handInputModel.amount
+ "; Description: " + $scope.handInputModel.description + "keyinData:" + $scope.handInputModel.keyinData;
logDto.OperationName = $translate.instant('ManualInputDataSource');
logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID
+ ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")";
logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput;
// 前端保存数据
return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
......@@ -2559,9 +2572,9 @@
$scope.commitApprove = function(){
if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){
SweetAlert.error('报表提审中!');
SweetAlert.error('报表提审中或审核已通过!');
}else{
SweetAlert.swal({
title: "warning!",
......@@ -2590,7 +2603,7 @@
$scope.doApprove = function(){
if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){
$("#ApprovalComment").modal('show')
......@@ -2688,54 +2701,34 @@
};
$scope.upLoadManual = function(){
if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){
SweetAlert.error('报表提审中!');
}else{
var text= $(".li").find(".active").text();
$log.debug(text);
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){
var excelIo = new GC.Spread.Excel.IO();
$("#importExcellFile").modal('show');
}else{
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数");
}
}
});
var text= $(".li").find(".active").text();
$log.debug(text);
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){
var excelIo = new GC.Spread.Excel.IO();
$("#importExcellFile").modal('show');
}else{
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数");
}
};
$scope.loadMyExcel = function(){
if($scope.file){
if($scope.hasManualLoad){
SweetAlert.warning("已载入文件,如需重新载入请先清空!");
}else{
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
var excelIo = new GC.Spread.Excel.IO();
var excelFile = $scope.file;
excelIo.open(excelFile, function(json) {
var workbookObj = json;
$scope.manualSpread.fromJSON(workbookObj);
}, function(e) {
alert(e.errorMessage);
if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/ ) {
document.getElementById('password').onselect = null;
}
}, {
});
$scope.hasManualLoad = true;
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
var excelIo = new GC.Spread.Excel.IO();
var excelFile = document.getElementById("fileDemo").files[0];
excelIo.open(excelFile, function(json) {
var workbookObj = json;
$scope.manualSpread.fromJSON(workbookObj);
}, function(e) {
alert(e.errorMessage);
if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/ ) {
document.getElementById('password').onselect = null;
}
}else{
SweetAlert.warning("请先选择文件!");
}
}, {
});
};
$scope.multiWrite = function(){
if($scope.hasManualLoad){
var manualSheet = $scope.manualSpread.getActiveSheet();
var currentSheet = $scope.spread.getActiveSheet()
currentSheet.options.isProtected=false;
......@@ -2771,9 +2764,6 @@
}
}
}
}else{
SweetAlert.warning("文件未载入!");
}
};
......@@ -2809,13 +2799,7 @@
$scope.cleanManual = function(){
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
$('#ss').html('');
$scope.hasManualLoad = false;
$scope.file = null;
};
$scope.closeManualModal = function () {
$scope.cleanManual();
$scope.modalInstance.dismiss('cancel');
document.getElementById("fileDemo").value="";
};
......
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