This commit is contained in:
李文飞 2025-12-16 23:27:35 +08:00
parent 94288657d9
commit d71ed080da
3 changed files with 94 additions and 25 deletions

View File

@ -474,13 +474,16 @@ public class ConSaleController extends BaseController {
conMediaTypeBo.setMediaType(mediaType);
List<ConMediaTypeVo> conMediaTypeVos = iConMediaTypeService.queryList(conMediaTypeBo);
if (CollectionUtils.isEmpty(conMediaTypeVos)) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("未查到媒体类型" );
return;
}
ConMediaTypeBo mediaTypeBo = new ConMediaTypeBo();
mediaTypeBo.setMediaType(mediaType);
iConMediaTypeService.insertByBo(mediaTypeBo);
conSaleMediaBo.setMediaId(mediaTypeBo.getId());
conSaleMediaBo.setMediaName(mediaTypeBo.getMediaType());
}else {
ConMediaTypeVo conMediaTypeVo = conMediaTypeVos.get(0);
conSaleMediaBo.setMediaId(conMediaTypeVo.getId());
conSaleMediaBo.setMediaName(conMediaTypeVo.getMediaType());
}
//媒体位置
@ -644,6 +647,69 @@ public class ConSaleController extends BaseController {
conSaleImportVo.setNotes("比稿金额填写错误" );
return;
}
String period = conSaleImportVo.getPeriod();
if (StringUtils.isBlank(period)) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("周期未填写" );
return;
}
period = period.replace("","").replaceAll(",","");;
try {
conSaleMediaBo.setPeriod(MathCompute.formatFourStringToDouble(period));
} catch (Exception ex) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("周期填写错误" );
return;
}
String otherReverPoit = conSaleImportVo.getOtherReverPoit();
if (org.apache.commons.lang3.StringUtils.isBlank(otherReverPoit)) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点1未填写" );
return;
}
conSaleMediaBo.setOtherReverPoit(otherReverPoit);
String otherReverMoney = conSaleImportVo.getOtherReverMoney();
if (otherReverMoney == null) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点金额1未填写" );
return;
}
otherReverMoney = otherReverMoney.replace("","").replaceAll(",","");;
try {
conSaleMediaBo.setOtherReverMoney(MathCompute.formatFourStringToDouble(otherReverMoney));
} catch (Exception ex) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点金额1填写错误" );
return;
}
String otherReverPoit2 = conSaleImportVo.getOtherReverPoit2();
if (org.apache.commons.lang3.StringUtils.isBlank(otherReverPoit2)) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点2未填写" );
return;
}
conSaleMediaBo.setOtherReverPoit2(otherReverPoit2);
String otherReverMoney2 = conSaleImportVo.getOtherReverMoney2();
if (otherReverMoney2 == null) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点金额2未填写" );
return;
}
otherReverMoney2 = otherReverMoney2.replace("","").replaceAll(",","");;
try {
conSaleMediaBo.setOtherReverMoney2(MathCompute.formatFourStringToDouble(otherReverMoney2));
} catch (Exception ex) {
conSaleImportVo.setStatus("0" );
conSaleImportVo.setNotes("其他返点金额2填写错误" );
return;
}
//
// //YK给群邑返点比例
// String ykToQunYiRebateRate = conSaleImportVo.getYkToQunYiRebateRate();
@ -679,10 +745,6 @@ public class ConSaleController extends BaseController {
// String ykToQunYiRebateRateReplace = ykToQunYiRebateRate.replace("%", "" );
// String ykToYYXRebateRateReplace = ykToYYXRebateRate.replace("%", "" );
//其他返点
double otherRebates = 0;
//其他返点金额
double otherRebateAmounts = 0;
// try {
@ -717,11 +779,6 @@ public class ConSaleController extends BaseController {
//补充说明 其实是媒体信息中的备注
String additionalNotes = conSaleImportVo.getNotes();
conSaleMediaBo.setRemark(additionalNotes);
// conSaleMediaBo.setOtherReverPoit(String.valueOf(otherRebates).concat("%" ));
// conSaleMediaBo.setOtherReverMoney(otherRebateAmounts);
conSaleMediaBo.setOtherReverPoit(String.valueOf(MathCompute.formatFourDoubleToDouble(otherRebates)).concat("%" ));
conSaleMediaBo.setOtherReverMoney(MathCompute.formatFourDoubleToDouble(otherRebateAmounts));
conSaleMediaBoList.add(conSaleMediaBo);

View File

@ -41,7 +41,7 @@ public class ConSaleImportNewDto implements Serializable {
private String publishEndDate;
@Alias("周期")
private String publishCycle;
private String period;
@Alias("媒体类型")
private String mediaType;

View File

@ -177,6 +177,9 @@ public class ConPurchaseServiceImpl implements IConPurchaseService {
purchaseBo.setTaxPoints(firstRow.getTaxPoints());
// 状态转换
if(StringUtils.isEmpty(firstRow.getState())){
firstRow.setState("生效");
}
String state = "生效".equals(firstRow.getState()) ? "1" : "0";
purchaseBo.setState(state);
@ -187,6 +190,15 @@ public class ConPurchaseServiceImpl implements IConPurchaseService {
purchaseBo.setClientId(conClient.getId());
}
}
//城市
String city = firstRow.getCityName();
ConCityBo conCityBo = new ConCityBo();
conCityBo.setCityName(city+",全城");
ConCityVo conCityVo = iConCityService.queryOneByWholeName(conCityBo);
purchaseBo.setCityId(conCityVo.getId());
//赋予数组值
String s = iConCityService.selectTreeIds(conCityVo.getId());
purchaseBo.setCityIdList(s);
// 关联甲方ID
if (StringUtils.isNotBlank(firstRow.getFirstName())) {
@ -260,16 +272,16 @@ public class ConPurchaseServiceImpl implements IConPurchaseService {
}
// 城市
if (StringUtils.isNotBlank(row.getCityName())) {
// 城市一般是按照XXX/XXX/XXX这样的规则
String targetWholeName = row.getCityName().replace("/", "");
ConCity conCity = conCityMapper.selectOne(new LambdaQueryWrapper<ConCity>()
.eq(ConCity::getWholeName, targetWholeName));
if (conCity != null) {
mediaBo.setCityId(conCity.getId());
mediaBo.setCityName(conCity.getCityName());
String cityIds = iConCityService.selectTreeIds(conCity.getId());
//城市
String city = row.getCityName();
ConCityBo conCityBo = new ConCityBo();
conCityBo.setCityName(city+",全城");
ConCityVo conCityVo = iConCityService.queryOneByWholeName(conCityBo);
if (conCityVo != null) {
mediaBo.setCityId(conCityVo.getId());
mediaBo.setCityName(conCityVo.getCityName());
String cityIds = iConCityService.selectTreeIds(conCityVo.getId());
mediaBo.setCityIds(cityIds);
}
}