钉钉考勤
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.entity.ShopConfig;
|
||||
import com.czg.account.service.ShopConfigService;
|
||||
import com.czg.market.dto.AttendanceConfigDTO;
|
||||
import com.czg.market.service.AttendanceService;
|
||||
import com.czg.market.vo.DingAttendanceStatsVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 考勤打卡数据
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/attendance")
|
||||
public class AttendanceController {
|
||||
@Resource
|
||||
private AttendanceService attendanceService;
|
||||
@DubboReference
|
||||
private ShopConfigService shopConfigService;
|
||||
|
||||
/**
|
||||
* 配置获取
|
||||
* @return 配置信息
|
||||
*/
|
||||
@GetMapping("/config")
|
||||
public CzgResult<ShopConfig> getConfig() {
|
||||
return CzgResult.success(shopConfigService.getById(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配置
|
||||
*/
|
||||
@PutMapping("/config")
|
||||
public CzgResult<Boolean> editConfig(@Validated @RequestBody AttendanceConfigDTO dto) {
|
||||
return CzgResult.success(shopConfigService.editConfig(StpKit.USER.getShopId(), BeanUtil.copyProperties(dto, ShopConfig.class)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param page 开始页码
|
||||
* @param size 数量
|
||||
* @param name 姓名
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<ArrayList<DingAttendanceStatsVO>> getList(@RequestParam Integer page, @RequestParam Integer size,
|
||||
@RequestParam(required = false) String name, @RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(attendanceService.list(StpKit.USER.getShopId(), page, size, name, startTime, endTime));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user