瀏覽代碼

Merge branch 'online1' into practice_1129

yonge 3 年之前
父節點
當前提交
af72f7ae1e
共有 37 個文件被更改,包括 1504 次插入42 次删除
  1. 55 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/FinancialExpenditureDao.java
  2. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/QuestionnaireUserResultDao.java
  3. 26 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaColumnDto.java
  4. 25 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaFormStructureDto.java
  5. 56 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaInputDto.java
  6. 93 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PWorkOrderInfo.java
  7. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/QuestionnaireResultDto.java
  8. 54 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/FinancialExpenditure.java
  9. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java
  10. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java
  11. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExpenditureTypeEnum.java
  12. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/FeeProjectEnum.java
  13. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupType.java
  14. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/QuestionnaireActiveTypeEnum.java
  15. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/FinancialExpenditureService.java
  16. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java
  17. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  18. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/QuestionnaireUserResultService.java
  19. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/service/UploadFileService.java
  20. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  21. 322 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java
  22. 130 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  23. 253 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  24. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/QuestionnaireUserResultServiceImpl.java
  25. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java
  26. 152 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  27. 35 0
      mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml
  28. 24 1
      mec-biz/src/main/resources/config/mybatis/QuestionnaireUserResultMapper.xml
  29. 13 7
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  30. 1 1
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml
  31. 10 0
      mec-common/common-core/src/main/java/com/ym/mec/common/entity/UploadReturnBean.java
  32. 1 1
      mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java
  33. 10 10
      mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java
  34. 1 2
      mec-web/src/main/java/com/ym/mec/web/controller/QuestionnaireTopicController.java
  35. 17 2
      mec-web/src/main/java/com/ym/mec/web/controller/QuestionnaireUserResultController.java
  36. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/UploadFileController.java
  37. 25 2
      mec-web/src/main/java/com/ym/mec/web/controller/education/OaContractsController.java

+ 55 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/FinancialExpenditureDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.FinancialExpenditureDto;
+import com.ym.mec.biz.dal.dto.PWorkOrderInfo;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -36,4 +37,58 @@ public interface FinancialExpenditureDao extends BaseDAO<Long, FinancialExpendit
      * @time 11:38
      */
     List<String> countBydingTalk(@Param("collect") List<Object> collect);
+
+    /**
+    * @description: 同步oa审批到支出记录
+     * @param workOrderId
+    * @return java.lang.Boolean
+    * @author zx
+    * @date 2021/11/25 16:09
+    */
+    PWorkOrderInfo getWorkOrderInfo(Integer workOrderId);
+
+    /**
+    * @description: 获取oa表单模板
+     * @param workOrderId
+    * @return java.lang.String
+    * @author zx
+    * @date 2021/11/25 16:55
+    */
+    String getFormStructure(Integer workOrderId);
+
+    /**
+    * @description: 获取oa表单
+     * @param workOrderId
+    * @return java.lang.String
+    * @author zx
+    * @date 2021/11/26 10:09
+    */
+    String getFormData(Integer workOrderId);
+
+    /**
+    * @description: 获取模板
+     * @param tplInfoId
+    * @return java.lang.String
+    * @author zx
+    * @date 2021/11/29 15:16
+    */
+    String getTplInfo(String tplInfoId);
+
+    /**
+    * @description: 是否同步过数据
+     * @param workOrderId
+    * @return java.lang.Boolean
+    * @author zx
+    * @date 2021/11/29 16:48
+    */
+    Integer findByBatchNoAndProcessNo(Integer workOrderId);
+
+    /**
+    * @description: 获取社保分部
+     * @param deptId
+    * @return java.lang.Integer
+    * @author zx
+    * @date 2021/11/30 14:40
+    */
+    Integer getDeptId(Integer deptId);
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/QuestionnaireUserResultDao.java

@@ -38,4 +38,8 @@ public interface QuestionnaireUserResultDao extends BaseDAO<Long, QuestionnaireU
     List<QuestionnaireResultDto> getQuestionResult(@Param("activeId") Integer activeId, @Param("activeType") String activeType);
 
     List<Map<Integer, String>> queryUserName(String activeType);
+
+    List<QuestionnaireUserResultDto> findResultCount(Map<String, Object> params);
+
+    int countResultCount(Map<String, Object> params);
 }

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaColumnDto.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.List;
+
+public class OaColumnDto {
+
+    private Integer span;
+
+    private List<OaInputDto> list;
+
+    public Integer getSpan() {
+        return span;
+    }
+
+    public void setSpan(Integer span) {
+        this.span = span;
+    }
+
+    public List<OaInputDto> getList() {
+        return list;
+    }
+
+    public void setList(List<OaInputDto> list) {
+        this.list = list;
+    }
+}

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaFormStructureDto.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.List;
+
+public class OaFormStructureDto {
+    private Integer id;
+
+    private List<OaInputDto> list;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public List<OaInputDto> getList() {
+        return list;
+    }
+
+    public void setList(List<OaInputDto> list) {
+        this.list = list;
+    }
+}

+ 56 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OaInputDto.java

@@ -0,0 +1,56 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.List;
+
+public class OaInputDto {
+
+    private String key;
+
+    private String type;
+
+    private String model;
+
+    private String name;
+
+    private List<OaColumnDto> columns;
+
+    public List<OaColumnDto> getColumns() {
+        return columns;
+    }
+
+    public void setColumns(List<OaColumnDto> columns) {
+        this.columns = columns;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 93 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PWorkOrderInfo.java

@@ -0,0 +1,93 @@
+package com.ym.mec.biz.dal.dto;
+
+public class PWorkOrderInfo {
+    private Integer id;
+
+    private Integer process;
+
+    private Integer classify;
+
+    private Boolean isEnd;
+
+    private Boolean isDenied;
+
+    private Boolean isCancel;
+
+    private Integer creator;
+
+    private String title;
+
+    private Integer deptId;
+
+    public Integer getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Integer deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getProcess() {
+        return process;
+    }
+
+    public void setProcess(Integer process) {
+        this.process = process;
+    }
+
+    public Integer getClassify() {
+        return classify;
+    }
+
+    public void setClassify(Integer classify) {
+        this.classify = classify;
+    }
+
+    public Boolean getEnd() {
+        return isEnd;
+    }
+
+    public void setEnd(Boolean end) {
+        isEnd = end;
+    }
+
+    public Boolean getDenied() {
+        return isDenied;
+    }
+
+    public void setDenied(Boolean denied) {
+        isDenied = denied;
+    }
+
+    public Boolean getCancel() {
+        return isCancel;
+    }
+
+    public void setCancel(Boolean cancel) {
+        isCancel = cancel;
+    }
+
+    public Integer getCreator() {
+        return creator;
+    }
+
+    public void setCreator(Integer creator) {
+        this.creator = creator;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/QuestionnaireResultDto.java

@@ -15,6 +15,16 @@ public class QuestionnaireResultDto{
 
     private String additionalValue;
 
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
     public String getAdditionalValue() {
         return additionalValue;
     }

+ 54 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/FinancialExpenditure.java

@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import static com.ym.mec.biz.dal.enums.ExpenditureTypeEnum.REFUND;
+
 /**
  * 对应数据库表(financial_expenditure):
  */
@@ -33,10 +35,10 @@ public class FinancialExpenditure {
 	private String applyUser;
 
 	@ApiModelProperty(value = "支出类型(1:固定费用、2:变动费用:3:业务退费)",required = false)
-	private ExpenditureTypeEnum type;
+	private ExpenditureTypeEnum type = REFUND;
 
 	@ApiModelProperty(value = "费用项目",required = false)
-	private FeeProjectEnum feeProject;
+	private FeeProjectEnum feeProject = FeeProjectEnum.REFUND;
 	/**  */
 	@ApiModelProperty(value = "费用",required = false)
 	private BigDecimal amount;
@@ -68,6 +70,56 @@ public class FinancialExpenditure {
 	/**  */
 	private Integer delFlag;
 
+	private Long vipGroupId;
+
+	private String groupType;
+
+	private String musicGroupId;
+
+	private String returnFeeType;
+
+	private Integer studentId;
+
+	public String getGroupType() {
+		return groupType;
+	}
+
+	public void setGroupType(String groupType) {
+		this.groupType = groupType;
+	}
+
+	public String getMusicGroupId() {
+		return musicGroupId;
+	}
+
+	public void setMusicGroupId(String musicGroupId) {
+		this.musicGroupId = musicGroupId;
+	}
+
+	public String getReturnFeeType() {
+		return returnFeeType;
+	}
+
+	public void setReturnFeeType(String returnFeeType) {
+		this.returnFeeType = returnFeeType;
+	}
+
+	public Long getVipGroupId() {
+		return vipGroupId;
+	}
+
+	public void setVipGroupId(Long vipGroupId) {
+		this.vipGroupId = vipGroupId;
+	}
+
+	public Integer getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Integer studentId) {
+		this.studentId = studentId;
+	}
+
 	public String getApplyUser() {
 		return applyUser;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -21,6 +21,8 @@ public class Student extends SysUser {
 	/**  */
 	private Integer userId;
 	
+	private String schoolName;
+	
 	/**  */
 	private String subjectIdList;
 
@@ -154,6 +156,14 @@ public class Student extends SysUser {
 		return this.userId;
 	}
 			
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
 	public void setSubjectIdList(String subjectIdList){
 		this.subjectIdList = subjectIdList;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java

@@ -14,6 +14,8 @@ public class StudentPreRegistration {
 	
 	private String musicGroupId;
 	
+	private String school;
+	
 	/** 用户编号 */
 	private Integer userId;
 	
@@ -83,6 +85,14 @@ public class StudentPreRegistration {
 		this.musicGroupId = musicGroupId;
 	}
 
+	public String getSchool() {
+		return school;
+	}
+
+	public void setSchool(String school) {
+		this.school = school;
+	}
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExpenditureTypeEnum.java

@@ -15,6 +15,16 @@ public enum ExpenditureTypeEnum implements BaseEnum<Integer, ExpenditureTypeEnum
         this.desc = desc;
     }
 
+    public static ExpenditureTypeEnum valueOfDesc(String desc) {
+        ExpenditureTypeEnum[] values = ExpenditureTypeEnum.values();
+        for (ExpenditureTypeEnum value : values) {
+            if(value.getDesc().equals(desc)){
+                return value;
+            }
+        }
+        return null;
+    }
+
     @Override
     public Integer getCode() {
         return code;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/FeeProjectEnum.java

@@ -32,6 +32,16 @@ public enum FeeProjectEnum implements BaseEnum<Integer, FeeProjectEnum> {
         this.desc = desc;
     }
 
+    public static FeeProjectEnum valueOfDesc(String desc) {
+        FeeProjectEnum[] values = FeeProjectEnum.values();
+        for (FeeProjectEnum value : values) {
+            if(value.getDesc().equals(desc)){
+                return value;
+            }
+        }
+        return null;
+    }
+
     @Override
     public Integer getCode() {
         return code;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupType.java

@@ -25,6 +25,16 @@ public enum GroupType implements BaseEnum<String, GroupType> {
 		this.desc = desc;
 	}
 
+	public static GroupType valueOfDesc(String desc) {
+		GroupType[] values = GroupType.values();
+		for (GroupType value : values) {
+			if(value.getDesc().equals(desc)){
+				return value;
+			}
+		}
+		return null;
+	}
+
 	@Override
 	public String getCode() {
 		return name();

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/QuestionnaireActiveTypeEnum.java

@@ -5,7 +5,8 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum QuestionnaireActiveTypeEnum implements BaseEnum<String, QuestionnaireActiveTypeEnum> {
 	REPLACEMENT("REPLACEMENT", "乐器置换"),
 	CLOUD_TEACHER_FEEDBACK("CLOUD_TEACHER_FEEDBACK", "云教练用户反馈"),
-	MUSIC_GROUP_QUESTION("MUSIC_GROUP_QUESTION", "乐团满意度调查");
+	MUSIC_GROUP_QUESTION("MUSIC_GROUP_QUESTION", "乐团满意度调查"),
+	ENTERPRISE_CUSTOMIZATION("ENTERPRISE_CUSTOMIZATION", "管乐迷定制问卷");
 
 	private String code;
 

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/FinancialExpenditureService.java

@@ -1,8 +1,10 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.FinancialExpenditureDto;
+import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
@@ -10,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 public interface FinancialExpenditureService extends BaseService<Long, FinancialExpenditure> {
     /**
@@ -44,4 +47,22 @@ public interface FinancialExpenditureService extends BaseService<Long, Financial
      * @return
      */
     List<FinancialExpenditure> batchAdd(List<FinancialExpenditure> financialExpenditures);
+
+    /**
+    * @description: 同步oa审批到支出记录
+     * @param workOrderId
+    * @return void
+    * @author zx
+    * @date 2021/11/25 16:07
+    */
+    void syncOaPayLog(Integer workOrderId);
+
+    /**
+    * @description: 校验课程、乐团退费参数
+     * @param paramMap
+    * @return com.ym.mec.common.entity.HttpResponseResult
+    * @author zx
+    * @date 2021/11/29 14:40
+    */
+    void checkCourseReturnFee(Map<String,String> paramMap);
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java

@@ -65,6 +65,24 @@ public interface GroupClassService {
     HttpResponseResult cancelGroup(ReturnFeeDto returnFeeDto);
 
     /**
+    * @description: OA审批关闭课程组
+     * @param returnFeeDto
+    * @return void
+    * @author zx
+    * @date 2021/11/30 11:16
+    */
+    void cancelGroupOa(ReturnFeeDto returnFeeDto);
+
+    /**
+    * @description: 校验OA审批关闭课程组参数
+     * @param returnFeeDto
+    * @return void
+    * @author zx
+    * @date 2021/11/30 11:16
+    */
+    void checkCancelGroupOa(ReturnFeeDto returnFeeDto);
+
+    /**
     * @description: 退还活动相关赠送
      * @param activityUserMapper
      * @param confirmReturnActivityGive

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java

@@ -178,6 +178,26 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	 */
 	boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
 								 boolean isRefundTeachingAssistantsFee,boolean isRefundMemberFee, BigDecimal maintenanceFee, BigDecimal cloudTeacherAmount);
+	/**
+	 * 处理oa审批退团逻辑
+	 * @param musicGroupId
+	 * @param userId
+	 * @param reason
+	 * @param isRefundInstrumentFee 是否退还乐器费用
+	 * @param isRefundTeachingAssistantsFee 是否退还教辅费用
+	 * @param maintenanceFee
+	 * @return
+	 */
+	void directQuitMusicGroupOa(String musicGroupId, Integer userId, String reason, boolean isRefundInstrumentFee,
+								   boolean isRefundTeachingAssistantsFee, boolean maintenanceFee,BigDecimal amount);
+
+	/**
+	 * 检测oa退团参数
+	 * @param musicGroupId
+	 * @param userId
+	 * @return
+	 */
+	void checkDirectQuitMusicGroupOa(String musicGroupId, Integer userId);
 
 	/**
 	 *  续费

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/QuestionnaireUserResultService.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityDto;
 import com.ym.mec.biz.dal.entity.QuestionnaireQuestion;
 import com.ym.mec.biz.dal.entity.QuestionnaireUserResult;
+import com.ym.mec.biz.dal.page.QuestionnaireUserResultQueryInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 import org.json.JSONObject;
@@ -29,4 +30,15 @@ public interface QuestionnaireUserResultService extends BaseService<Long, Questi
      * @return
      */
     void add(ReplacementInstrumentActivityDto replacementInstrumentActivityDto);
+
+    /**
+    * @description: 提交调查问卷(没有活动)
+     * @param replacementInstrumentActivity
+    * @return void
+    * @author zx
+    * @date 2021/12/2 17:24
+    */
+    void addResult(ReplacementInstrumentActivityDto replacementInstrumentActivity);
+
+    Object queryResultPage(QuestionnaireUserResultQueryInfo queryInfo);
 }

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

@@ -31,7 +31,7 @@ public class UploadFileService {
 	private int maxSize;
 
 	/** 支持的扩展名 */
-	@Value("${common.upload.supportExtensions:jpg,jpeg,gif,png,mp3,mid,midi,aac,m4a,mp4,xml,xlsx,xls,doc,docx,txt,pdf}")
+	@Value("${common.upload.supportExtensions:jpg,jpeg,gif,png,mp3,mid,midi,aac,m4a,mp4,xml,xlsx,xls,doc,docx,txt,pdf,psd,eps,rar,zip}")
 	private String supportExtensions;
 
 	/** 文件根目录 */
@@ -69,7 +69,6 @@ public class UploadFileService {
 		String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME,staticFloder + folder, file);
 
 		FileUtils.deleteQuietly(file);
-
 		uploadReturn.setStatus(true);
 		uploadReturn.setUrl(url);
 		return uploadReturn;

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -306,6 +306,26 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     HttpResponseResult applyRefundForStudent(ReturnFeeDto returnFeeDto);
 
     /**
+     * @describe 校验Oa审批,vip退课参数
+     * @author Joburgess
+     * @date 2019/11/15
+     * @param vipGroupId: vip课程
+     * @param studentId: 学生编号
+     * @return void
+     */
+    void checkApplyRefundForStudentOa(ReturnFeeDto returnFeeDto);
+
+    /**
+     * @describe 处理oa审批的vip退费逻辑
+     * @author Joburgess
+     * @date 2019/11/15
+     * @param vipGroupId: vip课程
+     * @param studentId: 学生编号
+     * @return void
+     */
+    void applyRefundForStudentOa(ReturnFeeDto returnFeeDto);
+
+    /**
      * @describe 对某个学生进行休学
      * @author Joburgess
      * @date 2019/12/18

+ 322 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -1,17 +1,22 @@
 package com.ym.mec.biz.service.impl;
 
 
+import com.alibaba.druid.sql.visitor.functions.If;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.ym.mec.auth.api.entity.SysUserDevice;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.FinancialExpenditureDao;
-import com.ym.mec.biz.dal.dto.FinancialExpenditureDto;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
-import com.ym.mec.biz.dal.enums.ExpenditureTypeEnum;
-import com.ym.mec.biz.dal.enums.FeeProjectEnum;
-import com.ym.mec.biz.dal.enums.GoodsType;
-import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
+import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
-import com.ym.mec.biz.service.FinancialExpenditureService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -32,6 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -40,6 +46,16 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 
     @Autowired
     private FinancialExpenditureDao financialExpenditureDao;
+    @Autowired
+    private OrganizationDao organizationDao;
+    @Autowired
+    private EmployeeDao employeeDao;
+    @Autowired
+    private VipGroupService vipGroupService;
+    @Autowired
+    private GroupClassService groupClassService;
+    @Autowired
+    private MusicGroupService musicGroupService;
 
     @Override
     public BaseDAO<Long, FinancialExpenditure> getDAO() {
@@ -198,5 +214,305 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         return financialExpenditures;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void syncOaPayLog(Integer workOrderId) {
+        PWorkOrderInfo pWorkOrderInfo = financialExpenditureDao.getWorkOrderInfo(workOrderId);
+        if (pWorkOrderInfo != null){
+            Integer hasFinancial = financialExpenditureDao.findByBatchNoAndProcessNo(workOrderId);
+            if(hasFinancial != null){
+                return;
+            }
+            String formStructure = financialExpenditureDao.getFormStructure(workOrderId);
+            JSONObject formData = JSONObject.parseObject(financialExpenditureDao.getFormData(workOrderId));
+            OaFormStructureDto oaFormStructureDto = JSONObject.parseObject(formStructure, OaFormStructureDto.class);
+            List<OaInputDto> oaInputDtos = oaFormStructureDto.getList();
+            //课程退费和乐团退费需要单独处理
+            if(pWorkOrderInfo.getProcess().equals(22) || pWorkOrderInfo.getProcess().equals(19)){
+                List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
+                for (OaInputDto oaInputDto : oaInputDtos) {
+                    if(!"子表单".equals(oaInputDto.getName())){
+                        continue;
+                    }
+                    String submitForm = oaInputDto.getModel();
+                    List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
+                    for (HashMap hashMap : hashMaps) {
+                        FinancialExpenditure financialExpenditure = new FinancialExpenditure();
+                        financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
+                        financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
+                        List<OaColumnDto> columns = oaInputDto.getColumns();
+                        if(columns != null && columns.size() > 0){
+                            for (OaColumnDto column : columns) {
+                                List<OaInputDto> columnList = column.getList();
+                                if(columnList != null && columnList.size() > 0){
 
+                                    Employee employee = employeeDao.get(pWorkOrderInfo.getCreator());
+                                    List<SimpleUserDto> byIds = new ArrayList<>();
+                                    if(employee != null){
+                                        List<Integer> userIds = new ArrayList<>();
+                                        userIds.add(employee.getUserId());
+                                        byIds = employeeDao.findByIds(userIds);
+                                    }
+                                    if(employee != null){
+                                        if(byIds != null && byIds.size() > 0){
+                                            SimpleUserDto simpleUserDto = byIds.get(0);
+                                            financialExpenditure.setApplyUser(simpleUserDto.getUserName());
+                                        }
+                                    }
+                                    for (OaInputDto inputDto : columnList) {
+                                        String name = inputDto.getName();
+                                        if(name.contains("课程组编号")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setVipGroupId(Long.parseLong(o.toString()));
+                                                continue;
+                                            }
+                                        }else if(name.contains("课程类型")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setGroupType(o.toString());
+                                                continue;
+                                            }
+                                        }else if(name.contains("乐团编号")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setMusicGroupId(o.toString());
+                                                continue;
+                                            }
+                                        }else if(name.contains("退费项目")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setReturnFeeType(o.toString());
+                                                continue;
+                                            }
+                                        }else if(name.contains("学员编号")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setStudentId(Integer.parseInt(o.toString()));
+                                                continue;
+                                            }
+                                        }else if(name.contains("分部")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                int organId = Integer.parseInt(o.toString());
+                                                Organization organization = organizationDao.get(organId);
+                                                if(organization != null){
+                                                    financialExpenditure.setOrganId(organization.getId());
+                                                    financialExpenditure.setOrganName(organization.getName());
+                                                }
+                                                continue;
+                                            }
+                                        }else if(name.contains("金额")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
+                                                continue;
+                                            }
+                                        }else if(name.contains("情况说明")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setCause(o.toString());
+                                                continue;
+                                            }
+                                        }else if(name.contains("支出类型")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
+                                                continue;
+                                            }
+                                        }else if(name.contains("费用类型")){
+                                            Object o = hashMap.get(inputDto.getModel());
+                                            if(o != null){
+                                                financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
+                                                continue;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        financialExpenditureList.add(financialExpenditure);
+                    }
+                }
+                //课程退费
+                if(pWorkOrderInfo.getProcess().equals(22)){
+                    for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                        ReturnFeeDto returnFeeDto = new ReturnFeeDto();
+                        returnFeeDto.setGroupType(GroupType.valueOfDesc(financialExpenditure.getGroupType()));
+                        returnFeeDto.setAmount(financialExpenditure.getAmount());
+                        returnFeeDto.setStudentId(financialExpenditure.getStudentId());
+                        returnFeeDto.setConfirmReturnActivityGive(true);
+                        returnFeeDto.setGroupId(financialExpenditure.getVipGroupId());
+                        returnFeeDto.setVipGroupId(financialExpenditure.getVipGroupId());
+                        if(returnFeeDto.getGroupType() == GroupType.VIP){
+                            vipGroupService.applyRefundForStudentOa(returnFeeDto);
+                        }else if(returnFeeDto.getGroupType() == GroupType.COMM || returnFeeDto.getGroupType() == GroupType.PRACTICE){
+                            groupClassService.cancelGroupOa(returnFeeDto);
+                        }
+                    }
+                }else {
+                    //退团
+                    for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                        Boolean isRefundInstrumentFee = false;
+                        Boolean isRefundTeachingAssistantsFee = false;
+                        Boolean maintenanceFee = false;
+                        String returnFeeType = financialExpenditure.getReturnFeeType();
+                        if(StringUtils.isNotEmpty(returnFeeType)){
+                            if(returnFeeType.contains("乐器")){
+                                isRefundInstrumentFee = true;
+                            }
+                            if(returnFeeType.contains("乐保")){
+                                maintenanceFee = true;
+                            }
+                            if(returnFeeType.contains("教辅")){
+                                isRefundTeachingAssistantsFee = true;
+                            }
+                        }
+                        musicGroupService.directQuitMusicGroupOa(financialExpenditure.getMusicGroupId(), financialExpenditure.getStudentId(),
+                                financialExpenditure.getCause(), isRefundInstrumentFee,
+                                isRefundTeachingAssistantsFee, maintenanceFee, financialExpenditure.getAmount());
+                    }
+                }
+                financialExpenditureDao.batchInsert(financialExpenditureList);
+            }else {
+                FinancialExpenditure financialExpenditure = new FinancialExpenditure();
+                financialExpenditure.setBatchNo(workOrderId.toString());
+                financialExpenditure.setFinancialProcessNo(workOrderId.toString());
+                Employee employee = employeeDao.get(pWorkOrderInfo.getCreator());
+                Integer organId = financialExpenditureDao.getDeptId(pWorkOrderInfo.getDeptId());
+                Organization organization = organizationDao.get(organId);
+                if(organization != null){
+                    financialExpenditure.setOrganId(organization.getId());
+                    financialExpenditure.setOrganName(organization.getName());
+                }
+                if(employee != null){
+                    List<Integer> userIds = new ArrayList<>();
+                    userIds.add(employee.getUserId());
+                    List<SimpleUserDto> byIds = employeeDao.findByIds(userIds);
+                    if(byIds != null && byIds.size() > 0){
+                        SimpleUserDto simpleUserDto = byIds.get(0);
+                        financialExpenditure.setApplyUser(simpleUserDto.getUserName());
+                    }
+                }
+                for (OaInputDto oaInputDto : oaInputDtos) {
+                    String name = oaInputDto.getName();
+                    if(name.contains("金额")){
+                        Object o = formData.get(oaInputDto.getModel());
+                        if(o != null){
+                            financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
+                            continue;
+                        }
+                    }else if(name.contains("情况说明")){
+                        Object o = formData.get(oaInputDto.getModel());
+                        if(o != null){
+                            financialExpenditure.setCause(o.toString());
+                            continue;
+                        }
+                    }else if(name.contains("支出类型")){
+                        Object o = formData.get(oaInputDto.getModel());
+                        if(o != null){
+                            financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
+                            continue;
+                        }
+                    }else if(name.contains("费用类型")){
+                        Object o = formData.get(oaInputDto.getModel());
+                        if(o != null){
+                            financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
+                            continue;
+                        }
+                    }
+                }
+                financialExpenditureDao.insert(financialExpenditure);
+            }
+        }
+    }
+
+    @Override
+    public void checkCourseReturnFee(Map<String,String> paramMap) {
+        String tplInfoId = paramMap.get("tplInfoId");
+        if(StringUtils.isEmpty(tplInfoId)){
+            throw new BizException("参数校验失败");
+        }
+        if(tplInfoId.equals("11") || tplInfoId.equals("8")){
+            JSONObject formData = JSONObject.parseObject(paramMap.get("formData"));
+            String formStructure = financialExpenditureDao.getTplInfo(tplInfoId);
+            OaFormStructureDto oaFormStructureDto = JSONObject.parseObject(formStructure, OaFormStructureDto.class);
+            List<OaInputDto> oaInputDtos = oaFormStructureDto.getList();
+            List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
+            for (OaInputDto oaInputDto : oaInputDtos) {
+                if(!"子表单".equals(oaInputDto.getName())){
+                    continue;
+                }
+                String submitForm = oaInputDto.getModel();
+                List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
+                for (HashMap hashMap : hashMaps) {
+                    FinancialExpenditure financialExpenditure = new FinancialExpenditure();
+                    List<OaColumnDto> columns = oaInputDto.getColumns();
+                    if(columns != null && columns.size() > 0){
+                        for (OaColumnDto column : columns) {
+                            List<OaInputDto> columnList = column.getList();
+                            if(columnList != null && columnList.size() > 0){
+                                for (OaInputDto inputDto : columnList) {
+                                    String name = inputDto.getName();
+                                    if(name.contains("课程组编号")){
+                                        Object o = hashMap.get(inputDto.getModel());
+                                        if(o != null){
+                                            financialExpenditure.setVipGroupId(Long.parseLong(o.toString()));
+                                            continue;
+                                        }
+                                    }else if(name.contains("课程类型")){
+                                        Object o = hashMap.get(inputDto.getModel());
+                                        if(o != null){
+                                            financialExpenditure.setGroupType(o.toString());
+                                            continue;
+                                        }
+                                    }else if(name.contains("乐团编号")){
+                                        Object o = hashMap.get(inputDto.getModel());
+                                        if(o != null){
+                                            financialExpenditure.setMusicGroupId(o.toString());
+                                            continue;
+                                        }
+                                    }else if(name.contains("学员编号")){
+                                        Object o = hashMap.get(inputDto.getModel());
+                                        if(o != null){
+                                            financialExpenditure.setStudentId(Integer.parseInt(o.toString()));
+                                            continue;
+                                        }
+                                    }else if(name.contains("金额")){
+                                        Object o = hashMap.get(inputDto.getModel());
+                                        if(o != null){
+                                            financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
+                                            continue;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    financialExpenditureList.add(financialExpenditure);
+                }
+            }
+            //课程退费
+            if(tplInfoId.equals("11")){
+                for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                    ReturnFeeDto returnFeeDto = new ReturnFeeDto();
+                    returnFeeDto.setGroupType(GroupType.valueOfDesc(financialExpenditure.getGroupType()));
+                    returnFeeDto.setAmount(financialExpenditure.getAmount());
+                    returnFeeDto.setStudentId(financialExpenditure.getStudentId());
+                    returnFeeDto.setConfirmReturnActivityGive(true);
+                    returnFeeDto.setGroupId(financialExpenditure.getVipGroupId());
+                    returnFeeDto.setVipGroupId(financialExpenditure.getVipGroupId());
+                    if(returnFeeDto.getGroupType() == GroupType.VIP){
+                        vipGroupService.checkApplyRefundForStudentOa(returnFeeDto);
+                    }else if(returnFeeDto.getGroupType() == GroupType.COMM || returnFeeDto.getGroupType() == GroupType.PRACTICE){
+                        groupClassService.checkCancelGroupOa(returnFeeDto);
+                    }
+                }
+            }else {
+                for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                    musicGroupService.checkDirectQuitMusicGroupOa(financialExpenditure.getMusicGroupId(), financialExpenditure.getStudentId());
+                }
+            }
+        }
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.entity.*;
@@ -9,6 +10,8 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.date.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
@@ -55,7 +58,7 @@ public class GroupClassServiceImpl implements GroupClassService {
     @Autowired
     private PracticeGroupDao practiceGroupDao;
     @Autowired
-    private SysUserCashAccountService sysUserCashAccountService;
+    private TeacherDao teacherDao;
     @Autowired
     private SysUserCashAccountLogDao sysUserCashAccountLogDao;
     @Autowired
@@ -81,6 +84,8 @@ public class GroupClassServiceImpl implements GroupClassService {
     @Autowired
     private PracticeGroupService practiceGroupService;
 
+    private final static Logger LOGGER = LoggerFactory.getLogger(GroupClassServiceImpl.class);
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean deleteAllGroupInfo(String groupId, GroupType groupType) {
@@ -223,6 +228,130 @@ public class GroupClassServiceImpl implements GroupClassService {
         return BaseController.succeed();
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void cancelGroupOa(ReturnFeeDto returnFeeDto) {
+        Long groupId = returnFeeDto.getGroupId();
+        if (Objects.isNull(groupId)) {
+            LOGGER.error("请指定课程组");
+            return;
+        }
+        GroupType groupType = returnFeeDto.getGroupType();
+        if (Objects.isNull(groupType)) {
+            LOGGER.error("请指定课程组类型");
+            return;
+        }
+        Date now = new Date();
+        if (groupType.equals(GroupType.PRACTICE)) {
+            PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
+            if (Objects.isNull(practiceGroup)) {
+                LOGGER.error("课程组 {} 不存在",groupId);
+                return;
+            }
+            if (!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL) || practiceGroup.getCoursesExpireDate().before(now)) {
+                LOGGER.error("课程组 {} {} 不可关闭",groupId,practiceGroup.getName());
+                return;
+            }
+            if (Objects.nonNull(returnFeeDto.getAmount()) && returnFeeDto.getAmount().compareTo(BigDecimal.ZERO) > 0) {
+                SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+                sysUserCashAccountLog.setGroupType(GroupType.PRACTICE);
+                sysUserCashAccountLog.setUserId(practiceGroup.getStudentId());
+                sysUserCashAccountLog.setOrganId(practiceGroup.getOrganId());
+                sysUserCashAccountLog.setGroupId(practiceGroup.getId().toString());
+                sysUserCashAccountLog.setAmount(returnFeeDto.getAmount());
+                sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.PRACTICE);
+                sysUserCashAccountLog.setComment("OA审批关闭网管课");
+                sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
+            }
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
+            quitActivityGive(activityUserMapper, returnFeeDto.getConfirmReturnActivityGive(), practiceGroup.getId(),GroupType.PRACTICE);
+            cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
+            practiceGroup.setMemo("OA审批关闭网管课");
+            practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
+            practiceGroup.setUpdateTime(now);
+            practiceGroupDao.update(practiceGroup);
+        } else if (groupType.equals(GroupType.COMM)) {
+            CoursesGroup coursesGroup = coursesGroupDao.get(groupId);
+            if (Objects.isNull(coursesGroup)) {
+                LOGGER.error("课程组 {} 不存在",groupId);
+                return;
+            }
+            if (coursesGroup.getStatus().equals(GroupStatusEnum.CANCEL)) {
+                LOGGER.error("课程组 {} {} 已关闭",groupId,coursesGroup.getName());
+                return;
+            }
+            List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId.toString(), groupType);
+            if (!CollectionUtils.isEmpty(groupNotStartCourses)) {
+                //剩余课程时长
+                Integer totalCourseTime = groupNotStartCourses.size() * coursesGroup.getSingleClassMinutes();
+                sysTenantAccountService.update(coursesGroup.getTeacherId(), totalCourseTime, "", SysTenantAccountDetail.TransType.RETURN, "", BigDecimal.ZERO, "关闭课程组");
+            } else {
+                LOGGER.error("课程组 {} {} 已结束",groupId,coursesGroup.getName());
+                return;
+            }
+            cleanGroupInfo(groupId.toString(), GroupType.COMM);
+            coursesGroup.setMemo("OA审批关闭课程组");
+            coursesGroup.setStatus(GroupStatusEnum.CANCEL);
+            coursesGroupDao.update(coursesGroup);
+        }
+    }
+
+    @Override
+    public void checkCancelGroupOa(ReturnFeeDto returnFeeDto) {
+        Long groupId = returnFeeDto.getGroupId();
+        Integer studentId = returnFeeDto.getStudentId();
+        if (Objects.isNull(groupId)) {
+            throw new BizException("请指定课程组");
+        }
+        if (Objects.isNull(studentId)) {
+            throw new BizException("请指定学员");
+        }
+        GroupType groupType = returnFeeDto.getGroupType();
+        if (Objects.isNull(groupType)) {
+            throw new BizException("请指定课程组类型");
+        }
+        SysUser user = teacherDao.getUser(studentId);
+        if(user == null){
+            throw new BizException("用户 {} 信息不存在",studentId);
+        }
+        Student student = studentDao.get(studentId);
+        if(student == null){
+            throw new BizException("学员 {} 信息不存在",studentId);
+        }
+        Date now = new Date();
+        if (groupType.equals(GroupType.PRACTICE)) {
+            PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
+            if (Objects.isNull(practiceGroup)) {
+                throw new BizException("课程组 {} 不存在",groupId);
+            }
+            if (!returnFeeDto.getStudentId().equals(practiceGroup.getStudentId())) {
+                throw new BizException("学员 {} 不在 {} 课程组内",user.getUsername(),practiceGroup.getName());
+            }
+            if (!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL) || practiceGroup.getCoursesExpireDate().before(now)) {
+                throw new BizException("课程组 {} {} 不可关闭",groupId,practiceGroup.getName());
+            }
+            if (Objects.nonNull(returnFeeDto.getAmount()) && returnFeeDto.getAmount().compareTo(BigDecimal.ZERO) > 0) {
+                Map<String, BigDecimal> studentSurplusCourseFee = practiceGroupService.getStudentSurplusCourseFee(groupId);
+                BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
+                if(returnFeeDto.getAmount().compareTo(suplusCourseFee) > 0){
+                    throw new BizException("学员 {} {} 最大可退费金额为{}元",studentId,user.getUsername(),suplusCourseFee.toString());
+                }
+            }
+        } else if (groupType.equals(GroupType.COMM)) {
+            CoursesGroup coursesGroup = coursesGroupDao.get(groupId);
+            if (Objects.isNull(coursesGroup)) {
+                throw new BizException("课程组 {} 不存在",groupId);
+            }
+            if (coursesGroup.getStatus().equals(GroupStatusEnum.CANCEL)) {
+                throw new BizException("课程组 {} {} 已关闭",groupId,coursesGroup.getName());
+            }
+            List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId.toString(), groupType);
+            if (CollectionUtils.isEmpty(groupNotStartCourses)) {
+                throw new BizException("课程组 {} {} 已结束",groupId,coursesGroup.getName());
+            }
+        }
+    }
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)

+ 253 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -709,7 +709,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("报名信息有误,请核查");
         }
         
-        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(studentRegistration.getMusicGroupId());
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(studentRegistration.getMusicGroupId());
         if(musicGroupRegCalender == null){
         	throw new BizException("缴费信息不存在");
         }
@@ -781,7 +781,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //新课程形态
         List<MusicGroupPaymentCalenderCourseSettings> newCourses = new ArrayList<>();
-        if (registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
+        if (musicGroupRegCalender.getPayUserType() == PayUserType.STUDENT && registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
             newCourses = musicGroupPaymentCalenderCourseSettingsDao.getCalenderCourseSettings(registerPayDto.getNewCourse());
             for (MusicGroupPaymentCalenderCourseSettings calenderCourseSetting : newCourses) {
                 if (remitCourseRFeeFlag && !calenderCourseSetting.getIsStudentOptional()) {
@@ -987,7 +987,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	}*/
         }
 
-    	MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(studentRegistration.getMusicGroupId());
+    	MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(studentRegistration.getMusicGroupId());
         if(musicGroupRegCalender == null){
         	throw new BizException("缴费信息不存在");
         }
@@ -1061,7 +1061,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //新课程形态
         List<MusicGroupPaymentCalenderCourseSettings> newCourses = new ArrayList<>();
-        if (registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
+        if (musicGroupRegCalender.getPayUserType() == PayUserType.STUDENT && registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
             newCourses = musicGroupPaymentCalenderCourseSettingsDao.getCalenderCourseSettings(registerPayDto.getNewCourse());
             for (MusicGroupPaymentCalenderCourseSettings calenderCourseSetting : newCourses) {
                 if (remitCourseRFeeFlag && !calenderCourseSetting.getIsStudentOptional()) {
@@ -2744,6 +2744,255 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public void directQuitMusicGroupOa(String musicGroupId, Integer userId, String reason, boolean isRefundInstrumentFee,
+                                        boolean isRefundTeachingAssistantsFee, boolean maintenanceFee,BigDecimal amount) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            return ;
+        }
+        if (musicGroup.getStatus() == MusicGroupStatusEnum.CANCELED || musicGroup.getStatus() == MusicGroupStatusEnum.PAUSE) {
+            return;
+        }
+
+        StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+        if (studentRegistration == null) {
+            return;
+        }
+
+        StudentMusicGroupStatusEnum currentStudentMusicGroupStatus = studentRegistration.getMusicGroupStatus();
+        if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL && currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.APPLY) {
+            return;
+        }
+
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            return;
+        }
+
+        boolean hasPaid = studentRegistration.getMusicGroupStatus().equals(StudentMusicGroupStatusEnum.NORMAL);
+
+        //如果是会员团,并且有预排课计划
+        MusicGroupSchoolTermCourseDetail termCourseDetail = musicGroupSchoolTermCourseDetailDao.findByCourseDateAndMusicGroupId(musicGroupId, null, 0);
+        if(termCourseDetail != null){
+            //是否已经预排部分课程
+            List<CourseSchedule> courseSchedules = courseScheduleDao.queryPreCourseListByMusicGroupId(musicGroup.getId());
+            if(courseSchedules.size() > 0){
+                return;
+            }else {
+                musicGroupSchoolTermStudentCourseDetailDao.deleteByDetailId(termCourseDetail.getId(),userId);
+            }
+        }
+
+        courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), Arrays.asList(userId), GroupType.MUSIC);
+
+        Date date = new Date();
+
+        MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
+        musicGroupQuit.setCreateTime(date);
+        musicGroupQuit.setJoinDate(studentRegistration.getCreateTime());
+        musicGroupQuit.setMusicGroupId(musicGroupId);
+        musicGroupQuit.setUserId(userId);
+        musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
+        musicGroupQuit.setReason(reason);
+        musicGroupQuit.setQuitDate(date);
+        musicGroupQuitDao.insert(musicGroupQuit);
+
+        List<Integer> classGroupIdList = classGroupStudentMapperDao.queryClassGroupIdList(musicGroupId, userId, GroupType.MUSIC);
+        for (Integer classGroupId : classGroupIdList) {
+            ClassGroup classGroup = classGroupService.get(classGroupId);
+            if (classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
+                classGroupService.delSingle(classGroupId);
+            } else {
+                classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId, true);
+            }
+        }
+
+        //删除续费周期
+        musicGroupStudentFeeDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
+
+        // 退团
+        studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.QUIT);
+        studentRegistration.setSurplusCourseFee(BigDecimal.ZERO);
+        studentRegistration.setHasCloudTeacher(0);
+        studentRegistration.setUpdateTime(date);
+        studentRegistrationDao.update(studentRegistration);
+
+        //删除进行中加学生,且在审批中或拒绝的缴费
+        List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
+        if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
+            musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+        }
+
+        //查询未交费的项目
+        List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
+
+        for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
+            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+            if (mgpc != null) {
+                if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
+                    musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                } else {
+                    // 缴费项目预计人数减一
+                    mgpc.setExpectNum(mgpc.getExpectNum() - 1);
+                    mgpc.setUpdateTime(date);
+                    musicGroupPaymentCalenderDao.update(mgpc);
+                }
+            }
+            musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
+        }
+        //删除用户购买的课程记录
+        musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
+
+        List<StudentPaymentOrder> studentPaymentOrderList = new ArrayList<StudentPaymentOrder>();
+
+		if (studentRegistration.getMusicGroupPaymentCalenderId() == null) {
+			if(currentStudentMusicGroupStatus == StudentMusicGroupStatusEnum.NORMAL || (currentStudentMusicGroupStatus == StudentMusicGroupStatusEnum.APPLY && studentRegistration.getPaymentStatus() == PaymentStatusEnum.YES)){
+				studentPaymentOrderList = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
+			}
+
+		} else {
+			studentPaymentOrderList = studentPaymentOrderService.queryByBatchNo(userId, studentRegistration.getMusicGroupPaymentCalenderId() + "",
+					DealStatusEnum.SUCCESS);
+		}
+
+        // 判断乐器是否是租赁
+        MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
+        if (hasPaid && musicGroupSubjectPlan != null) {
+            musicGroupSubjectPlan.setUpdateTime(date);
+            //减去缴费人数(器乐收费,0元时不减缴费人数)
+            if (musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE) {
+
+            	for(StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList){
+            		if (studentPaymentOrder != null && studentPaymentOrder.getPaymentAccountNo() != null && studentPaymentOrder.getPaymentAccountNo().equals("200")) {
+                        musicGroupSubjectPlan.setPaidZeroNum(musicGroupSubjectPlan.getPaidZeroNum() - 1);
+                        musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
+                        break;
+                    } else if (studentPaymentOrder != null && studentPaymentOrder.getPaymentAccountNo() == null) {
+                        musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
+                        break;
+                    }
+            	}
+            } else {
+                musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
+            }
+            musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
+        }
+
+        if (MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())) {
+            //统计变更学员数
+            groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
+        }
+
+        if (studentPaymentOrderList.size() > 0) {
+
+        	List<Long> paymentOrderIdList = studentPaymentOrderList.stream().map(t -> t.getId()).collect(Collectors.toList());
+
+        	Long minPaymentOrderId = Collections.min(paymentOrderIdList);
+
+            List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.getWithIds(paymentOrderIdList);
+
+            SubjectChange studentLastChange = null;
+            if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
+                studentLastChange = subjectChangeDao.getStudentLastChange(userId, musicGroupId);
+            }
+
+			if (studentLastChange != null && minPaymentOrderId <= studentLastChange.getOriginalOrderId()) {
+				if (isRefundInstrumentFee) {
+					StudentInstrument studentMaintenance = studentInstrumentDao.getByOrderId(studentLastChange.getOrderId().longValue());
+		            if (studentMaintenance != null) {
+		                studentMaintenance.setDelFlag(1);
+		                studentInstrumentDao.update(studentMaintenance);
+		            }
+				}
+			} else {
+				for (StudentPaymentOrderDetail detail : orderDetailList) {
+					// 退乐器费用
+					if (isRefundInstrumentFee && detail.getType() == MUSICAL) {
+						StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
+			            if (studentMaintenance != null) {
+			                studentMaintenance.setDelFlag(1);
+			                studentInstrumentDao.update(studentMaintenance);
+			            }
+					}
+				}
+			}
+
+        }
+        //退乐保费用
+        if (maintenanceFee) {
+            StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
+            if (studentMaintenance != null) {
+                studentMaintenance.setStatus(0);
+                studentMaintenance.setStartTime(null);
+                studentMaintenance.setEndTime(null);
+                studentInstrumentDao.update(studentMaintenance);
+            }
+        }
+
+        if (amount.doubleValue() > 0) {
+            //这个接口没有退费的操作了
+            SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+            sysUserCashAccountLog.setGroupType(GroupType.MUSIC);
+            sysUserCashAccountLog.setUserId(userId);
+            sysUserCashAccountLog.setOrganId(musicGroup.getOrganId());
+            sysUserCashAccountLog.setGroupId(musicGroupId);
+            sysUserCashAccountLog.setAmount(amount);
+            sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.MUSIC);
+            sysUserCashAccountLog.setComment("OA审批退团");
+            sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
+        }
+    }
+
+    @Override
+    public void checkDirectQuitMusicGroupOa(String musicGroupId, Integer userId) {
+        SysUser user = teacherDao.getUser(userId);
+        if (user == null) {
+            throw new BizException("学员 {} 信息不存在",userId);
+        }
+        Student student = studentDao.get(userId);
+        if(student == null){
+            throw new BizException("学员 {} 信息不存在",userId);
+        }
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团 {} 不存在",musicGroupId);
+        }
+        if (musicGroup.getStatus() == MusicGroupStatusEnum.CANCELED || musicGroup.getStatus() == MusicGroupStatusEnum.PAUSE) {
+            throw new BizException("退团失败,乐团 {} {} 状态[已取消]或[已暂停]",musicGroupId,musicGroup.getName());
+        }
+
+        StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+        if (studentRegistration == null) {
+            throw new BizException("学员 {} {} 注册信息不存在",userId,user.getUsername());
+        }
+
+        StudentMusicGroupStatusEnum currentStudentMusicGroupStatus = studentRegistration.getMusicGroupStatus();
+        if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL && currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.APPLY) {
+            throw new BizException("学员 {} {} 当前在团状态不能退团",userId,user.getUsername());
+        }
+
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            throw new BizException("学员 {} {} 存在[进行中]的课程",userId,user.getUsername());
+        }
+
+        //如果是会员团,并且有预排课计划
+        MusicGroupSchoolTermCourseDetail termCourseDetail = musicGroupSchoolTermCourseDetailDao.findByCourseDateAndMusicGroupId(musicGroupId, null, 0);
+        if(termCourseDetail != null){
+            //是否已经预排部分课程
+            List<CourseSchedule> courseSchedules = courseScheduleDao.queryPreCourseListByMusicGroupId(musicGroup.getId());
+            if(courseSchedules.size() > 0){
+                throw new BizException("乐团 {} {} 存在预排课课程,请优先完成预排课",musicGroupId,musicGroup.getName());
+            }
+        }
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public Map renew(RenewParamDto renewParamDto) throws Exception {
         Long calenderId = renewParamDto.getCalenderId();
         Integer userId = renewParamDto.getUserId();

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/QuestionnaireUserResultServiceImpl.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.QuestionnaireActiveTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.page.QuestionnaireUserResultQueryInfo;
 import com.ym.mec.biz.dal.page.ReplacementInstrumentActivityQueryInfo;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -17,6 +18,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.json.JSONObject;
@@ -194,4 +196,43 @@ public class QuestionnaireUserResultServiceImpl extends BaseServiceImpl<Long, Qu
 		//新增问卷结果
 		questionnaireUserResultDao.batchInsert1(questionnaireUserResultList);
 	}
+
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public void addResult(ReplacementInstrumentActivityDto replacementInstrumentActivity) {
+		Integer topicId = replacementInstrumentActivity.getTopicId();
+
+		List<QuestionnaireUserResult> questionnaireUserResultList = replacementInstrumentActivity.getQuestionnaireUserResultList();
+		if(questionnaireUserResultList == null || questionnaireUserResultList.size() == 0){
+			throw new BizException("请填写问卷结果");
+		}
+		Long time = new Date().getTime();
+		for (QuestionnaireUserResult result : questionnaireUserResultList) {
+			result.setUserId(time.intValue());
+			result.setQuestionnaireTopicId(topicId);
+			result.setActiveType(QuestionnaireActiveTypeEnum.ENTERPRISE_CUSTOMIZATION);
+		}
+		//新增问卷结果
+		questionnaireUserResultDao.batchInsert1(questionnaireUserResultList);
+    }
+
+	@Override
+	public Object queryResultPage(QuestionnaireUserResultQueryInfo queryInfo) {
+		PageInfo<QuestionnaireUserResultDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<QuestionnaireUserResultDto> dataList = null;
+		int count = questionnaireUserResultDao.countResultCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = questionnaireUserResultDao.findResultCount(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

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

@@ -175,6 +175,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         student.setCreateTime(date);
         student.setUpdateTime(date);
         student.setIsNewUser(true);
+        student.setSchoolName(studentPreRegistration.getSchool());
         student.setCurrentGradeNum(studentPreRegistration.getCurrentGradeNum());
         student.setCurrentClass(studentPreRegistration.getCurrentClass());
         studentDao.insert(student);

+ 152 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -3143,6 +3143,158 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	public void checkApplyRefundForStudentOa(ReturnFeeDto returnFeeDto) {
+		Long vipGroupId = returnFeeDto.getVipGroupId();
+		Integer studentId = returnFeeDto.getStudentId();
+		if(Objects.isNull(vipGroupId) || Objects.isNull(studentId)){
+			throw new BizException("请指定小课与学生");
+		}
+		SysUser user = teacherDao.getUser(studentId);
+		if(user == null){
+			throw new BizException("用户 {} 信息不存在",studentId);
+		}
+		Student student = studentDao.get(studentId);
+		if(student == null){
+			throw new BizException("学员 {} 信息不存在",studentId);
+		}
+		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
+		if(Objects.isNull(vipGroup)){
+			throw new BizException("课程 {} 不存在",vipGroupId);
+		}
+		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
+			throw new BizException("课程 {} {} 已停止",vipGroupId,vipGroup.getName());
+		}
+		if(vipGroup.getName().startsWith("考前辅导课")){
+			throw new BizException("课程 {} {} 不支持退学",vipGroupId,vipGroup.getName());
+		}
+
+		List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
+		if(!CollectionUtils.isEmpty(studentApplyRefunds)){
+			throw new BizException("学生 {} {} 存在退课申请",studentId,user.getUsername());
+		}
+
+		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
+
+		ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
+				studentId);
+
+		if(Objects.isNull(classStudentMapperByUserIdAndClassGroupId)){
+			throw new BizException("学生 {} {} 不在此课程中",studentId,user.getUsername());
+		}
+
+		if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){
+			throw new BizException("学生 {} {} 已经是退学状态",studentId,user.getUsername());
+		}
+		BigDecimal amount = returnFeeDto.getAmount();
+		if(!classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)){
+			if(Objects.isNull(amount)){
+				throw new BizException("请确定退费金额");
+			}
+			Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
+			BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
+			if(amount.compareTo(suplusCourseFee) > 0){
+				throw new BizException("学员 {} {} 最大可退费金额为{}元", studentId,user.getUsername(),suplusCourseFee.toString());
+			}
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void applyRefundForStudentOa(ReturnFeeDto returnFeeDto) {
+		Long vipGroupId = returnFeeDto.getVipGroupId();
+		Integer studentId = returnFeeDto.getStudentId();
+		if(Objects.isNull(vipGroupId) || Objects.isNull(studentId)){
+			return;
+		}
+		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
+		if(Objects.isNull(vipGroup)){
+			return;
+		}
+		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
+			return;
+		}
+		if(vipGroup.getName().startsWith("考前辅导课")){
+			return;
+		}
+
+		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
+
+		List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
+		if(!CollectionUtils.isEmpty(studentApplyRefunds)){
+			return;
+        }
+
+        ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
+
+		ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
+				studentId);
+
+		if(Objects.isNull(classStudentMapperByUserIdAndClassGroupId)){
+			return;
+		}
+
+		if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){
+			return;
+		}
+		BigDecimal amount = returnFeeDto.getAmount();
+		if(!classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)){
+			if(Objects.isNull(amount)){
+				return;
+			}
+//			Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
+//			BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
+//			if(amount.compareTo(suplusCourseFee) > 0){
+//				throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
+//			}
+		}
+		//退还活动购买
+		ActivityUserMapper activityUserMapper = activityUserMapperService.findByStudentId(vipGroup.getId(),studentId);
+		HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper, returnFeeDto.getConfirmReturnActivityGive(),vipGroup.getId(),VIP);
+
+        if(classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)){
+			classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
+			classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
+			studentPauseInfoDao.deleteUserPauseInfoWithGroup(GroupType.VIP, vipGroupId.toString(), studentId);
+
+			classGroup.setStudentNum(classGroup.getStudentNum()-1);
+			classGroupDao.update(classGroup);
+			return ;
+        }
+
+		//记录日志
+		SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+		sysUserCashAccountLog.setUserId(studentId);
+		sysUserCashAccountLog.setGroupType(VIP);
+		sysUserCashAccountLog.setOrganId(vipGroup.getOrganId());
+		sysUserCashAccountLog.setGroupId(vipGroupId.toString());
+		sysUserCashAccountLog.setAmount(amount);
+		sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.VIP);
+		sysUserCashAccountLog.setComment("OA审批VIP退课");
+		sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
+
+		classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
+		classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
+
+		courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(),studentId,GroupType.VIP);
+
+        List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classGroup.getId(), studentId);
+        if(!CollectionUtils.isEmpty(studentPaymentIds)){
+            courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
+        }
+
+        if(!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING) || (Objects.nonNull(vipGroupCategory) && vipGroupCategory.getMusicTheory())){
+			courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(), vipGroup.getUserId());
+		}
+
+		classGroup.setStudentNum(classGroup.getStudentNum()-1);
+
+        classGroupDao.update(classGroup);
+
+		//学员退出班级群
+		imGroupMemberService.quit(classGroup.getId().longValue(), studentId);
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void pauseForStudent(Long vipGroupId, Integer studentId) {
 		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){

+ 35 - 0
mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml

@@ -196,6 +196,7 @@
         LEFT JOIN organization o ON o.id_ = fe.organ_id_
         LEFT JOIN cooperation_organ co ON co.id_ = fe.cooperation_organ_id_
         <include refid="queryPageSql"/>
+        ORDER BY fe.id_ DESC
         <include refid="global.limit"/>
     </select>
 
@@ -215,4 +216,38 @@
         </foreach>
         GROUP BY dingtalk_process_no_
     </select>
+    <resultMap id="PWorkOrderInfo" type="com.ym.mec.biz.dal.dto.PWorkOrderInfo">
+        <result property="id" column="id"/>
+        <result property="classify" column="classify"/>
+        <result property="isEnd" column="is_end"/>
+        <result property="isDenied" column="is_denied"/>
+        <result property="isCancel" column="is_cancel"/>
+        <result property="creator" column="mec_user_id"/>
+        <result property="process" column="process"/>
+        <result property="title" column="title"/>
+        <result property="deptId" column="dept_id"/>
+    </resultMap>
+    <select id="getWorkOrderInfo" resultMap="PWorkOrderInfo">
+        SELECT woi.*,su.mec_user_id FROM mec_dev_api.p_work_order_info woi
+        LEFT JOIN mec_dev_api.p_work_order_circulation_history woch ON woi.id = woch.work_order
+        LEFT JOIN mec_dev_api.p_process_info pi ON pi.id = woi.classify
+        LEFT JOIN mec_dev_api.sys_user su ON su.user_id = woi.creator
+        WHERE woi.is_end = 1  AND woi.is_denied = 0  AND woi.is_cancel = 0
+        AND woch.`status` != 0 AND woi.id = #{workOrderId} AND pi.fee_type = 1 LIMIT 1
+    </select>
+    <select id="getFormStructure" resultType="java.lang.String">
+        SELECT form_structure FROM mec_dev_api.p_work_order_tpl_data WHERE work_order = #{workOrderId}
+    </select>
+    <select id="getFormData" resultType="java.lang.String">
+        SELECT form_data FROM mec_dev_api.p_work_order_tpl_data WHERE work_order = #{workOrderId}
+    </select>
+    <select id="getTplInfo" resultType="java.lang.String">
+        SELECT form_structure FROM mec_dev_api.p_tpl_info WHERE id = #{tplInfoId}
+    </select>
+    <select id="findByBatchNoAndProcessNo" resultType="integer">
+        SELECT id_ FROM financial_expenditure WHERE batch_no_ = #{workOrderId} AND financial_process_no_ = #{workOrderId} LIMIT 1
+    </select>
+    <select id="getDeptId" resultType="java.lang.Integer">
+        SELECT organ_id FROM mec_dev_api.sys_dept WHERE dept_id = #{deptId}
+    </select>
 </mapper>

+ 24 - 1
mec-biz/src/main/resources/config/mybatis/QuestionnaireUserResultMapper.xml

@@ -106,14 +106,36 @@
 	</delete>
 
     <!-- 分页查询 -->
+	<select id="findResultCount" resultMap="QuestionnaireUserResultDto" parameterType="map">
+		SELECT qu1.*,qq.content_,GROUP_CONCAT(qqi.answer_value_ ORDER BY qqi.sort_) answer_value_,qq.type_
+		FROM (SELECT qu.user_id_ id_ FROM questionnaire_user_result qu
+		WHERE qu.questionnaire_topic_id_ = #{topicId}
+		<if test="search != null and search != ''">
+			AND (qu.user_id_ = #{search} OR qu.additional_value_ LIKE CONCAT('%',#{search},'%'))
+		</if>
+		GROUP BY qu.user_id_ <include refid="global.limit"/>) qur
+		LEFT JOIN questionnaire_user_result qu1 ON qur.id_ = qu1.user_id_
+		LEFT JOIN questionnaire_question qq ON qq.id_ = qu1.questionnaire_question_id_
+		LEFT JOIN questionnaire_question_item qqi ON FIND_IN_SET(qqi.id_,qu1.questionnaire_question_item_id_list_)
+		WHERE qu1.questionnaire_topic_id_ = #{topicId}
+		GROUP BY qu1.user_id_,qq.id_
+		ORDER BY qu1.user_id_,qq.sort_
+	</select>
+	<!-- 查询当前表的总记录数 -->
+	<select id="countResultCount" resultType="int">
+		SELECT COUNT(DISTINCT qu.user_id_) FROM questionnaire_user_result qu WHERE qu.questionnaire_topic_id_ = #{topicId}
+	</select>
+
+	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="QuestionnaireUserResult" parameterType="map">
 		SELECT * FROM questionnaire_user_result ORDER BY id_ <include refid="global.limit"/>
 	</select>
-	
+
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM questionnaire_user_result
 	</select>
+
     <select id="countByTopicId" resultType="java.lang.Integer">
 		SELECT COUNT(id_) FROM questionnaire_user_result WHERE questionnaire_topic_id_ = #{topicId}
 	</select>
@@ -137,6 +159,7 @@
 			<result column="questionnaire_question_id_" property="questionnaireQuestionId" />
 			<result column="questionnaire_question_item_id_list_" property="questionnaireQuestionItemIdList" />
 			<result column="additional_value_" property="additionalValue" />
+			<result column="type_" property="type" />
 		</collection>
 	</resultMap>
 	<sql id="queryDetailPageSql">

+ 13 - 7
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -8,6 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.Student" id="Student">
         <result column="user_id_" property="userId"/>
+        <result column="school_name_" property="schoolName"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="subject_name_" property="subjectNames"/>
         <result column="service_tag_" property="serviceTag"/>
@@ -77,7 +78,7 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Student" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO student (user_id_,subject_id_list_,
+        INSERT INTO student (user_id_,school_name_,subject_id_list_,
         <if test="serviceTag != null">
             service_tag_,
         </if>
@@ -87,7 +88,7 @@
         teacher_id_,create_time_,update_time_,service_tag_update_time_,cooperation_organ_id_,
         care_package_,come_on_package_,member_rank_setting_id_,membership_start_time_,membership_end_time_)
         VALUES
-        (#{userId},#{subjectIdList},
+        (#{userId},#{schoolName},#{subjectIdList},
         <if test="serviceTag != null">
             #{serviceTag},
         </if>
@@ -101,6 +102,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
         UPDATE student
         <set>
+            <if test="schoolName != null">
+                school_name_ = #{schoolName},
+            </if>
             <if test="subjectIdList != null">
                 subject_id_list_ = #{subjectIdList},
             </if>
@@ -232,6 +236,9 @@
         <foreach collection="studentList" item="item" index="index" open="" close="" separator=";">
             UPDATE student
             <set>
+	            <if test="item.schoolName != null">
+	                school_name_ = #{item.schoolName},
+	            </if>
                 <if test="item.subjectIdList != null">
                     subject_id_list_ = #{item.subjectIdList},
                 </if>
@@ -769,15 +776,14 @@
         </foreach>
     </select>
     <select id="getNoTeacherOrNoSubjectStudent" resultMap="Student">
-        SELECT * FROM student WHERE teacher_id_ IS NULL OR subject_id_list_ IS NULL OR cooperation_organ_id_ IS NULL;
+        SELECT * FROM student WHERE teacher_id_ IS NULL OR subject_id_list_ IS NULL OR cooperation_organ_id_ IS NULL limit 0,1000;
     </select>
 
     <select id="getHasVipCourseStudentIdsFromNewStudents" resultType="int">
-        SELECT DISTINCT s.user_id_
-        FROM student s
-        LEFT JOIN course_schedule_student_payment cssp ON s.user_id_=cssp.user_id_
-        WHERE s.is_new_user_=1 AND cssp.group_type_='VIP'
+        SELECT DISTINCT(spo.user_id_) from student_payment_order spo LEFT JOIN student s on spo.user_id_ = s.user_id_ WHERE spo.type_ in ('DOUBLE_ELEVEN2021','DOUBLE_ELEVEN2020','SMALL_CLASS_TO_BUY')
+		and spo.status_ = 'SUCCESS' and spo.expect_amount_ > 0 and s.is_new_user_ = 1
     </select>
+    
     <select id="getMemberNum" resultType="int">
         SELECT COUNT(0) FROM student WHERE member_rank_setting_id_ IS NOT NULL AND FIND_IN_SET(user_id_,#{studentIdsStr})
     </select>

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

@@ -171,7 +171,7 @@
 			</if>
 			<if test="rankType != null">
 				<if test="rankType == 0">
-					AND ses.rank_ids_ IS NULL
+					AND (ses.rank_ids_ IS NULL or ses.rank_ids_ = '')
 				</if>
 				<if test="rankType == 1">
 					AND ses.rank_ids_ IS NOT NULL AND ses.rank_ids_ != ''

+ 10 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/entity/UploadReturnBean.java

@@ -20,6 +20,16 @@ public class UploadReturnBean {
 
 	private String message;// 上传失败 返回原因
 
+	private String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
 	public String getUrl() {
 		return url;
 	}

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -38,7 +38,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                         "/replacementInstrumentActivity/queryReplacementsStat", "/eduStudentRegistration/queryPreApplyList",
                         "/eduSubject/findSubSubjects", "/eduFinancialExpenditure/batchAdd", "/eduSendNotice/*",
                         "/oaContracts/*", "/eduStudent/organStudentOverView", "/activity/countCloudTeacherActive",
-                        "/activity/organDoubleEleven2021Statis", "/activity/doubleEleven2021Statis").permitAll().anyRequest().authenticated().and().httpBasic();
+                        "/activity/organDoubleEleven2021Statis", "/activity/doubleEleven2021Statis", "/questionnaireTopic/getDetail", "/questionnaireUserResult/add").permitAll().anyRequest().authenticated().and().httpBasic();
     }
 
     @Override

+ 10 - 10
mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java

@@ -48,17 +48,17 @@ public class FinancialExpenditureController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            return failed("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                return failed("非法请求");
             }
+        }
         return succeed(financialExpenditureService.queryFinancialExpenditurePage(queryInfo));
     }
 

+ 1 - 2
mec-web/src/main/java/com/ym/mec/web/controller/QuestionnaireTopicController.java

@@ -30,8 +30,7 @@ public class QuestionnaireTopicController extends BaseController {
 
     @ApiOperation(value = "获取详情")
     @GetMapping("/getDetail")
-    @PreAuthorize("@pcs.hasPermissions('questionnaireTopic/getDetail')")
-    @AuditLogAnnotation(operateName = "新增")
+    @AuditLogAnnotation(operateName = "获取详情")
     public Object getDetail(Integer id) {
         return succeed(questionnaireTopicService.getDetail(id));
     }

+ 17 - 2
mec-web/src/main/java/com/ym/mec/web/controller/QuestionnaireUserResultController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dao.QuestionnaireQuestionDao;
+import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityDto;
 import com.ym.mec.biz.dal.entity.QuestionnaireQuestion;
 import com.ym.mec.biz.dal.enums.QuestionnaireActiveTypeEnum;
 import com.ym.mec.biz.dal.page.QuestionnaireUserResultQueryInfo;
@@ -14,7 +15,7 @@ import io.swagger.annotations.ApiOperation;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -36,13 +37,27 @@ public class QuestionnaireUserResultController extends BaseController {
     @Autowired
     private QuestionnaireQuestionDao questionnaireQuestionDao;
 
+    @ApiOperation(value = "添加调查问卷(非活动)")
+    @RequestMapping("/add")
+    public Object queryPage(@RequestBody ReplacementInstrumentActivityDto replacementInstrumentActivity) {
+        questionnaireUserResultService.addResult(replacementInstrumentActivity);
+        return succeed();
+    }
+
     @ApiOperation(value = "分页查询")
-    @GetMapping("/queryPage")
+    @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('questionnaireUserResult/queryPage')")
     public Object queryPage(QuestionnaireUserResultQueryInfo queryInfo) {
         return succeed(questionnaireUserResultService.queryDetailPage(queryInfo));
     }
 
+    @ApiOperation(value = "分页查询")
+    @RequestMapping("/queryResultPage")
+    @PreAuthorize("@pcs.hasPermissions('questionnaireUserResult/queryResultPage')")
+    public Object queryResultPage(QuestionnaireUserResultQueryInfo queryInfo) {
+        return succeed(questionnaireUserResultService.queryResultPage(queryInfo));
+    }
+
     @ApiOperation(value = "导出")
     @RequestMapping("/export")
     @PreAuthorize("@pcs.hasPermissions('questionnaireUserResult/export')")

+ 1 - 0
mec-web/src/main/java/com/ym/mec/web/controller/UploadFileController.java

@@ -34,6 +34,7 @@ public class UploadFileController extends BaseController {
 		try {
 			if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {
 				UploadReturnBean bean = uploadFileService.uploadFile(file.getInputStream(), UploadUtil.getExtension(file.getOriginalFilename()));
+				bean.setName(file.getOriginalFilename());
 				if (bean.isStatus()) {
 					return succeed(bean);
 				}

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

@@ -1,25 +1,48 @@
 package com.ym.mec.web.controller.education;
 
 import com.ym.mec.biz.dal.dto.OAFinancialDto;
+import com.ym.mec.biz.dal.dto.ReturnFeeDto;
+import com.ym.mec.biz.dal.entity.FinancialExpenditure;
+import com.ym.mec.biz.dal.entity.MusicGroupQuit;
 import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.biz.service.FinancialExpenditureService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-@RequestMapping("oaContracts")
+import java.util.List;
+import java.util.Map;
+
+@RequestMapping()
 @Api(tags = "OA签章服务")
 @RestController
 public class OaContractsController extends BaseController {
 
     @Autowired
     private ContractService contractService;
+    @Autowired
+    private FinancialExpenditureService financialExpenditureService;
 
-    @PostMapping("finance")
+    @PostMapping("oaContracts/finance")
     public HttpResponseResult<String> transferProduceContract(@RequestBody OAFinancialDto financialDto) {
         String fileUrl = contractService.transferOaFinancial(financialDto);
         return succeed(fileUrl);
     }
 
+    @PostMapping("oa/syncPayLog")
+    @ApiOperation("同步oa审批到支出记录")
+    public HttpResponseResult syncOaPayLog(Integer workOrderId) {
+        financialExpenditureService.syncOaPayLog(workOrderId);
+        return succeed();
+    }
+
+    @PostMapping("oa/checkCourseReturnFee")
+    @ApiOperation("校验课程退费、乐团退费参数")
+    public HttpResponseResult checkCourseReturnFee(@RequestBody Map<String,String> paramMap) {
+        financialExpenditureService.checkCourseReturnFee(paramMap);
+        return succeed();
+    }
 }