diff --git a/src/main/java/com/yipin/liuwanr/controller/CourseController.java b/src/main/java/com/yipin/liuwanr/controller/CourseController.java index 99b31d1..baae4d5 100644 --- a/src/main/java/com/yipin/liuwanr/controller/CourseController.java +++ b/src/main/java/com/yipin/liuwanr/controller/CourseController.java @@ -392,6 +392,8 @@ public class CourseController { resp.setErrmessage("courseLinkList Is Null!"); }else { Integer size = courseLinkList.size(); + //根据courseId批量删除hr_course_link表中数据 + int j = courseService.deleteCourseLink(courseLinkList.get(0).getCourseId()); for (int i = 0; i < size; i++) { Integer courseId = courseLinkList.get(i).getCourseId(); Integer projectId = courseLinkList.get(i).getProjectId(); diff --git a/src/main/java/com/yipin/liuwanr/controller/OrderController.java b/src/main/java/com/yipin/liuwanr/controller/OrderController.java index 0611539..a7ec12b 100644 --- a/src/main/java/com/yipin/liuwanr/controller/OrderController.java +++ b/src/main/java/com/yipin/liuwanr/controller/OrderController.java @@ -195,7 +195,19 @@ public class OrderController { int orderId = order.getOrderId(); HashMap ret0 = orderService.deleteCoursePermissions(orderId); HashMap ret1 = orderService.updateCoursePermissions(coursePermissionss); - int status1 = (int) ret1.get("retcode"); + + //查询订单对应的所有课程是否全部发货,如果是全部发货,则修改订单状态为已发货 + Listlist = orderService.selectByOrderId(orderId); + + if(!list.contains(0)){//如果list中不存在状态为未发货,则修改订单状态为已发货 + int orderStatus=2; + int i = orderService.updateOrderStatus(orderId,orderStatus); + }else{//修改订单状态为待发货 + int orderStatus=1; + int i = orderService.updateOrderStatus(orderId,orderStatus); + } + + int status1 = (int) ret1.get("retcode"); if (status1 == 200) { resp.setStatus(status1); resp.setMessage(ret.get("retvalue")); diff --git a/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java b/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java index cac1643..fa52eb2 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java @@ -222,4 +222,8 @@ public interface CourseMapper { @Select("select courseName,courseIntroduction,teachingGoal from course where courseId=#{courseId}") Course getcouese(Integer courseId); + + //删除课程实训配置 + @Delete("Delete FROM hr_course_link where courseId = #{courseId}") + int deleteCourseLink(Integer courseId); } \ No newline at end of file diff --git a/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java b/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java index b71ef3a..1ad5fdf 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java @@ -135,4 +135,16 @@ public interface OrderMapper { " "}) List queryCourseList(String searchContent, @Param("courseId") List courseId); + @Select({" "}) + List selectByOrderId(int orderId); + + @Update({" "}) + int updateOrderStatus(@Param("orderId") int orderId,@Param("orderStatus") int orderStatus); } \ No newline at end of file diff --git a/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java b/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java index 9248868..11db361 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java @@ -46,7 +46,8 @@ public interface UserInfoMapper { " and s.provinceId = #{provinceId} ", " and u.schoolId = #{schoolId} ", " and s.cityId = #{cityId} ", - " and u.roleId LIKE CONCAT('%',#{roleId},'%')", + /*" and u.roleId LIKE CONCAT('%',#{roleId},'%')",*/ + " and FIND_IN_SET(#{roleId},u.roleId)", " AND CONCAT(u.userName, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')", " and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)", " and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)", diff --git a/src/main/java/com/yipin/liuwanr/service/CourseService.java b/src/main/java/com/yipin/liuwanr/service/CourseService.java index 55f00ad..83a36fc 100644 --- a/src/main/java/com/yipin/liuwanr/service/CourseService.java +++ b/src/main/java/com/yipin/liuwanr/service/CourseService.java @@ -438,4 +438,9 @@ public class CourseService { } return resp; } + + public int deleteCourseLink(Integer courseId) { + int i=courseMapper.deleteCourseLink(courseId); + return i; + } } diff --git a/src/main/java/com/yipin/liuwanr/service/OrderService.java b/src/main/java/com/yipin/liuwanr/service/OrderService.java index 430d851..39e3f20 100644 --- a/src/main/java/com/yipin/liuwanr/service/OrderService.java +++ b/src/main/java/com/yipin/liuwanr/service/OrderService.java @@ -309,4 +309,14 @@ public class OrderService { } return resp; } + + public List selectByOrderId(int orderId) { + List list = orderMapper.selectByOrderId(orderId); + return list; + } + + public int updateOrderStatus(int orderId,int orderStatus) { + int i = orderMapper.updateOrderStatus(orderId,orderStatus); + return i; + } }