Merge remote-tracking branch 'origin/master'

master
yangjie 4 years ago
commit 10320169e1
  1. 2
      src/main/java/com/yipin/liuwanr/controller/CourseController.java
  2. 12
      src/main/java/com/yipin/liuwanr/controller/OrderController.java
  3. 4
      src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java
  4. 12
      src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java
  5. 3
      src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java
  6. 5
      src/main/java/com/yipin/liuwanr/service/CourseService.java
  7. 10
      src/main/java/com/yipin/liuwanr/service/OrderService.java

@ -392,6 +392,8 @@ public class CourseController {
resp.setErrmessage("courseLinkList Is Null!"); resp.setErrmessage("courseLinkList Is Null!");
}else { }else {
Integer size = courseLinkList.size(); Integer size = courseLinkList.size();
//根据courseId批量删除hr_course_link表中数据
int j = courseService.deleteCourseLink(courseLinkList.get(0).getCourseId());
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
Integer courseId = courseLinkList.get(i).getCourseId(); Integer courseId = courseLinkList.get(i).getCourseId();
Integer projectId = courseLinkList.get(i).getProjectId(); Integer projectId = courseLinkList.get(i).getProjectId();

@ -195,6 +195,18 @@ public class OrderController {
int orderId = order.getOrderId(); int orderId = order.getOrderId();
HashMap<String, Object> ret0 = orderService.deleteCoursePermissions(orderId); HashMap<String, Object> ret0 = orderService.deleteCoursePermissions(orderId);
HashMap<String, Object> ret1 = orderService.updateCoursePermissions(coursePermissionss); HashMap<String, Object> ret1 = orderService.updateCoursePermissions(coursePermissionss);
//查询订单对应的所有课程是否全部发货,如果是全部发货,则修改订单状态为已发货
List<Integer>list = 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"); int status1 = (int) ret1.get("retcode");
if (status1 == 200) { if (status1 == 200) {
resp.setStatus(status1); resp.setStatus(status1);

@ -222,4 +222,8 @@ public interface CourseMapper {
@Select("select courseName,courseIntroduction,teachingGoal from course where courseId=#{courseId}") @Select("select courseName,courseIntroduction,teachingGoal from course where courseId=#{courseId}")
Course getcouese(Integer courseId); Course getcouese(Integer courseId);
//删除课程实训配置
@Delete("Delete FROM hr_course_link where courseId = #{courseId}")
int deleteCourseLink(Integer courseId);
} }

@ -135,4 +135,16 @@ public interface OrderMapper {
"</script> "}) "</script> "})
List<Course> queryCourseList(String searchContent, @Param("courseId") List<Integer> courseId); List<Course> queryCourseList(String searchContent, @Param("courseId") List<Integer> courseId);
@Select({"<script>",
"SELECT isDeliverGoods FROM hr_course_permissions where isdel = 0 and orderId = #{orderId}",
"</script> "})
List<Integer> selectByOrderId(int orderId);
@Update({"<script>",
"UPDATE orders SET"
+ "<if test='orderStatus==1'> orderStatus = 1 </if>"
+ "<if test='orderStatus==2'> orderStatus = 2 </if>"
+ "where orderId = #{orderId}",
"</script> "})
int updateOrderStatus(@Param("orderId") int orderId,@Param("orderStatus") int orderStatus);
} }

@ -46,7 +46,8 @@ public interface UserInfoMapper {
" <if test='provinceId!=null and provinceId !=\"\" '>and s.provinceId = #{provinceId} </if>", " <if test='provinceId!=null and provinceId !=\"\" '>and s.provinceId = #{provinceId} </if>",
" <if test='schoolId!=null and schoolId !=\"\"'>and u.schoolId = #{schoolId} </if>", " <if test='schoolId!=null and schoolId !=\"\"'>and u.schoolId = #{schoolId} </if>",
" <if test='cityId!=null and cityId !=\"\" '>and s.cityId = #{cityId} </if>", " <if test='cityId!=null and cityId !=\"\" '>and s.cityId = #{cityId} </if>",
" <if test='roleId!=null and roleId !=\"\" '>and u.roleId LIKE CONCAT('%',#{roleId},'%')</if>", /*" <if test='roleId!=null and roleId !=\"\" '>and u.roleId LIKE CONCAT('%',#{roleId},'%')</if>",*/
" <if test='roleId!=null and roleId !=\"\" '>and FIND_IN_SET(#{roleId},u.roleId)</if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')</if>", " <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')</if>",
" <if test='month==3'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>", " <if test='month==3'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>",
" <if test='month==6'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>", " <if test='month==6'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>",

@ -438,4 +438,9 @@ public class CourseService {
} }
return resp; return resp;
} }
public int deleteCourseLink(Integer courseId) {
int i=courseMapper.deleteCourseLink(courseId);
return i;
}
} }

@ -309,4 +309,14 @@ public class OrderService {
} }
return resp; return resp;
} }
public List<Integer> selectByOrderId(int orderId) {
List<Integer> list = orderMapper.selectByOrderId(orderId);
return list;
}
public int updateOrderStatus(int orderId,int orderStatus) {
int i = orderMapper.updateOrderStatus(orderId,orderStatus);
return i;
}
} }

Loading…
Cancel
Save