|
@@ -22,7 +22,9 @@ import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.page.PageUtil;
|
|
|
import com.ym.mec.common.page.WrapperUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+import com.ym.mec.util.excel.POIUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -30,6 +32,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.OutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
@@ -67,7 +72,7 @@ public class TempLittleArtistTrainingCampServiceImpl extends ServiceImpl<TempLit
|
|
|
BeanUtils.copyProperties(dto, entity);
|
|
|
Date now = new Date();
|
|
|
//训练时间必需大于报名时间
|
|
|
- if (dto.getTrainStartDate().getTime() > dto.getApplyStartDate().getTime()) {
|
|
|
+ if (dto.getApplyStartDate().getTime() > dto.getTrainStartDate().getTime()) {
|
|
|
throw new BizException("训练时间必需大于报名时间");
|
|
|
}
|
|
|
entity.setState(TempLittleArtistTrainingCamp.NOT_START);
|
|
@@ -347,6 +352,38 @@ public class TempLittleArtistTrainingCampServiceImpl extends ServiceImpl<TempLit
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//public void exp(Map<String, Object> param, HttpServletResponse response){
|
|
|
+// List<TempCampUserTrainingDetailVo> list = baseMapper.queryUserTrainingDetail(param);
|
|
|
+//
|
|
|
+// OutputStream outputStream = response.getOutputStream();
|
|
|
+// HSSFWorkbook workbook = null;
|
|
|
+// try {
|
|
|
+// String[] header = {"学员编号","学员姓名", "手机号", "群组","打卡天数", "训练时长(分钟)"};
|
|
|
+// String[] body = {"id","username", "phone", " private String imGroupName","title","payStatus==NULL || payStatus==0?'未缴费':payStatus==1?'缴费中':'已缴费'", "userId", "userName", "mobileNo", "subjectName", "brand", "specification","hasInstrumentsId","actualAmount","balance"};
|
|
|
+// workbook = POIUtil.exportExcel(header, body, pageList.getRows());
|
|
|
+// response.setContentType("application/octet-stream");
|
|
|
+// response.setHeader("Content-Disposition", "attachment;filename=replacement-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+// response.flushBuffer();
|
|
|
+// outputStream = response.getOutputStream();
|
|
|
+// workbook.write(outputStream);
|
|
|
+// outputStream.flush();
|
|
|
+// workbook.close();
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// } finally {
|
|
|
+// if (outputStream != null) {
|
|
|
+// try {
|
|
|
+// workbook.close();
|
|
|
+// outputStream.close();
|
|
|
+// } catch (IOException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//}
|
|
|
+
|
|
|
+
|
|
|
private SysUser getUser() {
|
|
|
return Optional.ofNullable(sysUserFeignService.queryUserInfo())
|
|
|
.orElseThrow(() -> new BizException("用户信息获取失败,请刷新页面或者重新登录!"));
|