|
@@ -14,11 +14,12 @@ import org.springframework.stereotype.Service;
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
import me.chanjar.weixin.cp.bean.oa.WxCpCheckinOption;
|
|
|
+import me.chanjar.weixin.cp.bean.oa.WxCpCheckinOption.CheckinDate;
|
|
|
import me.chanjar.weixin.cp.bean.oa.WxCpCheckinOption.CheckinTime;
|
|
|
|
|
|
@Service
|
|
|
public class WxCheckOptionService extends BaseService {
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private WxUserService wxUserService;
|
|
|
|
|
@@ -30,9 +31,11 @@ public class WxCheckOptionService extends BaseService {
|
|
|
for (String key : map.keySet()) {
|
|
|
List<WxCpCheckinOption> options = WXCpOaUtil.getCheckinOption(datetimes, map.get(key));
|
|
|
for (WxCpCheckinOption option : options) {
|
|
|
- if (option.getGroup() != null && !option.getGroup().getCheckinDate().isEmpty()) {
|
|
|
+ List<CheckinDate> checkinDate = option.getGroup().getCheckinDate();
|
|
|
+ if (option.getGroup() != null && !checkinDate.isEmpty()
|
|
|
+ && checkinDate.get(0).getCheckinTime().length > 0) {
|
|
|
SapCheckOption check = new SapCheckOption();
|
|
|
- CheckinTime checkinTime = option.getGroup().getCheckinDate().get(0).getCheckinTime()[0];
|
|
|
+ CheckinTime checkinTime = checkinDate.get(0).getCheckinTime()[0];
|
|
|
check.setUserId(option.getUserId());
|
|
|
check.setWorkSec(checkinTime.getWorkSec());
|
|
|
check.setOffWorkSec(checkinTime.getOffWorkSec());
|
|
@@ -41,7 +44,7 @@ public class WxCheckOptionService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void save(SapCheckOption check) throws Exception {
|
|
|
save("SapCheckOptionMapper.save", check);
|
|
|
}
|