Procházet zdrojové kódy

新增学校场地和课程保险部分

zhangxin před 1 dnem
rodič
revize
458c5b0053

+ 30 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -1,14 +1,18 @@
 package org.jeecg.modules.app.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DictAnnotationUtil;
 import org.jeecg.modules.app.service.IDetailService;
 import org.jeecg.modules.app.vo.CourseInfoVO;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
@@ -26,6 +30,7 @@ import org.jeecg.modules.system.mapper.SysDictMapper;
 import org.jeecg.modules.system.mapper.SysUserMapper;
 import org.jeecg.modules.system.util.PositionUtil;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -62,6 +67,12 @@ public class DetailServiceImpl implements IDetailService {
     @Resource
     private SysDictMapper sysDictMapper;
 
+    @Autowired
+    private AppInsureMapper appInsureMapper;
+    @Autowired
+    InsurePriceMapper insurePriceMapper;
+
+
     @Override
     public PlaceInfoVO getPlaceInfo(String id) {
         AppSite appSite = appSiteMapper.selectById(id);
@@ -140,6 +151,25 @@ public class DetailServiceImpl implements IDetailService {
             BeanUtils.copyProperties(appCourses,courseDetailVO);
             courseDetailVOList.add(courseDetailVO);
         });
+        if (StringUtils.isNotEmpty(courseInfoVO.getInsureIds())){
+            List<String> aptitudesList = new ArrayList<>();
+            if (courseInfoVO.getInsureIds().indexOf(",")>0){
+                aptitudesList =  Arrays.asList(courseInfoVO.getInsureIds().split(","));
+            }else {
+                aptitudesList.add(courseInfoVO.getInsureIds());
+            }
+            LambdaQueryWrapper<AppInsure> wrapper = new LambdaQueryWrapper<>();
+            wrapper.in(AppInsure::getId, aptitudesList)
+                    .eq(AppInsure::getStatus,0)
+                    .eq(AppInsure::getDelFlag,0);  // 方法引用 + 集合
+            List<AppInsure> appInsureList = appInsureMapper.selectList(wrapper);
+            DictAnnotationUtil.translateDictList(appInsureList);
+            for (AppInsure appInsure : appInsureList) {
+                List<InsurePrice> insurePrices = insurePriceMapper.selectList(new QueryWrapper<InsurePrice>().lambda().eq(InsurePrice::getInsureId, appInsure.getId()).eq(InsurePrice::getDelFlag, 0));
+                appInsure.setPriceDataList(insurePrices);
+            }
+            courseInfoVO.setInsureIdList(appInsureList);
+        }
 
         courseInfoVO.setCourseDetail(courseDetailVOList);
         return courseInfoVO;

+ 22 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.app.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.ObjectUtils;
@@ -10,6 +12,7 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DictAnnotationUtil;
 import org.jeecg.modules.app.form.CreateOrderForm;
 import org.jeecg.modules.app.form.InsureOrderInfoForm;
 import org.jeecg.modules.app.form.UserPayForm;
@@ -127,6 +130,25 @@ public class OrderServiceImpl implements IOrderService {
         previewOrderPlaceSchool.setName(appSitePlace.getName())
                 .setId(appSitePlace.getId())
                 .setTimeSlot(timeSlot);
+        if (StringUtils.isNotEmpty(appSitePlace.getInsureIds())){
+            List<String> aptitudesList = new ArrayList<>();
+            if (appSitePlace.getInsureIds().indexOf(",")>0){
+                aptitudesList =  Arrays.asList(appSitePlace.getInsureIds().split(","));
+            }else {
+                aptitudesList.add(appSitePlace.getInsureIds());
+            }
+            LambdaQueryWrapper<AppInsure> wrapper = new LambdaQueryWrapper<>();
+            wrapper.in(AppInsure::getId, aptitudesList)
+                    .eq(AppInsure::getStatus,0)
+                    .eq(AppInsure::getDelFlag,0);  // 方法引用 + 集合
+            List<AppInsure> appInsureList = appInsureMapper.selectList(wrapper);
+            DictAnnotationUtil.translateDictList(appInsureList);
+            for (AppInsure appInsure : appInsureList) {
+                List<InsurePrice> insurePrices = insurePriceMapper.selectList(new QueryWrapper<InsurePrice>().lambda().eq(InsurePrice::getInsureId, appInsure.getId()).eq(InsurePrice::getDelFlag, 0));
+                appInsure.setPriceDataList(insurePrices);
+            }
+            previewOrderPlaceSchool.setInsureIdList(appInsureList);
+        }
         return previewOrderPlaceSchool;
     }
 

+ 6 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/CourseInfoVO.java

@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.modules.system.app.entity.AppInsure;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -63,6 +64,11 @@ public class CourseInfoVO {
     @Schema(description ="纬度")
     private BigDecimal latitude;
 
+    @Schema(description = "保险")
+    private String  insureIds;
+    @Schema(description = "保险列表")
+    private List<AppInsure>  insureIdList;
+
     @Data
     @Accessors(chain = true)
     @EqualsAndHashCode(callSuper = false)

+ 6 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/OrderVO.java

@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.modules.system.app.entity.AppInsure;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
@@ -28,6 +29,11 @@ public class OrderVO {
         @Schema(description="学校场地预约-预览页-时间段")
         private List<PreviewOrderPlaceSchoolChild> timeSlot;
 
+        @Schema(description = "保险")
+        private String  insureIds;
+        @Schema(description = "保险列表")
+        private List<AppInsure>  insureIdList;
+
     }
 
     @Data

+ 0 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/EvaluateController.java

@@ -95,7 +95,6 @@ public class EvaluateController extends JeecgController<Evaluate, IEvaluateServi
 	 */
 	@AutoLog(value = "评价管理-编辑")
 	@Operation(summary="评价管理-编辑")
-	@RequiresPermissions("evaluate:nm_evaluate:edit")
 	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
 	public Result<String> edit(@RequestBody Evaluate evaluate) {
 		Subject subject = SecurityUtils.getSubject();

+ 1 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppCoursesMapper.xml

@@ -47,6 +47,7 @@
             b.address,
             a.details,
             a.site_id,
+            a.insure_ids,
             a.fit_people,
             a.start_time,
             a.end_time,