Browse Source

Merge branch 'maintenance_feature'

周箭河 4 years ago
parent
commit
2e19dca72d

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentGoodsSellService.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.dto.StudentGoodsSellDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
 import com.ym.mec.biz.dal.entity.StudentGoodsSell;
 import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.page.GoodsSellQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
@@ -51,6 +52,6 @@ public interface StudentGoodsSellService extends BaseService<Integer, StudentGoo
      * 将购买的乐器加入学生乐器列表
      * @return
      */
-    List<StudentInstrument> saveStudentInstrument(String orderNo);
+    List<StudentInstrument> saveStudentInstrument(StudentPaymentOrder order);
 
 }

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentGoodsSellServiceImpl.java

@@ -12,6 +12,7 @@ import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentGoodsSell;
 import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.page.GoodsSellQueryInfo;
 import com.ym.mec.biz.service.StudentGoodsSellService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -110,8 +111,8 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
     }
 
     @Override
-    public List<StudentInstrument> saveStudentInstrument(String orderNo) {
-        StudentGoodsSell studentGoodsSell = studentGoodsSellDao.findByOrderNo(orderNo);
+    public List<StudentInstrument> saveStudentInstrument(StudentPaymentOrder order) {
+        StudentGoodsSell studentGoodsSell = studentGoodsSellDao.findByOrderNo(order.getOrderNo());
         List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(studentGoodsSell.getGoodsJson(), GoodsSellDto.class);
         List<Integer> goodsIds = new ArrayList<>();
         for (GoodsSellDto goodsSellDto : goodsSellDtos) {
@@ -134,6 +135,7 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
             studentInstrument.setGoodsBrand(goods.getBrand());
             studentInstrument.setSpecification(goods.getSpecification());
             studentInstrument.setGoodsImg(goods.getImage());
+            studentInstrument.setOrderId(order.getId());
             studentInstrument.setStatus(0);
             studentInstruments.add(studentInstrument);
         }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentInstrumentServiceImpl.java

@@ -300,6 +300,7 @@ public class StudentInstrumentServiceImpl extends BaseServiceImpl<Long, StudentI
         studentInstrument.setOrganId(order.getOrganId());
         studentInstrument.setGoodsId(goodsId);
         studentInstrument.setStatus(maintenanceStatus);
+        studentInstrument.setOrderId(order.getId());
         studentInstrument.setStartTime(startTime);
         studentInstrument.setEndTime(endTime);
         addStudentInstrument(studentInstrument);

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -736,7 +736,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             paymentDetail.setUserId(userId);
             sysUserCashAccountDetailService.insert(paymentDetail);
             //将购买的乐器加入学生乐器列表
-            studentGoodsSellService.saveStudentInstrument(studentPaymentOrder.getOrderNo());
+            studentGoodsSellService.saveStudentInstrument(studentPaymentOrder);
             //购买的商品加入销售列表
             saveSellOrder(studentPaymentOrder.getOrderNo());
         } else if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/StudentInstrumentMapper.xml

@@ -44,7 +44,7 @@
         )
         values
         (#{studentId},#{organId},#{goodsId},#{goodsCategoryId},#{goodsCategoryName},#{goodsName},#{goodsBrand},#{specification},#{goodsImg},
-        #{organId},#{operation},#{status}, #{startTime}, #{endTime}, NOW(), NOW()
+        #{orderId},#{operation},#{status}, #{startTime}, #{endTime}, NOW(), NOW()
         )
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentInstrument">
@@ -153,11 +153,11 @@
     <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         insert into student_instrument
         (student_id_,organ_id_,goods_id_,goods_category_id_,goods_category_name_,goods_name_,goods_brand_,specification_,goods_img_,
-        status_, start_time_, end_time_, create_time_, update_time)
+        order_id_,status_, start_time_, end_time_, create_time_, update_time)
         VALUE
         <foreach collection="studentInstruments" item="item" separator=",">
             (#{item.studentId},#{item.organId},#{item.goodsId},#{item.goodsCategoryId},#{item.goodsCategoryName},#{item.goodsName},#{item.goodsBrand},#{item.specification},#{item.goodsImg},
-            #{item.status}, #{item.startTime},
+            #{item.orderId},#{item.status}, #{item.startTime},
             #{item.endTime}, NOW(), NOW())
         </foreach>
     </insert>