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