Merge branch 'release/3.0.0.2311.01' into release/个税版本
This commit is contained in:
commit
b050888b7b
|
|
@ -1705,15 +1705,6 @@ public class SIArchivesBiz {
|
|||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要生成历史福利档案基本信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.salary.biz;
|
|||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO;
|
||||
|
|
@ -409,7 +408,7 @@ public class SISchemeBiz {
|
|||
insuranceSchemeMapper.insert(batchPO);
|
||||
|
||||
List<InsuranceSchemeDetailPO> detailList = insuranceSchemeDetailMapper.queryListBySchemeId(id);
|
||||
detailList = decryptSchemeDetailList(detailList);
|
||||
detailList = encryptUtil.decryptList(detailList,InsuranceSchemeDetailPO.class);
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
List<InsuranceSchemeDetailPO> detailPOS = detailList.stream().map(item -> InsuranceSchemeDetailPO.builder()
|
||||
.creator(employeeId)
|
||||
|
|
@ -461,16 +460,6 @@ public class SISchemeBiz {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
public int checkBeforeDeleteSocialscheme(Map<String, Object> params) {
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>) params.get("ids")).get(0).getNum();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ public class DataCollectionEmployee {
|
|||
private Double workYear;
|
||||
private Double companyWorkYear;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 98624, dataType = "string")
|
||||
private String idNo;
|
||||
|
||||
//是否是系统管理员
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ public class SalaryAcctFormulaBO {
|
|||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.build();
|
||||
return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ public class SalaryAcctImportFieldDTO {
|
|||
|
||||
//薪资项目名称
|
||||
private String salaryItemName;
|
||||
|
||||
//薪资项目类型
|
||||
private String dataType;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public class SalaryFormulaEmployeeDTO {
|
|||
private String sex;
|
||||
|
||||
|
||||
// @SalaryFormulaVar(defaultLabel = "证件号码", labelId = 86318, dataType = "string")
|
||||
// private String idNo;
|
||||
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 86318, dataType = "string")
|
||||
private String idNo;
|
||||
|
||||
//邮件
|
||||
@SalaryFormulaVar(defaultLabel = "邮件", labelId = 92919, dataType = "string")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.formlua.util;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.formlua.entity.parameter.FormulaContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -11,217 +12,223 @@ import java.util.regex.PatternSyntaxException;
|
|||
|
||||
|
||||
public class ExpressRegularUtil {
|
||||
private static final String[] checkRegularNullParameter=new String[]{"TRUE","FALSE","NOW","TODAY"};
|
||||
private static final String[] operSymbs=new String[]{">",">=","=","<","<=","\\+","-","\\*","\\/","!="};
|
||||
private static final String checkRegularParameter="AND|OR|IF|NOT|LIKE|DATEDIFF|DATEADD|WEEKNUM|WEEKDAY|DATEFORMAT|Y|M|D|H|I|S|COUNT|SUM|MAX|MIN|CONCAT|SEARCH|TEXT|PAD|REPLACE|VALUE|LEN|LEFT|RIGHT|MID";
|
||||
private final static String leftCircleBracket="Unmatched closing '('";
|
||||
private final static String rightCircleBracket="Unmatched closing ')'";
|
||||
private final static String leftSquareBracket="Unmatched closing '['";
|
||||
private final static String rightSquareeBracket="Unmatched closing ']'";
|
||||
private final static String leftBigBracket="Unmatched closing '{'";
|
||||
private final static String rightBigBracket="Unmatched closing '}'";
|
||||
public static boolean checkFuncExpress(String str){
|
||||
filter(str);
|
||||
return true;
|
||||
}
|
||||
private static final String[] checkRegularNullParameter = new String[]{"TRUE", "FALSE", "NOW", "TODAY"};
|
||||
private static final String[] operSymbs = new String[]{">", ">=", "=", "<", "<=", "\\+", "-", "\\*", "\\/", "!="};
|
||||
private static final String checkRegularParameter = "AND|OR|IF|NOT|LIKE|DATEDIFF|DATEADD|WEEKNUM|WEEKDAY|DATEFORMAT|Y|M|D|H|I|S|COUNT|SUM|MAX|MIN|CONCAT|SEARCH|TEXT|PAD|REPLACE|VALUE|LEN|LEFT|RIGHT|MID";
|
||||
private final static String leftCircleBracket = "Unmatched closing '('";
|
||||
private final static String rightCircleBracket = "Unmatched closing ')'";
|
||||
private final static String leftSquareBracket = "Unmatched closing '['";
|
||||
private final static String rightSquareeBracket = "Unmatched closing ']'";
|
||||
private final static String leftBigBracket = "Unmatched closing '{'";
|
||||
private final static String rightBigBracket = "Unmatched closing '}'";
|
||||
|
||||
public static boolean isContainChinese(String str) {
|
||||
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
|
||||
Matcher m = p.matcher(str);
|
||||
if (m.find()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean checkFuncExpress(String str) {
|
||||
filter(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void filter(String formula){
|
||||
try {
|
||||
testSymbol(formula);
|
||||
checkNullRegular(formula);
|
||||
checkOperatorNullParam(formula);
|
||||
formula=formula.replaceAll("","#");
|
||||
String leftReplace="";
|
||||
String rightReplace="";
|
||||
leftReplace=formula.replaceAll("\\(","");
|
||||
rightReplace=formula.replaceAll("\\)","");
|
||||
if(leftReplace.length()>rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftCircleBracket,formula,formula.lastIndexOf(")"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if(leftReplace.length()<rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightCircleBracket,formula,formula.indexOf("("));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
public static boolean isContainChinese(String str) {
|
||||
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
|
||||
Matcher m = p.matcher(str);
|
||||
if (m.find()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
leftReplace=formula.replaceAll("\\{","");
|
||||
rightReplace=formula.replaceAll("}","");
|
||||
if(leftReplace.length()>rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftBigBracket,formula,formula.lastIndexOf("}"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if(leftReplace.length()<rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightBigBracket,formula,formula.indexOf("{"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
private static void filter(String formula) {
|
||||
try {
|
||||
testSymbol(formula);
|
||||
checkNullRegular(formula);
|
||||
checkOperatorNullParam(formula);
|
||||
formula = formula.replaceAll("", "#");
|
||||
String leftReplace = "";
|
||||
String rightReplace = "";
|
||||
leftReplace = formula.replaceAll("\\(", "");
|
||||
rightReplace = formula.replaceAll("\\)", "");
|
||||
if (leftReplace.length() > rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftCircleBracket, formula, formula.lastIndexOf(")"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if (leftReplace.length() < rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightCircleBracket, formula, formula.indexOf("("));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
|
||||
leftReplace=formula.replaceAll("\\[","");
|
||||
rightReplace=formula.replaceAll("]","");
|
||||
if(leftReplace.length()>rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftSquareBracket,formula,formula.lastIndexOf("]"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if(leftReplace.length()<rightReplace.length()){
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightSquareeBracket,formula,formula.indexOf("["));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
leftReplace = formula.replaceAll("\\{", "");
|
||||
rightReplace = formula.replaceAll("}", "");
|
||||
if (leftReplace.length() > rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftBigBracket, formula, formula.lastIndexOf("}"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if (leftReplace.length() < rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightBigBracket, formula, formula.indexOf("{"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
|
||||
} catch (PatternSyntaxException e) {
|
||||
String error=e.getDescription().trim();
|
||||
int errorIdx=e.getIndex();
|
||||
int errorEndIdx=-1;
|
||||
switch (error){
|
||||
case leftCircleBracket:
|
||||
error="'('括号没有找到";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case rightCircleBracket:
|
||||
error="'('括号没有闭合";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case leftSquareBracket:
|
||||
error="'['括号没有找到";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case rightSquareeBracket:
|
||||
error="'['括号没有闭合";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case leftBigBracket:
|
||||
error="'{'括号没有找到";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case rightBigBracket:
|
||||
error="'{'括号没有闭合";
|
||||
errorEndIdx=-1;
|
||||
break;
|
||||
case "TRUE函数不能有参数":
|
||||
errorEndIdx=errorIdx+4;
|
||||
break;
|
||||
case "FALSE函数不能有参数":
|
||||
errorEndIdx=errorIdx+5;
|
||||
break;
|
||||
case "NOW函数不能有参数":
|
||||
errorEndIdx=errorIdx+3;
|
||||
break;
|
||||
case "TODAY函数不能有参数":
|
||||
errorEndIdx=errorIdx+5;
|
||||
break;
|
||||
leftReplace = formula.replaceAll("\\[", "");
|
||||
rightReplace = formula.replaceAll("]", "");
|
||||
if (leftReplace.length() > rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftSquareBracket, formula, formula.lastIndexOf("]"));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
if (leftReplace.length() < rightReplace.length()) {
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightSquareeBracket, formula, formula.indexOf("["));
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
|
||||
}
|
||||
JSONObject catchJson=null;
|
||||
if(errorEndIdx<0){
|
||||
catchJson= ErrorUtil.buildError(formula,errorIdx+1,null,error);
|
||||
}else {
|
||||
catchJson= ErrorUtil.buildError(formula,errorIdx+1,errorEndIdx,null,error);
|
||||
}
|
||||
} catch (PatternSyntaxException e) {
|
||||
String error = e.getDescription().trim();
|
||||
int errorIdx = e.getIndex();
|
||||
int errorEndIdx = -1;
|
||||
switch (error) {
|
||||
case leftCircleBracket:
|
||||
error = "'('括号没有找到";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case rightCircleBracket:
|
||||
error = "'('括号没有闭合";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case leftSquareBracket:
|
||||
error = "'['括号没有找到";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case rightSquareeBracket:
|
||||
error = "'['括号没有闭合";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case leftBigBracket:
|
||||
error = "'{'括号没有找到";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case rightBigBracket:
|
||||
error = "'{'括号没有闭合";
|
||||
errorEndIdx = -1;
|
||||
break;
|
||||
case "TRUE函数不能有参数":
|
||||
errorEndIdx = errorIdx + 4;
|
||||
break;
|
||||
case "FALSE函数不能有参数":
|
||||
errorEndIdx = errorIdx + 5;
|
||||
break;
|
||||
case "NOW函数不能有参数":
|
||||
errorEndIdx = errorIdx + 3;
|
||||
break;
|
||||
case "TODAY函数不能有参数":
|
||||
errorEndIdx = errorIdx + 5;
|
||||
break;
|
||||
|
||||
catchJson.put("formula",formula);
|
||||
throw new PatternSyntaxException(catchJson.toJSONString(),null,errorIdx+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject catchJson = null;
|
||||
if (errorEndIdx < 0) {
|
||||
catchJson = ErrorUtil.buildError(formula, errorIdx + 1, null, error);
|
||||
} else {
|
||||
catchJson = ErrorUtil.buildError(formula, errorIdx + 1, errorEndIdx, null, error);
|
||||
}
|
||||
|
||||
private static void checkNullRegular(String formula){
|
||||
String filterPattern=null;
|
||||
for(int i=0;i<checkRegularNullParameter.length;i++){
|
||||
int eidx=formula.indexOf(checkRegularNullParameter[i]);
|
||||
if(eidx>=0){
|
||||
if(FormulaContext.get().getValue(checkRegularNullParameter[i])!=null){
|
||||
Integer paramCount=FormulaContext.get().getValue(checkRegularNullParameter[i]);
|
||||
paramCount++;
|
||||
FormulaContext.get().setValue(checkRegularNullParameter[i]);
|
||||
}else {
|
||||
FormulaContext.get().setValue(checkRegularNullParameter[i]);
|
||||
}
|
||||
filterPattern=checkRegularNullParameter[i]+"{1}\\({1}\\){1}";
|
||||
Pattern pattern= Pattern.compile(filterPattern);
|
||||
Matcher matcher=pattern.matcher(formula);
|
||||
boolean excuteBool=matcher.find();
|
||||
if(!excuteBool){
|
||||
eidx=0;
|
||||
Integer errorCount=FormulaContext.get().getFormulaJson().getInteger(checkRegularNullParameter[i]);
|
||||
String [] errorCutArray=formula.split(checkRegularNullParameter[i]);
|
||||
for (int fi=0;fi<errorCount;fi++){
|
||||
eidx+=errorCutArray[fi].length();
|
||||
if(errorCutArray.length>1&&fi>0){
|
||||
eidx+=checkRegularNullParameter[i].length();
|
||||
}
|
||||
}
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(checkRegularNullParameter[i]+"函数不能有参数",formula,eidx);
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
}else {
|
||||
catchJson.put("formula", formula);
|
||||
throw new PatternSyntaxException(catchJson.toJSONString(), null, errorIdx + 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void checkNullRegular(String formula) {
|
||||
String filterPattern = null;
|
||||
for (int i = 0; i < checkRegularNullParameter.length; i++) {
|
||||
int eidx = formula.indexOf(checkRegularNullParameter[i]);
|
||||
if (eidx >= 0) {
|
||||
if (FormulaContext.get().getValue(checkRegularNullParameter[i]) != null) {
|
||||
Integer paramCount = FormulaContext.get().getValue(checkRegularNullParameter[i]);
|
||||
paramCount++;
|
||||
FormulaContext.get().setValue(checkRegularNullParameter[i]);
|
||||
} else {
|
||||
FormulaContext.get().setValue(checkRegularNullParameter[i]);
|
||||
}
|
||||
filterPattern = checkRegularNullParameter[i] + "{1}\\({1}\\){1}";
|
||||
Pattern pattern = Pattern.compile(filterPattern);
|
||||
Matcher matcher = pattern.matcher(formula);
|
||||
boolean excuteBool = matcher.find();
|
||||
if (!excuteBool) {
|
||||
eidx = 0;
|
||||
Integer errorCount = FormulaContext.get().getFormulaJson().getInteger(checkRegularNullParameter[i]);
|
||||
String[] errorCutArray = formula.split(checkRegularNullParameter[i]);
|
||||
for (int fi = 0; fi < errorCount; fi++) {
|
||||
eidx += errorCutArray[fi].length();
|
||||
if (errorCutArray.length > 1 && fi > 0) {
|
||||
eidx += checkRegularNullParameter[i].length();
|
||||
}
|
||||
}
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(checkRegularNullParameter[i] + "函数不能有参数", formula, eidx);
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
} else {
|
||||
|
||||
private static void checkOperatorNullParam(String formula){
|
||||
formula=formula.trim();
|
||||
JSONObject errorJson=new JSONObject();
|
||||
Map<String,Integer> operMap=new HashMap<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<operSymbs.length;i++){
|
||||
String operSymb=operSymbs[i];
|
||||
if(formula.indexOf(operSymb)<0){
|
||||
continue;
|
||||
}
|
||||
if(operMap.get(operSymb)==null){
|
||||
operMap.put(operSymb,1);
|
||||
}else{
|
||||
operMap.put(operSymb,operMap.get(operSymb)+1);
|
||||
}
|
||||
String commonP="("+operSymb+")";
|
||||
Pattern wrongPone=Pattern.compile("^.+"+commonP+"+?$");
|
||||
Pattern wrongPtwo=Pattern.compile("^"+commonP+"+?.+$");
|
||||
Pattern wrongPthree=Pattern.compile("^"+commonP+"+?$");
|
||||
private static void checkOperatorNullParam(String formula) {
|
||||
formula = formula.trim();
|
||||
JSONObject errorJson = new JSONObject();
|
||||
Map<String, Integer> operMap = new HashMap<>();
|
||||
|
||||
Matcher m=wrongPone.matcher(formula);
|
||||
for (int i = 0; i < operSymbs.length; i++) {
|
||||
String operSymb = operSymbs[i];
|
||||
if (formula.indexOf(operSymb) < 0) {
|
||||
continue;
|
||||
}
|
||||
if (operMap.get(operSymb) == null) {
|
||||
operMap.put(operSymb, 1);
|
||||
} else {
|
||||
operMap.put(operSymb, operMap.get(operSymb) + 1);
|
||||
}
|
||||
String commonP = "(" + operSymb + ")";
|
||||
Pattern wrongPone = Pattern.compile("^.+" + commonP + "+?$");
|
||||
Pattern wrongPtwo = Pattern.compile("^" + commonP + "+?.+$");
|
||||
Pattern wrongPthree = Pattern.compile("^" + commonP + "+?$");
|
||||
|
||||
if(m.find()){
|
||||
errorJson= ErrorUtil.buildError(operSymb,formula.length(),operMap.get(operSymb),"操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
Matcher m = wrongPone.matcher(formula);
|
||||
|
||||
Matcher mtwo=wrongPtwo.matcher(formula);
|
||||
if(mtwo.find()){
|
||||
errorJson= ErrorUtil.buildError(operSymb,1,operMap.get(operSymb),"操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
if (m.find()) {
|
||||
errorJson = ErrorUtil.buildError(operSymb, formula.length(), operMap.get(operSymb), "操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
|
||||
Matcher mthree=wrongPthree.matcher(formula);
|
||||
if(mthree.find()){
|
||||
errorJson= ErrorUtil.buildError(operSymb,1,operMap.get(operSymb),"操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
Matcher mtwo = wrongPtwo.matcher(formula);
|
||||
if (mtwo.find()) {
|
||||
//-,负数特殊处理
|
||||
if (StringUtils.equals(operSymb, "-")) {
|
||||
return;
|
||||
}
|
||||
errorJson = ErrorUtil.buildError(operSymb, 1, operMap.get(operSymb), "操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
|
||||
}
|
||||
Matcher mthree = wrongPthree.matcher(formula);
|
||||
if (mthree.find()) {
|
||||
errorJson = ErrorUtil.buildError(operSymb, 1, operMap.get(operSymb), "操作符两端的参数不能为空");
|
||||
throw new RuntimeException(errorJson.getString("msg"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static void testSymbol(String formula){
|
||||
Pattern pattern=Pattern.compile(",+?\\s*\\)");
|
||||
Matcher m=pattern.matcher(formula);
|
||||
if(m.find()){
|
||||
int idx=formula.indexOf(m.group());
|
||||
PatternSyntaxException patternSyntaxException=new PatternSyntaxException("参数格式错误",formula,idx);
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]){
|
||||
public static void testSymbol(String formula) {
|
||||
Pattern pattern = Pattern.compile(",+?\\s*\\)");
|
||||
Matcher m = pattern.matcher(formula);
|
||||
if (m.find()) {
|
||||
int idx = formula.indexOf(m.group());
|
||||
PatternSyntaxException patternSyntaxException = new PatternSyntaxException("参数格式错误", formula, idx);
|
||||
throw patternSyntaxException;
|
||||
}
|
||||
}
|
||||
|
||||
checkOperatorNullParam(" abc>=");
|
||||
}
|
||||
public static void main(String args[]) {
|
||||
|
||||
checkOperatorNullParam(" abc>=");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.engine.salary.service;
|
|||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资报表
|
||||
|
|
@ -15,23 +14,6 @@ import java.util.List;
|
|||
**/
|
||||
public interface SalaryAcctReportService {
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
List<String> decrypt(List<String> s);
|
||||
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
String decrypt(String s);
|
||||
|
||||
/**
|
||||
* 保存核算记录报表数据
|
||||
* @param pos
|
||||
|
|
|
|||
|
|
@ -1477,16 +1477,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
}
|
||||
|
||||
|
||||
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
|
||||
encryptList.forEach(item -> {
|
||||
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
|
||||
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
|
||||
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
|
||||
});
|
||||
return encryptList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验待新增的社保福利档案数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.*;
|
||||
|
|
@ -442,6 +443,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
.map(salarySobItemPO -> SalaryAcctImportFieldDTO.ImportFieldDTO.builder()
|
||||
.salaryItemId(salarySobItemPO.getSalaryItemId())
|
||||
.salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY))
|
||||
.dataType(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getDataType).orElse(SalaryDataTypeEnum.NUMBER.getValue()))
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
|
@ -458,6 +460,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
.map(salarySobItemPO ->SalaryAcctImportFieldDTO.ImportFieldDTO.builder()
|
||||
.salaryItemId(salarySobItemPO.getSalaryItemId())
|
||||
.salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY))
|
||||
.dataType(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getDataType).orElse(SalaryDataTypeEnum.NUMBER.getValue()))
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import com.engine.salary.sys.enums.OpenEnum;
|
|||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -42,31 +41,6 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> decrypt(List<String> s) {
|
||||
if (s != null) {
|
||||
return s.stream().map(AESEncryptUtil::decrypt).collect(Collectors.toList());
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
* @param s 待解密字符串
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String decrypt(String s) {
|
||||
return AESEncryptUtil.decrypt(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存核算报表数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -354,6 +354,29 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
|
||||
@Override
|
||||
public Map<String, Object> sumRow(SalaryAcctResultQueryParam queryParam) {
|
||||
|
||||
//其他条件
|
||||
List<SalaryAcctResultQueryParam.OtherCondition> otherConditions = queryParam.getOtherConditions();
|
||||
if(CollectionUtils.isNotEmpty(otherConditions)){
|
||||
List<Long> items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList());
|
||||
List<SalaryAcctResultPO> list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items);
|
||||
for (int i = 0; i < otherConditions.size(); i++) {
|
||||
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
|
||||
Long itemId = otherCondition.getItemId();
|
||||
FilterEnum filter = otherCondition.getFilter();
|
||||
List<String> params = otherCondition.getParams();
|
||||
list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList());
|
||||
}
|
||||
List<Long> salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmpId)) {
|
||||
//条件不满足直接返回空列表
|
||||
return new HashMap<>();
|
||||
} else {
|
||||
queryParam.setIds(salaryAcctEmpId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByResultQueryParam(queryParam);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
|
|
@ -17,7 +16,10 @@ import com.engine.salary.entity.salaryformula.ExpressFormula;
|
|||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper;
|
||||
|
|
@ -268,14 +270,4 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary
|
|||
public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||
getExcelAcctResultMapper().deleteBySalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
}
|
||||
|
||||
private Collection<ExcelAcctResultPO> encryptCollection(Collection<ExcelAcctResultPO> collection) {
|
||||
collection.forEach(item -> item.setResultValue(AESEncryptUtil.encrypt(item.getResultValue())));
|
||||
return collection;
|
||||
}
|
||||
|
||||
private Collection<ExcelAcctResultPO> decryptCollection(Collection<ExcelAcctResultPO> collection) {
|
||||
collection.forEach(item -> item.setResultValue(AESEncryptUtil.decrypt(item.getResultValue())));
|
||||
return collection;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.engine.salary.transmethod;
|
||||
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
|
||||
public class EncryptTransMethod {
|
||||
public static String decrypt(String source) {
|
||||
return AESEncryptUtil.decrypt(source);
|
||||
}
|
||||
// public static String decrypt(String source) {
|
||||
// return AESEncryptUtil.decrypt(source);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SISchemeWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -48,15 +49,16 @@ import java.util.stream.Collectors;
|
|||
* @Date 2022/3/7
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SISchemeController {
|
||||
|
||||
private SISchemeService getService(User user) {
|
||||
return ServiceUtil.getService(SISchemeServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SISchemeWrapper getSISchemeWrapper(User user) {
|
||||
|
||||
return ServiceUtil.getService(SISchemeWrapper.class,user);
|
||||
return ServiceUtil.getService(SISchemeWrapper.class, user);
|
||||
}
|
||||
|
||||
private SIAccountService getSIAccountService(User user) {
|
||||
|
|
@ -65,6 +67,7 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 查询福利方案表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -77,13 +80,14 @@ public class SISchemeController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
//InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build();
|
||||
map.put("welfareTypeEnum",welfareTypeEnum);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm,map);
|
||||
map.put("welfareTypeEnum", welfareTypeEnum);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm, map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询福利方案列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -99,6 +103,7 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -109,12 +114,13 @@ public class SISchemeController {
|
|||
public String insertScheme(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::insertScheme,map);
|
||||
map.put("insuranceSchemeReqParam", insuranceSchemeReqParam);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::insertScheme, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑方案主表和明细表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceSchemeReqParam
|
||||
|
|
@ -123,15 +129,16 @@ public class SISchemeController {
|
|||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update,map);
|
||||
map.put("insuranceSchemeReqParam", insuranceSchemeReqParam);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑方案明细表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param schemeDetailList
|
||||
|
|
@ -140,13 +147,14 @@ public class SISchemeController {
|
|||
@POST
|
||||
@Path("/updateSchemeDetail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateSchemeDetail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody List<InsuranceSchemeDetailUpdateParam> schemeDetailList) {
|
||||
public String updateSchemeDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody List<InsuranceSchemeDetailUpdateParam> schemeDetailList) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult< List<InsuranceSchemeDetailUpdateParam> , List<String>>(user).run(getService(user)::updateSchemeDetail,schemeDetailList);
|
||||
return new ResponseResult<List<InsuranceSchemeDetailUpdateParam>, List<String>>(user).run(getService(user)::updateSchemeDetail, schemeDetailList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除(接口中暂无)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceSchemeReqParam
|
||||
|
|
@ -158,13 +166,14 @@ public class SISchemeController {
|
|||
public String deleteTaxRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("ids",insuranceSchemeReqParam.getIds());
|
||||
map.put("ids", insuranceSchemeReqParam.getIds());
|
||||
map.put("welfareTypeId", insuranceSchemeReqParam.getWelfareTypeEnum().getValue());
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete,map);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制福利方案表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
|
|
@ -176,55 +185,61 @@ public class SISchemeController {
|
|||
@QueryParam("id") Long id, @QueryParam("schemeName") String schemeName) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("id",id);
|
||||
map.put("schemeName",schemeName);
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::copyScheme,map);
|
||||
map.put("id", id);
|
||||
map.put("schemeName", schemeName);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::copyScheme, map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出档案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).export(param);
|
||||
String fileName ;
|
||||
//表头
|
||||
if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
|
||||
try {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).export(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
|
||||
}
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("社保福利档案导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -248,58 +263,63 @@ public class SISchemeController {
|
|||
|
||||
/**
|
||||
* 导出档案和档案模板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
|
||||
InsuranceArchivesListParam param = buildInsuranceArchivesListParam(request);
|
||||
|
||||
param.setExportData(Boolean.valueOf(request.getParameter("exportData")));
|
||||
param.setExtWelArchiveList(Boolean.valueOf(request.getParameter("extWelArchiveList")));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
if (param.getInspectAll() != null && param.getInspectAll()) {
|
||||
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getSIAccountService(user).allInspects(param.getIds(), param.getBillMonth());
|
||||
param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
XSSFWorkbook workbook = getService(user).exportTemplate(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.isExtWelArchiveList()) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(0, "社保福利档案导入模板") + "-" + SalaryI18nUtil.getI18nLabel(542679, "非系统人员");
|
||||
} else if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
|
||||
param.setExportData(Boolean.valueOf(request.getParameter("exportData")));
|
||||
param.setExtWelArchiveList(Boolean.valueOf(request.getParameter("extWelArchiveList")));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
if (param.getInspectAll() != null && param.getInspectAll()) {
|
||||
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getSIAccountService(user).allInspects(param.getIds(), param.getBillMonth());
|
||||
param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
XSSFWorkbook workbook = getService(user).exportTemplate(param);
|
||||
String fileName;
|
||||
//表头
|
||||
if (param.isExtWelArchiveList()) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(0, "社保福利档案导入模板") + "-" + SalaryI18nUtil.getI18nLabel(542679, "非系统人员");
|
||||
} else if (param.getRunStatuses().size() > 0) {
|
||||
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
|
||||
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
}
|
||||
} else {
|
||||
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
|
||||
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("社保福利档案模板导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
fileName = fileName + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
return Response.ok(output)
|
||||
.header("Content-disposition", "attachment;filename=" + fileName)
|
||||
.header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
@ -307,13 +327,13 @@ public class SISchemeController {
|
|||
InsuranceArchivesListParam param = new InsuranceArchivesListParam();
|
||||
|
||||
String ids = request.getParameter("ids");
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
param.setIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
param.setIds(Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String runStatuses = request.getParameter("runStatuses");
|
||||
if(StringUtils.isNotBlank(runStatuses)){
|
||||
param.setRunStatuses( Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
|
||||
if (StringUtils.isNotBlank(runStatuses)) {
|
||||
param.setRunStatuses(Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String statusesStr = request.getParameter("statusesStr");
|
||||
|
|
@ -360,5 +380,4 @@ public class SISchemeController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue