Browse Source

【pc端 - 爱心互助-活动管理 】-【添加标题查询功能】-(魏凯)-2020/06/03

feature/dangjian
weikai 6 years ago
parent
commit
df29fa0e6f
  1. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
  2. 9
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java
  3. 23
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  4. 3
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml

13
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java

@ -17,10 +17,8 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
@ -29,21 +27,16 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.dto.ScheduleJobDTO;
import com.elink.esua.epdc.modules.activity.excel.ActInfoExcel;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import com.elink.esua.epdc.modules.feign.JobFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -131,5 +124,9 @@ public class ActInfoController {
List<ActInfoDTO> list = actInfoService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActInfoExcel.class);
}
@GetMapping("/ifTime/{actId}")
public Result<String> ifNowTime(@PathVariable("actId") String actId){
return actInfoService.ifNowTime(actId);
}
}

9
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java

@ -185,4 +185,13 @@ public interface ActInfoService extends BaseService<ActInfoEntity> {
* @date 2020/4/3 9:23
*/
void minusSignUpNum(String actId);
/**
* @Description: 判断活动时间是否已经结束 1 结束 0 还在进行中
* @Param: [actId]
* @return: com.elink.esua.epdc.commons.tools.utils.Result
* @Author: wk
* @Date: 2020/6/3
*/
Result<String> ifNowTime(String actId);
}

23
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java

@ -245,6 +245,29 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
baseDao.minusSignUpNum(actId);
}
/**
* @Description: 判断活动时间是否已经结束 1 结束 0 还在进行中
* @Param: [actId]
* @return: com.elink.esua.epdc.commons.tools.utils.Result<java.lang.String>
* @Author: wk
* @Date: 2020/6/3
*/
@Override
public Result<String> ifNowTime(String actId) {
String returnTime = "0";
//根据活动id查询活动结束时间
ActInfoEntity entity = baseDao.selectById(actId);
Long end = entity.getActEndTime().getTime();
System.out.println(end);
Long now = System.currentTimeMillis();
System.out.println(now);
if (now>end){
returnTime = "1";
}
//获取现在服务器时间并判断活动是否结束
return new Result<String>().ok(returnTime);
}
@Override
public Result<ActInfoDetailAppResultDTO> getDetailByApp(ActInfoAppFormDTO formDto) {
formDto.setTimestamp(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

3
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml

@ -126,6 +126,9 @@
<if test="actStatus != null and actStatus != ''">
AND actInfo.ACT_STATUS = #{actStatus}
</if>
<if test="title != null and title != ''">
AND actInfo.TITLE like '%${title}%'
</if>
ORDER BY
actInfo.CREATED_TIME DESC
</select>

Loading…
Cancel
Save