|
@@ -16,6 +16,7 @@ import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.ReturnFeeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.TenantOrderRecordEnum;
|
|
|
import com.ym.mec.biz.dal.page.CloudTeacherOrderQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
@@ -40,6 +41,8 @@ import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.ym.mec.biz.dal.enums.GroupType.GOODS_SELL;
|
|
|
+import static com.ym.mec.biz.dal.enums.GroupType.MEMBER;
|
|
|
import static com.ym.mec.biz.dal.enums.PeriodEnum.*;
|
|
|
|
|
|
@Service
|
|
@@ -71,6 +74,9 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserCashAccountLogService sysUserCashAccountLogService;
|
|
|
+
|
|
|
@Override
|
|
|
public BaseDAO<Long, CloudTeacherOrder> getDAO() {
|
|
|
return cloudTeacherOrderDao;
|
|
@@ -393,12 +399,25 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
|
|
|
throw new BizException("未指定删除云教练");
|
|
|
}
|
|
|
|
|
|
- List<Long> idList = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList());
|
|
|
+ List<Integer> idList = Arrays.stream(ids.split(",")).map(Integer::valueOf).collect(Collectors.toList());
|
|
|
int cancelNum = cloudTeacherOrderDao.cancelInactiveCloudTeacher(idList, cloudTeacherCancel.getCancelReason(),
|
|
|
sysUser.getId(), new Date(), tenantId);
|
|
|
if (cancelNum != idList.size()) {
|
|
|
throw new BizException("数据已更新,请刷新后重试");
|
|
|
}
|
|
|
+ List<CloudTeacherOrder> cloudTeacherOrders = cloudTeacherOrderDao.queryCloudTeacherOrderByIds(idList);
|
|
|
+ cloudTeacherOrders.stream().filter(next -> next.getAmount().compareTo(new BigDecimal(0)) != 0).forEach(next -> {
|
|
|
+ SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
|
|
|
+ sysUserCashAccountLog.setReturnFeeType(ReturnFeeEnum.MEMBER);
|
|
|
+ sysUserCashAccountLog.setOrganId(next.getOrganId());
|
|
|
+ sysUserCashAccountLog.setUserId(next.getStudentId());
|
|
|
+ sysUserCashAccountLog.setGroupType(MEMBER);
|
|
|
+ sysUserCashAccountLog.setComment(ReturnFeeEnum.MEMBER.getMsg());
|
|
|
+ sysUserCashAccountLog.setGroupId(String.valueOf(next.getId()));
|
|
|
+ sysUserCashAccountLog.setAmount(next.getRefundAmount());
|
|
|
+ sysUserCashAccountLogService.insert(sysUserCashAccountLog);
|
|
|
+ });
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
}
|