Commit 0457636b authored by kevin's avatar kevin

$

parent bcb807ed
...@@ -111,21 +111,6 @@ public class ReportController { ...@@ -111,21 +111,6 @@ public class ReportController {
return ""; return "";
} }
public static void main(String[] args) {
System.out.println(201833 % 100);
}
private DataImportService dataImportService;
@RequestMapping(value = "saveAndRefresh", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<EbitDataDto> saveAndRefresh(@RequestParam(value ="orgId") String orgId, @RequestParam(value ="period") Integer period, @RequestParam(value = "specialConsiderations", defaultValue = "0") Integer specialConsiderations, @RequestParam(value = "ebitRate", defaultValue = "1") String ebitRate) {
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto.setData(reportService.loadEbitData(orgId, period, specialConsiderations, ebitRate));
reportService.saveDatasource(orgId, period, specialConsiderations, ebitRate, operationResultDto);
return operationResultDto;
}
@RequestMapping(value = "report/{templateId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "report/{templateId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period, @RequestHeader String from) { public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period, @RequestHeader String from) {
...@@ -271,6 +256,16 @@ public class ReportController { ...@@ -271,6 +256,16 @@ public class ReportController {
} }
@RequestMapping(value = "saveAndRefresh", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<EbitDataDto> saveAndRefresh(@RequestParam(value ="orgId") String orgId, @RequestParam(value ="period") Integer period, @RequestParam(value = "specialConsiderations", defaultValue = "0") Integer specialConsiderations, @RequestParam(value = "ebitRate", defaultValue = "1") String ebitRate) {
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto.setData(reportService.loadEbitData(orgId, period, specialConsiderations, ebitRate));
reportService.saveDatasource(orgId, period, specialConsiderations, ebitRate, operationResultDto);
return operationResultDto;
}
/** /**
*批量导出利润表 *批量导出利润表
*/ */
...@@ -280,5 +275,19 @@ public class ReportController { ...@@ -280,5 +275,19 @@ public class ReportController {
operationResultDto.setResult(null); operationResultDto.setResult(null);
return operationResultDto; return operationResultDto;
} }
/**
* 将spread序列化字符串保存到数据库
*/
@RequestMapping("spreadToDb")
public OperationResultDto spreadToDb(@RequestBody RequestParameterDto.EbitParam ebitParam){
OperationResultDto operationResultDto = new OperationResultDto();
try{
reportService.spreadToDb(ebitParam);
return operationResultDto.success();
}catch (Exception e){
e.printStackTrace();
return operationResultDto.error();
}
}
} }
\ No newline at end of file
...@@ -43,6 +43,7 @@ public class OperationResultDto<T> extends OperationResultBase { ...@@ -43,6 +43,7 @@ public class OperationResultDto<T> extends OperationResultBase {
return new OperationResultDto<>(true); return new OperationResultDto<>(true);
} }
public static OperationResultDto<?> success(Object data) { public static OperationResultDto<?> success(Object data) {
OperationResultDto dto = new OperationResultDto(); OperationResultDto dto = new OperationResultDto();
dto.setData(data); dto.setData(data);
......
package pwc.taxtech.atms.dto;
/**
* @ClassName RequestParameterBaseDto
* Description TODO
* @Author pwc kevin
* @Date 3/30/2019 3:00 PM
* Version 1.0
**/
public class RequestParameterBaseDto {
public String orgId;
public Integer period;
public String templateId;
public String projectId;
public String reportId;
}
...@@ -10,12 +10,38 @@ import java.io.Serializable; ...@@ -10,12 +10,38 @@ import java.io.Serializable;
* Version 1.0 * Version 1.0
* 请求参数封装 * 请求参数封装
**/ **/
public class RequestParameterDto implements Serializable { public class RequestParameterDto extends RequestParameterBaseDto implements Serializable {
private String reportId;
private String orgId; public class EbitParam extends RequestParameterDto{
private Integer period; private String jsonString;//excel传过来的数据 已经被序列化成字符串了
private String templateId; private Integer specialConsiderations;
private String projectId; private String ebitRate;
public String getEbitRate() {
return ebitRate;
}
public void setEbitRate(String ebitRate) {
this.ebitRate = ebitRate;
}
public Integer getSpecialConsiderations() {
return specialConsiderations;
}
public void setSpecialConsiderations(Integer specialConsiderations) {
this.specialConsiderations = specialConsiderations;
}
public String getJsonString() {
return jsonString;
}
public void setJsonString(String jsonString) {
this.jsonString = jsonString;
}
}
public String getReportId() { public String getReportId() {
return reportId; return reportId;
......
...@@ -31,10 +31,7 @@ import pwc.taxtech.atms.constant.Constant; ...@@ -31,10 +31,7 @@ import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.*; import pwc.taxtech.atms.constant.enums.*;
import pwc.taxtech.atms.dao.*; import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dpo.ReportDto; import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.PeriodReportDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.vatdto.*; import pwc.taxtech.atms.dto.vatdto.*;
...@@ -2261,7 +2258,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -2261,7 +2258,7 @@ public class ReportServiceImpl extends BaseService {
EbitCellDataExample.Criteria criteria = example.createCriteria(); EbitCellDataExample.Criteria criteria = example.createCriteria();
criteria.andOrganizationIdEqualTo(orgId); criteria.andOrganizationIdEqualTo(orgId);
criteria.andPeriodEqualTo(period); criteria.andPeriodEqualTo(period);
criteria.andColEqualTo(3); criteria.andColEqualTo(1);
criteria.andRowEqualTo(i); criteria.andRowEqualTo(i);
List<EbitCellData> ebitCellData = ebitCellDataMapper.selectByExample(example); List<EbitCellData> ebitCellData = ebitCellDataMapper.selectByExample(example);
if (ebitCellData.size() == 0) { if (ebitCellData.size() == 0) {
...@@ -2295,10 +2292,17 @@ public class ReportServiceImpl extends BaseService { ...@@ -2295,10 +2292,17 @@ public class ReportServiceImpl extends BaseService {
ebitCellData1.setData(operationResultDto.getData().getEbitData().getTotalAmountTax().toString()); ebitCellData1.setData(operationResultDto.getData().getEbitData().getTotalAmountTax().toString());
ebitCellData1.setRow(i); ebitCellData1.setRow(i);
} }
ebitCellData1.setCol(3); ebitCellData1.setCol(1);
ebitCellData1.setCreateTime(new Date()); ebitCellData1.setCreateTime(new Date());
ebitCellData1.setOrganizationId(orgId); ebitCellData1.setOrganizationId(orgId);
ebitCellData1.setPeriod(period); ebitCellData1.setPeriod(period);
return ebitCellData1; return ebitCellData1;
} }
public void spreadToDb(RequestParameterDto.EbitParam ebitParam) {
EbitSpreadDataExample example = new EbitSpreadDataExample();
EbitSpreadDataExample.Criteria criteria = example.createCriteria();
EbitSpreadDataExample.Criteria criteria1 = criteria.andOrganizationIdEqualTo(ebitParam.getOrgId()).andPeriodEqualTo(ebitParam.getPeriod());
}
} }
...@@ -40,10 +40,11 @@ ...@@ -40,10 +40,11 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java"> <javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java">
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" /> <property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator> </javaClientGenerator>
<!--<table tableName="ebit_cell_data" domainObjectName="EbitCellData">--> <table tableName="ebit_spread_data" domainObjectName="EbitSpreadData">
<!--<property name="useActualColumnNames" value="false"/>--> <property name="useActualColumnNames" value="false"/>
<!--<property name="ignoreQualifiersAtRuntime" value="true"/>--> <property name="ignoreQualifiersAtRuntime" value="true"/>
<!--</table>--> </table>
<!-- <!--
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.EbitSpreadData;
import pwc.taxtech.atms.vat.entity.EbitSpreadDataExample;
@Mapper
public interface EbitSpreadDataMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
long countByExample(EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int deleteByExample(EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int insert(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int insertSelective(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExampleWithBLOBsWithRowbounds(EbitSpreadDataExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExampleWithBLOBs(EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExampleWithRowbounds(EbitSpreadDataExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExample(EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
EbitSpreadData selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") EbitSpreadData record, @Param("example") EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") EbitSpreadData record, @Param("example") EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByExample(@Param("record") EbitSpreadData record, @Param("example") EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByPrimaryKey(EbitSpreadData record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity; package pwc.taxtech.atms.vat.entity;
import pwc.taxtech.atms.entity.BaseEntity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import pwc.taxtech.atms.entity.BaseEntity;
/** /**
* *
......
...@@ -2922,11 +2922,29 @@ ...@@ -2922,11 +2922,29 @@
if(res.data){ if(res.data){
$scope.relation.data = res.data; $scope.relation.data = res.data;
} }
}).error(function(error){ }).error(function(error){
}); });
} }
//将spread保存到数据库 var spreadTODb = function(){
//spread序列化参数
var serializationOption = {
ignoreFormula: false, // indicate to ignore the style when convert workbook to json, default value is false
ignoreStyle: false, // indicate to ignore the formula when convert workbook to json, default value is false
rowHeadersAsFrozenColumns: false, // indicate to treat the row headers as frozen columns when convert workbook to json, default value is false
columnHeadersAsFrozenRows: false // indicate to treat the column headers as frozen rows when convert workbook to json, default value is false
}
var jsonString = JSON.stringify($scope.spread.toJSON(serializationOption));
var obj = {
period : $scope.relation.period != undefined ? $scope.relation.period : null,
orgId : $scope.relation.orgId,
jsonString : jsonString
}
$http.post('/Report/spreadToDb', obj ,function(res){
if(!res.result)
SweetAlert.error("保存表单到数据库失败");
});
}
$scope.$watch('file', function (file) { $scope.$watch('file', function (file) {
$scope.upload($scope.file); $scope.upload($scope.file);
...@@ -3004,9 +3022,6 @@ ...@@ -3004,9 +3022,6 @@
} }
} }
//前端导入 //前端导入
var frontImport = function(file){ var frontImport = function(file){
if($scope.spread != undefined && $scope.spread){ if($scope.spread != undefined && $scope.spread){
......
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