|
@@ -1,20 +1,118 @@
|
|
|
package com.qmth.sop.server.api;
|
|
|
|
|
|
-
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.annotation.BOOL;
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+import com.qmth.sop.business.bean.result.TBDingCountQueryResult;
|
|
|
+import com.qmth.sop.business.bean.result.TBDingCountResult;
|
|
|
+import com.qmth.sop.business.entity.TBDing;
|
|
|
+import com.qmth.sop.business.entity.TBTask;
|
|
|
+import com.qmth.sop.business.service.TBDingService;
|
|
|
+import com.qmth.sop.business.service.TBTaskService;
|
|
|
+import com.qmth.sop.business.templete.execute.AsyncDingCountExportService;
|
|
|
+import com.qmth.sop.common.contant.SystemConstant;
|
|
|
+import com.qmth.sop.common.enums.TaskTypeEnum;
|
|
|
+import com.qmth.sop.common.util.Result;
|
|
|
+import com.qmth.sop.common.util.ResultUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.validation.constraints.Max;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
/**
|
|
|
- * <p>
|
|
|
- * 考勤打卡表 前端控制器
|
|
|
- * </p>
|
|
|
+ * 考勤打卡表 控制器
|
|
|
*
|
|
|
- * @author wangliang
|
|
|
- * @since 2023-08-01
|
|
|
+ * @author: shudonghui
|
|
|
+ * @date: 2023-08-10 14:23:08
|
|
|
+ * @version: 1.0
|
|
|
+ * @email: shudonghui@qmth.com.cn
|
|
|
+ * @Company: www.qmth.com.cn
|
|
|
*/
|
|
|
+@Api(tags = "考勤打卡表 Controller")
|
|
|
@RestController
|
|
|
-@RequestMapping("/t-bding")
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_DING)
|
|
|
+@Validated
|
|
|
public class TBDingController {
|
|
|
|
|
|
-}
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TBDingService tBDingService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TBTaskService tbTaskService;
|
|
|
+ @Resource
|
|
|
+ AsyncDingCountExportService asyncDingCountExportService;
|
|
|
+
|
|
|
+ @Aac(auth = BOOL.FALSE)
|
|
|
+ @ApiOperation(value = "考勤打卡统计查询接口")
|
|
|
+ @RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "考勤打卡统计查询结果", response = TBDingCountQueryResult.class)})
|
|
|
+ public Result query(
|
|
|
+ @ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
+ @ApiParam(value = "提交状态", required = false) @RequestParam(required = false) String status,
|
|
|
+ @ApiParam(value = "提交人", required = false) @RequestParam(required = false) Long createId,
|
|
|
+ @ApiParam(value = "姓名(模糊查询)", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "供应商", required = false) @RequestParam(required = false) Long supplierId,
|
|
|
+ @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
+ @ApiParam(value = "SOP流水号(模糊查询)", required = false) @RequestParam(required = false) String sopNo,
|
|
|
+ @ApiParam(value = "违规工时", required = false) @RequestParam(required = false) Long days,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBDingCountQueryResult> resultIPage = tBDingService.query(new Page<>(pageNumber, pageSize), serviceId, status, createId, userName, supplierId, custom, sopNo, days);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Aac(auth = BOOL.FALSE)
|
|
|
+ @ApiOperation(value = "考勤打卡统计接口")
|
|
|
+ @RequestMapping(value = "/count", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "考勤打卡统计结果", response = TBDingCountResult.class)})
|
|
|
+ public Result count(@ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
+ @ApiParam(value = "提交人", required = false) @RequestParam(required = false) Long createId,
|
|
|
+ @ApiParam(value = "姓名(模糊查询)", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "供应商", required = false) @RequestParam(required = false) Long supplierId,
|
|
|
+ @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
+ @ApiParam(value = "SOP流水号(模糊查询)", required = false) @RequestParam(required = false) String sopNo
|
|
|
+ ) {
|
|
|
+ TBDingCountResult result = tBDingService.count(serviceId, createId, userName, supplierId, custom, sopNo);
|
|
|
+
|
|
|
+ return ResultUtil.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Aac(auth = BOOL.FALSE)
|
|
|
+ @ApiOperation(value = "考勤打卡统计导出")
|
|
|
+ @RequestMapping(value = "/export", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
|
|
|
+ public Result export(@ApiParam(value = "服务单元", required = false) @RequestParam(required = false) Long serviceId,
|
|
|
+ @ApiParam(value = "提交状态", required = false) @RequestParam(required = false) String status,
|
|
|
+ @ApiParam(value = "提交人", required = false) @RequestParam(required = false) Long createId,
|
|
|
+ @ApiParam(value = "姓名(模糊查询)", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "供应商", required = false) @RequestParam(required = false) Long supplierId,
|
|
|
+ @ApiParam(value = "客户名称(模糊查询)", required = false) @RequestParam(required = false) String custom,
|
|
|
+ @ApiParam(value = "SOP流水号(模糊查询)", required = false) @RequestParam(required = false) String sopNo,
|
|
|
+ @ApiParam(value = "违规工时", required = false) @RequestParam(required = false) Long days) throws Exception {
|
|
|
+ Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.DING_COUNT_EXPORT);
|
|
|
+ map.putIfAbsent("serviceId", serviceId);
|
|
|
+ map.putIfAbsent("status", status);
|
|
|
+ map.putIfAbsent("createId", createId);
|
|
|
+ map.putIfAbsent("userName", userName);
|
|
|
+ map.putIfAbsent("supplierId", supplierId);
|
|
|
+ map.putIfAbsent("custom", custom);
|
|
|
+ map.putIfAbsent("sopNo", sopNo);
|
|
|
+ map.putIfAbsent("days", days);
|
|
|
+ asyncDingCountExportService.exportTask(map);
|
|
|
+ TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
|
|
|
+ return ResultUtil.ok(tbTask.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+}
|