This commit is contained in:
齐天大圣 2024-03-07 16:23:33 +08:00
parent 6c0a35ca3e
commit 42f76872b8
4 changed files with 14 additions and 10 deletions

View File

@ -41,7 +41,7 @@ public class ActiveDiscountController extends BaseController {
* @return * @return
*/ */
@GetMapping @GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, public ResponseObject selectAll(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") ActiveDiscount activeDiscount) { @Param("cardFuelDiesel") ActiveDiscount activeDiscount) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);

View File

@ -21,6 +21,7 @@ import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.service.AccountService; import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
@ -145,7 +146,7 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
.map(Integer::valueOf) .map(Integer::valueOf)
.toArray(Integer[]::new)); .toArray(Integer[]::new));
} }
String oilName = ""; /*String oilName = "";
if (ObjectUtils.isNotEmpty(activeDiscountVO.getAdaptOil())) { if (ObjectUtils.isNotEmpty(activeDiscountVO.getAdaptOil())) {
for (Integer integer : activeDiscountVO.getAdaptOil()) { for (Integer integer : activeDiscountVO.getAdaptOil()) {
OilName oilNames = oilNameService.selectOilNameById(integer); OilName oilNames = oilNameService.selectOilNameById(integer);
@ -156,13 +157,14 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾 if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾
oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串 oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串
} }
activeDiscountVO.setAdaptOilss(oilName); activeDiscountVO.setAdaptOilss(oilName);*/
//获取会员等级 //获取会员等级
String str = ""; String str = "";
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){ if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
for (String gradeId : s.getDieselUserLevel().split(",")) { for (String gradeId : s.getDieselUserLevel().split(",")) {
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){ LJUserGrade ljUserGrade = userGradeService.selectUserGradeByGradeId(Integer.parseInt(gradeId));
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ","; if (ObjectUtils.isNotEmpty(ljUserGrade)){
str += ljUserGrade.getName() + ",";
} }
} }
activeDiscountVO.setDieselUserLevel(str.split(",")); activeDiscountVO.setDieselUserLevel(str.split(","));

View File

@ -42,7 +42,7 @@ public class ActiveFullminusController extends BaseController {
* @return * @return
*/ */
@GetMapping @GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, public ResponseObject selectAll(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") ActiveFullminus activeFullminus) { @Param("cardFuelDiesel") ActiveFullminus activeFullminus) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);

View File

@ -20,6 +20,7 @@ import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO
import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.service.AccountService; import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
@ -137,7 +138,7 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(",")) activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf) .map(Integer::valueOf)
.toArray(Integer[]::new)); .toArray(Integer[]::new));
String oilName = ""; /* String oilName = "";
for (Integer integer : activeFullminusVO.getAdaptOil()) { for (Integer integer : activeFullminusVO.getAdaptOil()) {
OilName oilNames = oilNameService.selectOilNameById(integer); OilName oilNames = oilNameService.selectOilNameById(integer);
oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ","; oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ",";
@ -146,13 +147,14 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾 if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾
oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串 oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串
} }
activeFullminusVO.setAdaptOilss(oilName); activeFullminusVO.setAdaptOilss(oilName);*/
//获取会员等级 //获取会员等级
String str = ""; String str = "";
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){ if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
for (String gradeId : s.getDieselUserLevel().split(",")) { for (String gradeId : s.getDieselUserLevel().split(",")) {
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){ LJUserGrade ljUserGrade = userGradeService.selectUserGradeByGradeId(Integer.parseInt(gradeId));
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ","; if (ObjectUtils.isNotEmpty(ljUserGrade)){
str += ljUserGrade.getName() + ",";
} }
} }
activeFullminusVO.setDieselUserLevel(str.split(",")); activeFullminusVO.setDieselUserLevel(str.split(","));