Commit 44d2a378 authored by suhuiguang's avatar suhuiguang

1.交接班记录

parent 572b0d5b
......@@ -53,4 +53,10 @@ public interface IShiftChangeService {
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> queryForShiftChangeList();
/**
* 最近交班记录
* @return Map<String, Object>
*/
Map<String, Object> lastRecord();
}
......@@ -143,4 +143,5 @@ 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
......@@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletResponse;
*/
@RestController
@Api(tags = "交接班记录表Api")
@RequestMapping(value = "/jcs/shift-change")
@RequestMapping(value = "/shift-change")
public class ShiftChangeController extends BaseController {
@Autowired
......@@ -98,9 +98,17 @@ public class ShiftChangeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "pdf下载", notes = "pdf下载")
@PostMapping("/pdf/export")
public void exportPdf(HttpServletResponse response,Long shiftChangeId){
@ApiOperation(httpMethod = "GET", value = "pdf下载", notes = "pdf下载")
@GetMapping("/pdf/export")
public void exportPdf(HttpServletResponse response,@RequestParam Long shiftChangeId){
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "上次最新记录", notes = "上次最新记录")
@GetMapping("/lastRecord")
public ResponseModel lastRecord(){
return ResponseHelper.buildResponse(iShiftChangeService.lastRecord());
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
......@@ -16,6 +17,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
......@@ -45,6 +48,8 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
Long instanceId = dynamicFormInstanceService.commonSave(GROUP_CODE, model);
ShiftChange shiftChange = (ShiftChange) Bean.mapToBean(model, ShiftChange.class);
shiftChange.setInstanceId(instanceId);
shiftChange.setDutyJson(shiftChange.getDutyJson() == null ? new JSONObject() : shiftChange.getDutyJson());
shiftChange.setPowerJson(shiftChange.getPowerJson() == null ? new JSONObject() : shiftChange.getPowerJson());
this.save(shiftChange);
return model;
}
......@@ -96,4 +101,13 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
});
return list;
}
@Override
public Map<String, Object> lastRecord() {
List<Map<String, Object>> list = dynamicFormInstanceService.listAll(GROUP_CODE);
list = list.stream().sorted(Comparator.comparing(e->e.get("instanceId"), Comparator.comparingLong(s -> -Long.parseLong(s.toString())))).collect(Collectors.toList());
Map<String, Object> map = new HashMap<>();
map = list.isEmpty() ? map : list.get(0);
return map;
}
}
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