|
|
@ -26,7 +26,6 @@ |
|
|
|
package com.yxt.anrui.scm.biz.scmvehrebate; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -39,16 +38,13 @@ import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.scm.api.scmcollectionrebate.ScmCollectionRebateVo; |
|
|
|
import com.yxt.anrui.scm.api.scmspecialrebate.ScmSpecialRebateExcelVo; |
|
|
|
import com.yxt.anrui.scm.api.scmvehrebate.*; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
@ -661,7 +657,15 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
scmVehRebate.setRebateTypeValue(info.getRebateTypeValue()); |
|
|
|
scmVehRebate.setRebateName(info.getRebateName()); |
|
|
|
scmVehRebate.setCalculationStandard(info.getCalculationStandard()); |
|
|
|
scmVehRebate.setEstimateRebate(info.getEstimateRebate()); |
|
|
|
if (StringUtils.isNotBlank(info.getCalculationModeValue())) { |
|
|
|
String calculationModeValue = info.getCalculationModeValue(); |
|
|
|
if (calculationModeValue.equals("比例")) { |
|
|
|
scmVehRebate.setCalculationModeKey("001"); |
|
|
|
} else { |
|
|
|
scmVehRebate.setCalculationModeKey("002"); |
|
|
|
} |
|
|
|
scmVehRebate.setCalculationModeValue(info.getCalculationModeValue()); |
|
|
|
} |
|
|
|
scmVehRebate.setPalceGenDate(info.getPalceGenDate()); |
|
|
|
scmVehRebate.setExpectTreatCost(new BigDecimal(info.getExpectTreatCost())); |
|
|
|
scmVehRebate.setExpectSuppCost(new BigDecimal(info.getExpectSuppCost())); |
|
|
@ -716,10 +720,10 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
importVo.setRebateName(temp); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
importVo.setCalculationStandard(temp); |
|
|
|
importVo.setCalculationModeValue(temp); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
importVo.setEstimateRebate(temp); |
|
|
|
importVo.setCalculationStandard(temp); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
importVo.setExpectTreatCost(temp); |
|
|
@ -757,10 +761,10 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
word = "返利名称"; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
word = "计算标准"; |
|
|
|
word = "计算方式(固定金额、比例)"; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
word = "返利金额"; |
|
|
|
word = "计算标准"; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
word = "其中待支付费用"; |
|
|
@ -788,7 +792,7 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
} |
|
|
|
if (!importVoList.isEmpty()) { |
|
|
|
for (ScmVehRebateExcelInfo excelInfo : importVoList) { |
|
|
|
ScmVehRebateVo scmVehRebateVo = baseMapper.selectByVinNoAndOrgSid(excelInfo.getVinNo(), excelInfo.getRebateTypeValue(), excelInfo.getRebateName(), excelInfo.getPalceGenDate(), excelInfo.getEstimateRebate(), useOrgSid); |
|
|
|
ScmVehRebateVo scmVehRebateVo = baseMapper.selectByVinNoAndOrgSid(excelInfo.getVinNo(), excelInfo.getRebateTypeValue(), excelInfo.getRebateName(), excelInfo.getPalceGenDate(), excelInfo.getCalculationModeValue(), useOrgSid); |
|
|
|
if (scmVehRebateVo != null) { |
|
|
|
checkWord.add("车架号为" + excelInfo.getVinNo() + "的单车返利信息已存在"); |
|
|
|
break; |
|
|
@ -830,23 +834,27 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
checkWord.add("返利名称不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getCalculationStandard())) { |
|
|
|
checkWord.add("计算标准不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getEstimateRebate())) { |
|
|
|
checkWord.add("返利金额不能为空"); |
|
|
|
if (StringUtils.isBlank(excelInfo.getCalculationModeValue())) { |
|
|
|
checkWord.add("计算方式不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getEstimateRebate())) { |
|
|
|
String estimateRebate = excelInfo.getEstimateRebate(); |
|
|
|
Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$"); |
|
|
|
boolean matches = pattern.matcher(estimateRebate).matches(); |
|
|
|
if (!matches) { |
|
|
|
checkWord.add("返利金额必须为数字"); |
|
|
|
if (StringUtils.isBlank(excelInfo.getCalculationStandard())) { |
|
|
|
checkWord.add("计算标准不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
// if (StringUtils.isBlank(excelInfo.getEstimateRebate())) {
|
|
|
|
// checkWord.add("返利金额不能为空");
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// if (StringUtils.isNotBlank(excelInfo.getEstimateRebate())) {
|
|
|
|
// String estimateRebate = excelInfo.getEstimateRebate();
|
|
|
|
// Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$");
|
|
|
|
// boolean matches = pattern.matcher(estimateRebate).matches();
|
|
|
|
// if (!matches) {
|
|
|
|
// checkWord.add("返利金额必须为数字");
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
if (StringUtils.isBlank(excelInfo.getExpectTreatCost())) { |
|
|
|
checkWord.add("其中待支付费用不能为空"); |
|
|
|
break; |
|
|
|