Commit ed8d3c01 authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyPersonController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/IDutyCommonService.java
parents 3e3a8108 e1200d1d
......@@ -117,9 +117,9 @@ public class DutyCarController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "车辆执勤导出", notes = "车辆执勤导出")
public void exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
iDutyCarService.downloadList(beginDate, endDate, response);
return ResponseHelper.buildResponse(iDutyCarService.downloadList(beginDate, endDate));
}
/**
......@@ -143,4 +143,4 @@ public class DutyCarController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyCarService.dayDutyPersonList(dutyDay,shiftId,postType));
}
}
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
......@@ -120,12 +121,25 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.deleteDutyData(instanceId));
}
/**
* 人员执勤导出
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "人员执勤导出", notes = "人员执勤导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.downloadList(beginDate, endDate));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定日期值班人信息列表")
@GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay,shiftId,postType));
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType));
}
}
package com.yeejoin.amos.boot.module.common.biz.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
......@@ -48,7 +46,7 @@ public interface IDutyCommonService {
*/
String getGroupCode();
void downloadList(String beginDate, String endDate, HttpServletResponse response) throws ParseException;
List downloadList(String beginDate, String endDate) throws ParseException;
/**
* 值班数据入库
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
......@@ -177,30 +180,19 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
@Override
public void downloadList(String beginDate, String endDate, HttpServletResponse response) throws ParseException {
public List downloadList(String beginDate, String endDate) throws ParseException {
List<Map<String, Object>> maps = this.list(beginDate, endDate);
JSONArray jsonArray = new JSONArray();
jsonArray.addAll(maps);
List<?> list = new ArrayList<>();
String groupCode = this.getGroupCode();
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
Date d = sdf.parse(beginDate);
Calendar calendar = Calendar.getInstance();
calendar.setTime(d);
List<String> dayByMonth = DateUtils.getDayByMonth(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH));
List<Map<String, Object>> contentList = new ArrayList<>();
String fileName;
if (0 < maps.size()) {
for (Map<String, Object> map : maps) {
}
}
if ("dutyCar".equals(groupCode)) {
fileName = "车辆执勤值班表";
list = jsonArray.toJavaList(DutyCarDto.class);
} else {
fileName = "消防人员值班表";
list = jsonArray.toJavaList(DutyPersonDto.class);
}
// Workbook workbook = initExcel(appKey, orgCode, getTitleMap(year, mouth), contentList);
// ExcelUtils.exportExcel(workbook, fileName, response);
return list;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment