Commit 2ae2b6d9 authored by hongguangwu's avatar hongguangwu

&& !"".equals(obj)

parent 9ea3d0e1
......@@ -222,8 +222,7 @@ public class TSalaryAccount {
/**
* 年终奖扣税方案0:合并;1:单独
*/
@ExcelAttribute(name = "年终奖扣税方案0:合并;1:单独", isNotEmpty = true, errorInfo = "年终奖扣税方案0:合并;1:单独不能为空", maxLength = 1)
@NotBlank(message = "年终奖扣税方案0:合并;1:单独不能为空")
@ExcelAttribute(name = "年终奖扣税方案0:合并;1:单独", maxLength = 1)
@Length(max = 1, message = "年终奖扣税方案0:合并;1:单独不能超过1个字符")
@ExcelProperty("年终奖扣税方案0:合并;1:单独")
private String annualBonusType;
......
......@@ -202,6 +202,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
......
......@@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -41,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeVo;
import lombok.extern.log4j.Log4j2;
......@@ -282,15 +284,20 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
TCheckBankNo checkIdCard = new TCheckBankNo();
checkIdCard.setName(employee.getEmpName());
checkIdCard.setBankNo(employee.getBankNo());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", checkIdCard, TCheckBankNo.class, SecurityConstants.FROM_IN);
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", checkIdCard, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
TCheckBankNo check = checkListR.getData();
if (!CommonConstants.ONE_STRING.equals(check.getResult())) {
return check.getMessage();
CheckBankNoVo vo = checkListR.getData();
TCheckBankNo check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
return SalaryConstants.CHECK_NO_RESPONSE;
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
return vo.getRes().getMsg();
} else if (check != null && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
return check.getRemark();
}
} else {
return "校验服务未找到银行卡,请联系管理员";
return SalaryConstants.CHECK_NO_RESPONSE;
}
}
// 手机号
......
......@@ -125,7 +125,10 @@ public class SalaryAccountUtil implements Serializable {
String saveNewEmpReturn;
// 每一行是否有错误 true : 无错误
boolean errorFlag;
// 是否含有年终奖 false 没有
boolean annualBonusFlag;
for (int i = 0; i < rows; i++) {
annualBonusFlag = false;
error = "";
errorFlag = true;
temp = list.get(i);
......@@ -140,7 +143,6 @@ public class SalaryAccountUtil implements Serializable {
relaySalary = null;
actualSalarySum = null;
entity.setSettlementMonth(nowMonth);
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[0]);
for (Map.Entry<String, TSalaryConfigStandard> entry : salaryConfigMap.entrySet()) {
cellValueObj = getFieldValueByName(entry.getKey(), temp);
scs = entry.getValue();
......@@ -156,8 +158,16 @@ public class SalaryAccountUtil implements Serializable {
if (isMustMap.get(dbFiedName) != null && Boolean.TRUE.equals(isMustMap.get(dbFiedName))) {
isMustMap.put(dbFiedName, false);
}
if (SalaryConstants.ANNUAL_BONUS_TAX_TYPE.equals(scs.getJavaFiedName()) && SalaryConstants.ANNUAL_BONUS_ALONE.equals(cellValueStr)) {
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[1]);
if (SalaryConstants.ANNUAL_BONUS_JAVA.equals(scs.getJavaFiedName()) && Common.isNotNull(cellValueStr)) {
annualBonusFlag = true;
}
if (SalaryConstants.ANNUAL_BONUS_TAX_TYPE.equals(scs.getJavaFiedName())) {
if (SalaryConstants.ANNUAL_BONUS_ALONE.equals(cellValueStr)) {
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[1]);
}
if (SalaryConstants.ANNUAL_BONUS_MERGE.equals(cellValueStr)) {
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[0]);
}
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(scs.getJavaFiedName())) {
try {
......@@ -282,6 +292,12 @@ public class SalaryAccountUtil implements Serializable {
continue;
}
if (annualBonusFlag && Common.isEmpty(entity.getAnnualBonusType())) {
errorFlag = false;
error = "第" + (i + 2) + "行:年终奖有值,【年终奖扣税方式】需填写【单独】/【合并】";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if ("3".equals(salaryType) && actualSalarySum == null) {
errorFlag = false;
error = "第" + (i + 2) + "行:【实发劳务费】列_不可缺少";
......
......@@ -177,6 +177,7 @@ public class SalaryConstants {
public static final String ANNUAL_BONUS_TAX_TYPE = "annualBonusTaxType";
// 年终奖扣税方式:单独
public static final String ANNUAL_BONUS_ALONE = "单独";
public static final String ANNUAL_BONUS_MERGE = "合并";
// 年终奖扣税方式的值:0合并/1单独
public static final String[] ANNUAL_BONUS_TAX_TYPE_VALUE = {"0","1"};
......@@ -280,4 +281,6 @@ public class SalaryConstants {
public static final String CONFIG_SALARY_REPEAT = "项目薪资配置重复";
//项目薪资权限重复
public static final String DEPT_SEE_REPEAT = "项目薪资权限重复";
public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!";
}
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