浏览代码

Merge branch 'master' into yonge

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
#	mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
#	mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java
yonge 5 年之前
父节点
当前提交
66f9552efa

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -213,7 +213,7 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     int countCourseSchedulesWithDate(Map<String, Object> params);
 
     /**
-     * @param musicGroupID: 乐团编号
+     * @param musicGroupId: 乐团编号
      * @return int
      * @describe 根据乐团ID删除排课
      * @author Joburgess
@@ -284,7 +284,9 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @author Joburgess
      * @date 2019/10/18
      */
-    List<Date> getCourseScheduleDate(@Param("month") Date month, @Param("organIdList") String organIdList);
+    List<Date> getCourseScheduleDate(@Param("month") Date month,
+                                     @Param("organIdList") String organIdList,
+                                     @Param("type") String type);
 
     /**
      * @Author: Joburgess

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java

@@ -42,5 +42,7 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
      * @param organId
      * @return
      */
-    String getOrganName(String organId);
+	String getOrganName(String organId);
+	
+	List<Organization> findAllOrgans();
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseScheduleQueryInfo.java

@@ -26,6 +26,17 @@ public class CourseScheduleQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否只查询历史数据")
     private Integer onlyHistory;
 
+    @ApiModelProperty(value = "课程类型")
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
     public Integer getOnlyHistory() {
         return onlyHistory;
     }

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

@@ -167,7 +167,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @return java.util.List<java.util.Date>
 	 * @describe 获取
 	 */
-	List<Date> getCourseScheduleDates(Date month, String organIdList);
+	List<Date> getCourseScheduleDates(Date month, String organIdList, String type);
 
 	/**
 	 * @describe 课程调整

+ 2 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -304,8 +304,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     }
 
     @Override
-    public List<Date> getCourseScheduleDates(Date month, String organIdList) {
-        return courseScheduleDao.getCourseScheduleDate(month, organIdList);
+    public List<Date> getCourseScheduleDates(Date month, String organIdList, String type) {
+        return courseScheduleDao.getCourseScheduleDate(month, organIdList,type);
     }
 
     @Override
@@ -1370,7 +1370,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<Long, CourseSchedule> oldCourseSchedules = new HashMap<>();
 
         newCourseSchedules.forEach(newCourseSchedule -> {
-
             if (!sysUser.getUserType().contains("SYSTEM") && newCourseSchedule.getStartClassTime().before(tomorrow) && sysUser.getUserType().contains("TEACHER")) {
                 throw new BizException("调整时间必须为明天及以后");
             }

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

@@ -445,17 +445,22 @@
             cs.leave_student_num_,
             cg.student_num_ total_student_num_,
             su.username_ teacher_name_,
-            ta.sign_in_status_ attendance_status_
+            ta.sign_in_status_ attendance_status_,
+            s.name_ school_name_
         FROM
             music_group mg
             LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
             LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
             LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
             LEFT JOIN teacher_attendance ta ON cs.id_=ta.class_group_id_ AND ta.teacher_id_=cs.teacher_id_
+            LEFT JOIN school s ON mg.school_id_=s.id_
         WHERE
         (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
         AND FIND_IN_SET(mg.organ_id_,#{organIdList})
-        AND cs.id_ IS NOT NULL AND cg.group_type_ = 'MUSIC'
+        AND cs.id_ IS NOT NULL
+        <if test="type!=null">
+            AND cg.group_type_ = #{type}
+        </if>
         AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
         <include refid="global.limit"/>
     </select>
@@ -470,7 +475,10 @@
         WHERE
         (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
         AND FIND_IN_SET(mg.organ_id_,#{organIdList})
-        AND cs.id_ IS NOT NULL AND cg.group_type_ = 'MUSIC'
+        AND cs.id_ IS NOT NULL
+        <if test="type!=null">
+            AND cg.group_type_ = #{type}
+        </if>
         AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
     </select>
 
@@ -776,6 +784,9 @@
         <if test="month!=null">
             AND DATE_FORMAT( #{month}, '%Y%m' ) = DATE_FORMAT( cs.class_date_, '%Y%m' )
         </if>
+        <if test="type!=null and type!=''">
+            AND cs.type_=#{type}
+        </if>
         GROUP BY
         cs.class_date_
     </select>

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -120,7 +120,12 @@
     <select id="findOrganNameMap" resultType="java.util.Map">
         SELECT o.id_ 'key',o.name_ 'value' FROM organization o WHERE FIND_IN_SET(o.id_,#{organIds})
     </select>
+
     <select id="getOrganName" resultType="java.lang.String">
         SELECT GROUP_CONCAT(name_) FROM organization WHERE FIND_IN_SET(id_,#{organId})
     </select>
+    
+    <select id="findAllOrgans" resultMap="Organization">
+        SELECT * from organization where del_flag_=0 ORDER BY id_ ASC;
+    </select>
 </mapper>

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -36,6 +36,7 @@
     <resultMap type="com.ym.mec.biz.dal.entity.StudentPaymentOrder" extends="StudentPaymentOrder"
                id="PaymentOrderAndStudentInfo">
         <result column="username_" property="user.username"/>
+        <result column="phone_" property="user.phone"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.Goods" id="Goods">
@@ -176,7 +177,7 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="PaymentOrderAndStudentInfo" parameterType="map">
-        SELECT spo.*,u.username_ FROM student_payment_order spo
+        SELECT spo.*,u.username_,u.phone_ FROM student_payment_order spo
         left join sys_user u on spo.user_id_ = u.id_
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ DESC

+ 26 - 10
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -1,9 +1,10 @@
 package com.ym.mec.student.controller;
 
+import com.ym.mec.biz.dal.dao.OrganizationDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.LuckStatisDto;
 import com.ym.mec.biz.dal.dto.OrderStatisDto;
-import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.service.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -37,9 +38,6 @@ import com.huifu.adapay.model.payment.PayChannelEnum;
 import com.huifu.adapay.model.payment.Payment;
 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
 import com.ym.mec.biz.dal.dto.VipBuyResultDto;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.controller.BaseController;
@@ -78,6 +76,8 @@ public class StudentOrderController extends BaseController {
     private SysConfigDao sysConfigDao;
     @Autowired
     private SporadicChargeInfoService sporadicChargeInfoService;
+    @Autowired
+    private OrganizationDao organizationDao;
 
     @PostMapping("/notify")
     public Msg notify(@ModelAttribute Msg msg) throws Exception {
@@ -131,7 +131,7 @@ public class StudentOrderController extends BaseController {
         } else if (orderByOrderNo.getGroupType().equals(GroupType.VIP)) {
             VipBuyResultDto vipBuyResultInfo = vipGroupService.findVipBuyResultInfo(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
             orderDetail.put("detail", vipBuyResultInfo);
-        }else if(orderByOrderNo.getGroupType().equals(GroupType.SPORADIC)){
+        } else if (orderByOrderNo.getGroupType().equals(GroupType.SPORADIC)) {
             SporadicChargeInfo info = sporadicChargeInfoService.get(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
             orderDetail.put("detail", info);
         }
@@ -289,21 +289,37 @@ public class StudentOrderController extends BaseController {
     public void paymentResult(HttpServletResponse response,String orderNo) {
         try {
             String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
-            response.sendRedirect(baseApiUrl+"/#/paymentresult?orderNo=" + orderNo);
+            response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo);
         } catch (IOException e) {
             e.printStackTrace();
         }
     }
 
     @GetMapping("/getLuckStatis")
-    public HttpResponseResult getLuckStatis(){
+    public HttpResponseResult getLuckStatis() {
+        List<Organization> organs = organizationDao.findAllOrgans();
         List<OrderStatisDto> orders = studentPaymentOrderDao.getLuckStatis();
+
         BigDecimal totalMoney = BigDecimal.ZERO;
         Integer totalNum = 0;
-        for (OrderStatisDto order : orders) {
-            totalMoney = totalMoney.add(order.getMoney());
-            totalNum += order.getNums();
+        for (Organization organ : organs) {
+            boolean flag = false;
+            for (OrderStatisDto order : orders) {
+                totalMoney = totalMoney.add(order.getMoney());
+                totalNum += order.getNums();
+                if (organ.getName().equals(order.getOrganName())) {
+                    flag = true;
+                }
+            }
+            if (!flag) {
+                OrderStatisDto orderStatisDto = new OrderStatisDto();
+                orderStatisDto.setOrganName(organ.getName());
+                orderStatisDto.setMoney(BigDecimal.ZERO);
+                orderStatisDto.setNums(0);
+                orders.add(orderStatisDto);
+            }
         }
+
         LuckStatisDto luckStatisDto = new LuckStatisDto();
         luckStatisDto.setOrderStatisDtoList(orders);
         luckStatisDto.setTotalNum(totalNum);

+ 3 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java

@@ -30,7 +30,7 @@ public class VipGroupCategoryController extends BaseController {
 
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
-
+	
 	@Autowired
 	private TeacherDao teacherDao;
 
@@ -48,8 +48,8 @@ public class VipGroupCategoryController extends BaseController {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
 		Teacher teacher = teacherDao.get(user.getId());
-		if(teacher == null){
-			throw new BizException("教师信息异常");
+		if(Objects.isNull(teacher)){
+			return failed("教师信息不存在");
 		}
 		return succeed(vipGroupCategoryService.findAllByOrgan(teacher.getTeacherOrganId().toString()));
 	}

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -240,11 +240,11 @@ public class ExportController extends BaseController {
                     if (row.getChargeType().equals(1)) {
                         row.setSporadicType("考级");
                     } else if (row.getChargeType().equals(2)) {
-                        row.setSporadicType("缴费");
-                    } else if (row.getChargeType().equals(3)) {
                         row.setSporadicType("声部更改");
-                    } else if (row.getChargeType().equals(4)) {
+                    } else if (row.getChargeType().equals(3)) {
                         row.setSporadicType("乐器更换");
+                    } else if (row.getChargeType().equals(4)) {
+                        row.setSporadicType("配件销售");
                     }else if (row.getChargeType().equals(5)) {
                         row.setSporadicType("维修费");
                     }else if (row.getChargeType().equals(6)) {

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/education/EducationCourseScheduleController.java

@@ -42,7 +42,7 @@ public class EducationCourseScheduleController extends BaseController {
 
     @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
     @GetMapping("/getCourseScheduleDateByMonth")
-    public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
+    public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,String type) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (null == user) {
             throw new BizException("请登录");
@@ -51,7 +51,7 @@ public class EducationCourseScheduleController extends BaseController {
         if(Objects.isNull(employee)){
             throw new BizException("员工信息不存在");
         }
-        return succeed(scheduleService.getCourseScheduleDates(month,employee.getOrganIdList()));
+        return succeed(scheduleService.getCourseScheduleDates(month,employee.getOrganIdList(),type));
     }
 
     @ApiOperation(value = "根据日期获取当日排课")