|
@@ -9,6 +9,7 @@ import com.lc.ibps.api.base.query.QueryOP;
|
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
|
import com.lc.ibps.base.core.exception.BaseException;
|
|
import com.lc.ibps.base.core.exception.BaseException;
|
|
|
import com.lc.ibps.base.core.monitor.StopWatchUtil;
|
|
import com.lc.ibps.base.core.monitor.StopWatchUtil;
|
|
|
|
|
+import com.lc.ibps.base.core.util.AppUtil;
|
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
import com.lc.ibps.base.core.util.I18nUtil;
|
|
import com.lc.ibps.base.core.util.I18nUtil;
|
|
|
import com.lc.ibps.base.core.util.string.StringUtil;
|
|
import com.lc.ibps.base.core.util.string.StringUtil;
|
|
@@ -18,6 +19,7 @@ import com.lc.ibps.base.db.model.DefaultQueryFilter;
|
|
|
import com.lc.ibps.base.db.mybatis.domain.DefaultPage;
|
|
import com.lc.ibps.base.db.mybatis.domain.DefaultPage;
|
|
|
import com.lc.ibps.base.db.tenant.utils.TenantUtil;
|
|
import com.lc.ibps.base.db.tenant.utils.TenantUtil;
|
|
|
import com.lc.ibps.base.framework.id.UniqueIdUtil;
|
|
import com.lc.ibps.base.framework.id.UniqueIdUtil;
|
|
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
import com.lc.ibps.base.saas.context.TenantContext;
|
|
import com.lc.ibps.base.saas.context.TenantContext;
|
|
|
import com.lc.ibps.base.web.context.ContextUtil;
|
|
import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
import com.lc.ibps.base.web.context.RequestContext;
|
|
import com.lc.ibps.base.web.context.RequestContext;
|
|
@@ -51,6 +53,7 @@ import com.lc.ibps.org.party.persistence.entity.*;
|
|
|
import com.lc.ibps.org.party.repository.*;
|
|
import com.lc.ibps.org.party.repository.*;
|
|
|
import com.lc.ibps.org.spi.SpiUserService;
|
|
import com.lc.ibps.org.spi.SpiUserService;
|
|
|
import com.lc.ibps.org.spi.SpiUserServiceUtil;
|
|
import com.lc.ibps.org.spi.SpiUserServiceUtil;
|
|
|
|
|
+import com.lc.ibps.platform.service.DesktopFacadeService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -102,6 +105,8 @@ public class DesktopFacadeProvider extends GenericProvider implements IDesktopFa
|
|
|
private InnerMessageRepository innerMessageRepository;
|
|
private InnerMessageRepository innerMessageRepository;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PartyUserNavigateRepository userNavigateRepository;
|
|
private PartyUserNavigateRepository userNavigateRepository;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICommonDao<?> commonDao;
|
|
|
@Resource
|
|
@Resource
|
|
|
private PartyEntityRepository partyEntityRepository;
|
|
private PartyEntityRepository partyEntityRepository;
|
|
|
|
|
|
|
@@ -244,11 +249,17 @@ public class DesktopFacadeProvider extends GenericProvider implements IDesktopFa
|
|
|
try {
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String currentDate = sdf.format(new Date());
|
|
String currentDate = sdf.format(new Date());
|
|
|
|
|
+ DesktopFacadeService desktopFacadeService = AppUtil.getBean(DesktopFacadeService.class);
|
|
|
List<PartyUserCalendarPo> calendarPoList = calendarRepository.findByUserId(ContextUtil.getCurrentUserId());
|
|
List<PartyUserCalendarPo> calendarPoList = calendarRepository.findByUserId(ContextUtil.getCurrentUserId());
|
|
|
for (PartyUserCalendarPo bean : calendarPoList){
|
|
for (PartyUserCalendarPo bean : calendarPoList){
|
|
|
if (BeanUtils.isEmpty(bean.getMarkDate()) || !bean.getMarkDate().equals(currentDate)){
|
|
if (BeanUtils.isEmpty(bean.getMarkDate()) || !bean.getMarkDate().equals(currentDate)){
|
|
|
bean.setPopUp(1);// 标记为弹窗提醒
|
|
bean.setPopUp(1);// 标记为弹窗提醒
|
|
|
}
|
|
}
|
|
|
|
|
+ String flag = desktopFacadeService.chargeExamPassingStatus(bean.getDataSourceId());
|
|
|
|
|
+ if("pass".equals(flag)){
|
|
|
|
|
+ logger.warn("已限制时间考试id{},已通过取消弹窗提醒",bean.getDataSourceId());
|
|
|
|
|
+ bean.setPopUp(0);// 取消弹窗提醒
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
result.setData(calendarPoList);
|
|
result.setData(calendarPoList);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -257,6 +268,41 @@ public class DesktopFacadeProvider extends GenericProvider implements IDesktopFa
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public String chargeExamPassingStatus(String dataSourceId) {
|
|
|
|
|
+ //List<Map<String,Object>> list = desktopFacadeDao.selectExamViewInfo(dataSourceId);
|
|
|
|
|
+ String sql = " select * from v_examination ;";
|
|
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
|
|
+ return "empt";//未发布考试或者非考试弹窗
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, Object> record = list.get(0);
|
|
|
|
|
+ String flag ="NotExaminedStatus";//考试已发布但是未考试完成状态
|
|
|
|
|
+ // 获取字段
|
|
|
|
|
+ Object limitDateObj = record.get("limitDate");
|
|
|
|
|
+ String examState = (String) record.get("examState");
|
|
|
|
|
+ String paperState = (String) record.get("paperState");
|
|
|
|
|
+ // 检查条件
|
|
|
|
|
+ if (limitDateObj != null && !limitDateObj.toString().isEmpty() && "已发布".equals(examState) && "已完成".equals(paperState)) {
|
|
|
|
|
+ // 获取分数相关字段
|
|
|
|
|
+ Number totalScore = (Number) record.get("totalScore");
|
|
|
|
|
+ Number qualifiedRadio = (Number) record.get("qualifiedRadio");
|
|
|
|
|
+ String scoringType = (String) record.get("scoringType");
|
|
|
|
|
+ Number curScore = null;
|
|
|
|
|
+ if ("平均分".equals(scoringType)) {
|
|
|
|
|
+ curScore = (Number) record.get("averageScore");
|
|
|
|
|
+ } else if ("最高分".equals(scoringType)) {
|
|
|
|
|
+ curScore = (Number) record.get("maxScore");
|
|
|
|
|
+ } else if ("最近得分".equals(scoringType)) {
|
|
|
|
|
+ curScore = (Number) record.get("recentScore");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (totalScore != null && qualifiedRadio != null && curScore != null) {
|
|
|
|
|
+ double passScore = totalScore.doubleValue() * qualifiedRadio.doubleValue() / 100.0;
|
|
|
|
|
+ return curScore.doubleValue() >= passScore?flag="pass":"failure";//pass 考试已通过
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return flag;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "批量删除用户日历日程", notes = "批量删除用户日历日程")
|
|
@ApiOperation(value = "批量删除用户日历日程", notes = "批量删除用户日历日程")
|
|
|
@Override
|
|
@Override
|
|
|
public APIResult<Void> removeCalendar(
|
|
public APIResult<Void> removeCalendar(
|