Commit 6433e6a3 authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

# Conflicts:
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
parents 2a074497 838b9b65
......@@ -94,6 +94,24 @@ public class AnalysisController extends BaseController {
}
}
@ResponseBody
@RequestMapping(value = "InternationalExcelFile", method = RequestMethod.POST)
public OperationResultDto importDomesitcExcelFile(@RequestParam MultipartFile file, @RequestParam String period,
@RequestParam Integer type,@RequestParam String companyName,@RequestParam String country) {
try {
String valMsg = valParameter(file,period,type);
if(StringUtils.isNotEmpty(valMsg)){
return OperationResultDto.error(valMsg);
}
return analysisServiceImpl.importInterNationalExcelFile(file,period, type,companyName,country);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importDomesitcExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
private String valParameter(MultipartFile file,String periodDate,Integer type){
if (null == file) {
return ErrorMessage.NoFile;
......
......@@ -7,6 +7,8 @@ public class ErrorMessageCN {
public static final String InconsistentPeriod = "单表中期间不一致";
public static final String DoNotSelectPeriod = "未选择期间";
public static final String DoNotSelectCompany = "非选定主体";
public static final String DoNotExistProject = "项目未开启";
public static final String DoNotInputPeriod = "缺少期间字段";
public static final String StrctureRepeat = "层级重复!";
public static final String BusinssUnitRepeat = "事业部重复!";
public static final String BusinssUnitUpdateFailed = "未对事业部名称或状态进行修改!";
......
......@@ -109,7 +109,6 @@ public class DateUtils {
return dateString;
}
/**
* 将短时间格式字符串转换为区间格式 yyyyMM
*
......@@ -117,12 +116,13 @@ public class DateUtils {
* @return
*/
public static Integer dateToPeriod(java.util.Date dateDate) {
if(dateDate==null){
return null;
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM");
Integer period = Integer.valueOf(formatter.format(dateDate));
return period;
return Integer.valueOf(formatter.format(dateDate));
}
/**
* 将yyyy-mm yyyy - mm等字符串转换为区间格式 yyyyMM
*
......@@ -217,6 +217,19 @@ public class DateUtils {
return strtodate;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM
*
* @param strDate
* @return
*/
public static Date strToDate5(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/**
* 得到现在时间
*
......
......@@ -7,10 +7,14 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.OperationLogEntryLogMapper;
import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.CitJournalEntryAdjust;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.OperationLogEntryLog;
import pwc.taxtech.atms.entity.OperationLogEntryLogExample;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper;
import pwc.taxtech.atms.vat.entity.CellComment;
......@@ -69,6 +73,11 @@ public class CellCommentController {
@Autowired
private PeriodFormulaBlockMapper periodFormulaBlockMapper;
@Autowired
private OperationLogEntryLogMapper operationLogEntryLogMapper;
@Autowired
private DistributedIdService distributedIdService;
//更新调整后金额
@RequestMapping("updateAdjust")
public OperationResultDto updateAdjust(@RequestBody CitTbam[] citTbams){
......@@ -77,8 +86,23 @@ 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;
}
@RequestMapping("selectEntryLog")
public OperationResultDto selectEntryLog(String code){
OperationResultDto operationResultDto = new OperationResultDto();
OperationLogEntryLogExample operationLogEntryLogExample = new OperationLogEntryLogExample();
OperationLogEntryLogExample.Criteria criteria = operationLogEntryLogExample.createCriteria();
criteria.andSubjectCodeEqualTo(code);
operationResultDto.setData(operationLogEntryLogMapper.selectByExample(operationLogEntryLogExample));
return operationResultDto;
}
}
......@@ -14,6 +14,15 @@ public class ManualDataSourceDto {
Integer period;
Long reportId;
Long id;
String penValue;//穿透修改值
public String getPenValue() {
return penValue;
}
public void setPenValue(String penValue) {
this.penValue = penValue;
}
public Long getCellId() {
return this.cellId;
......
......@@ -201,11 +201,20 @@ public class AnalysisServiceImpl extends BaseService {
case 4:
importAnalysisDriverNumExcelFile(file,periodDate);
break;
default:
break;
}
return OperationResultDto.success();
}
public OperationResultDto importInterNationalExcelFile(MultipartFile file, String periodDate, Integer type,
String companyName,String country) {
switch (type){
case 100:
importAnalysisInterBuDataExcelFile(file,periodDate);
importAnalysisInterBuDataExcelFile(file,periodDate,companyName,country);
break;
case 101:
importAnalysisInterTaxDataExcelFile(file,periodDate);
importAnalysisInterTaxDataExcelFile(file,periodDate,companyName,country);
break;
default:
break;
......@@ -221,12 +230,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if (!filePer.equals(selectedPer)) {
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -275,13 +279,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if (!filePer.equals(selectedPer)) {
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -330,13 +328,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -381,13 +373,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -432,13 +418,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -475,7 +455,8 @@ public class AnalysisServiceImpl extends BaseService {
}
}
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate) {
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate,
String companyName,String country) {
try{
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -483,14 +464,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String fileCountry = file.getOriginalFilename().split("_")[1];
String fileCompany = file.getOriginalFilename().split("_")[2];
String filePeriod = file.getOriginalFilename().split("_")[3];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -503,8 +477,8 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalTaxData model = new AnalysisInternationalTaxData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(fileCompany);
model.setCountry(fileCountry);
model.setCompanyName(companyName);
model.setCountry(country);
model.setTaxCategory(getCellStringValue(sheet.getRow(j).getCell(0)));
model.setTaxType(getCellStringValue(sheet.getRow(j).getCell(1)));
model.setTaxAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
......@@ -526,7 +500,8 @@ public class AnalysisServiceImpl extends BaseService {
}
}
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate) {
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate,
String companyName,String country) {
try{
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -534,14 +509,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String fileCountry = file.getOriginalFilename().split("_")[1];
String fileCompany = file.getOriginalFilename().split("_")[2];
String filePeriod = file.getOriginalFilename().split("_")[3];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -550,8 +518,8 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(fileCompany);
model.setCountry(fileCountry);
model.setCompanyName(companyName);
model.setCountry(country);
Cell cell1 = sheet.getRow(j).getCell(0);
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) {
continue;
......
......@@ -725,17 +725,20 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+"JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if(2 == config.getAccountType()){//手工输入
} else if (2 == config.getAccountType()) {//手工输入
}else{
} 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("");
if (1 == config.getTaxBase()) {//账载
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\"" + config.getName() + "\",\"E\")");
//838b9b6513422e029c38575f9b029b1fdd18dadb
} else if (2 == config.getTaxBase()) {//开票收入
} else if (3 == config.getTaxBase()) {//手工录入
......@@ -743,10 +746,11 @@ public class ReportServiceImpl extends BaseService {
} else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)");
} else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)");
}else{
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
// row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*"
// +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
......@@ -979,7 +983,7 @@ public class ReportServiceImpl extends BaseService {
PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); //这是取的是单元格中显示的值
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.andReportIdEqualTo(reportId);
......@@ -1304,17 +1308,35 @@ public class ReportServiceImpl extends BaseService {
data.setCellId(cellData.getId());
} else {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId());
if (StringUtils.isNotBlank(data.getKeyinData())) {
/*if (StringUtils.isNotBlank(data.getKeyinData())) {
cellData.setKeyinData(data.getKeyinData());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getKeyinData());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
}*/ /*else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
cellData.setData(data.getAmount().toString());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*//* else if (StringUtils.isNotBlank(data.getPenValue())) {//穿透调整数据
cellData.setData(data.getPenValue());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/
boolean boo1 = StringUtils.isNotBlank(data.getPenValue());//穿透合并值
boolean boo2 = StringUtils.isNotBlank(data.getKeyinData());//手工输入
if (boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()) + Double.parseDouble(data.getKeyinData()))));
} else if (boo1 && !boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()))));
} else if (!boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getKeyinData()))));
}
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}
......
......@@ -47,7 +47,7 @@ file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
......
......@@ -15,7 +15,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://172.20.201.164:9001
web.url=http://dts.erp.didichuxing.com:9001
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -23,7 +23,7 @@ jwt.expireSecond=180000
jwt.refreshSecond=600
#File Server Config
file.server.url=http://172.20.201.164:9001
file.server.url=http://dts.erp.didichuxing.com:9001
file.server.upload=/api/v1/upload
#upload
......@@ -33,7 +33,7 @@ max_file_length=104857600
distributed_id_datacenter=10
distributed_id_machine=15
api.url=http://172.20.201.164:8180
api.url=http://dts.erp.didichuxing.com:8180
# Longi config
longi_api_basic_user=
......
......@@ -45,7 +45,7 @@ file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -406,13 +406,15 @@ public class DataInitTest extends CommonIT {
*/
String input = "";
try {
File targetFile = new File("src/main/resources/orgImport/ddOrgJson.json");
File targetFile = new File("src/main/resources/orgImport/ddOrgJson3.json");
// File targetFile = new File("src/main/resources/orgImport/failedJson.json");
input = FileUtils.readFileToString(targetFile, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(input,DDSyncOrgInfo.class);
List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
// List<OrgSyncData> orgSyncDatas = JSONArray.parseArray(input,OrgSyncData.class);
orgSyncDatas.forEach(osd -> {
OrganizationExample example = new OrganizationExample();
example.createCriteria().andNameEqualTo(osd.getNameCN());
......@@ -438,6 +440,24 @@ public class DataInitTest extends CommonIT {
});
}
@Test
public void testOrg(){
String input = "";
try {
// File targetFile = new File("src/main/resources/orgImport/ddOrgJson.json");
File targetFile = new File("src/main/resources/orgImport/failedJson.json");
input = FileUtils.readFileToString(targetFile, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
// DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(input,DDSyncOrgInfo.class);
// List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
List<OrgSyncData> orgSyncDatas = JSONArray.parseArray(input,OrgSyncData.class);
}
private void setProperty(Object obj, String propertyName, Object value) {
try{
Class c = obj.getClass();
......
......@@ -41,7 +41,7 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyMapper"/>
</javaClientGenerator>
<table tableName="organization_accounting_rate" domainObjectName="OrganizationAccountingRate">
<table tableName="operation_log_entry_log" domainObjectName="OperationLogEntryLog">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
......
package pwc.taxtech.atms.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.MyMapper;
import pwc.taxtech.atms.entity.OperationLogEntryLog;
import pwc.taxtech.atms.entity.OperationLogEntryLogExample;
@Mapper
public interface OperationLogEntryLogMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
long countByExample(OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int deleteByExample(OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int deleteByPrimaryKey(String subjectCode);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int insert(OperationLogEntryLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int insertSelective(OperationLogEntryLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
List<OperationLogEntryLog> selectByExampleWithRowbounds(OperationLogEntryLogExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
List<OperationLogEntryLog> selectByExample(OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
OperationLogEntryLog selectByPrimaryKey(String subjectCode);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OperationLogEntryLog record, @Param("example") OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByExample(@Param("record") OperationLogEntryLog record, @Param("example") OperationLogEntryLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OperationLogEntryLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_entry_log
*
* @mbg.generated
*/
int updateByPrimaryKey(OperationLogEntryLog record);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package pwc.taxtech.atms.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
......@@ -35,6 +36,8 @@ public class CitTbam extends BaseEntity implements Serializable {
private String organizationId;
private Long adjustAccount;
private OperationLogEntryLog[] operationLogEntryLogList;
public Long getAdjustAccount() {
return adjustAccount;
}
......@@ -43,6 +46,14 @@ 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:
* 项目ID
......
......@@ -857,6 +857,30 @@ public class Organization extends BaseEntity implements Serializable {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.p_level
*
* @return the value of organization.p_level
*
* @mbg.generated
*/
public Integer getPLevel() {
return pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.p_level
*
* @param pLevel the value for organization.p_level
*
* @mbg.generated
*/
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.create_time
......
......@@ -83,8 +83,6 @@
</insert>
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.dpo.CitTbamDto">
select
id as id,
attribute attribute,
......
......@@ -208,7 +208,7 @@ public class AccountController {
response.addCookie(ddTicketCookie);
response.addCookie(ddJumptoCookie);
// todo 这里写死为DD的登出地址了
response.sendRedirect(" http://mis.diditaxi.com.cn/auth/ldap/logout?app_id=2500");
response.sendRedirect("http://mis.diditaxi.com.cn/auth/ldap/logout?app_id=2500&jumpto=http://dts.erp.didichuxing.com:9001/sso/accept");
} catch (Exception e) {
logger.error("登出失败", e);
}
......
......@@ -93,26 +93,44 @@ public class IndexController {
return "redirect:Account/LogOn";
}
@RequestMapping(value = {"/sso/callback"}, method = RequestMethod.GET)
public String ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestMapping(value = {"/sso/callback"})
public void ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestParam(value = "code") String code,
HttpServletResponse response) throws IOException, ServletException {
try{
String ticketStr = getTicket(code);
response.sendRedirect(jumpto+"?code="+code+"&ticketStr="+ticketStr);
}catch (Exception e){
logger.error("ddSSOCallback error",e);
}
}
/**
* 18/03/2019 20:46
* 跨站cookie的问题,所以做了一次跳转
* [code, ticketStr, request, response]
* @author Gary J Li
* @return
*/
@RequestMapping(value = {"/sso/accept"})
public String accept(@RequestParam(value = "code") String code,
@RequestParam(value = "ticketStr") String ticketStr,HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
StringBuffer url = request.getRequestURL();
String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString();
try{
Cookie codeCookie = new Cookie("ddCode",URLEncoder.encode(code, "UTF-8"));
codeCookie.setPath("/");
codeCookie.setMaxAge(18000);
Cookie ddTicket = new Cookie("ddTicket",URLEncoder.encode(ticketStr, "UTF-8"));
ddTicket.setPath("/");
Cookie jumptoCookie = new Cookie("ddJumpto",URLEncoder.encode(jumpto, "UTF-8"));
jumptoCookie.setPath("/");
ddTicket.setMaxAge(18000);
response.addCookie(codeCookie);
response.addCookie(jumptoCookie);
response.addCookie(ddTicket);
}catch (Exception e){
}catch (Exception e){
logger.error("ddSSOCallback error",e);
}
return "redirect:/Account/LogOn";
return "redirect:"+tempContextUrl+"Account/LogOn";
}
@RequestMapping(value = {"/admin", "/admin.html"}, method = RequestMethod.GET)
......
......@@ -9,7 +9,7 @@ log.level=DEBUG
#didi-config
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
\ No newline at end of file
api.url=http://172.20.201.164:8180/
api.url=http://dts.erp.didichuxing.com:8180/
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......
......@@ -10,6 +10,6 @@ jwt.refreshSecond=600
log.level=DEBUG
#didi-config
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
citModule.directive('entryModal', ['$log',
citModule.directive('entryLog', ['$log',
function ($log) {
return {
restrict: 'E',
......
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