lidongdong
2024-09-20 2a0ddb202b816ba0e05240b210ad8231a70edffa
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemClaimServiceImpl.java
@@ -4,6 +4,7 @@
import com.panzhihua.common.model.dtos.partybuilding.NeedProblemClaimDTO;
import com.panzhihua.common.model.dtos.partybuilding.NeedProblemInventoryDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActActRegistVO;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_dangjian.dao.NeedProblemClaimDAO;
@@ -14,6 +15,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -232,16 +234,34 @@
            {
                NeedProblemInventoryDTO comActActivityDO=baseMapper.getActivityEndTime(aId);
                if(comActActivityDO!=null)
                {
                if(comActActivityDO.getNeedEndTime().getTime()<new Date().getTime())
                {
                    List<String> timeList=baseMapper.getNotTimeId(aId);
                    for (String user:timeList)
                        List<NeedProblemClaimDTO> timeList=baseMapper.getNotTimeId(aId);
                        for (NeedProblemClaimDTO user:timeList)
                    {
                        long time=comActActivityDO.getNeedEndTime().getTime()-comActActivityDO.getNeedStartTime().getTime();
                        baseMapper.updateEndTime(user,time+"",comActActivityDO.getNeedEndTime());
                            baseMapper.updateEndTime(user.getId(),time+"",comActActivityDO.getNeedEndTime());
                    }
                }
            }
                else
                {
                    List<NeedProblemClaimDTO> timeList=baseMapper.getNotTimeId(aId);
                    for (NeedProblemClaimDTO user:timeList)
                    {
                        Calendar calendar = Calendar.getInstance();
                        calendar.setTime(user.getPunchStartTime());
                        calendar.add(Calendar.HOUR_OF_DAY, 3); // 加3小时
                        Date newDate = calendar.getTime();
                        long time=newDate.getTime()-user.getPunchStartTime().getTime();
                        baseMapper.updateEndTime(user.getId(),time+"",newDate);
                    }
                }
            }
        }