Selaa lähdekoodia

oa退团审批支持excel

zouxuan 3 vuotta sitten
vanhempi
commit
826a7ec4d8

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/QuitMusicGroupDto.java

@@ -18,7 +18,7 @@ public class QuitMusicGroupDto {
 
     private boolean maintenanceFeeFlag;
 
-    private BigDecimal amount;
+    private BigDecimal amount = BigDecimal.ZERO;
 
     public boolean isRefundCourseFee() {
         return refundCourseFee;

+ 44 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/FinancialExpenditure.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.Objects;
 
 import static com.ym.mec.biz.dal.enums.ExpenditureTypeEnum.REFUND;
 
@@ -82,6 +83,36 @@ public class FinancialExpenditure extends BaseEntity {
 
 	private Integer studentId;
 
+	private boolean refundInstrumentFeeFlag;
+
+	private boolean refundTeachingAssistantsFeeFlag;
+
+	private boolean maintenanceFeeFlag;
+
+	public boolean isRefundInstrumentFeeFlag() {
+		return refundInstrumentFeeFlag;
+	}
+
+	public void setRefundInstrumentFeeFlag(boolean refundInstrumentFeeFlag) {
+		this.refundInstrumentFeeFlag = refundInstrumentFeeFlag;
+	}
+
+	public boolean isRefundTeachingAssistantsFeeFlag() {
+		return refundTeachingAssistantsFeeFlag;
+	}
+
+	public void setRefundTeachingAssistantsFeeFlag(boolean refundTeachingAssistantsFeeFlag) {
+		this.refundTeachingAssistantsFeeFlag = refundTeachingAssistantsFeeFlag;
+	}
+
+	public boolean isMaintenanceFeeFlag() {
+		return maintenanceFeeFlag;
+	}
+
+	public void setMaintenanceFeeFlag(boolean maintenanceFeeFlag) {
+		this.maintenanceFeeFlag = maintenanceFeeFlag;
+	}
+
 	public String getGroupType() {
 		return groupType;
 	}
@@ -281,4 +312,17 @@ public class FinancialExpenditure extends BaseEntity {
 	public void setFeeProjectItem(String feeProjectItem) {
 		this.feeProjectItem = feeProjectItem;
 	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+		FinancialExpenditure that = (FinancialExpenditure) o;
+		return musicGroupId.equals(that.musicGroupId) && studentId.equals(that.studentId);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(musicGroupId, studentId);
+	}
 }

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

@@ -6,7 +6,8 @@ public enum TemplateTypeEnum implements BaseEnum<String, TemplateTypeEnum> {
     GOODS("GOODS","商品导入模板"),
     ROUTE_ORDER("ROUTE_ORDER","财务管理导入模板"),
     FINANCIAL_EXPENDITURE("FINANCIAL_EXPENDITURE","财务支出导入模板"),
-    REDEMPTIONCODE("REDEMPTION_CODE", "兑换码分配模板表");
+    REDEMPTIONCODE("REDEMPTION_CODE", "兑换码分配模板表"),
+    OA_QUIT_MUSIC_GROUP("OA_QUIT_MUSIC_GROUP", "乐团退费模板");
 
     private String code;
 

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.FinancialExpenditureDto;
+import com.ym.mec.biz.dal.dto.QuitMusicGroupDto;
 import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.entity.FinancialExpenditure;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
@@ -11,6 +12,7 @@ import com.ym.mec.common.service.BaseService;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.util.List;
 import java.util.Map;
 
@@ -55,7 +57,7 @@ public interface FinancialExpenditureService extends BaseService<Long, Financial
     * @author zx
     * @date 2021/11/25 16:07
     */
-    void syncOaPayLog(Integer workOrderId);
+    void syncOaPayLog(Integer workOrderId,String fileUrl) throws Exception;
 
     /**
     * @description: 校验课程、乐团退费参数
@@ -73,5 +75,5 @@ public interface FinancialExpenditureService extends BaseService<Long, Financial
     * @author zx
     * @date 2022/3/29 14:57
     */
-    void checkOaQuitMusicGroupExcel(MultipartFile file);
+    List<FinancialExpenditure> checkOaQuitMusicGroupExcel(byte[] buf, String filename) throws Exception;
 }

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

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

+ 98 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -1,10 +1,7 @@
 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.dao.OrganizationDao;
@@ -12,21 +9,26 @@ 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.entity.Organization;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.enums.ExpenditureTypeEnum;
+import com.ym.mec.biz.dal.enums.FeeProjectEnum;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.FinancialExpenditureService;
+import com.ym.mec.biz.service.GroupClassService;
+import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.VipGroupService;
 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;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
 import com.ym.mec.util.ini.IniFileUtil;
-
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,8 +39,10 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.ByteArrayInputStream;
+import java.io.File;
 import java.io.InputStream;
 import java.math.BigDecimal;
+import java.net.URL;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -57,6 +61,8 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
     private GroupClassService groupClassService;
     @Autowired
     private MusicGroupService musicGroupService;
+    @Autowired
+    private FinancialExpenditureService financialExpenditureService;
 
     @Override
     public BaseDAO<Long, FinancialExpenditure> getDAO() {
@@ -217,7 +223,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void syncOaPayLog(Integer workOrderId) {
+    public void syncOaPayLog(Integer workOrderId,String fileUrl) throws Exception {
         PWorkOrderInfo pWorkOrderInfo = financialExpenditureDao.getWorkOrderInfo(workOrderId);
         if (pWorkOrderInfo != null){
             Integer hasFinancial = financialExpenditureDao.findByBatchNoAndProcessNo(workOrderId);
@@ -354,25 +360,46 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                 }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;
+                                financialExpenditure.setRefundInstrumentFeeFlag(true);
                             }
                             if(returnFeeType.contains("乐保")){
-                                maintenanceFee = true;
+                                financialExpenditure.setMaintenanceFeeFlag(true);
                             }
                             if(returnFeeType.contains("教辅")){
-                                isRefundTeachingAssistantsFee = true;
+                                financialExpenditure.setRefundTeachingAssistantsFeeFlag(true);
                             }
                         }
-                        musicGroupService.directQuitMusicGroupOa(financialExpenditure.getMusicGroupId(), financialExpenditure.getStudentId(),
-                                financialExpenditure.getCause(), isRefundInstrumentFee,
-                                isRefundTeachingAssistantsFee, maintenanceFee, financialExpenditure.getAmount());
                     }
+                    //处理excel文件
+                    List<FinancialExpenditure> financialExpenditures = new ArrayList<>();
+                    if(StringUtils.isNotEmpty(fileUrl)){
+                        String[] split = fileUrl.split(",");
+                        for (String s : split) {
+                            File file = FileUtils.toFile(new URL(s));
+                            financialExpenditures.addAll(financialExpenditureService.checkOaQuitMusicGroupExcel(FileUtils.readFileToByteArray(file), file.getName()));
+                        }
+                        //去除重复数据
+                        financialExpenditures.removeAll(Collections.singleton(null));
+                        if(CollectionUtils.isNotEmpty(financialExpenditureList)){
+                            for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                                if(financialExpenditures.contains(financialExpenditure)) {
+                                    continue;
+                                }
+                                financialExpenditures.add(financialExpenditure);
+                            }
+                        }
+                    }
+                    for (FinancialExpenditure financialExpenditure : financialExpenditures) {
+                        financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
+                        financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
+                        financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
+                        financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
+                        musicGroupService.directQuitMusicGroupOa(financialExpenditure);
+                    }
+                    financialExpenditureList = financialExpenditures;
                 }
                 financialExpenditureDao.batchInsert(financialExpenditureList);
             }else {
@@ -518,7 +545,58 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
     }
 
     @Override
-    public void checkOaQuitMusicGroupExcel(MultipartFile file) {
-
+    public List<FinancialExpenditure> checkOaQuitMusicGroupExcel(byte[] buf,String filename) throws Exception {
+        Map<String, List<Map<String, Object>>> sheetsListMap = POIUtil.importExcel(new ByteArrayInputStream(buf), 2, filename);
+        InputStream inputStream = new ClassPathResource("columnMapper.ini").getInputStream();
+        Map<String, String> columns = IniFileUtil.readIniFile(inputStream, TemplateTypeEnum.OA_QUIT_MUSIC_GROUP.getMsg());
+        List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
+        List<Organization> organs = organizationDao.findAllOrgans(1);
+        Map<String, List<Organization>> collect = organs.stream().collect(Collectors.groupingBy(Organization::getName));
+        for (String e : sheetsListMap.keySet()) {
+            List<Map<String, Object>> sheet = sheetsListMap.get(e);
+            for (Map<String, Object> row : sheet) {
+                if (row.size() == 0) {
+                    continue;
+                }
+                JSONObject objectMap = new JSONObject();
+                for (String s : row.keySet()) {
+                    if (!columns.containsKey(s)) {
+                        continue;
+                    }
+                    String columnValue = columns.get(s);
+                    if(Objects.equals(columnValue,"refundInstrumentFeeFlag")
+                            || Objects.equals(columnValue,"refundTeachingAssistantsFeeFlag")
+                            || Objects.equals(columnValue,"maintenanceFeeFlag")
+                            || Objects.equals(columnValue,"refundCourseFee")){
+                        if(Objects.nonNull(row.get(s))){
+                            objectMap.put(columnValue, Objects.equals("是",row.get(s))?true:false);
+                        }
+                    }else if(Objects.equals(columnValue,"amount")){
+                        objectMap.put(columnValue, Objects.isNull(row.get(s)) || StringUtils.isEmpty(row.get(s).toString())?0:row.get(s));
+                    }else if(Objects.equals(columnValue,"organName")){
+                        if(Objects.isNull(row.get(s)) || StringUtils.isEmpty(row.get(s).toString())){
+                            throw new BizException("乐团退费模板错误: 请录入分部信息");
+                        }
+                        if(!collect.containsKey(row.get(s).toString())){
+                            throw new BizException("乐团退费模板错误: 分部 {} 不存在",row.get(s).toString());
+                        }
+                        objectMap.put("organId",collect.get(row.get(s).toString()).get(0).getId());
+                    }else {
+                        objectMap.put(columnValue, row.get(s));
+                    }
+                }
+                FinancialExpenditure financialExpenditure = JSONObject.parseObject(objectMap.toJSONString(),FinancialExpenditure.class);
+                if(StringUtils.isEmpty(financialExpenditure.getMusicGroupId()) || Objects.isNull(financialExpenditure.getStudentId())){
+                    throw new BizException("乐团退费模板错误: 乐团编号或学员编号不可为空");
+                }
+                financialExpenditureList.add(financialExpenditure);
+            }
+        }
+        if(CollectionUtils.isNotEmpty(financialExpenditureList)){
+            for (FinancialExpenditure financialExpenditure : financialExpenditureList) {
+                musicGroupService.checkDirectQuitMusicGroupOa(financialExpenditure.getMusicGroupId(), financialExpenditure.getStudentId());
+            }
+        }
+        return financialExpenditureList;
     }
 }

+ 11 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2352,7 +2352,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
-                                        boolean isRefundTeachingAssistantsFee, boolean isRefundMemberFee, BigDecimal maintenanceFee, BigDecimal cloudTeacherAmount) {
+                                        boolean isRefundTeachingAssistantsFee, boolean isRefundMemberFee, BigDecimal maintenanceFee) {
 
         SysUser sysUser = sysUserFeignService.queryUserById(userId);
         if (sysUser == null) {
@@ -2675,8 +2675,9 @@ 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) {
+    public void directQuitMusicGroupOa(FinancialExpenditure financialExpenditure) {
+        String musicGroupId = financialExpenditure.getMusicGroupId();
+        Integer userId = financialExpenditure.getStudentId();
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         if (musicGroup == null) {
             return;
@@ -2726,7 +2727,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupQuit.setMusicGroupId(musicGroupId);
         musicGroupQuit.setUserId(userId);
         musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
-        musicGroupQuit.setReason(reason);
+        musicGroupQuit.setReason(financialExpenditure.getCause());
         musicGroupQuit.setQuitDate(date);
         musicGroupQuitDao.insert(musicGroupQuit);
 
@@ -2825,12 +2826,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.getWithIds(paymentOrderIdList);
 
             SubjectChange studentLastChange = null;
-            if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
+            if (financialExpenditure.isRefundInstrumentFeeFlag() || financialExpenditure.isRefundTeachingAssistantsFeeFlag()) {
                 studentLastChange = subjectChangeDao.getStudentLastChange(userId, musicGroupId);
             }
 
             if (studentLastChange != null && minPaymentOrderId <= studentLastChange.getOriginalOrderId()) {
-                if (isRefundInstrumentFee) {
+                if (financialExpenditure.isRefundInstrumentFeeFlag()) {
                     StudentInstrument studentMaintenance = studentInstrumentDao.getByOrderId(studentLastChange.getOrderId().longValue());
                     if (studentMaintenance != null) {
                         studentMaintenance.setDelFlag(1);
@@ -2840,7 +2841,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             } else {
                 for (StudentPaymentOrderDetail detail : orderDetailList) {
                     // 退乐器费用
-                    if (isRefundInstrumentFee && detail.getType() == MUSICAL) {
+                    if (financialExpenditure.isRefundInstrumentFeeFlag() && detail.getType() == MUSICAL) {
                         StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
                         if (studentMaintenance != null) {
                             studentMaintenance.setDelFlag(1);
@@ -2852,7 +2853,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         }
         //退乐保费用
-        if (maintenanceFee) {
+        if (financialExpenditure.isMaintenanceFeeFlag()) {
             StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
             if (studentMaintenance != null) {
                 studentMaintenance.setStatus(0);
@@ -2862,14 +2863,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        if (amount.doubleValue() > 0) {
+        if (financialExpenditure.getAmount().doubleValue() > 0) {
             //这个接口没有退费的操作了
             SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
             sysUserCashAccountLog.setGroupType(GroupType.MUSIC);
             sysUserCashAccountLog.setUserId(userId);
             sysUserCashAccountLog.setOrganId(musicGroup.getOrganId());
             sysUserCashAccountLog.setGroupId(musicGroupId);
-            sysUserCashAccountLog.setAmount(amount);
+            sysUserCashAccountLog.setAmount(financialExpenditure.getAmount());
             sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.MUSIC);
             sysUserCashAccountLog.setComment("OA审批退团");
             sysUserCashAccountLogDao.insert(sysUserCashAccountLog);

+ 35 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ImportController.java

@@ -7,16 +7,19 @@ import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.AppRedemptionCode;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
-import com.ym.mec.biz.service.FinancialExpenditureService;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.biz.service.AppRedemptionCodeService;
-import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.util.date.DateUtil;
+import com.ym.mec.util.upload.UploadUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
+import org.redisson.liveobject.resolver.UUIDGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -24,11 +27,11 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
 @RequestMapping("import")
 @Api(tags = "数据导入服务")
@@ -45,6 +48,8 @@ public class ImportController extends BaseController {
     private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
     @Autowired
     private AppRedemptionCodeService appRedemptionCodeService;
+    @Autowired
+    private UploadFileService uploadFileService;
 
 
     @ApiOperation(value = "导入商品")
@@ -86,11 +91,29 @@ public class ImportController extends BaseController {
         return studentPaymentRouteOrderService.importRouteOrder(file);
     }
 
-    @ApiOperation(value = "校验oa退团excel")
-    @PostMapping(value = "checkOaQuitMusicGroupExcel")
-    @PreAuthorize("@pcs.hasPermissions('import/checkOaQuitMusicGroupExcel')")
-    public HttpResponseResult checkOaQuitMusicGroupExcel(@RequestParam("file") MultipartFile file) throws Exception {
-        return financialExpenditureService.checkOaQuitMusicGroupExcel(file);
+    @PostMapping(value = "oaUploadFile")
+    public Object uploadFile(@ApiParam(value = "上传的文件", required = true) @RequestParam("file") MultipartFile file,Integer processId) throws Exception {
+        if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {
+            String filename = file.getOriginalFilename();
+            String prefix = filename.substring(filename.lastIndexOf("."));
+            File excelFile = File.createTempFile(UUID.randomUUID().toString(), prefix);
+            file.transferTo(excelFile);
+            //如果是乐团退费,校验excel
+            if(processId != null && processId.equals(19)){
+                financialExpenditureService.checkOaQuitMusicGroupExcel(FileUtils.readFileToByteArray(excelFile),filename);
+            }
+            UploadReturnBean bean = uploadFileService.uploadFile(FileUtils.openInputStream(excelFile), UploadUtil.getExtension(filename));
+            bean.setName(file.getOriginalFilename());
+            if (bean.isStatus()) {
+                return succeed(bean);
+            }
+            //删除临时文件
+            if (excelFile.exists()) {
+                excelFile.delete();
+            }
+            return failed(bean.getMessage());
+        }
+        return failed("上传失败");
     }
 
     @ApiOperation(value = "下载导入模板")

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

@@ -215,7 +215,6 @@ public class MusicGroupQuitController extends BaseController {
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "reason", value = "原因", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "isRefundMemberFee", value = "是否退还云教练费用", required = true, dataType = "Boolean"),
             @ApiImplicitParam(name = "isRefundCourseFee", value = "是否退还课程费用", required = true, dataType = "Boolean"),
             @ApiImplicitParam(name = "isRefundInstrumentFee", value = "是否退还乐器费用(租金)", required = true, dataType = "Boolean"),
             @ApiImplicitParam(name = "isRefundTeachingAssistantsFee", value = "是否退还教辅费用", required = true, dataType = "Boolean"),
@@ -223,8 +222,8 @@ public class MusicGroupQuitController extends BaseController {
     })
     public HttpResponseResult directQuitMusicGroup(String musicGroupId, Integer userId, String reason, boolean isRefundCourseFee,
                                                    boolean isRefundInstrumentFee, boolean isRefundTeachingAssistantsFee,boolean isRefundMemberFee,
-                                                   BigDecimal maintenanceFee, BigDecimal cloudTeacherAmount) throws Exception {
+                                                   BigDecimal maintenanceFee) throws Exception {
         return succeed(musicGroupService.directQuitMusicGroup(musicGroupId, userId, reason, isRefundCourseFee, isRefundInstrumentFee,
-                isRefundTeachingAssistantsFee,isRefundMemberFee, maintenanceFee, cloudTeacherAmount));
+                isRefundTeachingAssistantsFee,isRefundMemberFee, maintenanceFee));
     }
 }

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

@@ -34,8 +34,8 @@ public class OaContractsController extends BaseController {
 
     @PostMapping("oa/syncPayLog")
     @ApiOperation("同步oa审批到支出记录")
-    public HttpResponseResult syncOaPayLog(Integer workOrderId) {
-        financialExpenditureService.syncOaPayLog(workOrderId);
+    public HttpResponseResult syncOaPayLog(Integer workOrderId,String fileUrl) throws Exception {
+        financialExpenditureService.syncOaPayLog(workOrderId,fileUrl);
         return succeed();
     }
 

+ 4 - 4
mec-web/src/main/resources/columnMapper.ini

@@ -46,14 +46,14 @@
 
 
 [乐团退费模板]
-学员编号 = userId
+学员编号 = studentId
 乐团编号 = musicGroupId
-退还乐器费用 = refundInstrumentFeeFlag
+分部 = organName
 退还辅件费用 = refundTeachingAssistantsFeeFlag
 退还乐保费用 = maintenanceFeeFlag
 退还课程费用 = refundCourseFee
-申请退款金额(元) = amount
-退费说明 = reason
+退款金额(元) = amount
+情况说明 = cause
 
 [兑换码分配模板表]
 代码 = code