From 12916db6e7946a31f4fbc5c48a27e7769683b034 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期一, 23 十月 2023 18:25:02 +0800
Subject: [PATCH] 10.23
---
cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java | 6
cloud-server-account/src/test/java/com/dsh/AccountApplicationTests.java | 12 +-
cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java | 69 +++++++------
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java | 17 +++
cloud-server-other/src/main/resources/mapper/BannerMapper.xml | 8 -
cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js | 4
cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CourseClient.java | 3
cloud-server-other/src/main/java/com/dsh/other/model/BannerVo.java | 6 +
cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/UserServiceImpl.java | 1
cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java | 16 +-
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java | 2
cloud-server-other/src/main/java/com/dsh/other/service/impl/BannerServiceImpl.java | 3
cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html | 1
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java | 4
cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js | 62 +++++++++++-
cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java | 13 ++
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java | 2
cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java | 2
cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java | 5
cloud-server-other/src/main/java/com/dsh/other/mapper/BannerMapper.java | 3
cloud-server-other/src/main/java/com/dsh/other/service/IBannerService.java | 3
21 files changed, 168 insertions(+), 74 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
index 844723b..c107e9f 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
@@ -14,10 +14,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@@ -288,6 +285,7 @@
})
public ResultUtil<List<Goods>> pointsMallList(MallRequest request){
try {
+ System.out.println("======request========"+request);
return ResultUtil.success(tauService.queryAppUserIntegral(request));
}catch (Exception e){
return ResultUtil.runErr();
diff --git a/cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java b/cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java
index 689904d..fb02228 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java
@@ -13,7 +13,7 @@
private String phone;
private Integer isVip;
private Integer state;
- private String salesmanUserId;
+ private String salesmanUser;
// 角色类型
private Integer insertType;
// 平台/运营商/门店id
diff --git a/cloud-server-account/src/test/java/com/dsh/AccountApplicationTests.java b/cloud-server-account/src/test/java/com/dsh/AccountApplicationTests.java
index e9dcbde..84551a4 100644
--- a/cloud-server-account/src/test/java/com/dsh/AccountApplicationTests.java
+++ b/cloud-server-account/src/test/java/com/dsh/AccountApplicationTests.java
@@ -2,6 +2,9 @@
import com.dsh.account.controller.CoachTypeController;
+import com.dsh.account.controller.UseBenefitsController;
+import com.dsh.account.model.vo.userBenefitDetail.Goods;
+import com.dsh.account.util.ResultUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -12,15 +15,14 @@
class AccountApplicationTests {
@Autowired
- private CoachTypeController controller;
+ private UseBenefitsController useBenefitsController;
@Test
void contextLoads() {
- System.out.println(System.getProperty("java.version"));
- System.out.println(System.getProperty("java.compiler"));
- System.out.println(System.getProperty("java.vm.specification.version"));
- System.out.println(System.getProperty("java.specification.version"));
+
+
+
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
index e9a3473..208e0cb 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -44,6 +44,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -163,41 +164,45 @@
@PostMapping("/base/coupon/getAllCoupons")
public List<Coupon> getAllCoupons(@RequestBody CommodityRequest request){
List<Coupon> couponList = new ArrayList<>();
- String provinceCode = "";
- String cityCode = "";
- if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){
- return couponList;
- }
+// String provinceCode = "";
+// String cityCode = "";
+// if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){
+// return couponList;
+// }
+// try {
+// Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat());
+// provinceCode = geocode.get("provinceCode");
+// cityCode = geocode.get("cityCode");
+// }catch (Exception e){
+// e.printStackTrace();
+// }
try {
- Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat());
- provinceCode = geocode.get("provinceCode");
- cityCode = geocode.get("cityCode");
- }catch (Exception e){
- e.printStackTrace();
- }
- try {
+ LocalDateTime currentDate = LocalDateTime.now();
+
couponList = couponService.list(new QueryWrapper<Coupon>()
- .eq("auditStatus",2)
+ .eq("distributionMethod",1)
.eq("state",1)
- .eq("status",2));
- if (couponList.size() > 0 ){
- Iterator<Coupon> iterator = couponList.iterator();
- while (iterator.hasNext()) {
- Coupon merchandise = iterator.next();
- if (merchandise.getUseScope() == 2){
- List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>()
- .eq(CouponCity::getCouponId,merchandise.getId()));
- if (couponCities.size() > 0){
- for (CouponCity couponCity : couponCities) {
- if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){
- iterator.remove(); // 移除符合条件的商品
- break;
- }
- }
- }
- }
- }
- }
+ .eq("status",1)
+ .le("startTime", currentDate)
+ .ge("endTime", currentDate));
+// if (couponList.size() > 0 ){
+// Iterator<Coupon> iterator = couponList.iterator();
+// while (iterator.hasNext()) {
+// Coupon merchandise = iterator.next();
+// if (merchandise.getUseScope() == 2){
+// List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>()
+// .eq(CouponCity::getCouponId,merchandise.getId()));
+// if (couponCities.size() > 0){
+// for (CouponCity couponCity : couponCities) {
+// if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){
+// iterator.remove(); // 移除符合条件的商品
+// break;
+// }
+// }
+// }
+// }
+// }
+// }
return couponList;
} catch (Exception e) {
throw new RuntimeException(e);
diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java
index 4f64774..10eb06d 100644
--- a/cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java
+++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java
@@ -506,6 +506,19 @@
return discountService.updateBatchById(list);
}
+ @Autowired
+ private ICoursePackagePaymentConfigService packagePaymentConfigService;
+ @PostMapping("/course/times")
+ public List<Integer> times( @RequestBody Integer oneId){
+ List<CoursePackagePaymentConfig> list = packagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId",oneId));
+ List<Integer> integerList = new ArrayList<>();
+ for (CoursePackagePaymentConfig coursePackagePaymentConfig : list) {
+ integerList.add(coursePackagePaymentConfig.getClassHours());
+ }
+
+
+ return integerList;
+ }
@PostMapping("/course/queryFee")
public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){
diff --git a/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java b/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java
index ec1cb23..8ddabfd 100644
--- a/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java
+++ b/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java
@@ -177,8 +177,9 @@
coursePackageListVo.setPayType(coursePackage.getPayType());
- coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin());
-
+ if (coursePackagePaymentConfig!=null) {
+ coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin());
+ }
//会员显示原价和会员价(最低)。非会员显示会员价和支付价(最低)
if(appUser.getIsVip() == 0){//非会员
List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId())
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java
index faa9821..4e22306 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java
@@ -13,7 +13,7 @@
private String phone;
private Integer isVip;
private Integer state;
- private Integer salesmanUserId;
+ private Integer salesmanUser;
// 角色类型
private Integer insertType;
// 平台/运营商/门店id
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CourseClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CourseClient.java
index f4a30f6..196cfe0 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CourseClient.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CourseClient.java
@@ -133,4 +133,7 @@
@PostMapping("/course/auditDiscount")
Boolean auditDiscount(AuditDiscount auditDiscount);
+
+ @PostMapping("/course/times")
+ List<Integer> timeChange(@RequestBody Integer oneId);
}
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java
index 1afed17..d2e43da 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java
@@ -151,14 +151,14 @@
@RequestMapping("/listAll")
@ResponseBody
public List<QueryAppUserVO> listAll(String province, String city,String name,
- String phone,Integer isVip, Integer salesmanUserName){
+ String phone,Integer isVip, String salesmanUserName){
QueryAppUser queryAppUser = new QueryAppUser();
queryAppUser.setProvince(province);
queryAppUser.setCity(city);
queryAppUser.setName(name);
queryAppUser.setPhone(phone);
queryAppUser.setIsVip(isVip);
- queryAppUser.setSalesmanUserId(salesmanUserName);
+// queryAppUser.setSalesmanUser(salesmanUserName);
if (province!=null && (!province.equals(""))){
TCity p = cityService.getOne(new QueryWrapper<TCity>().eq("code", province));
queryAppUser.setProvince(p.getName());
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java
index 7f0e88c..20c6822 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCityController.java
@@ -11,12 +11,15 @@
import com.dsh.course.feignClient.account.model.TCityManager;
import com.dsh.course.feignClient.competition.CompetitionClient;
import com.dsh.course.feignClient.competition.model.*;
+import com.dsh.course.feignClient.course.CourseClient;
+import com.dsh.course.feignClient.course.model.TCoursePackage;
import com.dsh.course.mapper.UserMapper;
import com.dsh.guns.core.base.controller.BaseController;
import com.dsh.guns.core.base.tips.SuccessTip;
import com.dsh.guns.core.common.constant.factory.PageFactory;
import com.dsh.guns.core.util.ToolUtil;
import com.dsh.guns.modular.system.model.TCity;
+import com.dsh.guns.modular.system.model.TCourse;
import com.dsh.guns.modular.system.model.TStore;
import com.dsh.guns.modular.system.model.User;
import com.dsh.guns.modular.system.service.ICityService;
@@ -108,6 +111,20 @@
}
+ @Resource
+ private CourseClient courseClient;
+ @RequestMapping(value = "/timeChange")
+ @ResponseBody
+ public List<Integer> timeChange(Integer oneId) {
+
+ List<Integer> integerList = courseClient.timeChange(oneId);
+ return integerList ;
+ }
+
+
+
+
+
@RequestMapping(value = "/add")
@ResponseBody
public Object list(TCityManager manager) {
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
index 5efcfbf..6db3b75 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
@@ -527,6 +527,8 @@
+ }else {
+ Integer id = pointMercharsClient.add(pointsMerchandise);
}
return new SuccessTip<>();
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/UserServiceImpl.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/UserServiceImpl.java
index a9c2206..52203d7 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/UserServiceImpl.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/UserServiceImpl.java
@@ -42,6 +42,7 @@
@Override
public User getByAccount(String account) {
+ System.out.println("=====account===="+account);
return this.baseMapper.getByAccount(account);
}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html
index 4149c09..045de00 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html
@@ -278,7 +278,6 @@
<label class="col-sm-3 control-label">课时数:</label>
<div class="col-sm-9">
<select class="form-control" id="coursePackageConfigId" name="coursePackageConfigId">
- <option value="">选择课时数</option>
</select>
</div>
</div>
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js
index 5d80600..f00f8ff 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js
@@ -41,9 +41,9 @@
},
{title: '发放数量', field: 'quantityIssued', visible: true, align: 'center', valign: 'middle'
},
- {title: '限领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle'
+ {title: '限领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle'
},
- {title: '已领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle'
+ {title: '已领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle'
},
{title: '已兑换数量', field: 'hasExchangeQty', visible: true, align: 'center', valign: 'middle'
},
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
index 0e976c4..93e2e24 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
@@ -253,6 +253,27 @@
return ;
}
+ const quantityIssuedInput = document.getElementById('quantityIssued');
+ const pickUpQuantityInput = document.getElementById('pickUpQuantity');
+
+ const quantityIssued2 = Number(quantityIssuedInput.value);
+ const pickUpQuantity2 = Number(pickUpQuantityInput.value);
+
+ if (isNaN(quantityIssued2) || isNaN(pickUpQuantity2)) {
+ Feng.error("优惠卷数量必须为数字")
+ console.log('Both quantityIssued and pickUpQuantity must be numbers.');
+ } else if (quantityIssued2 >= pickUpQuantity2) {
+
+ console.log('quantityIssued is greater than pickUpQuantity.');
+ } else {
+
+ Feng.error("发放数量必须大于等于限领数量")
+ return
+ console.log('quantityIssued is not greater than pickUpQuantity.');
+ }
+
+
+
let typeAll = document.querySelector('input[name="type"]:checked').value;
if(typeAll==2){
let pCode = $("#pCode").val()
@@ -394,6 +415,11 @@
},function(data){
Feng.error("添加失败!" + data.responseJSON.message + "!");
});
+ var selectElement = document.getElementById("coursePackageId");
+ var selectedText = selectElement.options[selectElement.selectedIndex].text;
+
+ ajax.set("name",selectedText);
+
ajax.set("typeAll",typeAll);
ajax.set("provinceCode",pCode);
ajax.set("cityCode",cCode);
@@ -834,6 +860,25 @@
Feng.info("请上传实景图")
return;
}
+
+
+ const quantityIssuedInput = document.getElementById('quantityIssued');
+ const pickUpQuantityInput = document.getElementById('pickUpQuantity');
+
+ const quantityIssued1 = Number(quantityIssuedInput.value);
+ const pickUpQuantity1 = Number(pickUpQuantityInput.value);
+
+ if (isNaN(quantityIssued1) || isNaN(pickUpQuantity1)) {
+ Feng.error("优惠卷数量必须为数字")
+ console.log('Both quantityIssued and pickUpQuantity must be numbers.');
+ } else if (quantityIssued1 >= pickUpQuantity1) {
+
+ console.log('quantityIssued is greater than pickUpQuantity.');
+ } else {
+
+ Feng.error("发放数量必须大于限领数量")
+ console.log('quantityIssued is not greater than pickUpQuantity.');
+ }
var imgOne ="";
console.log(goodImgs)
console.log(goodImgs.length)
@@ -915,7 +960,7 @@
/**
* 选择分公司后执行
*/
-TGoodsInfoDlg.oneChange = function () {
+TGoodsInfoDlg.oneChange = function (e) {
var oneId=$(e).val();
var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){
if(data!=null){
@@ -940,7 +985,7 @@
}
TGoodsInfoDlg.storeChange = function (e) {
var oneId=$(e).val();
- var ajax = new $ax(Feng.ctxPath + "/tCity/storeChange", function(data){
+ var ajax = new $ax(Feng.ctxPath + "/coursePackage/queryStore", function(data){
if(data!=null){
if(language==1){
var content='<option value="">选择门店</option>';
@@ -955,12 +1000,12 @@
$("#storeId").empty().append(content);
}
});
- ajax.set("oneId",oneId);
+ ajax.set("cityCode",oneId);
ajax.start();
}
TGoodsInfoDlg.packageChange = function (e) {
var oneId=$(e).val();
- var ajax = new $ax(Feng.ctxPath + "/tCity/packageChange", function(data){
+ var ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCoursePackageLists", function(data){
if(data!=null){
if(language==1){
var content='<option value="">选择课包</option>';
@@ -969,13 +1014,16 @@
}else {
var content='<option value="">Pilih franchisee Anda</option>';
}
- $.each(data, function(k,v) {
+ $.each(data.rows, function(k,v) {
content += "<option value='"+v.id+"'>"+v.name+"</option>";
});
$("#coursePackageId").empty().append(content);
}
});
- ajax.set("oneId",oneId);
+ ajax.set("coursePackageTypeId",oneId);
+ ajax.set("order","desc");
+ ajax.set("offset",0);
+ ajax.set("limit",100);
ajax.start();
}
TGoodsInfoDlg.timeChange = function (e) {
@@ -990,7 +1038,7 @@
var content='<option value="">Pilih franchisee Anda</option>';
}
$.each(data, function(k,v) {
- content += "<option value='"+v.id+"'>"+v.classHours+"</option>";
+ content += "<option value='"+v+"'>"+v+"</option>";
});
$("#coursePackageConfigId").empty().append(content);
}
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java
index 5c317de..a317cf5 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java
@@ -84,15 +84,15 @@
try {
List<Banner> list = bannerService.list(new QueryWrapper<Banner>().eq("position", position).eq("state", 1).orderByAsc("sort"));
- List<Banner> list2 = bannerService.list1(position);
+ List<BannerVo> list2 = bannerService.list1(position);
- List<BannerVo> list1 = new ArrayList<>();
- for (Banner banner : list2) {
- BannerVo bannerVo = new BannerVo();
- BeanUtils.copyProperties(banner, bannerVo);
- list1.add(bannerVo);
- }
- return ResultUtil.success(list1);
+// List<BannerVo> list1 = new ArrayList<>();
+// for (Banner banner : list2) {
+// BannerVo bannerVo = new BannerVo();
+// BeanUtils.copyProperties(banner, bannerVo);
+// list1.add(bannerVo);
+// }
+ return ResultUtil.success(list2);
}catch (Exception e){
e.printStackTrace();
return ResultUtil.runErr();
diff --git a/cloud-server-other/src/main/java/com/dsh/other/mapper/BannerMapper.java b/cloud-server-other/src/main/java/com/dsh/other/mapper/BannerMapper.java
index b96cda8..a529f48 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/mapper/BannerMapper.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/mapper/BannerMapper.java
@@ -4,6 +4,7 @@
import com.dsh.other.entity.Banner;
import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
import com.dsh.other.feignclient.model.AdvertisementQuery;
+import com.dsh.other.model.BannerVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;
@@ -28,5 +29,5 @@
String getFirst();
- List<Banner> list1(Integer position);
+ List<BannerVo> list1(Integer position);
}
diff --git a/cloud-server-other/src/main/java/com/dsh/other/model/BannerVo.java b/cloud-server-other/src/main/java/com/dsh/other/model/BannerVo.java
index 3fc012f..90e19cf 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/model/BannerVo.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/model/BannerVo.java
@@ -17,4 +17,10 @@
private String img;
@ApiModelProperty("跳转页面")
private String page;
+ @ApiModelProperty("名称")
+ private String name;
+ @ApiModelProperty("跳转类型")
+ private String type;
+ @ApiModelProperty("跳转页面Id")
+ private Integer turnId;
}
diff --git a/cloud-server-other/src/main/java/com/dsh/other/service/IBannerService.java b/cloud-server-other/src/main/java/com/dsh/other/service/IBannerService.java
index 81706f8..0732641 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/service/IBannerService.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/service/IBannerService.java
@@ -8,6 +8,7 @@
import java.util.List;
import com.dsh.other.entity.CreateHistoryDto;
import com.dsh.other.entity.GetHistoryDto;
+import com.dsh.other.model.BannerVo;
import java.util.List;
@@ -25,5 +26,5 @@
String getFirst();
- List<Banner> list1(Integer position);
+ List<BannerVo> list1(Integer position);
}
diff --git a/cloud-server-other/src/main/java/com/dsh/other/service/impl/BannerServiceImpl.java b/cloud-server-other/src/main/java/com/dsh/other/service/impl/BannerServiceImpl.java
index 86dc263..a3dd352 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/service/impl/BannerServiceImpl.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/service/impl/BannerServiceImpl.java
@@ -7,6 +7,7 @@
import com.dsh.other.entity.CreateHistoryDto;
import com.dsh.other.entity.GetHistoryDto;
import com.dsh.other.mapper.BannerMapper;
+import com.dsh.other.model.BannerVo;
import com.dsh.other.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -35,7 +36,7 @@
}
@Override
- public List<Banner> list1(Integer position) {
+ public List<BannerVo> list1(Integer position) {
return this.bannerMapper.list1(position);
}
diff --git a/cloud-server-other/src/main/resources/mapper/BannerMapper.xml b/cloud-server-other/src/main/resources/mapper/BannerMapper.xml
index ff797be..6b85d1e 100644
--- a/cloud-server-other/src/main/resources/mapper/BannerMapper.xml
+++ b/cloud-server-other/src/main/resources/mapper/BannerMapper.xml
@@ -49,14 +49,10 @@
from t_img_config
where position = 6
</select>
- <select id="list1" resultType="com.dsh.other.entity.Banner">
- select tb.id as id,tb.img as img, tt.name as page
+ <select id="list1" resultType="com.dsh.other.model.BannerVo">
+ select tb.id as id,tb.img as img, tb.page as page,tb.name as name,tb.type as type,tb.typeId as turnId
from t_banner tb
- left join t_turn tt on tb.jumpPage = tt.id
where tb.position = #{position}
-
-
-
</select>
</mapper>
--
Gitblit v1.7.1