|
@@ -35,9 +35,9 @@ public class WxCheckOptionService extends BaseService {
|
|
|
if (option.getGroup() != null && !checkinDate.isEmpty()
|
|
|
&& checkinDate.get(0).getCheckinTime().length > 0) {
|
|
|
SapCheckOption check = selectByUserId(option.getUserId());
|
|
|
+ CheckinTime checkinTime = checkinDate.get(0).getCheckinTime()[0];
|
|
|
if (check == null) {
|
|
|
check = new SapCheckOption();
|
|
|
- CheckinTime checkinTime = checkinDate.get(0).getCheckinTime()[0];
|
|
|
check.setUserId(option.getUserId());
|
|
|
check.setWorkSec(checkinTime.getWorkSec());
|
|
|
check.setWorkTime(DateUtil.secToTime(check.getWorkSec().intValue()));
|
|
@@ -45,6 +45,14 @@ public class WxCheckOptionService extends BaseService {
|
|
|
check.setOffWorkTime(DateUtil.secToTime(check.getOffWorkSec().intValue()));
|
|
|
check.setNoNeedOffwork(checkinDate.get(0).getNoNeedOffwork());
|
|
|
save(check);
|
|
|
+ } else {
|
|
|
+ check.setUserId(option.getUserId());
|
|
|
+ check.setWorkSec(checkinTime.getWorkSec());
|
|
|
+ check.setWorkTime(DateUtil.secToTime(check.getWorkSec().intValue()));
|
|
|
+ check.setOffWorkSec(checkinTime.getOffWorkSec());
|
|
|
+ check.setOffWorkTime(DateUtil.secToTime(check.getOffWorkSec().intValue()));
|
|
|
+ check.setNoNeedOffwork(checkinDate.get(0).getNoNeedOffwork());
|
|
|
+ update(check);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -54,6 +62,10 @@ public class WxCheckOptionService extends BaseService {
|
|
|
public void save(SapCheckOption check) throws Exception {
|
|
|
save("SapCheckOptionMapper.save", check);
|
|
|
}
|
|
|
+
|
|
|
+ public void update(SapCheckOption check) throws Exception {
|
|
|
+ save("SapCheckOptionMapper.update", check);
|
|
|
+ }
|
|
|
|
|
|
public SapCheckOption selectByUserId(String userId) throws Exception {
|
|
|
return (SapCheckOption) findObject("SapCheckOptionMapper.selectByUserId", userId);
|