|
@@ -0,0 +1,48 @@
|
|
|
+package com.boman.web.core.service.attendance;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.boman.common.core.utils.DateUtils;
|
|
|
+import com.boman.web.core.service.common.ICommonService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
|
|
|
+import static com.boman.domain.constant.AttendanceConst.ATTENDANCE_NOW_TIME;
|
|
|
+import static com.boman.domain.constant.AttendanceConst.ATTENDANCE_USER_NAME;
|
|
|
+/**
|
|
|
+ * @author shiqian
|
|
|
+ * @date 2021年06月03日 15:45
|
|
|
+ **/
|
|
|
+@Service
|
|
|
+public class AttendanceServiceImpl implements AttendanceService {
|
|
|
+
|
|
|
+ private static final Logger LOGGER = LoggerFactory.getLogger(AttendanceServiceImpl.class);
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ICommonService commonService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 功能描述: 根据tableName和userId查找当月考勤
|
|
|
+ *
|
|
|
+ * @param tableName tableName
|
|
|
+ * @param userName userName
|
|
|
+ * @return java.util.List<com.alibaba.fastjson.JSONObject>
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<JSONObject> listByUserName(String tableName, Long userName) {
|
|
|
+ requireNonNull(tableName, "tableName is empty");
|
|
|
+ requireNonNull(userName, "userName is empty");
|
|
|
+
|
|
|
+ String yyyyMm = DateUtils.getYyyyMm();
|
|
|
+ JSONObject map = new JSONObject(2);
|
|
|
+ map.put(ATTENDANCE_USER_NAME, userName);
|
|
|
+ map.put(ATTENDANCE_NOW_TIME, yyyyMm);
|
|
|
+ return commonService.getByMap(tableName, map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|