Commit af41b75c authored by huyuchen's avatar huyuchen

ldap同步用户部门问题修改

parent cc0c64d8
...@@ -108,6 +108,9 @@ public class TEmployeeInfoController { ...@@ -108,6 +108,9 @@ public class TEmployeeInfoController {
menuUtil.setAuthSql(user, tEmployeeInfo); menuUtil.setAuthSql(user, tEmployeeInfo);
if (Common.isNotNull(tEmployeeInfo.getAuthSql()) && tEmployeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) { if (Common.isNotNull(tEmployeeInfo.getAuthSql()) && tEmployeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tEmployeeInfo.setAuthSql(tEmployeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID")); tEmployeeInfo.setAuthSql(tEmployeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID"));
if (tEmployeeInfo.getAuthSql().contains("1=2 or ")) {
tEmployeeInfo.setAuthSql(tEmployeeInfo.getAuthSql().replace("1=2 or ", ""));
}
} }
return R.ok(tEmployeeInfoService.getLeavePage(page, tEmployeeInfo)); return R.ok(tEmployeeInfoService.getLeavePage(page, tEmployeeInfo));
} }
......
...@@ -69,6 +69,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -69,6 +69,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -235,9 +236,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -235,9 +236,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<String> idList = Common.initStrToList(ids, CommonConstants.COMMA_STRING); List<String> idList = Common.initStrToList(ids, CommonConstants.COMMA_STRING);
TPaymentInfo paymentInfo; TPaymentInfo paymentInfo;
for (String id : idList) { if (idList != null) {
paymentInfo = baseMapper.selectById(id); for (String id : idList) {
if (null != paymentInfo && Common.isNotNull(paymentInfo.getId())) { paymentInfo = baseMapper.selectById(id);
if ((!user.getId().equals(paymentInfo.getCreateBy()) && if ((!user.getId().equals(paymentInfo.getCreateBy()) &&
!CommonConstants.ONE_STRING.equals(user.getId())) || !CommonConstants.ONE_STRING.equals(user.getId())) ||
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus())) { CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus())) {
...@@ -275,7 +276,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -275,7 +276,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfo> list = baseMapper.selectList(wrapper); List<TPaymentInfo> list = baseMapper.selectList(wrapper);
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
Boolean delFlag = false; boolean delFlag = false;
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
for (TPaymentInfo paymentInfo : list) { for (TPaymentInfo paymentInfo : list) {
if ((!user.getId().equals(paymentInfo.getCreateBy()) && if ((!user.getId().equals(paymentInfo.getCreateBy()) &&
...@@ -608,7 +609,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -608,7 +609,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (int i = lastIdx + 1; i < list.size(); i++) { for (int i = lastIdx + 1; i < list.size(); i++) {
tempList.add(list.get(i)); tempList.add(list.get(i));
} }
lastIdx += 1;
} }
List<TPaymentInfoVo> finalTempList = tempList; List<TPaymentInfoVo> finalTempList = tempList;
...@@ -1590,7 +1590,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1590,7 +1590,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (int i = lastIdx + 1; i < list.size(); i++) { for (int i = lastIdx + 1; i < list.size(); i++) {
tempList.add(list.get(i)); tempList.add(list.get(i));
} }
lastIdx += 1;
} }
List<TPaymentHeFeiVo> finalTempList = tempList; List<TPaymentHeFeiVo> finalTempList = tempList;
...@@ -2469,14 +2468,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2469,14 +2468,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
} }
for (String key: map.keySet()) { for (Map.Entry<String,Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError(); TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date()); error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay()); error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING); error.setType(CommonConstants.THREE_STRING);
error.setLinkId(idMap.get(key)); error.setLinkId(idMap.get(entry.getKey()));
error.setTitle(key); error.setTitle(entry.getKey());
error.setNums(map.get(key)); error.setNums(entry.getValue());
tSendEkpErrorService.save(error); tSendEkpErrorService.save(error);
} }
//更新推送状态 //更新推送状态
...@@ -2640,14 +2639,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2640,14 +2639,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
} }
for (String key: map.keySet()) { for (Map.Entry<String,Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError(); TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date()); error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay()); error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING); error.setType(CommonConstants.THREE_STRING);
error.setLinkId(idMap.get(key)); error.setLinkId(idMap.get(entry.getKey()));
error.setTitle(key); error.setTitle(entry.getKey());
error.setNums(map.get(key)); error.setNums(entry.getValue());
tSendEkpErrorService.save(error); tSendEkpErrorService.save(error);
} }
//更新推送状态 //更新推送状态
...@@ -2710,78 +2709,74 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2710,78 +2709,74 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 含有社保,则计算收入 // 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING) if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING) && CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) { && CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
//预估模式 //预估模式
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { //预估模式只有按人次和人数收费
//预估模式只有按人次和人数收费 if (!exitFlag) {
if (!exitFlag) { createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING, settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee(), socialFundFlag, detailList);
settleDomain.getManagementFee(), socialFundFlag, detailList); }
} } else {
BigDecimal gMoney;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
BigDecimal gMoney; isSum = 1;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) { if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = settleDomain.getManagementFee(); gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { settleDomain.getManagementFee().divide(new BigDecimal("100"),
gMoney = settleDomain.getManagementFee(); CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else { } else {
isSum = 1; gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) { settleDomain.getManagementFee().divide(new BigDecimal("100"),
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag || isSum == 1) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag, detailList);
} }
} }
if (!exitFlag || isSum == 1) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag, detailList);
}
} }
} }
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING) if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING) && CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) { && CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
//预估模式 //预估模式
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (!exitFlag) {
if (!exitFlag) { createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING, settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(), settleDomain.getRiskFundFee(), socialFundFlag, detailList);
settleDomain.getRiskFundFee(), socialFundFlag, detailList); }
} } else {
} else { if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) { BigDecimal money;
BigDecimal money; if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) { money = settleDomain.getRiskFundFee();
money = settleDomain.getRiskFundFee(); } else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) { money = settleDomain.getRiskFundFee();
money = settleDomain.getRiskFundFee(); } else {
isSum = 2;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else { } else {
isSum = 2; money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) { settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag || isSum == 2) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag, detailList);
} }
} }
if (!exitFlag || isSum == 2) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag, detailList);
}
} }
} }
} }
......
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