| | |
| | | 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.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.dtos.grid.ComActEasyPhotoAddDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.dao.UnionReportMapper; |
| | | import com.panzhihua.service_equipment.dao.UnionUserMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionOutdoorSite; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | import com.panzhihua.service_equipment.service.UnionReportService; |
| | | import com.panzhihua.service_equipment.service.UnionUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | @Slf4j |
| | |
| | | public R add(UnionReportDto unionReportDto) { |
| | | UnionReport unionReport = new UnionReport(); |
| | | BeanUtils.copyProperties(unionReportDto, unionReport); |
| | | UnionUser unionUser = unionUserMapper |
| | | .selectOne(new QueryWrapper<UnionUser>().eq("user_id", unionReport.getCreateUserId())); |
| | | UnionUser unionUser=null; |
| | | if (unionReportDto.getIsApplets().equals(1)) |
| | | { |
| | | unionUser = unionUserMapper |
| | | .selectOne(new QueryWrapper<UnionUser>().eq("user_id", unionReportDto.getCreateUserId())); |
| | | }else if (unionReportDto.getIsApplets().equals(3)) { |
| | | unionUser = unionUserMapper |
| | | .selectOne(new QueryWrapper<UnionUser>().eq("id", unionReportDto.getCreateUnionUserId())); |
| | | } |
| | | if (unionUser!=null) |
| | | unionReport.setCreateUnionUserId(unionUser.getId()); |
| | | unionReport.setStatus(1); |
| | |
| | | Page page = new Page(unionReportDto.getPageNum(), unionReportDto.getPageSize()); |
| | | QueryWrapper<UnionReport> unionOutdoorLaborDynamicQueryWrapper = new QueryWrapper<>(); |
| | | if (unionReportDto.getIsApplets().equals(1)){ |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("create_user_id",unionReportDto.getCreateUserId()); |
| | | if (unionReportDto.getType()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("type",unionReportDto.getType()); |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("create_user_id",unionReportDto.getCreateUserId()).eq("type",2); |
| | | if (unionReportDto.getStatus()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("status",unionReportDto.getStatus()); |
| | | }else if(unionReportDto.getIsApplets().equals(3)){ |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("create_union_user_id",unionReportDto.getCreateUnionUserId()).eq("type",2); |
| | | if (unionReportDto.getStatus()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("status",unionReportDto.getStatus()); |
| | | } |
| | | Page pageResult = baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper); |
| | | pageResult.setTotal(pageResult.getRecords().size()); |