| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.partybuilding.NeedProblemInventoryDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.NeedProblemUnitTaskDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiExperienceActivityVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_dangjian.dao.NeedProblemUnitTaskDAO; |
| | | import com.panzhihua.service_dangjian.service.NeedProblemInventoryService; |
| | | import com.panzhihua.service_dangjian.service.NeedProblemUnitTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | public class NeedProblemUnitTaskServiceImpl extends ServiceImpl<NeedProblemUnitTaskDAO, NeedProblemUnitTaskDTO> |
| | | implements NeedProblemUnitTaskService |
| | | { |
| | | |
| | | //任务 问题接口 |
| | | @Resource |
| | | private NeedProblemInventoryService inventoryService; |
| | | |
| | | @Override |
| | | public IPage<NeedProblemUnitTaskDTO> getList(int pageNum, int pageSize, String unitId,String kind,String status) |
| | |
| | | @Override |
| | | public R addData(NeedProblemUnitTaskDTO item) |
| | | { |
| | | //任务问题详情 |
| | | NeedProblemInventoryDTO inventoryDTO=inventoryService.getDetails(item.getTaskId(),item.getUserId()); |
| | | long times=System.currentTimeMillis(); |
| | | if(times<inventoryDTO.getClaimStartTime().getTime()) |
| | | { |
| | | return R.fail("报名未开始"); |
| | | } |
| | | |
| | | if(StringUtils.equals(inventoryDTO.getJoinNum(),inventoryDTO.getClaimNum())) |
| | | { |
| | | return R.fail("认领人数已满"); |
| | | } |
| | | |
| | | if(times>inventoryDTO.getClaimEndTime().getTime()) |
| | | { |
| | | return R.fail("报名已结束"); |
| | | } |
| | | int num=baseMapper.isGet(item.getTaskId(),item.getUnitId()); |
| | | if(num>0) |
| | | { |