Kaynağa Gözat

一些小bug以及以及志愿者订单新增volunteerInfoId字段删除无用字段

LiRong 3 hafta önce
ebeveyn
işleme
b0880c996b

+ 2 - 3
leromro-core/src/main/java/com/leromro/core/controller/OrdersController.java

@@ -89,7 +89,7 @@ public class OrdersController extends BaseController {
         List<SecondOrder> list = secondOrderService.list(wrapper1);
         //地址改版,所有地址都在订单中获取
         Address address = Address.builder().address(mainOrders.getAddress()).name(mainOrders.getClientName()).telephone(mainOrders.getClientTelephone()).build();
-       /* QueryWrapper<Address> addressQueryWrapper = new QueryWrapper<Address>().eq("address_id", mainOrders.getAddressId());
+        /* QueryWrapper<Address> addressQueryWrapper = new QueryWrapper<Address>().eq("address_id", mainOrders.getAddressId());
         Address address = addressService.getOne(addressQueryWrapper);*/
         QueryWrapper<VolunteerInfo> volunteerInfoQueryWrapper = new QueryWrapper<VolunteerInfo>().eq("volunteer_id", mainOrders.getVolunteerId()).eq("service_category",mainOrders.getServiceCategory());
         VolunteerInfo volunteerInfo = volunteerInfoService.list(volunteerInfoQueryWrapper).get(0);
@@ -127,10 +127,9 @@ public class OrdersController extends BaseController {
     /**
      * 管理端 订单列表查询
      */
-    @ApiOperation(value = "管理端订单详情信息查询",notes = "订单mainOrderId")
+    @ApiOperation(value = "web管理端订单详情信息查询",notes = "传入订单mainOrderId")
     @GetMapping("/web/orderInfo/{mainOrderId}")
     public R<WebMainOrdersInfoVO> webOrderInfo (@PathVariable String mainOrderId) {
-
         WebMainOrdersInfoVO webMainOrderInfoVO = mainOrderService.selectWebMainOrderInfoVO(mainOrderId);
         List<SecondOrder> secondOrderList = secondOrderService.list(new LambdaQueryWrapper<SecondOrder>().eq(SecondOrder::getMainOrderId, mainOrderId));
         webMainOrderInfoVO.setSecondOrderList(secondOrderList);

+ 1 - 1
leromro-core/src/main/java/com/leromro/core/controller/volunteerOrderController.java

@@ -59,7 +59,7 @@ public class volunteerOrderController extends BaseController {
         QueryWrapper<MainOrders> mainOrdersQueryWrapper = new QueryWrapper<MainOrders>().eq("main_order_id", secondOrderInfo.getMainOrderId());
         MainOrders mainOrder = mainOrderService.getOne(mainOrdersQueryWrapper);
         //地址都去主订单里面去获取
-        Address address = Address.builder().address(mainOrder.getAddress()).name(mainOrder.getClientName()).telephone(mainOrder.getClientTelephone()).build();
+        Address address = Address.builder().address(mainOrder.getAddress()).name(mainOrder.getClientName()).telephone(mainOrder.getClientTelephone()).longitude(mainOrder.getAddressLongitude()).latitude(mainOrder.getAddressLatitude()).build();
         SecondOrderInfoVO secondOrderInfoVO = new SecondOrderInfoVO();
         secondOrderInfoVO.setSecondOrder(secondOrderInfo);
         secondOrderInfoVO.setAddress(address);

+ 10 - 0
leromro-core/src/main/java/com/leromro/core/domain/Address.java

@@ -91,6 +91,16 @@ public class Address extends BaseEntity
     @ApiModelProperty("详细地址")
     private String address;
 
+    /** 详细地址 */
+    @TableField("longitude")
+    @ApiModelProperty("经度")
+    private String longitude;
+
+    /** 详细地址 */
+    @TableField("latitude")
+    @ApiModelProperty("纬度")
+    private String latitude;
+
     /** 是否为默认地址 0否 1是 */
     @TableField("is_default")
     @ApiModelProperty("是否为默认地址 0否 1是")

+ 10 - 9
leromro-core/src/main/java/com/leromro/core/domain/MainOrders.java

@@ -69,15 +69,6 @@ public class MainOrders extends BaseEntity
     @ApiModelProperty("服务大类别")
     private Long serviceCategory;
 
-    /** 服务小类别 */
-    @Excel(name = "服务小类别")
-    @ApiModelProperty("服务小类别")
-    private Long serviceType;
-
-    /** 学科科目 */
-    @Excel(name = "学科科目")
-    @ApiModelProperty("学科科目")
-    private Long serviceSubject;
 
     /** 总次数 */
     @Excel(name = "总次数")
@@ -138,6 +129,16 @@ public class MainOrders extends BaseEntity
     @ApiModelProperty("受服务地址")
     private String address;
 
+    /** 详细地址 */
+    @TableField("address_longitude")
+    @ApiModelProperty("收货地址经度")
+    private String addressLongitude;
+
+    /** 详细地址 */
+    @TableField("address_latitude")
+    @ApiModelProperty("收货地址纬度")
+    private String addressLatitude;
+
     /** 受服务地址id */
     @Excel(name = "受服务地址人姓名")
     @ApiModelProperty("受服务地址人姓名")

+ 4 - 10
leromro-core/src/main/java/com/leromro/core/domain/SecondOrder.java

@@ -65,15 +65,6 @@ public class SecondOrder extends BaseEntity
     @ApiModelProperty("大类别")
     private Long serviceCategory;
 
-    /** 小类别 */
-    @Excel(name = "小类别")
-    @ApiModelProperty("小类别")
-    private Long serviceType;
-
-    /** 学科科目 */
-    @Excel(name = "学科科目")
-    @ApiModelProperty("学科科目")
-    private Long serviceSubject;
 
     /** 服务记录照片拼接 */
     @Excel(name = "志愿者文字评价")
@@ -153,7 +144,10 @@ public class SecondOrder extends BaseEntity
     @ApiModelProperty("服务质量")
     private Integer qualityScore;
 
-
+    /** 评分 */
+    @Excel(name = "服务质量")
+    @ApiModelProperty("服务质量")
+    private Long volunteerInfoId;
 
 
 }

+ 0 - 5
leromro-core/src/main/java/com/leromro/core/domain/VolunteerInfo.java

@@ -63,11 +63,6 @@ public class VolunteerInfo extends BaseEntity {
     @ApiModelProperty(value = "大类别")
     private Long serviceCategory;
 
-    @ApiModelProperty(value = "小类别")
-    private Long serviceType;
-
-    @ApiModelProperty(value = "学科科目")
-    private Long serviceSubject;
 
     @ApiModelProperty(value = "技能描述")
     private String skillDescribe;

+ 0 - 6
leromro-core/src/main/java/com/leromro/core/domain/vo/VolunteerInfoDetailVO.java

@@ -47,12 +47,6 @@ public class VolunteerInfoDetailVO {
     @ApiModelProperty(value = "大类别")
     private Long serviceCategory;
 
-    @ApiModelProperty(value = "小类别")
-    private Long serviceType;
-
-    @ApiModelProperty(value = "学科科目")
-    private Long serviceSubject;
-
     @ApiModelProperty(value = "技能描述")
     private String skillDescribe;
 

+ 13 - 4
leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java

@@ -22,6 +22,7 @@ import java.time.Duration;
 import java.time.LocalTime;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrders> implements IMainOrderService{
@@ -102,7 +103,15 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
         //创建订单主表
         //把地址信息也添加到数据里面
         Address address = addressMapper.selectAddressByAddressId(orders.getAddressId());
-        orders.setAddress(address.getAddress());
+        //地址拼接信息+经纬度
+        String OrderAddress = String.join("",
+                Objects.toString(address.getProvinceName(), ""),
+                Objects.toString(address.getCityName(), ""),
+                Objects.toString(address.getDistrictName(), ""),
+                Objects.toString(address.getAddress(), ""));
+        orders.setAddressLongitude(address.getLongitude());
+        orders.setAddressLatitude(address.getLatitude());
+        orders.setAddress(OrderAddress);
         orders.setClientName(address.getName());
         orders.setClientTelephone(address.getTelephone());
         orders.setProvinceCode(address.getProvinceCode());
@@ -126,9 +135,9 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
         //新增按次数的小订单表
         //创建小订单模板
         SecondOrder secondOrder = SecondOrder.builder().mainOrderId(String.valueOf(orderId)).volunteerId(orders.getVolunteerId()).
-                serviceCategory(orders.getServiceCategory()).serviceSubject(orders.getServiceSubject()).serviceType(orders.getServiceType())
-                .serviceDuration(orders.getServiceDuration()).addressId(orders.getAddressId()).serviceOnePrice(orders.getServiceOnePrice())
-                .orderStatus("0").serviceType(orders.getServiceType()).serviceSubject(orders.getServiceSubject()).build();
+                serviceCategory(orders.getServiceCategory()).serviceDuration(orders.getServiceDuration()).addressId(orders.getAddressId())
+                .serviceOnePrice(orders.getServiceOnePrice())
+                .orderStatus("0").volunteerInfoId(orders.getVolunteerInfoId()).build();
         secondOrder.setRemark(orders.getRemark());
         List<SecondOrder> secondOrderList = new ArrayList<>();
         //添加平台

+ 12 - 10
leromro-core/src/main/java/com/leromro/core/service/impl/SecondOrdersServiceImpl.java

@@ -1,26 +1,22 @@
 package com.leromro.core.service.impl;
 
 import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.leromro.common.core.domain.AjaxResult;
 import com.leromro.common.utils.DateUtils;
 import com.leromro.common.utils.SecurityUtils;
-import com.leromro.core.domain.MainOrders;
-import com.leromro.core.domain.OrderFrozenFunds;
-import com.leromro.core.domain.SecondOrder;
-import com.leromro.core.domain.VolunteerAccount;
+import com.leromro.core.domain.*;
 import com.leromro.core.domain.dto.UserOrderReviewDTO;
 import com.leromro.core.domain.vo.VolunteerOrdersVO;
-import com.leromro.core.mapper.MainOrdersMapper;
-import com.leromro.core.mapper.OrderFrozenFundsMapper;
-import com.leromro.core.mapper.SecondOrdersMapper;
-import com.leromro.core.mapper.VolunteerAccountMapper;
+import com.leromro.core.mapper.*;
 import com.leromro.core.service.ISecondOrderService;
 import com.leromro.core.utils.DateTimeUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -36,6 +32,8 @@ public class SecondOrdersServiceImpl extends ServiceImpl<SecondOrdersMapper, Sec
     private VolunteerAccountMapper volunteerAccountMapper;
     @Autowired
     private MainOrdersMapper mainOrdersMapper;
+    @Autowired
+    private VolunteerInfoMapper volunteerInfoMapper;
 
     /**
      * @param orderStatus
@@ -104,10 +102,14 @@ public class SecondOrdersServiceImpl extends ServiceImpl<SecondOrdersMapper, Sec
      * @param reviewDTO
      */
     @Override
+    @Transactional
     public void userFinish(UserOrderReviewDTO reviewDTO) {
         //根据用户传来的评分 来设置需要计算的钱数
         //获取一次服务的钱数(!!   这一版先不改钱数的获取方式   !!)
-        BigDecimal serviceOnePrice = reviewDTO.getServiceOnePrice();
+        //BigDecimal serviceOnePrice = reviewDTO.getServiceOnePrice();
+        //更新后的第二版,钱数要从
+        Long volunteerInfoId = reviewDTO.getVolunteerInfoId();
+        BigDecimal serviceOnePrice = volunteerInfoMapper.selectOne(new LambdaQueryWrapper<VolunteerInfo>().eq(VolunteerInfo::getVolunteerInfoId, volunteerInfoId)).getBusinessPrice();
         BigDecimal volunteerMoney = serviceOnePrice.multiply(new BigDecimal("0.85"));
         BigDecimal scoreMoney = BigDecimal.valueOf(0);
         BigDecimal platformBrokerage = BigDecimal.valueOf(0);
@@ -147,7 +149,7 @@ public class SecondOrdersServiceImpl extends ServiceImpl<SecondOrdersMapper, Sec
         volunteerAccountMapper.update(null,volunteerAccountUpdateWrapper);
         //更改订单状态:
         UpdateWrapper<SecondOrder> updateWrapper = new UpdateWrapper<SecondOrder>().eq("second_order_id", reviewDTO.getSecondOrderId())
-                .set("score",score).set("user_review",reviewDTO.getUserReview()).set("user_picture",reviewDTO.getUserPicture());
+                .set("score",score).set("user_review",reviewDTO.getUserReview()).set("user_picture",reviewDTO.getUserPicture()).set("protocol_score",protocolScore).set("clothing_score",clothingScore).set("ability_score",abilityScore).set("quality_score",qualityScore);
         secondOrdersMapper.update(null,updateWrapper);
     }
 }

+ 7 - 1
leromro-core/src/main/resources/mapper/core/AddressMapper.xml

@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>-->
     
     <select id="selectAddressByAddressId" parameterType="Long" resultMap="AddressResult">
-        <include refid="selectAddressVo"/>
+        select * from l_address
         where address_id = #{addressId}
     </select>
     <select id="selectAddressBySeconderId" resultType="com.leromro.core.domain.Address">
@@ -85,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="districtCode != null">district_code,</if>
             <if test="districtName != null">district_name,</if>
             <if test="address != null">address,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude,</if>
             <if test="isDefault != null">is_default,</if>
             <if test="isDelete != null">is_delete,</if>
             <if test="label != null">label,</if>
@@ -107,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="districtCode != null">#{districtCode},</if>
             <if test="districtName != null">#{districtName},</if>
             <if test="address != null">#{address},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude},</if>
             <if test="isDefault != null">#{isDefault},</if>
             <if test="isDelete != null">#{isDelete},</if>
             <if test="label != null">#{label},</if>
@@ -133,6 +137,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="districtCode != null">district_code = #{districtCode},</if>
             <if test="districtName != null">district_name = #{districtName},</if>
             <if test="address != null">address = #{address},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude},</if>
             <if test="isDefault != null">is_default = #{isDefault},</if>
             <if test="isDelete != null">is_delete = #{isDelete},</if>
             <if test="label != null">label = #{label},</if>

+ 1 - 1
leromro-core/src/main/resources/mapper/core/BusinessManagementMapper.xml

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select business_management_id as id,parent_id,business_name,business_tier_name
         from l_business_management
         <where>
-            <if test="parentId != null "> ancestors like concat('%', #{parentId}, '%')</if>
+            find_in_set(#{parentId},ancestors)
         </where>
         order by sort
     </select>

+ 0 - 2
leromro-core/src/main/resources/mapper/core/MainOrdersMapper.xml

@@ -11,8 +11,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="serviceTotalPrice"    column="service_total_price"    />
         <result property="orderStatus"    column="order_status"    />
         <result property="serviceCategory"    column="service_category"    />
-        <result property="serviceType"    column="service_type"    />
-        <result property="serviceSubject"    column="service_subject"    />
         <result property="totalTimes"    column="total_times"    />
         <result property="finishTimes"    column="finish_times"    />
         <result property="serviceStartDate"    column="service_start_date"    />

+ 1 - 4
leromro-core/src/main/resources/mapper/core/SecondOrdersMapper.xml

@@ -9,8 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         main_order_id,
         volunteer_id,
         service_category,
-        service_type,
-        service_subject,
         service_one_price,
         work_start_time,
         work_number,
@@ -31,8 +29,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  #{secondOrder.mainOrderId},
                 #{secondOrder.volunteerId},
                 #{secondOrder.serviceCategory},
-                #{secondOrder.serviceType},
-                #{secondOrder.serviceSubject},
                 #{secondOrder.serviceOnePrice},
                 #{secondOrder.workStartTime},
                 #{secondOrder.workNumber},
@@ -201,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">and lso.volunteer_id = #{userId}</if>
             <if test="orderStatus != null ">and lso.order_status = #{orderStatus}</if>
         </where>
+        order by lso.create_time desc
     </select>
 
 </mapper>

+ 2 - 12
leromro-core/src/main/resources/mapper/core/VolunteerInfoMapper.xml

@@ -11,8 +11,6 @@
         <result property="idCard"    column="id_card"    />
         <result property="score"    column="score"    />
         <result property="serviceCategory"    column="service_category"    />
-        <result property="serviceType"    column="service_type"    />
-        <result property="serviceSubject"    column="service_subject"    />
         <result property="skillDescribe"    column="skill_describe"    />
         <result property="phonenumber"    column="phonenumber"    />
         <result property="sex"    column="sex"    />
@@ -31,7 +29,7 @@
     </resultMap>
 
     <sql id="selectLVolunteerInfoVo">
-        select volunteer_id, name, id_card, score, service_category, service_type, service_subject, skill_describe, phonenumber, sex, status, id_card_picture, certification_picture, volunteer_picture, worked_company, level, is_on_job, city, address, create_time, update_time, remark from l_volunteer_info
+        select volunteer_id, name, id_card, score, service_category, skill_describe, phonenumber, sex, status, id_card_picture, certification_picture, volunteer_picture, worked_company, level, is_on_job, city, address, create_time, update_time, remark from l_volunteer_info
     </sql>
 
 
@@ -43,8 +41,6 @@
             <if test="idCard != null">id_card,</if>
             <if test="idCardPicture != null">id_card_picture,</if>
             <if test="serviceCategory != null">service_category,</if>
-            <if test="serviceType != null">service_type,</if>
-            <if test="serviceSubject != null">service_subject,</if>
             <if test="skillDescribe != null">skill_describe,</if>
             <if test="phonenumber != null">phonenumber,</if>
             <if test="sex != null">sex,</if>
@@ -70,8 +66,6 @@
             <if test="idCard != null">#{idCard},</if>
             <if test="idCardPicture != null">#{idCardPicture},</if>
             <if test="serviceCategory != null">#{serviceCategory},</if>
-            <if test="serviceType != null">#{serviceType},</if>
-            <if test="serviceSubject != null">#{serviceSubject},</if>
             <if test="skillDescribe != null">#{skillDescribe},</if>
             <if test="phonenumber != null">#{phonenumber},</if>
             <if test="sex != null">#{sex},</if>
@@ -99,8 +93,6 @@
             <if test="name != null  and name != ''"> and lvi.name like concat('%', #{name}, '%')</if>
             <if test="score != null "> and lvi.score = #{score}</if>
             <if test="serviceCategory != null "> and lvi.service_category = #{serviceCategory}</if>
-            <if test="serviceType != null "> and lvi.service_type = #{serviceType}</if>
-            <if test="serviceSubject != null "> and lvi.service_subject = #{serviceSubject}</if>
             <if test="skillDescribe != null  and skillDescribe != ''"> and lvi.skill_describe = #{skillDescribe}</if>
             <if test="level != null  and level != ''"> and lvi.level = #{level}</if>
             <if test="city != null  and city != ''"> and lvi.city = #{city}</if>
@@ -109,7 +101,7 @@
         </where>
     </select>
     <select id="selectLVolunteerInfoByVolunteerId" resultType="com.leromro.core.domain.VolunteerInfo">
-        select name , service_category ,service_subject, phonenumber,address ,skill_describe , age ,certification_picture ,volunteer_id ,score from l_volunteer_info
+        select name , service_category , phonenumber,address ,skill_describe , age ,certification_picture ,volunteer_id ,score from l_volunteer_info
         where volunteer_id = #{volunteerId} and service_category = #{serviceCategory}
     </select>
     <select id="selectVolunteerInfoSimple" resultType="com.leromro.core.domain.vo.VolunteerInfoVO">
@@ -119,8 +111,6 @@
             <if test="name != null  and name != ''"> and lvi.name like concat('%', #{name}, '%')</if>
             <if test="score != null "> and lvi.score = #{score}</if>
             <if test="serviceCategory != null and serviceCategory != ''"> and lvi.service_category = #{serviceCategory}</if>
-            <if test="serviceType != null "> and lvi.service_type = #{serviceType}</if>
-            <if test="serviceSubject != null "> and lvi.service_subject = #{serviceSubject}</if>
             <if test="skillDescribe != null  and skillDescribe != ''"> and lvi.skill_describe = #{skillDescribe}</if>
             <if test="level != null  and level != ''"> and lvi.level = #{level}</if>
             <if test="city != null  and city != ''"> and lvi.city = #{city}</if>