|
@@ -27,8 +27,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
-import java.util.regex.Matcher;
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
@Service("costCostingGroupService")
|
|
@@ -118,9 +116,6 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
return Result.build(500, "数据未成功导入", null);
|
|
|
}
|
|
|
// 检验数据的合理性
|
|
|
-
|
|
|
- Pattern pattern = Pattern.compile("[0-9]+(.[0-9]+)?");
|
|
|
- Matcher isNum = pattern.matcher("str");
|
|
|
// 检验成本数据
|
|
|
checkCostData(list, incomeErrorMessageList, departmentMap, productMap, responsibilityMap, accountingMap, responsibilityDepMap, accountProMap, costCostingGroupArrayList, year, month);
|
|
|
// 文件上传
|
|
@@ -144,14 +139,6 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
return Result.build(200, "数据未成功导入", null);
|
|
|
}
|
|
|
}
|
|
|
- public static boolean isNumeric(String str){
|
|
|
- Pattern pattern = Pattern.compile("[0-9]+(.[0-9]+)?");
|
|
|
- Matcher isNum = pattern.matcher(str);
|
|
|
- if( !isNum.matches() ){
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
/**
|
|
|
* 检验成本数据
|
|
|
*
|
|
@@ -193,7 +180,7 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
Integer emptyStatus = 0;
|
|
|
for (int j = 2; j < data.size()-1 ; j++) {
|
|
|
BigDecimal parseInt = new BigDecimal (data.get(j).toString());
|
|
|
- if (!NumberConstant.ZERO.equals(parseInt)) {
|
|
|
+ if (!BigDecimal.ZERO.equals(parseInt)) {
|
|
|
emptyStatus = 1;
|
|
|
break;
|
|
|
}
|
|
@@ -234,9 +221,9 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
// 0表示全为0 1表示不全为0
|
|
|
|
|
|
BigDecimal combined = new BigDecimal (data.get(data.size() - 1).toString());
|
|
|
- if (NumberConstant.ZERO.equals(emptyStatus) && NumberConstant.ZERO.equals(combined)) {
|
|
|
+ if (NumberConstant.ZERO.equals(emptyStatus) &&BigDecimal.ZERO.equals(combined)) {
|
|
|
// 全为0
|
|
|
- } else if (!NumberConstant.ZERO.equals(combined) && NumberConstant.ZERO.equals(emptyStatus)) {
|
|
|
+ } else if (!BigDecimal.ZERO.equals(combined) && NumberConstant.ZERO.equals(emptyStatus)) {
|
|
|
// 这条数据是保存到其他责任中心的
|
|
|
CostCostingGroup costCostingGroup = costCostingGroupRequest;
|
|
|
// TODO 设置其他责任中心
|