Commit b9563dfe authored by gary's avatar gary

1、fixbug

parent b006169e
......@@ -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;
}
/**
* 得到现在时间
*
......
......@@ -295,6 +295,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -461,6 +468,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -602,6 +616,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -744,6 +765,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -948,6 +976,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
return;
}
if(!orgIds.contains(orgId)){
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLog.setImportResult(false);
......@@ -1042,6 +1077,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
return;
}
if(!orgIds.contains(orgId)){
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLog.setImportResult(false);
......@@ -1139,6 +1181,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
return;
}
if(!orgIds.contains(orgId)){
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLog.setImportResult(false);
......@@ -1234,6 +1283,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -1370,7 +1426,7 @@ public class DataImportService extends BaseService {
private void processIrs(String billingBody, List<InvoiceRecord> irs,List<String> orgIds,
Integer tmsPeriod, Integer importType,List<DataImportLog> dataImportLogs) {
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andCodeEqualTo(billingBody);
organizationExample.createCriteria().andNameEqualTo(billingBody);
List<Organization> orgs = organizationMapper.selectByExample(organizationExample);
DataImportLog dataImportLog = generalDataImportLog(irs.get(0).getBillingBody(),"", "",
......@@ -1390,6 +1446,13 @@ public class DataImportService extends BaseService {
// 根据机构ID和年份获取卡片
String projId = getProjId(orgId, tmsPeriod);
if (StringUtils.isEmpty(projId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotExistProject);
dataImportLogs.add(dataImportLog);
return;
}
if(!orgIds.contains(orgId)){
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLog.setImportResult(false);
......@@ -1407,6 +1470,13 @@ public class DataImportService extends BaseService {
boolean validateRes = true;
for (InvoiceRecord ir : irs) {
// 校验该主体导入所有记录区间是否一致
if(null==ir.getPeriod()){
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotInputPeriod);
validateRes = false;
break;
}
if (!ir.getPeriod().equals(period1)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.InconsistentPeriod);
......@@ -1484,7 +1554,7 @@ public class DataImportService extends BaseService {
ir.setApplicationDate(row.getCell(11).getDateCellValue());
ir.setBillingDate(row.getCell(12).getDateCellValue());
ir.setPeriod(DateUtils.dateToPeriod(ir.getBillingDate()));
ir.setBillingMonth(row.getCell(13).getDateCellValue());
ir.setBillingMonth(DateUtils.strToDate5(getCellStringValue(row.getCell(13))));
ir.setInvoiceCode(getCellStringValue(row.getCell(14)));
ir.setInvoiceNum(getCellStringValue(row.getCell(15)));
ir.setRemarks(getCellStringValue(row.getCell(16)));
......@@ -1589,6 +1659,9 @@ public class DataImportService extends BaseService {
}
private String getCellStringValue(Cell cell) {
if(null==cell){
return "";
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return cell.getStringCellValue();
} else if(cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
......@@ -1600,6 +1673,9 @@ public class DataImportService extends BaseService {
}
private Boolean getCellBolleanValue(Cell cell) {
if(null==cell){
return false;
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
switch (cell.getStringCellValue()) {
case "TRUE":
......@@ -1621,6 +1697,9 @@ public class DataImportService extends BaseService {
}
private Integer getCellIntegerValue(Cell cell) {
if(null==cell){
return null;
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return Integer.valueOf(cell.getStringCellValue());
} else if(cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
......@@ -1631,6 +1710,9 @@ public class DataImportService extends BaseService {
}
private BigDecimal getCellBigDecimalValue(Cell cell) {
if(null==cell){
return null;
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return new BigDecimal(cell.getStringCellValue());
} else if(cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
......@@ -1641,6 +1723,9 @@ public class DataImportService extends BaseService {
}
private Long getCellLongDecimalValue(Cell cell) {
if(null==cell){
return null;
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return Long.valueOf(cell.getStringCellValue());
} else if(cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
......
......@@ -406,7 +406,7 @@ public class DataInitTest extends CommonIT {
*/
String input = "";
try {
File targetFile = new File("src/main/resources/orgImport/ddOrgJson2.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) {
......
......@@ -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
......
......@@ -94,7 +94,7 @@ public class IndexController {
}
@RequestMapping(value = {"/sso/callback"}, method = RequestMethod.GET)
public String ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
public void ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestParam(value = "code") String code,
HttpServletResponse response) throws IOException, ServletException {
try{
......@@ -108,11 +108,10 @@ public class IndexController {
response.addCookie(codeCookie);
response.addCookie(jumptoCookie);
response.addCookie(ddTicket);
response.sendRedirect(jumpto);
}catch (Exception e){
logger.error("ddSSOCallback error",e);
}
return "redirect:/Account/LogOn";
}
@RequestMapping(value = {"/admin", "/admin.html"}, method = RequestMethod.GET)
......
......@@ -373,11 +373,11 @@
"InvestmentAmount": "投资金额",
"InvestmentCurrency": "投资金额币种",
"InvestmentRadio": "投资比例",
"PayableShareholderName": "实缴股东名称",
"PayableShareholderIdNum": "实缴股东证件编号",
"PayableCapitalContributionAmount": "实缴出资金额",
"PayableCapitalContributionCurrency": "实缴出资币种",
"PayableContributionProportion": "实缴出资比例",
"PayableShareholderName": "实缴投资方信息",
"PayableShareholderIdNum": "证件编号",
"PayableCapitalContributionAmount": "实缴投资方金额",
"PayableCapitalContributionCurrency": "实缴投资方币种",
"PayableContributionProportion": "实缴投资方出资比例",
"TotalInvestment": "出资总额",
"HoldingInstitution": "控股机构",
"TaxRegistrationInformation": "税务登记信息",
......
......@@ -2979,9 +2979,11 @@
orgTotal: data.length,
amountTotal: amountTotal,
proportionTotal: proportionTotal
}
};
if($scope.EquitySumInfo.proportionTotal!==100){
$scope.isNotHundred=true;
}else{
$scope.isNotHundred=false;
}
} else {
SweetAlert.warning($translate.instant('NoEquityInfo'));
......
......@@ -33,6 +33,7 @@ controller('editEquityChangeModalController', ['$scope', '$log', '$translate', '
// 保存股权
$scope.saveEquity = function () {
$scope.equityControlForm.$setSubmitted();
var rows = $scope.equityListInstance.getVisibleRows();
var updateEquity = [];
for (var i = 0; i < rows.length; i++) {
......
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