|
|
@ -117,8 +117,14 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getCreateOrgName())) { |
|
|
|
qw.like("createOrgName", query.getCreateOrgName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
@ -187,8 +193,11 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
ScmSpecialRebateQuery query = pq.getParams(); |
|
|
|
QueryWrapper<ScmSpecialRebate> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("createOrgSid",query.getCreateOrgSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
@ -254,8 +263,11 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
@ -278,30 +290,6 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
} else {//上传状态:已上传
|
|
|
|
record.setUploadState("1"); |
|
|
|
} |
|
|
|
//是否调整
|
|
|
|
if (0 == record.getAdjustmentState()) { |
|
|
|
if (new BigDecimal(record.getStayDetermineMoney()).compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
BigDecimal decimal = new BigDecimal(StringUtils.isNotBlank(record.getUploadMoney()) ? record.getUploadMoney() : "0").add(new BigDecimal(StringUtils.isNotBlank(record.getSecondaryUploadMoney()) ? record.getSecondaryUploadMoney() : "0")).subtract(new BigDecimal(StringUtils.isNotBlank(record.getMoney()) ? record.getMoney() : "0")).subtract(new BigDecimal(StringUtils.isNotBlank(record.getStayDetermineMoney()) ? record.getStayDetermineMoney() : "0")).subtract(new BigDecimal(StringUtils.isNotBlank(record.getEstimateRebate()) ? record.getEstimateRebate() : "0")); |
|
|
|
int i = decimal.compareTo(BigDecimal.ZERO); |
|
|
|
if (i < 0) {//小于
|
|
|
|
record.setIsAdjustment("否"); |
|
|
|
record.setAdjustmentMoney("0"); |
|
|
|
record.setAdjustOrNot(true); |
|
|
|
} else if (i == 0) {//等于
|
|
|
|
record.setIsAdjustment("是"); |
|
|
|
record.setAdjustmentMoney("0"); |
|
|
|
record.setAdjustOrNot(false); |
|
|
|
} else {//大于
|
|
|
|
record.setIsAdjustment("是"); |
|
|
|
record.setAdjustmentMoney(decimal.toString()); |
|
|
|
record.setAdjustOrNot(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
record.setIsAdjustment("否"); |
|
|
|
record.setAdjustmentMoney("0"); |
|
|
|
record.setAdjustOrNot(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<ScmSpecialRebateVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
@ -350,10 +338,12 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
|
} |
|
|
@ -372,15 +362,6 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
} |
|
|
|
IPage<ScmSpecialRebate> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<ScmSpecialRebateVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
for (ScmSpecialRebateVo record : pagging.getRecords()) { |
|
|
|
if (StringUtils.isNotBlank(record.getWithholdingDate())){ |
|
|
|
Date withholdingDate = DateUtil.parseDate(record.getWithholdingDate()); |
|
|
|
int year = DateUtil.year(withholdingDate); |
|
|
|
int month = DateUtil.month(withholdingDate) + 1; |
|
|
|
String withholdingDateCopy = year + "年" + month + "月"; |
|
|
|
record.setWithholdingDateCopy(withholdingDateCopy); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<ScmSpecialRebateVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
@ -452,8 +433,11 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("ssr.brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("ssr.rebateTypeKey", query.getRebateTypeKey()); |
|
|
@ -500,7 +484,7 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return rb.fail().setMsg("上传文件不正确"); |
|
|
|
} |
|
|
|
|
|
|
|
int[] resultCell = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8}; |
|
|
|
int[] resultCell = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; |
|
|
|
boolean isExcel2003 = true; |
|
|
|
if (fileName.matches("^.+\\.(?i)(xlsx)$")) { |
|
|
|
isExcel2003 = false; |
|
|
@ -522,7 +506,7 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
ScmSpecialRebateVo scmSpecialRebateVo = baseMapper.selectExcelInfo(info.getCreateTime(), info.getRebateName(), info.getRebateTypeValue(), info.getEstimateRebate()); |
|
|
|
Date javaDate = new Date((long) ((Double.valueOf(info.getUploadDate()) - 25569) * 86400 * 1000)); |
|
|
|
String uploadDate = DateUtil.formatDate(javaDate); |
|
|
|
baseMapper.updateOneExcelInfo(uploadDate, info.getUploadMoney(), info.getStayDetermineMoney(), info.getMoney(), info.getAdjustmentRemarks(), scmSpecialRebateVo.getSid()); |
|
|
|
baseMapper.updateOneExcelInfo(uploadDate, info.getUploadMoney(), info.getStayDetermineMoney(), info.getOnceItureCost(), info.getAdjustmentRemarks(), scmSpecialRebateVo.getSid()); |
|
|
|
} |
|
|
|
return rb.success().setMsg("成功导入数据,请点击确定按钮"); |
|
|
|
} |
|
|
@ -553,9 +537,15 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
for (int j = 0; j < resultCell.length; j++) { |
|
|
|
if (i == resultCell[j]) { |
|
|
|
switch (i) { |
|
|
|
/*case 0: |
|
|
|
//importVo.set(temp);
|
|
|
|
break; |
|
|
|
case 0: |
|
|
|
importVo.setCreateTime(temp); |
|
|
|
break; |
|
|
|
case 0: |
|
|
|
importVo.setCreateTime(temp); |
|
|
|
break;*/ |
|
|
|
case 1: |
|
|
|
importVo.setRebateName(temp); |
|
|
|
break; |
|
|
@ -575,7 +565,7 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
importVo.setStayDetermineMoney(temp); |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
importVo.setMoney(temp); |
|
|
|
//importVo.setMoney(temp);
|
|
|
|
break; |
|
|
|
case 8: |
|
|
|
importVo.setAdjustmentRemarks(temp); |
|
|
@ -634,10 +624,10 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
checkWord.add("返利名称" + excelInfo.getRebateName() + "导入的返利信息不存在"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (scmSpecialRebateVo.getAdjustmentState() == 1) { |
|
|
|
/*if (scmSpecialRebateVo.get() == 1) { |
|
|
|
checkWord.add("返利名称" + excelInfo.getRebateName() + "导入的返利信息已调整"); |
|
|
|
break; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
if (StringUtils.isBlank(excelInfo.getCreateTime())) { |
|
|
|
checkWord.add("创建日期不能为空"); |
|
|
|
break; |
|
|
@ -734,19 +724,6 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getMoney())) { |
|
|
|
checkWord.add("费用不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getMoney())) { |
|
|
|
String money = excelInfo.getMoney(); |
|
|
|
Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$"); |
|
|
|
boolean matches = pattern.matcher(money).matches(); |
|
|
|
if (!matches) { |
|
|
|
checkWord.add("费用必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getAdjustmentRemarks())) { |
|
|
|
checkWord.add("调整说明不能为空"); |
|
|
|
break; |
|
|
@ -991,10 +968,10 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
checkWord.add("返利名称" + excelInfo.getRebateName() + "导入的返利信息不存在"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (scmSpecialRebateVo.getAdjustmentState() == 1) { |
|
|
|
checkWord.add("返利名称" + excelInfo.getRebateName() + "导入的返利信息已调整"); |
|
|
|
/* if (excelInfo.getOnceCheckState() == 1) { |
|
|
|
checkWord.add("车架号" + excelInfo.getRebateName() + "导入的返利信息已核对"); |
|
|
|
break; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
if (StringUtils.isBlank(excelInfo.getCreateTime())) { |
|
|
|
checkWord.add("创建日期不能为空"); |
|
|
|
break; |
|
|
@ -1205,8 +1182,11 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
@ -1274,8 +1254,11 @@ public class ScmSpecialRebateService extends MybatisBaseService<ScmSpecialRebate |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBrandSid())) { |
|
|
|
qw.eq("brandSid", query.getBrandSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getBrandName())) { |
|
|
|
qw.like("brandName", query.getBrandName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPurchaseSystemName())) { |
|
|
|
qw.like("purchaseSystemName", query.getPurchaseSystemName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRebateTypeKey())) { |
|
|
|
qw.eq("rebateTypeKey", query.getRebateTypeKey()); |
|
|
|